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