@ts-core/angular 13.1.16 → 13.1.17

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, ViewContainerRef, Injectable, Directive, Input, Pipe, NgModule, PLATFORM_ID, Inject, InjectionToken, EventEmitter, Output, HostListener, Optional, RendererStyleFlags2, NgModuleFactory } from '@angular/core';
2
+ import { Component, ViewContainerRef, InjectionToken, Injectable, Directive, Input, Pipe, NgModule, PLATFORM_ID, Inject, EventEmitter, Output, HostListener, Optional, RendererStyleFlags2, NgModuleFactory } from '@angular/core';
3
3
  import { DestroyableContainer, PromiseHandler, ExtendedError, LoadableEvent, Destroyable, IDestroyable, DateUtil, ObservableData, ObjectUtil, ArrayUtil, RemoveFilterableCondition, GetFilterableCondition, Logger, LoggerLevel, DataSourceMapCollectionEvent, FilterableDataSourceMapCollection, PaginableDataSourceMapCollection, PaginableBookmarkDataSourceMapCollection, Loadable, LoadableStatus, TransportTimeoutError, TransportNoConnectionError, FilterableMapCollection, MapCollection, TransportEvent, TransportLocal } from '@ts-core/common';
4
4
  import * as _ from 'lodash';
5
5
  import * as i1$1 from '@ts-core/frontend';
@@ -142,6 +142,18 @@ class ViewUtil {
142
142
  }
143
143
  ViewUtil._renderer = value;
144
144
  }
145
+ static get document() {
146
+ if (_.isNil(ViewUtil._document)) {
147
+ throw new ExtendedError(`ViewUtil is not initialized: document in nil`);
148
+ }
149
+ return ViewUtil._document;
150
+ }
151
+ static set document(value) {
152
+ if (value === ViewUtil._document) {
153
+ return;
154
+ }
155
+ ViewUtil._document = value;
156
+ }
145
157
  // --------------------------------------------------------------------------
146
158
  //
147
159
  // Private Methods
