@ethlete/cdk 3.21.0 → 3.22.1

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/esm2022/lib/components/forms/components/select/components/combobox/components/combobox/combobox.component.mjs +9 -5
  3. package/esm2022/lib/components/forms/components/select/components/combobox/directives/combobox/combobox.directive.mjs +33 -7
  4. package/esm2022/lib/components/forms/components/select/components/combobox/partials/combobox-body/combobox-body.component.mjs +3 -3
  5. package/esm2022/lib/components/forms/components/select/components/combobox/partials/combobox-option/combobox-option.component.mjs +3 -4
  6. package/esm2022/lib/components/forms/components/select/components/combobox/private/combobox.private.types.mjs +1 -1
  7. package/esm2022/lib/components/forms/components/select/components/combobox/utils/public-api.mjs +1 -2
  8. package/esm2022/lib/components/forms/components/select/components/select/components/select/select.component.mjs +3 -3
  9. package/esm2022/lib/components/forms/components/select/components/select/directives/select/select.directive.mjs +144 -312
  10. package/esm2022/lib/components/forms/components/select/components/select/directives/select-body/select-body.directive.mjs +4 -3
  11. package/esm2022/lib/components/forms/components/select/components/select/directives/select-option/select-option.directive.mjs +15 -40
  12. package/esm2022/lib/components/forms/components/select/components/select/partials/select-body/select-body.component.mjs +8 -5
  13. package/esm2022/lib/components/forms/components/select/components/{combobox/utils → select/private}/index.mjs +2 -2
  14. package/esm2022/lib/components/forms/components/select/components/select/private/select.private.types.mjs +2 -0
  15. package/esm2022/lib/components/overlay/components/bottom-sheet/partials/bottom-sheet-container-base/bottom-sheet-container-base.component.mjs +4 -4
  16. package/esm2022/lib/components/overlay/components/dialog/partials/dialog-container-base/dialog-container-base.component.mjs +4 -4
  17. package/esm2022/lib/components/overlay/components/overlay/components/overlay-container/overlay-container.component.mjs +6 -4
  18. package/esm2022/lib/components/overlay/components/overlay/services/overlay.service.mjs +10 -3
  19. package/esm2022/lib/components/overlay/components/overlay/utils/overlay-ref.mjs +35 -6
  20. package/esm2022/lib/components/overlay/components/toggletip/directives/toggletip/toggletip.directive.mjs +5 -3
  21. package/esm2022/lib/components/overlay/components/tooltip/directives/tooltip/tooltip.directive.mjs +5 -3
  22. package/esm2022/lib/components/overlay/directives/overlay-close-auto-blocker/index.mjs +2 -0
  23. package/esm2022/lib/components/overlay/directives/overlay-close-auto-blocker/overlay-close-auto-blocker.directive.mjs +51 -0
  24. package/esm2022/lib/components/overlay/directives/overlay-close-auto-blocker/public-api.mjs +2 -0
  25. package/esm2022/lib/components/overlay/directives/public-api.mjs +2 -1
  26. package/esm2022/lib/components/overlay/public-api.mjs +2 -1
  27. package/esm2022/lib/components/overlay/utils/overlay-dismiss-checker.util.mjs +79 -0
  28. package/esm2022/lib/components/overlay/utils/public-api.mjs +2 -0
  29. package/fesm2022/ethlete-cdk.mjs +397 -409
  30. package/fesm2022/ethlete-cdk.mjs.map +1 -1
  31. package/lib/components/forms/components/select/components/combobox/components/combobox/combobox.component.d.ts +4 -3
  32. package/lib/components/forms/components/select/components/combobox/directives/combobox/combobox.directive.d.ts +4 -1
  33. package/lib/components/forms/components/select/components/combobox/private/combobox.private.types.d.ts +1 -1
  34. package/lib/components/forms/components/select/components/combobox/utils/public-api.d.ts +0 -1
  35. package/lib/components/forms/components/select/components/select/directives/select/select.directive.d.ts +16 -53
  36. package/lib/components/forms/components/select/components/select/directives/select-body/select-body.directive.d.ts +2 -1
  37. package/lib/components/forms/components/select/components/select/directives/select-option/select-option.directive.d.ts +7 -9
  38. package/lib/components/forms/components/select/components/select/partials/select-body/select-body.component.d.ts +2 -1
  39. package/lib/components/forms/components/select/components/select/private/index.d.ts +1 -0
  40. package/lib/components/forms/components/select/components/select/private/select.private.types.d.ts +13 -0
  41. package/lib/components/overlay/components/bottom-sheet/partials/bottom-sheet-container-base/bottom-sheet-container-base.component.d.ts +1 -1
  42. package/lib/components/overlay/components/dialog/partials/dialog-container-base/dialog-container-base.component.d.ts +1 -1
  43. package/lib/components/overlay/components/overlay/components/overlay-container/overlay-container.component.d.ts +5 -3
  44. package/lib/components/overlay/components/overlay/utils/overlay-ref.d.ts +12 -3
  45. package/lib/components/overlay/components/toggletip/directives/toggletip/toggletip.directive.d.ts +2 -1
  46. package/lib/components/overlay/components/tooltip/directives/tooltip/tooltip.directive.d.ts +2 -1
  47. package/lib/components/overlay/directives/overlay-close-auto-blocker/overlay-close-auto-blocker.directive.d.ts +12 -0
  48. package/lib/components/overlay/directives/overlay-close-auto-blocker/public-api.d.ts +1 -0
  49. package/lib/components/overlay/directives/public-api.d.ts +1 -0
  50. package/lib/components/overlay/public-api.d.ts +1 -0
  51. package/lib/components/overlay/utils/overlay-dismiss-checker.util.d.ts +60 -0
  52. package/lib/components/overlay/utils/public-api.d.ts +1 -0
  53. package/package.json +2 -2
  54. package/esm2022/lib/components/forms/components/select/components/combobox/utils/option.utils.mjs +0 -7
  55. package/lib/components/forms/components/select/components/combobox/utils/option.utils.d.ts +0 -1
  56. /package/lib/components/{forms/components/select/components/combobox/utils → overlay/directives/overlay-close-auto-blocker}/index.d.ts +0 -0
@@ -2,11 +2,12 @@ import { DecoratedInputBase } from '../../../../../../utils';
2
2
  import { ComboboxDirective } from '../../directives';
3
3
  import * as i0 from "@angular/core";
4
4
  import * as i1 from "@ethlete/core";
5
- import * as i2 from "../../../../../../directives/input/input.directive";
6
- import * as i3 from "../../directives/combobox/combobox.directive";
5
+ import * as i2 from "../../../../../../../overlay/directives/overlay-close-auto-blocker/overlay-close-auto-blocker.directive";
6
+ import * as i3 from "../../../../../../directives/input/input.directive";
7
+ import * as i4 from "../../directives/combobox/combobox.directive";
7
8
  export declare class ComboboxComponent extends DecoratedInputBase {
8
9
  protected readonly combobox: ComboboxDirective;
9
10
  constructor();
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "et-combobox", never, {}, {}, never, ["[etInputPrefix]", "[etInputSuffix]", "*"], true, [{ directive: typeof i1.AnimatedOverlayDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.InputDirective; inputs: { "placeholder": "placeholder"; }; outputs: {}; }, { directive: typeof i3.ComboboxDirective; inputs: { "options": "options"; "initialValue": "initialValue"; "filterInternal": "filterInternal"; "loading": "loading"; "error": "error"; "emptyText": "emptyText"; "placeholder": "placeholder"; "multiple": "multiple"; "bindLabel": "bindLabel"; "bindValue": "bindValue"; "allowCustomValues": "allowCustomValues"; "selectedOptionComponent": "selectedOptionComponent"; "optionComponent": "optionComponent"; "bodyErrorComponent": "bodyErrorComponent"; "bodyLoadingComponent": "bodyLoadingComponent"; "bodyEmptyComponent": "bodyEmptyComponent"; "bodyMoreItemsHintComponent": "bodyMoreItemsHintComponent"; "showBodyMoreItemsHint": "showBodyMoreItemsHint"; "bodyEmptyText": "bodyEmptyText"; "bodyMoreItemsHintText": "bodyMoreItemsHintText"; "optionComponentInputs": "optionComponentInputs"; "selectedOptionComponentInputs": "selectedOptionComponentInputs"; "bodyErrorComponentInputs": "bodyErrorComponentInputs"; "bodyLoadingComponentInputs": "bodyLoadingComponentInputs"; "bodyEmptyComponentInputs": "bodyEmptyComponentInputs"; "bodyMoreItemsHintComponentInputs": "bodyMoreItemsHintComponentInputs"; }; outputs: { "filterChange": "filterChange"; }; }]>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "et-combobox", never, {}, {}, never, ["[etInputPrefix]", "[etInputSuffix]", "*"], true, [{ directive: typeof i1.AnimatedOverlayDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.OverlayCloseBlockerDirective; inputs: {}; outputs: {}; }, { directive: typeof i3.InputDirective; inputs: { "placeholder": "placeholder"; }; outputs: {}; }, { directive: typeof i4.ComboboxDirective; inputs: { "options": "options"; "initialValue": "initialValue"; "filterInternal": "filterInternal"; "loading": "loading"; "error": "error"; "emptyText": "emptyText"; "placeholder": "placeholder"; "multiple": "multiple"; "bindLabel": "bindLabel"; "bindValue": "bindValue"; "bindDisabled": "bindDisabled"; "allowCustomValues": "allowCustomValues"; "selectedOptionComponent": "selectedOptionComponent"; "optionComponent": "optionComponent"; "bodyErrorComponent": "bodyErrorComponent"; "bodyLoadingComponent": "bodyLoadingComponent"; "bodyEmptyComponent": "bodyEmptyComponent"; "bodyMoreItemsHintComponent": "bodyMoreItemsHintComponent"; "showBodyMoreItemsHint": "showBodyMoreItemsHint"; "bodyEmptyText": "bodyEmptyText"; "bodyMoreItemsHintText": "bodyMoreItemsHintText"; "optionComponentInputs": "optionComponentInputs"; "selectedOptionComponentInputs": "selectedOptionComponentInputs"; "bodyErrorComponentInputs": "bodyErrorComponentInputs"; "bodyLoadingComponentInputs": "bodyLoadingComponentInputs"; "bodyEmptyComponentInputs": "bodyEmptyComponentInputs"; "bodyMoreItemsHintComponentInputs": "bodyMoreItemsHintComponentInputs"; }; outputs: { "filterChange": "filterChange"; }; }]>;
12
13
  }
@@ -54,6 +54,7 @@ export declare class ComboboxDirective implements OnInit {
54
54
  set bindLabel(value: SelectionModelBinding | null);
55
55
  set bindValue(value: SelectionModelBinding | null);
56
56
  set bindKey(value: SelectionModelBinding | null);
57
+ set bindDisabled(value: SelectionModelBinding | null);
57
58
  get allowCustomValues(): boolean;
58
59
  set allowCustomValues(value: unknown);
59
60
  private _allowCustomValues$;
@@ -169,6 +170,7 @@ export declare class ComboboxDirective implements OnInit {
169
170
  writeValueFromOption(option: unknown): void;
170
171
  isOptionSelected(option: unknown): import("rxjs").Observable<boolean>;
171
172
  isOptionActive(option: unknown): import("rxjs").Observable<boolean>;
173
+ isOptionDisabled(option: unknown): import("rxjs").Observable<boolean>;
172
174
  trackByOptionKeyFn: TrackByFunction<unknown>;
173
175
  _ignoreNextBlurEvent(): void;
174
176
  _processKeydownEvent(event: KeyboardEvent): void;
@@ -179,9 +181,10 @@ export declare class ComboboxDirective implements OnInit {
179
181
  private _updateFilter;
180
182
  private _setFilterFromInputValue;
181
183
  private _interpretKeyHandlerResult;
184
+ private _closeBodyOnDisable;
182
185
  private _debugValidateComboboxConfig;
183
186
  private _debugValidateOptionAndInitialValueSchema;
184
187
  static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxDirective, never>;
185
- static ɵdir: i0.ɵɵDirectiveDeclaration<ComboboxDirective, never, never, { "options": { "alias": "options"; "required": true; }; "initialValue": { "alias": "initialValue"; "required": false; }; "filterInternal": { "alias": "filterInternal"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "error": { "alias": "error"; "required": false; }; "emptyText": { "alias": "emptyText"; "required": false; }; "bodyEmptyText": { "alias": "bodyEmptyText"; "required": false; }; "bodyMoreItemsHintText": { "alias": "bodyMoreItemsHintText"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "bindLabel": { "alias": "bindLabel"; "required": false; }; "bindValue": { "alias": "bindValue"; "required": false; }; "bindKey": { "alias": "bindKey"; "required": false; }; "allowCustomValues": { "alias": "allowCustomValues"; "required": false; }; "showBodyMoreItemsHint": { "alias": "showBodyMoreItemsHint"; "required": false; }; "optionComponent": { "alias": "optionComponent"; "required": false; }; "optionComponentInputs": { "alias": "optionComponentInputs"; "required": false; }; "selectedOptionComponent": { "alias": "selectedOptionComponent"; "required": false; }; "selectedOptionComponentInputs": { "alias": "selectedOptionComponentInputs"; "required": false; }; "bodyErrorComponent": { "alias": "bodyErrorComponent"; "required": false; }; "bodyErrorComponentInputs": { "alias": "bodyErrorComponentInputs"; "required": false; }; "bodyLoadingComponent": { "alias": "bodyLoadingComponent"; "required": false; }; "bodyLoadingComponentInputs": { "alias": "bodyLoadingComponentInputs"; "required": false; }; "bodyEmptyComponent": { "alias": "bodyEmptyComponent"; "required": false; }; "bodyEmptyComponentInputs": { "alias": "bodyEmptyComponentInputs"; "required": false; }; "bodyMoreItemsHintComponent": { "alias": "bodyMoreItemsHintComponent"; "required": false; }; "bodyMoreItemsHintComponentInputs": { "alias": "bodyMoreItemsHintComponentInputs"; "required": false; }; }, { "filterChange": "filterChange"; }, ["optionTemplate", "selectedOptionTemplate", "bodyLoadingTemplate", "bodyErrorTemplate", "bodyEmptyTemplate", "bodyMoreItemsHintTemplate"], never, true, never>;
188
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComboboxDirective, never, never, { "options": { "alias": "options"; "required": true; }; "initialValue": { "alias": "initialValue"; "required": false; }; "filterInternal": { "alias": "filterInternal"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "error": { "alias": "error"; "required": false; }; "emptyText": { "alias": "emptyText"; "required": false; }; "bodyEmptyText": { "alias": "bodyEmptyText"; "required": false; }; "bodyMoreItemsHintText": { "alias": "bodyMoreItemsHintText"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "bindLabel": { "alias": "bindLabel"; "required": false; }; "bindValue": { "alias": "bindValue"; "required": false; }; "bindKey": { "alias": "bindKey"; "required": false; }; "bindDisabled": { "alias": "bindDisabled"; "required": false; }; "allowCustomValues": { "alias": "allowCustomValues"; "required": false; }; "showBodyMoreItemsHint": { "alias": "showBodyMoreItemsHint"; "required": false; }; "optionComponent": { "alias": "optionComponent"; "required": false; }; "optionComponentInputs": { "alias": "optionComponentInputs"; "required": false; }; "selectedOptionComponent": { "alias": "selectedOptionComponent"; "required": false; }; "selectedOptionComponentInputs": { "alias": "selectedOptionComponentInputs"; "required": false; }; "bodyErrorComponent": { "alias": "bodyErrorComponent"; "required": false; }; "bodyErrorComponentInputs": { "alias": "bodyErrorComponentInputs"; "required": false; }; "bodyLoadingComponent": { "alias": "bodyLoadingComponent"; "required": false; }; "bodyLoadingComponentInputs": { "alias": "bodyLoadingComponentInputs"; "required": false; }; "bodyEmptyComponent": { "alias": "bodyEmptyComponent"; "required": false; }; "bodyEmptyComponentInputs": { "alias": "bodyEmptyComponentInputs"; "required": false; }; "bodyMoreItemsHintComponent": { "alias": "bodyMoreItemsHintComponent"; "required": false; }; "bodyMoreItemsHintComponentInputs": { "alias": "bodyMoreItemsHintComponentInputs"; "required": false; }; }, { "filterChange": "filterChange"; }, ["optionTemplate", "selectedOptionTemplate", "bodyLoadingTemplate", "bodyErrorTemplate", "bodyEmptyTemplate", "bodyMoreItemsHintTemplate"], never, true, never>;
186
189
  static ngAcceptInputType_showBodyMoreItemsHint: unknown;
187
190
  }
@@ -4,7 +4,7 @@ export declare const ComboboxOptionType: {
4
4
  readonly Primitive: "primitive";
5
5
  readonly Object: "object";
6
6
  };
7
- export interface KeyHandlerResult {
7
+ export interface ComboboxKeyHandlerResult {
8
8
  setFilter?: string;
9
9
  overlayOperation?: 'open' | 'close';
10
10
  optionAction?: {
@@ -1,2 +1 @@
1
1
  export * from './combobox-config.utils';
2
- export * from './option.utils';
@@ -1,24 +1,25 @@
1
1
  import { ComponentType } from '@angular/cdk/portal';
2
- import { AfterContentInit, ElementRef, InjectionToken, OnInit, TemplateRef, TrackByFunction } from '@angular/core';
3
- import { AnimatedOverlayComponentBase, SelectionModel } from '@ethlete/core';
2
+ import { ElementRef, InjectionToken, OnInit, TemplateRef, TrackByFunction } from '@angular/core';
3
+ import { ActiveSelectionModel, AnimatedOverlayComponentBase, SelectionModel } from '@ethlete/core';
4
4
  import { SelectBodyDirective } from '../select-body';
5
5
  import { SelectOptionDirective } from '../select-option';
6
6
  import * as i0 from "@angular/core";
7
7
  import * as i1 from "@ethlete/core";
8
+ import * as i2 from "../../../../../../../overlay/directives/overlay-close-auto-blocker/overlay-close-auto-blocker.directive";
8
9
  export declare const SELECT_TOKEN: InjectionToken<SelectDirective<any>>;
9
10
  type SelectDirectiveBodyComponentBase = AnimatedOverlayComponentBase & {
10
11
  _bodyTemplate: TemplateRef<unknown> | null;
12
+ _containerElementRef: ElementRef<HTMLElement> | null | undefined;
11
13
  selectBody: SelectBodyDirective;
12
14
  };
13
15
  interface SelectBodyConfig<T extends SelectDirectiveBodyComponentBase> {
14
16
  component: ComponentType<T>;
15
17
  template: TemplateRef<unknown>;
16
18
  }
17
- export declare class SelectDirective<T extends SelectDirectiveBodyComponentBase> implements OnInit, AfterContentInit {
19
+ export declare class SelectDirective<T extends SelectDirectiveBodyComponentBase> implements OnInit {
18
20
  private _selectBodyConfig;
19
21
  private readonly _animatedOverlay;
20
22
  private readonly _destroy$;
21
- private readonly _liveAnnouncer;
22
23
  private readonly _selectField;
23
24
  private readonly _themeProvider;
24
25
  readonly input: import("../../../../../../directives").InputDirective<unknown, HTMLInputElement>;
@@ -26,39 +27,18 @@ export declare class SelectDirective<T extends SelectDirectiveBodyComponentBase>
26
27
  private readonly _isOpen$;
27
28
  readonly elementRef: ElementRef<HTMLElement>;
28
29
  readonly _selectionModel: SelectionModel<SelectOptionDirective>;
29
- private readonly _activeSelectionModel;
30
- get multiple(): boolean;
30
+ readonly _activeSelectionModel: ActiveSelectionModel<SelectOptionDirective>;
31
31
  set multiple(value: unknown);
32
- private _multiple$;
33
32
  emptyText?: string;
34
33
  private set _selectOptionsQueryList(value);
35
34
  private readonly _selectOptionsQueryList$;
36
- readonly selectOptions$: import("rxjs").Observable<{
37
- opt: SelectOptionDirective;
38
- selected: boolean;
39
- active: boolean;
40
- }[] | null>;
41
- readonly activeOption$: import("rxjs").Observable<{
42
- opt: SelectOptionDirective;
43
- selected: boolean;
44
- active: boolean;
45
- } | null>;
46
- readonly selectedOptions$: import("rxjs").Observable<{
47
- opt: SelectOptionDirective;
48
- selected: boolean;
49
- active: boolean;
50
- }[] | null>;
51
- readonly selectedOption$: import("rxjs").Observable<{
52
- opt: SelectOptionDirective;
53
- selected: boolean;
54
- active: boolean;
55
- } | null>;
56
35
  readonly selectBodyId$: import("rxjs").Observable<string | null>;
57
36
  readonly isOpen$: import("rxjs").Observable<boolean>;
58
37
  readonly isOpen: import("@angular/core").Signal<boolean | undefined>;
59
38
  readonly multiple$: import("rxjs").Observable<boolean>;
60
39
  readonly selectCurrentValueId: string;
61
40
  readonly ariaViewValue$: import("rxjs").Observable<string | null>;
41
+ readonly ariaViewValue: import("@angular/core").Signal<string | null | undefined>;
62
42
  readonly activeDescendant$: import("rxjs").Observable<string | null>;
63
43
  readonly owns$: import("rxjs").Observable<string | null>;
64
44
  readonly labelledBy$: import("rxjs").Observable<string>;
@@ -70,38 +50,21 @@ export declare class SelectDirective<T extends SelectDirectiveBodyComponentBase>
70
50
  remove: (...tokens: string[]) => void;
71
51
  has: (token: string) => boolean;
72
52
  };
53
+ inputElement: ElementRef<HTMLElement> | null;
73
54
  constructor();
74
55
  ngOnInit(): void;
75
- ngAfterContentInit(): void;
76
56
  trackByFn: TrackByFunction<SelectOptionDirective>;
77
- mountSelectBody(): void;
78
- unmountSelectBody(): void;
79
- setValue(value: unknown): void;
80
- handleKeyDown(event: KeyboardEvent): void;
57
+ open(): void;
58
+ close(): void;
59
+ writeValueFromOption(option: SelectOptionDirective): void;
60
+ focus(): void;
81
61
  setSelectBody(config: SelectBodyConfig<T>): void;
82
62
  removeOptionFromSelection(option: SelectOptionDirective): void;
83
63
  _controlTouched(): void;
84
- private _unmountSelectBodyOnDisable;
85
- private _handleKeyDownInClosedState;
86
- private _handleKeyDownInOpenState;
87
- _setActiveOption(option: SelectOptionDirective | null): Promise<boolean>;
88
- private _addActiveOptionToSelection;
89
- private _removeActiveOptionFromSelection;
90
- private _toggleSelectionOfAllOptions;
91
- private _selectAllOptions;
92
- private _deselectAllOptions;
93
- private _toggleActiveOptionSelection;
94
- private _setActiveOptionSelected;
95
- private _setSelectedOptionActive;
96
- private _setSelectedOption;
97
- private _selectFirstOption;
98
- private _selectLastOption;
99
- private _selectOptionByOffset;
100
- private _activateFirstOption;
101
- private _activateLastOption;
102
- private _activateOptionByOffset;
103
- private _migrateSelectValue;
64
+ _processKeydownEvent(event: KeyboardEvent): void;
65
+ private _interpretKeyHandlerResult;
66
+ private _closeBodyOnDisable;
104
67
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectDirective<any>, never>;
105
- static ɵdir: i0.ɵɵDirectiveDeclaration<SelectDirective<any>, never, never, { "multiple": { "alias": "multiple"; "required": false; }; "emptyText": { "alias": "emptyText"; "required": false; }; }, {}, ["_selectOptionsQueryList"], never, true, [{ directive: typeof i1.AnimatedOverlayDirective; inputs: {}; outputs: {}; }]>;
68
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SelectDirective<any>, never, never, { "multiple": { "alias": "multiple"; "required": false; }; "emptyText": { "alias": "emptyText"; "required": false; }; }, {}, ["_selectOptionsQueryList"], never, true, [{ directive: typeof i1.AnimatedOverlayDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.OverlayCloseBlockerDirective; inputs: {}; outputs: {}; }]>;
106
69
  }
107
70
  export {};
@@ -1,9 +1,10 @@
1
- import { InjectionToken, OnInit } from '@angular/core';
1
+ import { ElementRef, InjectionToken, OnInit } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "@ethlete/core";
4
4
  export declare const SELECT_BODY_TOKEN: InjectionToken<SelectBodyDirective>;
5
5
  export declare class SelectBodyDirective implements OnInit {
6
6
  private readonly _destroy$;
7
+ readonly _elementRef: ElementRef<HTMLElement>;
7
8
  private readonly _select;
8
9
  private readonly _clickOutside;
9
10
  readonly id: string;
@@ -1,12 +1,12 @@
1
- import { AfterContentInit, InjectionToken } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, InjectionToken } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "@ethlete/core";
4
4
  export declare const SELECT_OPTION_TOKEN: InjectionToken<SelectOptionDirective>;
5
- export declare class SelectOptionDirective implements AfterContentInit {
5
+ export declare class SelectOptionDirective implements AfterViewInit {
6
6
  private readonly _select;
7
- private readonly _elementRef;
7
+ readonly _elementRef: ElementRef<HTMLElement>;
8
8
  private readonly _viewValue$;
9
- private readonly _isActive$;
9
+ readonly isActive$: import("rxjs").Observable<boolean>;
10
10
  readonly id: string;
11
11
  get value(): unknown;
12
12
  set value(value: unknown);
@@ -14,12 +14,11 @@ export declare class SelectOptionDirective implements AfterContentInit {
14
14
  get disabled(): boolean;
15
15
  set disabled(value: unknown);
16
16
  private _disabled$;
17
+ readonly disabled$: import("rxjs").Observable<boolean>;
17
18
  readonly isSelected$: import("rxjs").Observable<boolean>;
18
19
  readonly isSelected: import("@angular/core").Signal<boolean | undefined>;
19
20
  get viewValue(): string;
20
21
  readonly viewValue$: import("rxjs").Observable<string>;
21
- readonly disabled$: import("rxjs").Observable<boolean>;
22
- readonly isActive$: import("rxjs").Observable<boolean>;
23
22
  readonly hostClassBindings: {
24
23
  remove: (...tokens: string[]) => void;
25
24
  has: (token: string) => boolean;
@@ -28,10 +27,9 @@ export declare class SelectOptionDirective implements AfterContentInit {
28
27
  remove: (...tokens: string[]) => void;
29
28
  has: (token: string) => boolean;
30
29
  };
31
- ngAfterContentInit(): void;
32
- setSelectValue(): Promise<void>;
30
+ ngAfterViewInit(): void;
31
+ protected selectOption(): void;
33
32
  _updateViewValue(): void;
34
- _setActive(isActive: boolean): void;
35
33
  protected setActiveByHover(): void;
36
34
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectOptionDirective, never>;
37
35
  static ɵdir: i0.ɵɵDirectiveDeclaration<SelectOptionDirective, never, never, { "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.ObserveContentDirective; inputs: {}; outputs: {}; }]>;
@@ -1,4 +1,4 @@
1
- import { TemplateRef } from '@angular/core';
1
+ import { ElementRef, TemplateRef } from '@angular/core';
2
2
  import { AnimatedLifecycleDirective } from '@ethlete/core';
3
3
  import { ProvideThemeDirective } from '@ethlete/theming';
4
4
  import { SelectBodyDirective } from '../../directives';
@@ -9,6 +9,7 @@ export declare class SelectBodyComponent {
9
9
  readonly selectBody: SelectBodyDirective;
10
10
  private readonly _themeProvider;
11
11
  readonly _animatedLifecycle?: AnimatedLifecycleDirective;
12
+ readonly _containerElementRef: ElementRef<HTMLElement> | undefined;
12
13
  _bodyTemplate: TemplateRef<unknown> | null;
13
14
  _setThemeFromProvider(provider: ProvideThemeDirective): void;
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectBodyComponent, never>;
@@ -0,0 +1 @@
1
+ export * from './select.private.types';
@@ -0,0 +1,13 @@
1
+ export interface SelectKeyHandlerResult<T = unknown> {
2
+ overlayOperation?: 'open' | 'close';
3
+ optionAction?: {
4
+ type: 'add';
5
+ option: T;
6
+ } | {
7
+ type: 'remove';
8
+ option: T;
9
+ } | {
10
+ type: 'toggle';
11
+ option: T;
12
+ } | 'clear' | 'toggleAll';
13
+ }
@@ -12,5 +12,5 @@ export declare abstract class BottomSheetContainerBaseComponent extends CdkDialo
12
12
  protected _captureInitialFocus(): void;
13
13
  protected _openAnimationDone(): void;
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<BottomSheetContainerBaseComponent, [null, null, { optional: true; }, null, null, null, null, null]>;
15
- static ɵcmp: i0.ɵɵComponentDeclaration<BottomSheetContainerBaseComponent, "ng-component", never, {}, {}, never, never, false, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<BottomSheetContainerBaseComponent, "et-bottom-sheet-container-base", never, {}, {}, never, never, false, never>;
16
16
  }
@@ -12,5 +12,5 @@ export declare abstract class DialogContainerBaseComponent extends CdkDialogCont
12
12
  protected _captureInitialFocus(): void;
13
13
  protected _openAnimationDone(): void;
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<DialogContainerBaseComponent, [null, null, { optional: true; }, null, null, null, null, null]>;
15
- static ɵcmp: i0.ɵɵComponentDeclaration<DialogContainerBaseComponent, "ng-component", never, {}, {}, never, never, false, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<DialogContainerBaseComponent, "et-dialog-container-base", never, {}, {}, never, never, false, never>;
16
16
  }
@@ -1,7 +1,8 @@
1
1
  import { CdkDialogContainer } from '@angular/cdk/dialog';
2
2
  import { OverlayRef as CdkOverlayRef } from '@angular/cdk/overlay';
3
3
  import { ElementRef } from '@angular/core';
4
- import { AnimatedLifecycleDirective } from '@ethlete/core';
4
+ import { AnimatedLifecycleDirective, RootBoundaryDirective } from '@ethlete/core';
5
+ import { ProvideThemeDirective } from '@ethlete/theming';
5
6
  import { OverlayConfig, OverlayDragToDismissConfig } from '../../types';
6
7
  import { OverlayRef } from '../../utils';
7
8
  import * as i0 from "@angular/core";
@@ -10,8 +11,9 @@ import * as i2 from "@ethlete/theming";
10
11
  export declare class OverlayContainerComponent extends CdkDialogContainer<OverlayConfig> {
11
12
  private readonly _swipeHandlerService;
12
13
  private readonly _dragToDismissStop$;
13
- private readonly _themeProvider;
14
+ readonly _themeProvider: ProvideThemeDirective;
14
15
  private readonly _parentThemeProvider;
16
+ readonly _rootBoundary: RootBoundaryDirective;
15
17
  readonly _animatedLifecycle: AnimatedLifecycleDirective;
16
18
  readonly cdkOverlayRef: CdkOverlayRef;
17
19
  overlayRef: OverlayRef | null;
@@ -25,5 +27,5 @@ export declare class OverlayContainerComponent extends CdkDialogContainer<Overla
25
27
  private _defaultSwipeMoveStyleInterpolator;
26
28
  private _defaultSwipeEndStyleInterpolator;
27
29
  static ɵfac: i0.ɵɵFactoryDeclaration<OverlayContainerComponent, never>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<OverlayContainerComponent, "et-overlay-container", never, {}, {}, never, never, true, [{ directive: typeof i1.AnimatedLifecycleDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.ProvideThemeDirective; inputs: {}; outputs: {}; }]>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<OverlayContainerComponent, "et-overlay-container", never, {}, {}, never, never, true, [{ directive: typeof i1.RootBoundaryDirective; inputs: {}; outputs: {}; }, { directive: typeof i1.AnimatedLifecycleDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.ProvideThemeDirective; inputs: {}; outputs: {}; }]>;
29
31
  }
@@ -13,22 +13,31 @@ export declare class OverlayRef<T = any, R = any> {
13
13
  id: string;
14
14
  private readonly _afterOpened;
15
15
  private readonly _beforeClosed;
16
+ private readonly _closeCalled;
16
17
  private _result;
17
18
  private _state;
18
- private _closeInteractionType;
19
+ _closeInteractionType: FocusOrigin | undefined;
20
+ _isEscCloseControlledExternally: boolean;
21
+ _isBackdropCloseControlledExternally: boolean;
22
+ _isCloseFnCloseControlledExternally: boolean;
23
+ private _disableCloseFromInternalInitiators;
24
+ get _internalDisableClose(): boolean;
19
25
  get _cdkRef(): CdkDialogRef<R, T>;
20
26
  constructor(_ref: CdkDialogRef<R, T>, config: OverlayConfig, _containerInstance: OverlayContainerComponent);
21
- close(result?: R): void;
27
+ close(result?: R, force?: boolean): void;
22
28
  afterOpened(): Observable<void>;
23
29
  afterClosed(): Observable<R | undefined>;
24
30
  beforeClosed(): Observable<R | undefined>;
25
31
  backdropClick(): Observable<MouseEvent>;
26
32
  keydownEvents(): Observable<KeyboardEvent>;
33
+ closeCalled(): Observable<R | undefined>;
27
34
  updatePosition(position?: OverlayPosition): this;
28
35
  updateSize(width?: string, height?: string): this;
29
36
  addPanelClass(classes: string | string[]): this;
30
37
  removePanelClass(classes: string | string[]): this;
31
38
  getState(): OverlayState;
32
39
  private _finishOverlayClose;
33
- _closeOverlayVia(interactionType: FocusOrigin, result?: R): void;
40
+ _closeOverlayVia(interactionType: FocusOrigin, result?: R, force?: boolean): void;
41
+ _addInternalBackdropCloseInitiator(initiatorId: string | number): void;
42
+ _removeInternalBackdropCloseInitiator(initiatorId: string | number): void;
34
43
  }
@@ -3,6 +3,7 @@ import { AnimatedOverlayDirective } from '@ethlete/core';
3
3
  import { ToggletipComponent } from '../../components';
4
4
  import * as i0 from "@angular/core";
5
5
  import * as i1 from "@ethlete/core";
6
+ import * as i2 from "../../../../directives/overlay-close-auto-blocker/overlay-close-auto-blocker.directive";
6
7
  type ToggletipTemplate = string | TemplateRef<unknown>;
7
8
  export declare const TOGGLETIP_DIRECTIVE: InjectionToken<ToggletipDirective>;
8
9
  export declare class ToggletipDirective implements OnInit, OnDestroy {
@@ -26,6 +27,6 @@ export declare class ToggletipDirective implements OnInit, OnDestroy {
26
27
  private _removeListeners;
27
28
  private _mountToggletip;
28
29
  static ɵfac: i0.ɵɵFactoryDeclaration<ToggletipDirective, never>;
29
- static ɵdir: i0.ɵɵDirectiveDeclaration<ToggletipDirective, "[etToggletip]", never, { "toggletip": { "alias": "etToggletip"; "required": false; }; "showToggletip": { "alias": "showToggletip"; "required": false; }; }, { "toggletipClose": "toggletipClose"; }, never, never, true, [{ directive: typeof i1.AnimatedOverlayDirective; inputs: { "placement": "placement"; }; outputs: {}; }]>;
30
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ToggletipDirective, "[etToggletip]", never, { "toggletip": { "alias": "etToggletip"; "required": false; }; "showToggletip": { "alias": "showToggletip"; "required": false; }; }, { "toggletipClose": "toggletipClose"; }, never, never, true, [{ directive: typeof i1.AnimatedOverlayDirective; inputs: { "placement": "placement"; }; outputs: {}; }, { directive: typeof i2.OverlayCloseBlockerDirective; inputs: {}; outputs: {}; }]>;
30
31
  }
31
32
  export {};
@@ -1,6 +1,7 @@
1
1
  import { InjectionToken, OnDestroy, TemplateRef } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "@ethlete/core";
4
+ import * as i2 from "../../../../directives/overlay-close-auto-blocker/overlay-close-auto-blocker.directive";
4
5
  type TooltipTemplate = string | TemplateRef<unknown>;
5
6
  export declare const TOOLTIP_DIRECTIVE: InjectionToken<TooltipDirective>;
6
7
  export declare class TooltipDirective implements OnDestroy {
@@ -29,6 +30,6 @@ export declare class TooltipDirective implements OnDestroy {
29
30
  private _mountTooltip;
30
31
  private _getTooltipText;
31
32
  static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
32
- static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[etTooltip]", never, { "tooltip": { "alias": "etTooltip"; "required": false; }; "tooltipAriaDescription": { "alias": "tooltipAriaDescription"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.AnimatedOverlayDirective; inputs: { "placement": "placement"; }; outputs: {}; }]>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[etTooltip]", never, { "tooltip": { "alias": "etTooltip"; "required": false; }; "tooltipAriaDescription": { "alias": "tooltipAriaDescription"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.AnimatedOverlayDirective; inputs: { "placement": "placement"; }; outputs: {}; }, { directive: typeof i2.OverlayCloseBlockerDirective; inputs: {}; outputs: {}; }]>;
33
34
  }
34
35
  export {};
@@ -0,0 +1,12 @@
1
+ import { InjectionToken, OnDestroy } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare const OVERLAY_CLOSE_BLOCKER_TOKEN: InjectionToken<OverlayCloseBlockerDirective>;
4
+ export declare class OverlayCloseBlockerDirective implements OnDestroy {
5
+ private readonly _id;
6
+ private readonly _animatedOverlay;
7
+ private readonly _nearestOverlayRef;
8
+ constructor();
9
+ ngOnDestroy(): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<OverlayCloseBlockerDirective, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<OverlayCloseBlockerDirective, "[etOverlayCloseBlocker]", never, {}, {}, never, never, true, never>;
12
+ }
@@ -0,0 +1 @@
1
+ export * from './overlay-close-auto-blocker.directive';
@@ -1 +1,2 @@
1
1
  export * from './dynamic-overlay-title/public-api';
2
+ export * from './overlay-close-auto-blocker/public-api';
@@ -2,3 +2,4 @@ export * from './components/public-api';
2
2
  export * from './directives/public-api';
3
3
  export * from './services/public-api';
4
4
  export * from './types/public-api';
5
+ export * from './utils/public-api';
@@ -0,0 +1,60 @@
1
+ import { AbstractControl } from '@angular/forms';
2
+ import { Observable } from 'rxjs';
3
+ export type CreateOverlayDismissCheckerConfig<T extends AbstractControl> = {
4
+ /**
5
+ * The form to check for changes
6
+ */
7
+ form: T;
8
+ /**
9
+ * The default value to compare the current form value to
10
+ *
11
+ * @default form.getRawValue()
12
+ */
13
+ defaultValue?: unknown;
14
+ /**
15
+ * The events that should trigger the dismiss check
16
+ *
17
+ * @default { backdropClick: true, escapeKey: true, closeCall: true }
18
+ */
19
+ dismissEvents?: {
20
+ /**
21
+ * Whether the backdrop click should trigger the dismiss check
22
+ *
23
+ * @default true
24
+ */
25
+ backdropClick?: boolean;
26
+ /**
27
+ * Whether the escape key should trigger the dismiss check
28
+ *
29
+ * @default true
30
+ */
31
+ escapeKey?: boolean;
32
+ /**
33
+ * Whether the close call should trigger the dismiss check.
34
+ * (e.g. `overlayRef.close()`)
35
+ *
36
+ * @default true
37
+ */
38
+ closeCall?: boolean;
39
+ };
40
+ /**
41
+ * This function will be called when the current form value is not equal to the default value.
42
+ * Use this to show a confirmation dialog or similar.
43
+ *
44
+ * @example Show a confirmation dialog:
45
+ * ```ts
46
+ * () => this.overlayService
47
+ * .show(SomeConfirmationComponent)
48
+ * .afterClosed()
49
+ * .pipe(map((result) => !!result?.confirmed))
50
+ * ```
51
+ *
52
+ * @param v The current form value
53
+ */
54
+ dismissCheckFn: (v: ReturnType<T['getRawValue']>) => unknown | Promise<unknown> | Observable<unknown>;
55
+ };
56
+ /**
57
+ * A utility function to enhance the ux of overlays containing forms.
58
+ * It can prevent the user from accidentally closing the overlay when the form value is not equal to the default value.
59
+ */
60
+ export declare const createOverlayDismissChecker: <T extends AbstractControl<any, any>>(config: CreateOverlayDismissCheckerConfig<T>) => import("rxjs").Subscription;
@@ -0,0 +1 @@
1
+ export * from './overlay-dismiss-checker.util';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/cdk",
3
- "version": "3.21.0",
3
+ "version": "3.22.1",
4
4
  "exports": {
5
5
  ".": {
6
6
  "css": "./src/lib/styles/index.css",
@@ -22,7 +22,7 @@
22
22
  "@angular/animations": "16.2.5",
23
23
  "@angular/platform-browser": "16.2.5",
24
24
  "@angular/cdk": "16.2.7",
25
- "@ethlete/core": "3.12.0",
25
+ "@ethlete/core": "3.13.1",
26
26
  "@ethlete/query": "4.16.3"
27
27
  },
28
28
  "module": "fesm2022/ethlete-cdk.mjs",
@@ -1,7 +0,0 @@
1
- export const isOptionDisabled = (opt) => {
2
- if (typeof opt === 'object' && opt !== null && 'disabled' in opt) {
3
- return !!opt.disabled;
4
- }
5
- return false;
6
- };
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uLnV0aWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jZGsvc3JjL2xpYi9jb21wb25lbnRzL2Zvcm1zL2NvbXBvbmVudHMvc2VsZWN0L2NvbXBvbmVudHMvY29tYm9ib3gvdXRpbHMvb3B0aW9uLnV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxNQUFNLGdCQUFnQixHQUFHLENBQUMsR0FBWSxFQUFFLEVBQUU7SUFDL0MsSUFBSSxPQUFPLEdBQUcsS0FBSyxRQUFRLElBQUksR0FBRyxLQUFLLElBQUksSUFBSSxVQUFVLElBQUksR0FBRyxFQUFFO1FBQ2hFLE9BQU8sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUM7S0FDdkI7SUFFRCxPQUFPLEtBQUssQ0FBQztBQUNmLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBpc09wdGlvbkRpc2FibGVkID0gKG9wdDogdW5rbm93bikgPT4ge1xuICBpZiAodHlwZW9mIG9wdCA9PT0gJ29iamVjdCcgJiYgb3B0ICE9PSBudWxsICYmICdkaXNhYmxlZCcgaW4gb3B0KSB7XG4gICAgcmV0dXJuICEhb3B0LmRpc2FibGVkO1xuICB9XG5cbiAgcmV0dXJuIGZhbHNlO1xufTtcbiJdfQ==
@@ -1 +0,0 @@
1
- export declare const isOptionDisabled: (opt: unknown) => boolean;