@coreui/angular-pro 5.7.21 → 5.7.22

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.
@@ -679,6 +679,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
679
679
  class DropdownService {
680
680
  #dropdownState = new BehaviorSubject({});
681
681
  dropdownState$ = this.#dropdownState.asObservable();
682
+ alignment = signal(undefined, /* @ts-ignore */
683
+ ...(ngDevMode ? [{ debugName: "alignment" }] : /* istanbul ignore next */ []));
682
684
  toggle(state) {
683
685
  this.#dropdownState.next(state);
684
686
  }
@@ -699,7 +701,7 @@ class DropdownMenuDirective {
699
701
  #focusKeyManager;
700
702
  /**
701
703
  * Set alignment of dropdown menu.
702
- * @returns 'start' | 'end'
704
+ * @returns DropdownAlignment
703
705
  */
704
706
  alignment = input(/* @ts-ignore */
705
707
  ...(ngDevMode ? [undefined, { debugName: "alignment" }] : /* istanbul ignore next */ []));
@@ -711,11 +713,10 @@ class DropdownMenuDirective {
711
713
  visible = linkedSignal({ ...(ngDevMode ? { debugName: "visible" } : /* istanbul ignore next */ {}), source: this.visibleInput,
712
714
  computation: (value) => value });
713
715
  hostClasses = computed(() => {
714
- const alignment = this.alignment();
715
716
  const visible = this.visible();
716
717
  return {
717
718
  'dropdown-menu': true,
718
- [`dropdown-menu-${alignment}`]: !!alignment,
719
+ ...alignmentClasses(this.alignment() ?? this.#dropdownService.alignment()),
719
720
  show: visible
720
721
  };
721
722
  }, /* @ts-ignore */
@@ -798,6 +799,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
798
799
  }
799
800
  }]
800
801
  }], propDecorators: { alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], visibleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], dropdownItemsContent: [{ type: i0.ContentChildren, args: [forwardRef(() => DropdownItemDirective), { ...{ descendants: true }, isSignal: true }] }] } });
802
+ const alignmentClasses = (alignment) => {
803
+ if (!alignment) {
804
+ return {};
805
+ }
806
+ if (typeof alignment === 'string') {
807
+ return { [`dropdown-menu-${alignment}`]: true };
808
+ }
809
+ return Object.fromEntries(Object.entries(alignment).map(([breakpoint, direction]) => [
810
+ `dropdown-menu${breakpoint === BreakpointInfix.xs ? '' : `-${breakpoint}`}-${direction}`,
811
+ true
812
+ ]));
813
+ };
801
814
 
802
815
  // lightweight injection token
