@angular/cdk-experimental 14.0.0-next.5 → 14.0.0-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/combobox/combobox-module.d.ts +3 -4
  2. package/combobox/combobox-popup.d.ts +6 -8
  3. package/combobox/combobox.d.ts +15 -18
  4. package/combobox/public-api.d.ts +0 -1
  5. package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
  6. package/esm2020/column-resize/column-resize-directives/column-resize.mjs +3 -3
  7. package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +3 -3
  8. package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize.mjs +3 -3
  9. package/esm2020/column-resize/column-resize-module.mjs +8 -8
  10. package/esm2020/column-resize/column-resize-notifier.mjs +6 -6
  11. package/esm2020/column-resize/column-resize.mjs +3 -3
  12. package/esm2020/column-resize/column-size-store.mjs +3 -3
  13. package/esm2020/column-resize/event-dispatcher.mjs +3 -3
  14. package/esm2020/column-resize/overlay-handle.mjs +3 -3
  15. package/esm2020/column-resize/resizable.mjs +3 -3
  16. package/esm2020/column-resize/resize-strategy.mjs +9 -9
  17. package/esm2020/combobox/combobox-module.mjs +6 -7
  18. package/esm2020/combobox/combobox-popup.mjs +12 -23
  19. package/esm2020/combobox/combobox.mjs +50 -34
  20. package/esm2020/combobox/public-api.mjs +1 -2
  21. package/esm2020/dialog/dialog-container.mjs +28 -11
  22. package/esm2020/dialog/dialog-module.mjs +4 -4
  23. package/esm2020/dialog/dialog.mjs +3 -3
  24. package/esm2020/listbox/listbox-module.mjs +4 -4
  25. package/esm2020/listbox/listbox.mjs +26 -44
  26. package/esm2020/menu/context-menu.mjs +46 -82
  27. package/esm2020/menu/menu-aim.mjs +6 -6
  28. package/esm2020/menu/menu-bar.mjs +16 -13
  29. package/esm2020/menu/menu-errors.mjs +1 -9
  30. package/esm2020/menu/menu-group.mjs +3 -3
  31. package/esm2020/menu/menu-item-checkbox.mjs +3 -3
  32. package/esm2020/menu/menu-item-radio.mjs +15 -8
  33. package/esm2020/menu/menu-item-selectable.mjs +3 -3
  34. package/esm2020/menu/menu-item-trigger.mjs +63 -88
  35. package/esm2020/menu/menu-item.mjs +29 -37
  36. package/esm2020/menu/menu-module.mjs +5 -9
  37. package/esm2020/menu/menu-stack.mjs +10 -6
  38. package/esm2020/menu/menu-trigger.mjs +43 -0
  39. package/esm2020/menu/menu.mjs +32 -45
  40. package/esm2020/menu/public-api.mjs +3 -3
  41. package/esm2020/popover-edit/edit-event-dispatcher.mjs +3 -3
  42. package/esm2020/popover-edit/edit-ref.mjs +3 -3
  43. package/esm2020/popover-edit/edit-services.mjs +3 -3
  44. package/esm2020/popover-edit/focus-dispatcher.mjs +3 -3
  45. package/esm2020/popover-edit/focus-escape-notifier.mjs +3 -3
  46. package/esm2020/popover-edit/lens-directives.mjs +9 -9
  47. package/esm2020/popover-edit/popover-edit-module.mjs +4 -4
  48. package/esm2020/popover-edit/popover-edit-position-strategy-factory.mjs +6 -6
  49. package/esm2020/popover-edit/table-directives.mjs +15 -15
  50. package/esm2020/scrolling/auto-size-virtual-scroll.mjs +3 -3
  51. package/esm2020/scrolling/scrolling-module.mjs +4 -4
  52. package/esm2020/selection/row-selection.mjs +3 -3
  53. package/esm2020/selection/select-all.mjs +3 -3
  54. package/esm2020/selection/selection-column.mjs +3 -3
  55. package/esm2020/selection/selection-module.mjs +4 -4
  56. package/esm2020/selection/selection-toggle.mjs +3 -3
  57. package/esm2020/selection/selection.mjs +3 -3
  58. package/esm2020/table-scroll-container/table-scroll-container-module.mjs +4 -4
  59. package/esm2020/table-scroll-container/table-scroll-container.mjs +3 -3
  60. package/esm2020/version.mjs +1 -1
  61. package/fesm2015/cdk-experimental.mjs +1 -1
  62. package/fesm2015/cdk-experimental.mjs.map +1 -1
  63. package/fesm2015/column-resize.mjs +50 -50
  64. package/fesm2015/column-resize.mjs.map +1 -1
  65. package/fesm2015/combobox.mjs +63 -106
  66. package/fesm2015/combobox.mjs.map +1 -1
  67. package/fesm2015/dialog.mjs +34 -17
  68. package/fesm2015/dialog.mjs.map +1 -1
  69. package/fesm2015/listbox.mjs +31 -47
  70. package/fesm2015/listbox.mjs.map +1 -1
  71. package/fesm2015/menu.mjs +334 -421
  72. package/fesm2015/menu.mjs.map +1 -1
  73. package/fesm2015/popover-edit.mjs +49 -49
  74. package/fesm2015/popover-edit.mjs.map +1 -1
  75. package/fesm2015/scrolling.mjs +7 -7
  76. package/fesm2015/scrolling.mjs.map +1 -1
  77. package/fesm2015/selection.mjs +19 -19
  78. package/fesm2015/selection.mjs.map +1 -1
  79. package/fesm2015/table-scroll-container.mjs +7 -7
  80. package/fesm2015/table-scroll-container.mjs.map +1 -1
  81. package/fesm2020/cdk-experimental.mjs +1 -1
  82. package/fesm2020/cdk-experimental.mjs.map +1 -1
  83. package/fesm2020/column-resize.mjs +50 -50
  84. package/fesm2020/column-resize.mjs.map +1 -1
  85. package/fesm2020/combobox.mjs +62 -103
  86. package/fesm2020/combobox.mjs.map +1 -1
  87. package/fesm2020/dialog.mjs +34 -17
  88. package/fesm2020/dialog.mjs.map +1 -1
  89. package/fesm2020/listbox.mjs +29 -46
  90. package/fesm2020/listbox.mjs.map +1 -1
  91. package/fesm2020/menu.mjs +238 -321
  92. package/fesm2020/menu.mjs.map +1 -1
  93. package/fesm2020/popover-edit.mjs +49 -49
  94. package/fesm2020/popover-edit.mjs.map +1 -1
  95. package/fesm2020/scrolling.mjs +7 -7
  96. package/fesm2020/scrolling.mjs.map +1 -1
  97. package/fesm2020/selection.mjs +19 -19
  98. package/fesm2020/selection.mjs.map +1 -1
  99. package/fesm2020/table-scroll-container.mjs +7 -7
  100. package/fesm2020/table-scroll-container.mjs.map +1 -1
  101. package/listbox/listbox.d.ts +16 -13
  102. package/menu/context-menu.d.ts +12 -30
  103. package/menu/menu-bar.d.ts +2 -2
  104. package/menu/menu-errors.d.ts +0 -5
  105. package/menu/menu-item-radio.d.ts +4 -3
  106. package/menu/menu-item-trigger.d.ts +11 -18
  107. package/menu/menu-item.d.ts +11 -6
  108. package/menu/menu-module.d.ts +9 -10
  109. package/menu/menu-stack.d.ts +7 -6
  110. package/menu/menu-trigger.d.ts +24 -0
  111. package/menu/menu.d.ts +7 -23
  112. package/menu/public-api.d.ts +2 -2
  113. package/package.json +2 -2
  114. package/combobox/combobox-panel.d.ts +0 -27
  115. package/esm2020/combobox/combobox-panel.mjs +0 -48
  116. package/esm2020/menu/menu-panel.mjs +0 -37
  117. package/menu/menu-panel.d.ts +0 -30
