@ts-core/angular 15.0.6 → 15.0.7

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, Directive, Input, Pipe, NgModule, PLATFORM_ID, Injectable, Inject, InjectionToken, EventEmitter, Output, HostListener, RendererStyleFlags2, NgModuleFactory, APP_INITIALIZER, RendererFactory2 } from '@angular/core';
2
+ import { Component, ViewContainerRef, Directive, Input, Pipe, NgModule, PLATFORM_ID, Injectable, Inject, InjectionToken, EventEmitter, Output, HostListener, RendererStyleFlags2, Optional, NgModuleFactory, APP_INITIALIZER, RendererFactory2 } from '@angular/core';
3
3
  import { DestroyableContainer, PromiseHandler, LoadableEvent, ExtendedError, Destroyable, DateUtil, Loadable, LoadableStatus, ObservableData, TransportTimeoutError, TransportNoConnectionError, ArrayUtil, FilterableMapCollection, RemoveFilterableCondition, GetFilterableCondition, MapCollection, TransportEvent, TransportLocal, Logger, LoggerLevel } from '@ts-core/common';
4
4
  import * as _ from 'lodash';
5
5
  import * as i1 from '@ts-core/frontend';
@@ -5551,6 +5551,385 @@ var UserBaseServiceEvent;
5551
5551
  UserBaseServiceEvent["LOGOUTED"] = "LOGOUTED";
5552
5552
  })(UserBaseServiceEvent || (UserBaseServiceEvent = {}));
5553
5553
 
