@coreui/angular-pro 5.7.7 → 5.7.9

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.
@@ -774,7 +774,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
774
774
  class DropdownToken {
775
775
  }
776
776
  class DropdownToggleDirective {
777
- // injections
778
777
  #destroyRef = inject(DestroyRef);
779
778
  elementRef = inject(ElementRef);
780
779
  #dropdownService = inject(DropdownService);
@@ -793,7 +792,7 @@ class DropdownToggleDirective {
793
792
  */
794
793
  disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
795
794
  /**
796
- * Enables pseudo element caret on toggler.
795
+ * Enables pseudo-element caret on toggler.
797
796
  * @return boolean
798
797
  */
799
798
  caret = input(true, /* @ts-ignore */
@@ -830,9 +829,14 @@ class DropdownToggleDirective {
830
829
  }
831
830
  if (this.dropdown) {
832
831
  const dropdown = this.dropdown;
833
- dropdown?.visibleChange?.subscribe((visible) => {
832
+ const subscription = dropdown?.visibleChange?.subscribe((visible) => {
834
833
  this.#ariaExpanded.set(visible);
835
834
  });
835
+ if (subscription) {
836
+ this.#destroyRef.onDestroy(() => {
837
+ subscription.unsubscribe();
838
+ });
839
+ }
836
840
  }
837
841
  }
838
842
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: DropdownToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
@@ -12767,33 +12771,27 @@ class NavbarComponent {
12767
12771
  return false;
12768
12772
  }, /* @ts-ignore */
12769
12773
  ...(ngDevMode ? [{ debugName: "breakpoint" }] : /* istanbul ignore next */ []));
12770
- #observer;
12771
- ngAfterContentInit() {
12774
+ #breakpointEffect = effect((onCleanup) => {
12772
12775
  const breakpoint = this.breakpoint();
12773
- if (breakpoint) {
12774
- const onBreakpoint = `(min-width: ${breakpoint})`;
12775
- this.#observer = this.#breakpointObserver
12776
- .observe([onBreakpoint])
12777
- .pipe()
12778
- .subscribe((result) => {
12779
- const collapse = this.collapse();
12780
- if (collapse) {
12781
- const animate = collapse.animate();
12782
- collapse.animate.set(false);
12783
- collapse.toggle(false);
12784
- setTimeout(() => {
12785
- collapse.toggle(result.matches);
12786
- setTimeout(() => {
12787
- collapse.animate.set(animate);
12788
- });
12789
- });
12790
- }
12791
- });
12776
+ if (!breakpoint) {
12777
+ return;
12792
12778
  }
12793
- }
12794
- ngOnDestroy() {
12795
- this.#observer?.unsubscribe();
12796
- }
12779
+ const subscription = this.#breakpointObserver.observe([`(min-width: ${breakpoint})`]).subscribe((result) => {
12780
+ const collapse = this.collapse();
12781
+ if (!collapse) {
12782
+ return;
12783
+ }
12784
+ const animate = collapse.animate();
12785
+ collapse.animate.set(false);
12786
+ collapse.toggle(false);
12787
+ setTimeout(() => {
12788
+ collapse.toggle(result.matches);
12789
+ setTimeout(() => collapse.animate.set(animate));
12790
+ });
12791
+ });
12792
+ onCleanup(() => subscription.unsubscribe());
12793
+ }, /* @ts-ignore */
12794
+ ...(ngDevMode ? [{ debugName: "#breakpointEffect" }] : /* istanbul ignore next */ []));
12797
12795
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: NavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12798
12796
  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"] }] });
12799
12797
  }
@@ -13278,7 +13276,7 @@ class ModalComponent {
13278
13276
  this.show = this.visible();
13279
13277
  });
13280
13278
  }
