@indice/ng-components 0.2.4 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/_styles.css CHANGED
@@ -1081,21 +1081,6 @@
1081
1081
  border-radius: 0.3rem;
1082
1082
  outline: 0;
1083
1083
  }
1084
- .modal-backdrop {
1085
- position: fixed;
1086
- top: 0;
1087
- left: 0;
1088
- z-index: 1040;
1089
- width: 100vw;
1090
- height: 100vh;
1091
- background-color: #000;
1092
- }
1093
- .modal-backdrop.fade {
1094
- opacity: 0;
1095
- }
1096
- .modal-backdrop.show {
1097
- opacity: 0.5;
1098
- }
1099
1084
  .modal-scrollbar-measure {
1100
1085
  position: absolute;
1101
1086
  top: -9999px;
@@ -655,8 +655,8 @@
655
655
  }());
656
656
  var ExternalNavLink = /** @class */ (function (_super) {
657
657
  __extends(ExternalNavLink, _super);
658
- function ExternalNavLink(text, path, icon, newTab) {
659
- return _super.call(this, text, path, true, newTab, icon) || this;
658
+ function ExternalNavLink(text, path, openInNewTab, icon) {
659
+ return _super.call(this, text, path, true, openInNewTab, icon) || this;
660
660
  }
661
661
  return ExternalNavLink;
662
662
  }(NavLink));
@@ -2720,9 +2720,7 @@
2720
2720
  ]; };
2721
2721
 
2722
2722
  var cssClassNames = {
2723
- backdrop: 'modal-backdrop',
2724
2723
  show: 'show',
2725
- fade: 'fade',
2726
2724
  modalOpen: 'modal-open'
2727
2725
  };
2728
2726
  var animationTime = {
@@ -2730,50 +2728,6 @@
2730
2728
  modal: 300,
2731
2729
  };
2732
2730
 
