@coreui/angular 5.7.6 → 5.7.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.
@@ -3082,7 +3082,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
3082
3082
  class DropdownToken {
3083
3083
  }
3084
3084
  class DropdownToggleDirective {
3085
- // injections
3086
3085
  #destroyRef = inject(DestroyRef);
3087
3086
  elementRef = inject(ElementRef);
3088
3087
  #dropdownService = inject(DropdownService);
@@ -3101,7 +3100,7 @@ class DropdownToggleDirective {
3101
3100
  */
3102
3101
  disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
3103
3102
  /**
3104
- * Enables pseudo element caret on toggler.
3103
+ * Enables pseudo-element caret on toggler.
3105
3104
  * @return boolean
3106
3105
  */
3107
3106
  caret = input(true, /* @ts-ignore */
@@ -3138,9 +3137,14 @@ class DropdownToggleDirective {
3138
3137
  }
3139
3138
  if (this.dropdown) {
3140
3139
  const dropdown = this.dropdown;
3141
- dropdown?.visibleChange?.subscribe((visible) => {
3140
+ const subscription = dropdown?.visibleChange?.subscribe((visible) => {
3142
3141
  this.#ariaExpanded.set(visible);
3143
3142
  });
3143
+ if (subscription) {
3144
+ this.#destroyRef.onDestroy(() => {
3145
+ subscription.unsubscribe();
3146
+ });
3147
+ }
3144
3148
  }
3145
3149
  }
3146
3150
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: DropdownToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
@@ -5041,33 +5045,27 @@ class NavbarComponent {
5041
5045
  return false;
5042
5046
  }, /* @ts-ignore */
5043
5047
  ...(ngDevMode ? [{ debugName: "breakpoint" }] : /* istanbul ignore next */ []));
5044
- #observer;
5045
- ngAfterContentInit() {
5048
+ #breakpointEffect = effect((onCleanup) => {
5046
5049
  const breakpoint = this.breakpoint();
5047
- if (breakpoint) {
5048
- const onBreakpoint = `(min-width: ${breakpoint})`;
5049
- this.#observer = this.#breakpointObserver
5050
- .observe([onBreakpoint])
5051
- .pipe()
5052
- .subscribe((result) => {
5053
- const collapse = this.collapse();
5054
- if (collapse) {
5055
- const animate = collapse.animate();
5056
- collapse.animate.set(false);
5057
- collapse.toggle(false);
5058
- setTimeout(() => {
5059
- collapse.toggle(result.matches);
5060
- setTimeout(() => {
5061
- collapse.animate.set(animate);
5062
- });
5063
- });
5064
- }
5065
- });
5050
+ if (!breakpoint) {
5051
+ return;
5066
5052
  }
5067
- }
5068
- ngOnDestroy() {
5069
- this.#observer?.unsubscribe();
5070
- }
5053
+ const subscription = this.#breakpointObserver.observe([`(min-width: ${breakpoint})`]).subscribe((result) => {
5054
+ const collapse = this.collapse();
5055
+ if (!collapse) {
5056
+ return;
5057
+ }
5058
+ const animate = collapse.animate();
5059
+ collapse.animate.set(false);
5060
+ collapse.toggle(false);
5061
+ setTimeout(() => {
5062
+ collapse.toggle(result.matches);
5063
+ setTimeout(() => collapse.animate.set(animate));
5064
+ });
5065
+ });
5066
+ onCleanup(() => subscription.unsubscribe());
5067
+ }, /* @ts-ignore */
5068
+ ...(ngDevMode ? [{ debugName: "#breakpointEffect" }] : /* istanbul ignore next */ []));
5071
5069
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: NavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5072
5070
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.7", type: NavbarComponent, isStandalone: true, selector: "c-navbar", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, expand: { classPropertyName: "expand", publicName: "expand", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.role": "role()" } }, queries: [{ propertyName: "collapse", first: true, predicate: CollapseDirective, descendants: true, isSignal: true }], hostDirectives: [{ directive: ThemeDirective, inputs: ["colorScheme", "colorScheme"] }], ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"container() ? withContainerTemplate : noContainerTemplate\" />\n\n<ng-template #withContainerTemplate>\n <div [class]=\"containerClass()\">\n <ng-content />\n </div>\n</ng-template>\n\n<ng-template #noContainerTemplate>\n <ng-content />\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
5073
5071
  }