@@ -1,20 +1,30 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Directive, Optional, Input, Output, InjectionToken, Inject, NgModule } from '@angular/core';
2
+ import { InjectionToken, EventEmitter, Directive, Inject, Optional, Input, Output, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/cdk/overlay';
4
4
  import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
5
+ import { DOCUMENT } from '@angular/common';
5
6
  import { TemplatePortal } from '@angular/cdk/portal';
6
7
  import * as i2 from '@angular/cdk/bidi';
7
8
  import { coerceBooleanProperty, coerceArray } from '@angular/cdk/coercion';
8
9
  import { _getEventTarget } from '@angular/cdk/platform';
9
10
  import { DOWN_ARROW, ENTER, ESCAPE, TAB } from '@angular/cdk/keycodes';
10
- import { Subject } from 'rxjs';
11
11
 
12
+ /**
13
+ * @license
14
+ * Copyright Google LLC All Rights Reserved.
15
+ *
16
+ * Use of this source code is governed by an MIT-style license that can be
17
+ * found in the LICENSE file at https://angular.io/license
18
+ */
12
19
  const allowedOpenActions = ['focus', 'click', 'downKey', 'toggle'];
20
+ const CDK_COMBOBOX = new InjectionToken('CDK_COMBOBOX');
13
21
  class CdkCombobox {
14
- constructor(_elementRef, _overlay, _viewContainerRef, _directionality) {
22
+ constructor(_elementRef, _overlay, _viewContainerRef, _injector, _doc, _directionality) {
15
23
  this._elementRef = _elementRef;
16
24
  this._overlay = _overlay;
17
25
  this._viewContainerRef = _viewContainerRef;
26
+ this._injector = _injector;
27
+ this._doc = _doc;
18
28
  this._directionality = _directionality;
19
29
  this._disabled = false;
20
30
  this._openActions = ['click'];
@@ -24,12 +34,6 @@ class CdkCombobox {
24
34
  this.panelValueChanged = new EventEmitter();
25
35
  this.contentId = '';
26
36
  }
27
- get panel() {
28
- return this._panel;
29
- }
30
- set panel(panel) {
31
- this._panel = panel;
32
- }
33
37
  get disabled() {
34
38
  return this._disabled;
35
39
  }
@@ -49,18 +53,6 @@ class CdkCombobox {
49
53
  set autoSetText(value) {
50
54
  this._autoSetText = coerceBooleanProperty(value);
51
55
  }
52
- ngAfterContentInit() {
53
- this._panel?.valueUpdated.subscribe(data => {
54
- this._setComboboxValue(data);
55
- this.close();
56
- });
57
- this._panel?.contentIdUpdated.subscribe(id => {
58
- this.contentId = id;
59
- });
60
- this._panel?.contentTypeUpdated.subscribe(type => {
61
- this.contentType = type;
62
- });
63
- }
64
56
  ngOnDestroy() {
65
57
  if (this._overlayRef) {
66
58
  this._overlayRef.dispose();
@@ -73,7 +65,8 @@ class CdkCombobox {
73
65
  const { keyCode } = event;
74
66
  if (keyCode === DOWN_ARROW) {
75
67
  if (this.isOpen()) {
76
- this._panel?.focusContent();
68
+ // TODO: instead of using a focus function, potentially use cdk/a11y focus trapping
69
+ this._doc.getElementById(this.contentId)?.focus();
77
70
  }
78
71
  else if (this._openActions.indexOf('downKey') !== -1) {
79
72
  this.open();
@@ -137,7 +130,8 @@ class CdkCombobox {
137
130
  this._overlayRef = this._overlayRef || this._overlay.create(this._getOverlayConfig());
138
131
  this._overlayRef.attach(this._getPanelContent());
139
132
  if (!this._isTextTrigger()) {
140
- this._panel?.focusContent();
133
+ // TODO: instead of using a focus function, potentially use cdk/a11y focus trapping
134
+ this._doc.getElementById(this.contentId)?.focus();
141
135
  }
142
136
  }
143
137
  }
@@ -154,7 +148,7 @@ class CdkCombobox {
154
148
  }
155
149
  /** Returns true if combobox has a child panel. */
156
150
  hasPanel() {
157
- return !!this.panel;
151
+ return !!this._panelTemplateRef;
158
152
  }
159
153
  _getTabIndex() {
160
154
  return this.disabled ? null : '0';
@@ -169,6 +163,10 @@ class CdkCombobox {
169
163
  }
170
164
  }
171
165
  }
166
+ updateAndClose(value) {
167
+ this._setComboboxValue(value);
168
+ this.close();
169
+ }
172
170
  _setTextContent(content) {
173
171
  const contentArray = coerceArray(content);
174
172
  this._elementRef.nativeElement.textContent = contentArray.join(' ');
@@ -199,12 +197,15 @@ class CdkCombobox {
199
197
  { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
200
198
  ];
201
199
  }
200
+ _getPanelInjector() {
201
+ return this._injector;
202
+ }
202
203
  _getPanelContent() {
203
- const hasPanelChanged = this._panel?._templateRef !== this._panelContent?.templateRef;
204
- if (this._panel && (!this._panel || hasPanelChanged)) {
205
- this._panelContent = new TemplatePortal(this._panel._templateRef, this._viewContainerRef);
204
+ const hasPanelChanged = this._panelTemplateRef !== this._panelPortal?.templateRef;
205
+ if (this._panelTemplateRef && (!this._panelPortal || hasPanelChanged)) {
206
+ this._panelPortal = new TemplatePortal(this._panelTemplateRef, this._viewContainerRef, undefined, this._getPanelInjector());
206
207
  }
207
- return this._panelContent;
208
+ return this._panelPortal;
208
209
  }
209
210
  _coerceOpenActionProperty(input) {
210
211
  let actions = typeof input === 'string' ? input.trim().split(/[ ,]+/) : input;
@@ -214,10 +215,20 @@ class CdkCombobox {
214
215
  }
215
216
  return actions;
216
217
  }
218
+ /** Registers the content's id and the content type with the panel. */
219
+ _registerContent(contentId, contentType) {
220
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
221
+ contentType !== 'listbox' &&
222
+ contentType !== 'dialog') {
223
+ throw Error('CdkComboboxPanel currently only supports listbox or dialog content.');
224
+ }
225
+ this.contentId = contentId;
226
+ this.contentType = contentType;
227
+ }
217
228
  }
218
- CdkCombobox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkCombobox, deps: [{ token: i0.ElementRef }, { token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
219
- CdkCombobox.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.4", type: CdkCombobox, selector: "[cdkCombobox]", inputs: { panel: ["cdkComboboxTriggerFor", "panel"], value: "value", disabled: "disabled", openActions: "openActions", autoSetText: "autoSetText" }, outputs: { opened: "comboboxPanelOpened", closed: "comboboxPanelClosed", panelValueChanged: "panelValueChanged" }, host: { attributes: { "role": "combobox" }, listeners: { "click": "_handleInteractions(\"click\")", "focus": "_handleInteractions(\"focus\")", "keydown": "_keydown($event)", "document:click": "_attemptClose($event)" }, properties: { "attr.aria-disabled": "disabled", "attr.aria-owns": "contentId", "attr.aria-haspopup": "contentType", "attr.aria-expanded": "isOpen()", "attr.tabindex": "_getTabIndex()" }, classAttribute: "cdk-combobox" }, exportAs: ["cdkCombobox"], ngImport: i0 });
220
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkCombobox, decorators: [{
229
+ CdkCombobox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkCombobox, deps: [{ token: i0.ElementRef }, { token: i1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.Injector }, { token: DOCUMENT }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
230
+ CdkCombobox.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.6", type: CdkCombobox, selector: "[cdkCombobox]", inputs: { _panelTemplateRef: ["cdkComboboxTriggerFor", "_panelTemplateRef"], value: "value", disabled: "disabled", openActions: "openActions", autoSetText: "autoSetText" }, outputs: { opened: "comboboxPanelOpened", closed: "comboboxPanelClosed", panelValueChanged: "panelValueChanged" }, host: { attributes: { "role": "combobox" }, listeners: { "click": "_handleInteractions(\"click\")", "focus": "_handleInteractions(\"focus\")", "keydown": "_keydown($event)", "document:click": "_attemptClose($event)" }, properties: { "attr.aria-disabled": "disabled", "attr.aria-owns": "contentId", "attr.aria-haspopup": "contentType", "attr.aria-expanded": "isOpen()", "attr.tabindex": "_getTabIndex()" }, classAttribute: "cdk-combobox" }, providers: [{ provide: CDK_COMBOBOX, useExisting: CdkCombobox }], exportAs: ["cdkCombobox"], ngImport: i0 });
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkCombobox, decorators: [{
221
232
  type: Directive,
222
233
  args: [{
223
234
  selector: '[cdkCombobox]',
@@ -235,10 +246,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4",
235
246
  '[attr.aria-expanded]': 'isOpen()',
236
247
  '[attr.tabindex]': '_getTabIndex()',
237
248
  },
249
+ providers: [{ provide: CDK_COMBOBOX, useExisting: CdkCombobox }],
238
250
  }]
239
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i2.Directionality, decorators: [{
251
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.Injector }, { type: undefined, decorators: [{
252
+ type: Inject,
253
+ args: [DOCUMENT]
254
+ }] }, { type: i2.Directionality, decorators: [{
240
255
  type: Optional
241
- }] }]; }, propDecorators: { panel: [{
256
+ }] }]; }, propDecorators: { _panelTemplateRef: [{
242
257
  type: Input,
243
258
  args: ['cdkComboboxTriggerFor']
244
259
  }], value: [{
@@ -260,51 +275,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4",
260
275
  args: ['panelValueChanged']
261
276
  }] } });
262
277
 
263
- class CdkComboboxPanel {
264
- constructor(_templateRef) {
265
- this._templateRef = _templateRef;
266
- this.valueUpdated = new Subject();
267
- this.contentIdUpdated = new Subject();
268
- this.contentTypeUpdated = new Subject();
269
- this.contentId = '';
270
- }
271
- /** Tells the parent combobox to close the panel and sends back the content value. */
272
- closePanel(data) {
273
- this.valueUpdated.next(data || []);
274
- }
275
- // TODO: instead of using a focus function, potentially use cdk/a11y focus trapping
276
- focusContent() {
277
- // TODO: Use an injected document here
278
- document.getElementById(this.contentId)?.focus();
279
- }
280
- /** Registers the content's id and the content type with the panel. */
281
- _registerContent(contentId, contentType) {
282
- // If content has already been registered, no further contentIds are registered.
283
- if (this.contentType && this.contentType !== contentType) {
284
- return;
285
- }
286
- this.contentId = contentId;
287
- if (contentType !== 'listbox' && contentType !== 'dialog') {
288
- throw Error('CdkComboboxPanel currently only supports listbox or dialog content.');
289
- }
290
- this.contentType = contentType;
291
- this.contentIdUpdated.next(this.contentId);
292
- this.contentTypeUpdated.next(this.contentType);
293
- }
294
- }
295
- CdkComboboxPanel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkComboboxPanel, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
296
- CdkComboboxPanel.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.4", type: CdkComboboxPanel, selector: "ng-template[cdkComboboxPanel]", host: { classAttribute: "cdk-combobox-panel" }, exportAs: ["cdkComboboxPanel"], ngImport: i0 });
297
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkComboboxPanel, decorators: [{
298
- type: Directive,
299
- args: [{
300
- host: {
301
- 'class': 'cdk-combobox-panel',
302
- },
303
- selector: 'ng-template[cdkComboboxPanel]',
304
- exportAs: 'cdkComboboxPanel',
305
- }]
306
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
307
-
308
278
  /**
309
279
  * @license
310
280
  * Copyright Google LLC All Rights Reserved.
@@ -312,12 +282,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4",
312
282
  * Use of this source code is governed by an MIT-style license that can be
313
283
  * found in the LICENSE file at https://angular.io/license
314
284
  */
315
- const PANEL = new InjectionToken('CdkComboboxPanel');
316
285
  let nextId = 0;
317
286
  class CdkComboboxPopup {
318
- constructor(_elementRef, _parentPanel) {
287
+ constructor(_elementRef, _combobox) {
319
288
  this._elementRef = _elementRef;
320
- this._parentPanel = _parentPanel;
289
+ this._combobox = _combobox;
321
290
  this._role = 'dialog';
322
291
  this.id = `cdk-combobox-popup-${nextId++}`;
323
292
  }
@@ -337,12 +306,7 @@ class CdkComboboxPopup {
337
306
  this.registerWithPanel();
338
307
  }
339
308
  registerWithPanel() {
340
- if (this._parentPanel === null || this._parentPanel === undefined) {
341
- this._explicitPanel._registerContent(this.id, this._role);
342
- }
343
- else {
344
- this._parentPanel._registerContent(this.id, this._role);
345
- }
309
+ this._combobox._registerContent(this.id, this._role);
346
310
  }
347
311
  focusFirstElement() {
348
312
  if (this._firstFocusElement) {
@@ -353,9 +317,9 @@ class CdkComboboxPopup {
353
317
  }
354
318
  }
355
319
  }
356
- CdkComboboxPopup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkComboboxPopup, deps: [{ token: i0.ElementRef }, { token: PANEL, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
357
- CdkComboboxPopup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.4", type: CdkComboboxPopup, selector: "[cdkComboboxPopup]", inputs: { role: "role", firstFocus: "firstFocus", id: "id", _explicitPanel: ["parentPanel", "_explicitPanel"] }, host: { attributes: { "tabindex": "-1" }, listeners: { "focus": "focusFirstElement()" }, properties: { "attr.role": "role", "id": "id" }, classAttribute: "cdk-combobox-popup" }, exportAs: ["cdkComboboxPopup"], ngImport: i0 });
358
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkComboboxPopup, decorators: [{
320
+ CdkComboboxPopup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkComboboxPopup, deps: [{ token: i0.ElementRef }, { token: CDK_COMBOBOX }], target: i0.ɵɵFactoryTarget.Directive });
321
+ CdkComboboxPopup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.6", type: CdkComboboxPopup, selector: "[cdkComboboxPopup]", inputs: { role: "role", firstFocus: "firstFocus", id: "id" }, host: { attributes: { "tabindex": "-1" }, listeners: { "focus": "focusFirstElement()" }, properties: { "attr.role": "role", "id": "id" }, classAttribute: "cdk-combobox-popup" }, exportAs: ["cdkComboboxPopup"], ngImport: i0 });
322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkComboboxPopup, decorators: [{
359
323
  type: Directive,
360
324
  args: [{
361
325
  selector: '[cdkComboboxPopup]',
@@ -368,20 +332,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4",
368
332
  '(focus)': 'focusFirstElement()',
369
333
  },
370
334
  }]
371
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: CdkComboboxPanel, decorators: [{
372
- type: Optional
373
- }, {
335
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: CdkCombobox, decorators: [{
374
336
  type: Inject,
375
- args: [PANEL]
337
+ args: [CDK_COMBOBOX]
376
338
  }] }]; }, propDecorators: { role: [{
377
339
  type: Input
378
340
  }], firstFocus: [{
379
341
  type: Input
380
342
  }], id: [{
381
343
  type: Input
382
- }], _explicitPanel: [{
383
- type: Input,
384
- args: ['parentPanel']
385
344
  }] } });
386
345
 
387
346
  /**
@@ -391,13 +350,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4",
391
350
  * Use of this source code is governed by an MIT-style license that can be
392
351
  * found in the LICENSE file at https://angular.io/license
393
352
  */
394
- const EXPORTED_DECLARATIONS = [CdkCombobox, CdkComboboxPanel, CdkComboboxPopup];
353
+ const EXPORTED_DECLARATIONS = [CdkCombobox, CdkComboboxPopup];
395
354
  class CdkComboboxModule {
396
355
  }
397
- CdkComboboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkComboboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
398
- CdkComboboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkComboboxModule, declarations: [CdkCombobox, CdkComboboxPanel, CdkComboboxPopup], imports: [OverlayModule], exports: [CdkCombobox, CdkComboboxPanel, CdkComboboxPopup] });
399
- CdkComboboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkComboboxModule, imports: [[OverlayModule]] });
400
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkComboboxModule, decorators: [{
356
+ CdkComboboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkComboboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
357
+ CdkComboboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkComboboxModule, declarations: [CdkCombobox, CdkComboboxPopup], imports: [OverlayModule], exports: [CdkCombobox, CdkComboboxPopup] });
358
+ CdkComboboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkComboboxModule, imports: [[OverlayModule]] });
359
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkComboboxModule, decorators: [{
401
360
  type: NgModule,
402
361
  args: [{
403
362
  imports: [OverlayModule],
@@ -426,5 +385,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4",
426
385
  * Generated bundle index. Do not edit.
427
386
  */
428
387
 
429
- export { CdkCombobox, CdkComboboxModule, CdkComboboxPanel, CdkComboboxPopup, PANEL };
388
+ export { CDK_COMBOBOX, CdkCombobox, CdkComboboxModule, CdkComboboxPopup };
430
389
  //# sourceMappingURL=combobox.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.mjs","sources":["../../../../../../src/cdk-experimental/combobox/combobox.ts","../../../../../../src/cdk-experimental/combobox/combobox-panel.ts","../../../../../../src/cdk-experimental/combobox/combobox-popup.ts","../../../../../../src/cdk-experimental/combobox/combobox-module.ts","../../../../../../src/cdk-experimental/combobox/public-api.ts","../../../../../../src/cdk-experimental/combobox/index.ts","../../../../../../src/cdk-experimental/combobox/combobox_public_index.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.io/license\n */\n\nexport type OpenAction = 'focus' | 'click' | 'downKey' | 'toggle';\nexport type OpenActionInput = OpenAction | OpenAction[] | string | null | undefined;\n\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n Output,\n ViewContainerRef,\n} from '@angular/core';\nimport {CdkComboboxPanel, AriaHasPopupValue} from './combobox-panel';\nimport {TemplatePortal} from '@angular/cdk/portal';\nimport {\n ConnectedPosition,\n FlexibleConnectedPositionStrategy,\n Overlay,\n OverlayConfig,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {BooleanInput, coerceBooleanProperty, coerceArray} from '@angular/cdk/coercion';\nimport {_getEventTarget} from '@angular/cdk/platform';\nimport {DOWN_ARROW, ENTER, ESCAPE, TAB} from '@angular/cdk/keycodes';\n\nconst allowedOpenActions = ['focus', 'click', 'downKey', 'toggle'];\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})\nexport class CdkCombobox<T = unknown> implements OnDestroy, AfterContentInit {\n @Input('cdkComboboxTriggerFor')\n get panel(): CdkComboboxPanel<T> | undefined {\n return this._panel;\n }\n set panel(panel: CdkComboboxPanel<T> | undefined) {\n this._panel = panel;\n }\n private _panel: CdkComboboxPanel<T> | undefined;\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 private _overlayRef: OverlayRef;\n private _panelContent: TemplatePortal;\n contentId: string = '';\n contentType: AriaHasPopupValue;\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLElement>,\n private readonly _overlay: Overlay,\n protected readonly _viewContainerRef: ViewContainerRef,\n @Optional() private readonly _directionality?: Directionality,\n ) {}\n\n ngAfterContentInit() {\n this._panel?.valueUpdated.subscribe(data => {\n this._setComboboxValue(data);\n this.close();\n });\n\n this._panel?.contentIdUpdated.subscribe(id => {\n this.contentId = id;\n });\n\n this._panel?.contentTypeUpdated.subscribe(type => {\n this.contentType = type;\n });\n }\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 this._panel?.focusContent();\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 = this._overlayRef || this._overlay.create(this._getOverlayConfig());\n this._overlayRef.attach(this._getPanelContent());\n if (!this._isTextTrigger()) {\n this._panel?.focusContent();\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 }\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.panel;\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 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._elementRef.nativeElement.tagName.toLowerCase();\n return tagName === 'input' || tagName === 'textarea' ? true : false;\n }\n\n private _getOverlayConfig() {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPositionStrategy(),\n scrollStrategy: this._overlay.scrollStrategies.block(),\n direction: this._directionality,\n });\n }\n\n private _getOverlayPositionStrategy(): FlexibleConnectedPositionStrategy {\n return this._overlay\n .position()\n .flexibleConnectedTo(this._elementRef)\n .withPositions(this._getOverlayPositions());\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 _getPanelContent() {\n const hasPanelChanged = this._panel?._templateRef !== this._panelContent?.templateRef;\n if (this._panel && (!this._panel || hasPanelChanged)) {\n this._panelContent = new TemplatePortal(this._panel._templateRef, this._viewContainerRef);\n }\n\n return this._panelContent;\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","/**\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.io/license\n */\n\nexport type AriaHasPopupValue = 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';\n\nimport {Directive, TemplateRef} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n@Directive({\n host: {\n 'class': 'cdk-combobox-panel',\n },\n selector: 'ng-template[cdkComboboxPanel]',\n exportAs: 'cdkComboboxPanel',\n})\nexport class CdkComboboxPanel<T = unknown> {\n valueUpdated: Subject<T | T[]> = new Subject<T | T[]>();\n contentIdUpdated: Subject<string> = new Subject<string>();\n contentTypeUpdated: Subject<AriaHasPopupValue> = new Subject<AriaHasPopupValue>();\n\n contentId: string = '';\n contentType: AriaHasPopupValue;\n\n constructor(readonly _templateRef: TemplateRef<unknown>) {}\n\n /** Tells the parent combobox to close the panel and sends back the content value. */\n closePanel(data?: T | T[]) {\n this.valueUpdated.next(data || []);\n }\n\n // TODO: instead of using a focus function, potentially use cdk/a11y focus trapping\n focusContent() {\n // TODO: Use an injected document here\n document.getElementById(this.contentId)?.focus();\n }\n\n /** Registers the content's id and the content type with the panel. */\n _registerContent(contentId: string, contentType: AriaHasPopupValue) {\n // If content has already been registered, no further contentIds are registered.\n if (this.contentType && this.contentType !== contentType) {\n return;\n }\n\n this.contentId = contentId;\n if (contentType !== 'listbox' && contentType !== 'dialog') {\n throw Error('CdkComboboxPanel currently only supports listbox or dialog content.');\n }\n this.contentType = contentType;\n\n this.contentIdUpdated.next(this.contentId);\n this.contentTypeUpdated.next(this.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.io/license\n */\n\nimport {\n Directive,\n ElementRef,\n Inject,\n InjectionToken,\n Input,\n OnInit,\n Optional,\n} from '@angular/core';\nimport {AriaHasPopupValue, CdkComboboxPanel} from './combobox-panel';\n\nexport const PANEL = new InjectionToken<CdkComboboxPanel>('CdkComboboxPanel');\n\nlet nextId = 0;\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 @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 = `cdk-combobox-popup-${nextId++}`;\n\n @Input('parentPanel') private readonly _explicitPanel: CdkComboboxPanel;\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLElement>,\n @Optional() @Inject(PANEL) readonly _parentPanel?: CdkComboboxPanel<T>,\n ) {}\n\n ngOnInit() {\n this.registerWithPanel();\n }\n\n registerWithPanel(): void {\n if (this._parentPanel === null || this._parentPanel === undefined) {\n this._explicitPanel._registerContent(this.id, this._role);\n } else {\n this._parentPanel._registerContent(this.id, this._role);\n }\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.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {CdkCombobox} from './combobox';\nimport {CdkComboboxPanel} from './combobox-panel';\nimport {CdkComboboxPopup} from './combobox-popup';\n\nconst EXPORTED_DECLARATIONS = [CdkCombobox, CdkComboboxPanel, CdkComboboxPopup];\n@NgModule({\n imports: [OverlayModule],\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n})\nexport class CdkComboboxModule {}\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.io/license\n */\n\nexport * from './combobox-module';\nexport * from './combobox';\nexport * from './combobox-panel';\nexport * from './combobox-popup';\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.io/license\n */\n\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAoCA,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;MAmBtD,WAAW;IAoDtB,YACmB,WAAoC,EACpC,QAAiB,EACf,iBAAmC,EACzB,eAAgC;QAH5C,gBAAW,GAAX,WAAW,CAAyB;QACpC,aAAQ,GAAR,QAAQ,CAAS;QACf,sBAAiB,GAAjB,iBAAiB,CAAkB;QACzB,oBAAe,GAAf,eAAe,CAAiB;QApCvD,cAAS,GAAY,KAAK,CAAC;QAS3B,iBAAY,GAAiB,CAAC,OAAO,CAAC,CAAC;QAUvC,iBAAY,GAAY,IAAI,CAAC;QAEG,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AAO,EAAE,oBAAoB;wBAC7B,aAAa,EAAE,MAAM;wBACrB,MAAM,EAAE,IAAI;wBACZ,UAAU,EAAE,IAAI;wBAChB,SAAS,EAAE,qBAAqB;qBACjC;iBACF;;0BA0BI,QAAQ;;0BAAI,MAAM;2BAAC,KAAK;4CAvBvB,IAAI;sBADP,KAAK;gBAUF,UAAU;sBADb,KAAK;gBASG,EAAE;sBAAV,KAAK;gBAEiC,cAAc;sBAApD,KAAK;uBAAC,aAAa;;;ACvDtB;;;;;;;AAcA,MAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;MAMnE,iBAAiB;;qHAAjB,iBAAiB;sHAAjB,iBAAiB,iBANC,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,aAElE,aAAa,aAFM,WAAW,EAAE,gBAAgB,EAAE,gBAAgB;sHAMjE,iBAAiB,YAJnB,CAAC,aAAa,CAAC;kGAIb,iBAAiB;kBAL7B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,OAAO,EAAE,qBAAqB;oBAC9B,YAAY,EAAE,qBAAqB;iBACpC;;;ACnBD;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"combobox.mjs","sources":["../../../../../../src/cdk-experimental/combobox/combobox.ts","../../../../../../src/cdk-experimental/combobox/combobox-popup.ts","../../../../../../src/cdk-experimental/combobox/combobox-module.ts","../../../../../../src/cdk-experimental/combobox/public-api.ts","../../../../../../src/cdk-experimental/combobox/index.ts","../../../../../../src/cdk-experimental/combobox/combobox_public_index.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.io/license\n */\nimport {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Inject,\n InjectionToken,\n Injector,\n Input,\n OnDestroy,\n Optional,\n Output,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport {TemplatePortal} from '@angular/cdk/portal';\nimport {\n ConnectedPosition,\n FlexibleConnectedPositionStrategy,\n Overlay,\n OverlayConfig,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {BooleanInput, coerceArray, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {_getEventTarget} from '@angular/cdk/platform';\nimport {DOWN_ARROW, ENTER, ESCAPE, TAB} from '@angular/cdk/keycodes';\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 @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 private _overlayRef: OverlayRef;\n private _panelPortal: TemplatePortal;\n\n contentId: string = '';\n contentType: AriaHasPopupValue;\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLElement>,\n private readonly _overlay: Overlay,\n protected readonly _viewContainerRef: ViewContainerRef,\n private readonly _injector: Injector,\n @Inject(DOCUMENT) private readonly _doc: any,\n @Optional() private readonly _directionality?: Directionality,\n ) {}\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 = this._overlayRef || this._overlay.create(this._getOverlayConfig());\n this._overlayRef.attach(this._getPanelContent());\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 }\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._elementRef.nativeElement.tagName.toLowerCase();\n return tagName === 'input' || tagName === 'textarea' ? true : false;\n }\n\n private _getOverlayConfig() {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPositionStrategy(),\n scrollStrategy: this._overlay.scrollStrategies.block(),\n direction: this._directionality,\n });\n }\n\n private _getOverlayPositionStrategy(): FlexibleConnectedPositionStrategy {\n return this._overlay\n .position()\n .flexibleConnectedTo(this._elementRef)\n .withPositions(this._getOverlayPositions());\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.io/license\n */\n\nimport {Directive, ElementRef, Inject, Input, OnInit} from '@angular/core';\nimport {AriaHasPopupValue, CDK_COMBOBOX, CdkCombobox} from './combobox';\n\nlet nextId = 0;\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 @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 = `cdk-combobox-popup-${nextId++}`;\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLElement>,\n @Inject(CDK_COMBOBOX) private readonly _combobox: CdkCombobox,\n ) {}\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.io/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],\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n})\nexport class CdkComboboxModule {}\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.io/license\n */\n\nexport * from './combobox-module';\nexport * from './combobox';\nexport * from './combobox-popup';\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.io/license\n */\n\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;AAMG;AAiCH,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;MAEtD,YAAY,GAAG,IAAI,cAAc,CAAc,cAAc,EAAE;MAoB/D,WAAW,CAAA;IA+CtB,WACmB,CAAA,WAAoC,EACpC,QAAiB,EACf,iBAAmC,EACrC,SAAmB,EACD,IAAS,EACf,eAAgC,EAAA;QAL5C,IAAW,CAAA,WAAA,GAAX,WAAW,CAAyB;QACpC,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAS;QACf,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAkB;QACrC,IAAS,CAAA,SAAA,GAAT,SAAS,CAAU;QACD,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAK;QACf,IAAe,CAAA,eAAA,GAAf,eAAe,CAAiB;QAvCvD,IAAS,CAAA,SAAA,GAAY,KAAK,CAAC;AAS3B,QAAA,IAAA,CAAA,YAAY,GAAiB,CAAC,OAAO,CAAC,CAAC;QAUvC,IAAY,CAAA,YAAA,GAAY,IAAI,CAAC;AAEG,QAAA,IAAA,CAAA,MAAM,GAAuB,IAAI,YAAY,EAAQ,CAAC;AACtD,QAAA,IAAA,CAAA,MAAM,GAAuB,IAAI,YAAY,EAAQ,CAAC;AACxD,QAAA,IAAA,CAAA,iBAAiB,GAAsB,IAAI,YAAY,EAE1F,CAAC;QAKJ,IAAS,CAAA,SAAA,GAAW,EAAE,CAAC;KAU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AAa,CAAC;AACxB,oBAAA,OAAO,EAAE,qBAAqB;AAC9B,oBAAA,YAAY,EAAE,qBAAqB;AACpC,iBAAA,CAAA;;;AClBD;;;;;;AAMG;;ACNH;;;;;;AAMG;;ACNH;;AAEG;;;;"}
@@ -1,4 +1,4 @@
1
- import { trigger, state, style, transition, animate } from '@angular/animations';
1
+ import { trigger, state, style, transition, group, animate, query, animateChild } from '@angular/animations';
2
2
  import * as i1 from '@angular/cdk/a11y';
3
3
  import { A11yModule } from '@angular/cdk/a11y';
4
4
  import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
@@ -208,8 +208,13 @@ class CdkDialogContainer extends BasePortalOutlet {
208
208
  element.tabIndex = -1;
209
209
  // The tabindex attribute should be removed to avoid navigating to that element again
210
210
  this._ngZone.runOutsideAngular(() => {
211
- element.addEventListener('blur', () => element.removeAttribute('tabindex'));
212
- element.addEventListener('mousedown', () => element.removeAttribute('tabindex'));
211
+ const callback = () => {
212
+ element.removeEventListener('blur', callback);
213
+ element.removeEventListener('mousedown', callback);
214
+ element.removeAttribute('tabindex');
215
+ };
216
+ element.addEventListener('blur', callback);
217
+ element.addEventListener('mousedown', callback);
213
218
  });
214
219
  }
215
220
  element.focus(options);
@@ -284,23 +289,35 @@ class CdkDialogContainer extends BasePortalOutlet {
284
289
  }
285
290
  }
286
291
  }
287
- CdkDialogContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkDialogContainer, deps: [{ token: i0.ElementRef }, { token: i1.FocusTrapFactory }, { token: i0.ChangeDetectorRef }, { token: i1.InteractivityChecker }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }, { token: DialogConfig }], target: i0.ɵɵFactoryTarget.Component });
288
- CdkDialogContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.4", type: CdkDialogContainer, selector: "cdk-dialog-container", host: { attributes: { "tabindex": "-1", "aria-modal": "true" }, listeners: { "@dialog.start": "_onAnimationStart($event)", "@dialog.done": "_animationDone.next($event)" }, properties: { "@dialog": "{\n value: _state,\n params: {\n enterAnimationDuration: _config.enterAnimationDuration,\n exitAnimationDuration: _config.exitAnimationDuration\n }\n }", "attr.role": "_config.role", "attr.aria-label": "_config.ariaLabel || null", "attr.aria-describedby": "_config.ariaDescribedBy" } }, viewQueries: [{ propertyName: "_portalHost", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet></ng-template>\n", styles: ["cdk-dialog-container{background:#fff;border-radius:5px;display:block;padding:10px}\n"], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [
292
+ CdkDialogContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkDialogContainer, deps: [{ token: i0.ElementRef }, { token: i1.FocusTrapFactory }, { token: i0.ChangeDetectorRef }, { token: i1.InteractivityChecker }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }, { token: DialogConfig }], target: i0.ɵɵFactoryTarget.Component });
293
+ CdkDialogContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.6", type: CdkDialogContainer, selector: "cdk-dialog-container", host: { attributes: { "tabindex": "-1", "aria-modal": "true" }, listeners: { "@dialog.start": "_onAnimationStart($event)", "@dialog.done": "_animationDone.next($event)" }, properties: { "@dialog": "{\n value: _state,\n params: {\n enterAnimationDuration: _config.enterAnimationDuration,\n exitAnimationDuration: _config.exitAnimationDuration\n }\n }", "attr.role": "_config.role", "attr.aria-label": "_config.ariaLabel || null", "attr.aria-describedby": "_config.ariaDescribedBy" } }, viewQueries: [{ propertyName: "_portalHost", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet></ng-template>\n", styles: ["cdk-dialog-container{background:#fff;border-radius:5px;display:block;padding:10px}\n"], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [
289
294
  trigger('dialog', [
290
295
  state('enter', style({ opacity: 1 })),
291
296
  state('exit, void', style({ opacity: 0 })),
292
- transition('* => enter', animate('{{enterAnimationDuration}}')),
293
- transition('* => exit, * => void', animate('{{exitAnimationDuration}}')),
297
+ transition('* => enter', group([
298
+ animate('{{enterAnimationDuration}}'),
299
+ query('@*', animateChild(), { optional: true }),
300
+ ])),
301
+ transition('* => exit, * => void', group([
302
+ animate('{{exitAnimationDuration}}'),
303
+ query('@*', animateChild(), { optional: true }),
304
+ ])),
294
305
  ]),
295
306
  ], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: CdkDialogContainer, decorators: [{
307
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: CdkDialogContainer, decorators: [{
297
308
  type: Component,
298
309
  args: [{ selector: 'cdk-dialog-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, animations: [
299
310
  trigger('dialog', [
300
311
  state('enter', style({ opacity: 1 })),
301
312
  state('exit, void', style({ opacity: 0 })),
302
- transition('* => enter', animate('{{enterAnimationDuration}}')),
303
- transition('* => exit, * => void', animate('{{exitAnimationDuration}}')),
313
+ transition('* => enter', group([
314
+ animate('{{enterAnimationDuration}}'),
315
+ query('@*', animateChild(), { optional: true }),
316
+ ])),
317
+ transition('* => exit, * => void', group([
318
+ animate('{{exitAnimationDuration}}'),
319
+ query('@*', animateChild(), { optional: true }),
320
+ ])),
304
321
  ]),
305
322
  ], host: {
306
323
  '[@dialog]': `{
@@ -692,9 +709,9 @@ class Dialog {
692
709
  return { ...new dialogConfig(), ...config };
693
710
  }
694
711
  }
695
- Dialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: Dialog, deps: [{ token: i1$1.Overlay }, { token: i0.Injector }, { token: DIALOG_REF }, { token: DIALOG_SCROLL_STRATEGY }, { token: Dialog, optional: true, skipSelf: true }, { token: i2.Location, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
696
- Dialog.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: Dialog });
697
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: Dialog, decorators: [{
712
+ Dialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: Dialog, deps: [{ token: i1$1.Overlay }, { token: i0.Injector }, { token: DIALOG_REF }, { token: DIALOG_SCROLL_STRATEGY }, { token: Dialog, optional: true, skipSelf: true }, { token: i2.Location, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
713
+ Dialog.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: Dialog });
714
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: Dialog, decorators: [{
698
715
  type: Injectable
699
716
  }], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.Injector }, { type: i0.Type, decorators: [{
700
717
  type: Inject,
@@ -719,13 +736,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4",
719
736
  */
720
737
  class DialogModule {
721
738
  }
722
- DialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
723
- DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: DialogModule, declarations: [CdkDialogContainer], imports: [OverlayModule, PortalModule, A11yModule], exports: [
739
+ DialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
740
+ DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: DialogModule, declarations: [CdkDialogContainer], imports: [OverlayModule, PortalModule, A11yModule], exports: [
724
741
  // Re-export the PortalModule so that people extending the `CdkDialogContainer`
725
742
  // don't have to remember to import it or be faced with an unhelpful error.
726
743
  PortalModule,
727
744
  CdkDialogContainer] });
728
- DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: DialogModule, providers: [
745
+ DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: DialogModule, providers: [
729
746
  Dialog,
730
747
  MAT_DIALOG_SCROLL_STRATEGY_PROVIDER,
731
748
  { provide: DIALOG_REF, useValue: DialogRef },
@@ -735,7 +752,7 @@ DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
735
752
  // Re-export the PortalModule so that people extending the `CdkDialogContainer`
736
753
  // don't have to remember to import it or be faced with an unhelpful error.
737
754
  PortalModule] });
738
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.4", ngImport: i0, type: DialogModule, decorators: [{
755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: DialogModule, decorators: [{
739
756
  type: NgModule,
740
757
  args: [{
741
758
  imports: [OverlayModule, PortalModule, A11yModule],