2733
- /**
2734
- * Background layer for modals.
2735
- * Override class name to theme it.
2736
- * @see {@link cssClassNames}
2737
- * @internal
2738
- */
2739
- var ModalBackdropComponent = /** @class */ (function () {
2740
- function ModalBackdropComponent(element, renderer) {
2741
- this.element = element;
2742
- this.renderer = renderer;
2743
- this.animationsEnabled = false;
2744
- }
2745
- ModalBackdropComponent.prototype.ngOnInit = function () {
2746
- if (this.animationsEnabled) {
2747
- this.renderer.addClass(this.element.nativeElement, cssClassNames.fade);
2748
- this.reflow(this.element.nativeElement);
2749
- }
2750
- this.renderer.addClass(this.element.nativeElement, cssClassNames.show);
2751
- };
2752
- ModalBackdropComponent.prototype.hide = function () {
2753
- var _this = this;
2754
- this.renderer.removeClass(this.element.nativeElement, cssClassNames.show);
2755
- setTimeout(function () { var _a; return (_a = _this.backdropLoader) === null || _a === void 0 ? void 0 : _a.hide(); }, this.animationsEnabled ? animationTime.backdrop : 0);
2756
- };
2757
- ModalBackdropComponent.prototype.reflow = function (element) {
2758
- (function (bs) { return bs; })(element.offsetHeight);
2759
- };
2760
- return ModalBackdropComponent;
2761
- }());
2762
- ModalBackdropComponent.decorators = [
2763
- { type: i0.Component, args: [{
2764
- selector: 'lib-modal-backdrop',
2765
- encapsulation: i0.ViewEncapsulation.None,
2766
- template: '',
2767
- host: {
2768
- class: cssClassNames.backdrop,
2769
- }
2770
- },] }
2771
- ];
2772
- ModalBackdropComponent.ctorParameters = function () { return [
2773
- { type: i0.ElementRef },
2774
- { type: i0.Renderer2 }
2775
- ]; };
2776
-
2777
2731
  /**
2778
2732
  * Modals option can be passed to a specific modal from {@link ModalService.show} or set globbaly using the injection token {@link MODAL_CONFIG_DEFAULT_OVERRIDE}.
2779
2733
  * @remarks
@@ -2826,9 +2780,6 @@
2826
2780
  }
2827
2781
  ModalContainerComponent.prototype.ngOnInit = function () {
2828
2782
  var _this = this;
2829
- if (this.animationsEnabled) {
2830
- this.renderer.addClass(this._element.nativeElement, cssClassNames.fade);
2831
- }
2832
2783
  this.renderer.setStyle(this._element.nativeElement, 'display', 'block');
2833
2784
  setTimeout(function () {
2834
2785
  _this.isShown = true;
@@ -2838,17 +2789,6 @@
2838
2789
  this._element.nativeElement.focus();
2839
2790
  }
2840
2791
  };
2841
- ModalContainerComponent.prototype.onClickStarted = function (event) {
2842
- this.clickStartedInContent = event.target !== this._element.nativeElement;
2843
- };
2844
- ModalContainerComponent.prototype.onClickStop = function (event) {
2845
- var clickedInBackdrop = event.target === this._element.nativeElement && !this.clickStartedInContent;
2846
- if (this.config.ignoreBackdropClick || this.config.backdrop === 'static' || !clickedInBackdrop) {
2847
- this.clickStartedInContent = false;
2848
- return;
2849
- }
2850
- this.hide();
2851
- };
2852
2792
  ModalContainerComponent.prototype.onPopState = function () {
2853
2793
  this.hide();
2854
2794
  };
@@ -2913,8 +2853,6 @@
2913
2853
  { type: i0.Renderer2 }
2914
2854
  ]; };
2915
2855
  ModalContainerComponent.propDecorators = {
2916
- onClickStarted: [{ type: i0.HostListener, args: ['mousedown', ['$event'],] }],
2917
- onClickStop: [{ type: i0.HostListener, args: ['click', ['$event'],] }],
2918
2856
  onPopState: [{ type: i0.HostListener, args: ['window:popstate',] }],
2919
2857
  onEsc: [{ type: i0.HostListener, args: ['window:keydown.esc', ['$event'],] }]
2920
2858
  };
@@ -2959,7 +2897,6 @@
2959
2897
  this.loaders = [];
2960
2898
  this.modalsCount = 0;
2961
2899
  this.initialPadding = '0px';
2962
- this.backdropLoader = this.clf.createLoader();
2963
2900
  this.defaultConfig = Object.assign(Object.assign({}, modalConfigDefaults), modalDefaultOption);
2964
2901
  this.renderer = rendererFactory.createRenderer(null, null);
2965
2902
  }
@@ -2982,7 +2919,6 @@
2982
2919
  if (this.modalsCount === 1) {
2983
2920
  this.renderer.addClass(this.document.body, cssClassNames.modalOpen);
2984
2921
  }
2985
- this.showBackdrop(combinedConfig);
2986
2922
  return this.showModal(content, combinedConfig);
2987
2923
  };
2988
2924
  /**
@@ -2993,7 +2929,6 @@
2993
2929
  ModalService.prototype.hide = function (id, result) {
2994
2930
  var _this = this;
2995
2931
  if (this.modalsCount === 1 || id == null) {
2996
- this.hideBackdrop();
2997
2932
  this.revertScrollbar();
2998
2933
  this.renderer.removeClass(this.document.body, cssClassNames.modalOpen);
2999
2934
  }
@@ -3063,24 +2998,6 @@
3063
2998
  });
3064
2999
  }
3065
3000
  };
3066
- ModalService.prototype.showBackdrop = function (combinedConfig) {
3067
- var isBackdropEnabled = combinedConfig.backdrop === true || combinedConfig.backdrop === 'static';
3068
- var isBackdropInDOM = this.backdropRef != null;
3069
- if (isBackdropEnabled && !isBackdropInDOM) {
3070
- this.backdropLoader
3071
- .attach(ModalBackdropComponent)
3072
- .to('body')
3073
- .show({ animationsEnabled: combinedConfig.animated, backdropLoader: this.backdropLoader });
3074
- this.backdropRef = this.backdropLoader.componentRef;
3075
- }
3076
- };
3077
- ModalService.prototype.hideBackdrop = function () {
3078
- if (!this.backdropRef) {
3079
- return;
3080
- }
3081
- this.backdropRef.instance.hide();
3082
- this.backdropRef = void 0;
3083
- };
3084
3001
  ModalService.prototype.removeLoaders = function (id) {
3085
3002
  if (id != null) {
3086
3003
  var indexToRemove = this.loaders.findIndex(function (loader) { var _a; return ((_a = loader.instance) === null || _a === void 0 ? void 0 : _a.config.id) === id; });