@angular/cdk-experimental 21.0.0-next.5 → 21.0.0-next.6
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/fesm2022/{accordion2.mjs → _accordion-chunk.mjs} +4 -3
- package/fesm2022/_accordion-chunk.mjs.map +1 -0
- package/fesm2022/_combobox-chunk.mjs +278 -0
- package/fesm2022/_combobox-chunk.mjs.map +1 -0
- package/fesm2022/{option.mjs → _combobox-listbox-chunk.mjs} +55 -8
- package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -0
- package/fesm2022/_combobox-tree-chunk.mjs +398 -0
- package/fesm2022/_combobox-tree-chunk.mjs.map +1 -0
- package/fesm2022/{expansion.mjs → _expansion-chunk.mjs} +2 -2
- package/fesm2022/_expansion-chunk.mjs.map +1 -0
- package/fesm2022/{list.mjs → _list-chunk.mjs} +9 -5
- package/fesm2022/_list-chunk.mjs.map +1 -0
- package/fesm2022/_list-navigation-chunk.mjs +131 -0
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -0
- package/fesm2022/{list-navigation.mjs → _pointer-event-manager-chunk.mjs} +2 -118
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -0
- package/fesm2022/{polyfill.mjs → _polyfill-chunk.mjs} +1 -1
- package/fesm2022/_polyfill-chunk.mjs.map +1 -0
- package/fesm2022/{tabs2.mjs → _tabs-chunk.mjs} +4 -4
- package/fesm2022/_tabs-chunk.mjs.map +1 -0
- package/fesm2022/_toolbar-chunk.mjs +273 -0
- package/fesm2022/_toolbar-chunk.mjs.map +1 -0
- package/fesm2022/_toolbar-radio-group-chunk.mjs +222 -0
- package/fesm2022/_toolbar-radio-group-chunk.mjs.map +1 -0
- package/fesm2022/accordion.mjs +4 -3
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +1 -1
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +99 -308
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs +3 -3
- package/fesm2022/deferred-content.mjs.map +1 -1
- package/fesm2022/listbox.mjs +53 -12
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/popover-edit.mjs +1 -1
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/radio-group.mjs +42 -47
- package/fesm2022/radio-group.mjs.map +1 -1
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/tabs.mjs +5 -4
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +69 -19
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +57 -344
- package/fesm2022/tree.mjs.map +1 -1
- package/fesm2022/ui-patterns.mjs +11 -8
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/package.json +18 -18
- package/{accordion.d.d.ts → types/_accordion-chunk.d.ts} +3 -2
- package/types/_combobox-chunk.d.ts +138 -0
- package/{expansion.d.d.ts → types/_expansion-chunk.d.ts} +2 -2
- package/{list.d.d.ts → types/_list-chunk.d.ts} +4 -2
- package/{pointer-event-manager.d.d.ts → types/_list-navigation-chunk.d.ts} +7 -96
- package/{listbox.d.d.ts → types/_listbox-chunk.d.ts} +8 -4
- package/types/_pointer-event-manager-chunk.d.ts +98 -0
- package/types/_radio-group-chunk.d.ts +92 -0
- package/{tabs.d.d.ts → types/_tabs-chunk.d.ts} +4 -3
- package/types/_toolbar-chunk.d.ts +150 -0
- package/types/_tree-chunk.d.ts +139 -0
- package/{accordion/index.d.ts → types/accordion.d.ts} +4 -3
- package/types/combobox.d.ts +54 -0
- package/{deferred-content/index.d.ts → types/deferred-content.d.ts} +2 -2
- package/{listbox/index.d.ts → types/listbox.d.ts} +15 -5
- package/{radio-group/index.d.ts → types/radio-group.d.ts} +21 -23
- package/{tabs/index.d.ts → types/tabs.d.ts} +5 -4
- package/types/toolbar.d.ts +115 -0
- package/{tree/index.d.ts → types/tree.d.ts} +17 -137
- package/types/ui-patterns.d.ts +157 -0
- package/combobox/index.d.ts +0 -94
- package/fesm2022/accordion2.mjs.map +0 -1
- package/fesm2022/expansion.mjs.map +0 -1
- package/fesm2022/list-navigation.mjs.map +0 -1
- package/fesm2022/list.mjs.map +0 -1
- package/fesm2022/option.mjs.map +0 -1
- package/fesm2022/polyfill.mjs.map +0 -1
- package/fesm2022/radio-group2.mjs +0 -143
- package/fesm2022/radio-group2.mjs.map +0 -1
- package/fesm2022/tabs2.mjs.map +0 -1
- package/fesm2022/toolbar2.mjs +0 -224
- package/fesm2022/toolbar2.mjs.map +0 -1
- package/radio-group.d.d.ts +0 -80
- package/toolbar/index.d.ts +0 -91
- package/toolbar.d.d.ts +0 -136
- package/ui-patterns/index.d.ts +0 -9
- /package/{index.d.ts → types/cdk-experimental.d.ts} +0 -0
- /package/{column-resize/index.d.ts → types/column-resize.d.ts} +0 -0
- /package/{popover-edit/index.d.ts → types/popover-edit.d.ts} +0 -0
- /package/{scrolling/index.d.ts → types/scrolling.d.ts} +0 -0
- /package/{selection/index.d.ts → types/selection.d.ts} +0 -0
- /package/{table-scroll-container/index.d.ts → types/table-scroll-container.d.ts} +0 -0
package/fesm2022/combobox.mjs
CHANGED
|
@@ -1,340 +1,131 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { _getEventTarget } from '@angular/cdk/platform';
|
|
8
|
-
import { TemplatePortal } from '@angular/cdk/portal';
|
|
9
|
-
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
2
|
+
import { inject, ElementRef, contentChild, input, signal, afterRenderEffect, Directive, model, untracked } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/cdk-experimental/deferred-content';
|
|
4
|
+
import { DeferredContentAware, DeferredContent } from '@angular/cdk-experimental/deferred-content';
|
|
5
|
+
import { ComboboxPattern } from './_combobox-chunk.mjs';
|
|
6
|
+
import './_pointer-event-manager-chunk.mjs';
|
|
10
7
|
|
|
11
|
-
const allowedOpenActions = ['focus', 'click', 'downKey', 'toggle'];
|
|
12
|
-
const CDK_COMBOBOX = new InjectionToken('CDK_COMBOBOX');
|
|
13
8
|
class CdkCombobox {
|
|
14
|
-
|
|
9
|
+
/** The element that the combobox is attached to. */
|
|
15
10
|
_elementRef = inject(ElementRef);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
value
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
get autoSetText() {
|
|
41
|
-
return this._autoSetText;
|
|
42
|
-
}
|
|
43
|
-
set autoSetText(value) {
|
|
44
|
-
this._autoSetText = coerceBooleanProperty(value);
|
|
45
|
-
}
|
|
46
|
-
_autoSetText = true;
|
|
47
|
-
opened = new EventEmitter();
|
|
48
|
-
closed = new EventEmitter();
|
|
49
|
-
panelValueChanged = new EventEmitter();
|
|
50
|
-
contentId = '';
|
|
51
|
-
contentType;
|
|
52
|
-
ngOnDestroy() {
|
|
53
|
-
if (this._overlayRef) {
|
|
54
|
-
this._overlayRef.dispose();
|
|
55
|
-
}
|
|
56
|
-
this.opened.complete();
|
|
57
|
-
this.closed.complete();
|
|
58
|
-
this.panelValueChanged.complete();
|
|
59
|
-
}
|
|
60
|
-
_keydown(event) {
|
|
61
|
-
const { keyCode } = event;
|
|
62
|
-
if (keyCode === DOWN_ARROW) {
|
|
63
|
-
if (this.isOpen()) {
|
|
64
|
-
// TODO: instead of using a focus function, potentially use cdk/a11y focus trapping
|
|
65
|
-
this._doc.getElementById(this.contentId)?.focus();
|
|
66
|
-
}
|
|
67
|
-
else if (this._openActions.indexOf('downKey') !== -1) {
|
|
68
|
-
this.open();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else if (keyCode === ENTER) {
|
|
72
|
-
if (this._openActions.indexOf('toggle') !== -1) {
|
|
73
|
-
this.toggle();
|
|
74
|
-
}
|
|
75
|
-
else if (this._openActions.indexOf('click') !== -1) {
|
|
76
|
-
this.open();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
else if (keyCode === ESCAPE) {
|
|
80
|
-
event.preventDefault();
|
|
81
|
-
this.close();
|
|
82
|
-
}
|
|
83
|
-
else if (keyCode === TAB) {
|
|
84
|
-
this.close();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/** Handles click or focus interactions. */
|
|
88
|
-
_handleInteractions(interaction) {
|
|
89
|
-
if (interaction === 'click') {
|
|
90
|
-
if (this._openActions.indexOf('toggle') !== -1) {
|
|
91
|
-
this.toggle();
|
|
92
|
-
}
|
|
93
|
-
else if (this._openActions.indexOf('click') !== -1) {
|
|
94
|
-
this.open();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
else if (interaction === 'focus') {
|
|
98
|
-
if (this._openActions.indexOf('focus') !== -1) {
|
|
99
|
-
this.open();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/** Given a click in the document, determines if the click was inside a combobox. */
|
|
104
|
-
_attemptClose(event) {
|
|
105
|
-
if (this.isOpen()) {
|
|
106
|
-
let target = _getEventTarget(event);
|
|
107
|
-
while (target instanceof Element) {
|
|
108
|
-
if (target.className.indexOf('cdk-combobox') !== -1) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
target = target.parentElement;
|
|
11
|
+
/** The DeferredContentAware host directive. */
|
|
12
|
+
_deferredContentAware = inject(DeferredContentAware, { optional: true });
|
|
13
|
+
/** The combobox popup. */
|
|
14
|
+
popup = contentChild(CdkComboboxPopup, ...(ngDevMode ? [{ debugName: "popup" }] : []));
|
|
15
|
+
/** The filter mode for the combobox. */
|
|
16
|
+
filterMode = input('manual', ...(ngDevMode ? [{ debugName: "filterMode" }] : []));
|
|
17
|
+
/** Whether the combobox is focused. */
|
|
18
|
+
isFocused = signal(false, ...(ngDevMode ? [{ debugName: "isFocused" }] : []));
|
|
19
|
+
/** The value of the first matching item in the popup. */
|
|
20
|
+
firstMatch = input(undefined, ...(ngDevMode ? [{ debugName: "firstMatch" }] : []));
|
|
21
|
+
/** Whether the listbox has received focus yet. */
|
|
22
|
+
_hasBeenFocused = signal(false, ...(ngDevMode ? [{ debugName: "_hasBeenFocused" }] : []));
|
|
23
|
+
/** The combobox ui pattern. */
|
|
24
|
+
pattern = new ComboboxPattern({
|
|
25
|
+
...this,
|
|
26
|
+
inputValue: signal(''),
|
|
27
|
+
inputEl: signal(undefined),
|
|
28
|
+
containerEl: () => this._elementRef.nativeElement,
|
|
29
|
+
popupControls: () => this.popup()?.controls(),
|
|
30
|
+
});
|
|
31
|
+
constructor() {
|
|
32
|
+
afterRenderEffect(() => {
|
|
33
|
+
if (!this._deferredContentAware?.contentVisible() && this.pattern.isFocused()) {
|
|
34
|
+
this._deferredContentAware?.contentVisible.set(true);
|
|
112
35
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
toggle() {
|
|
118
|
-
if (this.hasPanel()) {
|
|
119
|
-
this.isOpen() ? this.close() : this.open();
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/** If the combobox is closed and not disabled, opens the panel. */
|
|
123
|
-
open() {
|
|
124
|
-
if (!this.isOpen() && !this.disabled) {
|
|
125
|
-
this.opened.next();
|
|
126
|
-
this._overlayRef =
|
|
127
|
-
this._overlayRef || createOverlayRef(this._injector, this._getOverlayConfig());
|
|
128
|
-
this._overlayRef.attach(this._getPanelContent());
|
|
129
|
-
this._changeDetectorRef.markForCheck();
|
|
130
|
-
if (!this._isTextTrigger()) {
|
|
131
|
-
// TODO: instead of using a focus function, potentially use cdk/a11y focus trapping
|
|
132
|
-
this._doc.getElementById(this.contentId)?.focus();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
/** If the combobox is open and not disabled, closes the panel. */
|
|
137
|
-
close() {
|
|
138
|
-
if (this.isOpen() && !this.disabled) {
|
|
139
|
-
this.closed.next();
|
|
140
|
-
this._overlayRef.detach();
|
|
141
|
-
this._changeDetectorRef.markForCheck();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
/** Returns true if panel is currently opened. */
|
|
145
|
-
isOpen() {
|
|
146
|
-
return this._overlayRef ? this._overlayRef.hasAttached() : false;
|
|
147
|
-
}
|
|
148
|
-
/** Returns true if combobox has a child panel. */
|
|
149
|
-
hasPanel() {
|
|
150
|
-
return !!this._panelTemplateRef;
|
|
151
|
-
}
|
|
152
|
-
_getTabIndex() {
|
|
153
|
-
return this.disabled ? null : '0';
|
|
154
|
-
}
|
|
155
|
-
_setComboboxValue(value) {
|
|
156
|
-
const valueChanged = this.value !== value;
|
|
157
|
-
this.value = value;
|
|
158
|
-
if (valueChanged) {
|
|
159
|
-
this.panelValueChanged.emit(coerceArray(value));
|
|
160
|
-
if (this._autoSetText) {
|
|
161
|
-
this._setTextContent(value);
|
|
36
|
+
});
|
|
37
|
+
afterRenderEffect(() => {
|
|
38
|
+
if (!this._hasBeenFocused() && this.pattern.isFocused()) {
|
|
39
|
+
this._hasBeenFocused.set(true);
|
|
162
40
|
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
updateAndClose(value) {
|
|
166
|
-
this._setComboboxValue(value);
|
|
167
|
-
this.close();
|
|
168
|
-
}
|
|
169
|
-
_setTextContent(content) {
|
|
170
|
-
const contentArray = coerceArray(content);
|
|
171
|
-
this._elementRef.nativeElement.textContent = contentArray.join(' ');
|
|
172
|
-
}
|
|
173
|
-
_isTextTrigger() {
|
|
174
|
-
// TODO: Should check if the trigger is contenteditable.
|
|
175
|
-
const tagName = this._tagName.toLowerCase();
|
|
176
|
-
return tagName === 'input' || tagName === 'textarea';
|
|
177
|
-
}
|
|
178
|
-
_getOverlayConfig() {
|
|
179
|
-
return new OverlayConfig({
|
|
180
|
-
positionStrategy: this._getOverlayPositionStrategy(),
|
|
181
|
-
scrollStrategy: createBlockScrollStrategy(this._injector),
|
|
182
|
-
direction: this._directionality || undefined,
|
|
183
41
|
});
|
|
184
42
|
}
|
|
185
|
-
_getOverlayPositionStrategy() {
|
|
186
|
-
return createFlexibleConnectedPositionStrategy(this._injector, this._elementRef).withPositions(this._getOverlayPositions());
|
|
187
|
-
}
|
|
188
|
-
_getOverlayPositions() {
|
|
189
|
-
return [
|
|
190
|
-
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
|
|
191
|
-
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
|
|
192
|
-
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },
|
|
193
|
-
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
|
|
194
|
-
];
|
|
195
|
-
}
|
|
196
|
-
_getPanelInjector() {
|
|
197
|
-
return this._injector;
|
|
198
|
-
}
|
|
199
|
-
_getPanelContent() {
|
|
200
|
-
const hasPanelChanged = this._panelTemplateRef !== this._panelPortal?.templateRef;
|
|
201
|
-
if (this._panelTemplateRef && (!this._panelPortal || hasPanelChanged)) {
|
|
202
|
-
this._panelPortal = new TemplatePortal(this._panelTemplateRef, this._viewContainerRef, undefined, this._getPanelInjector());
|
|
203
|
-
}
|
|
204
|
-
return this._panelPortal;
|
|
205
|
-
}
|
|
206
|
-
_coerceOpenActionProperty(input) {
|
|
207
|
-
let actions = typeof input === 'string' ? input.trim().split(/[ ,]+/) : input;
|
|
208
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
209
|
-
actions?.some(a => allowedOpenActions.indexOf(a) === -1)) {
|
|
210
|
-
throw Error(`${input} is not a support open action for CdkCombobox`);
|
|
211
|
-
}
|
|
212
|
-
return actions;
|
|
213
|
-
}
|
|
214
|
-
/** Registers the content's id and the content type with the panel. */
|
|
215
|
-
_registerContent(contentId, contentType) {
|
|
216
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
217
|
-
contentType !== 'listbox' &&
|
|
218
|
-
contentType !== 'dialog') {
|
|
219
|
-
throw Error('CdkComboboxPanel currently only supports listbox or dialog content.');
|
|
220
|
-
}
|
|
221
|
-
this.contentId = contentId;
|
|
222
|
-
this.contentType = contentType;
|
|
223
|
-
}
|
|
224
43
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkCombobox, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
225
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
44
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.2.0-next.2", type: CdkCombobox, isStandalone: true, selector: "[cdkCombobox]", inputs: { filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, firstMatch: { classPropertyName: "firstMatch", publicName: "firstMatch", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "pattern.onInput($event)", "keydown": "pattern.onKeydown($event)", "pointerup": "pattern.onPointerup($event)", "focusin": "pattern.onFocusIn()", "focusout": "pattern.onFocusOut($event)" }, properties: { "attr.data-expanded": "pattern.expanded()" } }, queries: [{ propertyName: "popup", first: true, predicate: CdkComboboxPopup, descendants: true, isSignal: true }], exportAs: ["cdkCombobox"], hostDirectives: [{ directive: i1.DeferredContentAware, inputs: ["preserveContent", "preserveContent"] }], ngImport: i0 });
|
|
226
45
|
}
|
|
227
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkCombobox, decorators: [{
|
|
228
47
|
type: Directive,
|
|
229
48
|
args: [{
|
|
230
49
|
selector: '[cdkCombobox]',
|
|
231
50
|
exportAs: 'cdkCombobox',
|
|
51
|
+
hostDirectives: [
|
|
52
|
+
{
|
|
53
|
+
directive: DeferredContentAware,
|
|
54
|
+
inputs: ['preserveContent'],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
232
57
|
host: {
|
|
233
|
-
'
|
|
234
|
-
'
|
|
235
|
-
'(
|
|
236
|
-
'(
|
|
237
|
-
'(
|
|
238
|
-
'(
|
|
239
|
-
'[attr.aria-disabled]': 'disabled',
|
|
240
|
-
'[attr.aria-owns]': 'contentId',
|
|
241
|
-
'[attr.aria-haspopup]': 'contentType',
|
|
242
|
-
'[attr.aria-expanded]': 'isOpen()',
|
|
243
|
-
'[attr.tabindex]': '_getTabIndex()',
|
|
58
|
+
'[attr.data-expanded]': 'pattern.expanded()',
|
|
59
|
+
'(input)': 'pattern.onInput($event)',
|
|
60
|
+
'(keydown)': 'pattern.onKeydown($event)',
|
|
61
|
+
'(pointerup)': 'pattern.onPointerup($event)',
|
|
62
|
+
'(focusin)': 'pattern.onFocusIn()',
|
|
63
|
+
'(focusout)': 'pattern.onFocusOut($event)',
|
|
244
64
|
},
|
|
245
|
-
providers: [{ provide: CDK_COMBOBOX, useExisting: CdkCombobox }],
|
|
246
65
|
}]
|
|
247
|
-
}],
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}], value: [{
|
|
251
|
-
type: Input
|
|
252
|
-
}], disabled: [{
|
|
253
|
-
type: Input
|
|
254
|
-
}], openActions: [{
|
|
255
|
-
type: Input
|
|
256
|
-
}], autoSetText: [{
|
|
257
|
-
type: Input
|
|
258
|
-
}], opened: [{
|
|
259
|
-
type: Output,
|
|
260
|
-
args: ['comboboxPanelOpened']
|
|
261
|
-
}], closed: [{
|
|
262
|
-
type: Output,
|
|
263
|
-
args: ['comboboxPanelClosed']
|
|
264
|
-
}], panelValueChanged: [{
|
|
265
|
-
type: Output,
|
|
266
|
-
args: ['panelValueChanged']
|
|
267
|
-
}] } });
|
|
268
|
-
|
|
269
|
-
class CdkComboboxPopup {
|
|
66
|
+
}], ctorParameters: () => [] });
|
|
67
|
+
class CdkComboboxInput {
|
|
68
|
+
/** The element that the combobox is attached to. */
|
|
270
69
|
_elementRef = inject(ElementRef);
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
this.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
this._firstFocusElement = id;
|
|
284
|
-
}
|
|
285
|
-
_firstFocusElement;
|
|
286
|
-
id = inject(_IdGenerator).getId('cdk-combobox-popup-');
|
|
287
|
-
ngOnInit() {
|
|
288
|
-
this.registerWithPanel();
|
|
289
|
-
}
|
|
290
|
-
registerWithPanel() {
|
|
291
|
-
this._combobox._registerContent(this.id, this._role);
|
|
292
|
-
}
|
|
293
|
-
focusFirstElement() {
|
|
294
|
-
if (this._firstFocusElement) {
|
|
295
|
-
this._firstFocusElement.focus();
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
this._elementRef.nativeElement.focus();
|
|
299
|
-
}
|
|
70
|
+
/** The combobox that the input belongs to. */
|
|
71
|
+
combobox = inject(CdkCombobox);
|
|
72
|
+
/** The value of the input. */
|
|
73
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
74
|
+
constructor() {
|
|
75
|
+
this.combobox.pattern.inputs.inputEl.set(this._elementRef.nativeElement);
|
|
76
|
+
this.combobox.pattern.inputs.inputValue = this.value;
|
|
77
|
+
/** Focuses & selects the first item in the combobox if the user changes the input value. */
|
|
78
|
+
afterRenderEffect(() => {
|
|
79
|
+
this.combobox.popup()?.controls()?.items();
|
|
80
|
+
untracked(() => this.combobox.pattern.onFilter());
|
|
81
|
+
});
|
|
300
82
|
}
|
|
301
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type:
|
|
302
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
84
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0-next.2", type: CdkComboboxInput, isStandalone: true, selector: "input[cdkComboboxInput]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "combobox" }, properties: { "value": "value()", "attr.aria-expanded": "combobox.pattern.expanded()", "attr.aria-activedescendant": "combobox.pattern.activedescendant()", "attr.aria-controls": "combobox.pattern.popupId()", "attr.aria-haspopup": "combobox.pattern.hasPopup()", "attr.aria-autocomplete": "combobox.pattern.autocomplete()" } }, exportAs: ["cdkComboboxInput"], ngImport: i0 });
|
|
303
85
|
}
|
|
304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type:
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxInput, decorators: [{
|
|
305
87
|
type: Directive,
|
|
306
88
|
args: [{
|
|
307
|
-
selector: '[
|
|
308
|
-
exportAs: '
|
|
89
|
+
selector: 'input[cdkComboboxInput]',
|
|
90
|
+
exportAs: 'cdkComboboxInput',
|
|
309
91
|
host: {
|
|
310
|
-
'
|
|
311
|
-
'[
|
|
312
|
-
'[
|
|
313
|
-
'
|
|
314
|
-
'
|
|
92
|
+
'role': 'combobox',
|
|
93
|
+
'[value]': 'value()',
|
|
94
|
+
'[attr.aria-expanded]': 'combobox.pattern.expanded()',
|
|
95
|
+
'[attr.aria-activedescendant]': 'combobox.pattern.activedescendant()',
|
|
96
|
+
'[attr.aria-controls]': 'combobox.pattern.popupId()',
|
|
97
|
+
'[attr.aria-haspopup]': 'combobox.pattern.hasPopup()',
|
|
98
|
+
'[attr.aria-autocomplete]': 'combobox.pattern.autocomplete()',
|
|
315
99
|
},
|
|
316
100
|
}]
|
|
317
|
-
}],
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}], id: [{
|
|
322
|
-
type: Input
|
|
323
|
-
}] } });
|
|
324
|
-
|
|
325
|
-
const EXPORTED_DECLARATIONS = [CdkCombobox, CdkComboboxPopup];
|
|
326
|
-
class CdkComboboxModule {
|
|
327
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
328
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxModule, imports: [OverlayModule, CdkCombobox, CdkComboboxPopup], exports: [CdkCombobox, CdkComboboxPopup] });
|
|
329
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxModule, imports: [OverlayModule] });
|
|
101
|
+
}], ctorParameters: () => [] });
|
|
102
|
+
class CdkComboboxPopupContainer {
|
|
103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxPopupContainer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
104
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: CdkComboboxPopupContainer, isStandalone: true, selector: "ng-template[cdkComboboxPopupContainer]", exportAs: ["cdkComboboxPopupContainer"], hostDirectives: [{ directive: i1.DeferredContent }], ngImport: i0 });
|
|
330
105
|
}
|
|
331
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type:
|
|
332
|
-
type:
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxPopupContainer, decorators: [{
|
|
107
|
+
type: Directive,
|
|
333
108
|
args: [{
|
|
334
|
-
|
|
335
|
-
|
|
109
|
+
selector: 'ng-template[cdkComboboxPopupContainer]',
|
|
110
|
+
exportAs: 'cdkComboboxPopupContainer',
|
|
111
|
+
hostDirectives: [DeferredContent],
|
|
112
|
+
}]
|
|
113
|
+
}] });
|
|
114
|
+
class CdkComboboxPopup {
|
|
115
|
+
/** The combobox that the popup belongs to. */
|
|
116
|
+
combobox = inject(CdkCombobox, { optional: true });
|
|
117
|
+
/** The controls the popup exposes to the combobox. */
|
|
118
|
+
controls = signal(undefined, ...(ngDevMode ? [{ debugName: "controls" }] : []));
|
|
119
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxPopup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
120
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: CdkComboboxPopup, isStandalone: true, selector: "[cdkComboboxPopup]", exportAs: ["cdkComboboxPopup"], ngImport: i0 });
|
|
121
|
+
}
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxPopup, decorators: [{
|
|
123
|
+
type: Directive,
|
|
124
|
+
args: [{
|
|
125
|
+
selector: '[cdkComboboxPopup]',
|
|
126
|
+
exportAs: 'cdkComboboxPopup',
|
|
336
127
|
}]
|
|
337
128
|
}] });
|
|
338
129
|
|
|
339
|
-
export {
|
|
130
|
+
export { CdkCombobox, CdkComboboxInput, CdkComboboxPopup, CdkComboboxPopupContainer };
|
|
340
131
|
//# sourceMappingURL=combobox.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/combobox/combobox.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/combobox/combobox-popup.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/combobox/combobox-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {Directionality} from '@angular/cdk/bidi';\nimport {BooleanInput, coerceArray, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DOWN_ARROW, ENTER, ESCAPE, TAB} from '@angular/cdk/keycodes';\nimport {\n ConnectedPosition,\n createBlockScrollStrategy,\n createFlexibleConnectedPositionStrategy,\n createOverlayRef,\n FlexibleConnectedPositionStrategy,\n OverlayConfig,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport {_getEventTarget} from '@angular/cdk/platform';\nimport {TemplatePortal} from '@angular/cdk/portal';\n\nimport {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n HOST_TAG_NAME,\n InjectionToken,\n Injector,\n Input,\n OnDestroy,\n Output,\n TemplateRef,\n ViewContainerRef,\n inject,\n DOCUMENT,\n} from '@angular/core';\n\nexport type AriaHasPopupValue = 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';\nexport type OpenAction = 'focus' | 'click' | 'downKey' | 'toggle';\nexport type OpenActionInput = OpenAction | OpenAction[] | string | null | undefined;\n\nconst allowedOpenActions = ['focus', 'click', 'downKey', 'toggle'];\n\nexport const CDK_COMBOBOX = new InjectionToken<CdkCombobox>('CDK_COMBOBOX');\n\n@Directive({\n selector: '[cdkCombobox]',\n exportAs: 'cdkCombobox',\n host: {\n 'role': 'combobox',\n 'class': 'cdk-combobox',\n '(click)': '_handleInteractions(\"click\")',\n '(focus)': '_handleInteractions(\"focus\")',\n '(keydown)': '_keydown($event)',\n '(document:click)': '_attemptClose($event)',\n '[attr.aria-disabled]': 'disabled',\n '[attr.aria-owns]': 'contentId',\n '[attr.aria-haspopup]': 'contentType',\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.tabindex]': '_getTabIndex()',\n },\n providers: [{provide: CDK_COMBOBOX, useExisting: CdkCombobox}],\n})\nexport class CdkCombobox<T = unknown> implements OnDestroy {\n private readonly _tagName = inject(HOST_TAG_NAME);\n private readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected readonly _viewContainerRef = inject(ViewContainerRef);\n private readonly _injector = inject(Injector);\n private readonly _doc = inject(DOCUMENT);\n private readonly _directionality = inject(Directionality, {optional: true});\n private _changeDetectorRef = inject(ChangeDetectorRef);\n private _overlayRef: OverlayRef;\n private _panelPortal: TemplatePortal;\n\n @Input('cdkComboboxTriggerFor')\n _panelTemplateRef: TemplateRef<unknown>;\n\n @Input()\n value: T | T[];\n\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled: boolean = false;\n\n @Input()\n get openActions(): OpenAction[] {\n return this._openActions;\n }\n set openActions(action: OpenActionInput) {\n this._openActions = this._coerceOpenActionProperty(action);\n }\n private _openActions: OpenAction[] = ['click'];\n\n /** Whether the textContent is automatically updated upon change of the combobox value. */\n @Input()\n get autoSetText(): boolean {\n return this._autoSetText;\n }\n set autoSetText(value: BooleanInput) {\n this._autoSetText = coerceBooleanProperty(value);\n }\n private _autoSetText: boolean = true;\n\n @Output('comboboxPanelOpened') readonly opened: EventEmitter<void> = new EventEmitter<void>();\n @Output('comboboxPanelClosed') readonly closed: EventEmitter<void> = new EventEmitter<void>();\n @Output('panelValueChanged') readonly panelValueChanged: EventEmitter<T[]> = new EventEmitter<\n T[]\n >();\n\n contentId: string = '';\n contentType: AriaHasPopupValue;\n\n ngOnDestroy() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n }\n\n this.opened.complete();\n this.closed.complete();\n this.panelValueChanged.complete();\n }\n\n _keydown(event: KeyboardEvent) {\n const {keyCode} = event;\n\n if (keyCode === DOWN_ARROW) {\n if (this.isOpen()) {\n // TODO: instead of using a focus function, potentially use cdk/a11y focus trapping\n this._doc.getElementById(this.contentId)?.focus();\n } else if (this._openActions.indexOf('downKey') !== -1) {\n this.open();\n }\n } else if (keyCode === ENTER) {\n if (this._openActions.indexOf('toggle') !== -1) {\n this.toggle();\n } else if (this._openActions.indexOf('click') !== -1) {\n this.open();\n }\n } else if (keyCode === ESCAPE) {\n event.preventDefault();\n this.close();\n } else if (keyCode === TAB) {\n this.close();\n }\n }\n\n /** Handles click or focus interactions. */\n _handleInteractions(interaction: OpenAction) {\n if (interaction === 'click') {\n if (this._openActions.indexOf('toggle') !== -1) {\n this.toggle();\n } else if (this._openActions.indexOf('click') !== -1) {\n this.open();\n }\n } else if (interaction === 'focus') {\n if (this._openActions.indexOf('focus') !== -1) {\n this.open();\n }\n }\n }\n\n /** Given a click in the document, determines if the click was inside a combobox. */\n _attemptClose(event: MouseEvent) {\n if (this.isOpen()) {\n let target = _getEventTarget(event);\n while (target instanceof Element) {\n if (target.className.indexOf('cdk-combobox') !== -1) {\n return;\n }\n target = target.parentElement;\n }\n }\n\n this.close();\n }\n\n /** Toggles the open state of the panel. */\n toggle() {\n if (this.hasPanel()) {\n this.isOpen() ? this.close() : this.open();\n }\n }\n\n /** If the combobox is closed and not disabled, opens the panel. */\n open() {\n if (!this.isOpen() && !this.disabled) {\n this.opened.next();\n this._overlayRef =\n this._overlayRef || createOverlayRef(this._injector, this._getOverlayConfig());\n this._overlayRef.attach(this._getPanelContent());\n this._changeDetectorRef.markForCheck();\n if (!this._isTextTrigger()) {\n // TODO: instead of using a focus function, potentially use cdk/a11y focus trapping\n this._doc.getElementById(this.contentId)?.focus();\n }\n }\n }\n\n /** If the combobox is open and not disabled, closes the panel. */\n close() {\n if (this.isOpen() && !this.disabled) {\n this.closed.next();\n this._overlayRef.detach();\n this._changeDetectorRef.markForCheck();\n }\n }\n\n /** Returns true if panel is currently opened. */\n isOpen(): boolean {\n return this._overlayRef ? this._overlayRef.hasAttached() : false;\n }\n\n /** Returns true if combobox has a child panel. */\n hasPanel(): boolean {\n return !!this._panelTemplateRef;\n }\n\n _getTabIndex(): string | null {\n return this.disabled ? null : '0';\n }\n\n private _setComboboxValue(value: T | T[]) {\n const valueChanged = this.value !== value;\n this.value = value;\n\n if (valueChanged) {\n this.panelValueChanged.emit(coerceArray(value));\n if (this._autoSetText) {\n this._setTextContent(value);\n }\n }\n }\n\n updateAndClose(value: T | T[]) {\n this._setComboboxValue(value);\n this.close();\n }\n\n private _setTextContent(content: T | T[]) {\n const contentArray = coerceArray(content);\n this._elementRef.nativeElement.textContent = contentArray.join(' ');\n }\n\n private _isTextTrigger() {\n // TODO: Should check if the trigger is contenteditable.\n const tagName = this._tagName.toLowerCase();\n return tagName === 'input' || tagName === 'textarea';\n }\n\n private _getOverlayConfig() {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPositionStrategy(),\n scrollStrategy: createBlockScrollStrategy(this._injector),\n direction: this._directionality || undefined,\n });\n }\n\n private _getOverlayPositionStrategy(): FlexibleConnectedPositionStrategy {\n return createFlexibleConnectedPositionStrategy(this._injector, this._elementRef).withPositions(\n this._getOverlayPositions(),\n );\n }\n\n private _getOverlayPositions(): ConnectedPosition[] {\n return [\n {originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top'},\n {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top'},\n {originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom'},\n ];\n }\n\n private _getPanelInjector() {\n return this._injector;\n }\n\n private _getPanelContent() {\n const hasPanelChanged = this._panelTemplateRef !== this._panelPortal?.templateRef;\n if (this._panelTemplateRef && (!this._panelPortal || hasPanelChanged)) {\n this._panelPortal = new TemplatePortal(\n this._panelTemplateRef,\n this._viewContainerRef,\n undefined,\n this._getPanelInjector(),\n );\n }\n\n return this._panelPortal;\n }\n\n private _coerceOpenActionProperty(input: OpenActionInput): OpenAction[] {\n let actions = typeof input === 'string' ? input.trim().split(/[ ,]+/) : input;\n if (\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n actions?.some(a => allowedOpenActions.indexOf(a) === -1)\n ) {\n throw Error(`${input} is not a support open action for CdkCombobox`);\n }\n return actions as OpenAction[];\n }\n\n /** Registers the content's id and the content type with the panel. */\n _registerContent(contentId: string, contentType: AriaHasPopupValue) {\n if (\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n contentType !== 'listbox' &&\n contentType !== 'dialog'\n ) {\n throw Error('CdkComboboxPanel currently only supports listbox or dialog content.');\n }\n this.contentId = contentId;\n this.contentType = contentType;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, ElementRef, Input, OnInit, inject} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {AriaHasPopupValue, CDK_COMBOBOX, CdkCombobox} from './combobox';\n\n@Directive({\n selector: '[cdkComboboxPopup]',\n exportAs: 'cdkComboboxPopup',\n host: {\n 'class': 'cdk-combobox-popup',\n '[attr.role]': 'role',\n '[id]': 'id',\n 'tabindex': '-1',\n '(focus)': 'focusFirstElement()',\n },\n})\nexport class CdkComboboxPopup<T = unknown> implements OnInit {\n private readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly _combobox = inject<CdkCombobox>(CDK_COMBOBOX);\n\n @Input()\n get role(): AriaHasPopupValue {\n return this._role;\n }\n set role(value: AriaHasPopupValue) {\n this._role = value;\n }\n private _role: AriaHasPopupValue = 'dialog';\n\n @Input()\n get firstFocus(): HTMLElement {\n return this._firstFocusElement;\n }\n set firstFocus(id: HTMLElement) {\n this._firstFocusElement = id;\n }\n private _firstFocusElement: HTMLElement;\n\n @Input() id: string = inject(_IdGenerator).getId('cdk-combobox-popup-');\n\n ngOnInit() {\n this.registerWithPanel();\n }\n\n registerWithPanel(): void {\n this._combobox._registerContent(this.id, this._role);\n }\n\n focusFirstElement() {\n if (this._firstFocusElement) {\n this._firstFocusElement.focus();\n } else {\n this._elementRef.nativeElement.focus();\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {CdkCombobox} from './combobox';\nimport {CdkComboboxPopup} from './combobox-popup';\n\nconst EXPORTED_DECLARATIONS = [CdkCombobox, CdkComboboxPopup];\n@NgModule({\n imports: [OverlayModule, ...EXPORTED_DECLARATIONS],\n exports: EXPORTED_DECLARATIONS,\n})\nexport class CdkComboboxModule {}\n"],"names":[],"mappings":";;;;;;;;;;AA2CA,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;MAErD,YAAY,GAAG,IAAI,cAAc,CAAc,cAAc;MAoB7D,WAAW,CAAA;AACL,IAAA,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC;AAChC,IAAA,WAAW,GAAG,MAAM,CAA0B,UAAU,CAAC;AACvD,IAAA,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC9C,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC;IACvB,eAAe,GAAG,MAAM,CAAC,cAAc,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;AACnE,IAAA,kBAAkB,GAAG,MAAM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,EAFM,WAAW,EAAE,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAA7B,WAAW,EAAE,gBAAgB,CAAA,EAAA,CAAA;AAK/C,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAHlB,aAAa,CAAA,EAAA,CAAA;;kGAGZ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,GAAG,qBAAqB,CAAC;AAClD,oBAAA,OAAO,EAAE,qBAAqB;AAC/B,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"combobox.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/combobox/combobox.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n signal,\n untracked,\n WritableSignal,\n} from '@angular/core';\nimport {DeferredContent, DeferredContentAware} from '@angular/cdk-experimental/deferred-content';\nimport {ComboboxPattern, ComboboxListboxControls, ComboboxTreeControls} from '../ui-patterns';\n\n@Directive({\n selector: '[cdkCombobox]',\n exportAs: 'cdkCombobox',\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n host: {\n '[attr.data-expanded]': 'pattern.expanded()',\n '(input)': 'pattern.onInput($event)',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerup)': 'pattern.onPointerup($event)',\n '(focusin)': 'pattern.onFocusIn()',\n '(focusout)': 'pattern.onFocusOut($event)',\n },\n})\nexport class CdkCombobox<V> {\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n\n /** The combobox popup. */\n readonly popup = contentChild<CdkComboboxPopup<V>>(CdkComboboxPopup);\n\n /** The filter mode for the combobox. */\n filterMode = input<'manual' | 'auto-select' | 'highlight'>('manual');\n\n /** Whether the combobox is focused. */\n readonly isFocused = signal(false);\n\n /** The value of the first matching item in the popup. */\n firstMatch = input<V | undefined>(undefined);\n\n /** Whether the listbox has received focus yet. */\n private _hasBeenFocused = signal(false);\n\n /** The combobox ui pattern. */\n readonly pattern = new ComboboxPattern<any, V>({\n ...this,\n inputValue: signal(''),\n inputEl: signal(undefined),\n containerEl: () => this._elementRef.nativeElement,\n popupControls: () => this.popup()?.controls(),\n });\n\n constructor() {\n afterRenderEffect(() => {\n if (!this._deferredContentAware?.contentVisible() && this.pattern.isFocused()) {\n this._deferredContentAware?.contentVisible.set(true);\n }\n });\n\n afterRenderEffect(() => {\n if (!this._hasBeenFocused() && this.pattern.isFocused()) {\n this._hasBeenFocused.set(true);\n }\n });\n }\n}\n\n@Directive({\n selector: 'input[cdkComboboxInput]',\n exportAs: 'cdkComboboxInput',\n host: {\n 'role': 'combobox',\n '[value]': 'value()',\n '[attr.aria-expanded]': 'combobox.pattern.expanded()',\n '[attr.aria-activedescendant]': 'combobox.pattern.activedescendant()',\n '[attr.aria-controls]': 'combobox.pattern.popupId()',\n '[attr.aria-haspopup]': 'combobox.pattern.hasPopup()',\n '[attr.aria-autocomplete]': 'combobox.pattern.autocomplete()',\n },\n})\nexport class CdkComboboxInput {\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n /** The combobox that the input belongs to. */\n readonly combobox = inject(CdkCombobox);\n\n /** The value of the input. */\n value = model<string>('');\n\n constructor() {\n (this.combobox.pattern.inputs.inputEl as WritableSignal<HTMLInputElement>).set(\n this._elementRef.nativeElement,\n );\n this.combobox.pattern.inputs.inputValue = this.value;\n\n /** Focuses & selects the first item in the combobox if the user changes the input value. */\n afterRenderEffect(() => {\n this.combobox.popup()?.controls()?.items();\n untracked(() => this.combobox.pattern.onFilter());\n });\n }\n}\n\n@Directive({\n selector: 'ng-template[cdkComboboxPopupContainer]',\n exportAs: 'cdkComboboxPopupContainer',\n hostDirectives: [DeferredContent],\n})\nexport class CdkComboboxPopupContainer {}\n\n@Directive({\n selector: '[cdkComboboxPopup]',\n exportAs: 'cdkComboboxPopup',\n})\nexport class CdkComboboxPopup<V> {\n /** The combobox that the popup belongs to. */\n readonly combobox = inject<CdkCombobox<V>>(CdkCombobox, {optional: true});\n\n /** The controls the popup exposes to the combobox. */\n readonly controls = signal<\n ComboboxListboxControls<any, V> | ComboboxTreeControls<any, V> | undefined\n >(undefined);\n}\n"],"names":[],"mappings":";;;;;;;MAyCa,WAAW,CAAA;;AAEL,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;;IAGhC,qBAAqB,GAAG,MAAM,CAAC,oBAAoB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;AAG9E,IAAA,KAAK,GAAG,YAAY,CAAsB,gBAAgB,iDAAC;;AAGpE,IAAA,UAAU,GAAG,KAAK,CAAyC,QAAQ,sDAAC;;AAG3D,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;;AAGlC,IAAA,UAAU,GAAG,KAAK,CAAgB,SAAS,sDAAC;;AAGpC,IAAA,eAAe,GAAG,MAAM,CAAC,KAAK,2DAAC;;IAG9B,OAAO,GAAG,IAAI,eAAe,CAAS;AAC7C,QAAA,GAAG,IAAI;AACP,QAAA,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC;AACtB,QAAA,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC;QAC1B,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa;QACjD,aAAa,EAAE,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,E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kBALrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wCAAwC;AAClD,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,cAAc,EAAE,CAAC,eAAe,CAAC;AAClC,iBAAA;;MAOY,gBAAgB,CAAA;;IAElB,QAAQ,GAAG,MAAM,CAAiB,WAAW,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;AAGhE,IAAA,QAAQ,GAAG,MAAM,CAExB,SAAS,oDAAC;8GAPD,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;kGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;kGAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,kBAAkB;AAC7B,iBAAA;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal,
|
|
2
|
+
import { signal, model, Directive, inject, TemplateRef, ViewContainerRef, afterRenderEffect } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A container directive controls the visibility of its content.
|
|
6
6
|
*/
|
|
7
7
|
class DeferredContentAware {
|
|
8
8
|
contentVisible = signal(false, ...(ngDevMode ? [{ debugName: "contentVisible" }] : []));
|
|
9
|
-
preserveContent =
|
|
9
|
+
preserveContent = model(false, ...(ngDevMode ? [{ debugName: "preserveContent" }] : []));
|
|
10
10
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: DeferredContentAware, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
11
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0-next.2", type: DeferredContentAware, isStandalone: true, inputs: { preserveContent: { classPropertyName: "preserveContent", publicName: "preserveContent", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
11
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0-next.2", type: DeferredContentAware, isStandalone: true, inputs: { preserveContent: { classPropertyName: "preserveContent", publicName: "preserveContent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { preserveContent: "preserveContentChange" }, ngImport: i0 });
|
|
12
12
|
}
|
|
13
13
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: DeferredContentAware, decorators: [{
|
|
14
14
|
type: Directive
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferred-content.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"deferred-content.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/deferred-content/deferred-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n Directive,\n inject,\n TemplateRef,\n signal,\n ViewContainerRef,\n model,\n} from '@angular/core';\n\n/**\n * A container directive controls the visibility of its content.\n */\n@Directive()\nexport class DeferredContentAware {\n readonly contentVisible = signal(false);\n readonly preserveContent = model(false);\n}\n\n/**\n * DeferredContent loads/unloads the content based on the visibility.\n * The visibilty signal is sent from a parent directive implements\n * DeferredContentAware.\n *\n * Use this directive as a host directive. For example:\n *\n * ```ts\n * @Directive({\n * selector: 'ng-template[cdkAccordionContent]',\n * hostDirectives: [DeferredContent],\n * })\n * class CdkAccordionContent {}\n * ```\n */\n@Directive()\nexport class DeferredContent {\n private readonly _deferredContentAware = inject(DeferredContentAware);\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainerRef = inject(ViewContainerRef);\n private _isRendered = false;\n\n constructor() {\n afterRenderEffect(() => {\n if (this._deferredContentAware.contentVisible()) {\n if (this._isRendered) return;\n this._viewContainerRef.clear();\n this._viewContainerRef.createEmbeddedView(this._templateRef);\n this._isRendered = true;\n } else if (!this._deferredContentAware.preserveContent()) {\n this._viewContainerRef.clear();\n this._isRendered = false;\n }\n });\n }\n}\n"],"names":[],"mappings":";;;AAkBA;;AAEG;MAEU,oBAAoB,CAAA;AACtB,IAAA,cAAc,GAAG,MAAM,CAAC,KAAK,0DAAC;AAC9B,IAAA,eAAe,GAAG,KAAK,CAAC,KAAK,2DAAC;8GAF5B,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;kGAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,eAAA,EAAA,uBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;kGAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC;;AAMD;;;;;;;;;;;;;;AAcG;MAEU,eAAe,CAAA;AACT,IAAA,qBAAqB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACpD,IAAA,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC;AAClC,IAAA,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IACrD,WAAW,GAAG,KAAK;AAE3B,IAAA,WAAA,GAAA;QACE,iBAAiB,CAAC,MAAK;AACrB,YAAA,IAAI,IAAI,CAAC,qBA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