13281
- onKeyUpHandler(event) {
13279
+ onKeyDownHandler(event) {
13282
13280
  if (event.key === 'Escape' && this.keyboard() && this.visible()) {
13283
13281
  if (this.backdrop() === 'static') {
13284
13282
  this.setStaticBackdrop();
@@ -13359,7 +13357,7 @@ class ModalComponent {
13359
13357
  }
13360
13358
  }
13361
13359
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13362
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.7", type: ModalComponent, isStandalone: true, selector: "c-modal", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, attrId: { classPropertyName: "attrId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaModalInput: { classPropertyName: "ariaModalInput", publicName: "ariaModal", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { listeners: { "mousedown": "onMouseDownHandler($event)", "click": "onClickHandler($event)", "document:keyup": "onKeyUpHandler($event)" }, properties: { "class": "hostClasses()", "attr.role": "visible() ? role() : null", "attr.inert": "ariaHidden()", "attr.id": "id", "attr.aria-modal": "ariaModal()", "attr.aria-hidden": "ariaHidden()", "attr.tabindex": "-1" }, classAttribute: "modal" }, viewQueries: [{ propertyName: "modalContentRef", first: true, predicate: ["modalContentRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "modalDialogRef", first: true, predicate: ModalDialogComponent, descendants: true, read: ElementRef, isSignal: true }], exportAs: ["cModal"], ngImport: i0, template: "@let isVisible = visible();\n<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n <div #modalContentRef [cdkTrapFocusAutoCapture]=\"isVisible\" [cdkTrapFocus]=\"isVisible\" style=\"display: contents;\">\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n", dependencies: [{ kind: "component", type: ModalDialogComponent, selector: "c-modal-dialog", inputs: ["alignment", "fullscreen", "scrollable", "size"] }, { kind: "component", type: ModalContentComponent, selector: "c-modal-content" }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
13360
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.7", type: ModalComponent, isStandalone: true, selector: "c-modal", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, attrId: { classPropertyName: "attrId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaModalInput: { classPropertyName: "ariaModalInput", publicName: "ariaModal", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, host: { listeners: { "mousedown": "onMouseDownHandler($event)", "click": "onClickHandler($event)", "document:keydown": "onKeyDownHandler($event)" }, properties: { "class": "hostClasses()", "attr.role": "visible() ? role() : null", "attr.inert": "ariaHidden()", "attr.id": "id", "attr.aria-modal": "ariaModal()", "attr.aria-hidden": "ariaHidden()", "attr.tabindex": "-1" }, classAttribute: "modal" }, viewQueries: [{ propertyName: "modalContentRef", first: true, predicate: ["modalContentRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "modalDialogRef", first: true, predicate: ModalDialogComponent, descendants: true, read: ElementRef, isSignal: true }], exportAs: ["cModal"], ngImport: i0, template: "@let isVisible = visible();\n<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n <div #modalContentRef [cdkTrapFocusAutoCapture]=\"isVisible\" [cdkTrapFocus]=\"isVisible\" style=\"display: contents;\">\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n", dependencies: [{ kind: "component", type: ModalDialogComponent, selector: "c-modal-dialog", inputs: ["alignment", "fullscreen", "scrollable", "size"] }, { kind: "component", type: ModalContentComponent, selector: "c-modal-content" }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
13363
13361
  }
13364
13362
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ModalComponent, decorators: [{
13365
13363
  type: Component,
@@ -13374,7 +13372,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
13374
13372
  '[attr.tabindex]': '-1',
13375
13373
  '(mousedown)': 'onMouseDownHandler($event)',
13376
13374
  '(click)': 'onClickHandler($event)',
13377
- '(document:keyup)': 'onKeyUpHandler($event)'
13375
+ '(document:keydown)': 'onKeyDownHandler($event)'
13378
13376
  }, template: "@let isVisible = visible();\n<c-modal-dialog\n [alignment]=\"alignment()\"\n [fullscreen]=\"fullscreen()\"\n [scrollable]=\"scrollable()\"\n [size]=\"size()\">\n <c-modal-content>\n <div #modalContentRef [cdkTrapFocusAutoCapture]=\"isVisible\" [cdkTrapFocus]=\"isVisible\" style=\"display: contents;\">\n <ng-content />\n </div>\n </c-modal-content>\n</c-modal-dialog>\n" }]
13379
13377
  }], propDecorators: { alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }], keyboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboard", required: false }] }], attrId: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], transition: [{ type: i0.Input, args: [{ isSignal: true, alias: "transition", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaModalInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaModal", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }], modalContentRef: [{ type: i0.ViewChild, args: ['modalContentRef', { ...{ read: ElementRef }, isSignal: true }] }], modalDialogRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ModalDialogComponent), { ...{ read: ElementRef }, isSignal: true }] }] } });
13380
13378
 
@@ -14697,6 +14695,25 @@ class PopoverDirective {
14697
14695
  this.visible() ? this.addTooltipElement() : this.removeTooltipElement();
14698
14696
  }
14699
14697
  });
14698
+ #handleEscapeKey = (event) => {
14699
+ if (event.key !== 'Escape') {
14700
+ return;
14701
+ }
14702
+ event.preventDefault();
14703
+ event.stopPropagation();
14704
+ this.visible.set(false);
14705
+ };
14706
+ #escapeEffect = effect((onCleanup) => {
14707
+ if (!this.visible()) {
14708
+ return;
14709
+ }
14710
+ const useCapture = true;
14711
+ this.#document.addEventListener('keydown', this.#handleEscapeKey, useCapture);
14712
+ onCleanup(() => {
14713
+ this.#document.removeEventListener('keydown', this.#handleEscapeKey, useCapture);
14714
+ });
14715
+ }, /* @ts-ignore */
14716
+ ...(ngDevMode ? [{ debugName: "#escapeEffect" }] : /* istanbul ignore next */ []));
14700
14717
  get ariaDescribedBy() {
14701
14718
  return this.tooltipId ? this.tooltipId : null;
14702
14719
  }
@@ -15235,6 +15252,23 @@ class TooltipDirective {
15235
15252
  this.visible() ? this.addTooltipElement() : this.removeTooltipElement();
15236
15253
  }
15237
15254
  });
15255
+ #handleEscapeKey = (event) => {
15256
+ if (event.key !== 'Escape') {
15257
+ return;
15258
+ }
15259
+ event.preventDefault();
15260
+ event.stopPropagation();
15261
+ this.visible.set(false);
15262
+ };
15263
+ #escapeEffect = effect((onCleanup) => {
15264
+ if (!this.visible()) {
15265
+ return;
15266
+ }
15267
+ const useCapture = true;
15268
+ this.#document.addEventListener('keydown', this.#handleEscapeKey, useCapture);
15269
+ onCleanup(() => this.#document.removeEventListener('keydown', this.#handleEscapeKey, useCapture));
15270
+ }, /* @ts-ignore */
15271
+ ...(ngDevMode ? [{ debugName: "#escapeEffect" }] : /* istanbul ignore next */ []));
15238
15272
  get ariaDescribedBy() {
15239
15273
  return this.tooltipId ? this.tooltipId : null;
15240
15274
  }