@open-rlb/ng-bootstrap 3.1.25 → 3.1.26

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, Component, input, booleanAttribute, effect, Host, Self, Optional, Directive, Injectable, output, contentChild, computed, contentChildren, viewChild, numberAttribute, model, ViewChild, isSignal, Pipe, ChangeDetectionStrategy, inject, ViewContainerRef, Renderer2, DestroyRef, DOCUMENT, Inject, HostListener, InjectionToken, viewChildren, untracked, EventEmitter, Output, NgModule } from '@angular/core';
2
+ import { signal, Component, input, booleanAttribute, effect, Host, Self, Optional, Directive, Injectable, output, contentChild, computed, contentChildren, viewChild, numberAttribute, model, ViewChild, isSignal, Pipe, ChangeDetectionStrategy, inject, ViewContainerRef, Renderer2, DOCUMENT, Inject, HostListener, InjectionToken, viewChildren, untracked, EventEmitter, Output, NgModule } from '@angular/core';
3
3
  import { Collapse, Carousel, Dropdown, Modal, Toast, Offcanvas, ScrollSpy, Popover, Tooltip } from 'bootstrap';
4
4
  import * as i2 from '@angular/router';
5
5
  import { RouterModule } from '@angular/router';
@@ -4212,10 +4212,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
4212
4212
 
4213
4213
  class NavbarDropdownItemComponent {
4214
4214
  constructor() {
4215
- this.viewContainerRef = inject(ViewContainerRef);
4216
- this.renderer = inject(Renderer2);
4217
- this.destroyRef = inject(DestroyRef);
4218
- this.template = viewChild.required('template');
4215
+ this.listeners = [];
4219
4216
  this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), alias: 'disabled', transform: booleanAttribute });
4220
4217
  this.dropdown = input(false, { ...(ngDevMode ? { debugName: "dropdown" } : {}), alias: 'dropdown', transform: booleanAttribute });
4221
4218
  this.href = input(undefined, ...(ngDevMode ? [{ debugName: "href" }] : []));
@@ -4226,6 +4223,8 @@ class NavbarDropdownItemComponent {
4226
4223
  this.statusChanged = output({ alias: 'status-changed' });
4227
4224
  this._autoClose = computed(() => {
4228
4225
  switch (this.autoClose()) {
4226
+ case 'default':
4227
+ return 'true';
4229
4228
  case 'inside':
4230
4229
  return 'inside';
4231
4230
  case 'outside':
@@ -4236,28 +4235,19 @@ class NavbarDropdownItemComponent {
4236
4235
  return 'true';
4237
4236
  }
4238
4237
  }, ...(ngDevMode ? [{ debugName: "_autoClose" }] : []));
4239
- effect(() => {
4240
- const template = this.template();
4241
- const dropdownEnabled = this.dropdown();
4242
- const templateView = this.viewContainerRef.createEmbeddedView(template);
4243
- this.element = templateView.rootNodes[0];
4244
- this.viewContainerRef.element.nativeElement.remove();
4245
- const anchor = this.element.querySelector('a');
4246
- if (!anchor || !dropdownEnabled)
4247
- return;
4238
+ this.template = viewChild.required('template');
4239
+ this.viewContainerRef = inject(ViewContainerRef);
4240
+ this.renderer = inject(Renderer2);
4241
+ }
4242
+ ngOnInit() {
4243
+ const templateView = this.viewContainerRef.createEmbeddedView(this.template());
4244
+ this.element = templateView.rootNodes[0];
4245
+ this.viewContainerRef.element.nativeElement.remove();
4246
+ const anchor = this.element.querySelector('a');
4247
+ if (anchor && this.dropdown()) {
4248
4248
  this.dropdownInstance = Dropdown.getOrCreateInstance(anchor);
4249
- const unsubShow = this.renderer.listen(anchor, 'show.bs.dropdown', () => this.statusChanged.emit('show'));
4250
- const unsubShown = this.renderer.listen(anchor, 'shown.bs.dropdown', () => this.statusChanged.emit('shown'));
4251
- const unsubHide = this.renderer.listen(anchor, 'hide.bs.dropdown', () => this.statusChanged.emit('hide'));
4252
- const unsubHidden = this.renderer.listen(anchor, 'hidden.bs.dropdown', () => this.statusChanged.emit('hidden'));
4253
- this.destroyRef.onDestroy(() => {
4254
- unsubShow();
4255
- unsubShown();
4256
- unsubHide();
4257
- unsubHidden();
4258
- this.dropdownInstance?.dispose();
4259
- });
4260
- });
4249
+ this.listeners.push(this.renderer.listen(anchor, 'show.bs.dropdown', () => this.statusChanged.emit('show')), this.renderer.listen(anchor, 'shown.bs.dropdown', () => this.statusChanged.emit('shown')), this.renderer.listen(anchor, 'hide.bs.dropdown', () => this.statusChanged.emit('hide')), this.renderer.listen(anchor, 'hidden.bs.dropdown', () => this.statusChanged.emit('hidden')));
4250
+ }
4261
4251
  }
4262
4252
  open() {
4263
4253
  this.dropdownInstance?.show();
@@ -4268,6 +4258,10 @@ class NavbarDropdownItemComponent {
4268
4258
  toggleDropdown() {
4269
4259
  this.dropdownInstance?.toggle();
4270
4260
  }
4261
+ ngOnDestroy() {
4262
+ this.listeners.forEach(unsub => unsub());
4263
+ this.listeners = [];
4264
+ }
4271
4265
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: NavbarDropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4272
4266
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.1", type: NavbarDropdownItemComponent, isStandalone: false, selector: "rlb-navbar-dropdown-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dropdown: { classPropertyName: "dropdown", publicName: "dropdown", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, toggle: { classPropertyName: "toggle", publicName: "toggle", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "auto-close", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click", statusChanged: "status-changed" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, isSignal: true }], ngImport: i0, template: `
4273
4267
  <ng-template #template>
@@ -4287,7 +4281,6 @@ class NavbarDropdownItemComponent {
4287
4281
  >
4288
4282
  <ng-content select=":not(rlb-dropdown-container)"></ng-content>
4289
4283
  </a>
4290
-
4291
4284
  <ng-content select="rlb-dropdown-container"></ng-content>
4292
4285
  </li>
4293
4286
  </ng-template>
@@ -4315,14 +4308,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
4315
4308
  >
4316
4309
  <ng-content select=":not(rlb-dropdown-container)"></ng-content>
4317
4310
  </a>
4318
-
4319
4311
  <ng-content select="rlb-dropdown-container"></ng-content>
4320
4312
  </li>
4321
4313
  </ng-template>
4322
4314
  `,
4323
4315
  standalone: false,
4324
4316
  }]
4325
- }], ctorParameters: () => [], propDecorators: { template: [{ type: i0.ViewChild, args: ['template', { isSignal: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dropdown: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdown", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], toggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggle", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "auto-close", required: false }] }], click: [{ type: i0.Output, args: ["click"] }], statusChanged: [{ type: i0.Output, args: ["status-changed"] }] } });
4317
+ }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dropdown: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdown", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], toggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggle", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "auto-close", required: false }] }], click: [{ type: i0.Output, args: ["click"] }], statusChanged: [{ type: i0.Output, args: ["status-changed"] }], template: [{ type: i0.ViewChild, args: ['template', { isSignal: true }] }] } });
4326
4318
 
4327
4319
  class NavbarItemComponent {
4328
4320
  constructor(viewContainerRef) {