@koobiq/components 20.1.0 → 20.3.0
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.
- package/accordion/_accordion-theme.scss +6 -2
- package/accordion/accordion-tokens.scss +3 -0
- package/accordion/{accordion-trigger.component.scss → accordion-trigger.scss} +10 -0
- package/accordion/accordion.scss +71 -0
- package/accordion/index.d.ts +264 -121
- package/actions-panel/index.d.ts +25 -13
- package/alert/_alert-theme.scss +14 -0
- package/alert/alert.component.scss +24 -13
- package/alert/index.d.ts +63 -29
- package/app-switcher/app-switcher-dropdown-app.scss +7 -5
- package/app-switcher/app-switcher-dropdown-site.scss +6 -4
- package/app-switcher/index.d.ts +41 -4
- package/app-switcher/kbq-app-switcher-list-item.scss +6 -8
- package/autocomplete/autocomplete.scss +2 -1
- package/autocomplete/index.d.ts +58 -37
- package/badge/index.d.ts +2 -3
- package/breadcrumbs/index.d.ts +1 -1
- package/button/index.d.ts +2 -2
- package/button-toggle/button-toggle-tokens.scss +2 -0
- package/button-toggle/button-toggle.scss +9 -0
- package/button-toggle/index.d.ts +5 -0
- package/checkbox/index.d.ts +33 -29
- package/clamped-text/index.d.ts +3 -2
- package/code-block/index.d.ts +24 -19
- package/content-panel/index.d.ts +1 -1
- package/core/index.d.ts +1217 -186
- package/core/option/_action-container-mixins.scss +28 -0
- package/core/option/_option-theme.scss +24 -0
- package/core/option/action.scss +7 -0
- package/core/styles/_core.scss +2 -0
- package/core/styles/_koobiq-theme.scss +2 -0
- package/core/styles/_tokens.scss +1 -0
- package/core/styles/common/_animation.scss +31 -24
- package/core/styles/common/_connected-overlay.scss +39 -0
- package/core/styles/common/_select.scss +19 -2
- package/core/styles/common/_tokens.scss +0 -9
- package/core/styles/theming/_index.scss +0 -1
- package/core/styles/theming/_theming.scss +34 -5
- package/datepicker/index.d.ts +46 -15
- package/dl/dl.scss +26 -0
- package/dl/index.d.ts +8 -1
- package/dropdown/_dropdown-theme.scss +28 -2
- package/dropdown/dropdown-item.scss +29 -0
- package/dropdown/dropdown-tokens.scss +2 -1
- package/dropdown/dropdown.scss +16 -1
- package/dropdown/index.d.ts +331 -17
- package/dynamic-translation/index.d.ts +1 -1
- package/fesm2022/koobiq-components-accordion.mjs +480 -317
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +57 -46
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +98 -58
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs +233 -38
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +89 -52
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +18 -17
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +25 -25
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +17 -12
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +25 -25
- package/fesm2022/koobiq-components-checkbox.mjs +69 -92
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +18 -13
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +56 -69
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +29 -29
- package/fesm2022/koobiq-components-core.mjs +2485 -735
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +168 -126
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +7 -7
- package/fesm2022/koobiq-components-dl.mjs +23 -15
- package/fesm2022/koobiq-components-dl.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +814 -136
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-dynamic-translation.mjs +13 -13
- package/fesm2022/koobiq-components-ellipsis-center.mjs +7 -7
- package/fesm2022/koobiq-components-empty-state.mjs +19 -19
- package/fesm2022/koobiq-components-file-upload.mjs +74 -42
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +783 -199
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-flag.mjs +7 -7
- package/fesm2022/koobiq-components-form-field.mjs +350 -162
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +52 -25
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +175 -28
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +41 -24
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +8 -8
- package/fesm2022/koobiq-components-list.mjs +657 -143
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +16 -16
- package/fesm2022/koobiq-components-markdown.mjs +14 -11
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +59 -35
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +177 -67
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +40 -24
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +16 -17
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +31 -21
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +13 -13
- package/fesm2022/koobiq-components-progress-spinner.mjs +13 -13
- package/fesm2022/koobiq-components-radio.mjs +10 -10
- package/fesm2022/koobiq-components-resizer.mjs +33 -14
- package/fesm2022/koobiq-components-resizer.mjs.map +1 -1
- package/fesm2022/koobiq-components-scrollbar.mjs +10 -10
- package/fesm2022/koobiq-components-search-expandable.mjs +49 -14
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +450 -146
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +14 -14
- package/fesm2022/koobiq-components-sidepanel.mjs +26 -26
- package/fesm2022/koobiq-components-skeleton.mjs +10 -10
- package/fesm2022/koobiq-components-split-button.mjs +10 -17
- package/fesm2022/koobiq-components-split-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter.mjs +17 -17
- package/fesm2022/koobiq-components-table.mjs +15 -13
- package/fesm2022/koobiq-components-table.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +80 -68
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +283 -122
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +13 -8
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +29 -24
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +61 -30
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +77 -42
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +7 -7
- package/fesm2022/koobiq-components-toast.mjs +51 -26
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +72 -64
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +219 -28
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +13 -13
- package/fesm2022/koobiq-components-tree-select.mjs +222 -80
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +302 -81
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/fesm2022/koobiq-components-username.mjs +27 -27
- package/file-upload/index.d.ts +25 -6
- package/file-upload/multiple-file-upload.component.scss +14 -0
- package/filter-bar/_filter-bar-theme.scss +0 -10
- package/filter-bar/filter-bar-tokens.scss +3 -0
- package/filter-bar/filters.scss +3 -2
- package/filter-bar/index.d.ts +281 -9
- package/filter-bar/pipes/base-pipe.scss +0 -11
- package/filter-bar/pipes/pipe-input.scss +10 -0
- package/filter-bar/pipes/pipe-multi-tree-select.scss +0 -6
- package/filter-bar/pipes/pipe-multiselect.scss +0 -6
- package/filter-bar/pipes/pipe-tree-select.scss +0 -6
- package/form-field/_form-field-theme.scss +76 -20
- package/form-field/fieldset.scss +10 -0
- package/form-field/form-field-tokens.scss +15 -1
- package/form-field/form-field.scss +15 -19
- package/form-field/index.d.ts +147 -65
- package/icon/icon-button.scss +3 -1
- package/icon/index.d.ts +45 -7
- package/inline-edit/index.d.ts +57 -4
- package/inline-edit/inline-edit.scss +10 -0
- package/input/index.d.ts +17 -2
- package/list/_list-theme.scss +42 -10
- package/list/index.d.ts +326 -79
- package/list/list-tokens.scss +43 -8
- package/list/list.scss +186 -12
- package/markdown/index.d.ts +1 -1
- package/modal/index.d.ts +21 -4
- package/modal/modal-tokens.scss +1 -1
- package/navbar/_navbar-item_vertical.scss +7 -5
- package/navbar/index.d.ts +54 -5
- package/navbar/navbar-brand.scss +23 -7
- package/navbar/vertical-navbar.scss +6 -0
- package/notification-center/index.d.ts +2 -1
- package/notification-center/notification-item.scss +6 -0
- package/package.json +3 -6
- package/popover/index.d.ts +2 -2
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/resizer/index.d.ts +12 -0
- package/schematics/collection.json +10 -0
- package/schematics/migrations/alert-signals/README.md +64 -0
- package/schematics/migrations/alert-signals/data.js +70 -0
- package/schematics/migrations/alert-signals/index.js +350 -0
- package/schematics/migrations/alert-signals/schema.json +20 -0
- package/schematics/migrations/autocomplete-panel-width-auto/README.md +68 -0
- package/schematics/migrations/autocomplete-panel-width-auto/index.js +70 -0
- package/schematics/migrations/autocomplete-panel-width-auto/schema.json +15 -0
- package/schematics/migrations/deprecated-icons/README.md +29 -4
- package/schematics/migrations/deprecated-icons/data.js +7 -0
- package/schematics/migrations/deprecated-icons/index.js +62 -35
- package/schematics/migrations/filter-bar-signals/README.md +1 -1
- package/schematics/migrations/new-icons-pack/README.md +37 -2
- package/schematics/migrations/new-icons-pack/data.js +8 -0
- package/schematics/migrations/new-icons-pack/index.js +144 -53
- package/schematics/migrations.json +11 -1
- package/schematics/ng-add/index.js +3 -3
- package/schematics/utils/angular-parsing.js +41 -14
- package/schematics/utils/ast.js +31 -0
- package/schematics/utils/icon-migration.js +530 -0
- package/schematics/utils/typescript.js +44 -0
- package/scrollbar/index.d.ts +1 -1
- package/search-expandable/index.d.ts +3 -0
- package/select/index.d.ts +212 -40
- package/select/select-tokens.scss +0 -1
- package/select/select.scss +0 -2
- package/splitter/index.d.ts +1 -1
- package/table/_table-theme.scss +4 -0
- package/table/index.d.ts +2 -1
- package/table/table.scss +8 -0
- package/tabs/_tabs-common.scss +60 -31
- package/tabs/_tabs-theme.scss +12 -0
- package/tabs/index.d.ts +2 -2
- package/tabs/tab-header.scss +14 -0
- package/tabs/tab-nav-bar.scss +4 -0
- package/tabs/tabs-tokens.scss +1 -0
- package/tags/index.d.ts +128 -29
- package/textarea/index.d.ts +5 -0
- package/time-range/index.d.ts +1 -1
- package/timepicker/index.d.ts +4 -0
- package/timezone/index.d.ts +10 -8
- package/toast/index.d.ts +26 -3
- package/toggle/index.d.ts +34 -14
- package/tooltip/index.d.ts +119 -7
- package/tree/_tree-theme.scss +25 -5
- package/tree/index.d.ts +71 -3
- package/tree/tree-option.scss +2 -8
- package/tree-select/_tree-select-theme.scss +22 -0
- package/tree-select/index.d.ts +127 -36
- package/accordion/accordion.component.scss +0 -50
- package/core/styles/_tokens.kbq.import.scss +0 -4
- package/core/styles/theming/_components-theming.scss +0 -1927
- package/filter-bar/pipes/pipe-select.scss +0 -5
- package/overflow-items/overflow-items.scss +0 -20
package/dropdown/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { AnimationTriggerMetadata, AnimationEvent } from '@angular/animations';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { OnDestroy,
|
|
3
|
+
import { OnDestroy, Signal, InjectionToken, TemplateRef, EventEmitter, QueryList, ElementRef, AfterContentInit, OnInit } from '@angular/core';
|
|
4
4
|
import { Subject, Observable } from 'rxjs';
|
|
5
5
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
6
|
-
import { KbqTitleTextRef, IFocusableOption, KbqComponentColors } from '@koobiq/components/core';
|
|
6
|
+
import { KbqPanelWidth, KbqPanelMinWidth, KbqPanelMaxWidth, KbqTitleTextRef, IFocusableOption, Highlightable, KbqComponentColors, KbqSiblingPopup, KbqPanelWidthOrigin, KbqTriangle } from '@koobiq/components/core';
|
|
7
7
|
import * as i2 from '@koobiq/components/icon';
|
|
8
8
|
import { KbqIcon } from '@koobiq/components/icon';
|
|
9
9
|
import { Direction } from '@angular/cdk/bidi';
|
|
10
|
+
import * as _angular_forms from '@angular/forms';
|
|
10
11
|
import * as i1 from '@angular/cdk/overlay';
|
|
11
12
|
import { ScrollStrategy, Overlay } from '@angular/cdk/overlay';
|
|
12
13
|
|
|
@@ -66,6 +67,62 @@ declare function throwKbqDropdownInvalidPositionX(): void;
|
|
|
66
67
|
* @docs-private
|
|
67
68
|
*/
|
|
68
69
|
declare function throwKbqDropdownInvalidPositionY(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Throws an exception for the case when `kbqDropdownSearch` is applied to a form field that doesn't
|
|
72
|
+
* host a `kbqInput`.
|
|
73
|
+
* @docs-private
|
|
74
|
+
*/
|
|
75
|
+
declare function throwKbqDropdownSearchMissingInputError(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Throws an exception for the case when `kbqDropdownSearch`'s input isn't bound to a form control, so
|
|
78
|
+
* there is no query to react to.
|
|
79
|
+
* @docs-private
|
|
80
|
+
*/
|
|
81
|
+
declare function throwKbqDropdownSearchMissingNgControlError(): void;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Narrow view of `KbqDropdownItem` that `KbqDropdownItemAction` needs. Read through
|
|
85
|
+
* `KBQ_DROPDOWN_ITEM_ACTION_HOST` instead of importing `KbqDropdownItem` directly: the item
|
|
86
|
+
* imports `KbqDropdownItemAction` for its `contentChild` query, so an import back from here would
|
|
87
|
+
* form a circular dependency between the two files, which breaks the query at runtime (the
|
|
88
|
+
* predicate ends up captured as `undefined`).
|
|
89
|
+
* @docs-private
|
|
90
|
+
*/
|
|
91
|
+
interface KbqDropdownItemActionHost {
|
|
92
|
+
readonly disabled: boolean;
|
|
93
|
+
readonly progress: Signal<boolean>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Marks a secondary, independently-focusable/clickable element (e.g. a settings link) projected
|
|
97
|
+
* inside a `kbq-dropdown-item` alongside the item's own primary action. Requires the item's host
|
|
98
|
+
* element to be non-interactive (e.g. `<div kbq-dropdown-item>`), since interactive content
|
|
99
|
+
* cannot validly nest inside another interactive element.
|
|
100
|
+
*/
|
|
101
|
+
declare class KbqDropdownItemAction {
|
|
102
|
+
private readonly elementRef;
|
|
103
|
+
private readonly dropdownItem;
|
|
104
|
+
/**
|
|
105
|
+
* The `tabindex` this element had before `isInactive()` first forced it to `-1`, so it can be
|
|
106
|
+
* restored instead of left removed. Plain `[attr.tabindex]` can't do this: co-located host
|
|
107
|
+
* bindings for the same attribute (e.g. `KbqIconButton`'s own `tabindex`) apply in directive
|
|
108
|
+
* order and the last one always wins outright, so writing `null` here on the active branch
|
|
109
|
+
* would strip whatever tabindex the host component set, not just leave it alone.
|
|
110
|
+
*/
|
|
111
|
+
private originalTabindex;
|
|
112
|
+
constructor();
|
|
113
|
+
/** Returns the host DOM element. */
|
|
114
|
+
getHostElement(): HTMLElement;
|
|
115
|
+
/** `progress` takes priority over the action, same as `disabled`. */
|
|
116
|
+
protected isInactive(): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Always stops the click from bubbling to the item's own primary click handler.
|
|
119
|
+
* Additionally, blocks the action's own default behavior when the parent item is
|
|
120
|
+
* disabled/loading — `<a>` has no native `disabled`.
|
|
121
|
+
*/
|
|
122
|
+
protected onClick(event: MouseEvent): void;
|
|
123
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KbqDropdownItemAction, never>;
|
|
124
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqDropdownItemAction, "[kbqDropdownItemAction]", never, {}, {}, never, never, true, never>;
|
|
125
|
+
}
|
|
69
126
|
|
|
70
127
|
/** Position of the dropdown panel along the x-axis. */
|
|
71
128
|
type KbqDropdownPositionX = 'before' | 'after' | 'center';
|
|
@@ -95,12 +152,21 @@ interface KbqDropdownPanel {
|
|
|
95
152
|
templateRef: TemplateRef<any>;
|
|
96
153
|
closed: EventEmitter<DropdownCloseReason>;
|
|
97
154
|
parent?: KbqDropdownPanel | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* @deprecated Has no effect. Use `KbqDropdownTrigger.widthOrigin` to make the panel match
|
|
157
|
+
* an element other than the trigger. Will be removed in v21.
|
|
158
|
+
*/
|
|
98
159
|
triggerWidth?: string;
|
|
160
|
+
panelWidth?: Signal<KbqPanelWidth>;
|
|
161
|
+
panelMinWidth?: Signal<KbqPanelMinWidth>;
|
|
162
|
+
panelMaxWidth?: Signal<KbqPanelMaxWidth>;
|
|
99
163
|
direction?: Direction;
|
|
100
164
|
lazyContent?: KbqDropdownContent;
|
|
101
165
|
backdropClass?: string;
|
|
102
166
|
hasBackdrop?: boolean;
|
|
103
167
|
items: QueryList<KbqDropdownItem>;
|
|
168
|
+
/** Whether the panel highlights the active item instead of focusing it, see `KbqDropdownSearch`. */
|
|
169
|
+
readonly inSearchMode?: Signal<boolean>;
|
|
104
170
|
focusFirstItem(origin?: FocusOrigin): void;
|
|
105
171
|
resetActiveItem(): void;
|
|
106
172
|
setPositionClasses?(x: KbqDropdownPositionX, y: KbqDropdownPositionY): void;
|
|
@@ -119,6 +185,24 @@ interface KbqDropdownDefaultOptions {
|
|
|
119
185
|
backdropClass: string;
|
|
120
186
|
/** Whether the dropdown has a backdrop. */
|
|
121
187
|
hasBackdrop: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Whether nested dropdowns opened from this dropdown's items use a "safe area": while the
|
|
190
|
+
* pointer moves from a trigger toward its open submenu, sibling items it crosses over on the way
|
|
191
|
+
* don't prematurely close the submenu.
|
|
192
|
+
*/
|
|
193
|
+
safeArea?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Width of the panel. If set to `auto`, the panel will match the trigger width.
|
|
196
|
+
* If set to null, the panel will grow to match its content.
|
|
197
|
+
*/
|
|
198
|
+
panelWidth?: KbqPanelWidth;
|
|
199
|
+
/** Minimum width of the panel. If set to null, only the trigger width applies. */
|
|
200
|
+
panelMinWidth?: KbqPanelMinWidth;
|
|
201
|
+
/**
|
|
202
|
+
* Maximum width of the panel. Caps growth by content only — it never overrides the trigger width or an
|
|
203
|
+
* explicit `panelWidth`. If null, the `--kbq-dropdown-size-container-width-max` token applies.
|
|
204
|
+
*/
|
|
205
|
+
panelMaxWidth?: KbqPanelMaxWidth;
|
|
122
206
|
}
|
|
123
207
|
/**
|
|
124
208
|
* Injection token used to provide the parent dropdown to dropdown-specific components.
|
|
@@ -134,29 +218,45 @@ declare function KBQ_DROPDOWN_DEFAULT_OPTIONS_FACTORY(): KbqDropdownDefaultOptio
|
|
|
134
218
|
* This directive is intended to be used inside an kbq-dropdown tag.
|
|
135
219
|
* It exists mostly to set the role attribute.
|
|
136
220
|
*/
|
|
137
|
-
declare class KbqDropdownItem implements KbqTitleTextRef, IFocusableOption,
|
|
221
|
+
declare class KbqDropdownItem implements KbqTitleTextRef, KbqDropdownItemActionHost, IFocusableOption, Highlightable, OnDestroy {
|
|
138
222
|
private elementRef;
|
|
139
223
|
private focusMonitor;
|
|
140
224
|
parentDropdownPanel?: KbqDropdownPanel | null | undefined;
|
|
141
225
|
textElement: ElementRef;
|
|
142
226
|
icon: KbqIcon;
|
|
227
|
+
/** Secondary, independently-focusable icon action projected into the item (e.g. a settings link). */
|
|
228
|
+
readonly itemAction: i0.Signal<KbqDropdownItemAction | undefined>;
|
|
143
229
|
get disabled(): boolean;
|
|
144
230
|
set disabled(value: boolean);
|
|
145
231
|
private _disabled;
|
|
232
|
+
/** Whether the dropdown item is in a loading state. */
|
|
233
|
+
readonly progress: i0.InputSignalWithTransform<boolean, unknown>;
|
|
146
234
|
/** Stream that emits when the dropdown item is hovered. */
|
|
147
235
|
readonly hovered: Subject<KbqDropdownItem>;
|
|
148
236
|
/** Stream that emits when the menu item is focused. */
|
|
149
237
|
readonly focused: Subject<KbqDropdownItem>;
|
|
150
238
|
/** Whether the dropdown item is highlighted. */
|
|
151
239
|
highlighted: boolean;
|
|
240
|
+
/** Whether the item is the panel's active item while DOM focus is held elsewhere. */
|
|
241
|
+
protected readonly active: i0.WritableSignal<boolean>;
|
|
152
242
|
/** Whether the dropdown item acts as a trigger for a nested dropdown. */
|
|
153
243
|
isNested: boolean;
|
|
154
244
|
/** @docs-private */
|
|
155
245
|
protected readonly componentColors: typeof KbqComponentColors;
|
|
156
|
-
|
|
246
|
+
constructor();
|
|
157
247
|
ngOnDestroy(): void;
|
|
158
248
|
resetStyles(): void;
|
|
159
|
-
/**
|
|
249
|
+
/** Styles the item as active without focusing it. */
|
|
250
|
+
setActiveStyles(): void;
|
|
251
|
+
/** Removes the styles applied by `setActiveStyles`. */
|
|
252
|
+
setInactiveStyles(): void;
|
|
253
|
+
/**
|
|
254
|
+
* Focuses the dropdown item and reveals it.
|
|
255
|
+
*
|
|
256
|
+
* The reveal is explicit because the one `focus()` performs implicitly is not portable: WebKit defers
|
|
257
|
+
* it to a later rendering update, where it lands after — and undoes — any scrolling the reader did in
|
|
258
|
+
* the meantime. `preventScroll` is therefore always forced on, overriding `options`.
|
|
259
|
+
*/
|
|
160
260
|
focus(origin?: FocusOrigin, options?: FocusOptions): void;
|
|
161
261
|
/** Returns the host DOM element. */
|
|
162
262
|
getHostElement(): HTMLElement;
|
|
@@ -166,15 +266,58 @@ declare class KbqDropdownItem implements KbqTitleTextRef, IFocusableOption, Afte
|
|
|
166
266
|
checkDisabled(event: Event): void;
|
|
167
267
|
/** Emits to the hover stream. Bound via `host` metadata. */
|
|
168
268
|
handleMouseEnter(): void;
|
|
269
|
+
/**
|
|
270
|
+
* Lets Tab move focus between the host and `itemAction` without leaving the dropdown
|
|
271
|
+
* (`stopPropagation` only — the browser's native focus move still happens). Any other Tab
|
|
272
|
+
* press, i.e. actually leaving the item, is left untouched and still closes the dropdown via
|
|
273
|
+
* the panel's `FocusKeyManager.tabOut`. Bound via `host` metadata.
|
|
274
|
+
*/
|
|
275
|
+
protected handleActionKeydown(event: KeyboardEvent): void;
|
|
169
276
|
/** Gets the label to be used when determining whether the option should be focused. */
|
|
170
277
|
getLabel(): string;
|
|
171
278
|
haltDisabledEvents(event: Event): void;
|
|
172
279
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqDropdownItem, never>;
|
|
173
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KbqDropdownItem, "kbq-dropdown-item, [kbq-dropdown-item]", ["kbqDropdownItem"], { "disabled": { "alias": "disabled"; "required": false; }; }, {}, ["icon"], ["[kbq-icon]", "*"], true, never>;
|
|
280
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KbqDropdownItem, "kbq-dropdown-item, [kbq-dropdown-item]", ["kbqDropdownItem"], { "disabled": { "alias": "disabled"; "required": false; }; "progress": { "alias": "progress"; "required": false; "isSignal": true; }; }, {}, ["itemAction", "icon"], ["[kbq-icon]", "*", "[kbqDropdownItemAction]"], true, never>;
|
|
174
281
|
static ngAcceptInputType_disabled: unknown;
|
|
175
282
|
}
|
|
176
283
|
|
|
177
|
-
/**
|
|
284
|
+
/**
|
|
285
|
+
* Marks a `kbq-form-field` projected into a `kbq-dropdown` as the panel's search field.
|
|
286
|
+
*
|
|
287
|
+
* The panel keeps DOM focus in the field, so arrow keys move the highlighted item while the query
|
|
288
|
+
* stays editable.
|
|
289
|
+
*/
|
|
290
|
+
declare class KbqDropdownSearch implements AfterContentInit {
|
|
291
|
+
private readonly formField;
|
|
292
|
+
/**
|
|
293
|
+
* Panel this field searches. A nested panel declared inside its parent's content shares the view with
|
|
294
|
+
* it, so the parent has to be able to tell which of the projected fields is its own.
|
|
295
|
+
* @docs-private
|
|
296
|
+
*/
|
|
297
|
+
readonly panel: KbqDropdownPanel | null;
|
|
298
|
+
/** The form control the query is bound to. */
|
|
299
|
+
get ngControl(): _angular_forms.NgControl | null;
|
|
300
|
+
ngAfterContentInit(): void;
|
|
301
|
+
/** Focuses the search field. */
|
|
302
|
+
focus(): void;
|
|
303
|
+
/** Clears the search query. */
|
|
304
|
+
reset(): void;
|
|
305
|
+
/** The current search query. */
|
|
306
|
+
value(): string;
|
|
307
|
+
/** @docs-private */
|
|
308
|
+
protected handleClick(event: MouseEvent): void;
|
|
309
|
+
/** @docs-private */
|
|
310
|
+
protected handleKeydown(event: KeyboardEvent): void;
|
|
311
|
+
/** Whether the key still has caret to travel inside the field, rather than acting on the panel. */
|
|
312
|
+
private movesCaret;
|
|
313
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KbqDropdownSearch, never>;
|
|
314
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqDropdownSearch, "[kbqDropdownSearch]", ["kbqDropdownSearch"], {}, {}, never, never, true, never>;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Injection token that determines the scroll handling while the dropdown is open. The root default keeps the
|
|
319
|
+
* trigger usable outside `KbqDropdownModule`'s injector; providing the token anywhere still wins over it.
|
|
320
|
+
*/
|
|
178
321
|
declare const KBQ_DROPDOWN_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
|
|
179
322
|
/** @docs-private */
|
|
180
323
|
declare function KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy;
|
|
@@ -201,7 +344,7 @@ declare const NESTED_PANEL_LEFT_PADDING = 8;
|
|
|
201
344
|
* This directive is intended to be used in conjunction with an kbq-dropdown tag. It is
|
|
202
345
|
* responsible for toggling the display of the provided dropdown instance.
|
|
203
346
|
*/
|
|
204
|
-
declare class KbqDropdownTrigger implements AfterContentInit, OnDestroy {
|
|
347
|
+
declare class KbqDropdownTrigger implements AfterContentInit, OnDestroy, KbqSiblingPopup {
|
|
205
348
|
private overlay;
|
|
206
349
|
private elementRef;
|
|
207
350
|
private viewContainerRef;
|
|
@@ -213,10 +356,16 @@ declare class KbqDropdownTrigger implements AfterContentInit, OnDestroy {
|
|
|
213
356
|
private focusMonitor;
|
|
214
357
|
private readonly overlayContainer;
|
|
215
358
|
private readonly renderer;
|
|
359
|
+
private readonly ngZone;
|
|
216
360
|
protected readonly isBrowser: boolean;
|
|
217
|
-
private readonly window;
|
|
218
361
|
private readonly host;
|
|
219
362
|
lastDestroyReason: DropdownCloseReason;
|
|
363
|
+
/**
|
|
364
|
+
* Element whose width the panel should match. Defaults to the trigger itself.
|
|
365
|
+
* Useful when the trigger is only a part of a larger control, e.g. `kbq-split-button`.
|
|
366
|
+
* @docs-private
|
|
367
|
+
*/
|
|
368
|
+
widthOrigin?: KbqPanelWidthOrigin;
|
|
220
369
|
/** Position offset of the dropdown in the X axis. */
|
|
221
370
|
offsetX: number;
|
|
222
371
|
/** Position offset of the dropdown in the Y axis. */
|
|
@@ -248,16 +397,27 @@ declare class KbqDropdownTrigger implements AfterContentInit, OnDestroy {
|
|
|
248
397
|
* KBQ_OPTION_ACTION_PARENT contract, which an `OutputEmitterRef` does not support — see #DS-5079.
|
|
249
398
|
*/
|
|
250
399
|
readonly dropdownClosed: EventEmitter<void>;
|
|
400
|
+
/** Emits `true` when the dropdown opens and `false` when it closes. Part of the `KbqSiblingPopup` contract. */
|
|
401
|
+
readonly openedChange: Observable<boolean>;
|
|
251
402
|
openedBy: Exclude<FocusOrigin, 'program' | null> | undefined;
|
|
252
403
|
/** The text direction of the containing app. */
|
|
253
404
|
get dir(): Direction;
|
|
254
405
|
/** Whether the dropdown is open. */
|
|
255
406
|
get opened(): boolean;
|
|
407
|
+
/**
|
|
408
|
+
* Whether the dropdown overlay is currently attached. Part of the `KbqSiblingPopup` contract.
|
|
409
|
+
*
|
|
410
|
+
* `opened` is set synchronously right after the overlay is attached and, on close, only once the exit
|
|
411
|
+
* animation is done — i.e. it stays `true` for the whole time the trigger is busy with its panel,
|
|
412
|
+
* including the moment `destroy()` restores focus to the trigger.
|
|
413
|
+
*/
|
|
414
|
+
get isAttached(): boolean;
|
|
256
415
|
private _opened;
|
|
257
416
|
private portal;
|
|
258
417
|
private overlayRef;
|
|
259
418
|
private closeSubscription;
|
|
260
419
|
private hoverSubscription;
|
|
420
|
+
private widthLockSubscription;
|
|
261
421
|
private classAddedToOverlayContainer;
|
|
262
422
|
constructor();
|
|
263
423
|
ngAfterContentInit(): void;
|
|
@@ -276,6 +436,11 @@ declare class KbqDropdownTrigger implements AfterContentInit, OnDestroy {
|
|
|
276
436
|
focus(origin?: FocusOrigin, options?: FocusOptions): void;
|
|
277
437
|
/** Handles mouse presses on the trigger. */
|
|
278
438
|
handleMousedown(event: MouseEvent): void;
|
|
439
|
+
/**
|
|
440
|
+
* Starts safe-area protection when the pointer leaves a trigger whose submenu is open, so a
|
|
441
|
+
* sibling item crossed on the way to the submenu doesn't prematurely close it.
|
|
442
|
+
*/
|
|
443
|
+
handleMouseLeave(event: MouseEvent): void;
|
|
279
444
|
/** Handles key presses on the trigger. */
|
|
280
445
|
handleKeydown(event: KeyboardEvent): void;
|
|
281
446
|
/** Handles click events on the trigger. */
|
|
@@ -303,6 +468,8 @@ declare class KbqDropdownTrigger implements AfterContentInit, OnDestroy {
|
|
|
303
468
|
* OverlayRef so that it can be attached to the DOM when open is called.
|
|
304
469
|
*/
|
|
305
470
|
private createOverlay;
|
|
471
|
+
/** Whether the panel should be at least as wide as its trigger. */
|
|
472
|
+
private get shouldMatchTriggerWidth();
|
|
306
473
|
/**
|
|
307
474
|
* This method builds the configuration object needed to create the overlay, the OverlayState.
|
|
308
475
|
* @returns OverlayConfig
|
|
@@ -328,7 +495,15 @@ declare class KbqDropdownTrigger implements AfterContentInit, OnDestroy {
|
|
|
328
495
|
private handleHover;
|
|
329
496
|
/** Gets the portal that should be attached to the overlay. */
|
|
330
497
|
private getPortal;
|
|
331
|
-
private
|
|
498
|
+
private getOverlaySize;
|
|
499
|
+
/**
|
|
500
|
+
* When the panel hosts a search field, its content-sized width would jump as the field's cleaner
|
|
501
|
+
* appears or options are filtered. Freeze the width at the opened (empty) state so it stays stable
|
|
502
|
+
* — mirrors `KbqAbstractSelect.lockOverlayWidthForSearch`.
|
|
503
|
+
*/
|
|
504
|
+
private lockOverlayWidthForSearch;
|
|
505
|
+
/** Freezes the overlay pane at its rendered width. */
|
|
506
|
+
private pinOverlayWidth;
|
|
332
507
|
private addClassToOverlayContainer;
|
|
333
508
|
private removeClassFromOverlayContainer;
|
|
334
509
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqDropdownTrigger, never>;
|
|
@@ -338,15 +513,39 @@ declare class KbqDropdownTrigger implements AfterContentInit, OnDestroy {
|
|
|
338
513
|
static ngAcceptInputType_demoteOverlay: unknown;
|
|
339
514
|
}
|
|
340
515
|
|
|
516
|
+
/**
|
|
517
|
+
* Grace period before switching to a different nested trigger hovered while a safe area is
|
|
518
|
+
* protecting the currently open submenu. Without it, sweeping the pointer down a long list of
|
|
519
|
+
* nested triggers on the way to the submenu would flicker each row's submenu open and closed.
|
|
520
|
+
*/
|
|
521
|
+
declare const NESTED_HOVER_SWITCH_DELAY = 50;
|
|
341
522
|
declare class KbqDropdownStaticContent {
|
|
342
523
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqDropdownStaticContent, never>;
|
|
343
524
|
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqDropdownStaticContent, "[kbqDropdownStaticContent]", never, {}, {}, never, never, true, never>;
|
|
344
525
|
}
|
|
526
|
+
/** Footer that is rendered below the dropdown options panel. */
|
|
527
|
+
declare class KbqDropdownFooter {
|
|
528
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KbqDropdownFooter, never>;
|
|
529
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqDropdownFooter, "[kbqDropdownFooter], kbq-dropdown-footer", never, {}, {}, never, never, true, never>;
|
|
530
|
+
}
|
|
345
531
|
declare class KbqDropdown implements AfterContentInit, KbqDropdownPanel, OnInit, OnDestroy {
|
|
346
532
|
private elementRef;
|
|
347
533
|
private ngZone;
|
|
534
|
+
private document;
|
|
348
535
|
private defaultOptions;
|
|
536
|
+
private readonly destroyRef;
|
|
537
|
+
private readonly panelFormField;
|
|
538
|
+
/**
|
|
539
|
+
* Signal content queries carry `descendants: true`, and a nested panel declared inside this one's
|
|
540
|
+
* content is part of the same view — so the match has to be narrowed to the fields this panel owns,
|
|
541
|
+
* the way `updateDirectDescendants` narrows the items.
|
|
542
|
+
*/
|
|
543
|
+
private readonly searches;
|
|
349
544
|
private readonly search;
|
|
545
|
+
/** Whether the dropdown projects a search form-field. @docs-private */
|
|
546
|
+
readonly hasSearch: Signal<boolean>;
|
|
547
|
+
/** Whether the panel highlights the active item instead of focusing it. @docs-private */
|
|
548
|
+
readonly inSearchMode: Signal<boolean>;
|
|
350
549
|
readonly navigationWithWrap: i0.InputSignal<boolean>;
|
|
351
550
|
/** Position of the dropdown in the X axis. */
|
|
352
551
|
get xPosition(): KbqDropdownPositionX;
|
|
@@ -375,6 +574,10 @@ declare class KbqDropdown implements AfterContentInit, KbqDropdownPanel, OnInit,
|
|
|
375
574
|
private _overlapTriggerX;
|
|
376
575
|
private _overlapTriggerY;
|
|
377
576
|
private _hasBackdrop;
|
|
577
|
+
/**
|
|
578
|
+
* @deprecated Has no effect. Use `KbqDropdownTrigger.widthOrigin` to make the panel match
|
|
579
|
+
* an element other than the trigger. Will be removed in v21.
|
|
580
|
+
*/
|
|
378
581
|
triggerWidth: string;
|
|
379
582
|
/** Config object to be passed into the dropdown panel's `[class]` binding */
|
|
380
583
|
classList: {
|
|
@@ -392,6 +595,35 @@ declare class KbqDropdown implements AfterContentInit, KbqDropdownPanel, OnInit,
|
|
|
392
595
|
direction: Direction;
|
|
393
596
|
/** Class to be added to the backdrop element. */
|
|
394
597
|
backdropClass: string;
|
|
598
|
+
/**
|
|
599
|
+
* Width of the panel. If set to `auto`, the panel will match the trigger width, but will never be
|
|
600
|
+
* narrower than `panelMinWidth`. If set to null, the panel will grow to match its content.
|
|
601
|
+
* Any other value is used as an exact width, and `panelMinWidth` is not applied.
|
|
602
|
+
*/
|
|
603
|
+
readonly panelWidth: i0.InputSignal<KbqPanelWidth>;
|
|
604
|
+
/**
|
|
605
|
+
* Minimum width of the panel in pixels. The panel is never narrower than this, nor than its trigger.
|
|
606
|
+
*/
|
|
607
|
+
readonly panelMinWidth: i0.InputSignalWithTransform<KbqPanelMinWidth, unknown>;
|
|
608
|
+
/**
|
|
609
|
+
* Maximum width of the panel in pixels. Caps how far the panel grows with its content — it never makes
|
|
610
|
+
* the panel narrower than the trigger, and never clamps an explicit `panelWidth`.
|
|
611
|
+
* When null, the `--kbq-dropdown-size-container-width-max` token applies.
|
|
612
|
+
*/
|
|
613
|
+
readonly panelMaxWidth: i0.InputSignalWithTransform<KbqPanelMaxWidth, unknown>;
|
|
614
|
+
/**
|
|
615
|
+
* Whether nested dropdowns opened from this dropdown's items use a "safe area": while the
|
|
616
|
+
* pointer moves from a trigger toward its open submenu, sibling items it crosses over on the way
|
|
617
|
+
* don't prematurely close the submenu.
|
|
618
|
+
*/
|
|
619
|
+
readonly safeArea: i0.InputSignalWithTransform<boolean, unknown>;
|
|
620
|
+
/**
|
|
621
|
+
* `panelMinWidth` rendered as a CSS length for the `--kbq-dropdown-size-container-width-min`
|
|
622
|
+
* token, so the panel's CSS `min-width` floor tracks the input — mirroring how `panelMaxWidth`
|
|
623
|
+
* drives `max-width`. Non-finite input (e.g. `null`) leaves the token's static default in place.
|
|
624
|
+
* @docs-private
|
|
625
|
+
*/
|
|
626
|
+
protected readonly panelMinWidthToken: Signal<string | null>;
|
|
395
627
|
/** @docs-private */
|
|
396
628
|
templateRef: TemplateRef<any>;
|
|
397
629
|
/**
|
|
@@ -407,28 +639,95 @@ declare class KbqDropdown implements AfterContentInit, KbqDropdownPanel, OnInit,
|
|
|
407
639
|
readonly closed: EventEmitter<void | "click" | "keydown" | "tab">;
|
|
408
640
|
private previousPanelClass;
|
|
409
641
|
private keyManager;
|
|
642
|
+
private activeDescendantKeyManager?;
|
|
643
|
+
private focusKeyManager?;
|
|
644
|
+
private focusOrigin;
|
|
410
645
|
/** Only the direct descendant menu items. */
|
|
411
646
|
private directDescendantItems;
|
|
412
647
|
/** Subscription to tab events on the dropdown panel */
|
|
413
648
|
private tabSubscription;
|
|
649
|
+
/** Cleans up the safe-area `mousemove` listener. `null` when no safe area is being tracked. */
|
|
650
|
+
private safeAreaCleanup;
|
|
651
|
+
/** The nested trigger currently protected by the active safe area, if any. */
|
|
652
|
+
private safeAreaOwner;
|
|
653
|
+
/**
|
|
654
|
+
* The most recently hovered item, tracked independently of the safe area so that leaving it
|
|
655
|
+
* straight onto a sibling's nested trigger can switch to it immediately instead of waiting for a
|
|
656
|
+
* `mouseenter` that already happened.
|
|
657
|
+
*/
|
|
658
|
+
private currentHovered;
|
|
659
|
+
/** Emits when the pointer reaches the panel the active safe area protects. */
|
|
660
|
+
private readonly panelReached;
|
|
661
|
+
/** Emits the sibling trigger that should open once a forced switch has closed the current one. */
|
|
662
|
+
private readonly switchTarget;
|
|
663
|
+
/** Watches for a forced switch to a sibling trigger while a safe area is active. */
|
|
664
|
+
private switchTargetSubscription;
|
|
665
|
+
constructor();
|
|
414
666
|
ngOnInit(): void;
|
|
415
667
|
ngAfterContentInit(): void;
|
|
416
668
|
ngOnDestroy(): void;
|
|
417
669
|
/** Stream that emits whenever the hovered dropdown item changes. */
|
|
418
670
|
hovered(): Observable<KbqDropdownItem>;
|
|
671
|
+
/**
|
|
672
|
+
* Tracks the pointer against `triangle` to protect `owner`'s open submenu, closing it via
|
|
673
|
+
* `onExit` if the pointer leaves the triangle without first reaching `panelRect`. Meanwhile, if a
|
|
674
|
+
* different nested trigger is hovered, `switchTarget()` emits it — immediately if it's outside
|
|
675
|
+
* the triangle, otherwise after a grace period (see `NESTED_HOVER_SWITCH_DELAY`). Replaces any
|
|
676
|
+
* safe area already being tracked.
|
|
677
|
+
* @docs-private
|
|
678
|
+
*/
|
|
679
|
+
activateSafeArea(owner: KbqDropdownItem, triangle: KbqTriangle, panelRect: DOMRect, onExit: () => void): void;
|
|
680
|
+
/**
|
|
681
|
+
* Stops tracking the current safe area, if any.
|
|
682
|
+
* @docs-private
|
|
683
|
+
*/
|
|
684
|
+
deactivateSafeArea(): void;
|
|
685
|
+
/**
|
|
686
|
+
* Whether a safe area is currently being tracked.
|
|
687
|
+
* @docs-private
|
|
688
|
+
*/
|
|
689
|
+
isSafeAreaActive(): boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Whether `item` is the nested trigger currently protected by an active safe area.
|
|
692
|
+
* @docs-private
|
|
693
|
+
*/
|
|
694
|
+
isSafeAreaOwner(item: KbqDropdownItem): boolean;
|
|
695
|
+
/**
|
|
696
|
+
* Stream that emits when the pointer reaches the panel the active safe area protects (as opposed
|
|
697
|
+
* to leaving the safe area, which closes the panel instead).
|
|
698
|
+
* @docs-private
|
|
699
|
+
*/
|
|
700
|
+
onPanelReached(): Observable<void>;
|
|
701
|
+
/**
|
|
702
|
+
* Stream that emits the sibling trigger that should open once a forced safe-area switch has
|
|
703
|
+
* closed the trigger it was protecting.
|
|
704
|
+
* @docs-private
|
|
705
|
+
*/
|
|
706
|
+
onSwitchTarget(): Observable<KbqDropdownItem>;
|
|
419
707
|
/** Handle a keyboard event from the dropdown, delegating to the appropriate action. */
|
|
420
708
|
handleKeydown(event: KeyboardEvent): void;
|
|
421
709
|
/**
|
|
422
|
-
*
|
|
710
|
+
* Applies the panel's initial focus, see `applyInitialFocus`.
|
|
423
711
|
* @param origin Action from which the focus originated. Used to set the correct styling.
|
|
424
712
|
*/
|
|
425
713
|
focusFirstItem(origin?: FocusOrigin): void;
|
|
426
714
|
/**
|
|
427
|
-
* Applies focus when the dropdown is opened.
|
|
428
|
-
*
|
|
429
|
-
*
|
|
715
|
+
* Applies focus when the dropdown is opened.
|
|
716
|
+
*
|
|
717
|
+
* A projected search field takes the caret for every origin and keeps it: the first arrow key press
|
|
718
|
+
* only highlights an item. Without one, opening by mouse or touch focuses the panel rather than an
|
|
719
|
+
* item, so that nothing is highlighted while keyboard events still reach the panel; any other origin
|
|
720
|
+
* highlights the first item. A submenu of a search panel focuses nothing at all, so that hovering it
|
|
721
|
+
* does not pull the caret out of the query.
|
|
430
722
|
*/
|
|
431
723
|
private applyInitialFocus;
|
|
724
|
+
/**
|
|
725
|
+
* Moves focus back into the projected search field, reporting whether there was one. A nested panel
|
|
726
|
+
* restores focus through this instead of onto its trigger item, which would strand the caret outside
|
|
727
|
+
* the query.
|
|
728
|
+
* @docs-private
|
|
729
|
+
*/
|
|
730
|
+
restoreFocus(): boolean;
|
|
432
731
|
/** Moves DOM focus onto the dropdown panel so that keydown events keep being handled. */
|
|
433
732
|
private focusPanel;
|
|
434
733
|
/**
|
|
@@ -452,6 +751,21 @@ declare class KbqDropdown implements AfterContentInit, KbqDropdownPanel, OnInit,
|
|
|
452
751
|
onAnimationDone(event: AnimationEvent): void;
|
|
453
752
|
onAnimationStart(event: AnimationEvent): void;
|
|
454
753
|
close(): void;
|
|
754
|
+
/**
|
|
755
|
+
* With a search field the caret has to stay in the input, so the active item is only highlighted and
|
|
756
|
+
* typeahead is left off — it would race the query the user is typing.
|
|
757
|
+
*/
|
|
758
|
+
private initKeyManager;
|
|
759
|
+
/** Which mode the installed key manager serves; the wanted one is `inSearchMode()`. */
|
|
760
|
+
private keyManagerInstalledForSearch;
|
|
761
|
+
private configureKeyManager;
|
|
762
|
+
private setFocusOrigin;
|
|
763
|
+
private isActiveItemStale;
|
|
764
|
+
/**
|
|
765
|
+
* Reveals the highlighted item, which the browser only does on its own for real focus. Mirrors the
|
|
766
|
+
* reveal `kbqFocusAndReveal` performs for focused elements.
|
|
767
|
+
*/
|
|
768
|
+
private revealActiveItem;
|
|
455
769
|
/**
|
|
456
770
|
* Sets up a stream that will keep track of any newly-added menu items and will update the list
|
|
457
771
|
* of direct descendants. We collect the descendants this way, because `items` can include
|
|
@@ -460,14 +774,14 @@ declare class KbqDropdown implements AfterContentInit, KbqDropdownPanel, OnInit,
|
|
|
460
774
|
*/
|
|
461
775
|
private updateDirectDescendants;
|
|
462
776
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqDropdown, never>;
|
|
463
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KbqDropdown, "kbq-dropdown", ["kbqDropdown"], { "navigationWithWrap": { "alias": "navigationWithWrap"; "required": false; "isSignal": true; }; "xPosition": { "alias": "xPosition"; "required": false; }; "yPosition": { "alias": "yPosition"; "required": false; }; "overlapTriggerY": { "alias": "overlapTriggerY"; "required": false; }; "overlapTriggerX": { "alias": "overlapTriggerX"; "required": false; }; "hasBackdrop": { "alias": "hasBackdrop"; "required": false; }; "panelClass": { "alias": "class"; "required": false; }; "backdropClass": { "alias": "backdropClass"; "required": false; }; }, { "closed": "closed"; }, ["
|
|
777
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KbqDropdown, "kbq-dropdown", ["kbqDropdown"], { "navigationWithWrap": { "alias": "navigationWithWrap"; "required": false; "isSignal": true; }; "xPosition": { "alias": "xPosition"; "required": false; }; "yPosition": { "alias": "yPosition"; "required": false; }; "overlapTriggerY": { "alias": "overlapTriggerY"; "required": false; }; "overlapTriggerX": { "alias": "overlapTriggerX"; "required": false; }; "hasBackdrop": { "alias": "hasBackdrop"; "required": false; }; "panelClass": { "alias": "class"; "required": false; }; "backdropClass": { "alias": "backdropClass"; "required": false; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "panelMinWidth": { "alias": "panelMinWidth"; "required": false; "isSignal": true; }; "panelMaxWidth": { "alias": "panelMaxWidth"; "required": false; "isSignal": true; }; "safeArea": { "alias": "safeArea"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, ["panelFormField", "searches", "lazyContent", "items"], ["*", "[kbqDropdownFooter], kbq-dropdown-footer", "[kbqDropdownStaticContent]"], true, never>;
|
|
464
778
|
}
|
|
465
779
|
|
|
466
780
|
declare class KbqDropdownModule {
|
|
467
781
|
static ɵfac: i0.ɵɵFactoryDeclaration<KbqDropdownModule, never>;
|
|
468
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<KbqDropdownModule, never, [typeof i1.OverlayModule, typeof i2.KbqIconModule, typeof KbqDropdownStaticContent, typeof KbqDropdown, typeof KbqDropdownItem, typeof KbqDropdownTrigger, typeof KbqDropdownContent], [typeof KbqDropdown, typeof KbqDropdownItem, typeof KbqDropdownTrigger, typeof KbqDropdownContent, typeof KbqDropdownStaticContent]>;
|
|
782
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<KbqDropdownModule, never, [typeof i1.OverlayModule, typeof i2.KbqIconModule, typeof KbqDropdownStaticContent, typeof KbqDropdown, typeof KbqDropdownItem, typeof KbqDropdownItemAction, typeof KbqDropdownTrigger, typeof KbqDropdownContent, typeof KbqDropdownFooter, typeof KbqDropdownSearch], [typeof KbqDropdown, typeof KbqDropdownItem, typeof KbqDropdownItemAction, typeof KbqDropdownTrigger, typeof KbqDropdownContent, typeof KbqDropdownStaticContent, typeof KbqDropdownFooter, typeof KbqDropdownSearch]>;
|
|
469
783
|
static ɵinj: i0.ɵɵInjectorDeclaration<KbqDropdownModule>;
|
|
470
784
|
}
|
|
471
785
|
|
|
472
|
-
export { KBQ_DROPDOWN_DEFAULT_OPTIONS, KBQ_DROPDOWN_DEFAULT_OPTIONS_FACTORY, KBQ_DROPDOWN_HOST, KBQ_DROPDOWN_PANEL, KBQ_DROPDOWN_SCROLL_STRATEGY, KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY, KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER, KbqDropdown, KbqDropdownContent, KbqDropdownItem, KbqDropdownModule, KbqDropdownStaticContent, KbqDropdownTrigger, NESTED_PANEL_LEFT_PADDING, NESTED_PANEL_TOP_PADDING, fadeInItems, kbqDropdownAnimations, throwKbqDropdownInvalidPositionX, throwKbqDropdownInvalidPositionY, throwKbqDropdownMissingError, transformDropdown };
|
|
786
|
+
export { KBQ_DROPDOWN_DEFAULT_OPTIONS, KBQ_DROPDOWN_DEFAULT_OPTIONS_FACTORY, KBQ_DROPDOWN_HOST, KBQ_DROPDOWN_PANEL, KBQ_DROPDOWN_SCROLL_STRATEGY, KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY, KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER, KbqDropdown, KbqDropdownContent, KbqDropdownFooter, KbqDropdownItem, KbqDropdownItemAction, KbqDropdownModule, KbqDropdownSearch, KbqDropdownStaticContent, KbqDropdownTrigger, NESTED_HOVER_SWITCH_DELAY, NESTED_PANEL_LEFT_PADDING, NESTED_PANEL_TOP_PADDING, fadeInItems, kbqDropdownAnimations, throwKbqDropdownInvalidPositionX, throwKbqDropdownInvalidPositionY, throwKbqDropdownMissingError, throwKbqDropdownSearchMissingInputError, throwKbqDropdownSearchMissingNgControlError, transformDropdown };
|
|
473
787
|
export type { DropdownCloseReason, DropdownPositionX, DropdownPositionY, KbqDropdownDefaultOptions, KbqDropdownPanel, KbqDropdownPositionX, KbqDropdownPositionY };
|