@ts-core/angular 13.0.58 → 13.0.61

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