@mintplayer/ng-bootstrap 13.1.18 → 13.1.23

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.
@@ -2312,6 +2312,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
2312
2312
 
2313
2313
  class BsNavbarComponent {
2314
2314
  constructor() {
2315
+ this.autoclose = true;
2315
2316
  this.expandButtonTemplate = null;
2316
2317
  this.isExpanded$ = new BehaviorSubject(false);
2317
2318
  }
@@ -2322,13 +2323,15 @@ class BsNavbarComponent {
2322
2323
  }
2323
2324
  }
2324
2325
  BsNavbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2325
- BsNavbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarComponent, selector: "bs-navbar", viewQueries: [{ propertyName: "nav", first: true, predicate: ["nav"], descendants: true }], ngImport: i0, template: "<nav #nav class=\"navbar navbar-expand-md position-fixed navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <div class=\"d-flex w-100 w-md-auto\">\n <ng-content select=\"bs-navbar-brand\"></ng-content>\n <button (click)=\"toggleExpanded()\" title=\"Expand/collapse menu\" class=\"align-self-end\" [class.navbar-toggler]=\"!expandButtonTemplate\" [class.bg-transparent]=\"expandButtonTemplate\" [class.shadow-none]=\"expandButtonTemplate\" [class.border-0]=\"expandButtonTemplate\" type=\"button\">\n <ng-container *ngTemplateOutlet=\"expandButtonTemplate ?? defaultExpandButton; context: { state: (isExpanded$ | async) ? 'open' : 'closed' }\"></ng-container>\n </button>\n </div>\n <ng-content></ng-content>\n </div>\n</nav>\n\n<ng-template #defaultExpandButton>\n <span class=\"navbar-toggler-icon\"></span>\n</ng-template>", styles: [":host ::ng-deep+*{padding-top:56px}nav{left:0;top:0;right:0;z-index:10}@media (min-width: 768px){.mx-md-unset{margin-left:0!important;margin-right:0!important}.w-md-auto{width:auto!important}}\n"], directives: [{ type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i1.AsyncPipe } });
2326
+ BsNavbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarComponent, selector: "bs-navbar", inputs: { autoclose: "autoclose" }, viewQueries: [{ propertyName: "nav", first: true, predicate: ["nav"], descendants: true }], ngImport: i0, template: "<nav #nav class=\"navbar navbar-expand-md position-fixed navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <div class=\"d-flex w-100 w-md-auto\">\n <ng-content select=\"bs-navbar-brand\"></ng-content>\n <div class=\"flex-end d-md-none d-flex tw\">\n <button (click)=\"toggleExpanded()\" title=\"Expand/collapse menu\" class=\"align-self-center\" [class.navbar-toggler]=\"!expandButtonTemplate\" [class.bg-transparent]=\"expandButtonTemplate\" [class.shadow-none]=\"expandButtonTemplate\" [class.border-0]=\"expandButtonTemplate\" type=\"button\">\n <ng-container *ngTemplateOutlet=\"expandButtonTemplate ?? defaultExpandButton; context: { state: (isExpanded$ | async) ? 'open' : 'closed' }\"></ng-container>\n </button>\n </div>\n </div>\n <ng-content></ng-content>\n </div>\n</nav>\n\n<ng-template #defaultExpandButton>\n <span class=\"navbar-toggler-icon\"></span>\n</ng-template>", styles: [":host ::ng-deep+*{padding-top:56px}nav{left:0;top:0;right:0;z-index:10}@media (min-width: 768px){.mx-md-unset{margin-left:0!important;margin-right:0!important}.w-md-auto{width:auto!important}}.tw{margin:-.5rem -.6666666667rem}\n"], directives: [{ type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i1.AsyncPipe } });
2326
2327
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarComponent, decorators: [{
2327
2328
  type: Component,
2328
- args: [{ selector: 'bs-navbar', template: "<nav #nav class=\"navbar navbar-expand-md position-fixed navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <div class=\"d-flex w-100 w-md-auto\">\n <ng-content select=\"bs-navbar-brand\"></ng-content>\n <button (click)=\"toggleExpanded()\" title=\"Expand/collapse menu\" class=\"align-self-end\" [class.navbar-toggler]=\"!expandButtonTemplate\" [class.bg-transparent]=\"expandButtonTemplate\" [class.shadow-none]=\"expandButtonTemplate\" [class.border-0]=\"expandButtonTemplate\" type=\"button\">\n <ng-container *ngTemplateOutlet=\"expandButtonTemplate ?? defaultExpandButton; context: { state: (isExpanded$ | async) ? 'open' : 'closed' }\"></ng-container>\n </button>\n </div>\n <ng-content></ng-content>\n </div>\n</nav>\n\n<ng-template #defaultExpandButton>\n <span class=\"navbar-toggler-icon\"></span>\n</ng-template>", styles: [":host ::ng-deep+*{padding-top:56px}nav{left:0;top:0;right:0;z-index:10}@media (min-width: 768px){.mx-md-unset{margin-left:0!important;margin-right:0!important}.w-md-auto{width:auto!important}}\n"] }]
2329
+ args: [{ selector: 'bs-navbar', template: "<nav #nav class=\"navbar navbar-expand-md position-fixed navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <div class=\"d-flex w-100 w-md-auto\">\n <ng-content select=\"bs-navbar-brand\"></ng-content>\n <div class=\"flex-end d-md-none d-flex tw\">\n <button (click)=\"toggleExpanded()\" title=\"Expand/collapse menu\" class=\"align-self-center\" [class.navbar-toggler]=\"!expandButtonTemplate\" [class.bg-transparent]=\"expandButtonTemplate\" [class.shadow-none]=\"expandButtonTemplate\" [class.border-0]=\"expandButtonTemplate\" type=\"button\">\n <ng-container *ngTemplateOutlet=\"expandButtonTemplate ?? defaultExpandButton; context: { state: (isExpanded$ | async) ? 'open' : 'closed' }\"></ng-container>\n </button>\n </div>\n </div>\n <ng-content></ng-content>\n </div>\n</nav>\n\n<ng-template #defaultExpandButton>\n <span class=\"navbar-toggler-icon\"></span>\n</ng-template>", styles: [":host ::ng-deep+*{padding-top:56px}nav{left:0;top:0;right:0;z-index:10}@media (min-width: 768px){.mx-md-unset{margin-left:0!important;margin-right:0!important}.w-md-auto{width:auto!important}}.tw{margin:-.5rem -.6666666667rem}\n"] }]
2329
2330
  }], propDecorators: { nav: [{
2330
2331
  type: ViewChild,
2331
2332
  args: ['nav']
2333
+ }], autoclose: [{
2334
+ type: Input
2332
2335
  }] } });
