@ts-core/angular 13.0.57 → 13.0.60

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.
@@ -4120,9 +4120,12 @@ class WindowImpl extends WindowBase {
4120
4120
  ViewUtil.addClass(this.container, 'vi-window');
4121
4121
  ViewUtil.toggleClass(this.container, 'vi-modal', this.config.isModal);
4122
4122
  this.container.addEventListener('click', this.mouseClickHandlerProxy, true);
4123
+ this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4124
+ /*
4123
4125
  if (!this.config.isModal) {
4124
4126
  this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
4125
4127
  }
4128
+ */
4126
4129
  this.elementsCreate();
4127
4130
  }
4128
4131
  commitIsBlinkProperties() { }
@@ -4140,8 +4143,8 @@ class WindowImpl extends WindowBase {
4140
4143
  }
4141
4144
  isNeedClickStopPropagation(event) {
4142
4145
  // return !this.isWasOnTop;
4143
- if (this.isWasOnTop) {
4144
- return false;
4146
+ if (!this.isWasOnTop && !this.isOnTop) {
4147
+ return true;
4145
4148
  }
4146
4149
  let element = _.find(this.elements, item => item.location.nativeElement === event.target);
4147
4150
  if (_.isNil(element)) {
@@ -4590,6 +4593,7 @@ WindowBaseComponent.RESIZE_COMPONENT = WindowResizeElementComponent;
4590
4593
  WindowBaseComponent.MINIMIZE_COMPONENT = WindowMinimizeElementComponent;
4591
4594
 
4592
4595
  class WindowService extends Destroyable {
4596
+ // public topZIndex: number = 1001;
4593
4597
  // --------------------------------------------------------------------------
4594
4598
  //
4595
4599
  // Constructor
@@ -4609,7 +4613,7 @@ class WindowService extends Destroyable {
4609
4613
  this.paddingBottom = 25;
4610
4614
  this.defaultVerticalAlign = WindowAlign.CENTER;
4611
4615
  this.defaultHorizontalAlign = WindowAlign.CENTER;
4612
- this.topZIndex = 999;
4616
+ this.topZIndex = WindowService.Z_INDEX_MAX;
4613
4617
  this._windows = new Map();
4614
4618
  this.dialog = dialog;
4615
4619
  this.language = language;
@@ -4620,23 +4624,40 @@ class WindowService extends Destroyable {
4620
4624
  }
4621
4625
  // --------------------------------------------------------------------------
4622
4626
  //
4627
+ // Static Methods
4628
+ //
4629
+ // --------------------------------------------------------------------------
4630
+ static getZIndex(window) {
4631
+ return !_.isNil(window) && !_.isNil(window.container) ? parseInt(ViewUtil.getStyle(window.container.parentElement, 'zIndex'), 10) : -1;
4632
+ }
4633
+ static setZIndex(window, index) {
4634
+ if (_.isNil(window)) {
4635
+ return;
4636
+ }
4637
+ if (!_.isNil(window.backdrop)) {
4638
+ ViewUtil.setStyle(window.backdrop, 'zIndex', index);
4639
+ }
4640
+ if (!_.isNil(window.wrapper)) {
4641
+ ViewUtil.setStyle(window.wrapper, 'zIndex', index);
4642
+ }
4643
+ }
4644
+ // --------------------------------------------------------------------------
4645
+ //
4623
4646
  // Private Methods
4624
4647
  //
4625
4648
  // --------------------------------------------------------------------------
4626
4649
  sortFunction(first, second) {
4627
- let firstIndex = first.container ? parseInt(ViewUtil.getStyle(first.container.parentElement, 'zIndex'), 10) : -1;
4628
- let secondIndex = second.container ? parseInt(ViewUtil.getStyle(second.container.parentElement, 'zIndex'), 10) : -1;
4629
- return firstIndex > secondIndex ? -1 : 1;
4650
+ return WindowService.getZIndex(first) > WindowService.getZIndex(second) ? -1 : 1;
4630
4651
  }
4631
4652
  updateTop() {
4632
4653
  let zIndex = 0;
4633
4654
  let topWindow = null;
4634
- let windows = [this.sheet.window, ...this.windowsArray];
4655
+ let windows = [...this.windowsArray, this.sheet.window];
4635
4656
  for (let window of windows) {
4636
4657
  if (_.isNil(window) || _.isNil(window.container)) {
4637
4658
  continue;
4638
4659
  }
4639
- let index = parseInt(ViewUtil.getStyle(window.container.parentElement, 'zIndex'), 10);
4660
+ let index = WindowService.getZIndex(window);
4640
4661
  if (zIndex >= index) {
4641
4662
  continue;
4642
4663
  }
@@ -4651,16 +4672,16 @@ class WindowService extends Destroyable {
4651
4672
  }
4652
4673
  setWindowOnTop(topWindow) {
4653
4674
  let currentIndex = this.topZIndex - 2;
4654
- for (let window of this.windowsArray) {
4675
+ let windows = [...this.windowsArray, this.sheet.window];
4676
+ for (let window of windows) {
4655
4677
  if (_.isNil(window.container)) {
4656
4678
  continue;
4657
4679
  }
4658
4680
  window.isOnTop = window === topWindow;
4659
4681
  let zIndex = window.isOnTop ? this.topZIndex : currentIndex--;
4660
- ViewUtil.setStyle(window.backdrop, 'zIndex', zIndex);
4661
- ViewUtil.setStyle(window.wrapper, 'zIndex', zIndex);
4682
+ WindowService.setZIndex(window, zIndex);
4662
4683
  }
4663
- this.windowsArray.sort(this.sortFunction);
4684
+ windows.sort(this.sortFunction);
4664
4685
  this.observer.next(new ObservableData(WindowServiceEvent.SETTED_ON_TOP, topWindow));
4665
4686
  }
4666
4687
  checkPosition(item) {
@@ -4864,6 +4885,12 @@ class WindowService extends Destroyable {
4864
4885
  return this._windows;
4865
4886
  }
4866
4887
  }
4888
+ // --------------------------------------------------------------------------
4889
+ //
4890
+ // Constants
4891
+ //
4892
+ // --------------------------------------------------------------------------
4893
+ WindowService.Z_INDEX_MAX = 1000;
4867
4894
  WindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, deps: [{ token: i1.MatDialog }, { token: i1$1.LanguageService }, { token: CookieService }, { token: BottomSheetService }], target: i0.ɵɵFactoryTarget.Injectable });
4868
4895
  WindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, providedIn: 'root' });
4869
4896
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WindowService, decorators: [{
@@ -4999,9 +5026,12 @@ class BottomSheetImpl extends DestroyableContainer {
4999
5026
  ViewUtil.addClass(this.container, 'vi-bottom-sheet');
5000
5027
  ViewUtil.toggleClass(this.container, 'vi-modal', this.config.isModal);
5001
5028
  this.container.addEventListener('click', this.mouseClickHandlerProxy, true);
5029
+ this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
5030
+ /*
5002
5031
  if (!this.config.isModal) {
5003
5032
  this.container.addEventListener('mousedown', this.mouseDownHandlerProxy);
5004
5033
  }
5034
+ */
5005
5035
  }
5006
5036
  commitIsBlinkProperties() { }
5007
5037
  commitIsDisabledProperties() { }