@ts-core/angular 13.1.22 → 13.1.25

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.
@@ -382,6 +382,9 @@ class ViewUtil {
382
382
  static set document(value) {
383
383
  ViewUtil._document = value;
384
384
  }
385
+ static get window() {
386
+ return this.document.defaultView;
387
+ }
385
388
  // --------------------------------------------------------------------------
386
389
  //
387
390
  // Private Methods
@@ -437,7 +440,7 @@ class ViewUtil {
437
440
  }
438
441
  }
439
442
  else {
440
- let selection = window.getSelection();
443
+ let selection = ViewUtil.window.getSelection();
441
444
  selection.removeAllRanges();
442
445
  let range = ViewUtil.document.createRange();
443
446
  if (!_.isNil(container)) {
@@ -501,10 +504,10 @@ class ViewUtil {
501
504
  //
502
505
  // --------------------------------------------------------------------------
503
506
  static getStageWidth() {
504
- return window.innerWidth || ViewUtil.document.body.clientWidth;
507
+ return ViewUtil.window.innerWidth || ViewUtil.document.body.clientWidth;
505
508
  }
506
509
  static getStageHeight() {
507
- return window.innerHeight || ViewUtil.document.body.clientHeight;
510
+ return ViewUtil.window.innerHeight || ViewUtil.document.body.clientHeight;
508
511
  }
509
512
  static getWidth(container) {
510
513
  container = ViewUtil.parseElement(container);
@@ -3448,6 +3451,15 @@ class WindowFactory {
3448
3451
  }
3449
3452
  }
3450
3453
 
3454
+ var WindowServiceEvent;
3455
+ (function (WindowServiceEvent) {
3456
+ WindowServiceEvent["OPEN_STARTED"] = "OPEN_STARTED";
3457
+ WindowServiceEvent["OPENED"] = "OPENED";
3458
+ WindowServiceEvent["OPEN_FINISHED"] = "OPEN_FINISHED";
3459
+ WindowServiceEvent["CLOSED"] = "CLOSED";
3460
+ WindowServiceEvent["SETTED_ON_TOP"] = "SETTED_ON_TOP";
3461
+ })(WindowServiceEvent || (WindowServiceEvent = {}));
3462
+
3451
3463
  class IWindowContent extends DestroyableContainer {
3452
3464
  // --------------------------------------------------------------------------
3453
3465
  //
@@ -3633,482 +3645,174 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
3633
3645
  args: [{ template: "<p class=\"text m-4 text-center mouse-inactive text-word-wrap-break-word\" [innerHTML]=\"text\"></p>\n\n<div class=\"text-center border-sm-top p-3\">\n\n <button (click)=\"data?.closeClickHandler()\" mat-stroked-button *ngIf=\"data?.isInfo\">\n <span [innerHTML]=\"data?.closeText\"></span>\n </button>\n\n <button class=\"mr-3 me-3\" (click)=\"data?.yesClickHandler()\" color=\"primary\" mat-stroked-button *ngIf=\"data?.isQuestion\">\n <span [innerHTML]=\"data?.yesText\"></span>\n </button>\n\n <button (click)=\"data?.notClickHandler()\" mat-stroked-button *ngIf=\"data?.isQuestion\">\n <span [innerHTML]=\"data?.notText\"></span>\n </button>\n\n</div>" }]
3634
3646
  }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i1$1.LanguageService }]; } });
3635
3647
 