@@ -149,7 +161,7 @@ class ViewUtil {
149
161
  // --------------------------------------------------------------------------
150
162
  static copyToClipboard() {
151
163
  try {
152
- document.execCommand('copy');
164
+ ViewUtil.document.execCommand('copy');
153
165
  }
154
166
  catch (error) { }
155
167
  }
@@ -158,9 +170,6 @@ class ViewUtil {
158
170
  // Common Properties
159
171
  //
160
172
  // --------------------------------------------------------------------------
161
- static initialize(renderer) {
162
- ViewUtil._renderer = renderer;
163
- }
164
173
  static parseElement(element) {
165
174
  if (element instanceof HTMLElement) {
166
175
  return element;
@@ -202,7 +211,7 @@ class ViewUtil {
202
211
  else {
203
212
  let selection = window.getSelection();
204
213
  selection.removeAllRanges();
205
- let range = document.createRange();
214
+ let range = ViewUtil.document.createRange();
206
215
  if (!_.isNil(container)) {
207
216
  range.selectNodeContents(container);
208
217
  }
@@ -264,10 +273,10 @@ class ViewUtil {
264
273
  //
265
274
  // --------------------------------------------------------------------------
266
275
  static getStageWidth() {
267
- return window.innerWidth || document.body.clientWidth;
276
+ return window.innerWidth || ViewUtil.document.body.clientWidth;
268
277
  }
269
278
  static getStageHeight() {
270
- return window.innerHeight || document.body.clientHeight;
279
+ return window.innerHeight || ViewUtil.document.body.clientHeight;
271
280
  }
272
281
  static getWidth(container) {
273
282
  container = ViewUtil.parseElement(container);
@@ -671,6 +680,8 @@ class ViewUtil {
671
680
  //
672
681
  // --------------------------------------------------------------------------
673
682
  ViewUtil._renderer = null;
683
+ ViewUtil._document = document;
684
+ const VIEW_UTIL = new InjectionToken('VIEW_UTIL');
674
685
 
675
686
  class ApplicationComponent extends ApplicationBaseComponent {
676
687
  // --------------------------------------------------------------------------
@@ -1785,19 +1796,6 @@ class CookieService extends Cookie.CookieService {
1785
1796
  }
1786
1797
  // --------------------------------------------------------------------------
1787
1798
  //
1788
- // Protected Methods
1789
- //
1790
- // --------------------------------------------------------------------------
1791
- /*
1792
- protected get cookieString(): string {
1793
- return document.cookie || '';
1794
- }
1795
- protected override set cookieString(value: string) {
1796
- document.cookie = value;
1797
- }
1798
- */
1799
- // --------------------------------------------------------------------------
1800
- //
1801
1799
  // Public Methods
1802
1800
  //
1803
1801
  // --------------------------------------------------------------------------
@@ -6896,12 +6894,12 @@ class ThemeModule {
6896
6894
  },
6897
6895
  {
6898
6896
  provide: ThemeService,
6899
- deps: [CookieService, THEME_OPTIONS],
6897
+ deps: [NativeWindowService, CookieService, THEME_OPTIONS],
6900
6898
  useFactory: themeServiceFactory
6901
6899
  },
6902
6900
  {
6903
6901
  provide: ThemeAssetService,
6904
- deps: [ThemeService],
6902
+ deps: [ThemeService, NativeWindowService],
6905
6903
  useFactory: themeAssetServiceFactory
6906
6904
  }
6907
6905
  ]
@@ -6919,11 +6917,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
6919
6917
  exports: declarations
6920
6918
  }]
6921
6919
  }] });
6922
- function themeServiceFactory(cookie, options) {
6920
+ function themeServiceFactory(nativeWindow, cookie, options) {
6923
6921
  if (!_.isNil(options) && _.isNil(options.service)) {
6924
6922
  options.service = cookie;
6925
6923
  }
6926
- return new ThemeService(options);
6924
+ return new ThemeService(nativeWindow, options);
6927
6925
  }
6928
6926
  function themeAssetServiceFactory(theme) {
6929
6927
  return new ThemeAssetService(theme);
@@ -7154,6 +7152,7 @@ class VICommonModule {
7154
7152
  LoadingService,
7155
7153
  PlatformService,
7156
7154
  CanDeactivateGuard,
7155
+ { provide: VIEW_UTIL, useFactory: viewUtilFactory },
7157
7156
  { provide: VI_ANGULAR_OPTIONS, useValue: options || {} },
7158
7157
  { provide: Logger, deps: [VI_ANGULAR_OPTIONS], useFactory: loggerServiceFactory },
7159
7158
  { provide: NativeWindowService, deps: [DOCUMENT], useFactory: nativeWindowServiceFactory },
@@ -7228,6 +7227,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
7228
7227
  }] });
7229
7228
  class IVICommonOptions extends ICookieOptions {
7230
7229
  }
7230
+ function viewUtilFactory(nativeWindow, renderer) {
7231
+ ViewUtil.renderer = renderer;
7232
+ ViewUtil.document = nativeWindow.document;
7233
+ return ViewUtil;
7234
+ }
7231
7235
  function loggerServiceFactory(options) {
7232
7236
  return new DefaultLogger(!_.isNil(options.loggerLevel) ? options.loggerLevel : LoggerLevel.LOG);
7233
7237
  }
@@ -10153,5 +10157,5 @@ class TransportLazyModule {
10153
10157
  * Generated bundle index. Do not edit.
10154
10158
  */
10155
10159
 
10156
- export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetBaseComponent, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, CdkTableBaseComponent, CdkTableCellClassNamePipe, CdkTableCellStyleNamePipe, CdkTableCellValuePipe, CdkTableCellValuePipePure, CdkTableColumnClassNamePipe, CdkTableColumnStyleNamePipe, CdkTableDataSource, CdkTableFilterableComponent, CdkTableFilterableMapCollection, CdkTablePaginableBookmarkComponent, CdkTablePaginableBookmarkMapCollection, CdkTablePaginableComponent, CdkTablePaginableMapCollection, CdkTableRowClassNamePipe, CdkTableRowStyleNamePipe, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVICommonOptions, IWindow, IWindowContent, InfiniteScrollDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageMatPaginatorIntl, LanguageModule, LanguageMomentDateAdapter, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LanguageSelectorComponent, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MenuListComponent, MenuTriggerForDirective, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationBaseComponent, NotificationComponent, NotificationConfig, NotificationEvent, NotificationFactory, NotificationModule, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, PropertiesManager, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListComponent, SelectListItem, SelectListItems, SelectOnFocusDirective, ShellBaseComponent, StartCasePipe, THEME_OPTIONS, TabGroupComponent, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VICommonModule, VIComponentModule, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowBaseComponent, WindowCloseElementComponent, WindowClosedError, WindowConfig, WindowDragAreaDirective, WindowElement, WindowEvent, WindowExpandElementComponent, WindowFactory, WindowImpl, WindowMinimizeElementComponent, WindowModule, WindowQuestionBaseComponent, WindowQuestionComponent, WindowResizeElementComponent, WindowService, WindowServiceEvent, cookieServiceFactory, languageServiceFactory, loggerServiceFactory, nativeWindowServiceFactory, notificationServiceFactory, themeAssetServiceFactory, themeServiceFactory };
10160
+ export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetBaseComponent, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, CdkTableBaseComponent, CdkTableCellClassNamePipe, CdkTableCellStyleNamePipe, CdkTableCellValuePipe, CdkTableCellValuePipePure, CdkTableColumnClassNamePipe, CdkTableColumnStyleNamePipe, CdkTableDataSource, CdkTableFilterableComponent, CdkTableFilterableMapCollection, CdkTablePaginableBookmarkComponent, CdkTablePaginableBookmarkMapCollection, CdkTablePaginableComponent, CdkTablePaginableMapCollection, CdkTableRowClassNamePipe, CdkTableRowStyleNamePipe, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVICommonOptions, IWindow, IWindowContent, InfiniteScrollDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageMatPaginatorIntl, LanguageModule, LanguageMomentDateAdapter, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LanguageSelectorComponent, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MenuListComponent, MenuTriggerForDirective, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationBaseComponent, NotificationComponent, NotificationConfig, NotificationEvent, NotificationFactory, NotificationModule, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, PropertiesManager, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListComponent, SelectListItem, SelectListItems, SelectOnFocusDirective, ShellBaseComponent, StartCasePipe, THEME_OPTIONS, TabGroupComponent, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VICommonModule, VIComponentModule, VIEW_UTIL, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowBaseComponent, WindowCloseElementComponent, WindowClosedError, WindowConfig, WindowDragAreaDirective, WindowElement, WindowEvent, WindowExpandElementComponent, WindowFactory, WindowImpl, WindowMinimizeElementComponent, WindowModule, WindowQuestionBaseComponent, WindowQuestionComponent, WindowResizeElementComponent, WindowService, WindowServiceEvent, cookieServiceFactory, languageServiceFactory, loggerServiceFactory, nativeWindowServiceFactory, notificationServiceFactory, themeAssetServiceFactory, themeServiceFactory, viewUtilFactory };
10157
10161
  //# sourceMappingURL=ts-core-angular.mjs.map