2333
2336
 
2334
2337
  class BsNavbarNavComponent {
@@ -2376,7 +2379,9 @@ class BsNavbarNavComponent {
2376
2379
  //#endregion
2377
2380
  onWindowResize() {
2378
2381
  this.isResizing$.next(true);
2379
- this.windowWidth$.next(window.innerWidth);
2382
+ if (typeof window !== 'undefined') {
2383
+ this.windowWidth$.next(window.innerWidth);
2384
+ }
2380
2385
  }
2381
2386
  }
2382
2387
  BsNavbarNavComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarNavComponent, deps: [{ token: BsNavbarComponent }], target: i0.ɵɵFactoryTarget.Component });
@@ -2392,7 +2397,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
2392
2397
  }] } });
2393
2398
 
2394
2399
  class BsNavbarItemComponent {
2395
- constructor(parentDropdown, element) {
2400
+ constructor(navbar, parentDropdown, element) {
2401
+ this.navbar = navbar;
2396
2402
  this.element = element;
2397
2403
  this.hasDropdown = false;
2398
2404
  this.anchorTag = null;
@@ -2419,7 +2425,7 @@ class BsNavbarItemComponent {
2419
2425
  }
2420
2426
  else {
2421
2427
  // Close if this is a link
2422
- if (this.parentDropdown && this.dropdowns.length === 0) {
2428
+ if (this.dropdowns.length === 0) {
2423
2429
  if (this.anchorTag && !this.anchorTag.onclick) {
2424
2430
  this.anchorTag.onclick = (ev) => {
2425
2431
  let d = this.parentDropdown;
@@ -2427,18 +2433,21 @@ class BsNavbarItemComponent {
2427
2433
  d.isVisible = false;
2428
2434
  d = d.parentDropdown;
2429
2435
  }
2436
+ if (this.navbar.autoclose) {
2437
+ this.navbar.isExpanded$.next(false);
2438
+ }
2430
2439
  };
2431
2440
  }
2432
2441
  }
2433
2442
  }
2434
2443
  }
2435
2444
  }
2436
- BsNavbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarItemComponent, deps: [{ token: BsNavbarDropdownComponent, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2445
+ BsNavbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarItemComponent, deps: [{ token: BsNavbarComponent }, { token: BsNavbarDropdownComponent, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2437
2446
  BsNavbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarItemComponent, selector: "bs-navbar-item", queries: [{ propertyName: "dropdowns", predicate: i0.forwardRef(function () { return BsNavbarDropdownComponent; }) }], ngImport: i0, template: "<li [class.nav-item]=\"parentDropdown === null\" [class.dropdown]=\"(dropdowns.length > 0) && (parentDropdown === null)\" [class.dropend]=\"(dropdowns.length > 0) && (parentDropdown !== null)\">\n <ng-content></ng-content>\n</li>", styles: ["li.dropend ::ng-deep a.dropdown-toggle{padding-right:1.5rem}li.dropend ::ng-deep a.dropdown-toggle:after{position:absolute;right:.5rem;top:.75rem}\n"] });
2438
2447
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarItemComponent, decorators: [{
2439
2448
  type: Component,
2440
2449
  args: [{ selector: 'bs-navbar-item', template: "<li [class.nav-item]=\"parentDropdown === null\" [class.dropdown]=\"(dropdowns.length > 0) && (parentDropdown === null)\" [class.dropend]=\"(dropdowns.length > 0) && (parentDropdown !== null)\">\n <ng-content></ng-content>\n</li>", styles: ["li.dropend ::ng-deep a.dropdown-toggle{padding-right:1.5rem}li.dropend ::ng-deep a.dropdown-toggle:after{position:absolute;right:.5rem;top:.75rem}\n"] }]
2441
- }], ctorParameters: function () { return [{ type: BsNavbarDropdownComponent, decorators: [{
2450
+ }], ctorParameters: function () { return [{ type: BsNavbarComponent }, { type: BsNavbarDropdownComponent, decorators: [{
2442
2451
  type: Optional
2443
2452
  }] }, { type: i0.ElementRef }]; }, propDecorators: { dropdowns: [{
2444
2453
  type: ContentChildren,
@@ -2612,7 +2621,7 @@ class BsNavbarTogglerComponent {
2612
2621
  this.stateChange.emit(this._state);
2613
2622
  }
2614
2623
  //#endregion
2615
- toggleState() {
2624
+ toggleState(ev) {
2616
2625
  switch (this._state) {
2617
2626
  case 'open':
2618
2627
  this.state = 'closed';
@@ -2624,14 +2633,17 @@ class BsNavbarTogglerComponent {
2624
2633
  }
2625
2634
  }
2626
2635
  BsNavbarTogglerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarTogglerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2627
- BsNavbarTogglerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarTogglerComponent, selector: "bs-navbar-toggler", inputs: { state: "state" }, outputs: { stateChange: "stateChange" }, ngImport: i0, template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\" id=\"navbar-toggler\" (click)=\"toggleState()\">\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [":host{align-self:start;position:absolute;top:0;right:0;padding:.5rem .75rem}.navbar-toggler{padding:.25rem;border:none}.navbar-toggler>div{width:25px;height:2px;background:#BBB;margin:6px 0;transition:.4s}.navbar-toggler.open>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.open>div:nth-of-type(2){opacity:0}.navbar-toggler.open>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}@media (min-width: 768px){.navbar-toggler.auto>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.auto>div:nth-of-type(2){opacity:0}.navbar-toggler.auto>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2636
+ BsNavbarTogglerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BsNavbarTogglerComponent, selector: "bs-navbar-toggler", inputs: { state: "state" }, outputs: { stateChange: "stateChange" }, host: { listeners: { "click": "toggleState($event)" } }, ngImport: i0, template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\">\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [":host{align-self:start;top:0;right:0}.navbar-toggler{padding:.75rem 1rem;border:none}.navbar-toggler>div{width:25px;height:2px;background:#BBB;margin:6px 0;transition:.4s}.navbar-toggler.open>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.open>div:nth-of-type(2){opacity:0}.navbar-toggler.open>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}@media (min-width: 768px){.navbar-toggler.auto>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.auto>div:nth-of-type(2){opacity:0}.navbar-toggler.auto>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2628
2637
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsNavbarTogglerComponent, decorators: [{
2629
2638
  type: Component,
2630
- args: [{ selector: 'bs-navbar-toggler', template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\" id=\"navbar-toggler\" (click)=\"toggleState()\">\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [":host{align-self:start;position:absolute;top:0;right:0;padding:.5rem .75rem}.navbar-toggler{padding:.25rem;border:none}.navbar-toggler>div{width:25px;height:2px;background:#BBB;margin:6px 0;transition:.4s}.navbar-toggler.open>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.open>div:nth-of-type(2){opacity:0}.navbar-toggler.open>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}@media (min-width: 768px){.navbar-toggler.auto>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.auto>div:nth-of-type(2){opacity:0}.navbar-toggler.auto>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}}\n"] }]
2639
+ args: [{ selector: 'bs-navbar-toggler', template: "<div class=\"navbar-toggler float-left\" [ngClass]=\"state\">\n <div></div>\n <div></div>\n <div></div>\n</div>", styles: [":host{align-self:start;top:0;right:0}.navbar-toggler{padding:.75rem 1rem;border:none}.navbar-toggler>div{width:25px;height:2px;background:#BBB;margin:6px 0;transition:.4s}.navbar-toggler.open>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.open>div:nth-of-type(2){opacity:0}.navbar-toggler.open>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}@media (min-width: 768px){.navbar-toggler.auto>div:nth-of-type(1){transform:rotate(-45deg) translate(-7px,5px)}.navbar-toggler.auto>div:nth-of-type(2){opacity:0}.navbar-toggler.auto>div:nth-of-type(3){transform:rotate(45deg) translate(-6px,-4px)}}\n"] }]
2631
2640
  }], propDecorators: { stateChange: [{
2632
2641
  type: Output
2633
2642
  }], state: [{
2634
2643
  type: Input
2644
+ }], toggleState: [{
2645
+ type: HostListener,
2646
+ args: ['click', ['$event']]
2635
2647
  }] } });
2636
2648
 
2637
2649
  class BsNavbarModule {
@@ -2874,7 +2886,7 @@ class BsScrollspyComponent {
2874
2886
  }
2875
2887
  }
2876
2888
  scrollToCurrentInSpy() {
2877
- if (window && (window.innerWidth >= 768)) {
2889
+ if ((typeof window !== 'undefined') && (window.innerWidth >= 768)) {
2878
2890
  if (this.activeDirective) {
2879
2891
  const index = this.directives.toArray().findIndex((v, i) => v === this.activeDirective);
2880
2892
  const anchor = this.anchors.get(index);
@@ -2885,10 +2897,12 @@ class BsScrollspyComponent {
2885
2897
  }
2886
2898
  }
2887
2899
  scrollToHeader(directive) {
2888
- const header = directive.element.nativeElement;
2889
- const offsetY = this.scrollOffsetService.getScrollOffset()[1];
2890
- const y = header.getBoundingClientRect().top + window.scrollY - offsetY + 1;
2891
- window.scrollTo({ top: y, behavior: 'smooth' });
2900
+ if (typeof window !== 'undefined') {
2901
+ const header = directive.element.nativeElement;
2902
+ const offsetY = this.scrollOffsetService.getScrollOffset()[1];
2903
+ const y = header.getBoundingClientRect().top + window.scrollY - offsetY + 1;
2904
+ window.scrollTo({ top: y, behavior: 'smooth' });
2905
+ }
2892
2906
  }
2893
2907
  }
2894
2908
  BsScrollspyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsScrollspyComponent, deps: [{ token: BsScrollOffsetService }, { token: DOCUMENT }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
@@ -2997,7 +3011,9 @@ class BsSelect2Component {
2997
3011
  this.focus();
2998
3012
  }
2999
3013
  onResize() {
3000
- this.hostWidth$.next(this.itemsBox.nativeElement.offsetWidth);
3014
+ if (typeof window !== 'undefined') {
3015
+ this.hostWidth$.next(this.itemsBox.nativeElement.offsetWidth);
3016
+ }
3001
3017
  }
3002
3018
  focus() {
3003
3019
  this.searchBox.nativeElement.focus();
@@ -3441,7 +3457,9 @@ class BsTypeaheadComponent {
3441
3457
  this.textbox.nativeElement.focus();
3442
3458
  }
3443
3459
  onResize() {
3444
- this.hostWidth$.next(this.textbox.nativeElement.offsetWidth);
3460
+ if (typeof window !== 'undefined') {
3461
+ this.hostWidth$.next(this.textbox.nativeElement.offsetWidth);
3462
+ }
3445
3463
  }
3446
3464
  }
3447
3465
  BsTypeaheadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BsTypeaheadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });