@db-ux/ngx-core-components 2.2.3 → 2.2.4

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.
@@ -11,7 +11,7 @@ export declare class DBAccordionItem implements AfterViewInit {
11
11
  disabled: import("@angular/core").InputSignal<string | boolean | undefined>;
12
12
  headlinePlain: import("@angular/core").InputSignal<string | undefined>;
13
13
  text: import("@angular/core").InputSignal<string | undefined>;
14
- toggle: import("@angular/core").OutputEmitterRef<any>;
14
+ toggle: import("@angular/core").OutputEmitterRef<boolean | void>;
15
15
  _ref: import("@angular/core").Signal<ElementRef<any> | undefined>;
16
16
  _id: import("@angular/core").WritableSignal<string | undefined>;
17
17
  _open: import("@angular/core").WritableSignal<boolean | undefined>;
@@ -1,6 +1,7 @@
1
1
  import { AfterViewInit, ElementRef, Renderer2 } from "@angular/core";
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
3
  import { CustomSelectOptionType } from "./model";
4
+ import { ClickEvent, GeneralEvent, InputEvent, InteractionEvent } from "../../shared/model";
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class DBCustomSelect implements AfterViewInit, ControlValueAccessor {
6
7
  private renderer;
@@ -64,9 +65,9 @@ export declare class DBCustomSelect implements AfterViewInit, ControlValueAccess
64
65
  placeholder: import("@angular/core").InputSignal<string | undefined>;
65
66
  messageIcon: import("@angular/core").InputSignal<import("@db-ux/core-foundations").BaseIconTypes | import("@db-ux/core-foundations").LooseAutocomplete | undefined>;
66
67
  amountChange: import("@angular/core").OutputEmitterRef<number | void>;
67
- dropdownToggle: import("@angular/core").OutputEmitterRef<any>;
68
+ dropdownToggle: import("@angular/core").OutputEmitterRef<void | Event>;
68
69
  optionSelected: import("@angular/core").OutputEmitterRef<void | string[]>;
69
- search: import("@angular/core").OutputEmitterRef<any>;
70
+ search: import("@angular/core").OutputEmitterRef<void | Event>;
70
71
  _ref: import("@angular/core").Signal<ElementRef<any> | undefined>;
71
72
  selectRef: import("@angular/core").Signal<ElementRef<any> | undefined>;
72
73
  detailsRef: import("@angular/core").Signal<ElementRef<any> | undefined>;
@@ -104,25 +105,25 @@ export declare class DBCustomSelect implements AfterViewInit, ControlValueAccess
104
105
  handleDocumentScroll(event: any): void;
105
106
  hasValidState(): boolean;
106
107
  handleValidation(): void;
107
- handleDropdownToggle(event: any): void;
108
+ handleDropdownToggle(event: GeneralEvent<HTMLDetailsElement>): void;
108
109
  getNativeSelectValue(): string;
109
110
  setDescById(descId?: string): void;
110
111
  getSelectAllLabel(): string;
111
112
  getOptionLabel(option: CustomSelectOptionType): string;
112
113
  getOptionChecked(value?: string): boolean | undefined;
113
114
  getTagRemoveLabel(index: number): string;
114
- handleTagRemove(option: CustomSelectOptionType, event: any): void;
115
+ handleTagRemove(option: CustomSelectOptionType, event?: ClickEvent<HTMLButtonElement> | void): void;
115
116
  handleAutoPlacement(): void;
116
117
  handleArrowDownUp(event: any): void;
117
118
  handleKeyboardPress(event: any): void;
118
- handleClose(event: any): void;
119
+ handleClose(event?: InteractionEvent<HTMLDetailsElement> | void, forceClose?: boolean): void;
119
120
  handleDocumentClose(event: any): void;
120
121
  handleOptionSelected(values: string[]): void;
121
122
  handleSelect(value?: string): void;
122
123
  handleSelectAll(event: any): void;
123
124
  handleFocusFirstDropdownCheckbox(activeElement?: Element): void;
124
125
  handleOpenByKeyboardFocus(): void;
125
- handleSearch(event: any): void;
126
+ handleSearch(valueOrEvent?: InputEvent<HTMLInputElement> | string | void): void;
126
127
  handleClearAll(event: any): void;
127
128
  handleSummaryFocus(): void;
128
129
  satisfyReact(event: any): void;
@@ -1,4 +1,4 @@
1
- import { BaseFormProps, CloseEventState, CustomFormProps, DocumentScrollState, FormMessageProps, FormState, FromValidState, GlobalProps, GlobalState, IconProps, PlacementVerticalType, RequiredProps, ShowIconProps, ShowLabelProps, ValidationType, WidthType } from '../../shared/model';
1
+ import { BaseFormProps, ClickEvent, CloseEventState, CustomFormProps, DocumentScrollState, FormMessageProps, FormState, FromValidState, GeneralEvent, GlobalProps, GlobalState, IconProps, InputEvent, InteractionEvent, PlacementVerticalType, RequiredProps, ShowIconProps, ShowLabelProps, ValidationType, WidthType } from '../../shared/model';
2
2
  import { DBCustomSelectFormFieldDefaultProps } from '../custom-select-form-field/model';
3
3
  import { CustomSelectDropdownWidthType } from '../custom-select-dropdown/model';
4
4
  import { DBCustomSelectListItemExtraProps } from '../custom-select-list-item/model';
@@ -46,19 +46,19 @@ export type DBCustomSelectEvents = {
46
46
  /**
47
47
  * Informs the user when dropdown was toggled.
48
48
  */
49
- onDropdownToggle?: (event: any) => void;
49
+ onDropdownToggle?: (event: GeneralEvent<HTMLDetailsElement>) => void;
50
50
  /**
51
51
  * Informs the user when dropdown was toggled.
52
52
  */
53
- dropdownToggle?: (event: any) => void;
53
+ dropdownToggle?: (event: GeneralEvent<HTMLDetailsElement>) => void;
54
54
  /**
55
55
  * Informs the user when a search was performed.
56
56
  */
57
- onSearch?: (event: any) => void;
57
+ onSearch?: (event: InputEvent<HTMLInputElement>) => void;
58
58
  /**
59
59
  * Informs the user when a search was performed.
60
60
  */
61
- search?: (event: any) => void;
61
+ search?: (event: InputEvent<HTMLInputElement>) => void;
62
62
  };
63
63
  export type DBCustomSelectDefaultProps = {
64
64
  /**
@@ -198,7 +198,7 @@ export type DBCustomSelectDefaultState = {
198
198
  searchEnabled: boolean;
199
199
  amountOptions: number;
200
200
  setDescById: (descId?: string) => void;
201
- handleTagRemove: (option: CustomSelectOptionType, event?: any) => void;
201
+ handleTagRemove: (option: CustomSelectOptionType, event?: ClickEvent<HTMLButtonElement> | void) => void;
202
202
  handleSummaryFocus: () => void;
203
203
  handleSelect: (value?: string) => void;
204
204
  handleSelectAll: (event: any) => void;
@@ -216,4 +216,4 @@ export type DBCustomSelectDefaultState = {
216
216
  selectAllIndeterminate: boolean;
217
217
  handleAutoPlacement: () => void;
218
218
  };
219
- export type DBCustomSelectState = DBCustomSelectDefaultState & GlobalState & FormState & FromValidState & CloseEventState & DocumentScrollState;
219
+ export type DBCustomSelectState = DBCustomSelectDefaultState & GlobalState & FormState & FromValidState & CloseEventState<InteractionEvent<HTMLDetailsElement>> & DocumentScrollState;
@@ -1,4 +1,5 @@
1
1
  import { AfterViewInit, ElementRef } from "@angular/core";
2
+ import { ClickEvent, GeneralKeyboardEvent } from "../../shared/model";
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class DBDrawer implements AfterViewInit {
4
5
  protected readonly cls: (...args: import("../../utils").ClassNameArg[]) => string;
@@ -15,10 +16,10 @@ export declare class DBDrawer implements AfterViewInit {
15
16
  rounded: import("@angular/core").InputSignal<string | boolean | undefined>;
16
17
  closeButtonId: import("@angular/core").InputSignal<string | undefined>;
17
18
  closeButtonText: import("@angular/core").InputSignal<string | undefined>;
18
- close: import("@angular/core").OutputEmitterRef<any>;
19
+ close: import("@angular/core").OutputEmitterRef<void | KeyboardEvent | MouseEvent | undefined>;
19
20
  _ref: import("@angular/core").Signal<ElementRef<any> | undefined>;
20
21
  dialogContainerRef: import("@angular/core").Signal<ElementRef<any> | undefined>;
21
- handleClose(event: any, forceClose?: boolean): void;
22
+ handleClose(event?: ClickEvent<HTMLButtonElement | HTMLDialogElement> | GeneralKeyboardEvent<HTMLDialogElement> | void, forceClose?: boolean): void;
22
23
  handleDialogOpen(): void;
23
24
  constructor();
24
25
  /**
@@ -1,4 +1,4 @@
1
- import { CloseEventProps, CloseEventState, GlobalProps, GlobalState, InnerCloseButtonProps, SpacingProps, WidthProps } from '../../shared/model';
1
+ import { ClickEvent, CloseEventProps, CloseEventState, GeneralKeyboardEvent, GlobalProps, GlobalState, InnerCloseButtonProps, SpacingProps, WidthProps } from '../../shared/model';
2
2
  export declare const DrawerBackdropList: readonly ["none", "strong", "weak", "invisible"];
3
3
  export type DrawerBackdropType = (typeof DrawerBackdropList)[number];
4
4
  export declare const DrawerDirectionList: readonly ["left", "right", "up", "down"];
@@ -34,8 +34,8 @@ export type DBDrawerDefaultProps = {
34
34
  */
35
35
  variant?: DrawerVariantType;
36
36
  };
37
- export type DBDrawerProps = DBDrawerDefaultProps & GlobalProps & CloseEventProps & InnerCloseButtonProps & WidthProps & SpacingProps;
37
+ export type DBDrawerProps = DBDrawerDefaultProps & GlobalProps & CloseEventProps<ClickEvent<HTMLButtonElement | HTMLDialogElement> | GeneralKeyboardEvent<HTMLDialogElement>> & InnerCloseButtonProps & WidthProps & SpacingProps;
38
38
  export type DBDrawerDefaultState = {
39
39
  handleDialogOpen: () => void;
40
40
  };
41
- export type DBDrawerState = DBDrawerDefaultState & GlobalState & CloseEventState;
41
+ export type DBDrawerState = DBDrawerDefaultState & GlobalState & CloseEventState<ClickEvent<HTMLButtonElement | HTMLDialogElement> | GeneralKeyboardEvent<HTMLDialogElement>>;
@@ -13,7 +13,7 @@ export declare class DBHeader implements AfterViewInit {
13
13
  className: import("@angular/core").InputSignal<string | undefined>;
14
14
  width: import("@angular/core").InputSignal<"medium" | "small" | "large" | "full" | undefined>;
15
15
  burgerMenuLabel: import("@angular/core").InputSignal<string | undefined>;
16
- toggle: import("@angular/core").OutputEmitterRef<any>;
16
+ toggle: import("@angular/core").OutputEmitterRef<boolean | void>;
17
17
  _ref: import("@angular/core").Signal<ElementRef<any> | undefined>;
18
18
  _id: import("@angular/core").WritableSignal<string | undefined>;
19
19
  initialized: import("@angular/core").WritableSignal<boolean>;
@@ -1,4 +1,4 @@
1
- import { CloseEventProps, CloseEventState, GlobalProps, GlobalState, IconProps, InnerCloseButtonProps, PopoverProps, SemanticProps, ShowIconProps, TextProps } from '../../shared/model';
1
+ import { ClickEvent, CloseEventProps, CloseEventState, GlobalProps, GlobalState, IconProps, InnerCloseButtonProps, PopoverProps, SemanticProps, ShowIconProps, TextProps } from '../../shared/model';
2
2
  export declare const NotificationVariantList: readonly ["docked", "standalone", "overlay"];
3
3
  export type NotificationVariantType = (typeof NotificationVariantList)[number];
4
4
  export declare const NotificationLinkVariantList: readonly ["block", "inline"];
@@ -52,6 +52,6 @@ export type DBNotificationDefaultProps = {
52
52
  */
53
53
  variant?: NotificationVariantType;
54
54
  };
55
- export type DBNotificationProps = DBNotificationDefaultProps & GlobalProps & CloseEventProps & IconProps & SemanticProps & InnerCloseButtonProps & PopoverProps & ShowIconProps & TextProps;
55
+ export type DBNotificationProps = DBNotificationDefaultProps & GlobalProps & CloseEventProps<ClickEvent<HTMLButtonElement>> & IconProps & SemanticProps & InnerCloseButtonProps & PopoverProps & ShowIconProps & TextProps;
56
56
  export type DBNotificationDefaultState = {};
57
- export type DBNotificationState = DBNotificationDefaultState & GlobalState & CloseEventState;
57
+ export type DBNotificationState = DBNotificationDefaultState & GlobalState & CloseEventState<ClickEvent<HTMLButtonElement>>;
@@ -23,9 +23,9 @@ export declare class DBNotification implements AfterViewInit {
23
23
  closeable: import("@angular/core").InputSignal<string | boolean | undefined>;
24
24
  closeButtonId: import("@angular/core").InputSignal<string | undefined>;
25
25
  closeButtonText: import("@angular/core").InputSignal<string | undefined>;
26
- close: import("@angular/core").OutputEmitterRef<any>;
26
+ close: import("@angular/core").OutputEmitterRef<void | MouseEvent | undefined>;
27
27
  _ref: import("@angular/core").Signal<ElementRef<any> | undefined>;
28
- handleClose(event: ClickEvent<HTMLButtonElement> | any): void;
28
+ handleClose(event?: ClickEvent<HTMLButtonElement> | void): void;
29
29
  constructor();
30
30
  /**
31
31
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
@@ -1,4 +1,4 @@
1
- import { AlignmentProps, GlobalProps, GlobalState, InitializedState, OrientationProps, WidthProps } from '../../shared/model';
1
+ import { AlignmentProps, InputEvent, GlobalProps, GlobalState, InitializedState, OrientationProps, WidthProps } from '../../shared/model';
2
2
  import { DBTabItemProps } from '../tab-item/model';
3
3
  import { DBTabPanelProps } from '../tab-panel/model';
4
4
  export declare const TabsBehaviorList: readonly ["scrollbar", "arrows"];
@@ -28,27 +28,29 @@ export type DBTabsDefaultProps = {
28
28
  */
29
29
  name?: string;
30
30
  /**
31
- * Informs the user if the current tab index has changed.
31
+ * Provide simple tabs with label + text as content
32
32
  */
33
- onIndexChange?: (index?: number) => void;
33
+ tabs?: DBSimpleTabProps[] | string;
34
+ };
35
+ export type DBTabsEventProps = {
34
36
  /**
35
- * Informs the user if another tab has been selected.
37
+ * Informs the user if the current tab index has changed.
36
38
  */
37
- onTabSelect?: (event?: Event) => void;
39
+ indexChange?: (index?: number) => void;
38
40
  /**
39
41
  * Informs the user if the current tab index has changed.
40
42
  */
41
- indexChange?: (index?: number) => void;
43
+ onIndexChange?: (index?: number) => void;
42
44
  /**
43
45
  * Informs the user if another tab has been selected.
44
46
  */
45
- tabSelect?: (event?: Event) => void;
47
+ onTabSelect?: (event?: InputEvent<HTMLElement>) => void;
46
48
  /**
47
- * Provide simple tabs with label + text as content
49
+ * Informs the user if another tab has been selected.
48
50
  */
49
- tabs?: DBSimpleTabProps[] | string;
51
+ tabSelect?: (event?: InputEvent<HTMLElement>) => void;
50
52
  };
51
- export type DBTabsProps = DBTabsDefaultProps & GlobalProps & OrientationProps & WidthProps & AlignmentProps;
53
+ export type DBTabsProps = DBTabsDefaultProps & GlobalProps & OrientationProps & WidthProps & AlignmentProps & DBTabsEventProps;
52
54
  export type DBTabsDefaultState = {
53
55
  _name: string;
54
56
  scrollContainer?: Element | null;
@@ -59,6 +61,6 @@ export type DBTabsDefaultState = {
59
61
  convertTabs: () => DBSimpleTabProps[];
60
62
  initTabList: () => void;
61
63
  initTabs: (init?: boolean) => void;
62
- handleChange: (event: any) => void;
64
+ handleChange: (event: InputEvent<HTMLElement>) => void;
63
65
  };
64
66
  export type DBTabsState = DBTabsDefaultState & GlobalState & InitializedState;
@@ -1,5 +1,6 @@
1
1
  import { AfterViewInit, ElementRef } from "@angular/core";
2
2
  import { DBSimpleTabProps } from "./model";
3
+ import { InputEvent } from "../../shared/model";
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class DBTabs implements AfterViewInit {
5
6
  protected readonly cls: (...args: import("../../utils").ClassNameArg[]) => string;
@@ -28,7 +29,7 @@ export declare class DBTabs implements AfterViewInit {
28
29
  scroll(left?: boolean): void;
29
30
  initTabList(): void;
30
31
  initTabs(init?: boolean): void;
31
- handleChange(event: any): void;
32
+ handleChange(event: InputEvent<HTMLElement>): void;
32
33
  trackByTab0(index: number, tab: any): string;
33
34
  trackByTab1(index: number, tab: any): string;
34
35
  constructor();
@@ -1,6 +1,16 @@
1
1
  import { ClickEvent, ContentSlotProps, GlobalProps, GlobalState, IconProps, InitializedState, OverflowProps, SemanticProps, ShowIconProps, EmphasisProps } from '../../shared/model';
2
2
  export declare const TagBehaviorList: readonly ["static", "removable"];
3
3
  export type TagBehaviorType = (typeof TagBehaviorList)[number];
4
+ export type DBTagEventsProps = {
5
+ /**
6
+ * If "removeButton" attribute is set this function will be called when user clicks cancel button inside the tag.
7
+ */
8
+ onRemove?: (event?: ClickEvent<HTMLButtonElement> | void) => void;
9
+ /**
10
+ * If "removeButton" attribute is set this function will be called when user clicks cancel button inside the tag.
11
+ */
12
+ remove?: (event?: ClickEvent<HTMLButtonElement> | void) => void;
13
+ };
4
14
  export type DBTagDefaultProps = {
5
15
  /**
6
16
  * Defines the behavior of the component:
@@ -16,14 +26,6 @@ export type DBTagDefaultProps = {
16
26
  * Define the text next to the icon specified via the icon Property to get hidden.
17
27
  */
18
28
  noText?: boolean | string;
19
- /**
20
- * If "removeButton" attribute is set this function will be called when user clicks cancel button inside the tag.
21
- */
22
- onRemove?: (event?: any) => void;
23
- /**
24
- * If "removeButton" attribute is set this function will be called when user clicks cancel button inside the tag.
25
- */
26
- remove?: (event?: any) => void;
27
29
  /**
28
30
  * The removeButton attribute shows the cancel button.
29
31
  */
@@ -41,9 +43,9 @@ export type DBTagDefaultProps = {
41
43
  */
42
44
  value?: string;
43
45
  };
44
- export type DBTagProps = DBTagDefaultProps & GlobalProps & IconProps & SemanticProps & OverflowProps & EmphasisProps & ShowIconProps & ContentSlotProps;
46
+ export type DBTagProps = DBTagDefaultProps & GlobalProps & IconProps & SemanticProps & OverflowProps & EmphasisProps & ShowIconProps & ContentSlotProps & DBTagEventsProps;
45
47
  export type DBTagDefaultState = {
46
48
  getRemoveButtonText: () => string;
47
- handleRemove: (event?: ClickEvent<HTMLButtonElement>) => void;
49
+ handleRemove: (event?: ClickEvent<HTMLButtonElement> | void) => void;
48
50
  };
49
51
  export type DBTagState = DBTagDefaultState & GlobalState & InitializedState;
@@ -18,10 +18,10 @@ export declare class DBTag implements AfterViewInit {
18
18
  overflow: import("@angular/core").InputSignal<string | boolean | undefined>;
19
19
  text: import("@angular/core").InputSignal<string | undefined>;
20
20
  behavior: import("@angular/core").InputSignal<string | undefined>;
21
- remove: import("@angular/core").OutputEmitterRef<any>;
21
+ remove: import("@angular/core").OutputEmitterRef<void | MouseEvent | undefined>;
22
22
  _ref: import("@angular/core").Signal<ElementRef<any> | undefined>;
23
23
  initialized: import("@angular/core").WritableSignal<boolean>;
24
- handleRemove(event?: ClickEvent<HTMLButtonElement>): void;
24
+ handleRemove(event?: ClickEvent<HTMLButtonElement> | void): void;
25
25
  getRemoveButtonText(): string | undefined;
26
26
  constructor();
27
27
  /**
@@ -107,6 +107,7 @@ const getOptionKey = (option, prefix) => {
107
107
  const key = option.id ?? option.value ?? uuid();
108
108
  return `${prefix}${key}`;
109
109
  };
110
+ const isKeyboardEvent = (event) => event.key !== undefined;
110
111
 
111
112
  const defaultProps$z = {};
112
113
  class DBButton {
@@ -342,6 +343,8 @@ const TESTING_VIEWPORTS = [{
342
343
  const defaultProps$y = {};
343
344
  class DBNotification {
344
345
  handleClose(event) {
346
+ if (!event)
347
+ return;
345
348
  event.stopPropagation();
346
349
  if (this.close) {
347
350
  this.close.emit(event);
@@ -1262,19 +1265,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
1262
1265
  const defaultProps$r = {};
1263
1266
  class DBDrawer {
1264
1267
  handleClose(event, forceClose) {
1265
- if (event.key === "Escape") {
1266
- event.preventDefault();
1267
- }
1268
- if (forceClose) {
1269
- event.stopPropagation();
1268
+ if (!event)
1269
+ return;
1270
+ if (isKeyboardEvent(event)) {
1271
+ if (event.key === "Escape") {
1272
+ event.preventDefault();
1273
+ if (this.close) {
1274
+ this.close.emit(event);
1275
+ }
1276
+ }
1270
1277
  }
1271
- if (forceClose ||
1272
- event.key === "Escape" ||
1273
- (event.target.nodeName === "DIALOG" &&
1278
+ else {
1279
+ if (forceClose) {
1280
+ event.stopPropagation();
1281
+ if (this.close) {
1282
+ this.close.emit(event);
1283
+ }
1284
+ }
1285
+ if (event.target?.nodeName === "DIALOG" &&
1274
1286
  event.type === "click" &&
1275
- this.backdrop() !== "none")) {
1276
- if (this.close) {
1277
- this.close.emit(event);
1287
+ this.backdrop() !== "none") {
1288
+ if (this.close) {
1289
+ this.close.emit(event);
1290
+ }
1278
1291
  }
1279
1292
  }
1280
1293
  }
@@ -4136,7 +4149,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
4136
4149
  const defaultProps$f = {};
4137
4150
  class DBTag {
4138
4151
  handleRemove(event) {
4139
- event?.stopPropagation();
4152
+ if (!event)
4153
+ return;
4154
+ event.stopPropagation();
4140
4155
  if (this.remove) {
4141
4156
  this.remove.emit(event);
4142
4157
  }
@@ -5736,10 +5751,13 @@ class DBTabs {
5736
5751
  }
5737
5752
  handleChange(event) {
5738
5753
  event.stopPropagation();
5739
- const list = event.target?.closest("ul");
5754
+ const closest = event.target?.closest;
5755
+ if (!closest)
5756
+ return;
5757
+ const list = closest("ul");
5740
5758
  const listItem =
5741
5759
  // db-tab-item for angular and stencil wrapping elements
5742
- event.target.closest("db-tab-item") ?? event.target.closest("li");
5760
+ closest("db-tab-item") ?? closest("li");
5743
5761
  if (list !== null && listItem !== null) {
5744
5762
  const indices = Array.from(list.childNodes).indexOf(listItem);
5745
5763
  if (this.indexChange) {
@@ -6493,12 +6511,12 @@ class DBCustomSelect {
6493
6511
  event.stopPropagation();
6494
6512
  this.dropdownToggle.emit(event);
6495
6513
  }
6496
- if (event.target.open) {
6514
+ if (event.target instanceof HTMLDetailsElement && event.target.open) {
6497
6515
  this._documentClickListenerCallbackId.set(new DocumentClickListener().addCallback((event) => this.handleDocumentClose(event)));
6498
6516
  this._documentScrollListenerCallbackId.set(new DocumentScrollListener().addCallback((event) => this.handleDocumentScroll(event)));
6499
6517
  this.handleAutoPlacement();
6500
6518
  this._observer()?.observe(this.detailsRef()?.nativeElement);
6501
- if (!event.target.dataset.test) {
6519
+ if (!event.target.dataset["test"]) {
6502
6520
  // We need this workaround for snapshot testing
6503
6521
  this.handleOpenByKeyboardFocus();
6504
6522
  }
@@ -6552,7 +6570,9 @@ class DBCustomSelect {
6552
6570
  }
6553
6571
  }
6554
6572
  handleTagRemove(option, event) {
6555
- event.stopPropagation();
6573
+ if (event) {
6574
+ event.stopPropagation();
6575
+ }
6556
6576
  this.handleSelect(option.value);
6557
6577
  this.handleSummaryFocus();
6558
6578
  }
@@ -6620,7 +6640,7 @@ class DBCustomSelect {
6620
6640
  // 2. If we are on the search, and press up we go back to summary and close
6621
6641
  if (activeElement.getAttribute("type") === "search" &&
6622
6642
  (event.key === "ArrowUp" || event.key === "ArrowLeft")) {
6623
- this.handleClose("close");
6643
+ this.handleClose(undefined, true);
6624
6644
  this.handleSummaryFocus();
6625
6645
  }
6626
6646
  else {
@@ -6645,7 +6665,7 @@ class DBCustomSelect {
6645
6665
  handleKeyboardPress(event) {
6646
6666
  event.stopPropagation();
6647
6667
  if (event.key === "Escape" && this.detailsRef()?.nativeElement?.open) {
6648
- this.handleClose("close");
6668
+ this.handleClose(undefined, true);
6649
6669
  this.handleSummaryFocus();
6650
6670
  }
6651
6671
  else if (event.key === "ArrowDown" ||
@@ -6655,19 +6675,20 @@ class DBCustomSelect {
6655
6675
  this.handleArrowDownUp(event);
6656
6676
  }
6657
6677
  }
6658
- handleClose(event) {
6678
+ handleClose(event, forceClose) {
6659
6679
  if (this.detailsRef()?.nativeElement) {
6660
- if (event === "close") {
6680
+ if (forceClose) {
6661
6681
  this.detailsRef().nativeElement.open = false;
6662
6682
  this.handleSummaryFocus();
6663
6683
  }
6664
- else if (this.detailsRef()?.nativeElement.open &&
6665
- event?.relatedTarget) {
6666
- const relatedTarget = event.relatedTarget;
6667
- if (!this.detailsRef()?.nativeElement.contains(relatedTarget)) {
6668
- // We need to use delay here because the combination of `contains`
6669
- // and changing the DOM element causes a race condition inside browser
6670
- delay(() => (this.detailsRef().nativeElement.open = false), 1);
6684
+ else if (this.detailsRef()?.nativeElement.open && event) {
6685
+ if (event.relatedTarget) {
6686
+ const relatedTarget = event.relatedTarget;
6687
+ if (!this.detailsRef()?.nativeElement.contains(relatedTarget)) {
6688
+ // We need to use delay here because the combination of `contains`
6689
+ // and changing the DOM element causes a race condition inside browser
6690
+ delay(() => (this.detailsRef().nativeElement.open = false), 1);
6691
+ }
6671
6692
  }
6672
6693
  }
6673
6694
  }
@@ -6709,7 +6730,7 @@ class DBCustomSelect {
6709
6730
  }
6710
6731
  else {
6711
6732
  this.handleOptionSelected([value]);
6712
- this.handleClose("close");
6733
+ this.handleClose(undefined, true);
6713
6734
  }
6714
6735
  }
6715
6736
  }
@@ -6766,12 +6787,16 @@ class DBCustomSelect {
6766
6787
  }
6767
6788
  }
6768
6789
  }
6769
- handleSearch(event) {
6790
+ handleSearch(valueOrEvent) {
6791
+ if (valueOrEvent === undefined) {
6792
+ return;
6793
+ }
6770
6794
  let filterText;
6771
- if (typeof event === "string") {
6772
- filterText = event;
6795
+ if (typeof valueOrEvent === "string") {
6796
+ filterText = valueOrEvent;
6773
6797
  }
6774
6798
  else {
6799
+ const event = valueOrEvent;
6775
6800
  event.stopPropagation();
6776
6801
  if (this.search) {
6777
6802
  this.search.emit(event);
@@ -7377,7 +7402,7 @@ class DBCustomSelect {
7377
7402
  size="small"
7378
7403
  [name]="_id()"
7379
7404
  [form]="_id()"
7380
- (click)="handleClose('close')"
7405
+ (click)="handleClose(undefined, true)"
7381
7406
  >
7382
7407
  {{mobileCloseButtonText() ?? DEFAULT_CLOSE_BUTTON}}
7383
7408
  </db-button>
@@ -7588,7 +7613,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
7588
7613
  size="small"
7589
7614
  [name]="_id()"
7590
7615
  [form]="_id()"
7591
- (click)="handleClose('close')"
7616
+ (click)="handleClose(undefined, true)"
7592
7617
  >
7593
7618
  {{mobileCloseButtonText() ?? DEFAULT_CLOSE_BUTTON}}
7594
7619
  </db-button>
@@ -7707,5 +7732,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
7707
7732
  * Generated bundle index. Do not edit.
7708
7733
  */
7709
7734
 
7710
- export { AlignmentList, AutoCompleteList, COLOR, COLORS, COLORS_SIMPLE, COLOR_CONST, COLOR_SIMPLE, DBAccordion, DBAccordionItem, DBBadge, DBBrand, DBButton, DBCard, DBCheckbox, DBCustomSelect, DBCustomSelectDropdown, DBCustomSelectFormField, DBCustomSelectList, DBCustomSelectListItem, DBDivider, DBDrawer, DBHeader, DBIcon, DBInfotext, DBInput, DBLink, DBNavigation, DBNavigationItem, DBNotification, DBPage, DBPopover, DBRadio, DBSection, DBSelect, DBStack, DBSwitch, DBTabItem, DBTabList, DBTabPanel, DBTabs, DBTag, DBTextarea, DBTooltip, DEFAULT_BACK, DEFAULT_BURGER_MENU, DEFAULT_CLOSE_BUTTON, DEFAULT_DATALIST_ID_SUFFIX, DEFAULT_ICON, DEFAULT_ID, DEFAULT_INVALID_MESSAGE, DEFAULT_INVALID_MESSAGE_ID_SUFFIX, DEFAULT_LABEL, DEFAULT_LABEL_ID_SUFFIX, DEFAULT_MESSAGE, DEFAULT_MESSAGE_ID_SUFFIX, DEFAULT_PLACEHOLDER, DEFAULT_PLACEHOLDER_ID_SUFFIX, DEFAULT_REMOVE, DEFAULT_ROWS, DEFAULT_SELECTED, DEFAULT_SELECT_ID_SUFFIX, DEFAULT_VALID_MESSAGE, DEFAULT_VALID_MESSAGE_ID_SUFFIX, DEFAULT_VIEWPORT, DENSITIES, DENSITY, DENSITY_CONST, DESKTOP_VIEWPORT, EmphasisList, FieldSizingList, GapSpacingList, LabelVariantList, LinkCurrentList, LinkReferrerPolicyList, LinkTargetList, MarginList, MaxWidthList, MetaNavigationDirective, NavigationContentDirective, NavigationDirective, NavigationItemSafeTriangle, OrientationList, PlacementHorizontalList, PlacementList, PlacementVerticalList, PopoverDelayList, PopoverWidthList, SEMANTIC, SEMANTICS, SecondaryActionDirective, SemanticList, SizeList, SpacingList, TESTING_VIEWPORTS, ValidationList, WidthList, addAttributeToChildren, cls, delay, getBoolean, getBooleanAsString, getHideProp, getInputValue, getNumber, getOptionKey, getSearchInput, hasVoiceOver, isArrayOfStrings, isEventTargetNavigationItem, stringPropVisible, uuid };
7735
+ export { AlignmentList, AutoCompleteList, COLOR, COLORS, COLORS_SIMPLE, COLOR_CONST, COLOR_SIMPLE, DBAccordion, DBAccordionItem, DBBadge, DBBrand, DBButton, DBCard, DBCheckbox, DBCustomSelect, DBCustomSelectDropdown, DBCustomSelectFormField, DBCustomSelectList, DBCustomSelectListItem, DBDivider, DBDrawer, DBHeader, DBIcon, DBInfotext, DBInput, DBLink, DBNavigation, DBNavigationItem, DBNotification, DBPage, DBPopover, DBRadio, DBSection, DBSelect, DBStack, DBSwitch, DBTabItem, DBTabList, DBTabPanel, DBTabs, DBTag, DBTextarea, DBTooltip, DEFAULT_BACK, DEFAULT_BURGER_MENU, DEFAULT_CLOSE_BUTTON, DEFAULT_DATALIST_ID_SUFFIX, DEFAULT_ICON, DEFAULT_ID, DEFAULT_INVALID_MESSAGE, DEFAULT_INVALID_MESSAGE_ID_SUFFIX, DEFAULT_LABEL, DEFAULT_LABEL_ID_SUFFIX, DEFAULT_MESSAGE, DEFAULT_MESSAGE_ID_SUFFIX, DEFAULT_PLACEHOLDER, DEFAULT_PLACEHOLDER_ID_SUFFIX, DEFAULT_REMOVE, DEFAULT_ROWS, DEFAULT_SELECTED, DEFAULT_SELECT_ID_SUFFIX, DEFAULT_VALID_MESSAGE, DEFAULT_VALID_MESSAGE_ID_SUFFIX, DEFAULT_VIEWPORT, DENSITIES, DENSITY, DENSITY_CONST, DESKTOP_VIEWPORT, EmphasisList, FieldSizingList, GapSpacingList, LabelVariantList, LinkCurrentList, LinkReferrerPolicyList, LinkTargetList, MarginList, MaxWidthList, MetaNavigationDirective, NavigationContentDirective, NavigationDirective, NavigationItemSafeTriangle, OrientationList, PlacementHorizontalList, PlacementList, PlacementVerticalList, PopoverDelayList, PopoverWidthList, SEMANTIC, SEMANTICS, SecondaryActionDirective, SemanticList, SizeList, SpacingList, TESTING_VIEWPORTS, ValidationList, WidthList, addAttributeToChildren, cls, delay, getBoolean, getBooleanAsString, getHideProp, getInputValue, getNumber, getOptionKey, getSearchInput, hasVoiceOver, isArrayOfStrings, isEventTargetNavigationItem, isKeyboardEvent, stringPropVisible, uuid };
7711
7736
  //# sourceMappingURL=db-ux-ngx-core-components.mjs.map