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