@ts-core/angular 15.0.6 → 15.0.8

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';
@@ -5515,6 +5515,383 @@ var UserBaseServiceEvent;
5515
5515
  UserBaseServiceEvent["LOGOUTED"] = "LOGOUTED";
5516
5516
  })(UserBaseServiceEvent || (UserBaseServiceEvent = {}));
5517
5517
 
5518
+ class IWindow extends Destroyable {
5519
+ constructor() {
5520
+ // --------------------------------------------------------------------------
5521
+ //
5522
+ // Public Methods
5523
+ //
5524
+ // --------------------------------------------------------------------------
5525
+ super(...arguments);
5526
+ // --------------------------------------------------------------------------
5527
+ //
5528
+ // Public Properties
5529
+ //
5530
+ // --------------------------------------------------------------------------
5531
+ this.isOnTop = false;
5532
+ this.isDisabled = false;
5533
+ this.isMinimized = false;
5534
+ }
5535
+ }
5536
+ var WindowEvent;
5537
+ (function (WindowEvent) {
5538
+ WindowEvent["OPENED"] = "OPENED";
5539
+ WindowEvent["CLOSED"] = "CLOSED";
5540
+ WindowEvent["CONTENT_READY"] = "CONTENT_READY";
5541
+ WindowEvent["MOVED"] = "MOVED";
5542
+ WindowEvent["RESIZED"] = "RESIZED";
5543
+ WindowEvent["DISABLED_CHANGED"] = "DISABLED_CHANGED";
5544
+ WindowEvent["MINIMIZED_CHANGED"] = "MINIMIZED_CHANGED";
5545
+ WindowEvent["IS_ON_TOP_CHANGED"] = "IS_ON_TOP_CHANGED";
5546
+ WindowEvent["EXPAND"] = "EXPAND";
5547
+ WindowEvent["SET_ON_TOP"] = "SET_ON_TOP";
5548
+ })(WindowEvent || (WindowEvent = {}));
5549
+
5550
+ var WindowAlign;
5551
+ (function (WindowAlign) {
5552
+ WindowAlign["START"] = "START";
5553
+ WindowAlign["CENTER"] = "CENTER";
5554
+ WindowAlign["END"] = "END";
5555
+ })(WindowAlign || (WindowAlign = {}));
5556
+
5557
+ class WindowBase extends DestroyableContainer {
5558
+ // --------------------------------------------------------------------------
5559
+ //
5560
+ // Constructor
5561
+ //
5562
+ // --------------------------------------------------------------------------
5563
+ constructor() {
5564
+ super();
5565
+ // --------------------------------------------------------------------------
5566
+ //
5567
+ // Properties
5568
+ //
5569
+ // --------------------------------------------------------------------------
5570
+ this._x = NaN;
5571
+ this._width = NaN;
5572
+ this._y = NaN;
5573
+ this._height = NaN;
5574
+ this.updatePosition = () => this.setPosition();
5575
+ }
5576
+ // --------------------------------------------------------------------------
5577
+ //
5578
+ // Static Methods
5579
+ //
5580
+ // --------------------------------------------------------------------------
5581
+ static parseX(value, config) {
5582
+ value = Math.max(value, config.elementMinX);
5583
+ value = Math.min(value, config.elementMaxX);
5584
+ return value;
5585
+ }
5586
+ static parseY(value, config) {
5587
+ value = Math.max(value, config.elementMinY);
5588
+ value = Math.min(value, config.elementMaxY);
5589
+ return value;
5590
+ }
5591
+ static parseWidth(value, config) {
5592
+ value = Math.max(value, config.elementMinWidth);
5593
+ value = Math.min(value, config.elementMaxWidth);
5594
+ return value;
5595
+ }
5596
+ static parseHeight(value, config) {
5597
+ value = Math.max(value, config.elementMinHeight);
5598
+ value = Math.min(value, config.elementMaxHeight);
5599
+ return value;
5600
+ }
5601
+ setProperties() {
5602
+ let config = this.getConfig();
5603
+ if (!_.isNaN(config.defaultWidth)) {
5604
+ this.width = config.defaultWidth;
5605
+ }
5606
+ if (!_.isNaN(config.defaultHeight)) {
5607
+ this.height = config.defaultHeight;
5608
+ }
5609
+ }
5610
+ setPosition() {
5611
+ let config = this.getConfig();
5612
+ switch (config.horizontalAlign) {
5613
+ case WindowAlign.START:
5614
+ this.x = !_.isNaN(this.paddingLeft) ? this.paddingLeft : 0;
5615
+ break;
5616
+ case WindowAlign.END:
5617
+ let value = ViewUtil.getStageWidth() - this.calculateWidth();
5618
+ if (!_.isNaN(this.paddingRight)) {
5619
+ value -= this.paddingRight;
5620
+ }
5621
+ this.x = value;
5622
+ break;
5623
+ default:
5624
+ this.x = (ViewUtil.getStageWidth() - this.calculateWidth()) / 2;
5625
+ break;
5626
+ }
5627
+ switch (config.verticalAlign) {
5628
+ case WindowAlign.START:
5629
+ this.y = !_.isNaN(this.paddingTop) ? this.paddingTop : 0;
5630
+ break;
5631
+ case WindowAlign.END:
5632
+ let value = ViewUtil.getStageHeight() - this.calculateHeight();
5633
+ if (!_.isNaN(this.paddingBottom)) {
5634
+ value -= this.paddingBottom;
5635
+ }
5636
+ this.y = value;
5637
+ break;
5638
+ default:
5639
+ this.y = (ViewUtil.getStageHeight() - this.calculateHeight()) / 2;
5640
+ break;
5641
+ }
5642
+ }
5643
+ clearSize() {
5644
+ this._x = NaN;
5645
+ this._y = NaN;
5646
+ this._width = NaN;
5647
+ this._height = NaN;
5648
+ }
5649
+ commitSizeProperties() {
5650
+ /*
5651
+ let width = !_.isNaN(this.width) ? `${this.width}px` : 'auto';
5652
+ let height = !_.isNaN(this.height) ? `${this.height}px` : 'auto';
5653
+ this.getReference().updateSize(width, height);
5654
+ */
5655
+ }
5656
+ commitPositionProperties() {
5657
+ /*
5658
+ if (_.isNaN(this._x) && _.isNaN(this._y)) {
5659
+ return;
5660
+ }
5661
+ let position = {} as any;
5662
+ if (!_.isNaN(this._y)) {
5663
+ position.top = `${this._y}px`;
5664
+ }
5665
+ if (!_.isNaN(this._x)) {
5666
+ position.left = `${this._x}px`;
5667
+ }
5668
+ this.getReference().updatePosition(position);
5669
+ */
5670
+ }
5671
+ // --------------------------------------------------------------------------
5672
+ //
5673
+ // Public Methods
5674
+ //
5675
+ // --------------------------------------------------------------------------
5676
+ calculateWidth() {
5677
+ return !_.isNaN(this.width) ? this.width : ViewUtil.getWidth(this.getContainer());
5678
+ }
5679
+ calculateHeight() {
5680
+ return !_.isNaN(this.height) ? this.height : ViewUtil.getHeight(this.getContainer());
5681
+ }
5682
+ // --------------------------------------------------------------------------
5683
+ //
5684
+ // Private Properties
5685
+ //
5686
+ // --------------------------------------------------------------------------
5687
+ get width() {
5688
+ return this._width;
5689
+ }
5690
+ set width(value) {
5691
+ value = WindowBase.parseWidth(value, this.getConfig());
5692
+ if (value === this._width) {
5693
+ return;
5694
+ }
5695
+ this._width = value;
5696
+ this.commitSizeProperties();
5697
+ }
5698
+ get height() {
5699
+ return this._height;
5700
+ }
5701
+ set height(value) {
5702
+ value = WindowBase.parseWidth(value, this.getConfig());
5703
+ if (value === this._height) {
5704
+ return;
5705
+ }
5706
+ this._height = value;
5707
+ this.commitSizeProperties();
5708
+ }
5709
+ // --------------------------------------------------------------------------
5710
+ //
5711
+ // Public Properties
5712
+ //
5713
+ // --------------------------------------------------------------------------
5714
+ get x() {
5715
+ return this._x;
5716
+ }
5717
+ set x(value) {
5718
+ value = WindowBase.parseX(value, this.getConfig());
5719
+ if (value === this._x) {
5720
+ return;
5721
+ }
5722
+ this._x = value;
5723
+ this.commitPositionProperties();
5724
+ }
5725
+ get y() {
5726
+ return this._y;
5727
+ }
5728
+ set y(value) {
5729
+ value = WindowBase.parseY(value, this.getConfig());
5730
+ if (value === this._y) {
5731
+ return;
5732
+ }
5733
+ this._y = value;
5734
+ this.commitPositionProperties();
5735
+ }
5736
+ get paddingTop() {
5737
+ return this.getConfig().paddingTop;
5738
+ }
5739
+ get paddingLeft() {
5740
+ return this.getConfig().paddingLeft;
5741
+ }
5742
+ get paddingRight() {
5743
+ return this.getConfig().paddingRight;
5744
+ }
5745
+ get paddingBottom() {
5746
+ return this.getConfig().paddingBottom;
5747
+ }
5748
+ }
5749
+
5750
+ class IWindowContent extends DestroyableContainer {
5751
+ // --------------------------------------------------------------------------
5752
+ //
5753
+ // Constructor
5754
+ //
5755
+ // --------------------------------------------------------------------------
5756
+ constructor(container) {
5757
+ super();
5758
+ this.container = container;
5759
+ }
5760
+ // --------------------------------------------------------------------------
5761
+ //
5762
+ // Private Methods
5763
+ //
5764
+ // --------------------------------------------------------------------------
5765
+ commitWindowProperties() {
5766
+ this.commitConfigProperties();
5767
+ }
5768
+ commitConfigProperties() { }
5769
+ // --------------------------------------------------------------------------
5770
+ //
5771
+ // Public Methods
5772
+ //
5773
+ // --------------------------------------------------------------------------
5774
+ ngAfterViewInit() {
5775
+ this.emit(WindowEvent.CONTENT_READY);
5776
+ }
5777
+ ngOnDestroy() {
5778
+ // do nothing, window will destroy content after closing
5779
+ }
5780
+ blink() {
5781
+ if (!_.isNil(this.window)) {
5782
+ this.window.blink();
5783
+ }
5784
+ }
5785
+ shake() {
5786
+ if (!_.isNil(this.window)) {
5787
+ this.window.shake();
5788
+ }
5789
+ }
5790
+ emit(event) {
5791
+ if (!_.isNil(this.window)) {
5792
+ this.window.emit(event);
5793
+ }
5794
+ }
5795
+ close() {
5796
+ if (!_.isNil(this.window)) {
5797
+ this.window.close();
5798
+ }
5799
+ }
5800
+ destroy() {
5801
+ if (this.isDestroyed) {
5802
+ return;
5803
+ }
5804
+ super.destroy();
5805
+ this.window = null;
5806
+ this.container = null;
5807
+ }
5808
+ // --------------------------------------------------------------------------
5809
+ //
5810
+ // Proxy Public Properties
5811
+ //
5812
+ // --------------------------------------------------------------------------
5813
+ get data() {
5814
+ return !_.isNil(this.config) ? this.config.data : null;
5815
+ }
5816
+ get isOnTop() {
5817
+ return !_.isNil(this.window) ? this.window.isOnTop : false;
5818
+ }
5819
+ get isMinimized() {
5820
+ return !_.isNil(this.window) ? this.window.isMinimized : false;
5821
+ }
5822
+ get events() {
5823
+ return !_.isNil(this.window) ? this.window.events : null;
5824
+ }
5825
+ get isDisabled() {
5826
+ return !_.isNil(this.window) ? this.window.isDisabled : false;
5827
+ }
5828
+ set isDisabled(value) {
5829
+ if (!_.isNil(this.window)) {
5830
+ this.window.isDisabled = value;
5831
+ }
5832
+ }
5833
+ // --------------------------------------------------------------------------
5834
+ //
5835
+ // Public Properties
5836
+ //
5837
+ // --------------------------------------------------------------------------
5838
+ get element() {
5839
+ if (_.isNil(this.container)) {
5840
+ return null;
5841
+ }
5842
+ return this.container instanceof ViewContainerRef ? this.container.element : this.container;
5843
+ }
5844
+ get config() {
5845
+ return !_.isNil(this.window) ? this.window.config : null;
5846
+ }
5847
+ get window() {
5848
+ return this._window;
5849
+ }
5850
+ set window(value) {
5851
+ if (value === this._window) {
5852
+ return;
5853
+ }
5854
+ this._window = value;
5855
+ if (!_.isNil(value)) {
5856
+ this.commitWindowProperties();
5857
+ }
5858
+ }
5859
+ }
5860
+ 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 });
5861
+ 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 });
5862
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IWindowContent, decorators: [{
5863
+ type: Component,
5864
+ args: [{ template: '' }]
5865
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
5866
+ type: Optional
5867
+ }, {
5868
+ type: Inject,
5869
+ args: [WINDOW_CONTENT_CONTAINER]
5870
+ }] }]; }, propDecorators: { isDisabled: [{
5871
+ type: Input
5872
+ }], window: [{
5873
+ type: Input
5874
+ }] } });
5875
+ const WINDOW_CONTENT_CONTAINER = new InjectionToken('WINDOW_CONTENT_CONTAINER');
5876
+
5877
+ class WindowClosedError extends ExtendedError {
5878
+ // --------------------------------------------------------------------------
5879
+ //
5880
+ // Constructor
5881
+ //
5882
+ // --------------------------------------------------------------------------
5883
+ constructor(message = WindowClosedError.MESSAGE, code = WindowClosedError.CODE) {
5884
+ super(message, code);
5885
+ }
5886
+ }
5887
+ // --------------------------------------------------------------------------
5888
+ //
5889
+ // Static Methods
5890
+ //
5891
+ // --------------------------------------------------------------------------
5892
+ WindowClosedError.CODE = ExtendedError.DEFAULT_ERROR_CODE;
5893
+ WindowClosedError.MESSAGE = 'WINDOW_CLOSED';
5894
+
5518
5895
  class LazyModuleLoader extends Loadable {
5519
5896
  //--------------------------------------------------------------------------
5520
5897
  //
@@ -5869,5 +6246,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
5869
6246
  * Generated bundle index. Do not edit.
5870
6247
  */
5871
6248
 
5872
- 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 };
6249
+ 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 };
5873
6250
  //# sourceMappingURL=ts-core-angular.mjs.map