@nettyapps/ntybase 21.0.33 → 21.0.34

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Injectable, inject, NgModule, signal, input, output, computed, effect, ViewChild, model, InjectionToken, Optional, Inject, Input, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
2
+ import { Component, Injectable, inject, NgModule, signal, input, output, computed, effect, ViewChild, model, InjectionToken, Optional, Inject, Input } from '@angular/core';
3
3
  import * as i1$2 from '@angular/common/http';
4
4
  import { HttpErrorResponse, HttpResponse, HTTP_INTERCEPTORS, HttpClient, HttpHeaders } from '@angular/common/http';
5
5
  import { of, throwError, lastValueFrom, map, catchError as catchError$1, Subject, finalize, take as take$1, takeUntil } from 'rxjs';
@@ -4027,101 +4027,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
4027
4027
  type: Input
4028
4028
  }] } });
4029
4029
 
4030
- // Library: @nettyapps/ntybase
4031
- function ntyEnvironmentConfigFactory(envService) {
4032
- // SSR Kontrolü (Node.js tarafında window yoktur)
4033
- if (typeof window !== 'undefined') {
4034
- const cachedConfig = window.__env?.fullConfig;
4035
- if (cachedConfig) {
4036
- return cachedConfig;
4037
- }
4038
- }
4039
- // Bulamazsa servisten al (servis de token'dan aldığı default'u döndürecek)
4040
- return envService.getEnvironment();
4041
- }
4042
-
4043
- function ntyInitializeEnvironment(envLoader) {
4044
- return () => {
4045
- return envLoader.loadEnvironment().then((config) => {
4046
- // Global erişim için (window) ataması
4047
- if (typeof window !== 'undefined') {
4048
- window.__env = window.__env || {};
4049
- window.__env.fullConfig = config;
4050
- }
4051
- return config;
4052
- });
4053
- };
4054
- }
4055
-
4056
- // 1. Bir Token Tanımlayın
4057
- const NETTY_APP_ENVIRONMENT = new InjectionToken('NETTY_APP_ENVIRONMENT');
4058
- class NtyEnvironmentService {
4059
- defaultEnv;
4060
- // 2. Token'ı Inject Edin
4061
- constructor(defaultEnv) {
4062
- this.defaultEnv = defaultEnv;
4063
- }
4064
- async loadEnvironment() {
4065
- if (!window.__env?.nettyUrls) {
4066
- await this.loadEnvScript();
4067
- if (!window.__env?.nettyUrls) {
4068
- throw new Error('env.js not found!');
4069
- }
4070
- }
4071
- return { ...this.defaultEnv, nettyUrls: window.__env.nettyUrls };
4072
- }
4073
- loadEnvScript() {
4074
- return new Promise((resolve, reject) => {
4075
- const script = document.createElement('script');
4076
- script.src = 'assets/env.js';
4077
- script.onload = () => resolve();
4078
- script.onerror = () => reject(new Error('Failed to load env.js'));
4079
- document.head.appendChild(script);
4080
- });
4081
- }
4082
- getEnvironment() {
4083
- return { ...this.defaultEnv, nettyUrls: window.__env.nettyUrls };
4084
- }
4085
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NtyEnvironmentService, deps: [{ token: NETTY_APP_ENVIRONMENT }], target: i0.ɵɵFactoryTarget.Injectable });
4086
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NtyEnvironmentService, providedIn: 'root' });
4087
- }
4088
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NtyEnvironmentService, decorators: [{
4089
- type: Injectable,
4090
- args: [{
4091
- providedIn: 'root',
4092
- }]
4093
- }], ctorParameters: () => [{ type: undefined, decorators: [{
4094
- type: Inject,
4095
- args: [NETTY_APP_ENVIRONMENT]
4096
- }] }] });
4097
-
4098
- /**
4099
- * Uygulamanın environment altyapısını kurar.
4100
- *
4101
- * @usage
4102
- * providers: [
4103
- * provideNettyEnvironment()
4104
- * // Not: { provide: NETTY_APP_ENVIRONMENT, useValue: environment } dışarıdan verilmelidir.
4105
- * ]
4106
- */
4107
- function provideNtyEnvironment() {
4108
- return makeEnvironmentProviders([
4109
- // 1. EnvironmentService'in kendisi (providedIn: 'root' varsa buraya gerek yok ama zararı da yok)
4110
- NtyEnvironmentService,
4111
- // 2. ENVIRONMENT_CONFIG provider'ı
4112
- {
4113
- provide: ENVIRONMENT_CONFIG,
4114
- useFactory: ntyEnvironmentConfigFactory,
4115
- deps: [NtyEnvironmentService],
4116
- },
4117
- // 3. APP_INITIALIZER (Uygulama başlamadan önce env yüklemesi)
4118
- provideAppInitializer(() => {
4119
- const initializerFn = ntyInitializeEnvironment(inject(NtyEnvironmentService));
4120
- return initializerFn();
4121
- }),
4122
- ]);
4123
- }
4124
-
4125
4030
  class NtyLoadingService {
4126
4031
  requestCount = 0;
4127
4032
  isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
@@ -4214,5 +4119,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
4214
4119
  * Generated bundle index. Do not edit.
4215
4120
  */
4216
4121
 
4217
- export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ENVIRONMENT_CONFIG, EnvironmentInfo, EnvironmentInfoService, ExcelImportBase, ForgotPassword, Login, LoginDto, MFACodeDto, MfaLogin, NETTY_APP_ENVIRONMENT, NettyAgGridBase, NettyAgGridSaveBase, NettyAgGridService, NettyAppsBase, NettyBaseApp, NettyHelper, NettyImageService, NettyMenuService, NtyEnvironmentService, NtyLoadingComponent, NtyLoadingInterceptor, Ntybase, NtybaseModule, RangeDateTimeFilter, RangeNumberFilter, RangeStringFilter, UrlHelperService, ntyAuthenticationInterceptor, ntyEnvironmentConfigFactory, ntyInitializeEnvironment, provideNtyEnvironment };
4122
+ export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ENVIRONMENT_CONFIG, EnvironmentInfo, EnvironmentInfoService, ExcelImportBase, ForgotPassword, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridBase, NettyAgGridSaveBase, NettyAgGridService, NettyAppsBase, NettyBaseApp, NettyHelper, NettyImageService, NettyMenuService, NtyLoadingComponent, NtyLoadingInterceptor, Ntybase, NtybaseModule, RangeDateTimeFilter, RangeNumberFilter, RangeStringFilter, UrlHelperService, ntyAuthenticationInterceptor };
4218
4123
  //# sourceMappingURL=nettyapps-ntybase.mjs.map