3636
- class WindowElement extends DestroyableContainer {
3648
+ class WindowBase extends DestroyableContainer {
3637
3649
  // --------------------------------------------------------------------------
3638
3650
  //
3639
3651
  // Constructor
3640
3652
  //
3641
3653
  // --------------------------------------------------------------------------
3642
- constructor(element) {
3654
+ constructor() {
3643
3655
  super();
3644
- this.element = element;
3656
+ // --------------------------------------------------------------------------
3657
+ //
3658
+ // Properties
3659
+ //
3660
+ // --------------------------------------------------------------------------
3661
+ this._x = NaN;
3662
+ this._width = NaN;
3663
+ this._y = NaN;
3664
+ this._height = NaN;
3665
+ this.updatePosition = () => this.setPosition();
3645
3666
  }
3646
- // --------------------------------------------------------------------------
3647
- //
3648
- // Private Methods
3649
- //
3650
- // --------------------------------------------------------------------------
3651
- checkWindowParent() {
3652
- let container = this.getContainer();
3653
- if (!_.isNil(container)) {
3654
- ViewUtil.appendChild(container, this.element.nativeElement);
3667
+ setProperties() {
3668
+ let config = this.getConfig();
3669
+ if (!_.isNaN(config.defaultWidth)) {
3670
+ this.width = config.defaultWidth;
3671
+ }
3672
+ if (!_.isNaN(config.defaultHeight)) {
3673
+ this.height = config.defaultHeight;
3655
3674
  }
3656
3675
  }
3657
- getContainer() {
3658
- let item = ViewUtil.parseElement(this.element.nativeElement);
3659
- while (!_.isNil(item) && item.nodeName.toLowerCase() !== 'mat-dialog-container') {
3660
- item = item.parentElement;
3676
+ setPosition() {
3677
+ let config = this.getConfig();
3678
+ switch (config.horizontalAlign) {
3679
+ case WindowAlign.START:
3680
+ this.x = !_.isNaN(this.paddingLeft) ? this.paddingLeft : 0;
3681
+ break;
3682
+ case WindowAlign.END:
3683
+ let value = ViewUtil.getStageWidth() - this.calculateWidth();
3684
+ if (!_.isNaN(this.paddingRight)) {
3685
+ value -= this.paddingRight;
3686
+ }
3687
+ this.x = value;
3688
+ break;
3689
+ default:
3690
+ this.x = (ViewUtil.getStageWidth() - this.calculateWidth()) / 2;
3691
+ break;
3692
+ }
3693
+ switch (config.verticalAlign) {
3694
+ case WindowAlign.START:
3695
+ this.y = !_.isNaN(this.paddingTop) ? this.paddingTop : 0;
3696
+ break;
3697
+ case WindowAlign.END:
3698
+ let value = ViewUtil.getStageHeight() - this.calculateHeight();
3699
+ if (!_.isNaN(this.paddingBottom)) {
3700
+ value -= this.paddingBottom;
3701
+ }
3702
+ this.y = value;
3703
+ break;
3704
+ default:
3705
+ this.y = (ViewUtil.getStageHeight() - this.calculateHeight()) / 2;
3706
+ break;
3661
3707
  }
3662
- return item;
3663
3708
  }
3664
- createChildren() { }
3665
- destroyChildren() { }
3666
- commitWindowProperties() { }
3667
- // --------------------------------------------------------------------------
3668
- //
3669
- // Public Methods
3670
- //
3671
- // --------------------------------------------------------------------------
3672
- ngAfterViewInit() {
3673
- this.createChildren();
3674
- this.checkWindowParent();
3709
+ clearSize() {
3710
+ this._x = NaN;
3711
+ this._y = NaN;
3712
+ this._width = NaN;
3713
+ this._height = NaN;
3675
3714
  }
3676
- destroy() {
3677
- if (this.isDestroyed) {
3715
+ commitSizeProperties() {
3716
+ let width = !_.isNaN(this.width) ? this.width + 'px' : 'auto';
3717
+ let height = !_.isNaN(this.height) ? this.height + 'px' : 'auto';
3718
+ this.getReference().updateSize(width, height);
3719
+ }
3720
+ commitPositionProperties() {
3721
+ if (_.isNaN(this._x) && _.isNaN(this._y)) {
3678
3722
  return;
3679
3723
  }
3680
- super.destroy();
3681
- this.destroyChildren();
3682
- this.element = null;
3683
- this.window = null;
3724
+ let position = {};
3725
+ if (!_.isNaN(this._y)) {
3726
+ position.top = this._y + 'px';
3727
+ }
3728
+ if (!_.isNaN(this._x)) {
3729
+ position.left = this._x + 'px';
3730
+ }
3731
+ this.getReference().updatePosition(position);
3684
3732
  }
3685
3733
  // --------------------------------------------------------------------------
3686
3734
  //
3687
- // Event Handlers
3735
+ // Public Methods
3688
3736
  //
3689
3737
  // --------------------------------------------------------------------------
3690
- clickHandler(event) {
3691
- event.stopPropagation();
3738
+ calculateWidth() {
3739
+ return !_.isNaN(this.width) ? this.width : ViewUtil.getWidth(this.getContainer());
3692
3740
  }
3693
- // --------------------------------------------------------------------------
3694
- //
3695
- // Protected Properties
3696
- //
3697
- // --------------------------------------------------------------------------
3698
- get nativeElement() {
3699
- return this.element ? this.element.nativeElement : null;
3741
+ calculateHeight() {
3742
+ return !_.isNaN(this.height) ? this.height : ViewUtil.getHeight(this.getContainer());
3700
3743
  }
3701
3744
  // --------------------------------------------------------------------------
3702
3745
  //
3703
- // Public Properties
3746
+ // Private Properties
3704
3747
  //
3705
3748
  // --------------------------------------------------------------------------
3706
- get window() {
3707
- return this._window;
3749
+ get width() {
3750
+ return this._width;
3708
3751
  }
3709
- set window(value) {
3710
- if (value === this._window) {
3752
+ set width(value) {
3753
+ value = this.getConfig().parseWidth(value);
3754
+ if (value === this._width) {
3711
3755
  return;
3712
3756
  }
3713
- this._window = value;
3714
- if (this.window) {
3715
- this.commitWindowProperties();
3757
+ this._width = value;
3758
+ this.commitSizeProperties();
3759
+ }
3760
+ get height() {
3761
+ return this._height;
3762
+ }
3763
+ set height(value) {
3764
+ value = this.getConfig().parseHeight(value);
3765
+ if (value === this._height) {
3766
+ return;
3716
3767
  }
3768
+ this._height = value;
3769
+ this.commitSizeProperties();
3717
3770
  }
3718
- }
3719
- WindowElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowElement, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
3720
- WindowElement.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowElement, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
3721
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowElement, decorators: [{
3722
- type: Component,
3723
- args: [{ template: '' }]
3724
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
3725
-
3726
- class WindowCloseElementComponent extends WindowElement {
3727
3771
  // --------------------------------------------------------------------------
3728
3772
  //
3729
- // Constructor
3773
+ // Public Properties
3730
3774
  //
3731
3775
  // --------------------------------------------------------------------------
3732
- constructor(element) {
3733
- super(element);
3776
+ get x() {
3777
+ return this._x;
3734
3778
  }
3735
- // --------------------------------------------------------------------------
3736
- //
3737
- // Private Methods
3738
- //
3739
- // --------------------------------------------------------------------------
3740
- createChildren() {
3741
- super.createChildren();
3742
- if (!_.isNil(WindowCloseElementComponent.ICON_VALUE)) {
3743
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowCloseElementComponent.ICON_VALUE);
3744
- }
3745
- if (!_.isNil(WindowCloseElementComponent.ICON_CLASS)) {
3746
- ViewUtil.addClasses(this.nativeElement, WindowCloseElementComponent.ICON_CLASS);
3779
+ set x(value) {
3780
+ value = this.getConfig().parseX(value);
3781
+ if (value === this._x) {
3782
+ return;
3747
3783
  }
3748
- ViewUtil.addClass(this.nativeElement, 'mouse-active');
3784
+ this._x = value;
3785
+ this.commitPositionProperties();
3749
3786
  }
3750
- // --------------------------------------------------------------------------
3751
- //
3752
- // Event Handlers
3753
- //
3754
- // --------------------------------------------------------------------------
3755
- clickHandler(event) {
3756
- super.clickHandler(event);
3757
- if (!_.isNil(this.window)) {
3758
- this.window.close();
3787
+ get y() {
3788
+ return this._y;
3789
+ }
3790
+ set y(value) {
3791
+ value = this.getConfig().parseY(value);
3792
+ if (value === this._y) {
3793
+ return;
3759
3794
  }
3795
+ this._y = value;
3796
+ this.commitPositionProperties();
3797
+ }
3798
+ get paddingTop() {
3799
+ return this.getConfig().paddingTop;
3800
+ }
3801
+ get paddingLeft() {
3802
+ return this.getConfig().paddingLeft;
3803
+ }
3804
+ get paddingRight() {
3805
+ return this.getConfig().paddingRight;
3806
+ }
3807
+ get paddingBottom() {
3808
+ return this.getConfig().paddingBottom;
3760
3809
  }
3761
3810
  }
3762
- // --------------------------------------------------------------------------
3763
- //
3764
- // Constants
3765
- //
3766
- // --------------------------------------------------------------------------
3767
- WindowCloseElementComponent.ICON_CLASS = 'fas fa-times';
3768
- WindowCloseElementComponent.ICON_VALUE = null;
3769
- WindowCloseElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowCloseElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
3770
- WindowCloseElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowCloseElementComponent, selector: "vi-window-close-element", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] });
3771
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowCloseElementComponent, decorators: [{
3772
- type: Component,
3773
- args: [{ selector: 'vi-window-close-element', template: '', styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] }]
3774
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
3775
3811
 
3776
- class WindowExpandElementComponent extends WindowElement {
3777
- // --------------------------------------------------------------------------
3778
- //
3779
- // Constructor
3780
- //
3781
- // --------------------------------------------------------------------------
3782
- constructor(element) {
3783
- super(element);
3784
- }
3812
+ class WindowImpl extends WindowBase {
3785
3813
  // --------------------------------------------------------------------------
3786
3814
  //
3787
- // Private Methods
3788
- //
3789
- // --------------------------------------------------------------------------
3790
- createChildren() {
3791
- super.createChildren();
3792
- if (!_.isNil(WindowExpandElementComponent.ICON_VALUE)) {
3793
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowExpandElementComponent.ICON_VALUE);
3794
- }
3795
- if (!_.isNil(WindowExpandElementComponent.ICON_CLASS)) {
3796
- ViewUtil.addClasses(this.nativeElement, WindowExpandElementComponent.ICON_CLASS);
3797
- }
3798
- ViewUtil.addClass(this.nativeElement, 'mouse-active');
3799
- }
3800
- // --------------------------------------------------------------------------
3801
- //
3802
- // Event Handlers
3803
- //
3804
- // --------------------------------------------------------------------------
3805
- clickHandler(event) {
3806
- super.clickHandler(event);
3807
- if (!_.isNil(this.window)) {
3808
- this.window.emit(WindowEvent.EXPAND);
3809
- }
3810
- }
3811
- }
3812
- // --------------------------------------------------------------------------
3813
- //
3814
- // Constants
3815
- //
3816
- // --------------------------------------------------------------------------
3817
- WindowExpandElementComponent.ICON_CLASS = 'fas fa-angle-double-up';
3818
- WindowExpandElementComponent.ICON_VALUE = null;
3819
- WindowExpandElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowExpandElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
3820
- WindowExpandElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowExpandElementComponent, selector: "vi-window-expand-element", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] });
3821
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowExpandElementComponent, decorators: [{
3822
- type: Component,
3823
- args: [{ selector: 'vi-window-expand-element', template: '', styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] }]
3824
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
3825
-
3826
- class WindowResizeElementComponent extends WindowElement {
3827
- // --------------------------------------------------------------------------
3828
- //
3829
- // Constructor
3830
- //
3831
- // --------------------------------------------------------------------------
3832
- constructor(element) {
3833
- super(element);
3834
- }
3835
- // --------------------------------------------------------------------------
3836
- //
3837
- // Private Methods
3838
- //
3839
- // --------------------------------------------------------------------------
3840
- createChildren() {
3841
- super.createChildren();
3842
- if (!_.isNil(WindowResizeElementComponent.ICON_VALUE)) {
3843
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowResizeElementComponent.ICON_VALUE);
3844
- }
3845
- if (!_.isNil(WindowResizeElementComponent.ICON_CLASS)) {
3846
- ViewUtil.addClasses(this.nativeElement, WindowResizeElementComponent.ICON_CLASS);
3847
- }
3848
- ViewUtil.setStyle(this.nativeElement, 'cursor', 'pointer');
3849
- }
3850
- // --------------------------------------------------------------------------
3851
- //
3852
- // Event Handlers
3853
- //
3854
- // --------------------------------------------------------------------------
3855
- clickHandler(event) {
3856
- super.clickHandler(event);
3857
- if (!_.isNil(this.window)) {
3858
- this.window.emit(WindowEvent.EXPAND);
3859
- }
3860
- }
3861
- }
3862
- // --------------------------------------------------------------------------
3863
- //
3864
- // Constants
3865
- //
3866
- // --------------------------------------------------------------------------
3867
- WindowResizeElementComponent.ICON_CLASS = 'fas fa-arrows-alt';
3868
- WindowResizeElementComponent.ICON_VALUE = null;
3869
- WindowResizeElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowResizeElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
3870
- WindowResizeElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowResizeElementComponent, selector: "vi-window-resize-element", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] });
3871
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowResizeElementComponent, decorators: [{
3872
- type: Component,
3873
- args: [{ selector: 'vi-window-resize-element', template: '', styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] }]
3874
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
3875
-
3876
- class WindowMinimizeElementComponent extends WindowElement {
3877
- // --------------------------------------------------------------------------
3878
- //
3879
- // Constructor
3880
- //
3881
- // --------------------------------------------------------------------------
3882
- constructor(element) {
3883
- super(element);
3884
- // --------------------------------------------------------------------------
3885
- //
3886
- // Private Methods
3887
- //
3888
- // --------------------------------------------------------------------------
3889
- this.commitIconProperties = () => {
3890
- let icon = this.window.isMinimized ? WindowMinimizeElementComponent.ICON_MAXIMIZE_VALUE : WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE;
3891
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', icon);
3892
- };
3893
- }
3894
- // --------------------------------------------------------------------------
3895
- //
3896
- // Protected Methods
3897
- //
3898
- // --------------------------------------------------------------------------
3899
- commitWindowProperties() {
3900
- super.commitWindowProperties();
3901
- this.window.events.pipe(takeUntil(this.destroyed)).subscribe(event => {
3902
- if (event === WindowEvent.MINIMIZED_CHANGED) {
3903
- this.commitIconProperties();
3904
- }
3905
- });
3906
- }
3907
- createChildren() {
3908
- super.createChildren();
3909
- if (!_.isNil(WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE)) {
3910
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE);
3911
- }
3912
- if (!_.isNil(WindowMinimizeElementComponent.ICON_CLASS)) {
3913
- ViewUtil.addClasses(this.nativeElement, WindowMinimizeElementComponent.ICON_CLASS);
3914
- }
3915
- ViewUtil.addClass(this.nativeElement, 'mouse-active');
3916
- }
3917
- // --------------------------------------------------------------------------
3918
- //
3919
- // Event Handlers
3920
- //
3921
- // --------------------------------------------------------------------------
3922
- clickHandler(event) {
3923
- super.clickHandler(event);
3924
- if (!_.isNil(this.window)) {
3925
- this.window.isMinimized = !this.window.isMinimized;
3926
- }
3927
- }
3928
- }
3929
- // --------------------------------------------------------------------------
3930
- //
3931
- // Constants
3932
- //
3933
- // --------------------------------------------------------------------------
3934
- WindowMinimizeElementComponent.ICON_CLASS = null;
3935
- WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE = null;
3936
- WindowMinimizeElementComponent.ICON_MAXIMIZE_VALUE = null;
3937
- WindowMinimizeElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowMinimizeElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
3938
- WindowMinimizeElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowMinimizeElementComponent, selector: "vi-window-minimize-element", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] });
3939
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowMinimizeElementComponent, decorators: [{
3940
- type: Component,
3941
- args: [{ selector: 'vi-window-minimize-element', template: '', styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] }]
3942
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
3943
-
3944
- class WindowBase extends DestroyableContainer {
3945
- // --------------------------------------------------------------------------
3946
- //
3947
- // Constructor
3948
- //
3949
- // --------------------------------------------------------------------------
3950
- constructor() {
3951
- super();
3952
- // --------------------------------------------------------------------------
3953
- //
3954
- // Properties
3955
- //
3956
- // --------------------------------------------------------------------------
3957
- this._x = NaN;
3958
- this._width = NaN;
3959
- this._y = NaN;
3960
- this._height = NaN;
3961
- this.updatePosition = () => this.setPosition();
3962
- }
3963
- setProperties() {
3964
- let config = this.getConfig();
3965
- if (!_.isNaN(config.defaultWidth)) {
3966
- this.width = config.defaultWidth;
3967
- }
3968
- if (!_.isNaN(config.defaultHeight)) {
3969
- this.height = config.defaultHeight;
3970
- }
3971
- }
3972
- setPosition() {
3973
- let config = this.getConfig();
3974
- switch (config.horizontalAlign) {
3975
- case WindowAlign.START:
3976
- this.x = !_.isNaN(this.paddingLeft) ? this.paddingLeft : 0;
3977
- break;
3978
- case WindowAlign.END:
3979
- let value = ViewUtil.getStageWidth() - this.calculateWidth();
3980
- if (!_.isNaN(this.paddingRight)) {
3981
- value -= this.paddingRight;
3982
- }
3983
- this.x = value;
3984
- break;
3985
- default:
3986
- this.x = (ViewUtil.getStageWidth() - this.calculateWidth()) / 2;
3987
- break;
3988
- }
3989
- switch (config.verticalAlign) {
3990
- case WindowAlign.START:
3991
- this.y = !_.isNaN(this.paddingTop) ? this.paddingTop : 0;
3992
- break;
3993
- case WindowAlign.END:
3994
- let value = ViewUtil.getStageHeight() - this.calculateHeight();
3995
- if (!_.isNaN(this.paddingBottom)) {
3996
- value -= this.paddingBottom;
3997
- }
3998
- this.y = value;
3999
- break;
4000
- default:
4001
- this.y = (ViewUtil.getStageHeight() - this.calculateHeight()) / 2;
4002
- break;
4003
- }
4004
- }
4005
- clearSize() {
4006
- this._x = NaN;
4007
- this._y = NaN;
4008
- this._width = NaN;
4009
- this._height = NaN;
4010
- }
4011
- commitSizeProperties() {
4012
- let width = !_.isNaN(this.width) ? this.width + 'px' : 'auto';
4013
- let height = !_.isNaN(this.height) ? this.height + 'px' : 'auto';
4014
- this.getReference().updateSize(width, height);
4015
- }
4016
- commitPositionProperties() {
4017
- if (_.isNaN(this._x) && _.isNaN(this._y)) {
4018
- return;
4019
- }
4020
- let position = {};
4021
- if (!_.isNaN(this._y)) {
4022
- position.top = this._y + 'px';
4023
- }
4024
- if (!_.isNaN(this._x)) {
4025
- position.left = this._x + 'px';
4026
- }
4027
- this.getReference().updatePosition(position);
4028
- }
4029
- // --------------------------------------------------------------------------
4030
- //
4031
- // Public Methods
4032
- //
4033
- // --------------------------------------------------------------------------
4034
- calculateWidth() {
4035
- return !_.isNaN(this.width) ? this.width : ViewUtil.getWidth(this.getContainer());
4036
- }
4037
- calculateHeight() {
4038
- return !_.isNaN(this.height) ? this.height : ViewUtil.getHeight(this.getContainer());
4039
- }
4040
- // --------------------------------------------------------------------------
4041
- //
4042
- // Private Properties
4043
- //
4044
- // --------------------------------------------------------------------------
4045
- get width() {
4046
- return this._width;
4047
- }
4048
- set width(value) {
4049
- value = this.getConfig().parseWidth(value);
4050
- if (value === this._width) {
4051
- return;
4052
- }
4053
- this._width = value;
4054
- this.commitSizeProperties();
4055
- }
4056
- get height() {
4057
- return this._height;
4058
- }
4059
- set height(value) {
4060
- value = this.getConfig().parseHeight(value);
4061
- if (value === this._height) {
4062
- return;
4063
- }
4064
- this._height = value;
4065
- this.commitSizeProperties();
4066
- }
4067
- // --------------------------------------------------------------------------
4068
- //
4069
- // Public Properties
4070
- //
4071
- // --------------------------------------------------------------------------
4072
- get x() {
4073
- return this._x;
4074
- }
4075
- set x(value) {
4076
- value = this.getConfig().parseX(value);
4077
- if (value === this._x) {
4078
- return;
4079
- }
4080
- this._x = value;
4081
- this.commitPositionProperties();
4082
- }
4083
- get y() {
4084
- return this._y;
4085
- }
4086
- set y(value) {
4087
- value = this.getConfig().parseY(value);
4088
- if (value === this._y) {
4089
- return;
4090
- }
4091
- this._y = value;
4092
- this.commitPositionProperties();
4093
- }
4094
- get paddingTop() {
4095
- return this.getConfig().paddingTop;
4096
- }
4097
- get paddingLeft() {
4098
- return this.getConfig().paddingLeft;
4099
- }
4100
- get paddingRight() {
4101
- return this.getConfig().paddingRight;
4102
- }
4103
- get paddingBottom() {
4104
- return this.getConfig().paddingBottom;
4105
- }
4106
- }
4107
-
4108
- class WindowImpl extends WindowBase {
4109
- // --------------------------------------------------------------------------
4110
- //
4111
- // Constructor
3815
+ // Constructor
4112
3816
  //
4113
3817
  // --------------------------------------------------------------------------
4114
3818
  constructor(properties) {
@@ -4460,516 +4164,446 @@ WindowImpl.BLINK_DELAY = 500;
4460
4164
  WindowImpl.SHAKE_DELAY = 500;
4461
4165
  WindowImpl.RESIZE_DELAY = 200;
4462
4166
 
4463
- class WindowResizeable extends WindowImpl {
4167
+ class BottomSheetImpl extends DestroyableContainer {
4464
4168
  // --------------------------------------------------------------------------
4465
4169
  //
4466
- // Protected Methods
4170
+ // Constructor
4467
4171
  //
4468
4172
  // --------------------------------------------------------------------------
4469
- setProperties() {
4470
- super.setProperties();
4471
- if (!this.config.isResizeable) {
4472
- return;
4473
- }
4474
- ViewUtil.addClass(this.container, 'vi-resizeable');
4475
- if (_.isNil(this.resizeMoveHandlerProxy)) {
4476
- this.resizeMoveHandlerProxy = this.resizeMoveHandler.bind(this);
4477
- }
4478
- let edges = {};
4479
- edges.top = true;
4480
- edges.left = true;
4481
- edges.right = true;
4482
- edges.bottom = true;
4483
- let param = {};
4484
- param.edges = edges;
4485
- this.interactable.resizable(param);
4486
- this.interactable.on('resizemove', this.resizeMoveHandlerProxy);
4173
+ constructor(properties) {
4174
+ super();
4175
+ // --------------------------------------------------------------------------
4176
+ //
4177
+ // Properties
4178
+ //
4179
+ // --------------------------------------------------------------------------
4180
+ this._isBlink = false;
4181
+ this._isDisabled = false;
4182
+ // --------------------------------------------------------------------------
4183
+ //
4184
+ // Protected Methods
4185
+ //
4186
+ // --------------------------------------------------------------------------
4187
+ this.setClosed = () => {
4188
+ this.emit(WindowEvent.CLOSED);
4189
+ this.destroy();
4190
+ };
4191
+ this.setOpened = () => {
4192
+ this.emit(WindowEvent.OPENED);
4193
+ };
4194
+ this.blinkToggle = () => {
4195
+ this.isBlink = !this.isBlink;
4196
+ };
4197
+ this.mouseDownHandlerProxy = (event) => {
4198
+ this.mouseDownHandler(event);
4199
+ };
4200
+ this.mouseClickHandlerProxy = (event) => {
4201
+ this.mouseClickHandler(event);
4202
+ };
4203
+ this.observer = new Subject();
4204
+ this.properties = properties;
4205
+ this.content.window = this;
4206
+ // Have to save for unsubscribe on destroy
4207
+ this._wrapper = this.properties.overlay.hostElement;
4208
+ this._backdrop = this.properties.overlay.backdropElement;
4209
+ this._container = this.properties.overlay.overlayElement;
4210
+ this.setProperties();
4211
+ this.elementsCreate();
4212
+ this.getReference().afterOpened().pipe(takeUntil(this.destroyed)).subscribe(this.setOpened);
4213
+ this.getReference().afterDismissed().pipe(takeUntil(this.destroyed)).subscribe(this.setClosed);
4487
4214
  }
4488
4215
  // --------------------------------------------------------------------------
4489
4216
  //
4490
- // Event Handlers
4217
+ // Elements Methods
4491
4218
  //
4492
4219
  // --------------------------------------------------------------------------
4493
- resizeMoveHandler(event) {
4494
- if (this.isMinimized) {
4495
- return;
4220
+ elementsCreate() {
4221
+ this.elements = new Array();
4222
+ }
4223
+ elementsDestroy() {
4224
+ this.elements.forEach(item => this.elementDestroy(item));
4225
+ this.elements = null;
4226
+ }
4227
+ elementAdd(item) {
4228
+ this.elements.push(item);
4229
+ item.instance.window = this;
4230
+ return item;
4231
+ }
4232
+ elementRemove(item) {
4233
+ ArrayUtil.remove(this.elements, item);
4234
+ this.elementDestroy(item);
4235
+ return item;
4236
+ }
4237
+ elementDestroy(item) {
4238
+ item.instance.window = null;
4239
+ item.destroy();
4240
+ return item;
4241
+ }
4242
+ setProperties() {
4243
+ ViewUtil.addClass(this.container, 'vi-bottom-sheet');
4244
+ ViewUtil.toggleClass(this.container, 'vi-modal', this.config.isModal);
4245
+ this.container.addEventListener('click', this.mouseClickHandlerProxy, true);
4246
+ this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4247
+ /*
4248
+ if (!this.config.isModal) {
4249
+ this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4496
4250
  }
4497
- let isChanged = event.dx !== 0 || event.dy !== 0;
4498
- if (!isChanged) {
4499
- return;
4251
+ */
4252
+ }
4253
+ commitIsBlinkProperties() { }
4254
+ commitIsDisabledProperties() { }
4255
+ getConfig() {
4256
+ return this.properties.config;
4257
+ }
4258
+ getContainer() {
4259
+ return this.container;
4260
+ }
4261
+ getReference() {
4262
+ return this.properties.reference;
4263
+ }
4264
+ isNeedClickStopPropagation(event) {
4265
+ let element = _.find(this.elements, item => item.location.nativeElement === event.target);
4266
+ if (_.isNil(element)) {
4267
+ return false;
4500
4268
  }
4501
- if (event.dx !== 0) {
4502
- let width = this.getWidth();
4503
- if (_.isNaN(width)) {
4504
- width = this.calculateWidth();
4505
- }
4506
- this.setWidth(width + event.dx, false);
4269
+ element.instance.clickHandler(event);
4270
+ return true;
4271
+ }
4272
+ stopBlinkIfNeed() {
4273
+ this.isBlink = false;
4274
+ if (!this.blinkTimer) {
4275
+ return;
4507
4276
  }
4508
- if (event.dy !== 0) {
4509
- let height = this.getHeight();
4510
- if (_.isNaN(height)) {
4511
- height = this.calculateHeight();
4512
- }
4513
- this.setHeight(height + event.dy, false);
4277
+ clearInterval(this.blinkTimer);
4278
+ this.blinkTimer = null;
4279
+ }
4280
+ // --------------------------------------------------------------------------
4281
+ //
4282
+ // Event Handlers
4283
+ //
4284
+ // --------------------------------------------------------------------------
4285
+ mouseDownHandler(event) {
4286
+ this.setOnTop();
4287
+ }
4288
+ mouseClickHandler(event) {
4289
+ if (this.isNeedClickStopPropagation(event)) {
4290
+ event.stopPropagation();
4514
4291
  }
4515
- this.resizeHandler();
4516
4292
  }
4517
4293
  // --------------------------------------------------------------------------
4518
4294
  //
4519
- // Public Properties
4295
+ // Public Methods
4520
4296
  //
4521
4297
  // --------------------------------------------------------------------------
4298
+ emit(event) {
4299
+ this.observer.next(event);
4300
+ }
4301
+ close() {
4302
+ this.getReference().dismiss();
4303
+ }
4522
4304
  destroy() {
4523
4305
  if (this.isDestroyed) {
4524
4306
  return;
4525
4307
  }
4526
4308
  super.destroy();
4527
- this.resizeMoveHandlerProxy = null;
4528
- if (!_.isNil(this._interactable)) {
4529
- this._interactable.unset();
4530
- this._interactable = null;
4309
+ this.elementsDestroy();
4310
+ this._container.removeEventListener('click', this.mouseClickHandlerProxy, true);
4311
+ this._container.removeEventListener('mousedown', this.mouseDownHandlerProxy);
4312
+ if (!_.isNil(this.content)) {
4313
+ this.content.destroy();
4531
4314
  }
4532
- }
4533
- // --------------------------------------------------------------------------
4534
- //
4535
- // Private Properties
4536
- //
4537
- // --------------------------------------------------------------------------
4538
- get interactable() {
4539
- if (_.isNil(this._interactable)) {
4540
- this._interactable = interact.default(this.container);
4541
- // this._interactable.styleCursor(false);
4315
+ if (!_.isNil(this.observer)) {
4316
+ this.observer.complete();
4317
+ this.observer = null;
4542
4318
  }
4543
- return this._interactable;
4319
+ this.properties = null;
4320
+ this._wrapper = null;
4321
+ this._backdrop = null;
4322
+ this._container = null;
4323
+ clearInterval(this.blinkTimer);
4324
+ this.blinkTimer = null;
4544
4325
  }
4545
- }
4546
-
4547
- class WindowDragable extends WindowResizeable {
4548
- constructor() {
4549
- // --------------------------------------------------------------------------
4550
- //
4551
- // Properties Methods
4552
- //
4553
- // --------------------------------------------------------------------------
4554
- super(...arguments);
4555
- this.isWasDragged = false;
4326
+ blink() {
4327
+ clearInterval(this.blinkTimer);
4328
+ this.blinkTimer = setInterval(this.blinkToggle, WindowImpl.BLINK_DELAY);
4556
4329
  }
4330
+ shake() { }
4331
+ setOnTop() { }
4557
4332
  // --------------------------------------------------------------------------
4558
4333
  //
4559
- // Protected Methods
4334
+ // Size Methods
4560
4335
  //
4561
4336
  // --------------------------------------------------------------------------
4562
- setProperties() {
4563
- super.setProperties();
4564
- if (this.config.isModal) {
4565
- return;
4566
- }
4567
- ViewUtil.addClass(this.container, 'vi-draggable');
4568
- if (!this.config.isContentDragable) {
4569
- return;
4570
- }
4571
- this.dragMoveHandlerProxy = this.dragMoveHandler.bind(this);
4572
- this.dragStartHandlerProxy = this.dragStartHandler.bind(this);
4573
- let param = {};
4574
- // let param = {} as any;
4575
- this.interactable.draggable(param);
4576
- this.interactable.on('dragmove', this.dragMoveHandlerProxy);
4577
- this.interactable.on('dragstart', this.dragStartHandlerProxy);
4337
+ getWidth() {
4338
+ return NaN;
4578
4339
  }
4579
- isNeedClickStopPropagation(event) {
4580
- return this.isWasDragged || super.isNeedClickStopPropagation(event);
4340
+ getHeight() {
4341
+ return NaN;
4581
4342
  }
4343
+ setWidth(value, isNeedNotify = true) { }
4344
+ setHeight(value, isNeedNotify = true) { }
4345
+ setSize(width, height) { }
4582
4346
  // --------------------------------------------------------------------------
4583
4347
  //
4584
- // Event Handlers
4348
+ // Move Methods
4585
4349
  //
4586
4350
  // --------------------------------------------------------------------------
4587
- dragStartHandler(event) {
4588
- this.isWasDragged = true;
4589
- }
4590
- dragMoveHandler(event) {
4591
- let x = this.getX() + event.dx;
4592
- let y = this.getY() + event.dy;
4593
- this.move(x, y);
4351
+ getX() {
4352
+ return NaN;
4594
4353
  }
4595
- mouseClickHandler(event) {
4596
- super.mouseClickHandler(event);
4597
- this.isWasDragged = false;
4354
+ setX(value, isNeedNotify = true) { }
4355
+ getY() {
4356
+ return NaN;
4598
4357
  }
4358
+ setY(value, isNeedNotify = true) { }
4359
+ move(x, y) { }
4599
4360
  // --------------------------------------------------------------------------
4600
4361
  //
4601
- // Public Methods
4362
+ // Private Properties
4602
4363
  //
4603
4364
  // --------------------------------------------------------------------------
4604
- destroy() {
4605
- if (this.isDestroyed) {
4365
+ get reference() {
4366
+ return this.properties.reference;
4367
+ }
4368
+ get isBlink() {
4369
+ return this._isBlink;
4370
+ }
4371
+ set isBlink(value) {
4372
+ if (value === this._isBlink) {
4606
4373
  return;
4607
4374
  }
4608
- super.destroy();
4609
- this.dragMoveHandlerProxy = null;
4610
- this.dragStartHandlerProxy = null;
4375
+ this._isBlink = value;
4376
+ this.commitIsBlinkProperties();
4611
4377
  }
4612
- }
4613
-
4614
- class WindowBaseComponent extends WindowDragable {
4378
+ get isShaking() {
4379
+ return false;
4380
+ }
4381
+ set isShaking(value) { }
4615
4382
  // --------------------------------------------------------------------------
4616
4383
  //
4617
- // Protected Methods
4384
+ // Public Properties
4618
4385
  //
4619
4386
  // --------------------------------------------------------------------------
4620
- elementsCreate() {
4621
- super.elementsCreate();
4622
- if (!(this.content.container instanceof ViewContainerRef)) {
4623
- return;
4624
- }
4625
- if (!this.config.disableClose) {
4626
- this.elementAdd(this.content.container.createComponent(WindowBaseComponent.CLOSE_COMPONENT));
4627
- }
4628
- if (this.config.isResizeable) {
4629
- this.elementAdd(this.content.container.createComponent(WindowBaseComponent.RESIZE_COMPONENT));
4630
- }
4631
- if (this.config.isMinimizable) {
4632
- this.elementAdd(this.content.container.createComponent(WindowBaseComponent.MINIMIZE_COMPONENT));
4633
- }
4634
- if (this.config.isExpandable) {
4635
- this.elementAdd(this.content.container.createComponent(WindowBaseComponent.EXPAND_COMPONENT));
4636
- }
4387
+ get events() {
4388
+ return this.observer.asObservable();
4637
4389
  }
4638
- commitIsBlinkProperties() {
4639
- ViewUtil.toggleClass(this.container, this.blinkClass, this.isBlink);
4390
+ get config() {
4391
+ return this.properties.config;
4640
4392
  }
4641
- commitIsDisabledProperties() {
4642
- ViewUtil.toggleClass(this.container, this.disabledClass, this.isDisabled);
4643
- ViewUtil.toggleClass(this.content.element, this.disabledClass, this.isDisabled);
4644
- ViewUtil.toggleClass(this.content.element.nativeElement.parentElement, this.disabledClass, this.isDisabled);
4393
+ get content() {
4394
+ return !_.isNil(this.reference) ? this.reference.instance : null;
4645
4395
  }
4646
- commitIsShakingProperties() {
4647
- ViewUtil.toggleClasses(this.container, this.shakingClass, this.isShaking);
4396
+ get container() {
4397
+ return this._container;
4648
4398
  }
4649
- commitIsMinimizedProperties() {
4650
- ViewUtil.toggleClass(this.container, this.minimizedClass, this.isMinimized);
4651
- ViewUtil.toggleClass(this.content.element, this.minimizedClass, this.isMinimized);
4652
- ViewUtil.toggleClass(this.content.element.nativeElement.parentElement, this.minimizedClass, this.isMinimized);
4399
+ get wrapper() {
4400
+ return this._wrapper;
4653
4401
  }
4654
- // --------------------------------------------------------------------------
4655
- //
4656
- // Protected Properties
4657
- //
4658
- // --------------------------------------------------------------------------
4659
- get blinkClass() {
4660
- return 'vi-blink';
4402
+ get backdrop() {
4403
+ return this._backdrop;
4661
4404
  }
4662
- get disabledClass() {
4663
- return 'vi-disabled';
4405
+ get isOnTop() {
4406
+ return false;
4664
4407
  }
4665
- get minimizedClass() {
4666
- return 'vi-minimized';
4408
+ set isOnTop(value) { }
4409
+ get isMinimized() {
4410
+ return false;
4667
4411
  }
4668
- get shakingClass() {
4669
- return 'shake-constant shake-horizontal';
4412
+ set isMinimized(value) { }
4413
+ get isDisabled() {
4414
+ return this._isDisabled;
4415
+ }
4416
+ set isDisabled(value) {
4417
+ if (value === this._isDisabled) {
4418
+ return;
4419
+ }
4420
+ this._isDisabled = value;
4421
+ this.commitIsDisabledProperties();
4422
+ this.emit(WindowEvent.DISABLED_CHANGED);
4670
4423
  }
4671
4424
  }
4672
4425
  // --------------------------------------------------------------------------
4673
4426
  //
4674
- // Static Properties
4427
+ // Constants
4675
4428
  //
4676
4429
  // --------------------------------------------------------------------------
4677
- WindowBaseComponent.CLOSE_COMPONENT = WindowCloseElementComponent;
4678
- WindowBaseComponent.EXPAND_COMPONENT = WindowExpandElementComponent;
4679
- WindowBaseComponent.RESIZE_COMPONENT = WindowResizeElementComponent;
4680
- WindowBaseComponent.MINIMIZE_COMPONENT = WindowMinimizeElementComponent;
4430
+ BottomSheetImpl.BLINK_DELAY = 500;
4431
+ BottomSheetImpl.SHAKE_DELAY = 500;
4681
4432
 
4682
- class WindowService extends Destroyable {
4683
- // public topZIndex: number = 1001;
4433
+ class WindowElement extends DestroyableContainer {
4684
4434
  // --------------------------------------------------------------------------
4685
4435
  //
4686
4436
  // Constructor
4687
4437
  //
4688
4438
  // --------------------------------------------------------------------------
4689
- constructor(dialog, language, cookies, sheet) {
4439
+ constructor(element) {
4690
4440
  super();
4691
- this.sheet = sheet;
4692
- this.isNeedCheckPositionAfterOpen = true;
4693
- this.gapX = 25;
4694
- this.gapY = 25;
4695
- this.minWidth = 100;
4696
- this.minHeight = 100;
4697
- this.paddingTop = 25;
4698
- this.paddingLeft = 25;
4699
- this.paddingRight = 25;
4700
- this.paddingBottom = 25;
4701
- this.defaultVerticalAlign = WindowAlign.CENTER;
4702
- this.defaultHorizontalAlign = WindowAlign.CENTER;
4703
- this.topZIndex = WindowService.Z_INDEX_MAX;
4704
- this._windows = new Map();
4705
- this.dialog = dialog;
4706
- this.language = language;
4707
- this.observer = new Subject();
4708
- this.properties = new PropertiesManager(cookies);
4709
- this.factory = new WindowFactory(WindowBaseComponent);
4710
- this.questionComponent = WindowQuestionComponent;
4441
+ this.element = element;
4442
+ }
4443
+ // --------------------------------------------------------------------------
4444
+ //
4445
+ // Private Methods
4446
+ //
4447
+ // --------------------------------------------------------------------------
4448
+ checkWindowParent() {
4449
+ let container = this.getContainer();
4450
+ if (!_.isNil(container)) {
4451
+ ViewUtil.appendChild(container, this.element.nativeElement);
4452
+ }
4453
+ }
4454
+ getContainer() {
4455
+ let item = ViewUtil.parseElement(this.element.nativeElement);
4456
+ while (!_.isNil(item) && item.nodeName.toLowerCase() !== 'mat-dialog-container') {
4457
+ item = item.parentElement;
4458
+ }
4459
+ return item;
4711
4460
  }
4461
+ createChildren() { }
4462
+ destroyChildren() { }
4463
+ commitWindowProperties() { }
4712
4464
  // --------------------------------------------------------------------------
4713
4465
  //
4714
- // Static Methods
4466
+ // Public Methods
4715
4467
  //
4716
4468
  // --------------------------------------------------------------------------
4717
- static getZIndex(window) {
4718
- return !_.isNil(window) && !_.isNil(window.container) ? parseInt(ViewUtil.getStyle(window.container.parentElement, 'zIndex'), 10) : -1;
4469
+ ngAfterViewInit() {
4470
+ this.createChildren();
4471
+ this.checkWindowParent();
4719
4472
  }
4720
- static setZIndex(window, index) {
4721
- if (_.isNil(window)) {
4473
+ destroy() {
4474
+ if (this.isDestroyed) {
4722
4475
  return;
4723
4476
  }
4724
- if (!_.isNil(window.backdrop)) {
4725
- ViewUtil.setStyle(window.backdrop, 'zIndex', index);
4726
- }
4727
- if (!_.isNil(window.wrapper)) {
4728
- ViewUtil.setStyle(window.wrapper, 'zIndex', index);
4729
- }
4477
+ super.destroy();
4478
+ this.destroyChildren();
4479
+ this.element = null;
4480
+ this.window = null;
4730
4481
  }
4731
4482
  // --------------------------------------------------------------------------
4732
4483
  //
4733
- // Private Methods
4484
+ // Event Handlers
4734
4485
  //
4735
4486
  // --------------------------------------------------------------------------
4736
- sortFunction(first, second) {
4737
- return WindowService.getZIndex(first) > WindowService.getZIndex(second) ? -1 : 1;
4738
- }
4739
- updateTop() {
4740
- let zIndex = 0;
4741
- let topWindow = null;
4742
- let windows = [...this.windowsArray, this.sheet.window];
4743
- for (let window of windows) {
4744
- if (_.isNil(window) || _.isNil(window.container)) {
4745
- continue;
4746
- }
4747
- let index = WindowService.getZIndex(window);
4748
- if (zIndex >= index) {
4749
- continue;
4750
- }
4751
- zIndex = index;
4752
- topWindow = window;
4753
- }
4754
- if (_.isNil(topWindow) || topWindow.isOnTop) {
4755
- return;
4756
- }
4757
- topWindow.isOnTop = true;
4758
- this.observer.next(new ObservableData(WindowServiceEvent.SETTED_ON_TOP, topWindow));
4759
- }
4760
- setWindowOnTop(topWindow) {
4761
- let currentIndex = this.topZIndex - 2;
4762
- let windows = [...this.windowsArray, this.sheet.window];
4763
- for (let window of windows) {
4764
- if (_.isNil(window) || _.isNil(window.container)) {
4765
- continue;
4766
- }
4767
- window.isOnTop = window === topWindow;
4768
- let zIndex = window.isOnTop ? this.topZIndex : currentIndex--;
4769
- WindowService.setZIndex(window, zIndex);
4770
- }
4771
- this.windowsArray.sort(this.sortFunction);
4772
- this.observer.next(new ObservableData(WindowServiceEvent.SETTED_ON_TOP, topWindow));
4773
- }
4774
- checkPosition(item) {
4775
- while (this.hasSamePosition(item)) {
4776
- item.move(item.getX() + this.gapX, item.getY() + this.gapY);
4777
- }
4778
- }
4779
- hasSamePosition(itemWindow) {
4780
- let x = itemWindow.getX();
4781
- let y = itemWindow.getY();
4782
- let result = false;
4783
- this.windowsArray.forEach(window => {
4784
- if (window !== itemWindow && x === window.getX() && y === window.getY()) {
4785
- result = true;
4786
- }
4787
- });
4788
- return result;
4487
+ clickHandler(event) {
4488
+ event.stopPropagation();
4789
4489
  }
4790
4490
  // --------------------------------------------------------------------------
4791
4491
  //
4792
- // Setters Methods
4492
+ // Protected Properties
4793
4493
  //
4794
4494
  // --------------------------------------------------------------------------
4795
- add(config, content) {
4796
- this._windows.set(config, content);
4797
- this.observer.next(new ObservableData(WindowServiceEvent.OPENED, content.window));
4798
- }
4799
- remove(config) {
4800
- let window = this._windows.get(config);
4801
- if (!window) {
4802
- return null;
4803
- }
4804
- window.close();
4805
- this._windows.delete(config);
4806
- this.observer.next(new ObservableData(WindowServiceEvent.CLOSED, window.window));
4495
+ get nativeElement() {
4496
+ return this.element ? this.element.nativeElement : null;
4807
4497
  }
4808
- getById(id) {
4809
- let item = _.find(Array.from(this._windows.values()), item => item.config.id === id);
4810
- return !_.isNil(item) ? item.window : null;
4498
+ // --------------------------------------------------------------------------
4499
+ //
4500
+ // Public Properties
4501
+ //
4502
+ // --------------------------------------------------------------------------
4503
+ get window() {
4504
+ return this._window;
4811
4505
  }
4812
- setDefaultProperties(config) {
4813
- if (!config.verticalAlign) {
4814
- config.verticalAlign = this.defaultVerticalAlign;
4815
- }
4816
- if (!config.horizontalAlign) {
4817
- config.horizontalAlign = this.defaultHorizontalAlign;
4818
- }
4819
- if (_.isNaN(config.defaultMinWidth)) {
4820
- config.defaultMinWidth = this.minWidth;
4821
- }
4822
- if (_.isNaN(config.defaultMinHeight)) {
4823
- config.defaultMinHeight = this.minHeight;
4824
- }
4825
- if (_.isNaN(config.paddingTop)) {
4826
- config.paddingTop = this.paddingTop;
4827
- }
4828
- if (_.isNaN(config.paddingLeft)) {
4829
- config.paddingLeft = this.paddingLeft;
4830
- }
4831
- if (_.isNaN(config.paddingRight)) {
4832
- config.paddingRight = this.paddingRight;
4833
- }
4834
- if (_.isNaN(config.paddingBottom)) {
4835
- config.paddingBottom = this.paddingBottom;
4506
+ set window(value) {
4507
+ if (value === this._window) {
4508
+ return;
4836
4509
  }
4837
- if (config.propertiesId) {
4838
- this.properties.load(config.propertiesId, config);
4510
+ this._window = value;
4511
+ if (this.window) {
4512
+ this.commitWindowProperties();
4839
4513
  }
4840
- config.setDefaultProperties();
4841
4514
  }
4515
+ }
4516
+ WindowElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowElement, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4517
+ WindowElement.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowElement, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
4518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowElement, decorators: [{
4519
+ type: Component,
4520
+ args: [{ template: '' }]
4521
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4522
+
4523
+ class WindowCloseElementComponent extends WindowElement {
4842
4524
  // --------------------------------------------------------------------------
4843
4525
  //
4844
- // Public Methods
4526
+ // Constructor
4845
4527
  //
4846
4528
  // --------------------------------------------------------------------------
4847
- open(component, config) {
4848
- let window = null;
4849
- if (config.id) {
4850
- window = this.getById(config.id);
4851
- if (window) {
4852
- return window.content;
4853
- }
4854
- }
4855
- this.setDefaultProperties(config);
4856
- // let dialog = this.dialog as any;
4857
- // dialog._getOverlayState = config.isModal ? dialog.getOverlayStateModal : dialog.getOverlayStateNonModal;
4858
- let reference = this.dialog.open(component, config);
4859
- window = this.factory.create({ config, reference, overlay: reference._overlayRef });
4860
- this.observer.next(new ObservableData(WindowServiceEvent.OPEN_STARTED, window));
4861
- let subscription = window.events.subscribe(event => {
4862
- switch (event) {
4863
- case WindowEvent.OPENED:
4864
- this.add(config, reference.componentInstance);
4865
- this.setWindowOnTop(window);
4866
- if (this.isNeedCheckPositionAfterOpen) {
4867
- this.checkPosition(window);
4868
- }
4869
- this.observer.next(new ObservableData(WindowServiceEvent.OPEN_FINISHED, window));
4870
- break;
4871
- case WindowEvent.CLOSED:
4872
- subscription.unsubscribe();
4873
- this.remove(config);
4874
- if (window.isOnTop && this.windows.size > 0) {
4875
- this.updateTop();
4876
- }
4877
- break;
4878
- case WindowEvent.RESIZED:
4879
- if (!_.isNil(config.propertiesId)) {
4880
- this.properties.save(config.propertiesId, window);
4881
- }
4882
- break;
4883
- case WindowEvent.SET_ON_TOP:
4884
- this.setWindowOnTop(window);
4885
- break;
4886
- }
4887
- });
4888
- return window.content;
4529
+ constructor(element) {
4530
+ super(element);
4889
4531
  }
4890
- get(value) {
4891
- let id = value.toString();
4892
- if (value instanceof WindowConfig) {
4893
- id = value.id;
4894
- }
4895
- if (!id) {
4896
- return null;
4897
- }
4898
- let window = this.getById(id);
4899
- if (_.isNil(window)) {
4900
- return null;
4532
+ // --------------------------------------------------------------------------
4533
+ //
4534
+ // Private Methods
4535
+ //
4536
+ // --------------------------------------------------------------------------
4537
+ createChildren() {
4538
+ super.createChildren();
4539
+ if (!_.isNil(WindowCloseElementComponent.ICON_VALUE)) {
4540
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowCloseElementComponent.ICON_VALUE);
4901
4541
  }
4902
- return window.content;
4903
- }
4904
- has(value) {
4905
- return !_.isNil(this.get(value));
4906
- }
4907
- setOnTop(value) {
4908
- let content = this.get(value);
4909
- if (!content) {
4910
- return false;
4542
+ if (!_.isNil(WindowCloseElementComponent.ICON_CLASS)) {
4543
+ ViewUtil.addClasses(this.nativeElement, WindowCloseElementComponent.ICON_CLASS);
4911
4544
  }
4912
- content.window.setOnTop();
4913
- return true;
4914
- }
4915
- removeAll() {
4916
- this.windowsArray.forEach(window => window.close());
4545
+ ViewUtil.addClass(this.nativeElement, 'mouse-active');
4917
4546
  }
4918
- destroy() {
4919
- if (this.isDestroyed) {
4920
- return;
4921
- }
4922
- super.destroy();
4923
- this.removeAll();
4924
- if (!_.isNil(this.observer)) {
4925
- this.observer.complete();
4926
- this.observer = null;
4927
- }
4928
- if (!_.isNil(this.properties)) {
4929
- this.properties.destroy();
4930
- this.properties = null;
4547
+ // --------------------------------------------------------------------------
4548
+ //
4549
+ // Event Handlers
4550
+ //
4551
+ // --------------------------------------------------------------------------
4552
+ clickHandler(event) {
4553
+ super.clickHandler(event);
4554
+ if (!_.isNil(this.window)) {
4555
+ this.window.close();
4931
4556
  }
4932
- this.factory = null;
4933
- this.questionComponent = null;
4934
- this.dialog = null;
4935
- this.language = null;
4936
- this._windows = null;
4937
4557
  }
4558
+ }
4559
+ // --------------------------------------------------------------------------
4560
+ //
4561
+ // Constants
4562
+ //
4563
+ // --------------------------------------------------------------------------
4564
+ WindowCloseElementComponent.ICON_CLASS = 'fas fa-times';
4565
+ WindowCloseElementComponent.ICON_VALUE = null;
4566
+ WindowCloseElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowCloseElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4567
+ WindowCloseElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowCloseElementComponent, selector: "vi-window-close-element", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] });
4568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowCloseElementComponent, decorators: [{
4569
+ type: Component,
4570
+ args: [{ selector: 'vi-window-close-element', template: '', styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] }]
4571
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4572
+
4573
+ class WindowExpandElementComponent extends WindowElement {
4938
4574
  // --------------------------------------------------------------------------
4939
4575
  //
4940
- // Additional Methods
4576
+ // Constructor
4941
4577
  //
4942
4578
  // --------------------------------------------------------------------------
4943
- info(translationId, translation, questionOptions, configOptions) {
4944
- let text = this.language.translate(translationId, translation);
4945
- let config = _.assign(new WindowConfig(true, false, 450), configOptions);
4946
- config.data = new QuestionManager(_.assign(questionOptions, { mode: QuestionMode.INFO, text }));
4947
- return this.open(this.questionComponent, config).config.data;
4948
- }
4949
- question(translationId, translation, questionOptions, configOptions) {
4950
- let text = this.language.translate(translationId, translation);
4951
- let config = _.assign(new WindowConfig(true, false, 450), configOptions);
4952
- config.data = new QuestionManager(_.assign(questionOptions, { mode: QuestionMode.QUESTION, text }));
4953
- return this.open(this.questionComponent, config).config.data;
4579
+ constructor(element) {
4580
+ super(element);
4954
4581
  }
4955
4582
  // --------------------------------------------------------------------------
4956
4583
  //
4957
- // Private Properties
4584
+ // Private Methods
4958
4585
  //
4959
4586
  // --------------------------------------------------------------------------
4960
- get windowsArray() {
4961
- return Array.from(this.windows.values()).map(item => item.window);
4587
+ createChildren() {
4588
+ super.createChildren();
4589
+ if (!_.isNil(WindowExpandElementComponent.ICON_VALUE)) {
4590
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowExpandElementComponent.ICON_VALUE);
4591
+ }
4592
+ if (!_.isNil(WindowExpandElementComponent.ICON_CLASS)) {
4593
+ ViewUtil.addClasses(this.nativeElement, WindowExpandElementComponent.ICON_CLASS);
4594
+ }
4595
+ ViewUtil.addClass(this.nativeElement, 'mouse-active');
4962
4596
  }
4963
4597
  // --------------------------------------------------------------------------
4964
4598
  //
4965
- // Public Properties
4599
+ // Event Handlers
4966
4600
  //
4967
4601
  // --------------------------------------------------------------------------
4968
- get events() {
4969
- return this.observer.asObservable();
4970
- }
4971
- get windows() {
4972
- return this._windows;
4602
+ clickHandler(event) {
4603
+ super.clickHandler(event);
4604
+ if (!_.isNil(this.window)) {
4605
+ this.window.emit(WindowEvent.EXPAND);
4606
+ }
4973
4607
  }
4974
4608
  }
4975
4609
  // --------------------------------------------------------------------------
@@ -4977,328 +4611,351 @@ class WindowService extends Destroyable {
4977
4611
  // Constants
4978
4612
  //
4979
4613
  // --------------------------------------------------------------------------
4980
- WindowService.Z_INDEX_MAX = 1000;
4981
- WindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, deps: [{ token: i1.MatDialog }, { token: i1$1.LanguageService }, { token: CookieService }, { token: BottomSheetService }], target: i0.ɵɵFactoryTarget.Injectable });
4982
- WindowServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, providedIn: 'root' });
4983
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, decorators: [{
4984
- type: Injectable,
4985
- args: [{ providedIn: 'root' }]
4986
- }], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i1$1.LanguageService }, { type: CookieService }, { type: BottomSheetService }]; } });
4987
- class PropertiesManager extends Destroyable {
4614
+ WindowExpandElementComponent.ICON_CLASS = 'fas fa-angle-double-up';
4615
+ WindowExpandElementComponent.ICON_VALUE = null;
4616
+ WindowExpandElementComponentfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowExpandElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4617
+ WindowExpandElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowExpandElementComponent, selector: "vi-window-expand-element", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] });
4618
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowExpandElementComponent, decorators: [{
4619
+ type: Component,
4620
+ args: [{ selector: 'vi-window-expand-element', template: '', styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] }]
4621
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4622
+
4623
+ class WindowResizeElementComponent extends WindowElement {
4988
4624
  // --------------------------------------------------------------------------
4989
4625
  //
4990
4626
  // Constructor
4991
4627
  //
4992
4628
  // --------------------------------------------------------------------------
4993
- constructor(cookies) {
4994
- super();
4995
- this.cookies = cookies;
4629
+ constructor(element) {
4630
+ super(element);
4996
4631
  }
4997
4632
  // --------------------------------------------------------------------------
4998
4633
  //
4999
- // Public Methods
4634
+ // Private Methods
5000
4635
  //
5001
4636
  // --------------------------------------------------------------------------
5002
- load(name, config) {
5003
- let item = this.cookies.getObject(name + 'Window');
5004
- if (!item) {
5005
- return;
5006
- }
5007
- if (item.hasOwnProperty('width')) {
5008
- config.defaultWidth = item.width;
4637
+ createChildren() {
4638
+ super.createChildren();
4639
+ if (!_.isNil(WindowResizeElementComponent.ICON_VALUE)) {
4640
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowResizeElementComponent.ICON_VALUE);
5009
4641
  }
5010
- if (item.hasOwnProperty('height')) {
5011
- config.defaultHeight = item.height;
4642
+ if (!_.isNil(WindowResizeElementComponent.ICON_CLASS)) {
4643
+ ViewUtil.addClasses(this.nativeElement, WindowResizeElementComponent.ICON_CLASS);
5012
4644
  }
4645
+ ViewUtil.setStyle(this.nativeElement, 'cursor', 'pointer');
5013
4646
  }
5014
- save(name, window) {
5015
- this.cookies.putObject(name + 'Window', {
5016
- width: window.getWidth(),
5017
- height: window.getHeight()
5018
- });
5019
- }
5020
- destroy() {
5021
- if (this.isDestroyed) {
5022
- return;
4647
+ // --------------------------------------------------------------------------
4648
+ //
4649
+ // Event Handlers
4650
+ //
4651
+ // --------------------------------------------------------------------------
4652
+ clickHandler(event) {
4653
+ super.clickHandler(event);
4654
+ if (!_.isNil(this.window)) {
4655
+ this.window.emit(WindowEvent.EXPAND);
5023
4656
  }
5024
- super.destroy();
5025
- this.cookies = null;
5026
4657
  }
5027
4658
  }
5028
- var WindowServiceEvent;
5029
- (function (WindowServiceEvent) {
5030
- WindowServiceEvent["OPEN_STARTED"] = "OPEN_STARTED";
5031
- WindowServiceEvent["OPENED"] = "OPENED";
5032
- WindowServiceEvent["OPEN_FINISHED"] = "OPEN_FINISHED";
5033
- WindowServiceEvent["CLOSED"] = "CLOSED";
5034
- WindowServiceEvent["SETTED_ON_TOP"] = "SETTED_ON_TOP";
5035
- })(WindowServiceEvent || (WindowServiceEvent = {}));
4659
+ // --------------------------------------------------------------------------
4660
+ //
4661
+ // Constants
4662
+ //
4663
+ // --------------------------------------------------------------------------
4664
+ WindowResizeElementComponent.ICON_CLASS = 'fas fa-arrows-alt';
4665
+ WindowResizeElementComponent.ICON_VALUE = null;
4666
+ WindowResizeElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowResizeElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4667
+ WindowResizeElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowResizeElementComponent, selector: "vi-window-resize-element", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] });
4668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowResizeElementComponent, decorators: [{
4669
+ type: Component,
4670
+ args: [{ selector: 'vi-window-resize-element', template: '', styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] }]
4671
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
5036
4672
 
5037
- class BottomSheetImpl extends DestroyableContainer {
4673
+ class WindowMinimizeElementComponent extends WindowElement {
5038
4674
  // --------------------------------------------------------------------------
5039
4675
  //
5040
- // Constructor
4676
+ // Constructor
5041
4677
  //
5042
4678
  // --------------------------------------------------------------------------
5043
- constructor(properties) {
5044
- super();
5045
- // --------------------------------------------------------------------------
5046
- //
5047
- // Properties
5048
- //
5049
- // --------------------------------------------------------------------------
5050
- this._isBlink = false;
5051
- this._isDisabled = false;
4679
+ constructor(element) {
4680
+ super(element);
5052
4681
  // --------------------------------------------------------------------------
5053
4682
  //
5054
- // Protected Methods
4683
+ // Private Methods
5055
4684
  //
5056
4685
  // --------------------------------------------------------------------------
5057
- this.setClosed = () => {
5058
- this.emit(WindowEvent.CLOSED);
5059
- this.destroy();
5060
- };
5061
- this.setOpened = () => {
5062
- this.emit(WindowEvent.OPENED);
5063
- };
5064
- this.blinkToggle = () => {
5065
- this.isBlink = !this.isBlink;
5066
- };
5067
- this.mouseDownHandlerProxy = (event) => {
5068
- this.mouseDownHandler(event);
5069
- };
5070
- this.mouseClickHandlerProxy = (event) => {
5071
- this.mouseClickHandler(event);
4686
+ this.commitIconProperties = () => {
4687
+ let icon = this.window.isMinimized ? WindowMinimizeElementComponent.ICON_MAXIMIZE_VALUE : WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE;
4688
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', icon);
5072
4689
  };
5073
- this.observer = new Subject();
5074
- this.properties = properties;
5075
- this.content.window = this;
5076
- // Have to save for unsubscribe on destroy
5077
- this._wrapper = this.properties.overlay.hostElement;
5078
- this._backdrop = this.properties.overlay.backdropElement;
5079
- this._container = this.properties.overlay.overlayElement;
5080
- this.setProperties();
5081
- this.elementsCreate();
5082
- this.getReference().afterOpened().pipe(takeUntil(this.destroyed)).subscribe(this.setOpened);
5083
- this.getReference().afterDismissed().pipe(takeUntil(this.destroyed)).subscribe(this.setClosed);
5084
4690
  }
5085
4691
  // --------------------------------------------------------------------------
5086
4692
  //
5087
- // Elements Methods
4693
+ // Protected Methods
5088
4694
  //
5089
4695
  // --------------------------------------------------------------------------
5090
- elementsCreate() {
5091
- this.elements = new Array();
5092
- }
5093
- elementsDestroy() {
5094
- this.elements.forEach(item => this.elementDestroy(item));
5095
- this.elements = null;
5096
- }
5097
- elementAdd(item) {
5098
- this.elements.push(item);
5099
- item.instance.window = this;
5100
- return item;
5101
- }
5102
- elementRemove(item) {
5103
- ArrayUtil.remove(this.elements, item);
5104
- this.elementDestroy(item);
5105
- return item;
5106
- }
5107
- elementDestroy(item) {
5108
- item.instance.window = null;
5109
- item.destroy();
5110
- return item;
4696
+ commitWindowProperties() {
4697
+ super.commitWindowProperties();
4698
+ this.window.events.pipe(takeUntil(this.destroyed)).subscribe(event => {
4699
+ if (event === WindowEvent.MINIMIZED_CHANGED) {
4700
+ this.commitIconProperties();
4701
+ }
4702
+ });
5111
4703
  }
5112
- setProperties() {
5113
- ViewUtil.addClass(this.container, 'vi-bottom-sheet');
5114
- ViewUtil.toggleClass(this.container, 'vi-modal', this.config.isModal);
5115
- this.container.addEventListener('click', this.mouseClickHandlerProxy, true);
5116
- this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
5117
- /*
5118
- if (!this.config.isModal) {
5119
- this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4704
+ createChildren() {
4705
+ super.createChildren();
4706
+ if (!_.isNil(WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE)) {
4707
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE);
5120
4708
  }
5121
- */
5122
- }
5123
- commitIsBlinkProperties() { }
5124
- commitIsDisabledProperties() { }
5125
- getConfig() {
5126
- return this.properties.config;
5127
- }
5128
- getContainer() {
5129
- return this.container;
5130
- }
5131
- getReference() {
5132
- return this.properties.reference;
4709
+ if (!_.isNil(WindowMinimizeElementComponent.ICON_CLASS)) {
4710
+ ViewUtil.addClasses(this.nativeElement, WindowMinimizeElementComponent.ICON_CLASS);
4711
+ }
4712
+ ViewUtil.addClass(this.nativeElement, 'mouse-active');
5133
4713
  }
5134
- isNeedClickStopPropagation(event) {
5135
- let element = _.find(this.elements, item => item.location.nativeElement === event.target);
5136
- if (_.isNil(element)) {
5137
- return false;
4714
+ // --------------------------------------------------------------------------
4715
+ //
4716
+ // Event Handlers
4717
+ //
4718
+ // --------------------------------------------------------------------------
4719
+ clickHandler(event) {
4720
+ super.clickHandler(event);
4721
+ if (!_.isNil(this.window)) {
4722
+ this.window.isMinimized = !this.window.isMinimized;
5138
4723
  }
5139
- element.instance.clickHandler(event);
5140
- return true;
5141
4724
  }
5142
- stopBlinkIfNeed() {
5143
- this.isBlink = false;
5144
- if (!this.blinkTimer) {
4725
+ }
4726
+ // --------------------------------------------------------------------------
4727
+ //
4728
+ // Constants
4729
+ //
4730
+ // --------------------------------------------------------------------------
4731
+ WindowMinimizeElementComponent.ICON_CLASS = null;
4732
+ WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE = null;
4733
+ WindowMinimizeElementComponent.ICON_MAXIMIZE_VALUE = null;
4734
+ WindowMinimizeElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowMinimizeElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4735
+ WindowMinimizeElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: WindowMinimizeElementComponent, selector: "vi-window-minimize-element", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] });
4736
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowMinimizeElementComponent, decorators: [{
4737
+ type: Component,
4738
+ args: [{ selector: 'vi-window-minimize-element', template: '', styles: [":host{display:block;position:absolute;color:#fff;background-color:#0006;border-radius:50%;padding:8px;font-size:14px;font-weight:700;text-align:center}:host:hover{background-color:#0009}:host.small{font-size:10px;padding:4px}\n"] }]
4739
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4740
+
4741
+ class WindowResizeable extends WindowImpl {
4742
+ // --------------------------------------------------------------------------
4743
+ //
4744
+ // Protected Methods
4745
+ //
4746
+ // --------------------------------------------------------------------------
4747
+ setProperties() {
4748
+ super.setProperties();
4749
+ if (!this.config.isResizeable) {
5145
4750
  return;
5146
4751
  }
5147
- clearInterval(this.blinkTimer);
5148
- this.blinkTimer = null;
4752
+ ViewUtil.addClass(this.container, 'vi-resizeable');
4753
+ if (_.isNil(this.resizeMoveHandlerProxy)) {
4754
+ this.resizeMoveHandlerProxy = this.resizeMoveHandler.bind(this);
4755
+ }
4756
+ let edges = {};
4757
+ edges.top = true;
4758
+ edges.left = true;
4759
+ edges.right = true;
4760
+ edges.bottom = true;
4761
+ let param = {};
4762
+ param.edges = edges;
4763
+ this.interactable.resizable(param);
4764
+ this.interactable.on('resizemove', this.resizeMoveHandlerProxy);
5149
4765
  }
5150
4766
  // --------------------------------------------------------------------------
5151
4767
  //
5152
4768
  // Event Handlers
5153
4769
  //
5154
4770
  // --------------------------------------------------------------------------
5155
- mouseDownHandler(event) {
5156
- this.setOnTop();
5157
- }
5158
- mouseClickHandler(event) {
5159
- if (this.isNeedClickStopPropagation(event)) {
5160
- event.stopPropagation();
4771
+ resizeMoveHandler(event) {
4772
+ if (this.isMinimized) {
4773
+ return;
4774
+ }
4775
+ let isChanged = event.dx !== 0 || event.dy !== 0;
4776
+ if (!isChanged) {
4777
+ return;
4778
+ }
4779
+ if (event.dx !== 0) {
4780
+ let width = this.getWidth();
4781
+ if (_.isNaN(width)) {
4782
+ width = this.calculateWidth();
4783
+ }
4784
+ this.setWidth(width + event.dx, false);
5161
4785
  }
4786
+ if (event.dy !== 0) {
4787
+ let height = this.getHeight();
4788
+ if (_.isNaN(height)) {
4789
+ height = this.calculateHeight();
4790
+ }
4791
+ this.setHeight(height + event.dy, false);
4792
+ }
4793
+ this.resizeHandler();
5162
4794
  }
5163
4795
  // --------------------------------------------------------------------------
5164
4796
  //
5165
- // Public Methods
4797
+ // Public Properties
5166
4798
  //
5167
4799
  // --------------------------------------------------------------------------
5168
- emit(event) {
5169
- this.observer.next(event);
5170
- }
5171
- close() {
5172
- this.getReference().dismiss();
5173
- }
5174
4800
  destroy() {
5175
4801
  if (this.isDestroyed) {
5176
4802
  return;
5177
4803
  }
5178
4804
  super.destroy();
5179
- this.elementsDestroy();
5180
- this._container.removeEventListener('click', this.mouseClickHandlerProxy, true);
5181
- this._container.removeEventListener('mousedown', this.mouseDownHandlerProxy);
5182
- if (!_.isNil(this.content)) {
5183
- this.content.destroy();
5184
- }
5185
- if (!_.isNil(this.observer)) {
5186
- this.observer.complete();
5187
- this.observer = null;
4805
+ this.resizeMoveHandlerProxy = null;
4806
+ if (!_.isNil(this._interactable)) {
4807
+ this._interactable.unset();
4808
+ this._interactable = null;
5188
4809
  }
5189
- this.properties = null;
5190
- this._wrapper = null;
5191
- this._backdrop = null;
5192
- this._container = null;
5193
- clearInterval(this.blinkTimer);
5194
- this.blinkTimer = null;
5195
- }
5196
- blink() {
5197
- clearInterval(this.blinkTimer);
5198
- this.blinkTimer = setInterval(this.blinkToggle, WindowImpl.BLINK_DELAY);
5199
4810
  }
5200
- shake() { }
5201
- setOnTop() { }
5202
4811
  // --------------------------------------------------------------------------
5203
4812
  //
5204
- // Size Methods
4813
+ // Private Properties
5205
4814
  //
5206
4815
  // --------------------------------------------------------------------------
5207
- getWidth() {
5208
- return NaN;
4816
+ get interactable() {
4817
+ if (_.isNil(this._interactable)) {
4818
+ this._interactable = interact.default(this.container);
4819
+ // this._interactable.styleCursor(false);
4820
+ }
4821
+ return this._interactable;
5209
4822
  }
5210
- getHeight() {
5211
- return NaN;
4823
+ }
4824
+
4825
+ class WindowDragable extends WindowResizeable {
4826
+ constructor() {
4827
+ // --------------------------------------------------------------------------
4828
+ //
4829
+ // Properties Methods
4830
+ //
4831
+ // --------------------------------------------------------------------------
4832
+ super(...arguments);
4833
+ this.isWasDragged = false;
5212
4834
  }
5213
- setWidth(value, isNeedNotify = true) { }
5214
- setHeight(value, isNeedNotify = true) { }
5215
- setSize(width, height) { }
5216
4835
  // --------------------------------------------------------------------------
5217
4836
  //
5218
- // Move Methods
4837
+ // Protected Methods
5219
4838
  //
5220
4839
  // --------------------------------------------------------------------------
5221
- getX() {
5222
- return NaN;
4840
+ setProperties() {
4841
+ super.setProperties();
4842
+ if (this.config.isModal) {
4843
+ return;
4844
+ }
4845
+ ViewUtil.addClass(this.container, 'vi-draggable');
4846
+ if (!this.config.isContentDragable) {
4847
+ return;
4848
+ }
4849
+ this.dragMoveHandlerProxy = this.dragMoveHandler.bind(this);
4850
+ this.dragStartHandlerProxy = this.dragStartHandler.bind(this);
4851
+ let param = {};
4852
+ // let param = {} as any;
4853
+ this.interactable.draggable(param);
4854
+ this.interactable.on('dragmove', this.dragMoveHandlerProxy);
4855
+ this.interactable.on('dragstart', this.dragStartHandlerProxy);
5223
4856
  }
5224
- setX(value, isNeedNotify = true) { }
5225
- getY() {
5226
- return NaN;
4857
+ isNeedClickStopPropagation(event) {
4858
+ return this.isWasDragged || super.isNeedClickStopPropagation(event);
5227
4859
  }
5228
- setY(value, isNeedNotify = true) { }
5229
- move(x, y) { }
5230
4860
  // --------------------------------------------------------------------------
5231
4861
  //
5232
- // Private Properties
4862
+ // Event Handlers
5233
4863
  //
5234
4864
  // --------------------------------------------------------------------------
5235
- get reference() {
5236
- return this.properties.reference;
4865
+ dragStartHandler(event) {
4866
+ this.isWasDragged = true;
5237
4867
  }
5238
- get isBlink() {
5239
- return this._isBlink;
4868
+ dragMoveHandler(event) {
4869
+ let x = this.getX() + event.dx;
4870
+ let y = this.getY() + event.dy;
4871
+ this.move(x, y);
5240
4872
  }
5241
- set isBlink(value) {
5242
- if (value === this._isBlink) {
4873
+ mouseClickHandler(event) {
4874
+ super.mouseClickHandler(event);
4875
+ this.isWasDragged = false;
4876
+ }
4877
+ // --------------------------------------------------------------------------
4878
+ //
4879
+ // Public Methods
4880
+ //
4881
+ // --------------------------------------------------------------------------
4882
+ destroy() {
4883
+ if (this.isDestroyed) {
5243
4884
  return;
5244
4885
  }
5245
- this._isBlink = value;
5246
- this.commitIsBlinkProperties();
5247
- }
5248
- get isShaking() {
5249
- return false;
4886
+ super.destroy();
4887
+ this.dragMoveHandlerProxy = null;
4888
+ this.dragStartHandlerProxy = null;
5250
4889
  }
5251
- set isShaking(value) { }
4890
+ }
4891
+
4892
+ class WindowBaseComponent extends WindowDragable {
5252
4893
  // --------------------------------------------------------------------------
5253
4894
  //
5254
- // Public Properties
4895
+ // Protected Methods
5255
4896
  //
5256
4897
  // --------------------------------------------------------------------------
5257
- get events() {
5258
- return this.observer.asObservable();
5259
- }
5260
- get config() {
5261
- return this.properties.config;
4898
+ elementsCreate() {
4899
+ super.elementsCreate();
4900
+ if (!(this.content.container instanceof ViewContainerRef)) {
4901
+ return;
4902
+ }
4903
+ if (!this.config.disableClose) {
4904
+ this.elementAdd(this.content.container.createComponent(WindowBaseComponent.CLOSE_COMPONENT));
4905
+ }
4906
+ if (this.config.isResizeable) {
4907
+ this.elementAdd(this.content.container.createComponent(WindowBaseComponent.RESIZE_COMPONENT));
4908
+ }
4909
+ if (this.config.isMinimizable) {
4910
+ this.elementAdd(this.content.container.createComponent(WindowBaseComponent.MINIMIZE_COMPONENT));
4911
+ }
4912
+ if (this.config.isExpandable) {
4913
+ this.elementAdd(this.content.container.createComponent(WindowBaseComponent.EXPAND_COMPONENT));
4914
+ }
5262
4915
  }
5263
- get content() {
5264
- return !_.isNil(this.reference) ? this.reference.instance : null;
4916
+ commitIsBlinkProperties() {
4917
+ ViewUtil.toggleClass(this.container, this.blinkClass, this.isBlink);
5265
4918
  }
5266
- get container() {
5267
- return this._container;
4919
+ commitIsDisabledProperties() {
4920
+ ViewUtil.toggleClass(this.container, this.disabledClass, this.isDisabled);
4921
+ ViewUtil.toggleClass(this.content.element, this.disabledClass, this.isDisabled);
4922
+ ViewUtil.toggleClass(this.content.element.nativeElement.parentElement, this.disabledClass, this.isDisabled);
5268
4923
  }
5269
- get wrapper() {
5270
- return this._wrapper;
4924
+ commitIsShakingProperties() {
4925
+ ViewUtil.toggleClasses(this.container, this.shakingClass, this.isShaking);
5271
4926
  }
5272
- get backdrop() {
5273
- return this._backdrop;
4927
+ commitIsMinimizedProperties() {
4928
+ ViewUtil.toggleClass(this.container, this.minimizedClass, this.isMinimized);
4929
+ ViewUtil.toggleClass(this.content.element, this.minimizedClass, this.isMinimized);
4930
+ ViewUtil.toggleClass(this.content.element.nativeElement.parentElement, this.minimizedClass, this.isMinimized);
5274
4931
  }
5275
- get isOnTop() {
5276
- return false;
4932
+ // --------------------------------------------------------------------------
4933
+ //
4934
+ // Protected Properties
4935
+ //
4936
+ // --------------------------------------------------------------------------
4937
+ get blinkClass() {
4938
+ return 'vi-blink';
5277
4939
  }
5278
- set isOnTop(value) { }
5279
- get isMinimized() {
5280
- return false;
4940
+ get disabledClass() {
4941
+ return 'vi-disabled';
5281
4942
  }
5282
- set isMinimized(value) { }
5283
- get isDisabled() {
5284
- return this._isDisabled;
4943
+ get minimizedClass() {
4944
+ return 'vi-minimized';
5285
4945
  }
5286
- set isDisabled(value) {
5287
- if (value === this._isDisabled) {
5288
- return;
5289
- }
5290
- this._isDisabled = value;
5291
- this.commitIsDisabledProperties();
5292
- this.emit(WindowEvent.DISABLED_CHANGED);
4946
+ get shakingClass() {
4947
+ return 'shake-constant shake-horizontal';
5293
4948
  }
5294
4949
  }
5295
4950
  // --------------------------------------------------------------------------
5296
4951
  //
5297
- // Constants
4952
+ // Static Properties
5298
4953
  //
5299
4954
  // --------------------------------------------------------------------------
5300
- BottomSheetImpl.BLINK_DELAY = 500;
5301
- BottomSheetImpl.SHAKE_DELAY = 500;
4955
+ WindowBaseComponent.CLOSE_COMPONENT = WindowCloseElementComponent;
4956
+ WindowBaseComponent.EXPAND_COMPONENT = WindowExpandElementComponent;
4957
+ WindowBaseComponent.RESIZE_COMPONENT = WindowResizeElementComponent;
4958
+ WindowBaseComponent.MINIMIZE_COMPONENT = WindowMinimizeElementComponent;
5302
4959
 
5303
4960
  class BottomSheetBaseComponent extends BottomSheetImpl {
5304
4961
  // --------------------------------------------------------------------------
@@ -6490,436 +6147,783 @@ class ThemeAssetDirective extends Destroyable {
6490
6147
  get name() {
6491
6148
  return this._name;
6492
6149
  }
6493
- set name(value) {
6494
- if (value === this._name) {
6150
+ set name(value) {
6151
+ if (value === this._name) {
6152
+ return;
6153
+ }
6154
+ if (!_.isNil(this._name)) {
6155
+ this.removeSourceProperties();
6156
+ }
6157
+ this._name = value;
6158
+ if (!_.isNil(value)) {
6159
+ this.setSourceProperties();
6160
+ }
6161
+ }
6162
+ get extension() {
6163
+ return this._extension;
6164
+ }
6165
+ set extension(value) {
6166
+ if (value === this._extension) {
6167
+ return;
6168
+ }
6169
+ this._extension = value;
6170
+ if (!_.isNil(value)) {
6171
+ this.setSourceProperties();
6172
+ }
6173
+ }
6174
+ }
6175
+ ThemeAssetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }, { token: i1$1.ThemeAssetService }], target: i0.ɵɵFactoryTarget.Directive });
6176
+ ThemeAssetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeAssetDirective, inputs: { isSound: "isSound", isVideo: "isVideo", isFile: "isFile", isImage: "isImage", isBackground: "isBackground", isIgnoreTheme: "isIgnoreTheme", name: "name", extension: "extension" }, host: { listeners: { "error": "errorLoadingHandler($event)" } }, usesInheritance: true, ngImport: i0 });
6177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetDirective, decorators: [{
6178
+ type: Directive
6179
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }, { type: i1$1.ThemeAssetService }]; }, propDecorators: { errorLoadingHandler: [{
6180
+ type: HostListener,
6181
+ args: ['error', ['$event']]
6182
+ }], isSound: [{
6183
+ type: Input
6184
+ }], isVideo: [{
6185
+ type: Input
6186
+ }], isFile: [{
6187
+ type: Input
6188
+ }], isImage: [{
6189
+ type: Input
6190
+ }], isBackground: [{
6191
+ type: Input
6192
+ }], isIgnoreTheme: [{
6193
+ type: Input
6194
+ }], name: [{
6195
+ type: Input
6196
+ }], extension: [{
6197
+ type: Input
6198
+ }] } });
6199
+
6200
+ class ThemeAssetBackgroundDirective extends ThemeAssetDirective {
6201
+ // --------------------------------------------------------------------------
6202
+ //
6203
+ // Constructor
6204
+ //
6205
+ // --------------------------------------------------------------------------
6206
+ constructor(element, theme, themeAsset) {
6207
+ super(element, theme, themeAsset);
6208
+ }
6209
+ // --------------------------------------------------------------------------
6210
+ //
6211
+ // Private Methods
6212
+ //
6213
+ // --------------------------------------------------------------------------
6214
+ commitSourceProperties() {
6215
+ let value = 'url(' + this.source + ')';
6216
+ ViewUtil.setStyle(this.element, 'backgroundImage', value);
6217
+ }
6218
+ removeSourceProperties() {
6219
+ ViewUtil.removeStyle(this.element, 'backgroundImage');
6220
+ }
6221
+ }
6222
+ ThemeAssetBackgroundDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetBackgroundDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }, { token: i1$1.ThemeAssetService }], target: i0.ɵɵFactoryTarget.Directive });
6223
+ ThemeAssetBackgroundDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeAssetBackgroundDirective, selector: "[vi-theme-background]", usesInheritance: true, ngImport: i0 });
6224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetBackgroundDirective, decorators: [{
6225
+ type: Directive,
6226
+ args: [{
6227
+ selector: '[vi-theme-background]'
6228
+ }]
6229
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }, { type: i1$1.ThemeAssetService }]; } });
6230
+
6231
+ class ThemeAssetImageDirective extends ThemeAssetDirective {
6232
+ // --------------------------------------------------------------------------
6233
+ //
6234
+ // Constructor
6235
+ //
6236
+ // --------------------------------------------------------------------------
6237
+ constructor(element, theme, themeAsset) {
6238
+ super(element, theme, themeAsset);
6239
+ }
6240
+ // --------------------------------------------------------------------------
6241
+ //
6242
+ // Private Methods
6243
+ //
6244
+ // --------------------------------------------------------------------------
6245
+ commitSourceProperties() {
6246
+ this.element.src = this.source;
6247
+ }
6248
+ removeSourceProperties() {
6249
+ this.element.src = null;
6250
+ }
6251
+ }
6252
+ ThemeAssetImageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetImageDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }, { token: i1$1.ThemeAssetService }], target: i0.ɵɵFactoryTarget.Directive });
6253
+ ThemeAssetImageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeAssetImageDirective, selector: "[vi-theme-image]", usesInheritance: true, ngImport: i0 });
6254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetImageDirective, decorators: [{
6255
+ type: Directive,
6256
+ args: [{
6257
+ selector: '[vi-theme-image]'
6258
+ }]
6259
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }, { type: i1$1.ThemeAssetService }]; } });
6260
+
6261
+ class ThemeToggleDirective extends Destroyable {
6262
+ // --------------------------------------------------------------------------
6263
+ //
6264
+ // Constructor
6265
+ //
6266
+ // --------------------------------------------------------------------------
6267
+ constructor(theme) {
6268
+ super();
6269
+ this.theme = theme;
6270
+ }
6271
+ // --------------------------------------------------------------------------
6272
+ //
6273
+ // Event Handlers
6274
+ //
6275
+ // --------------------------------------------------------------------------
6276
+ clickHandler(event) {
6277
+ let themes = this.theme.themes.collection;
6278
+ let length = themes.length;
6279
+ if (length < 2) {
6280
+ return;
6281
+ }
6282
+ let index = 0;
6283
+ if (this.theme.theme) {
6284
+ index = themes.indexOf(this.theme.theme);
6285
+ if (index < length - 1) {
6286
+ index++;
6287
+ }
6288
+ else {
6289
+ index = 0;
6290
+ }
6291
+ }
6292
+ this.theme.theme = themes[index];
6293
+ }
6294
+ // --------------------------------------------------------------------------
6295
+ //
6296
+ // Public Methods
6297
+ //
6298
+ // --------------------------------------------------------------------------
6299
+ destroy() {
6300
+ if (this.isDestroyed) {
6301
+ return;
6302
+ }
6303
+ super.destroy();
6304
+ this.theme = null;
6305
+ }
6306
+ }
6307
+ ThemeToggleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeToggleDirective, deps: [{ token: i1$1.ThemeService }], target: i0.ɵɵFactoryTarget.Directive });
6308
+ ThemeToggleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeToggleDirective, selector: "[vi-theme-toggle]", host: { listeners: { "click": "clickHandler($event)" } }, usesInheritance: true, ngImport: i0 });
6309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeToggleDirective, decorators: [{
6310
+ type: Directive,
6311
+ args: [{
6312
+ selector: '[vi-theme-toggle]'
6313
+ }]
6314
+ }], ctorParameters: function () { return [{ type: i1$1.ThemeService }]; }, propDecorators: { clickHandler: [{
6315
+ type: HostListener,
6316
+ args: ['click', ['$event']]
6317
+ }] } });
6318
+
6319
+ class ThemeStyleDirective extends Destroyable {
6320
+ // --------------------------------------------------------------------------
6321
+ //
6322
+ // Constructor
6323
+ //
6324
+ // --------------------------------------------------------------------------
6325
+ constructor(element, theme) {
6326
+ super();
6327
+ this.theme = theme;
6328
+ this.element = ViewUtil.parseElement(element.nativeElement);
6329
+ this.theme.changed.pipe(takeUntil(this.destroyed)).subscribe(() => this.stylePropertiesAdd());
6330
+ }
6331
+ // --------------------------------------------------------------------------
6332
+ //
6333
+ // Protected Methods
6334
+ //
6335
+ // --------------------------------------------------------------------------
6336
+ commitStyleProperties(name, value) {
6337
+ ViewUtil.setStyle(this.element, name, value, this.flags);
6338
+ }
6339
+ stylePropertiesCheck() {
6340
+ if (this.isNeedStyleAdd()) {
6341
+ this.stylePropertiesAdd();
6342
+ }
6343
+ else if (this.isNeedStyleRemove()) {
6344
+ this.stylePropertiesRemove();
6345
+ }
6346
+ }
6347
+ stylePropertiesRemove() {
6348
+ ViewUtil.removeStyle(this.element, this.styleName);
6349
+ }
6350
+ stylePropertiesAdd() {
6351
+ this.commitStyleProperties(this.styleName, this.theme.getStyle(this.key));
6352
+ }
6353
+ isNeedStyleAdd() {
6354
+ return !_.isNil(this.theme.theme) && !_.isNil(this.styleName);
6355
+ }
6356
+ isNeedStyleRemove() {
6357
+ return !_.isNil(this.styleName);
6358
+ }
6359
+ // --------------------------------------------------------------------------
6360
+ //
6361
+ // Public Methods
6362
+ //
6363
+ // --------------------------------------------------------------------------
6364
+ destroy() {
6365
+ if (this.isDestroyed) {
6366
+ return;
6367
+ }
6368
+ super.destroy();
6369
+ this.key = null;
6370
+ this.theme = null;
6371
+ this.element = null;
6372
+ }
6373
+ // --------------------------------------------------------------------------
6374
+ //
6375
+ // Public Properties
6376
+ //
6377
+ // --------------------------------------------------------------------------
6378
+ get flags() {
6379
+ return this._flags;
6380
+ }
6381
+ set flags(value) {
6382
+ if (value === this._flags) {
6495
6383
  return;
6496
6384
  }
6497
- if (!_.isNil(this._name)) {
6498
- this.removeSourceProperties();
6499
- }
6500
- this._name = value;
6501
- if (!_.isNil(value)) {
6502
- this.setSourceProperties();
6385
+ this._flags = value;
6386
+ this.stylePropertiesCheck();
6387
+ }
6388
+ get styleName() {
6389
+ return this._styleName;
6390
+ }
6391
+ set styleName(value) {
6392
+ if (value === this._styleName) {
6393
+ return;
6503
6394
  }
6395
+ this._styleName = value;
6396
+ this.stylePropertiesCheck();
6504
6397
  }
6505
- get extension() {
6506
- return this._extension;
6398
+ get key() {
6399
+ return this._key;
6507
6400
  }
6508
- set extension(value) {
6509
- if (value === this._extension) {
6401
+ set key(value) {
6402
+ if (value === this._key) {
6510
6403
  return;
6511
6404
  }
6512
- this._extension = value;
6405
+ this._key = value;
6513
6406
  if (!_.isNil(value)) {
6514
- this.setSourceProperties();
6407
+ this.stylePropertiesCheck();
6515
6408
  }
6516
6409
  }
6517
6410
  }
6518
- ThemeAssetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }, { token: i1$1.ThemeAssetService }], target: i0.ɵɵFactoryTarget.Directive });
6519
- ThemeAssetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeAssetDirective, inputs: { isSound: "isSound", isVideo: "isVideo", isFile: "isFile", isImage: "isImage", isBackground: "isBackground", isIgnoreTheme: "isIgnoreTheme", name: "name", extension: "extension" }, host: { listeners: { "error": "errorLoadingHandler($event)" } }, usesInheritance: true, ngImport: i0 });
6520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetDirective, decorators: [{
6521
- type: Directive
6522
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }, { type: i1$1.ThemeAssetService }]; }, propDecorators: { errorLoadingHandler: [{
6523
- type: HostListener,
6524
- args: ['error', ['$event']]
6525
- }], isSound: [{
6526
- type: Input
6527
- }], isVideo: [{
6528
- type: Input
6529
- }], isFile: [{
6530
- type: Input
6531
- }], isImage: [{
6532
- type: Input
6533
- }], isBackground: [{
6534
- type: Input
6535
- }], isIgnoreTheme: [{
6536
- type: Input
6537
- }], name: [{
6411
+ ThemeStyleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeStyleDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }], target: i0.ɵɵFactoryTarget.Directive });
6412
+ ThemeStyleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeStyleDirective, selector: "[vi-theme-style]", inputs: { flags: "flags", styleName: "styleName", key: ["vi-theme-style", "key"] }, usesInheritance: true, ngImport: i0 });
6413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeStyleDirective, decorators: [{
6414
+ type: Directive,
6415
+ args: [{
6416
+ selector: '[vi-theme-style]'
6417
+ }]
6418
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }]; }, propDecorators: { flags: [{
6538
6419
  type: Input
6539
- }], extension: [{
6420
+ }], styleName: [{
6540
6421
  type: Input
6422
+ }], key: [{
6423
+ type: Input,
6424
+ args: ['vi-theme-style']
6541
6425
  }] } });
6542
6426
 
6543
- class ThemeAssetBackgroundDirective extends ThemeAssetDirective {
6427
+ class ThemeStyleHoverDirective extends ThemeStyleDirective {
6544
6428
  // --------------------------------------------------------------------------
6545
6429
  //
6546
6430
  // Constructor
6547
6431
  //
6548
6432
  // --------------------------------------------------------------------------
6549
- constructor(element, theme, themeAsset) {
6550
- super(element, theme, themeAsset);
6433
+ constructor(element, theme) {
6434
+ super(element, theme);
6435
+ // --------------------------------------------------------------------------
6436
+ //
6437
+ // Properties
6438
+ //
6439
+ // --------------------------------------------------------------------------
6440
+ this._isHover = false;
6441
+ // --------------------------------------------------------------------------
6442
+ //
6443
+ // Event Handlers
6444
+ //
6445
+ // --------------------------------------------------------------------------
6446
+ this.mouseEnter = (event) => {
6447
+ this.isHover = true;
6448
+ };
6449
+ this.mouseLeave = (event) => {
6450
+ this.isHover = false;
6451
+ };
6452
+ this.flags = RendererStyleFlags2.Important;
6453
+ this.element.addEventListener('mouseenter', this.mouseEnter, false);
6454
+ this.element.addEventListener('mouseleave', this.mouseLeave, false);
6551
6455
  }
6552
6456
  // --------------------------------------------------------------------------
6553
6457
  //
6554
- // Private Methods
6458
+ // Protected Methods
6555
6459
  //
6556
6460
  // --------------------------------------------------------------------------
6557
- commitSourceProperties() {
6558
- let value = 'url(' + this.source + ')';
6559
- ViewUtil.setStyle(this.element, 'backgroundImage', value);
6461
+ isNeedStyleAdd() {
6462
+ return this.isHover && super.isNeedStyleAdd();
6560
6463
  }
6561
- removeSourceProperties() {
6562
- ViewUtil.removeStyle(this.element, 'backgroundImage');
6464
+ isNeedStyleRemove() {
6465
+ return !this.isHover || super.isNeedStyleRemove();
6563
6466
  }
6564
- }
6565
- ThemeAssetBackgroundDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetBackgroundDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }, { token: i1$1.ThemeAssetService }], target: i0.ɵɵFactoryTarget.Directive });
6566
- ThemeAssetBackgroundDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeAssetBackgroundDirective, selector: "[vi-theme-background]", usesInheritance: true, ngImport: i0 });
6567
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetBackgroundDirective, decorators: [{
6568
- type: Directive,
6569
- args: [{
6570
- selector: '[vi-theme-background]'
6571
- }]
6572
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }, { type: i1$1.ThemeAssetService }]; } });
6573
-
6574
- class ThemeAssetImageDirective extends ThemeAssetDirective {
6575
6467
  // --------------------------------------------------------------------------
6576
6468
  //
6577
- // Constructor
6469
+ // Public Methods
6578
6470
  //
6579
6471
  // --------------------------------------------------------------------------
6580
- constructor(element, theme, themeAsset) {
6581
- super(element, theme, themeAsset);
6472
+ destroy() {
6473
+ if (this.isDestroyed) {
6474
+ return;
6475
+ }
6476
+ this.element.removeEventListener('mouseenter', this.mouseEnter, false);
6477
+ this.element.removeEventListener('mouseleave', this.mouseLeave, false);
6478
+ super.destroy();
6582
6479
  }
6583
6480
  // --------------------------------------------------------------------------
6584
6481
  //
6585
- // Private Methods
6482
+ // Public Properties
6586
6483
  //
6587
6484
  // --------------------------------------------------------------------------
6588
- commitSourceProperties() {
6589
- this.element.src = this.source;
6485
+ get isHover() {
6486
+ return this._isHover;
6590
6487
  }
6591
- removeSourceProperties() {
6592
- this.element.src = null;
6488
+ set isHover(value) {
6489
+ if (value === this._isHover) {
6490
+ return;
6491
+ }
6492
+ this._isHover = value;
6493
+ this.stylePropertiesCheck();
6494
+ }
6495
+ get key() {
6496
+ return super.key;
6497
+ }
6498
+ set key(value) {
6499
+ super.key = value;
6500
+ }
6501
+ get styleName() {
6502
+ return super.styleName;
6503
+ }
6504
+ set styleName(value) {
6505
+ super.styleName = value;
6506
+ }
6507
+ get flags() {
6508
+ return super.flags;
6509
+ }
6510
+ set flags(value) {
6511
+ super.flags = value;
6593
6512
  }
6594
6513
  }
6595
- ThemeAssetImageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetImageDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }, { token: i1$1.ThemeAssetService }], target: i0.ɵɵFactoryTarget.Directive });
6596
- ThemeAssetImageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeAssetImageDirective, selector: "[vi-theme-image]", usesInheritance: true, ngImport: i0 });
6597
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeAssetImageDirective, decorators: [{
6514
+ ThemeStyleHoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeStyleHoverDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }], target: i0.ɵɵFactoryTarget.Directive });
6515
+ ThemeStyleHoverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeStyleHoverDirective, selector: "[vi-theme-style-hover]", inputs: { key: ["vi-theme-style-hover", "key"], styleName: "styleName", flags: "flags" }, usesInheritance: true, ngImport: i0 });
6516
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeStyleHoverDirective, decorators: [{
6598
6517
  type: Directive,
6599
6518
  args: [{
6600
- selector: '[vi-theme-image]'
6519
+ selector: '[vi-theme-style-hover]'
6601
6520
  }]
6602
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }, { type: i1$1.ThemeAssetService }]; } });
6521
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }]; }, propDecorators: { key: [{
6522
+ type: Input,
6523
+ args: ['vi-theme-style-hover']
6524
+ }], styleName: [{
6525
+ type: Input
6526
+ }], flags: [{
6527
+ type: Input
6528
+ }] } });
6603
6529
 
6604
- class ThemeToggleDirective extends Destroyable {
6605
- // --------------------------------------------------------------------------
6606
- //
6607
- // Constructor
6608
- //
6609
- // --------------------------------------------------------------------------
6610
- constructor(theme) {
6611
- super();
6612
- this.theme = theme;
6613
- }
6530
+ let declarations = [ThemeToggleDirective, ThemeAssetImageDirective, ThemeAssetBackgroundDirective, ThemeStyleDirective, ThemeStyleHoverDirective];
6531
+ class ThemeModule {
6614
6532
  // --------------------------------------------------------------------------
6615
6533
  //
6616
- // Event Handlers
6534
+ // Static Methods
6617
6535
  //
6618
6536
  // --------------------------------------------------------------------------
6619
- clickHandler(event) {
6620
- let themes = this.theme.themes.collection;
6621
- let length = themes.length;
6622
- if (length < 2) {
6623
- return;
6624
- }
6625
- let index = 0;
6626
- if (this.theme.theme) {
6627
- index = themes.indexOf(this.theme.theme);
6628
- if (index < length - 1) {
6629
- index++;
6630
- }
6631
- else {
6632
- index = 0;
6633
- }
6634
- }
6635
- this.theme.theme = themes[index];
6537
+ static forRoot(options) {
6538
+ return {
6539
+ ngModule: ThemeModule,
6540
+ providers: [
6541
+ {
6542
+ provide: THEME_OPTIONS,
6543
+ useValue: options || {}
6544
+ },
6545
+ {
6546
+ provide: ThemeService,
6547
+ deps: [NativeWindowService, CookieService, THEME_OPTIONS],
6548
+ useFactory: themeServiceFactory
6549
+ },
6550
+ {
6551
+ provide: ThemeAssetService,
6552
+ deps: [ThemeService, NativeWindowService],
6553
+ useFactory: themeAssetServiceFactory
6554
+ }
6555
+ ]
6556
+ };
6636
6557
  }
6637
- // --------------------------------------------------------------------------
6638
- //
6639
- // Public Methods
6640
- //
6641
- // --------------------------------------------------------------------------
6642
- destroy() {
6643
- if (this.isDestroyed) {
6644
- return;
6645
- }
6646
- super.destroy();
6647
- this.theme = null;
6558
+ }
6559
+ ThemeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6560
+ ThemeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeModule, declarations: [ThemeToggleDirective, ThemeAssetImageDirective, ThemeAssetBackgroundDirective, ThemeStyleDirective, ThemeStyleHoverDirective], imports: [CookieModule], exports: [ThemeToggleDirective, ThemeAssetImageDirective, ThemeAssetBackgroundDirective, ThemeStyleDirective, ThemeStyleHoverDirective] });
6561
+ ThemeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeModule, imports: [[CookieModule]] });
6562
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeModule, decorators: [{
6563
+ type: NgModule,
6564
+ args: [{
6565
+ imports: [CookieModule],
6566
+ declarations,
6567
+ exports: declarations
6568
+ }]
6569
+ }] });
6570
+ function themeServiceFactory(nativeWindow, cookie, options) {
6571
+ if (!_.isNil(options) && _.isNil(options.service)) {
6572
+ options.service = cookie;
6648
6573
  }
6574
+ return new ThemeService(options, nativeWindow.document);
6575
+ }
6576
+ function themeAssetServiceFactory(theme) {
6577
+ return new ThemeAssetService(theme);
6649
6578
  }
6650
- ThemeToggleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeToggleDirective, deps: [{ token: i1$1.ThemeService }], target: i0.ɵɵFactoryTarget.Directive });
6651
- ThemeToggleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeToggleDirective, selector: "[vi-theme-toggle]", host: { listeners: { "click": "clickHandler($event)" } }, usesInheritance: true, ngImport: i0 });
6652
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeToggleDirective, decorators: [{
6653
- type: Directive,
6654
- args: [{
6655
- selector: '[vi-theme-toggle]'
6656
- }]
6657
- }], ctorParameters: function () { return [{ type: i1$1.ThemeService }]; }, propDecorators: { clickHandler: [{
6658
- type: HostListener,
6659
- args: ['click', ['$event']]
6660
- }] } });
6579
+ const THEME_OPTIONS = new InjectionToken(`THEME_OPTIONS`);
6661
6580
 
6662
- class ThemeStyleDirective extends Destroyable {
6581
+ class WindowService extends Destroyable {
6582
+ // public topZIndex: number = 1001;
6663
6583
  // --------------------------------------------------------------------------
6664
6584
  //
6665
- // Constructor
6585
+ // Constructor
6666
6586
  //
6667
6587
  // --------------------------------------------------------------------------
6668
- constructor(element, theme) {
6588
+ constructor(dialog, language, cookies, sheet) {
6669
6589
  super();
6670
- this.theme = theme;
6671
- this.element = ViewUtil.parseElement(element.nativeElement);
6672
- this.theme.changed.pipe(takeUntil(this.destroyed)).subscribe(() => this.stylePropertiesAdd());
6590
+ this.sheet = sheet;
6591
+ this.isNeedCheckPositionAfterOpen = true;
6592
+ this.gapX = 25;
6593
+ this.gapY = 25;
6594
+ this.minWidth = 100;
6595
+ this.minHeight = 100;
6596
+ this.paddingTop = 25;
6597
+ this.paddingLeft = 25;
6598
+ this.paddingRight = 25;
6599
+ this.paddingBottom = 25;
6600
+ this.defaultVerticalAlign = WindowAlign.CENTER;
6601
+ this.defaultHorizontalAlign = WindowAlign.CENTER;
6602
+ this.topZIndex = WindowService.Z_INDEX_MAX;
6603
+ this._windows = new Map();
6604
+ this.dialog = dialog;
6605
+ this.language = language;
6606
+ this.observer = new Subject();
6607
+ this.properties = new PropertiesManager(cookies);
6608
+ this.factory = new WindowFactory(WindowBaseComponent);
6609
+ this.questionComponent = WindowQuestionComponent;
6673
6610
  }
6674
6611
  // --------------------------------------------------------------------------
6675
6612
  //
6676
- // Protected Methods
6613
+ // Static Methods
6677
6614
  //
6678
6615
  // --------------------------------------------------------------------------
6679
- commitStyleProperties(name, value) {
6680
- ViewUtil.setStyle(this.element, name, value, this.flags);
6616
+ static getZIndex(window) {
6617
+ return !_.isNil(window) && !_.isNil(window.container) ? parseInt(ViewUtil.getStyle(window.container.parentElement, 'zIndex'), 10) : -1;
6681
6618
  }
6682
- stylePropertiesCheck() {
6683
- if (this.isNeedStyleAdd()) {
6684
- this.stylePropertiesAdd();
6619
+ static setZIndex(window, index) {
6620
+ if (_.isNil(window)) {
6621
+ return;
6685
6622
  }
6686
- else if (this.isNeedStyleRemove()) {
6687
- this.stylePropertiesRemove();
6623
+ if (!_.isNil(window.backdrop)) {
6624
+ ViewUtil.setStyle(window.backdrop, 'zIndex', index);
6625
+ }
6626
+ if (!_.isNil(window.wrapper)) {
6627
+ ViewUtil.setStyle(window.wrapper, 'zIndex', index);
6688
6628
  }
6689
6629
  }
6690
- stylePropertiesRemove() {
6691
- ViewUtil.removeStyle(this.element, this.styleName);
6630
+ // --------------------------------------------------------------------------
6631
+ //
6632
+ // Private Methods
6633
+ //
6634
+ // --------------------------------------------------------------------------
6635
+ sortFunction(first, second) {
6636
+ return WindowService.getZIndex(first) > WindowService.getZIndex(second) ? -1 : 1;
6692
6637
  }
6693
- stylePropertiesAdd() {
6694
- this.commitStyleProperties(this.styleName, this.theme.getStyle(this.key));
6638
+ updateTop() {
6639
+ let zIndex = 0;
6640
+ let topWindow = null;
6641
+ let windows = [...this.windowsArray, this.sheet.window];
6642
+ for (let window of windows) {
6643
+ if (_.isNil(window) || _.isNil(window.container)) {
6644
+ continue;
6645
+ }
6646
+ let index = WindowService.getZIndex(window);
6647
+ if (zIndex >= index) {
6648
+ continue;
6649
+ }
6650
+ zIndex = index;
6651
+ topWindow = window;
6652
+ }
6653
+ if (_.isNil(topWindow) || topWindow.isOnTop) {
6654
+ return;
6655
+ }
6656
+ topWindow.isOnTop = true;
6657
+ this.observer.next(new ObservableData(WindowServiceEvent.SETTED_ON_TOP, topWindow));
6695
6658
  }
6696
- isNeedStyleAdd() {
6697
- return !_.isNil(this.theme.theme) && !_.isNil(this.styleName);
6659
+ setWindowOnTop(topWindow) {
6660
+ let currentIndex = this.topZIndex - 2;
6661
+ let windows = [...this.windowsArray, this.sheet.window];
6662
+ for (let window of windows) {
6663
+ if (_.isNil(window) || _.isNil(window.container)) {
6664
+ continue;
6665
+ }
6666
+ window.isOnTop = window === topWindow;
6667
+ let zIndex = window.isOnTop ? this.topZIndex : currentIndex--;
6668
+ WindowService.setZIndex(window, zIndex);
6669
+ }
6670
+ this.windowsArray.sort(this.sortFunction);
6671
+ this.observer.next(new ObservableData(WindowServiceEvent.SETTED_ON_TOP, topWindow));
6698
6672
  }
6699
- isNeedStyleRemove() {
6700
- return !_.isNil(this.styleName);
6673
+ checkPosition(item) {
6674
+ while (this.hasSamePosition(item)) {
6675
+ item.move(item.getX() + this.gapX, item.getY() + this.gapY);
6676
+ }
6677
+ }
6678
+ hasSamePosition(itemWindow) {
6679
+ let x = itemWindow.getX();
6680
+ let y = itemWindow.getY();
6681
+ let result = false;
6682
+ this.windowsArray.forEach(window => {
6683
+ if (window !== itemWindow && x === window.getX() && y === window.getY()) {
6684
+ result = true;
6685
+ }
6686
+ });
6687
+ return result;
6701
6688
  }
6702
6689
  // --------------------------------------------------------------------------
6703
6690
  //
6704
- // Public Methods
6691
+ // Setters Methods
6705
6692
  //
6706
6693
  // --------------------------------------------------------------------------
6707
- destroy() {
6708
- if (this.isDestroyed) {
6709
- return;
6694
+ add(config, content) {
6695
+ this._windows.set(config, content);
6696
+ this.observer.next(new ObservableData(WindowServiceEvent.OPENED, content.window));
6697
+ }
6698
+ remove(config) {
6699
+ let window = this._windows.get(config);
6700
+ if (!window) {
6701
+ return null;
6710
6702
  }
6711
- super.destroy();
6712
- this.key = null;
6713
- this.theme = null;
6714
- this.element = null;
6703
+ window.close();
6704
+ this._windows.delete(config);
6705
+ this.observer.next(new ObservableData(WindowServiceEvent.CLOSED, window.window));
6706
+ }
6707
+ getById(id) {
6708
+ let item = _.find(Array.from(this._windows.values()), item => item.config.id === id);
6709
+ return !_.isNil(item) ? item.window : null;
6710
+ }
6711
+ setDefaultProperties(config) {
6712
+ if (!config.verticalAlign) {
6713
+ config.verticalAlign = this.defaultVerticalAlign;
6714
+ }
6715
+ if (!config.horizontalAlign) {
6716
+ config.horizontalAlign = this.defaultHorizontalAlign;
6717
+ }
6718
+ if (_.isNaN(config.defaultMinWidth)) {
6719
+ config.defaultMinWidth = this.minWidth;
6720
+ }
6721
+ if (_.isNaN(config.defaultMinHeight)) {
6722
+ config.defaultMinHeight = this.minHeight;
6723
+ }
6724
+ if (_.isNaN(config.paddingTop)) {
6725
+ config.paddingTop = this.paddingTop;
6726
+ }
6727
+ if (_.isNaN(config.paddingLeft)) {
6728
+ config.paddingLeft = this.paddingLeft;
6729
+ }
6730
+ if (_.isNaN(config.paddingRight)) {
6731
+ config.paddingRight = this.paddingRight;
6732
+ }
6733
+ if (_.isNaN(config.paddingBottom)) {
6734
+ config.paddingBottom = this.paddingBottom;
6735
+ }
6736
+ if (config.propertiesId) {
6737
+ this.properties.load(config.propertiesId, config);
6738
+ }
6739
+ config.setDefaultProperties();
6715
6740
  }
6716
6741
  // --------------------------------------------------------------------------
6717
6742
  //
6718
- // Public Properties
6743
+ // Public Methods
6719
6744
  //
6720
6745
  // --------------------------------------------------------------------------
6721
- get flags() {
6722
- return this._flags;
6746
+ open(component, config) {
6747
+ let window = null;
6748
+ if (config.id) {
6749
+ window = this.getById(config.id);
6750
+ if (window) {
6751
+ return window.content;
6752
+ }
6753
+ }
6754
+ this.setDefaultProperties(config);
6755
+ // let dialog = this.dialog as any;
6756
+ // dialog._getOverlayState = config.isModal ? dialog.getOverlayStateModal : dialog.getOverlayStateNonModal;
6757
+ let reference = this.dialog.open(component, config);
6758
+ window = this.factory.create({ config, reference, overlay: reference._overlayRef });
6759
+ this.observer.next(new ObservableData(WindowServiceEvent.OPEN_STARTED, window));
6760
+ let subscription = window.events.subscribe(event => {
6761
+ switch (event) {
6762
+ case WindowEvent.OPENED:
6763
+ this.add(config, reference.componentInstance);
6764
+ this.setWindowOnTop(window);
6765
+ if (this.isNeedCheckPositionAfterOpen) {
6766
+ this.checkPosition(window);
6767
+ }
6768
+ this.observer.next(new ObservableData(WindowServiceEvent.OPEN_FINISHED, window));
6769
+ break;
6770
+ case WindowEvent.CLOSED:
6771
+ subscription.unsubscribe();
6772
+ this.remove(config);
6773
+ if (window.isOnTop && this.windows.size > 0) {
6774
+ this.updateTop();
6775
+ }
6776
+ break;
6777
+ case WindowEvent.RESIZED:
6778
+ if (!_.isNil(config.propertiesId)) {
6779
+ this.properties.save(config.propertiesId, window);
6780
+ }
6781
+ break;
6782
+ case WindowEvent.SET_ON_TOP:
6783
+ this.setWindowOnTop(window);
6784
+ break;
6785
+ }
6786
+ });
6787
+ return window.content;
6723
6788
  }
6724
- set flags(value) {
6725
- if (value === this._flags) {
6726
- return;
6789
+ get(value) {
6790
+ let id = value.toString();
6791
+ if (value instanceof WindowConfig) {
6792
+ id = value.id;
6727
6793
  }
6728
- this._flags = value;
6729
- this.stylePropertiesCheck();
6794
+ if (!id) {
6795
+ return null;
6796
+ }
6797
+ let window = this.getById(id);
6798
+ if (_.isNil(window)) {
6799
+ return null;
6800
+ }
6801
+ return window.content;
6730
6802
  }
6731
- get styleName() {
6732
- return this._styleName;
6803
+ has(value) {
6804
+ return !_.isNil(this.get(value));
6733
6805
  }
6734
- set styleName(value) {
6735
- if (value === this._styleName) {
6736
- return;
6806
+ setOnTop(value) {
6807
+ let content = this.get(value);
6808
+ if (!content) {
6809
+ return false;
6737
6810
  }
6738
- this._styleName = value;
6739
- this.stylePropertiesCheck();
6811
+ content.window.setOnTop();
6812
+ return true;
6740
6813
  }
6741
- get key() {
6742
- return this._key;
6814
+ removeAll() {
6815
+ this.windowsArray.forEach(window => window.close());
6743
6816
  }
6744
- set key(value) {
6745
- if (value === this._key) {
6817
+ destroy() {
6818
+ if (this.isDestroyed) {
6746
6819
  return;
6747
6820
  }
6748
- this._key = value;
6749
- if (!_.isNil(value)) {
6750
- this.stylePropertiesCheck();
6821
+ super.destroy();
6822
+ this.removeAll();
6823
+ if (!_.isNil(this.observer)) {
6824
+ this.observer.complete();
6825
+ this.observer = null;
6826
+ }
6827
+ if (!_.isNil(this.properties)) {
6828
+ this.properties.destroy();
6829
+ this.properties = null;
6751
6830
  }
6831
+ this.factory = null;
6832
+ this.questionComponent = null;
6833
+ this.dialog = null;
6834
+ this.language = null;
6835
+ this._windows = null;
6752
6836
  }
6753
- }
6754
- ThemeStyleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeStyleDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }], target: i0.ɵɵFactoryTarget.Directive });
6755
- ThemeStyleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeStyleDirective, selector: "[vi-theme-style]", inputs: { flags: "flags", styleName: "styleName", key: ["vi-theme-style", "key"] }, usesInheritance: true, ngImport: i0 });
6756
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeStyleDirective, decorators: [{
6757
- type: Directive,
6758
- args: [{
6759
- selector: '[vi-theme-style]'
6760
- }]
6761
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }]; }, propDecorators: { flags: [{
6762
- type: Input
6763
- }], styleName: [{
6764
- type: Input
6765
- }], key: [{
6766
- type: Input,
6767
- args: ['vi-theme-style']
6768
- }] } });
6769
-
6770
- class ThemeStyleHoverDirective extends ThemeStyleDirective {
6771
6837
  // --------------------------------------------------------------------------
6772
6838
  //
6773
- // Constructor
6839
+ // Additional Methods
6774
6840
  //
6775
6841
  // --------------------------------------------------------------------------
6776
- constructor(element, theme) {
6777
- super(element, theme);
6778
- // --------------------------------------------------------------------------
6779
- //
6780
- // Properties
6781
- //
6782
- // --------------------------------------------------------------------------
6783
- this._isHover = false;
6784
- // --------------------------------------------------------------------------
6785
- //
6786
- // Event Handlers
6787
- //
6788
- // --------------------------------------------------------------------------
6789
- this.mouseEnter = (event) => {
6790
- this.isHover = true;
6791
- };
6792
- this.mouseLeave = (event) => {
6793
- this.isHover = false;
6794
- };
6795
- this.flags = RendererStyleFlags2.Important;
6796
- this.element.addEventListener('mouseenter', this.mouseEnter, false);
6797
- this.element.addEventListener('mouseleave', this.mouseLeave, false);
6842
+ info(translationId, translation, questionOptions, configOptions) {
6843
+ let text = this.language.translate(translationId, translation);
6844
+ let config = _.assign(new WindowConfig(true, false, 450), configOptions);
6845
+ config.data = new QuestionManager(_.assign(questionOptions, { mode: QuestionMode.INFO, text }));
6846
+ return this.open(this.questionComponent, config).config.data;
6847
+ }
6848
+ question(translationId, translation, questionOptions, configOptions) {
6849
+ let text = this.language.translate(translationId, translation);
6850
+ let config = _.assign(new WindowConfig(true, false, 450), configOptions);
6851
+ config.data = new QuestionManager(_.assign(questionOptions, { mode: QuestionMode.QUESTION, text }));
6852
+ return this.open(this.questionComponent, config).config.data;
6798
6853
  }
6799
6854
  // --------------------------------------------------------------------------
6800
6855
  //
6801
- // Protected Methods
6856
+ // Private Properties
6802
6857
  //
6803
6858
  // --------------------------------------------------------------------------
6804
- isNeedStyleAdd() {
6805
- return this.isHover && super.isNeedStyleAdd();
6806
- }
6807
- isNeedStyleRemove() {
6808
- return !this.isHover || super.isNeedStyleRemove();
6859
+ get windowsArray() {
6860
+ return Array.from(this.windows.values()).map(item => item.window);
6809
6861
  }
6810
6862
  // --------------------------------------------------------------------------
6811
6863
  //
6812
- // Public Methods
6864
+ // Public Properties
6813
6865
  //
6814
6866
  // --------------------------------------------------------------------------
6815
- destroy() {
6816
- if (this.isDestroyed) {
6817
- return;
6818
- }
6819
- this.element.removeEventListener('mouseenter', this.mouseEnter, false);
6820
- this.element.removeEventListener('mouseleave', this.mouseLeave, false);
6821
- super.destroy();
6867
+ get events() {
6868
+ return this.observer.asObservable();
6869
+ }
6870
+ get windows() {
6871
+ return this._windows;
6822
6872
  }
6873
+ }
6874
+ // --------------------------------------------------------------------------
6875
+ //
6876
+ // Constants
6877
+ //
6878
+ // --------------------------------------------------------------------------
6879
+ WindowService.Z_INDEX_MAX = 1000;
6880
+ WindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, deps: [{ token: i1.MatDialog }, { token: i1$1.LanguageService }, { token: CookieService }, { token: BottomSheetService }], target: i0.ɵɵFactoryTarget.Injectable });
6881
+ WindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, providedIn: 'root' });
6882
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, decorators: [{
6883
+ type: Injectable,
6884
+ args: [{ providedIn: 'root' }]
6885
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i1$1.LanguageService }, { type: CookieService }, { type: BottomSheetService }]; } });
6886
+ class PropertiesManager extends Destroyable {
6823
6887
  // --------------------------------------------------------------------------
6824
6888
  //
6825
- // Public Properties
6889
+ // Constructor
6826
6890
  //
6827
6891
  // --------------------------------------------------------------------------
6828
- get isHover() {
6829
- return this._isHover;
6830
- }
6831
- set isHover(value) {
6832
- if (value === this._isHover) {
6833
- return;
6834
- }
6835
- this._isHover = value;
6836
- this.stylePropertiesCheck();
6837
- }
6838
- get key() {
6839
- return super.key;
6840
- }
6841
- set key(value) {
6842
- super.key = value;
6843
- }
6844
- get styleName() {
6845
- return super.styleName;
6846
- }
6847
- set styleName(value) {
6848
- super.styleName = value;
6849
- }
6850
- get flags() {
6851
- return super.flags;
6852
- }
6853
- set flags(value) {
6854
- super.flags = value;
6892
+ constructor(cookies) {
6893
+ super();
6894
+ this.cookies = cookies;
6855
6895
  }
6856
- }
6857
- ThemeStyleHoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeStyleHoverDirective, deps: [{ token: i0.ElementRef }, { token: i1$1.ThemeService }], target: i0.ɵɵFactoryTarget.Directive });
6858
- ThemeStyleHoverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ThemeStyleHoverDirective, selector: "[vi-theme-style-hover]", inputs: { key: ["vi-theme-style-hover", "key"], styleName: "styleName", flags: "flags" }, usesInheritance: true, ngImport: i0 });
6859
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeStyleHoverDirective, decorators: [{
6860
- type: Directive,
6861
- args: [{
6862
- selector: '[vi-theme-style-hover]'
6863
- }]
6864
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.ThemeService }]; }, propDecorators: { key: [{
6865
- type: Input,
6866
- args: ['vi-theme-style-hover']
6867
- }], styleName: [{
6868
- type: Input
6869
- }], flags: [{
6870
- type: Input
6871
- }] } });
6872
-
6873
- let declarations = [ThemeToggleDirective, ThemeAssetImageDirective, ThemeAssetBackgroundDirective, ThemeStyleDirective, ThemeStyleHoverDirective];
6874
- class ThemeModule {
6875
6896
  // --------------------------------------------------------------------------
6876
6897
  //
6877
- // Static Methods
6898
+ // Public Methods
6878
6899
  //
6879
6900
  // --------------------------------------------------------------------------
6880
- static forRoot(options) {
6881
- return {
6882
- ngModule: ThemeModule,
6883
- providers: [
6884
- {
6885
- provide: THEME_OPTIONS,
6886
- useValue: options || {}
6887
- },
6888
- {
6889
- provide: ThemeService,
6890
- deps: [NativeWindowService, CookieService, THEME_OPTIONS],
6891
- useFactory: themeServiceFactory
6892
- },
6893
- {
6894
- provide: ThemeAssetService,
6895
- deps: [ThemeService, NativeWindowService],
6896
- useFactory: themeAssetServiceFactory
6897
- }
6898
- ]
6899
- };
6901
+ load(name, config) {
6902
+ let item = this.cookies.getObject(name + 'Window');
6903
+ if (!item) {
6904
+ return;
6905
+ }
6906
+ if (item.hasOwnProperty('width')) {
6907
+ config.defaultWidth = item.width;
6908
+ }
6909
+ if (item.hasOwnProperty('height')) {
6910
+ config.defaultHeight = item.height;
6911
+ }
6900
6912
  }
6901
- }
6902
- ThemeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6903
- ThemeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeModule, declarations: [ThemeToggleDirective, ThemeAssetImageDirective, ThemeAssetBackgroundDirective, ThemeStyleDirective, ThemeStyleHoverDirective], imports: [CookieModule], exports: [ThemeToggleDirective, ThemeAssetImageDirective, ThemeAssetBackgroundDirective, ThemeStyleDirective, ThemeStyleHoverDirective] });
6904
- ThemeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeModule, imports: [[CookieModule]] });
6905
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ThemeModule, decorators: [{
6906
- type: NgModule,
6907
- args: [{
6908
- imports: [CookieModule],
6909
- declarations,
6910
- exports: declarations
6911
- }]
6912
- }] });
6913
- function themeServiceFactory(nativeWindow, cookie, options) {
6914
- if (!_.isNil(options) && _.isNil(options.service)) {
6915
- options.service = cookie;
6913
+ save(name, window) {
6914
+ this.cookies.putObject(name + 'Window', {
6915
+ width: window.getWidth(),
6916
+ height: window.getHeight()
6917
+ });
6918
+ }
6919
+ destroy() {
6920
+ if (this.isDestroyed) {
6921
+ return;
6922
+ }
6923
+ super.destroy();
6924
+ this.cookies = null;
6916
6925
  }
6917
- return new ThemeService(options, nativeWindow.document);
6918
- }
6919
- function themeAssetServiceFactory(theme) {
6920
- return new ThemeAssetService(theme);
6921
6926
  }
6922
- const THEME_OPTIONS = new InjectionToken(`THEME_OPTIONS`);
6923
6927
 
6924
6928
  class WindowDragAreaDirective extends Destroyable {
6925
6929
  // --------------------------------------------------------------------------
@@ -7056,6 +7060,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
7056
7060
  }]
7057
7061
  }] });
7058
7062
 
7063
+ class IsServerDirective {
7064
+ // --------------------------------------------------------------------------
7065
+ //
7066
+ // Constructor
7067
+ //
7068
+ // --------------------------------------------------------------------------
7069
+ constructor(platform, templateRef, viewContainer) {
7070
+ if (platform.isPlatformServer) {
7071
+ viewContainer.createEmbeddedView(templateRef);
7072
+ }
7073
+ }
7074
+ }
7075
+ IsServerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: IsServerDirective, deps: [{ token: PlatformService }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
7076
+ IsServerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: IsServerDirective, selector: "[viIsServer]", ngImport: i0 });
7077
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: IsServerDirective, decorators: [{
7078
+ type: Directive,
7079
+ args: [{
7080
+ selector: '[viIsServer]'
7081
+ }]
7082
+ }], ctorParameters: function () { return [{ type: PlatformService }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
7083
+
7084
+ class IsBrowserDirective {
7085
+ // --------------------------------------------------------------------------
7086
+ //
7087
+ // Constructor
7088
+ //
7089
+ // --------------------------------------------------------------------------
7090
+ constructor(platform, templateRef, viewContainer) {
7091
+ if (platform.isPlatformBrowser) {
7092
+ viewContainer.createEmbeddedView(templateRef);
7093
+ }
7094
+ }
7095
+ }
7096
+ IsBrowserDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: IsBrowserDirective, deps: [{ token: PlatformService }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
7097
+ IsBrowserDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: IsBrowserDirective, selector: "[viIsBrowser]", ngImport: i0 });
7098
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: IsBrowserDirective, decorators: [{
7099
+ type: Directive,
7100
+ args: [{
7101
+ selector: '[viIsBrowser]'
7102
+ }]
7103
+ }], ctorParameters: function () { return [{ type: PlatformService }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
7104
+
7059
7105
  class MenuTriggerForDirective extends MatMenuTrigger {
7060
7106
  //--------------------------------------------------------------------------
7061
7107
  //
@@ -7114,6 +7160,8 @@ const DECLARATIONS$1 = [
7114
7160
  CamelCasePipe,
7115
7161
  StartCasePipe,
7116
7162
  NgModelErrorPipe,
7163
+ IsServerDirective,
7164
+ IsBrowserDirective,
7117
7165
  MomentDatePipe,
7118
7166
  MomentTimePipe,
7119
7167
  MomentDateFromNowPipe,
@@ -7173,6 +7221,8 @@ VICommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
7173
7221
  CamelCasePipe,
7174
7222
  StartCasePipe,
7175
7223
  NgModelErrorPipe,
7224
+ IsServerDirective,
7225
+ IsBrowserDirective,
7176
7226
  MomentDatePipe,
7177
7227
  MomentTimePipe,
7178
7228
  MomentDateFromNowPipe,
@@ -7197,6 +7247,8 @@ VICommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
7197
7247
  CamelCasePipe,
7198
7248
  StartCasePipe,
7199
7249
  NgModelErrorPipe,
7250
+ IsServerDirective,
7251
+ IsBrowserDirective,
7200
7252
  MomentDatePipe,
7201
7253
  MomentTimePipe,
7202
7254
  MomentDateFromNowPipe,
@@ -10111,5 +10163,5 @@ class TransportLazyModule {
10111
10163
  * Generated bundle index. Do not edit.
10112
10164
  */
10113
10165
 
10114
- export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetBaseComponent, BottomSheetModule, 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, initializerFactory, languageServiceFactory, loggerServiceFactory, nativeWindowServiceFactory, notificationServiceFactory, themeAssetServiceFactory, themeServiceFactory };
10166
+ export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetBaseComponent, BottomSheetModule, 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, IsBrowserDirective, IsServerDirective, 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, initializerFactory, languageServiceFactory, loggerServiceFactory, nativeWindowServiceFactory, notificationServiceFactory, themeAssetServiceFactory, themeServiceFactory };
10115
10167
  //# sourceMappingURL=ts-core-angular.mjs.map