803
816
  class DropdownToken {
@@ -898,12 +911,15 @@ class DropdownComponent {
898
911
  }
899
912
  /**
900
913
  * Set alignment of dropdown menu.
901
- * @returns {'start' | 'end' | { xs: 'start' | 'end' } | { sm: 'start' | 'end' } | { md: 'start' | 'end' } | { lg: 'start' | 'end' } | { xl: 'start' | 'end'} | { xxl: 'start' | 'end'}}
914
+ * @returns DropdownAlignment
902
915
  */
903
916
  alignment = input(/* @ts-ignore */
904
917
  ...(ngDevMode ? [undefined, { debugName: "alignment" }] : /* istanbul ignore next */ []));
905
918
  /**
906
- * Automatically close dropdown when clicking outside the dropdown menu.
919
+ * Configure the auto close behavior: `true` closes the dropdown on a click inside or
920
+ * outside the menu, `false` only on the toggle button or an explicit hide/toggle call
921
+ * and not on the Esc key, `inside` only on a click inside the menu, `outside` only on
922
+ * a click outside it.
907
923
  * @returns boolean | 'inside' | 'outside'
908
924
  * @default true
909
925
  */
@@ -911,7 +927,7 @@ class DropdownComponent {
911
927
  ...(ngDevMode ? [{ debugName: "autoClose" }] : /* istanbul ignore next */ []));
912
928
  /**
913
929
  * Sets a specified direction and location of the dropdown menu.
914
- * @returns 'dropup' | 'dropend' | 'dropstart'
930
+ * @returns 'center' | 'dropup' | 'dropup-center' | 'dropend' | 'dropstart'
915
931
  */
916
932
  direction = input(/* @ts-ignore */
917
933
  ...(ngDevMode ? [undefined, { debugName: "direction" }] : /* istanbul ignore next */ []));
@@ -929,9 +945,17 @@ class DropdownComponent {
929
945
  * @default true
930
946
  */
931
947
  popper = input(true, { ...(ngDevMode ? { debugName: "popper" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
948
+ #popperEnabled = computed(() => this.popper() && typeof this.alignment() !== 'object', /* @ts-ignore */
949
+ ...(ngDevMode ? [{ debugName: "#popperEnabled" }] : /* istanbul ignore next */ []));
950
+ #alignmentEffect = effect(() => {
951
+ this.dropdownService.alignment.set(this.alignment());
952
+ }, /* @ts-ignore */
953
+ ...(ngDevMode ? [{ debugName: "#alignmentEffect" }] : /* istanbul ignore next */ []));
932
954
  /**
933
- * Optional popper Options object, `placement` prop takes precedence over
955
+ * Optional Popper.js options object; the `placement` prop takes precedence over the
956
+ * placement set here. See https://popper.js.org/docs/v2/constructors/#options
934
957
  * @returns Partial<Options>
958
+ * @default {}
935
959
  */
936
960
  popperOptionsInput = input({}, { ...(ngDevMode ? { debugName: "popperOptionsInput" } : /* istanbul ignore next */ {}), alias: 'popperOptions' });
937
961
  #popperOptionsEffect = effect(() => {
@@ -1081,7 +1105,7 @@ class DropdownComponent {
1081
1105
  // workaround for popper position calculate (see also: dropdown-menu.component)
1082
1106
  _menu.elementRef.nativeElement.style.visibility = 'hidden';
1083
1107
  _menu.elementRef.nativeElement.style.display = 'block';
1084
- if (this.popper()) {
1108
+ if (this.#popperEnabled()) {
1085
1109
  this.popperInstance = createPopper(_toggler.elementRef.nativeElement, _menu.elementRef.nativeElement, {
1086
1110
  ...this.popperOptions
1087
1111
  });
@@ -5820,7 +5844,7 @@ class BreadcrumbItemComponent {
5820
5844
  active = input(undefined, { ...(ngDevMode ? { debugName: "active" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
5821
5845
  /**
5822
5846
  * The `url` prop for the inner `[routerLink]` directive
5823
- * @returns string
5847
+ * @returns string | any[]
5824
5848
  */
5825
5849
  url = input(/* @ts-ignore */
5826
5850
  ...(ngDevMode ? [undefined, { debugName: "url" }] : /* istanbul ignore next */ []));
@@ -5994,7 +6018,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
5994
6018
  class ButtonGroupComponent {
5995
6019
  /**
5996
6020
  * Size the component small or large.
5997
- * @returns '' | 'sm' | 'lg' | string
6021
+ * @returns '' | 'sm' | 'lg'
5998
6022
  */
5999
6023
  size = input(/* @ts-ignore */
6000
6024
  ...(ngDevMode ? [undefined, { debugName: "size" }] : /* istanbul ignore next */ []));
@@ -7766,6 +7790,10 @@ class CalendarComponent {
7766
7790
  */
7767
7791
  ariaPrevYearLabel = input('Previous year', /* @ts-ignore */
7768
7792
  ...(ngDevMode ? [{ debugName: "ariaPrevYearLabel" }] : /* istanbul ignore next */ []));
7793
+ /**
7794
+ * Event emitted on calendar cell hover.
7795
+ * @returns Date | null
7796
+ */
7769
7797
  calendarCellHover = output();
7770
7798
  // used with calendarService
7771
7799
  hoverDate = signal(null, /* @ts-ignore */
@@ -8133,7 +8161,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
8133
8161
  class CardImgDirective {
8134
8162
  /**
8135
8163
  * Optionally orientate the image to the top, bottom, or make it overlaid across the card.
8136
- * @returns {'top | 'bottom'}
8164
+ * @returns 'top' | 'bottom' | 'start' | 'end'
8137
8165
  */
8138
8166
  orientation = input(undefined, { ...(ngDevMode ? { debugName: "orientation" } : /* istanbul ignore next */ {}), alias: 'cCardImg' });
8139
8167
  hostClasses = computed(() => {
@@ -8429,7 +8457,7 @@ class CarouselComponent {
8429
8457
  ...(ngDevMode ? [{ debugName: "#intervalEffect" }] : /* istanbul ignore next */ []));
8430
8458
  /**
8431
8459
  * Sets which event handlers you’d like provided to your pause prop. You can specify one trigger or an array of them.
8432
- * @returns 'hover' | 'focus' | 'click'
8460
+ * @returns Triggers | Triggers[] | false
8433
8461
  */
8434
8462
  pause = input('hover', /* @ts-ignore */
8435
8463
  ...(ngDevMode ? [{ debugName: "pause" }] : /* istanbul ignore next */ []));
@@ -12524,7 +12552,7 @@ class ListGroupItemDirective {
12524
12552
  active = input(false, { ...(ngDevMode ? { debugName: "active" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
12525
12553
  /**
12526
12554
  * Sets the color context of the component to one of CoreUI’s themed colors.
12527
- * @returns InputSignal<Colors | undefined>
12555
+ * @returns Colors
12528
12556
  */
12529
12557
  color = input(/* @ts-ignore */
12530
12558
  ...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
@@ -13113,8 +13141,7 @@ class NavbarTogglerDirective {
13113
13141
  }
13114
13142
  /**
13115
13143
  * Reference to navbar collapse element (via # template variable)
13116
- * @returns string
13117
- * @default 'button'
13144
+ * @returns CollapseDirective
13118
13145
  */
13119
13146
  collapseRef = input(undefined, { ...(ngDevMode ? { debugName: "collapseRef" } : /* istanbul ignore next */ {}), alias: 'cNavbarToggler' });
13120
13147
  /**
@@ -14806,7 +14833,7 @@ class PaginationComponent {
14806
14833
  ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
14807
14834
  /**
14808
14835
  * Size the component small or large.
14809
- * @returns '' | 'sm' | 'lg' | string
14836
+ * @returns '' | 'sm' | 'lg'
14810
14837
  */
14811
14838
  size = input(/* @ts-ignore */
14812
14839
  ...(ngDevMode ? [undefined, { debugName: "size" }] : /* istanbul ignore next */ []));
@@ -20192,6 +20219,11 @@ class TabPaneComponent {
20192
20219
  active: this.active
20193
20220
  };
20194
20221
  }
20222
+ /**
20223
+ * Element role.
20224
+ * @returns string
20225
+ * @default 'tabpanel'
20226
+ */
20195
20227
  role = 'tabpanel';
20196
20228
  ngOnDestroy() {
20197
20229
  this.subscribeTabService(false);
@@ -20494,7 +20526,7 @@ class TabsComponent {
20494
20526
  tabsService = inject(TabsService);
20495
20527
  /**
20496
20528
  * The active item key.
20497
- * @returns <string | number | undefined>
20529
+ * @returns number | string
20498
20530
  */
20499
20531
  activeItemKey = model(/* @ts-ignore */
20500
20532
  ...(ngDevMode ? [undefined, { debugName: "activeItemKey" }] : /* istanbul ignore next */ []));
@@ -21648,7 +21680,7 @@ class WidgetStatFComponent extends CardComponent {
21648
21680
  ...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
21649
21681
  /**
21650
21682
  * Value for your widget to display
21651
- * @returns string
21683
+ * @returns string | number
21652
21684
  */
21653
21685
  value = input(/* @ts-ignore */
21654
21686
  ...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));