5554
+ class IWindow extends Destroyable {
5555
+ constructor() {
5556
+ // --------------------------------------------------------------------------
5557
+ //
5558
+ // Public Methods
5559
+ //
5560
+ // --------------------------------------------------------------------------
5561
+ super(...arguments);
5562
+ // --------------------------------------------------------------------------
5563
+ //
5564
+ // Public Properties
5565
+ //
5566
+ // --------------------------------------------------------------------------
5567
+ this.isOnTop = false;
5568
+ this.isDisabled = false;
5569
+ this.isMinimized = false;
5570
+ }
5571
+ }
5572
+ var WindowEvent;
5573
+ (function (WindowEvent) {
5574
+ WindowEvent["OPENED"] = "OPENED";
5575
+ WindowEvent["CLOSED"] = "CLOSED";
5576
+ WindowEvent["CONTENT_READY"] = "CONTENT_READY";
5577
+ WindowEvent["MOVED"] = "MOVED";
5578
+ WindowEvent["RESIZED"] = "RESIZED";
5579
+ WindowEvent["DISABLED_CHANGED"] = "DISABLED_CHANGED";
5580
+ WindowEvent["MINIMIZED_CHANGED"] = "MINIMIZED_CHANGED";
5581
+ WindowEvent["IS_ON_TOP_CHANGED"] = "IS_ON_TOP_CHANGED";
5582
+ WindowEvent["EXPAND"] = "EXPAND";
5583
+ WindowEvent["SET_ON_TOP"] = "SET_ON_TOP";
5584
+ })(WindowEvent || (WindowEvent = {}));
5585
+
5586
+ var WindowAlign;
5587
+ (function (WindowAlign) {
5588
+ WindowAlign["START"] = "START";
5589
+ WindowAlign["CENTER"] = "CENTER";
5590
+ WindowAlign["END"] = "END";
5591
+ })(WindowAlign || (WindowAlign = {}));
5592
+
5593
+ class WindowBase extends DestroyableContainer {
5594
+ // --------------------------------------------------------------------------
5595
+ //
5596
+ // Constructor
5597
+ //
5598
+ // --------------------------------------------------------------------------
5599
+ constructor() {
5600
+ super();
5601
+ // --------------------------------------------------------------------------
5602
+ //
5603
+ // Properties
5604
+ //
5605
+ // --------------------------------------------------------------------------
5606
+ this._x = NaN;
5607
+ this._width = NaN;
5608
+ this._y = NaN;
5609
+ this._height = NaN;
5610
+ this.updatePosition = () => this.setPosition();
5611
+ }
5612
+ // --------------------------------------------------------------------------
5613
+ //
5614
+ // Static Methods
5615
+ //
5616
+ // --------------------------------------------------------------------------
5617
+ static parseX(value, config) {
5618
+ value = Math.max(value, config.elementMinX);
5619
+ value = Math.min(value, config.elementMaxX);
5620
+ return value;
5621
+ }
5622
+ static parseY(value, config) {
5623
+ value = Math.max(value, config.elementMinY);
5624
+ value = Math.min(value, config.elementMaxY);
5625
+ return value;
5626
+ }
5627
+ static parseWidth(value, config) {
5628
+ value = Math.max(value, config.elementMinWidth);
5629
+ value = Math.min(value, config.elementMaxWidth);
5630
+ return value;
5631
+ }
5632
+ static parseHeight(value, config) {
5633
+ value = Math.max(value, config.elementMinHeight);
5634
+ value = Math.min(value, config.elementMaxHeight);
5635
+ return value;
5636
+ }
5637
+ setProperties() {
5638
+ let config = this.getConfig();
5639
+ if (!_.isNaN(config.defaultWidth)) {
5640
+ this.width = config.defaultWidth;
5641
+ }
5642
+ if (!_.isNaN(config.defaultHeight)) {
5643
+ this.height = config.defaultHeight;
5644
+ }
5645
+ }
5646
+ setPosition() {
5647
+ let config = this.getConfig();
5648
+ switch (config.horizontalAlign) {
5649
+ case WindowAlign.START:
5650
+ this.x = !_.isNaN(this.paddingLeft) ? this.paddingLeft : 0;
5651
+ break;
5652
+ case WindowAlign.END:
5653
+ let value = ViewUtil.getStageWidth() - this.calculateWidth();
5654
+ if (!_.isNaN(this.paddingRight)) {
5655
+ value -= this.paddingRight;
5656
+ }
5657
+ this.x = value;
5658
+ break;
5659
+ default:
5660
+ this.x = (ViewUtil.getStageWidth() - this.calculateWidth()) / 2;
5661
+ break;
5662
+ }
5663
+ switch (config.verticalAlign) {
5664
+ case WindowAlign.START:
5665
+ this.y = !_.isNaN(this.paddingTop) ? this.paddingTop : 0;
5666
+ break;
5667
+ case WindowAlign.END:
5668
+ let value = ViewUtil.getStageHeight() - this.calculateHeight();
5669
+ if (!_.isNaN(this.paddingBottom)) {
5670
+ value -= this.paddingBottom;
5671
+ }
5672
+ this.y = value;
5673
+ break;
5674
+ default:
5675
+ this.y = (ViewUtil.getStageHeight() - this.calculateHeight()) / 2;
5676
+ break;
5677
+ }
5678
+ }
5679
+ clearSize() {
5680
+ this._x = NaN;
5681
+ this._y = NaN;
5682
+ this._width = NaN;
5683
+ this._height = NaN;
5684
+ }
5685
+ commitSizeProperties() {
5686
+ /*
5687
+ let width = !_.isNaN(this.width) ? `${this.width}px` : 'auto';
5688
+ let height = !_.isNaN(this.height) ? `${this.height}px` : 'auto';
5689
+ this.getReference().updateSize(width, height);
5690
+ */
5691
+ }
5692
+ commitPositionProperties() {
5693
+ /*
5694
+ if (_.isNaN(this._x) && _.isNaN(this._y)) {
5695
+ return;
5696
+ }
5697
+ let position = {} as any;
5698
+ if (!_.isNaN(this._y)) {
5699
+ position.top = `${this._y}px`;
5700
+ }
5701
+ if (!_.isNaN(this._x)) {
5702
+ position.left = `${this._x}px`;
5703
+ }
5704
+ this.getReference().updatePosition(position);
5705
+ */
5706
+ }
5707
+ // --------------------------------------------------------------------------
5708
+ //
5709
+ // Public Methods
5710
+ //
5711
+ // --------------------------------------------------------------------------
5712
+ calculateWidth() {
5713
+ return !_.isNaN(this.width) ? this.width : ViewUtil.getWidth(this.getContainer());
5714
+ }
5715
+ calculateHeight() {
5716
+ return !_.isNaN(this.height) ? this.height : ViewUtil.getHeight(this.getContainer());
5717
+ }
5718
+ // --------------------------------------------------------------------------
5719
+ //
5720
+ // Private Properties
5721
+ //
5722
+ // --------------------------------------------------------------------------
5723
+ get width() {
5724
+ return this._width;
5725
+ }
5726
+ set width(value) {
5727
+ value = WindowBase.parseWidth(value, this.getConfig());
5728
+ if (value === this._width) {
5729
+ return;
5730
+ }
5731
+ this._width = value;
5732
+ this.commitSizeProperties();
5733
+ }
5734
+ get height() {
5735
+ return this._height;
5736
+ }
5737
+ set height(value) {
5738
+ value = WindowBase.parseWidth(value, this.getConfig());
5739
+ if (value === this._height) {
5740
+ return;
5741
+ }
5742
+ this._height = value;
5743
+ this.commitSizeProperties();
5744
+ }
5745
+ // --------------------------------------------------------------------------
5746
+ //
5747
+ // Public Properties
5748
+ //
5749
+ // --------------------------------------------------------------------------
5750
+ get x() {
5751
+ return this._x;
5752
+ }
5753
+ set x(value) {
5754
+ value = WindowBase.parseX(value, this.getConfig());
5755
+ if (value === this._x) {
5756
+ return;
5757
+ }
5758
+ this._x = value;
5759
+ this.commitPositionProperties();
5760
+ }
5761
+ get y() {
5762
+ return this._y;
5763
+ }
5764
+ set y(value) {
5765
+ value = WindowBase.parseY(value, this.getConfig());
5766
+ if (value === this._y) {
5767
+ return;
5768
+ }
5769
+ this._y = value;
5770
+ this.commitPositionProperties();
5771
+ }
5772
+ get paddingTop() {
5773
+ return this.getConfig().paddingTop;
5774
+ }
5775
+ get paddingLeft() {
5776
+ return this.getConfig().paddingLeft;
5777
+ }
5778
+ get paddingRight() {
5779
+ return this.getConfig().paddingRight;
5780
+ }
5781
+ get paddingBottom() {
5782
+ return this.getConfig().paddingBottom;
5783
+ }
5784
+ }
5785
+
5786
+ class IWindowContent extends DestroyableContainer {
5787
+ // --------------------------------------------------------------------------
5788
+ //
5789
+ // Constructor
5790
+ //
5791
+ // --------------------------------------------------------------------------
5792
+ constructor(container) {
5793
+ super();
5794
+ this.container = container;
5795
+ }
5796
+ // --------------------------------------------------------------------------
5797
+ //
5798
+ // Private Methods
5799
+ //
5800
+ // --------------------------------------------------------------------------
5801
+ commitWindowProperties() {
5802
+ this.commitConfigProperties();
5803
+ }
5804
+ commitConfigProperties() { }
5805
+ // --------------------------------------------------------------------------
5806
+ //
5807
+ // Public Methods
5808
+ //
5809
+ // --------------------------------------------------------------------------
5810
+ ngAfterViewInit() {
5811
+ this.emit(WindowEvent.CONTENT_READY);
5812
+ }
5813
+ ngOnDestroy() {
5814
+ // do nothing, window will destroy content after closing
5815
+ }
5816
+ blink() {
5817
+ if (!_.isNil(this.window)) {
5818
+ this.window.blink();
5819
+ }
5820
+ }
5821
+ shake() {
5822
+ if (!_.isNil(this.window)) {
5823
+ this.window.shake();
5824
+ }
5825
+ }
5826
+ emit(event) {
5827
+ if (!_.isNil(this.window)) {
5828
+ this.window.emit(event);
5829
+ }
5830
+ }
5831
+ close() {
5832
+ if (!_.isNil(this.window)) {
5833
+ this.window.close();
5834
+ }
5835
+ }
5836
+ destroy() {
5837
+ if (this.isDestroyed) {
5838
+ return;
5839
+ }
5840
+ super.destroy();
5841
+ this.window = null;
5842
+ this.container = null;
5843
+ }
5844
+ // --------------------------------------------------------------------------
5845
+ //
5846
+ // Proxy Public Properties
5847
+ //
5848
+ // --------------------------------------------------------------------------
5849
+ get data() {
5850
+ return !_.isNil(this.config) ? this.config.data : null;
5851
+ }
5852
+ get isOnTop() {
5853
+ return !_.isNil(this.window) ? this.window.isOnTop : false;
5854
+ }
5855
+ get isMinimized() {
5856
+ return !_.isNil(this.window) ? this.window.isMinimized : false;
5857
+ }
5858
+ get events() {
5859
+ return !_.isNil(this.window) ? this.window.events : null;
5860
+ }
5861
+ get isDisabled() {
5862
+ return !_.isNil(this.window) ? this.window.isDisabled : false;
5863
+ }
5864
+ set isDisabled(value) {
5865
+ if (!_.isNil(this.window)) {
5866
+ this.window.isDisabled = value;
5867
+ }
5868
+ }
5869
+ // --------------------------------------------------------------------------
5870
+ //
5871
+ // Public Properties
5872
+ //
5873
+ // --------------------------------------------------------------------------
5874
+ get element() {
5875
+ if (_.isNil(this.container)) {
5876
+ return null;
5877
+ }
5878
+ return this.container instanceof ViewContainerRef ? this.container.element : this.container;
5879
+ }
5880
+ get config() {
5881
+ return !_.isNil(this.window) ? this.window.config : null;
5882
+ }
5883
+ get window() {
5884
+ return this._window;
5885
+ }
5886
+ set window(value) {
5887
+ if (value === this._window) {
5888
+ return;
5889
+ }
5890
+ this._window = value;
5891
+ if (!_.isNil(value)) {
5892
+ this.commitWindowProperties();
5893
+ }
5894
+ }
5895
+ }
5896
+ IWindowContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IWindowContent, deps: [{ token: WINDOW_CONTENT_CONTAINER, optional: true }], target: i0.ɵɵFactoryTarget.Component });
5897
+ IWindowContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: IWindowContent, selector: "ng-component", inputs: { isDisabled: "isDisabled", window: "window" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
5898
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IWindowContent, decorators: [{
5899
+ type: Component,
5900
+ args: [{ template: '' }]
5901
+ }], ctorParameters: function () {
5902
+ return [{ type: undefined, decorators: [{
5903
+ type: Optional
5904
+ }, {
5905
+ type: Inject,
5906
+ args: [WINDOW_CONTENT_CONTAINER]
5907
+ }] }];
5908
+ }, propDecorators: { isDisabled: [{
5909
+ type: Input
5910
+ }], window: [{
5911
+ type: Input
5912
+ }] } });
5913
+ const WINDOW_CONTENT_CONTAINER = new InjectionToken('WINDOW_CONTENT_CONTAINER');
5914
+
5915
+ class WindowClosedError extends ExtendedError {
5916
+ // --------------------------------------------------------------------------
5917
+ //
5918
+ // Constructor
5919
+ //
5920
+ // --------------------------------------------------------------------------
5921
+ constructor(message = WindowClosedError.MESSAGE, code = WindowClosedError.CODE) {
5922
+ super(message, code);
5923
+ }
5924
+ }
5925
+ // --------------------------------------------------------------------------
5926
+ //
5927
+ // Static Methods
5928
+ //
5929
+ // --------------------------------------------------------------------------
5930
+ WindowClosedError.CODE = ExtendedError.DEFAULT_ERROR_CODE;
5931
+ WindowClosedError.MESSAGE = 'WINDOW_CLOSED';
5932
+
5554
5933
  class LazyModuleLoader extends Loadable {
5555
5934
  //--------------------------------------------------------------------------
5556
5935
  //
@@ -5916,5 +6295,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
5916
6295
  * Generated bundle index. Do not edit.
5917
6296
  */
5918
6297
 
5919
- export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, IUser, IVIOptions, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageModule, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, PipeBaseService, PlatformService, PrettifyPipe, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListItem, SelectListItems, SelectOnFocusDirective, StartCasePipe, THEME_OPTIONS, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VIModule, VI_ANGULAR_OPTIONS, ViewUtil, cookieServiceFactory, initializerFactory, languageServiceFactory, loggerServiceFactory, nativeWindowServiceFactory, themeAssetServiceFactory, themeServiceFactory };
6298
+ export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, IUser, IVIOptions, IWindow, IWindowContent, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageModule, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, PipeBaseService, PlatformService, PrettifyPipe, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListItem, SelectListItems, SelectOnFocusDirective, StartCasePipe, THEME_OPTIONS, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VIModule, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowClosedError, WindowEvent, cookieServiceFactory, initializerFactory, languageServiceFactory, loggerServiceFactory, nativeWindowServiceFactory, themeAssetServiceFactory, themeServiceFactory };
5920
6299
  //# sourceMappingURL=ts-core-angular.mjs.map