@ts-core/angular 15.0.1 → 15.0.2

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.
Files changed (48) hide show
  1. package/bottomSheet/BottomSheetImpl.d.ts +0 -11
  2. package/bottomSheet/component/BottomSheetBaseComponent.d.ts +0 -5
  3. package/component/tab-group/tab-group.component.d.ts +4 -2
  4. package/directive/ResizeDirective.d.ts +2 -2
  5. package/directive/SelectOnFocusDirective.d.ts +1 -1
  6. package/esm2020/bottomSheet/BottomSheetImpl.mjs +2 -47
  7. package/esm2020/bottomSheet/BottomSheetService.mjs +2 -2
  8. package/esm2020/bottomSheet/component/BottomSheetBaseComponent.mjs +1 -16
  9. package/esm2020/component/tab-group/tab-group.component.mjs +15 -4
  10. package/esm2020/directive/AutoScrollBottomDirective.mjs +2 -2
  11. package/esm2020/directive/MenuTriggerForDirective.mjs +5 -3
  12. package/esm2020/directive/ResizeDirective.mjs +5 -5
  13. package/esm2020/directive/SelectOnFocusDirective.mjs +2 -2
  14. package/esm2020/language/LanguageMatPaginatorIntl.mjs +5 -7
  15. package/esm2020/manager/ResizeManager.mjs +3 -11
  16. package/esm2020/notification/NotificationService.mjs +2 -2
  17. package/esm2020/theme/ThemeStyleDirective.mjs +2 -2
  18. package/esm2020/util/ViewUtil.mjs +1 -1
  19. package/esm2020/window/IWindow.mjs +2 -1
  20. package/esm2020/window/WindowImpl.mjs +10 -17
  21. package/esm2020/window/WindowService.mjs +2 -2
  22. package/fesm2015/ts-core-angular.mjs +867 -931
  23. package/fesm2015/ts-core-angular.mjs.map +1 -1
  24. package/fesm2020/ts-core-angular.mjs +867 -931
  25. package/fesm2020/ts-core-angular.mjs.map +1 -1
  26. package/htdocs/common.js +3 -3
  27. package/manager/ResizeManager.d.ts +1 -1
  28. package/package.json +1 -2
  29. package/style/_filter.scss +14 -0
  30. package/style/_mouse.scss +27 -0
  31. package/style/_scroll.scss +20 -0
  32. package/style/_text.scss +12 -0
  33. package/style/mat/_core.scss +317 -0
  34. package/style/mat/_index.scss +169 -0
  35. package/style/mat/_variables.scss +1 -0
  36. package/style/mat/bootstrap/_background.scss +22 -4
  37. package/style/mat/bootstrap/_border.scss +67 -72
  38. package/style/mat/bootstrap/_index.scss +27 -0
  39. package/style/mat/bootstrap/_text.scss +28 -24
  40. package/style/mat/helper/_theme.scss +96 -0
  41. package/style/mat/helper/_typography.scss +15 -0
  42. package/window/IWindow.d.ts +1 -0
  43. package/window/WindowImpl.d.ts +1 -2
  44. package/style/mat/bootstrap/_variables.scss +0 -8
  45. package/style/mat/vi-mat-bootstrap.scss +0 -50
  46. package/style/mat/vi-mat.scss +0 -570
  47. package/style/mixin.scss +0 -69
  48. package/style/mouse.scss +0 -47
@@ -359,6 +359,7 @@ var WindowEvent;
359
359
  WindowEvent["RESIZED"] = "RESIZED";
360
360
  WindowEvent["DISABLED_CHANGED"] = "DISABLED_CHANGED";
361
361
  WindowEvent["MINIMIZED_CHANGED"] = "MINIMIZED_CHANGED";
362
+ WindowEvent["IS_ON_TOP_CHANGED"] = "IS_ON_TOP_CHANGED";
362
363
  WindowEvent["EXPAND"] = "EXPAND";
363
364
  WindowEvent["SET_ON_TOP"] = "SET_ON_TOP";
364
365
  })(WindowEvent || (WindowEvent = {}));
@@ -1225,7 +1226,7 @@ class NotificationService {
1225
1226
  }
1226
1227
  this.setDefaultProperties(config);
1227
1228
  let reference = this.dialog.open(component, config);
1228
- notification = this.factory.create({ config, reference, overlay: reference._overlayRef });
1229
+ notification = this.factory.create({ config, reference, overlay: reference['_ref'].overlayRef });
1229
1230
  let subscription = notification.events.subscribe(event => {
1230
1231
  switch (event) {
1231
1232
  case WindowEvent.OPENED:
@@ -1954,7 +1955,7 @@ class ResizeManager {
1954
1955
  // Event Handlers
1955
1956
  //
1956
1957
  // --------------------------------------------------------------------------
1957
- this.handler = (item) => {
1958
+ this.handlerItem = (item) => {
1958
1959
  if (!ResizeManager.isSizeValid(item)) {
1959
1960
  return;
1960
1961
  }
@@ -1966,12 +1967,11 @@ class ResizeManager {
1966
1967
  };
1967
1968
  this.handler2 = (items) => {
1968
1969
  if (!_.isEmpty(items)) {
1969
- this.handler(items[0].contentRect);
1970
+ this.handlerItem(items[0].contentRect);
1970
1971
  }
1971
1972
  };
1972
1973
  this.element = ViewUtil.parseElement(element);
1973
1974
  this.subject = new BehaviorSubject({ width: ViewUtil.getWidth(this.element), height: ViewUtil.getHeight(this.element) });
1974
- // this.sensor = new ResizeSensor(this.element, this.handler);
1975
1975
  // Could be undefined in ssr
1976
1976
  try {
1977
1977
  this.sensor = new ResizeObserver(this.handler2);
@@ -2011,13 +2011,6 @@ class ResizeManager {
2011
2011
  this.sensor.unobserve(this.element);
2012
2012
  this.sensor.disconnect();
2013
2013
  this.sensor = null;
2014
- /*
2015
- this.sensor.detach(this.handler);
2016
- try {
2017
- this.sensor.reset();
2018
- } catch (error) {}
2019
- this.sensor = null;
2020
- */
2021
2014
  }
2022
2015
  if (!_.isNil(this.subject)) {
2023
2016
  this.subject.complete();
@@ -2368,7 +2361,7 @@ class AutoScrollBottomDirective extends InfiniteScrollDirective {
2368
2361
  //
2369
2362
  // --------------------------------------------------------------------------
2370
2363
  initialize() {
2371
- if (!this._scrollValue) {
2364
+ if (this._scrollValue) {
2372
2365
  this._scrollValue = this.scrollHeight;
2373
2366
  }
2374
2367
  super.initialize();
@@ -2645,7 +2638,7 @@ class SelectOnFocusDirective extends Destroyable {
2645
2638
  //
2646
2639
  // --------------------------------------------------------------------------
2647
2640
  focusHandler() {
2648
- ViewUtil.selectContent(this.element.nativeElement);
2641
+ ViewUtil.selectContent(this.element);
2649
2642
  }
2650
2643
  // --------------------------------------------------------------------------
2651
2644
  //
@@ -2878,7 +2871,7 @@ class ResizeDirective extends Destroyable {
2878
2871
  // Properties
2879
2872
  //
2880
2873
  // --------------------------------------------------------------------------
2881
- this.resize = new EventEmitter();
2874
+ this.resized = new EventEmitter();
2882
2875
  this.isTop = false;
2883
2876
  this.isLeft = false;
2884
2877
  this.isRight = false;
@@ -2890,7 +2883,7 @@ class ResizeDirective extends Destroyable {
2890
2883
  // --------------------------------------------------------------------------
2891
2884
  this.resizeHandler = (event) => {
2892
2885
  if (event.dx !== 0 || event.dy !== 0) {
2893
- this.resize.emit(event);
2886
+ this.resized.emit(event);
2894
2887
  }
2895
2888
  };
2896
2889
  this.interactable = interact.default(ViewUtil.parseElement(element));
@@ -2920,13 +2913,13 @@ class ResizeDirective extends Destroyable {
2920
2913
  }
2921
2914
  }
2922
2915
  ResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ResizeDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
2923
- ResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: ResizeDirective, selector: "[vi-resize]", inputs: { isTop: "isTop", isLeft: "isLeft", isRight: "isRight", isBottom: "isBottom" }, outputs: { resize: "resize" }, usesInheritance: true, ngImport: i0 });
2916
+ ResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: ResizeDirective, selector: "[vi-resize]", inputs: { isTop: "isTop", isLeft: "isLeft", isRight: "isRight", isBottom: "isBottom" }, outputs: { resized: "resized" }, usesInheritance: true, ngImport: i0 });
2924
2917
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ResizeDirective, decorators: [{
2925
2918
  type: Directive,
2926
2919
  args: [{
2927
2920
  selector: '[vi-resize]'
2928
2921
  }]
2929
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { resize: [{
2922
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { resized: [{
2930
2923
  type: Output
2931
2924
  }], isTop: [{
2932
2925
  type: Input
@@ -3035,6 +3028,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
3035
3028
  args: ['vi-scroll-check']
3036
3029
  }] } });
3037
3030
 
3031
+ class FinancePipe {
3032
+ // --------------------------------------------------------------------------
3033
+ //
3034
+ // Static Methods
3035
+ //
3036
+ // --------------------------------------------------------------------------
3037
+ static format(value, format) {
3038
+ value = Number(value);
3039
+ try {
3040
+ return numeral(value).format(format);
3041
+ }
3042
+ catch (error) {
3043
+ return value.toString();
3044
+ }
3045
+ }
3046
+ // --------------------------------------------------------------------------
3047
+ //
3048
+ // Public Methods
3049
+ //
3050
+ // --------------------------------------------------------------------------
3051
+ transform(value, format, isNeedPlus = false) {
3052
+ value = Number(value);
3053
+ if (_.isNaN(value)) {
3054
+ return '---';
3055
+ }
3056
+ if (_.isNil(format)) {
3057
+ format = FinancePipe.DEFAULT_FORMAT;
3058
+ }
3059
+ if (isNeedPlus) {
3060
+ format = '+' + format;
3061
+ }
3062
+ return FinancePipe.format(value, format);
3063
+ }
3064
+ }
3065
+ // --------------------------------------------------------------------------
3066
+ //
3067
+ // Static Properties
3068
+ //
3069
+ // --------------------------------------------------------------------------
3070
+ FinancePipe.DEFAULT_FORMAT = '0,0';
3071
+ FinancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FinancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3072
+ FinancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: FinancePipe, name: "viFinance" });
3073
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FinancePipe, decorators: [{
3074
+ type: Pipe,
3075
+ args: [{
3076
+ name: 'viFinance'
3077
+ }]
3078
+ }] });
3079
+
3038
3080
  class LanguageMatPaginatorIntl extends MatPaginatorIntl {
3039
3081
  // --------------------------------------------------------------------------
3040
3082
  //
@@ -3046,16 +3088,13 @@ class LanguageMatPaginatorIntl extends MatPaginatorIntl {
3046
3088
  this.language = language;
3047
3089
  this.languageRangeLabel = (page, pageSize, length) => {
3048
3090
  let translation = { current: '0', total: '0' };
3049
- if (length === 0 || pageSize === 0) {
3050
- translation.total = length.toString();
3051
- }
3052
- else {
3091
+ if (length > 0 && pageSize > 0) {
3053
3092
  length = Math.max(length, 0);
3054
3093
  let startIndex = page * pageSize;
3055
3094
  let endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
3056
3095
  translation.current = `${startIndex + 1} – ${endIndex}`;
3057
- translation.total = length.toString();
3058
3096
  }
3097
+ translation.total = FinancePipe.format(length, FinancePipe.DEFAULT_FORMAT);
3059
3098
  return this.language.translate('paginator.pageRange', translation);
3060
3099
  };
3061
3100
  this.commitLanguageProperties();
@@ -3067,12 +3106,12 @@ class LanguageMatPaginatorIntl extends MatPaginatorIntl {
3067
3106
  //
3068
3107
  // --------------------------------------------------------------------------
3069
3108
  commitLanguageProperties() {
3109
+ this.getRangeLabel = this.languageRangeLabel;
3070
3110
  this.lastPageLabel = this.language.translate('paginator.lastPage');
3071
3111
  this.nextPageLabel = this.language.translate('paginator.nextPage');
3072
3112
  this.firstPageLabel = this.language.translate('paginator.firstPage');
3073
3113
  this.previousPageLabel = this.language.translate('paginator.previousPage');
3074
3114
  this.itemsPerPageLabel = this.language.translate('paginator.itemsPerPage');
3075
- this.getRangeLabel = this.languageRangeLabel;
3076
3115
  }
3077
3116
  // --------------------------------------------------------------------------
3078
3117
  //
@@ -3722,1098 +3761,1047 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
3722
3761
  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>" }]
3723
3762
  }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i1$1.LanguageService }]; } });
3724
3763
 
3725
- class WindowBase extends DestroyableContainer {
3764
+ class BottomSheetImpl extends DestroyableContainer {
3726
3765
  // --------------------------------------------------------------------------
3727
3766
  //
3728
- // Constructor
3767
+ // Constructor
3729
3768
  //
3730
3769
  // --------------------------------------------------------------------------
3731
- constructor() {
3770
+ constructor(properties) {
3732
3771
  super();
3772
+ this._isDisabled = false;
3733
3773
  // --------------------------------------------------------------------------
3734
3774
  //
3735
- // Properties
3775
+ // Protected Methods
3736
3776
  //
3737
3777
  // --------------------------------------------------------------------------
3738
- this._x = NaN;
3739
- this._width = NaN;
3740
- this._y = NaN;
3741
- this._height = NaN;
3742
- this.updatePosition = () => this.setPosition();
3778
+ this.setClosed = () => {
3779
+ this.emit(WindowEvent.CLOSED);
3780
+ this.destroy();
3781
+ };
3782
+ this.setOpened = () => {
3783
+ this.emit(WindowEvent.OPENED);
3784
+ };
3785
+ this.mouseDownHandlerProxy = (event) => {
3786
+ this.mouseDownHandler(event);
3787
+ };
3788
+ this.mouseClickHandlerProxy = (event) => {
3789
+ this.mouseClickHandler(event);
3790
+ };
3791
+ this.observer = new Subject();
3792
+ this.properties = properties;
3793
+ this.content.window = this;
3794
+ // Have to save for unsubscribe on destroy
3795
+ this._wrapper = this.properties.overlay.hostElement;
3796
+ this._backdrop = this.properties.overlay.backdropElement;
3797
+ this._container = this.properties.overlay.overlayElement;
3798
+ this.setProperties();
3799
+ this.elementsCreate();
3800
+ this.getReference().afterOpened().pipe(takeUntil(this.destroyed)).subscribe(this.setOpened);
3801
+ this.getReference().afterDismissed().pipe(takeUntil(this.destroyed)).subscribe(this.setClosed);
3802
+ }
3803
+ // --------------------------------------------------------------------------
3804
+ //
3805
+ // Elements Methods
3806
+ //
3807
+ // --------------------------------------------------------------------------
3808
+ elementsCreate() {
3809
+ this.elements = new Array();
3810
+ }
3811
+ elementsDestroy() {
3812
+ this.elements.forEach(item => this.elementDestroy(item));
3813
+ this.elements = null;
3814
+ }
3815
+ elementAdd(item) {
3816
+ this.elements.push(item);
3817
+ item.instance.window = this;
3818
+ return item;
3819
+ }
3820
+ elementRemove(item) {
3821
+ ArrayUtil.remove(this.elements, item);
3822
+ this.elementDestroy(item);
3823
+ return item;
3824
+ }
3825
+ elementDestroy(item) {
3826
+ item.instance.window = null;
3827
+ item.destroy();
3828
+ return item;
3743
3829
  }
3744
3830
  setProperties() {
3745
- let config = this.getConfig();
3746
- if (!_.isNaN(config.defaultWidth)) {
3747
- this.width = config.defaultWidth;
3748
- }
3749
- if (!_.isNaN(config.defaultHeight)) {
3750
- this.height = config.defaultHeight;
3831
+ ViewUtil.addClass(this.container, 'vi-bottom-sheet');
3832
+ ViewUtil.toggleClass(this.container, 'vi-modal', this.config.isModal);
3833
+ this.container.addEventListener('click', this.mouseClickHandlerProxy, true);
3834
+ this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
3835
+ /*
3836
+ if (!this.config.isModal) {
3837
+ this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
3751
3838
  }
3839
+ */
3752
3840
  }
3753
- setPosition() {
3754
- let config = this.getConfig();
3755
- switch (config.horizontalAlign) {
3756
- case WindowAlign.START:
3757
- this.x = !_.isNaN(this.paddingLeft) ? this.paddingLeft : 0;
3758
- break;
3759
- case WindowAlign.END:
3760
- let value = ViewUtil.getStageWidth() - this.calculateWidth();
3761
- if (!_.isNaN(this.paddingRight)) {
3762
- value -= this.paddingRight;
3763
- }
3764
- this.x = value;
3765
- break;
3766
- default:
3767
- this.x = (ViewUtil.getStageWidth() - this.calculateWidth()) / 2;
3768
- break;
3769
- }
3770
- switch (config.verticalAlign) {
3771
- case WindowAlign.START:
3772
- this.y = !_.isNaN(this.paddingTop) ? this.paddingTop : 0;
3773
- break;
3774
- case WindowAlign.END:
3775
- let value = ViewUtil.getStageHeight() - this.calculateHeight();
3776
- if (!_.isNaN(this.paddingBottom)) {
3777
- value -= this.paddingBottom;
3778
- }
3779
- this.y = value;
3780
- break;
3781
- default:
3782
- this.y = (ViewUtil.getStageHeight() - this.calculateHeight()) / 2;
3783
- break;
3784
- }
3841
+ commitIsDisabledProperties() { }
3842
+ getConfig() {
3843
+ return this.properties.config;
3785
3844
  }
3786
- clearSize() {
3787
- this._x = NaN;
3788
- this._y = NaN;
3789
- this._width = NaN;
3790
- this._height = NaN;
3845
+ getContainer() {
3846
+ return this.container;
3791
3847
  }
3792
- commitSizeProperties() {
3793
- let width = !_.isNaN(this.width) ? this.width + 'px' : 'auto';
3794
- let height = !_.isNaN(this.height) ? this.height + 'px' : 'auto';
3795
- this.getReference().updateSize(width, height);
3848
+ getReference() {
3849
+ return this.properties.reference;
3796
3850
  }
3797
- commitPositionProperties() {
3798
- if (_.isNaN(this._x) && _.isNaN(this._y)) {
3799
- return;
3800
- }
3801
- let position = {};
3802
- if (!_.isNaN(this._y)) {
3803
- position.top = this._y + 'px';
3804
- }
3805
- if (!_.isNaN(this._x)) {
3806
- position.left = this._x + 'px';
3851
+ isNeedClickStopPropagation(event) {
3852
+ let element = _.find(this.elements, item => item.location.nativeElement === event.target);
3853
+ if (_.isNil(element)) {
3854
+ return false;
3807
3855
  }
3808
- this.getReference().updatePosition(position);
3856
+ element.instance.clickHandler(event);
3857
+ return true;
3809
3858
  }
3810
3859
  // --------------------------------------------------------------------------
3811
3860
  //
3812
- // Public Methods
3861
+ // Event Handlers
3813
3862
  //
3814
3863
  // --------------------------------------------------------------------------
3815
- calculateWidth() {
3816
- return !_.isNaN(this.width) ? this.width : ViewUtil.getWidth(this.getContainer());
3864
+ mouseDownHandler(event) {
3865
+ this.setOnTop();
3817
3866
  }
3818
- calculateHeight() {
3819
- return !_.isNaN(this.height) ? this.height : ViewUtil.getHeight(this.getContainer());
3867
+ mouseClickHandler(event) {
3868
+ if (this.isNeedClickStopPropagation(event)) {
3869
+ event.stopPropagation();
3870
+ }
3820
3871
  }
3821
3872
  // --------------------------------------------------------------------------
3822
3873
  //
3823
- // Private Properties
3874
+ // Public Methods
3824
3875
  //
3825
3876
  // --------------------------------------------------------------------------
3826
- get width() {
3827
- return this._width;
3828
- }
3829
- set width(value) {
3830
- value = this.getConfig().parseWidth(value);
3831
- if (value === this._width) {
3832
- return;
3833
- }
3834
- this._width = value;
3835
- this.commitSizeProperties();
3877
+ emit(event) {
3878
+ this.observer.next(event);
3836
3879
  }
3837
- get height() {
3838
- return this._height;
3880
+ close() {
3881
+ this.getReference().dismiss();
3839
3882
  }
3840
- set height(value) {
3841
- value = this.getConfig().parseHeight(value);
3842
- if (value === this._height) {
3883
+ destroy() {
3884
+ if (this.isDestroyed) {
3843
3885
  return;
3844
3886
  }
3845
- this._height = value;
3846
- this.commitSizeProperties();
3887
+ super.destroy();
3888
+ this.elementsDestroy();
3889
+ this._container.removeEventListener('click', this.mouseClickHandlerProxy, true);
3890
+ this._container.removeEventListener('mousedown', this.mouseDownHandlerProxy);
3891
+ if (!_.isNil(this.content)) {
3892
+ this.content.destroy();
3893
+ }
3894
+ if (!_.isNil(this.observer)) {
3895
+ this.observer.complete();
3896
+ this.observer = null;
3897
+ }
3898
+ this.properties = null;
3899
+ this._wrapper = null;
3900
+ this._backdrop = null;
3901
+ this._container = null;
3847
3902
  }
3903
+ blink() { }
3904
+ shake() { }
3905
+ setOnTop() { }
3848
3906
  // --------------------------------------------------------------------------
3849
3907
  //
3850
- // Public Properties
3908
+ // Size Methods
3851
3909
  //
3852
3910
  // --------------------------------------------------------------------------
3853
- get x() {
3854
- return this._x;
3855
- }
3856
- set x(value) {
3857
- value = this.getConfig().parseX(value);
3858
- if (value === this._x) {
3859
- return;
3860
- }
3861
- this._x = value;
3862
- this.commitPositionProperties();
3863
- }
3864
- get y() {
3865
- return this._y;
3866
- }
3867
- set y(value) {
3868
- value = this.getConfig().parseY(value);
3869
- if (value === this._y) {
3870
- return;
3871
- }
3872
- this._y = value;
3873
- this.commitPositionProperties();
3874
- }
3875
- get paddingTop() {
3876
- return this.getConfig().paddingTop;
3911
+ getWidth() {
3912
+ return NaN;
3877
3913
  }
3878
- get paddingLeft() {
3879
- return this.getConfig().paddingLeft;
3914
+ getHeight() {
3915
+ return NaN;
3880
3916
  }
3881
- get paddingRight() {
3882
- return this.getConfig().paddingRight;
3917
+ setWidth(value, isNeedNotify = true) { }
3918
+ setHeight(value, isNeedNotify = true) { }
3919
+ setSize(width, height) { }
3920
+ // --------------------------------------------------------------------------
3921
+ //
3922
+ // Move Methods
3923
+ //
3924
+ // --------------------------------------------------------------------------
3925
+ getX() {
3926
+ return NaN;
3883
3927
  }
3884
- get paddingBottom() {
3885
- return this.getConfig().paddingBottom;
3928
+ setX(value, isNeedNotify = true) { }
3929
+ getY() {
3930
+ return NaN;
3886
3931
  }
3887
- }
3888
-
3889
- class WindowImpl extends WindowBase {
3932
+ setY(value, isNeedNotify = true) { }
3933
+ move(x, y) { }
3890
3934
  // --------------------------------------------------------------------------
3891
3935
  //
3892
- // Constructor
3936
+ // Private Properties
3893
3937
  //
3894
3938
  // --------------------------------------------------------------------------
3895
- constructor(properties) {
3896
- super();
3897
- // --------------------------------------------------------------------------
3898
- //
3899
- // Properties
3900
- //
3901
- // --------------------------------------------------------------------------
3902
- this._isBlink = false;
3903
- this._isShaking = false;
3904
- this._isOnTop = false;
3905
- this._isDisabled = false;
3906
- this._isMinimized = false;
3907
- this.isOpened = false;
3908
- this.isWasOnTop = false;
3909
- // --------------------------------------------------------------------------
3910
- //
3911
- // Protected Methods
3912
- //
3913
- // --------------------------------------------------------------------------
3914
- this.setClosed = () => {
3915
- this.isOpened = false;
3916
- this.emit(WindowEvent.CLOSED);
3917
- this.destroy();
3918
- };
3919
- this.setOpened = () => {
3920
- this.isOpened = true;
3921
- this.emit(WindowEvent.OPENED);
3922
- };
3923
- this.blinkToggle = () => {
3924
- this.isBlink = !this.isBlink;
3925
- };
3926
- this.stopShaking = () => {
3927
- this.isShaking = false;
3928
- };
3929
- this.emitResize = () => {
3930
- this.emit(WindowEvent.RESIZED);
3931
- };
3932
- this.resizeHandler = () => {
3933
- if (!this.isOpened) {
3934
- return;
3935
- }
3936
- clearTimeout(this.resizeTimer);
3937
- this.resizeTimer = setTimeout(this.emitResize, WindowImpl.RESIZE_DELAY);
3938
- };
3939
- this.mouseDownHandlerProxy = (event) => {
3940
- this.mouseDownHandler(event);
3941
- };
3942
- this.mouseClickHandlerProxy = (event) => {
3943
- this.mouseClickHandler(event);
3944
- };
3945
- this.observer = new Subject();
3946
- this.elements = new Array();
3947
- this.properties = properties;
3948
- this.content.window = this;
3949
- // Have to save for unsubscribe on destroy
3950
- this._wrapper = this.properties.overlay.hostElement;
3951
- this._backdrop = this.properties.overlay.backdropElement;
3952
- this._container = this.properties.overlay.overlayElement;
3953
- this.setProperties();
3954
- this.getReference().afterOpened().pipe(takeUntil(this.destroyed)).subscribe(this.setOpened);
3955
- this.getReference().afterClosed().pipe(takeUntil(this.destroyed)).subscribe(this.setClosed);
3956
- this.events
3957
- .pipe(filter(event => event === WindowEvent.CONTENT_READY), takeUntil(this.destroyed))
3958
- .subscribe(this.updatePosition);
3939
+ get reference() {
3940
+ return this.properties.reference;
3959
3941
  }
3960
3942
  // --------------------------------------------------------------------------
3961
3943
  //
3962
- // Elements Methods
3944
+ // Public Properties
3963
3945
  //
3964
3946
  // --------------------------------------------------------------------------
3965
- elementsCreate() {
3966
- this.elements = new Array();
3967
- }
3968
- elementsDestroy() {
3969
- this.elements.forEach(item => this.elementDestroy(item));
3970
- this.elements = null;
3947
+ get events() {
3948
+ return this.observer.asObservable();
3971
3949
  }
3972
- elementAdd(item) {
3973
- this.elements.push(item);
3974
- item.instance.window = this;
3975
- return item;
3950
+ get config() {
3951
+ return this.properties.config;
3976
3952
  }
3977
- elementRemove(item) {
3978
- ArrayUtil.remove(this.elements, item);
3979
- this.elementDestroy(item);
3980
- return item;
3953
+ get content() {
3954
+ return !_.isNil(this.reference) ? this.reference.instance : null;
3981
3955
  }
3982
- elementDestroy(item) {
3983
- item.instance.window = null;
3984
- item.destroy();
3985
- return item;
3956
+ get container() {
3957
+ return this._container;
3986
3958
  }
3987
- setProperties() {
3988
- super.setProperties();
3989
- ViewUtil.addClass(this.container, 'vi-window');
3990
- ViewUtil.toggleClass(this.container, 'vi-modal', this.config.isModal);
3991
- this.container.addEventListener('click', this.mouseClickHandlerProxy, true);
3992
- this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
3993
- /*
3994
- if (!this.config.isModal) {
3995
- this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
3996
- }
3997
- */
3998
- this.elementsCreate();
3959
+ get wrapper() {
3960
+ return this._wrapper;
3999
3961
  }
4000
- commitIsBlinkProperties() { }
4001
- commitIsShakingProperties() { }
4002
- commitIsDisabledProperties() { }
4003
- commitIsMinimizedProperties() { }
4004
- getConfig() {
4005
- return this.properties.config;
3962
+ get backdrop() {
3963
+ return this._backdrop;
4006
3964
  }
4007
- getContainer() {
4008
- return this.container;
3965
+ get isOnTop() {
3966
+ return false;
4009
3967
  }
4010
- getReference() {
4011
- return this.properties.reference;
3968
+ set isOnTop(value) { }
3969
+ get isMinimized() {
3970
+ return false;
4012
3971
  }
4013
- isNeedClickStopPropagation(event) {
4014
- if (!this.isWasOnTop) {
4015
- return true;
4016
- }
4017
- let element = _.find(this.elements, item => item.location.nativeElement === event.target);
4018
- if (_.isNil(element)) {
4019
- return false;
4020
- }
4021
- element.instance.clickHandler(event);
4022
- return true;
3972
+ set isMinimized(value) { }
3973
+ get isDisabled() {
3974
+ return this._isDisabled;
4023
3975
  }
4024
- stopBlinkIfNeed() {
4025
- this.isBlink = false;
4026
- if (!this.blinkTimer) {
3976
+ set isDisabled(value) {
3977
+ if (value === this._isDisabled) {
4027
3978
  return;
4028
3979
  }
4029
- clearInterval(this.blinkTimer);
4030
- this.blinkTimer = null;
3980
+ this._isDisabled = value;
3981
+ this.commitIsDisabledProperties();
3982
+ this.emit(WindowEvent.DISABLED_CHANGED);
4031
3983
  }
4032
- mouseDownHandler(event) {
4033
- this.setOnTop();
3984
+ }
3985
+
3986
+ class WindowElement extends DestroyableContainer {
3987
+ // --------------------------------------------------------------------------
3988
+ //
3989
+ // Constructor
3990
+ //
3991
+ // --------------------------------------------------------------------------
3992
+ constructor(element) {
3993
+ super();
3994
+ this.element = element;
4034
3995
  }
4035
- mouseClickHandler(event) {
4036
- if (this.isNeedClickStopPropagation(event)) {
4037
- event.stopPropagation();
3996
+ // --------------------------------------------------------------------------
3997
+ //
3998
+ // Private Methods
3999
+ //
4000
+ // --------------------------------------------------------------------------
4001
+ checkWindowParent() {
4002
+ let container = this.getContainer();
4003
+ if (!_.isNil(container)) {
4004
+ ViewUtil.appendChild(container, this.element.nativeElement);
4038
4005
  }
4039
- if (!this.isWasOnTop) {
4040
- this.isWasOnTop = true;
4006
+ }
4007
+ getContainer() {
4008
+ let item = ViewUtil.parseElement(this.element.nativeElement);
4009
+ while (!_.isNil(item) && item.nodeName.toLowerCase() !== 'mat-dialog-container') {
4010
+ item = item.parentElement;
4041
4011
  }
4012
+ return item;
4042
4013
  }
4014
+ createChildren() { }
4015
+ destroyChildren() { }
4016
+ commitWindowProperties() { }
4043
4017
  // --------------------------------------------------------------------------
4044
4018
  //
4045
- // Public Methods
4019
+ // Public Methods
4046
4020
  //
4047
4021
  // --------------------------------------------------------------------------
4048
- emit(event) {
4049
- this.observer.next(event);
4050
- }
4051
- close() {
4052
- this.getReference().close();
4022
+ ngAfterViewInit() {
4023
+ this.createChildren();
4024
+ this.checkWindowParent();
4053
4025
  }
4054
4026
  destroy() {
4055
4027
  if (this.isDestroyed) {
4056
4028
  return;
4057
4029
  }
4058
4030
  super.destroy();
4059
- this.elementsDestroy();
4060
- this._container.removeEventListener('click', this.mouseClickHandlerProxy, true);
4061
- this._container.removeEventListener('mousedown', this.mouseDownHandlerProxy);
4062
- if (!_.isNil(this.content)) {
4063
- this.content.destroy();
4064
- }
4065
- if (!_.isNil(this.observer)) {
4066
- this.observer.complete();
4067
- this.observer = null;
4068
- }
4069
- this.properties = null;
4070
- this._wrapper = null;
4071
- this._backdrop = null;
4072
- this._container = null;
4073
- clearInterval(this.blinkTimer);
4074
- this.blinkTimer = null;
4075
- clearInterval(this.shakeTimer);
4076
- this.shakeTimer = null;
4077
- clearTimeout(this.resizeTimer);
4078
- this.resizeTimer = null;
4079
- }
4080
- blink() {
4081
- clearInterval(this.blinkTimer);
4082
- this.blinkTimer = setInterval(this.blinkToggle, WindowImpl.BLINK_DELAY);
4083
- }
4084
- shake() {
4085
- if (this.isShaking) {
4086
- return;
4087
- }
4088
- this.isShaking = true;
4089
- clearInterval(this.shakeTimer);
4090
- this.shakeTimer = setInterval(this.stopShaking, WindowImpl.SHAKE_DELAY);
4091
- }
4092
- setOnTop() {
4093
- this.isWasOnTop = this.isOnTop;
4094
- this.emit(WindowEvent.SET_ON_TOP);
4031
+ this.destroyChildren();
4032
+ this.element = null;
4033
+ this.window = null;
4095
4034
  }
4096
4035
  // --------------------------------------------------------------------------
4097
4036
  //
4098
- // Size Methods
4037
+ // Event Handlers
4099
4038
  //
4100
4039
  // --------------------------------------------------------------------------
4101
- getWidth() {
4102
- return this.width;
4103
- }
4104
- getHeight() {
4105
- return this.height;
4106
- }
4107
- setWidth(value, isNeedNotify = true) {
4108
- this.width = value;
4109
- if (isNeedNotify) {
4110
- this.resizeHandler();
4111
- }
4112
- }
4113
- setHeight(value, isNeedNotify = true) {
4114
- this.height = value;
4115
- if (isNeedNotify) {
4116
- this.resizeHandler();
4117
- }
4118
- }
4119
- setSize(width, height) {
4120
- this.setWidth(width, false);
4121
- this.setHeight(height, false);
4122
- this.resizeHandler();
4040
+ clickHandler(event) {
4041
+ event.stopPropagation();
4123
4042
  }
4124
4043
  // --------------------------------------------------------------------------
4125
4044
  //
4126
- // Move Methods
4045
+ // Protected Properties
4127
4046
  //
4128
4047
  // --------------------------------------------------------------------------
4129
- getX() {
4130
- return this.x;
4131
- }
4132
- setX(value, isNeedNotify = true) {
4133
- this.x = value;
4134
- if (isNeedNotify) {
4135
- this.emit(WindowEvent.MOVED);
4136
- }
4137
- }
4138
- getY() {
4139
- return this.y;
4140
- }
4141
- setY(value, isNeedNotify = true) {
4142
- this.y = value;
4143
- if (isNeedNotify) {
4144
- this.emit(WindowEvent.MOVED);
4145
- }
4146
- }
4147
- move(x, y) {
4148
- this.setX(x, false);
4149
- this.setY(y, false);
4150
- this.emit(WindowEvent.MOVED);
4048
+ get nativeElement() {
4049
+ return this.element ? this.element.nativeElement : null;
4151
4050
  }
4152
4051
  // --------------------------------------------------------------------------
4153
4052
  //
4154
- // Private Properties
4053
+ // Public Properties
4155
4054
  //
4156
4055
  // --------------------------------------------------------------------------
4157
- get isBlink() {
4158
- return this._isBlink;
4056
+ get window() {
4057
+ return this._window;
4159
4058
  }
4160
- set isBlink(value) {
4161
- if (value === this._isBlink) {
4059
+ set window(value) {
4060
+ if (value === this._window) {
4162
4061
  return;
4163
4062
  }
4164
- this._isBlink = value;
4165
- this.commitIsBlinkProperties();
4166
- }
4167
- get isShaking() {
4168
- return this._isShaking;
4169
- }
4170
- set isShaking(value) {
4171
- if (value === this._isShaking) {
4172
- return;
4063
+ this._window = value;
4064
+ if (this.window) {
4065
+ this.commitWindowProperties();
4173
4066
  }
4174
- this._isShaking = value;
4175
- this.commitIsShakingProperties();
4176
4067
  }
4068
+ }
4069
+ WindowElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowElement, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4070
+ WindowElement.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: WindowElement, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
4071
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowElement, decorators: [{
4072
+ type: Component,
4073
+ args: [{ template: '' }]
4074
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4075
+
4076
+ class WindowCloseElementComponent extends WindowElement {
4177
4077
  // --------------------------------------------------------------------------
4178
4078
  //
4179
- // Public Properties
4079
+ // Constructor
4180
4080
  //
4181
4081
  // --------------------------------------------------------------------------
4182
- get events() {
4183
- return this.observer.asObservable();
4184
- }
4185
- get config() {
4186
- return this.properties.config;
4187
- }
4188
- get content() {
4189
- return this.properties.reference ? this.properties.reference.componentInstance : null;
4190
- }
4191
- get container() {
4192
- return this._container;
4193
- }
4194
- get wrapper() {
4195
- return this._wrapper;
4196
- }
4197
- get backdrop() {
4198
- return this._backdrop;
4199
- }
4200
- get isOnTop() {
4201
- return this._isOnTop;
4082
+ constructor(element) {
4083
+ super(element);
4202
4084
  }
4203
- set isOnTop(value) {
4204
- if (value === this._isOnTop) {
4205
- return;
4085
+ // --------------------------------------------------------------------------
4086
+ //
4087
+ // Private Methods
4088
+ //
4089
+ // --------------------------------------------------------------------------
4090
+ createChildren() {
4091
+ super.createChildren();
4092
+ if (!_.isNil(WindowCloseElementComponent.ICON_VALUE)) {
4093
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowCloseElementComponent.ICON_VALUE);
4206
4094
  }
4207
- this._isOnTop = value;
4208
- clearInterval(this.blinkTimer);
4209
- this.isBlink = false;
4210
- }
4211
- get isMinimized() {
4212
- return this._isMinimized;
4213
- }
4214
- set isMinimized(value) {
4215
- if (value === this._isMinimized) {
4216
- return;
4095
+ if (!_.isNil(WindowCloseElementComponent.ICON_CLASS)) {
4096
+ ViewUtil.addClasses(this.nativeElement, WindowCloseElementComponent.ICON_CLASS);
4217
4097
  }
4218
- this._isMinimized = value;
4219
- this.commitIsMinimizedProperties();
4220
- this.emit(WindowEvent.MINIMIZED_CHANGED);
4221
- this.stopBlinkIfNeed();
4222
- }
4223
- get isDisabled() {
4224
- return this._isDisabled;
4098
+ ViewUtil.addClass(this.nativeElement, 'mouse-active');
4225
4099
  }
4226
- set isDisabled(value) {
4227
- if (value === this._isDisabled) {
4228
- return;
4100
+ // --------------------------------------------------------------------------
4101
+ //
4102
+ // Event Handlers
4103
+ //
4104
+ // --------------------------------------------------------------------------
4105
+ clickHandler(event) {
4106
+ super.clickHandler(event);
4107
+ if (!_.isNil(this.window)) {
4108
+ this.window.close();
4229
4109
  }
4230
- this._isDisabled = value;
4231
- this.commitIsDisabledProperties();
4232
- this.emit(WindowEvent.DISABLED_CHANGED);
4233
4110
  }
4234
4111
  }
4235
4112
  // --------------------------------------------------------------------------
4236
4113
  //
4237
- // Constants
4114
+ // Constants
4238
4115
  //
4239
4116
  // --------------------------------------------------------------------------
4240
- WindowImpl.BLINK_DELAY = 500;
4241
- WindowImpl.SHAKE_DELAY = 500;
4242
- WindowImpl.RESIZE_DELAY = 200;
4117
+ WindowCloseElementComponent.ICON_CLASS = 'fas fa-times';
4118
+ WindowCloseElementComponent.ICON_VALUE = null;
4119
+ WindowCloseElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowCloseElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4120
+ WindowCloseElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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"] });
4121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowCloseElementComponent, decorators: [{
4122
+ type: Component,
4123
+ 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"] }]
4124
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4243
4125
 
4244
- class BottomSheetImpl extends DestroyableContainer {
4126
+ class WindowExpandElementComponent extends WindowElement {
4245
4127
  // --------------------------------------------------------------------------
4246
4128
  //
4247
- // Constructor
4129
+ // Constructor
4248
4130
  //
4249
4131
  // --------------------------------------------------------------------------
4250
- constructor(properties) {
4251
- super();
4252
- // --------------------------------------------------------------------------
4253
- //
4254
- // Properties
4255
- //
4256
- // --------------------------------------------------------------------------
4257
- this._isBlink = false;
4258
- this._isDisabled = false;
4259
- // --------------------------------------------------------------------------
4260
- //
4261
- // Protected Methods
4262
- //
4263
- // --------------------------------------------------------------------------
4264
- this.setClosed = () => {
4265
- this.emit(WindowEvent.CLOSED);
4266
- this.destroy();
4267
- };
4268
- this.setOpened = () => {
4269
- this.emit(WindowEvent.OPENED);
4270
- };
4271
- this.blinkToggle = () => {
4272
- this.isBlink = !this.isBlink;
4273
- };
4274
- this.mouseDownHandlerProxy = (event) => {
4275
- this.mouseDownHandler(event);
4276
- };
4277
- this.mouseClickHandlerProxy = (event) => {
4278
- this.mouseClickHandler(event);
4279
- };
4280
- this.observer = new Subject();
4281
- this.properties = properties;
4282
- this.content.window = this;
4283
- // Have to save for unsubscribe on destroy
4284
- this._wrapper = this.properties.overlay.hostElement;
4285
- this._backdrop = this.properties.overlay.backdropElement;
4286
- this._container = this.properties.overlay.overlayElement;
4287
- this.setProperties();
4288
- this.elementsCreate();
4289
- this.getReference().afterOpened().pipe(takeUntil(this.destroyed)).subscribe(this.setOpened);
4290
- this.getReference().afterDismissed().pipe(takeUntil(this.destroyed)).subscribe(this.setClosed);
4132
+ constructor(element) {
4133
+ super(element);
4291
4134
  }
4292
4135
  // --------------------------------------------------------------------------
4293
4136
  //
4294
- // Elements Methods
4137
+ // Private Methods
4295
4138
  //
4296
4139
  // --------------------------------------------------------------------------
4297
- elementsCreate() {
4298
- this.elements = new Array();
4299
- }
4300
- elementsDestroy() {
4301
- this.elements.forEach(item => this.elementDestroy(item));
4302
- this.elements = null;
4303
- }
4304
- elementAdd(item) {
4305
- this.elements.push(item);
4306
- item.instance.window = this;
4307
- return item;
4308
- }
4309
- elementRemove(item) {
4310
- ArrayUtil.remove(this.elements, item);
4311
- this.elementDestroy(item);
4312
- return item;
4313
- }
4314
- elementDestroy(item) {
4315
- item.instance.window = null;
4316
- item.destroy();
4317
- return item;
4318
- }
4319
- setProperties() {
4320
- ViewUtil.addClass(this.container, 'vi-bottom-sheet');
4321
- ViewUtil.toggleClass(this.container, 'vi-modal', this.config.isModal);
4322
- this.container.addEventListener('click', this.mouseClickHandlerProxy, true);
4323
- this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4324
- /*
4325
- if (!this.config.isModal) {
4326
- this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4327
- }
4328
- */
4329
- }
4330
- commitIsBlinkProperties() { }
4331
- commitIsDisabledProperties() { }
4332
- getConfig() {
4333
- return this.properties.config;
4334
- }
4335
- getContainer() {
4336
- return this.container;
4337
- }
4338
- getReference() {
4339
- return this.properties.reference;
4340
- }
4341
- isNeedClickStopPropagation(event) {
4342
- let element = _.find(this.elements, item => item.location.nativeElement === event.target);
4343
- if (_.isNil(element)) {
4344
- return false;
4345
- }
4346
- element.instance.clickHandler(event);
4347
- return true;
4348
- }
4349
- stopBlinkIfNeed() {
4350
- this.isBlink = false;
4351
- if (!this.blinkTimer) {
4352
- return;
4353
- }
4354
- clearInterval(this.blinkTimer);
4355
- this.blinkTimer = null;
4140
+ createChildren() {
4141
+ super.createChildren();
4142
+ if (!_.isNil(WindowExpandElementComponent.ICON_VALUE)) {
4143
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowExpandElementComponent.ICON_VALUE);
4144
+ }
4145
+ if (!_.isNil(WindowExpandElementComponent.ICON_CLASS)) {
4146
+ ViewUtil.addClasses(this.nativeElement, WindowExpandElementComponent.ICON_CLASS);
4147
+ }
4148
+ ViewUtil.addClass(this.nativeElement, 'mouse-active');
4356
4149
  }
4357
4150
  // --------------------------------------------------------------------------
4358
4151
  //
4359
- // Event Handlers
4152
+ // Event Handlers
4360
4153
  //
4361
4154
  // --------------------------------------------------------------------------
4362
- mouseDownHandler(event) {
4363
- this.setOnTop();
4364
- }
4365
- mouseClickHandler(event) {
4366
- if (this.isNeedClickStopPropagation(event)) {
4367
- event.stopPropagation();
4155
+ clickHandler(event) {
4156
+ super.clickHandler(event);
4157
+ if (!_.isNil(this.window)) {
4158
+ this.window.emit(WindowEvent.EXPAND);
4368
4159
  }
4369
4160
  }
4161
+ }
4162
+ // --------------------------------------------------------------------------
4163
+ //
4164
+ // Constants
4165
+ //
4166
+ // --------------------------------------------------------------------------
4167
+ WindowExpandElementComponent.ICON_CLASS = 'fas fa-angle-double-up';
4168
+ WindowExpandElementComponent.ICON_VALUE = null;
4169
+ WindowExpandElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowExpandElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4170
+ WindowExpandElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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"] });
4171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowExpandElementComponent, decorators: [{
4172
+ type: Component,
4173
+ 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"] }]
4174
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4175
+
4176
+ class WindowResizeElementComponent extends WindowElement {
4370
4177
  // --------------------------------------------------------------------------
4371
4178
  //
4372
- // Public Methods
4179
+ // Constructor
4373
4180
  //
4374
4181
  // --------------------------------------------------------------------------
4375
- emit(event) {
4376
- this.observer.next(event);
4377
- }
4378
- close() {
4379
- this.getReference().dismiss();
4182
+ constructor(element) {
4183
+ super(element);
4380
4184
  }
4381
- destroy() {
4382
- if (this.isDestroyed) {
4383
- return;
4384
- }
4385
- super.destroy();
4386
- this.elementsDestroy();
4387
- this._container.removeEventListener('click', this.mouseClickHandlerProxy, true);
4388
- this._container.removeEventListener('mousedown', this.mouseDownHandlerProxy);
4389
- if (!_.isNil(this.content)) {
4390
- this.content.destroy();
4185
+ // --------------------------------------------------------------------------
4186
+ //
4187
+ // Private Methods
4188
+ //
4189
+ // --------------------------------------------------------------------------
4190
+ createChildren() {
4191
+ super.createChildren();
4192
+ if (!_.isNil(WindowResizeElementComponent.ICON_VALUE)) {
4193
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowResizeElementComponent.ICON_VALUE);
4391
4194
  }
4392
- if (!_.isNil(this.observer)) {
4393
- this.observer.complete();
4394
- this.observer = null;
4195
+ if (!_.isNil(WindowResizeElementComponent.ICON_CLASS)) {
4196
+ ViewUtil.addClasses(this.nativeElement, WindowResizeElementComponent.ICON_CLASS);
4395
4197
  }
4396
- this.properties = null;
4397
- this._wrapper = null;
4398
- this._backdrop = null;
4399
- this._container = null;
4400
- clearInterval(this.blinkTimer);
4401
- this.blinkTimer = null;
4402
- }
4403
- blink() {
4404
- clearInterval(this.blinkTimer);
4405
- this.blinkTimer = setInterval(this.blinkToggle, WindowImpl.BLINK_DELAY);
4198
+ ViewUtil.setStyle(this.nativeElement, 'cursor', 'pointer');
4406
4199
  }
4407
- shake() { }
4408
- setOnTop() { }
4409
4200
  // --------------------------------------------------------------------------
4410
4201
  //
4411
- // Size Methods
4202
+ // Event Handlers
4412
4203
  //
4413
4204
  // --------------------------------------------------------------------------
4414
- getWidth() {
4415
- return NaN;
4416
- }
4417
- getHeight() {
4418
- return NaN;
4205
+ clickHandler(event) {
4206
+ super.clickHandler(event);
4207
+ if (!_.isNil(this.window)) {
4208
+ this.window.emit(WindowEvent.EXPAND);
4209
+ }
4419
4210
  }
4420
- setWidth(value, isNeedNotify = true) { }
4421
- setHeight(value, isNeedNotify = true) { }
4422
- setSize(width, height) { }
4211
+ }
4212
+ // --------------------------------------------------------------------------
4213
+ //
4214
+ // Constants
4215
+ //
4216
+ // --------------------------------------------------------------------------
4217
+ WindowResizeElementComponent.ICON_CLASS = 'fas fa-arrows-alt';
4218
+ WindowResizeElementComponent.ICON_VALUE = null;
4219
+ WindowResizeElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowResizeElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4220
+ WindowResizeElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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"] });
4221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowResizeElementComponent, decorators: [{
4222
+ type: Component,
4223
+ 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"] }]
4224
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4225
+
4226
+ class WindowMinimizeElementComponent extends WindowElement {
4423
4227
  // --------------------------------------------------------------------------
4424
4228
  //
4425
- // Move Methods
4229
+ // Constructor
4426
4230
  //
4427
4231
  // --------------------------------------------------------------------------
4428
- getX() {
4429
- return NaN;
4430
- }
4431
- setX(value, isNeedNotify = true) { }
4432
- getY() {
4433
- return NaN;
4232
+ constructor(element) {
4233
+ super(element);
4234
+ // --------------------------------------------------------------------------
4235
+ //
4236
+ // Private Methods
4237
+ //
4238
+ // --------------------------------------------------------------------------
4239
+ this.commitIconProperties = () => {
4240
+ let icon = this.window.isMinimized ? WindowMinimizeElementComponent.ICON_MAXIMIZE_VALUE : WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE;
4241
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', icon);
4242
+ };
4434
4243
  }
4435
- setY(value, isNeedNotify = true) { }
4436
- move(x, y) { }
4437
4244
  // --------------------------------------------------------------------------
4438
4245
  //
4439
- // Private Properties
4246
+ // Protected Methods
4440
4247
  //
4441
4248
  // --------------------------------------------------------------------------
4442
- get reference() {
4443
- return this.properties.reference;
4444
- }
4445
- get isBlink() {
4446
- return this._isBlink;
4249
+ commitWindowProperties() {
4250
+ super.commitWindowProperties();
4251
+ this.window.events.pipe(takeUntil(this.destroyed)).subscribe(event => {
4252
+ if (event === WindowEvent.MINIMIZED_CHANGED) {
4253
+ this.commitIconProperties();
4254
+ }
4255
+ });
4447
4256
  }
4448
- set isBlink(value) {
4449
- if (value === this._isBlink) {
4450
- return;
4257
+ createChildren() {
4258
+ super.createChildren();
4259
+ if (!_.isNil(WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE)) {
4260
+ ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE);
4451
4261
  }
4452
- this._isBlink = value;
4453
- this.commitIsBlinkProperties();
4454
- }
4455
- get isShaking() {
4456
- return false;
4262
+ if (!_.isNil(WindowMinimizeElementComponent.ICON_CLASS)) {
4263
+ ViewUtil.addClasses(this.nativeElement, WindowMinimizeElementComponent.ICON_CLASS);
4264
+ }
4265
+ ViewUtil.addClass(this.nativeElement, 'mouse-active');
4457
4266
  }
4458
- set isShaking(value) { }
4459
4267
  // --------------------------------------------------------------------------
4460
4268
  //
4461
- // Public Properties
4269
+ // Event Handlers
4462
4270
  //
4463
4271
  // --------------------------------------------------------------------------
4464
- get events() {
4465
- return this.observer.asObservable();
4466
- }
4467
- get config() {
4468
- return this.properties.config;
4469
- }
4470
- get content() {
4471
- return !_.isNil(this.reference) ? this.reference.instance : null;
4472
- }
4473
- get container() {
4474
- return this._container;
4475
- }
4476
- get wrapper() {
4477
- return this._wrapper;
4478
- }
4479
- get backdrop() {
4480
- return this._backdrop;
4481
- }
4482
- get isOnTop() {
4483
- return false;
4484
- }
4485
- set isOnTop(value) { }
4486
- get isMinimized() {
4487
- return false;
4488
- }
4489
- set isMinimized(value) { }
4490
- get isDisabled() {
4491
- return this._isDisabled;
4492
- }
4493
- set isDisabled(value) {
4494
- if (value === this._isDisabled) {
4495
- return;
4272
+ clickHandler(event) {
4273
+ super.clickHandler(event);
4274
+ if (!_.isNil(this.window)) {
4275
+ this.window.isMinimized = !this.window.isMinimized;
4496
4276
  }
4497
- this._isDisabled = value;
4498
- this.commitIsDisabledProperties();
4499
- this.emit(WindowEvent.DISABLED_CHANGED);
4500
4277
  }
4501
4278
  }
4502
4279
  // --------------------------------------------------------------------------
4503
4280
  //
4504
- // Constants
4281
+ // Constants
4505
4282
  //
4506
4283
  // --------------------------------------------------------------------------
4507
- BottomSheetImpl.BLINK_DELAY = 500;
4508
- BottomSheetImpl.SHAKE_DELAY = 500;
4284
+ WindowMinimizeElementComponent.ICON_CLASS = null;
4285
+ WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE = null;
4286
+ WindowMinimizeElementComponent.ICON_MAXIMIZE_VALUE = null;
4287
+ WindowMinimizeElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowMinimizeElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4288
+ WindowMinimizeElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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"] });
4289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowMinimizeElementComponent, decorators: [{
4290
+ type: Component,
4291
+ 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"] }]
4292
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4509
4293
 
4510
- class WindowElement extends DestroyableContainer {
4294
+ class WindowBase extends DestroyableContainer {
4511
4295
  // --------------------------------------------------------------------------
4512
4296
  //
4513
4297
  // Constructor
4514
4298
  //
4515
4299
  // --------------------------------------------------------------------------
4516
- constructor(element) {
4300
+ constructor() {
4517
4301
  super();
4518
- this.element = element;
4519
- }
4520
- // --------------------------------------------------------------------------
4521
- //
4522
- // Private Methods
4523
- //
4524
- // --------------------------------------------------------------------------
4525
- checkWindowParent() {
4526
- let container = this.getContainer();
4527
- if (!_.isNil(container)) {
4528
- ViewUtil.appendChild(container, this.element.nativeElement);
4302
+ // --------------------------------------------------------------------------
4303
+ //
4304
+ // Properties
4305
+ //
4306
+ // --------------------------------------------------------------------------
4307
+ this._x = NaN;
4308
+ this._width = NaN;
4309
+ this._y = NaN;
4310
+ this._height = NaN;
4311
+ this.updatePosition = () => this.setPosition();
4312
+ }
4313
+ setProperties() {
4314
+ let config = this.getConfig();
4315
+ if (!_.isNaN(config.defaultWidth)) {
4316
+ this.width = config.defaultWidth;
4317
+ }
4318
+ if (!_.isNaN(config.defaultHeight)) {
4319
+ this.height = config.defaultHeight;
4529
4320
  }
4530
4321
  }
4531
- getContainer() {
4532
- let item = ViewUtil.parseElement(this.element.nativeElement);
4533
- while (!_.isNil(item) && item.nodeName.toLowerCase() !== 'mat-dialog-container') {
4534
- item = item.parentElement;
4322
+ setPosition() {
4323
+ let config = this.getConfig();
4324
+ switch (config.horizontalAlign) {
4325
+ case WindowAlign.START:
4326
+ this.x = !_.isNaN(this.paddingLeft) ? this.paddingLeft : 0;
4327
+ break;
4328
+ case WindowAlign.END:
4329
+ let value = ViewUtil.getStageWidth() - this.calculateWidth();
4330
+ if (!_.isNaN(this.paddingRight)) {
4331
+ value -= this.paddingRight;
4332
+ }
4333
+ this.x = value;
4334
+ break;
4335
+ default:
4336
+ this.x = (ViewUtil.getStageWidth() - this.calculateWidth()) / 2;
4337
+ break;
4338
+ }
4339
+ switch (config.verticalAlign) {
4340
+ case WindowAlign.START:
4341
+ this.y = !_.isNaN(this.paddingTop) ? this.paddingTop : 0;
4342
+ break;
4343
+ case WindowAlign.END:
4344
+ let value = ViewUtil.getStageHeight() - this.calculateHeight();
4345
+ if (!_.isNaN(this.paddingBottom)) {
4346
+ value -= this.paddingBottom;
4347
+ }
4348
+ this.y = value;
4349
+ break;
4350
+ default:
4351
+ this.y = (ViewUtil.getStageHeight() - this.calculateHeight()) / 2;
4352
+ break;
4535
4353
  }
4536
- return item;
4537
4354
  }
4538
- createChildren() { }
4539
- destroyChildren() { }
4540
- commitWindowProperties() { }
4541
- // --------------------------------------------------------------------------
4542
- //
4543
- // Public Methods
4544
- //
4545
- // --------------------------------------------------------------------------
4546
- ngAfterViewInit() {
4547
- this.createChildren();
4548
- this.checkWindowParent();
4355
+ clearSize() {
4356
+ this._x = NaN;
4357
+ this._y = NaN;
4358
+ this._width = NaN;
4359
+ this._height = NaN;
4549
4360
  }
4550
- destroy() {
4551
- if (this.isDestroyed) {
4361
+ commitSizeProperties() {
4362
+ let width = !_.isNaN(this.width) ? this.width + 'px' : 'auto';
4363
+ let height = !_.isNaN(this.height) ? this.height + 'px' : 'auto';
4364
+ this.getReference().updateSize(width, height);
4365
+ }
4366
+ commitPositionProperties() {
4367
+ if (_.isNaN(this._x) && _.isNaN(this._y)) {
4552
4368
  return;
4553
4369
  }
4554
- super.destroy();
4555
- this.destroyChildren();
4556
- this.element = null;
4557
- this.window = null;
4370
+ let position = {};
4371
+ if (!_.isNaN(this._y)) {
4372
+ position.top = this._y + 'px';
4373
+ }
4374
+ if (!_.isNaN(this._x)) {
4375
+ position.left = this._x + 'px';
4376
+ }
4377
+ this.getReference().updatePosition(position);
4558
4378
  }
4559
4379
  // --------------------------------------------------------------------------
4560
4380
  //
4561
- // Event Handlers
4381
+ // Public Methods
4562
4382
  //
4563
4383
  // --------------------------------------------------------------------------
4564
- clickHandler(event) {
4565
- event.stopPropagation();
4384
+ calculateWidth() {
4385
+ return !_.isNaN(this.width) ? this.width : ViewUtil.getWidth(this.getContainer());
4566
4386
  }
4567
- // --------------------------------------------------------------------------
4568
- //
4569
- // Protected Properties
4570
- //
4571
- // --------------------------------------------------------------------------
4572
- get nativeElement() {
4573
- return this.element ? this.element.nativeElement : null;
4387
+ calculateHeight() {
4388
+ return !_.isNaN(this.height) ? this.height : ViewUtil.getHeight(this.getContainer());
4574
4389
  }
4575
4390
  // --------------------------------------------------------------------------
4576
4391
  //
4577
- // Public Properties
4392
+ // Private Properties
4578
4393
  //
4579
4394
  // --------------------------------------------------------------------------
4580
- get window() {
4581
- return this._window;
4395
+ get width() {
4396
+ return this._width;
4582
4397
  }
4583
- set window(value) {
4584
- if (value === this._window) {
4398
+ set width(value) {
4399
+ value = this.getConfig().parseWidth(value);
4400
+ if (value === this._width) {
4585
4401
  return;
4586
4402
  }
4587
- this._window = value;
4588
- if (this.window) {
4589
- this.commitWindowProperties();
4403
+ this._width = value;
4404
+ this.commitSizeProperties();
4405
+ }
4406
+ get height() {
4407
+ return this._height;
4408
+ }
4409
+ set height(value) {
4410
+ value = this.getConfig().parseHeight(value);
4411
+ if (value === this._height) {
4412
+ return;
4590
4413
  }
4414
+ this._height = value;
4415
+ this.commitSizeProperties();
4591
4416
  }
4592
- }
4593
- WindowElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowElement, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4594
- WindowElement.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: WindowElement, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
4595
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowElement, decorators: [{
4596
- type: Component,
4597
- args: [{ template: '' }]
4598
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4599
-
4600
- class WindowCloseElementComponent extends WindowElement {
4601
4417
  // --------------------------------------------------------------------------
4602
4418
  //
4603
- // Constructor
4419
+ // Public Properties
4604
4420
  //
4605
4421
  // --------------------------------------------------------------------------
4606
- constructor(element) {
4607
- super(element);
4422
+ get x() {
4423
+ return this._x;
4608
4424
  }
4609
- // --------------------------------------------------------------------------
4610
- //
4611
- // Private Methods
4612
- //
4613
- // --------------------------------------------------------------------------
4614
- createChildren() {
4615
- super.createChildren();
4616
- if (!_.isNil(WindowCloseElementComponent.ICON_VALUE)) {
4617
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowCloseElementComponent.ICON_VALUE);
4618
- }
4619
- if (!_.isNil(WindowCloseElementComponent.ICON_CLASS)) {
4620
- ViewUtil.addClasses(this.nativeElement, WindowCloseElementComponent.ICON_CLASS);
4425
+ set x(value) {
4426
+ value = this.getConfig().parseX(value);
4427
+ if (value === this._x) {
4428
+ return;
4621
4429
  }
4622
- ViewUtil.addClass(this.nativeElement, 'mouse-active');
4430
+ this._x = value;
4431
+ this.commitPositionProperties();
4623
4432
  }
4624
- // --------------------------------------------------------------------------
4625
- //
4626
- // Event Handlers
4627
- //
4628
- // --------------------------------------------------------------------------
4629
- clickHandler(event) {
4630
- super.clickHandler(event);
4631
- if (!_.isNil(this.window)) {
4632
- this.window.close();
4433
+ get y() {
4434
+ return this._y;
4435
+ }
4436
+ set y(value) {
4437
+ value = this.getConfig().parseY(value);
4438
+ if (value === this._y) {
4439
+ return;
4633
4440
  }
4441
+ this._y = value;
4442
+ this.commitPositionProperties();
4443
+ }
4444
+ get paddingTop() {
4445
+ return this.getConfig().paddingTop;
4446
+ }
4447
+ get paddingLeft() {
4448
+ return this.getConfig().paddingLeft;
4449
+ }
4450
+ get paddingRight() {
4451
+ return this.getConfig().paddingRight;
4452
+ }
4453
+ get paddingBottom() {
4454
+ return this.getConfig().paddingBottom;
4634
4455
  }
4635
4456
  }
4636
- // --------------------------------------------------------------------------
4637
- //
4638
- // Constants
4639
- //
4640
- // --------------------------------------------------------------------------
4641
- WindowCloseElementComponent.ICON_CLASS = 'fas fa-times';
4642
- WindowCloseElementComponent.ICON_VALUE = null;
4643
- WindowCloseElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowCloseElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4644
- WindowCloseElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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"] });
4645
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowCloseElementComponent, decorators: [{
4646
- type: Component,
4647
- 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"] }]
4648
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4649
4457
 
4650
- class WindowExpandElementComponent extends WindowElement {
4458
+ class WindowImpl extends WindowBase {
4651
4459
  // --------------------------------------------------------------------------
4652
4460
  //
4653
- // Constructor
4461
+ // Constructor
4654
4462
  //
4655
4463
  // --------------------------------------------------------------------------
4656
- constructor(element) {
4657
- super(element);
4464
+ constructor(properties) {
4465
+ super();
4466
+ // --------------------------------------------------------------------------
4467
+ //
4468
+ // Properties
4469
+ //
4470
+ // --------------------------------------------------------------------------
4471
+ this._isBlink = false;
4472
+ this._isShaking = false;
4473
+ this._isOnTop = false;
4474
+ this._isDisabled = false;
4475
+ this._isMinimized = false;
4476
+ this.isOpened = false;
4477
+ this.isWasOnTop = false;
4478
+ // --------------------------------------------------------------------------
4479
+ //
4480
+ // Protected Methods
4481
+ //
4482
+ // --------------------------------------------------------------------------
4483
+ this.setClosed = () => {
4484
+ this.isOpened = false;
4485
+ this.emit(WindowEvent.CLOSED);
4486
+ this.destroy();
4487
+ };
4488
+ this.setOpened = () => {
4489
+ this.isOpened = true;
4490
+ this.emit(WindowEvent.OPENED);
4491
+ };
4492
+ this.blinkToggle = () => {
4493
+ this.isBlink = !this.isBlink;
4494
+ };
4495
+ this.stopShaking = () => {
4496
+ this.isShaking = false;
4497
+ };
4498
+ this.emitResize = () => {
4499
+ this.emit(WindowEvent.RESIZED);
4500
+ };
4501
+ this.resizeHandler = () => {
4502
+ if (!this.isOpened) {
4503
+ return;
4504
+ }
4505
+ clearTimeout(this.resizeTimer);
4506
+ this.resizeTimer = setTimeout(this.emitResize, WindowImpl.RESIZE_DELAY);
4507
+ };
4508
+ this.mouseDownHandlerProxy = (event) => {
4509
+ this.mouseDownHandler(event);
4510
+ };
4511
+ this.mouseClickHandlerProxy = (event) => {
4512
+ this.mouseClickHandler(event);
4513
+ };
4514
+ this.observer = new Subject();
4515
+ this.elements = new Array();
4516
+ this.properties = properties;
4517
+ this.content.window = this;
4518
+ // Have to save for unsubscribe on destroy
4519
+ this._wrapper = this.properties.overlay.hostElement;
4520
+ this._backdrop = this.properties.overlay.backdropElement;
4521
+ this._container = this.properties.overlay.overlayElement;
4522
+ this.setProperties();
4523
+ this.getReference().afterOpened().pipe(takeUntil(this.destroyed)).subscribe(this.setOpened);
4524
+ this.getReference().afterClosed().pipe(takeUntil(this.destroyed)).subscribe(this.setClosed);
4525
+ this.events
4526
+ .pipe(filter(event => event === WindowEvent.CONTENT_READY), takeUntil(this.destroyed))
4527
+ .subscribe(this.updatePosition);
4658
4528
  }
4659
4529
  // --------------------------------------------------------------------------
4660
4530
  //
4661
- // Private Methods
4531
+ // Elements Methods
4662
4532
  //
4663
4533
  // --------------------------------------------------------------------------
4664
- createChildren() {
4665
- super.createChildren();
4666
- if (!_.isNil(WindowExpandElementComponent.ICON_VALUE)) {
4667
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowExpandElementComponent.ICON_VALUE);
4534
+ elementsCreate() {
4535
+ this.elements = new Array();
4536
+ }
4537
+ elementsDestroy() {
4538
+ this.elements.forEach(item => this.elementDestroy(item));
4539
+ this.elements = null;
4540
+ }
4541
+ elementAdd(item) {
4542
+ this.elements.push(item);
4543
+ item.instance.window = this;
4544
+ return item;
4545
+ }
4546
+ elementRemove(item) {
4547
+ ArrayUtil.remove(this.elements, item);
4548
+ this.elementDestroy(item);
4549
+ return item;
4550
+ }
4551
+ elementDestroy(item) {
4552
+ item.instance.window = null;
4553
+ item.destroy();
4554
+ return item;
4555
+ }
4556
+ setProperties() {
4557
+ super.setProperties();
4558
+ ViewUtil.addClass(this.container, 'vi-window');
4559
+ ViewUtil.toggleClass(this.container, 'vi-modal', this.config.isModal);
4560
+ this.container.addEventListener('click', this.mouseClickHandlerProxy, true);
4561
+ this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4562
+ /*
4563
+ if (!this.config.isModal) {
4564
+ this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4668
4565
  }
4669
- if (!_.isNil(WindowExpandElementComponent.ICON_CLASS)) {
4670
- ViewUtil.addClasses(this.nativeElement, WindowExpandElementComponent.ICON_CLASS);
4566
+ */
4567
+ this.elementsCreate();
4568
+ }
4569
+ commitIsBlinkProperties() { }
4570
+ commitIsShakingProperties() { }
4571
+ commitIsDisabledProperties() { }
4572
+ commitIsOnTopProperties() {
4573
+ this.isBlink = false;
4574
+ }
4575
+ commitIsMinimizedProperties() {
4576
+ this.isBlink = false;
4577
+ }
4578
+ getConfig() {
4579
+ return this.properties.config;
4580
+ }
4581
+ getContainer() {
4582
+ return this.container;
4583
+ }
4584
+ getReference() {
4585
+ return this.properties.reference;
4586
+ }
4587
+ isNeedClickStopPropagation(event) {
4588
+ if (!this.isWasOnTop) {
4589
+ return true;
4671
4590
  }
4672
- ViewUtil.addClass(this.nativeElement, 'mouse-active');
4591
+ let element = _.find(this.elements, item => item.location.nativeElement === event.target);
4592
+ if (_.isNil(element)) {
4593
+ return false;
4594
+ }
4595
+ element.instance.clickHandler(event);
4596
+ return true;
4673
4597
  }
4674
- // --------------------------------------------------------------------------
4675
- //
4676
- // Event Handlers
4677
- //
4678
- // --------------------------------------------------------------------------
4679
- clickHandler(event) {
4680
- super.clickHandler(event);
4681
- if (!_.isNil(this.window)) {
4682
- this.window.emit(WindowEvent.EXPAND);
4598
+ mouseDownHandler(event) {
4599
+ this.setOnTop();
4600
+ }
4601
+ mouseClickHandler(event) {
4602
+ if (this.isNeedClickStopPropagation(event)) {
4603
+ event.stopPropagation();
4604
+ }
4605
+ if (!this.isWasOnTop) {
4606
+ this.isWasOnTop = true;
4683
4607
  }
4684
4608
  }
4685
- }
4686
- // --------------------------------------------------------------------------
4687
- //
4688
- // Constants
4689
- //
4690
- // --------------------------------------------------------------------------
4691
- WindowExpandElementComponent.ICON_CLASS = 'fas fa-angle-double-up';
4692
- WindowExpandElementComponent.ICON_VALUE = null;
4693
- WindowExpandElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowExpandElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4694
- WindowExpandElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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"] });
4695
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowExpandElementComponent, decorators: [{
4696
- type: Component,
4697
- 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"] }]
4698
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4699
-
4700
- class WindowResizeElementComponent extends WindowElement {
4701
4609
  // --------------------------------------------------------------------------
4702
4610
  //
4703
- // Constructor
4611
+ // Public Methods
4704
4612
  //
4705
4613
  // --------------------------------------------------------------------------
4706
- constructor(element) {
4707
- super(element);
4614
+ emit(event) {
4615
+ this.observer.next(event);
4708
4616
  }
4709
- // --------------------------------------------------------------------------
4710
- //
4711
- // Private Methods
4712
- //
4713
- // --------------------------------------------------------------------------
4714
- createChildren() {
4715
- super.createChildren();
4716
- if (!_.isNil(WindowResizeElementComponent.ICON_VALUE)) {
4717
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowResizeElementComponent.ICON_VALUE);
4617
+ close() {
4618
+ this.getReference().close();
4619
+ }
4620
+ destroy() {
4621
+ if (this.isDestroyed) {
4622
+ return;
4718
4623
  }
4719
- if (!_.isNil(WindowResizeElementComponent.ICON_CLASS)) {
4720
- ViewUtil.addClasses(this.nativeElement, WindowResizeElementComponent.ICON_CLASS);
4624
+ super.destroy();
4625
+ this.elementsDestroy();
4626
+ this._container.removeEventListener('click', this.mouseClickHandlerProxy, true);
4627
+ this._container.removeEventListener('mousedown', this.mouseDownHandlerProxy);
4628
+ if (!_.isNil(this.content)) {
4629
+ this.content.destroy();
4630
+ }
4631
+ if (!_.isNil(this.observer)) {
4632
+ this.observer.complete();
4633
+ this.observer = null;
4634
+ }
4635
+ this.properties = null;
4636
+ this._wrapper = null;
4637
+ this._backdrop = null;
4638
+ this._container = null;
4639
+ clearInterval(this.shakeTimer);
4640
+ this.shakeTimer = null;
4641
+ clearTimeout(this.resizeTimer);
4642
+ this.resizeTimer = null;
4643
+ }
4644
+ blink() {
4645
+ this.isBlink = true;
4646
+ }
4647
+ shake() {
4648
+ if (this.isShaking) {
4649
+ return;
4721
4650
  }
4722
- ViewUtil.setStyle(this.nativeElement, 'cursor', 'pointer');
4651
+ this.isShaking = true;
4652
+ clearInterval(this.shakeTimer);
4653
+ this.shakeTimer = setInterval(this.stopShaking, WindowImpl.SHAKE_DELAY);
4654
+ }
4655
+ setOnTop() {
4656
+ this.isWasOnTop = this.isOnTop;
4657
+ this.emit(WindowEvent.SET_ON_TOP);
4723
4658
  }
4724
4659
  // --------------------------------------------------------------------------
4725
4660
  //
4726
- // Event Handlers
4661
+ // Size Methods
4727
4662
  //
4728
4663
  // --------------------------------------------------------------------------
4729
- clickHandler(event) {
4730
- super.clickHandler(event);
4731
- if (!_.isNil(this.window)) {
4732
- this.window.emit(WindowEvent.EXPAND);
4664
+ getWidth() {
4665
+ return this.width;
4666
+ }
4667
+ getHeight() {
4668
+ return this.height;
4669
+ }
4670
+ setWidth(value, isNeedNotify = true) {
4671
+ this.width = value;
4672
+ if (isNeedNotify) {
4673
+ this.resizeHandler();
4733
4674
  }
4734
4675
  }
4735
- }
4736
- // --------------------------------------------------------------------------
4737
- //
4738
- // Constants
4739
- //
4740
- // --------------------------------------------------------------------------
4741
- WindowResizeElementComponent.ICON_CLASS = 'fas fa-arrows-alt';
4742
- WindowResizeElementComponent.ICON_VALUE = null;
4743
- WindowResizeElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowResizeElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4744
- WindowResizeElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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"] });
4745
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowResizeElementComponent, decorators: [{
4746
- type: Component,
4747
- 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"] }]
4748
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4749
-
4750
- class WindowMinimizeElementComponent extends WindowElement {
4676
+ setHeight(value, isNeedNotify = true) {
4677
+ this.height = value;
4678
+ if (isNeedNotify) {
4679
+ this.resizeHandler();
4680
+ }
4681
+ }
4682
+ setSize(width, height) {
4683
+ this.setWidth(width, false);
4684
+ this.setHeight(height, false);
4685
+ this.resizeHandler();
4686
+ }
4751
4687
  // --------------------------------------------------------------------------
4752
4688
  //
4753
- // Constructor
4689
+ // Move Methods
4754
4690
  //
4755
4691
  // --------------------------------------------------------------------------
4756
- constructor(element) {
4757
- super(element);
4758
- // --------------------------------------------------------------------------
4759
- //
4760
- // Private Methods
4761
- //
4762
- // --------------------------------------------------------------------------
4763
- this.commitIconProperties = () => {
4764
- let icon = this.window.isMinimized ? WindowMinimizeElementComponent.ICON_MAXIMIZE_VALUE : WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE;
4765
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', icon);
4766
- };
4692
+ getX() {
4693
+ return this.x;
4694
+ }
4695
+ setX(value, isNeedNotify = true) {
4696
+ this.x = value;
4697
+ if (isNeedNotify) {
4698
+ this.emit(WindowEvent.MOVED);
4699
+ }
4700
+ }
4701
+ getY() {
4702
+ return this.y;
4703
+ }
4704
+ setY(value, isNeedNotify = true) {
4705
+ this.y = value;
4706
+ if (isNeedNotify) {
4707
+ this.emit(WindowEvent.MOVED);
4708
+ }
4709
+ }
4710
+ move(x, y) {
4711
+ this.setX(x, false);
4712
+ this.setY(y, false);
4713
+ this.emit(WindowEvent.MOVED);
4767
4714
  }
4768
4715
  // --------------------------------------------------------------------------
4769
4716
  //
4770
- // Protected Methods
4717
+ // Private Properties
4771
4718
  //
4772
4719
  // --------------------------------------------------------------------------
4773
- commitWindowProperties() {
4774
- super.commitWindowProperties();
4775
- this.window.events.pipe(takeUntil(this.destroyed)).subscribe(event => {
4776
- if (event === WindowEvent.MINIMIZED_CHANGED) {
4777
- this.commitIconProperties();
4778
- }
4779
- });
4720
+ get isBlink() {
4721
+ return this._isBlink;
4780
4722
  }
4781
- createChildren() {
4782
- super.createChildren();
4783
- if (!_.isNil(WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE)) {
4784
- ViewUtil.setProperty(this.nativeElement, 'innerHTML', WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE);
4723
+ set isBlink(value) {
4724
+ if (value === this._isBlink) {
4725
+ return;
4785
4726
  }
4786
- if (!_.isNil(WindowMinimizeElementComponent.ICON_CLASS)) {
4787
- ViewUtil.addClasses(this.nativeElement, WindowMinimizeElementComponent.ICON_CLASS);
4727
+ this._isBlink = value;
4728
+ this.commitIsBlinkProperties();
4729
+ }
4730
+ get isShaking() {
4731
+ return this._isShaking;
4732
+ }
4733
+ set isShaking(value) {
4734
+ if (value === this._isShaking) {
4735
+ return;
4788
4736
  }
4789
- ViewUtil.addClass(this.nativeElement, 'mouse-active');
4737
+ this._isShaking = value;
4738
+ this.commitIsShakingProperties();
4790
4739
  }
4791
4740
  // --------------------------------------------------------------------------
4792
4741
  //
4793
- // Event Handlers
4742
+ // Public Properties
4794
4743
  //
4795
4744
  // --------------------------------------------------------------------------
4796
- clickHandler(event) {
4797
- super.clickHandler(event);
4798
- if (!_.isNil(this.window)) {
4799
- this.window.isMinimized = !this.window.isMinimized;
4745
+ get events() {
4746
+ return this.observer.asObservable();
4747
+ }
4748
+ get config() {
4749
+ return this.properties.config;
4750
+ }
4751
+ get content() {
4752
+ return this.properties.reference ? this.properties.reference.componentInstance : null;
4753
+ }
4754
+ get container() {
4755
+ return this._container;
4756
+ }
4757
+ get wrapper() {
4758
+ return this._wrapper;
4759
+ }
4760
+ get backdrop() {
4761
+ return this._backdrop;
4762
+ }
4763
+ get isOnTop() {
4764
+ return this._isOnTop;
4765
+ }
4766
+ set isOnTop(value) {
4767
+ if (value === this._isOnTop) {
4768
+ return;
4769
+ }
4770
+ this._isOnTop = value;
4771
+ this.commitIsOnTopProperties();
4772
+ this.emit(WindowEvent.IS_ON_TOP_CHANGED);
4773
+ }
4774
+ get isMinimized() {
4775
+ return this._isMinimized;
4776
+ }
4777
+ set isMinimized(value) {
4778
+ if (value === this._isMinimized) {
4779
+ return;
4780
+ }
4781
+ this._isMinimized = value;
4782
+ this.commitIsMinimizedProperties();
4783
+ this.emit(WindowEvent.MINIMIZED_CHANGED);
4784
+ }
4785
+ get isDisabled() {
4786
+ return this._isDisabled;
4787
+ }
4788
+ set isDisabled(value) {
4789
+ if (value === this._isDisabled) {
4790
+ return;
4800
4791
  }
4792
+ this._isDisabled = value;
4793
+ this.commitIsDisabledProperties();
4794
+ this.emit(WindowEvent.DISABLED_CHANGED);
4801
4795
  }
4802
4796
  }
4803
4797
  // --------------------------------------------------------------------------
4804
4798
  //
4805
- // Constants
4799
+ // Constants
4806
4800
  //
4807
4801
  // --------------------------------------------------------------------------
4808
- WindowMinimizeElementComponent.ICON_CLASS = null;
4809
- WindowMinimizeElementComponent.ICON_MINIMIZE_VALUE = null;
4810
- WindowMinimizeElementComponent.ICON_MAXIMIZE_VALUE = null;
4811
- WindowMinimizeElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowMinimizeElementComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
4812
- WindowMinimizeElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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"] });
4813
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WindowMinimizeElementComponent, decorators: [{
4814
- type: Component,
4815
- 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"] }]
4816
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
4802
+ WindowImpl.BLINK_DELAY = 500;
4803
+ WindowImpl.SHAKE_DELAY = 500;
4804
+ WindowImpl.RESIZE_DELAY = 200;
4817
4805
 
4818
4806
  class WindowResizeable extends WindowImpl {
4819
4807
  // --------------------------------------------------------------------------
@@ -5052,34 +5040,19 @@ class BottomSheetBaseComponent extends BottomSheetImpl {
5052
5040
  this.elementAdd(this.content.container.createComponent(BottomSheetBaseComponent.EXPAND_COMPONENT));
5053
5041
  }
5054
5042
  }
5055
- commitIsBlinkProperties() {
5056
- ViewUtil.toggleClass(this.container, this.blinkClass, this.isBlink);
5057
- }
5058
5043
  commitIsDisabledProperties() {
5059
5044
  ViewUtil.toggleClass(this.container, this.disabledClass, this.isDisabled);
5060
5045
  ViewUtil.toggleClass(this.content.element, this.disabledClass, this.isDisabled);
5061
5046
  ViewUtil.toggleClass(this.content.element.nativeElement.parentElement, this.disabledClass, this.isDisabled);
5062
5047
  }
5063
- commitIsShakingProperties() {
5064
- ViewUtil.toggleClass(this.container, this.shakingClass, this.isShaking);
5065
- }
5066
5048
  // --------------------------------------------------------------------------
5067
5049
  //
5068
5050
  // Protected Properties
5069
5051
  //
5070
5052
  // --------------------------------------------------------------------------
5071
- get blinkClass() {
5072
- return 'vi-blink';
5073
- }
5074
5053
  get disabledClass() {
5075
5054
  return 'vi-disabled';
5076
5055
  }
5077
- get minimizedClass() {
5078
- return 'vi-minimized';
5079
- }
5080
- get shakingClass() {
5081
- return 'shake-constant shake-horizontal';
5082
- }
5083
5056
  }
5084
5057
  // --------------------------------------------------------------------------
5085
5058
  //
@@ -5110,7 +5083,7 @@ class BottomSheetService extends Destroyable {
5110
5083
  // --------------------------------------------------------------------------
5111
5084
  open(component, config) {
5112
5085
  let reference = this.dialog.open(component, config);
5113
- let window = this.factory.create({ config, reference: reference, overlay: reference._overlayRef });
5086
+ let window = this.factory.create({ config, reference: reference, overlay: reference['_ref'].overlayRef });
5114
5087
  this.observer.next(new ObservableData(WindowServiceEvent.OPEN_STARTED, window));
5115
5088
  let subscription = window.events.subscribe(event => {
5116
5089
  switch (event) {
@@ -5659,55 +5632,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
5659
5632
  }]
5660
5633
  }], ctorParameters: function () { return []; } });
5661
5634
 
5662
- class FinancePipe {
5663
- // --------------------------------------------------------------------------
5664
- //
5665
- // Static Methods
5666
- //
5667
- // --------------------------------------------------------------------------
5668
- static format(value, format) {
5669
- value = Number(value);
5670
- try {
5671
- return numeral(value).format(format);
5672
- }
5673
- catch (error) {
5674
- return value.toString();
5675
- }
5676
- }
5677
- // --------------------------------------------------------------------------
5678
- //
5679
- // Public Methods
5680
- //
5681
- // --------------------------------------------------------------------------
5682
- transform(value, format, isNeedPlus = false) {
5683
- value = Number(value);
5684
- if (_.isNaN(value)) {
5685
- return '---';
5686
- }
5687
- if (_.isNil(format)) {
5688
- format = FinancePipe.DEFAULT_FORMAT;
5689
- }
5690
- if (isNeedPlus) {
5691
- format = '+' + format;
5692
- }
5693
- return FinancePipe.format(value, format);
5694
- }
5695
- }
5696
- // --------------------------------------------------------------------------
5697
- //
5698
- // Static Properties
5699
- //
5700
- // --------------------------------------------------------------------------
5701
- FinancePipe.DEFAULT_FORMAT = '0,0';
5702
- FinancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FinancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
5703
- FinancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: FinancePipe, name: "viFinance" });
5704
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FinancePipe, decorators: [{
5705
- type: Pipe,
5706
- args: [{
5707
- name: 'viFinance'
5708
- }]
5709
- }] });
5710
-
5711
5635
  class MomentDatePipe {
5712
5636
  // --------------------------------------------------------------------------
5713
5637
  //
@@ -6477,7 +6401,7 @@ class ThemeStyleDirective extends Destroyable {
6477
6401
  super();
6478
6402
  this.theme = theme;
6479
6403
  this.element = ViewUtil.parseElement(element.nativeElement);
6480
- this.theme.changed.pipe(takeUntil(this.destroyed)).subscribe(() => this.stylePropertiesAdd());
6404
+ this.theme.changed.pipe(takeUntil(this.destroyed)).subscribe(() => this.stylePropertiesCheck());
6481
6405
  }
6482
6406
  // --------------------------------------------------------------------------
6483
6407
  //
@@ -6923,7 +6847,7 @@ class WindowService extends Destroyable {
6923
6847
  // let dialog = this.dialog as any;
6924
6848
  // dialog._getOverlayState = config.isModal ? dialog.getOverlayStateModal : dialog.getOverlayStateNonModal;
6925
6849
  let reference = this.dialog.open(component, config);
6926
- window = this.factory.create({ config, reference, overlay: reference._overlayRef });
6850
+ window = this.factory.create({ config, reference, overlay: reference['_ref'].overlayRef });
6927
6851
  this.observer.next(new ObservableData(WindowServiceEvent.OPEN_STARTED, window));
6928
6852
  let subscription = window.events.subscribe(event => {
6929
6853
  switch (event) {
@@ -7277,8 +7201,9 @@ class MenuTriggerForDirective extends MatMenuTrigger {
7277
7201
  //
7278
7202
  //--------------------------------------------------------------------------
7279
7203
  openMenuOn(target) {
7280
- if (_.isNil(target))
7204
+ if (_.isNil(target)) {
7281
7205
  return;
7206
+ }
7282
7207
  this.openMenu();
7283
7208
  let strategy = this.getPositionStrategy();
7284
7209
  if (strategy instanceof FlexibleConnectedPositionStrategy) {
@@ -7292,7 +7217,8 @@ class MenuTriggerForDirective extends MatMenuTrigger {
7292
7217
  //
7293
7218
  //--------------------------------------------------------------------------
7294
7219
  getPositionStrategy() {
7295
- return !_.isNil(this['_overlayRef']) ? this['_overlayRef'].getConfig().positionStrategy : null;
7220
+ let reference = this['_overlayRef'];
7221
+ return !_.isNil(reference) ? reference.getConfig().positionStrategy : null;
7296
7222
  }
7297
7223
  //--------------------------------------------------------------------------
7298
7224
  //
@@ -7548,6 +7474,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
7548
7474
  }] } });
7549
7475
 
7550
7476
  class TabGroupComponent extends DestroyableContainer {
7477
+ constructor() {
7478
+ super(...arguments);
7479
+ this.isStretch = true;
7480
+ }
7551
7481
  // --------------------------------------------------------------------------
7552
7482
  //
7553
7483
  // Protected Methods
@@ -7559,7 +7489,12 @@ class TabGroupComponent extends DestroyableContainer {
7559
7489
  // Event Handlers
7560
7490
  //
7561
7491
  // --------------------------------------------------------------------------
7562
- selectedTabChange(event) {
7492
+ selectedIndexChanged(event) {
7493
+ if (!_.isNil(this.list)) {
7494
+ this.list.selectedIndex = event;
7495
+ }
7496
+ }
7497
+ selectedTabChanged(event) {
7563
7498
  if (_.isNil(this.list)) {
7564
7499
  return;
7565
7500
  }
@@ -7602,12 +7537,14 @@ class TabGroupComponent extends DestroyableContainer {
7602
7537
  }
7603
7538
  }
7604
7539
  TabGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TabGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
7605
- TabGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: TabGroupComponent, selector: "vi-tab-group", inputs: { className: "className", list: "list" }, usesInheritance: true, ngImport: i0, template: "<mat-tab-group [ngClass]=\"className\" (selectedIndexChange)=\"list.selectedIndex = $event\" [selectedIndex]=\"list?.selectedIndex\"\n (selectedTabChange)=\"selectedTabChange($event)\">\n <ng-container *ngFor=\"let item of list?.collection\">\n <mat-tab [ngClass]=\"item.className\" [label]=\"item.label\" [disabled]=\"!item.isEnabled\" (click)=\"list?.actionItem(item)\"></mat-tab>\n </ng-container>\n</mat-tab-group>\n", dependencies: [{ kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2$2.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i2$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }] });
7540
+ TabGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: TabGroupComponent, selector: "vi-tab-group", inputs: { className: "className", isStretch: "isStretch", list: "list" }, usesInheritance: true, ngImport: i0, template: "<mat-tab-group\n [ngClass]=\"className\"\n [mat-stretch-tabs]=\"isStretch\"\n [selectedIndex]=\"list?.selectedIndex\"\n (selectedIndexChange)=\"selectedIndexChanged($event)\"\n (selectedTabChange)=\"selectedTabChanged($event)\"\n>\n <mat-tab\n [ngClass]=\"item.className\"\n [label]=\"item.label\"\n [disabled]=\"!item.isEnabled\"\n (click)=\"list?.actionItem(item)\"\n *ngFor=\"let item of list?.collection\"\n ></mat-tab>\n</mat-tab-group>\n", dependencies: [{ kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2$2.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i2$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }] });
7606
7541
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TabGroupComponent, decorators: [{
7607
7542
  type: Component,
7608
- args: [{ selector: 'vi-tab-group', template: "<mat-tab-group [ngClass]=\"className\" (selectedIndexChange)=\"list.selectedIndex = $event\" [selectedIndex]=\"list?.selectedIndex\"\n (selectedTabChange)=\"selectedTabChange($event)\">\n <ng-container *ngFor=\"let item of list?.collection\">\n <mat-tab [ngClass]=\"item.className\" [label]=\"item.label\" [disabled]=\"!item.isEnabled\" (click)=\"list?.actionItem(item)\"></mat-tab>\n </ng-container>\n</mat-tab-group>\n" }]
7543
+ args: [{ selector: 'vi-tab-group', template: "<mat-tab-group\n [ngClass]=\"className\"\n [mat-stretch-tabs]=\"isStretch\"\n [selectedIndex]=\"list?.selectedIndex\"\n (selectedIndexChange)=\"selectedIndexChanged($event)\"\n (selectedTabChange)=\"selectedTabChanged($event)\"\n>\n <mat-tab\n [ngClass]=\"item.className\"\n [label]=\"item.label\"\n [disabled]=\"!item.isEnabled\"\n (click)=\"list?.actionItem(item)\"\n *ngFor=\"let item of list?.collection\"\n ></mat-tab>\n</mat-tab-group>\n" }]
7609
7544
  }], propDecorators: { className: [{
7610
7545
  type: Input
7546
+ }], isStretch: [{
7547
+ type: Input
7611
7548
  }], list: [{
7612
7549
  type: Input
7613
7550
  }] } });
@@ -10377,4 +10314,3 @@ class TransportLazyModule {
10377
10314
 
10378
10315
  export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetBaseComponent, BottomSheetModule, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, CdkTableBaseComponent, CdkTableCellClassNamePipe, CdkTableCellStyleNamePipe, CdkTableCellValuePipe, CdkTableCellValuePipePure, CdkTableColumnClassNamePipe, CdkTableColumnStyleNamePipe, CdkTableDataSource, CdkTableFilterableComponent, CdkTableFilterableMapCollection, CdkTablePaginableBookmarkComponent, CdkTablePaginableBookmarkMapCollection, CdkTablePaginableComponent, CdkTablePaginableMapCollection, CdkTableRowClassNamePipe, CdkTableRowStyleNamePipe, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVICommonOptions, IWindow, IWindowContent, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageMatPaginatorIntl, LanguageModule, LanguageMomentDateAdapter, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LanguageSelectorComponent, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MenuListComponent, MenuTriggerForDirective, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationBaseComponent, NotificationComponent, NotificationConfig, NotificationEvent, NotificationFactory, NotificationModule, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, PropertiesManager, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListComponent, SelectListItem, SelectListItems, SelectOnFocusDirective, ShellBaseComponent, StartCasePipe, THEME_OPTIONS, TabGroupComponent, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VICommonModule, VIComponentModule, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowBaseComponent, WindowCloseElementComponent, WindowClosedError, WindowConfig, WindowDragAreaDirective, WindowElement, WindowEvent, WindowExpandElementComponent, WindowFactory, WindowImpl, WindowMinimizeElementComponent, WindowModule, WindowQuestionBaseComponent, WindowQuestionComponent, WindowResizeElementComponent, WindowService, WindowServiceEvent, cookieServiceFactory, initializerFactory, languageServiceFactory, loggerServiceFactory, nativeWindowServiceFactory, notificationServiceFactory, themeAssetServiceFactory, themeServiceFactory };
10379
10316
  //# sourceMappingURL=ts-core-angular.mjs.map
10380
- //# sourceMappingURL=ts-core-angular.mjs.map