@angular/cdk-experimental 21.0.0-next.6 → 21.0.0-next.9

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 (74) hide show
  1. package/fesm2022/_polyfill-chunk.mjs.map +1 -1
  2. package/fesm2022/cdk-experimental.mjs +1 -1
  3. package/fesm2022/cdk-experimental.mjs.map +1 -1
  4. package/fesm2022/column-resize.mjs.map +1 -1
  5. package/fesm2022/popover-edit.mjs.map +1 -1
  6. package/fesm2022/scrolling.mjs.map +1 -1
  7. package/fesm2022/selection.mjs.map +1 -1
  8. package/fesm2022/table-scroll-container.mjs.map +1 -1
  9. package/package.json +3 -38
  10. package/types/column-resize.d.ts +37 -37
  11. package/types/popover-edit.d.ts +30 -30
  12. package/types/scrolling.d.ts +6 -6
  13. package/types/selection.d.ts +14 -14
  14. package/types/table-scroll-container.d.ts +6 -6
  15. package/fesm2022/_accordion-chunk.mjs +0 -153
  16. package/fesm2022/_accordion-chunk.mjs.map +0 -1
  17. package/fesm2022/_combobox-chunk.mjs +0 -278
  18. package/fesm2022/_combobox-chunk.mjs.map +0 -1
  19. package/fesm2022/_combobox-listbox-chunk.mjs +0 -278
  20. package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
  21. package/fesm2022/_combobox-tree-chunk.mjs +0 -398
  22. package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
  23. package/fesm2022/_expansion-chunk.mjs +0 -87
  24. package/fesm2022/_expansion-chunk.mjs.map +0 -1
  25. package/fesm2022/_list-chunk.mjs +0 -374
  26. package/fesm2022/_list-chunk.mjs.map +0 -1
  27. package/fesm2022/_list-navigation-chunk.mjs +0 -131
  28. package/fesm2022/_list-navigation-chunk.mjs.map +0 -1
  29. package/fesm2022/_pointer-event-manager-chunk.mjs +0 -145
  30. package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
  31. package/fesm2022/_tabs-chunk.mjs +0 -211
  32. package/fesm2022/_tabs-chunk.mjs.map +0 -1
  33. package/fesm2022/_toolbar-chunk.mjs +0 -273
  34. package/fesm2022/_toolbar-chunk.mjs.map +0 -1
  35. package/fesm2022/_toolbar-radio-group-chunk.mjs +0 -222
  36. package/fesm2022/_toolbar-radio-group-chunk.mjs.map +0 -1
  37. package/fesm2022/accordion.mjs +0 -195
  38. package/fesm2022/accordion.mjs.map +0 -1
  39. package/fesm2022/combobox.mjs +0 -131
  40. package/fesm2022/combobox.mjs.map +0 -1
  41. package/fesm2022/deferred-content.mjs +0 -59
  42. package/fesm2022/deferred-content.mjs.map +0 -1
  43. package/fesm2022/listbox.mjs +0 -204
  44. package/fesm2022/listbox.mjs.map +0 -1
  45. package/fesm2022/radio-group.mjs +0 -200
  46. package/fesm2022/radio-group.mjs.map +0 -1
  47. package/fesm2022/tabs.mjs +0 -303
  48. package/fesm2022/tabs.mjs.map +0 -1
  49. package/fesm2022/toolbar.mjs +0 -221
  50. package/fesm2022/toolbar.mjs.map +0 -1
  51. package/fesm2022/tree.mjs +0 -333
  52. package/fesm2022/tree.mjs.map +0 -1
  53. package/fesm2022/ui-patterns.mjs +0 -24
  54. package/fesm2022/ui-patterns.mjs.map +0 -1
  55. package/types/_accordion-chunk.d.ts +0 -90
  56. package/types/_combobox-chunk.d.ts +0 -138
  57. package/types/_expansion-chunk.d.ts +0 -71
  58. package/types/_list-chunk.d.ts +0 -209
  59. package/types/_list-navigation-chunk.d.ts +0 -101
  60. package/types/_listbox-chunk.d.ts +0 -105
  61. package/types/_pointer-event-manager-chunk.d.ts +0 -98
  62. package/types/_radio-group-chunk.d.ts +0 -92
  63. package/types/_tabs-chunk.d.ts +0 -138
  64. package/types/_toolbar-chunk.d.ts +0 -150
  65. package/types/_tree-chunk.d.ts +0 -139
  66. package/types/accordion.d.ts +0 -95
  67. package/types/combobox.d.ts +0 -54
  68. package/types/deferred-content.d.ts +0 -37
  69. package/types/listbox.d.ts +0 -99
  70. package/types/radio-group.d.ts +0 -85
  71. package/types/tabs.d.ts +0 -160
  72. package/types/toolbar.d.ts +0 -115
  73. package/types/tree.d.ts +0 -155
  74. package/types/ui-patterns.d.ts +0 -157
@@ -1,195 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, input, signal, afterRenderEffect, Directive, ElementRef, booleanAttribute, computed, contentChildren, model } from '@angular/core';
3
- import { _IdGenerator } from '@angular/cdk/a11y';
4
- import { Directionality } from '@angular/cdk/bidi';
5
- import * as i1 from '@angular/cdk-experimental/deferred-content';
6
- import { DeferredContentAware, DeferredContent } from '@angular/cdk-experimental/deferred-content';
7
- import { AccordionPanelPattern, AccordionTriggerPattern, AccordionGroupPattern } from './_accordion-chunk.mjs';
8
- import './_expansion-chunk.mjs';
9
- import './_list-navigation-chunk.mjs';
10
- import './_pointer-event-manager-chunk.mjs';
11
-
12
- /**
13
- * Represents the content panel of an accordion item. It is controlled by an
14
- * associated `CdkAccordionTrigger`.
15
- */
16
- class CdkAccordionPanel {
17
- /** The DeferredContentAware host directive. */
18
- _deferredContentAware = inject(DeferredContentAware);
19
- /** A global unique identifier for the panel. */
20
- _id = inject(_IdGenerator).getId('cdk-accordion-trigger-');
21
- /** A local unique identifier for the panel, used to match with its trigger's value. */
22
- value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
23
- /** The parent accordion trigger pattern that controls this panel. This is set by CdkAccordionGroup. */
24
- accordionTrigger = signal(undefined, ...(ngDevMode ? [{ debugName: "accordionTrigger" }] : []));
25
- /** The UI pattern instance for this panel. */
26
- pattern = new AccordionPanelPattern({
27
- id: () => this._id,
28
- value: this.value,
29
- accordionTrigger: () => this.accordionTrigger(),
30
- });
31
- constructor() {
32
- // Connect the panel's hidden state to the DeferredContentAware's visibility.
33
- afterRenderEffect(() => {
34
- this._deferredContentAware.contentVisible.set(!this.pattern.hidden());
35
- });
36
- }
37
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkAccordionPanel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
38
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0-next.2", type: CdkAccordionPanel, isStandalone: true, selector: "[cdkAccordionPanel]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "region" }, properties: { "attr.id": "pattern.id()", "attr.aria-labelledby": "pattern.accordionTrigger()?.id()", "attr.inert": "pattern.hidden() ? true : null" }, classAttribute: "cdk-accordion-panel" }, exportAs: ["cdkAccordionPanel"], hostDirectives: [{ directive: i1.DeferredContentAware, inputs: ["preserveContent", "preserveContent"] }], ngImport: i0 });
39
- }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkAccordionPanel, decorators: [{
41
- type: Directive,
42
- args: [{
43
- selector: '[cdkAccordionPanel]',
44
- exportAs: 'cdkAccordionPanel',
45
- hostDirectives: [
46
- {
47
- directive: DeferredContentAware,
48
- inputs: ['preserveContent'],
49
- },
50
- ],
51
- host: {
52
- 'class': 'cdk-accordion-panel',
53
- 'role': 'region',
54
- '[attr.id]': 'pattern.id()',
55
- '[attr.aria-labelledby]': 'pattern.accordionTrigger()?.id()',
56
- '[attr.inert]': 'pattern.hidden() ? true : null',
57
- },
58
- }]
59
- }], ctorParameters: () => [] });
60
- /**
61
- * Represents the trigger button for an accordion item. It controls the expansion
62
- * state of an associated `CdkAccordionPanel`.
63
- */
64
- class CdkAccordionTrigger {
65
- /** A global unique identifier for the trigger. */
66
- _id = inject(_IdGenerator).getId('cdk-accordion-trigger-');
67
- /** A reference to the trigger element. */
68
- _elementRef = inject(ElementRef);
69
- /** The parent CdkAccordionGroup. */
70
- _accordionGroup = inject(CdkAccordionGroup);
71
- /** A local unique identifier for the trigger, used to match with its panel's value. */
72
- value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
73
- /** Whether the trigger is disabled. */
74
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
75
- /**
76
- * Whether this trigger is completely inaccessible.
77
- *
78
- * TODO(ok7sai): Consider move this to UI patterns.
79
- */
80
- hardDisabled = computed(() => this.pattern.disabled() && this.pattern.tabindex() < 0, ...(ngDevMode ? [{ debugName: "hardDisabled" }] : []));
81
- /** The accordion panel pattern controlled by this trigger. This is set by CdkAccordionGroup. */
82
- accordionPanel = signal(undefined, ...(ngDevMode ? [{ debugName: "accordionPanel" }] : []));
83
- /** The UI pattern instance for this trigger. */
84
- pattern = new AccordionTriggerPattern({
85
- id: () => this._id,
86
- value: this.value,
87
- disabled: this.disabled,
88
- element: () => this._elementRef.nativeElement,
89
- accordionGroup: computed(() => this._accordionGroup.pattern),
90
- accordionPanel: this.accordionPanel,
91
- });
92
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkAccordionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
93
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0-next.2", type: CdkAccordionTrigger, isStandalone: true, selector: "[cdkAccordionTrigger]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "button" }, listeners: { "keydown": "pattern.onKeydown($event)", "pointerdown": "pattern.onPointerdown($event)", "focusin": "pattern.onFocus($event)" }, properties: { "class.cdk-active": "pattern.active()", "id": "pattern.id()", "attr.aria-expanded": "pattern.expanded()", "attr.aria-controls": "pattern.controls()", "attr.aria-disabled": "pattern.disabled()", "attr.disabled": "hardDisabled() ? true : null", "attr.tabindex": "pattern.tabindex()" }, classAttribute: "cdk-accordion-trigger" }, exportAs: ["cdkAccordionTrigger"], ngImport: i0 });
94
- }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkAccordionTrigger, decorators: [{
96
- type: Directive,
97
- args: [{
98
- selector: '[cdkAccordionTrigger]',
99
- exportAs: 'cdkAccordionTrigger',
100
- host: {
101
- 'class': 'cdk-accordion-trigger',
102
- '[class.cdk-active]': 'pattern.active()',
103
- 'role': 'button',
104
- '[id]': 'pattern.id()',
105
- '[attr.aria-expanded]': 'pattern.expanded()',
106
- '[attr.aria-controls]': 'pattern.controls()',
107
- '[attr.aria-disabled]': 'pattern.disabled()',
108
- '[attr.disabled]': 'hardDisabled() ? true : null',
109
- '[attr.tabindex]': 'pattern.tabindex()',
110
- '(keydown)': 'pattern.onKeydown($event)',
111
- '(pointerdown)': 'pattern.onPointerdown($event)',
112
- '(focusin)': 'pattern.onFocus($event)',
113
- },
114
- }]
115
- }] });
116
- /**
117
- * Container for a group of accordion items. It manages the overall state and
118
- * interactions of the accordion, such as keyboard navigation and expansion mode.
119
- */
120
- class CdkAccordionGroup {
121
- /** A reference to the group element. */
122
- _elementRef = inject(ElementRef);
123
- /** The CdkAccordionTriggers nested inside this group. */
124
- _triggers = contentChildren(CdkAccordionTrigger, ...(ngDevMode ? [{ debugName: "_triggers", descendants: true }] : [{ descendants: true }]));
125
- /** The CdkAccordionPanels nested inside this group. */
126
- _panels = contentChildren(CdkAccordionPanel, ...(ngDevMode ? [{ debugName: "_panels", descendants: true }] : [{ descendants: true }]));
127
- /** The text direction (ltr or rtl). */
128
- textDirection = inject(Directionality).valueSignal;
129
- /** Whether the entire accordion group is disabled. */
130
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
131
- /** Whether multiple accordion items can be expanded simultaneously. */
132
- multiExpandable = input(true, ...(ngDevMode ? [{ debugName: "multiExpandable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
133
- /** The values of the current selected/expanded accordions. */
134
- value = model([], ...(ngDevMode ? [{ debugName: "value" }] : []));
135
- /** Whether disabled items should be skipped during keyboard navigation. */
136
- skipDisabled = input(true, ...(ngDevMode ? [{ debugName: "skipDisabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
137
- /** Whether keyboard navigation should wrap around from the last item to the first, and vice-versa. */
138
- wrap = input(false, ...(ngDevMode ? [{ debugName: "wrap", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
139
- /** The UI pattern instance for this accordion group. */
140
- pattern = new AccordionGroupPattern({
141
- ...this,
142
- // TODO(ok7sai): Consider making `activeItem` an internal state in the pattern and call
143
- // `setDefaultState` in the CDK.
144
- activeItem: signal(undefined),
145
- items: computed(() => this._triggers().map(trigger => trigger.pattern)),
146
- expandedIds: this.value,
147
- // TODO(ok7sai): Investigate whether an accordion should support horizontal mode.
148
- orientation: () => 'vertical',
149
- element: () => this._elementRef.nativeElement,
150
- });
151
- constructor() {
152
- // Effect to link triggers with their corresponding panels and update the group's items.
153
- afterRenderEffect(() => {
154
- const triggers = this._triggers();
155
- const panels = this._panels();
156
- for (const trigger of triggers) {
157
- const panel = panels.find(p => p.value() === trigger.value());
158
- trigger.accordionPanel.set(panel?.pattern);
159
- if (panel) {
160
- panel.accordionTrigger.set(trigger.pattern);
161
- }
162
- }
163
- });
164
- }
165
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkAccordionGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
166
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.2.0-next.2", type: CdkAccordionGroup, isStandalone: true, selector: "[cdkAccordionGroup]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiExpandable: { classPropertyName: "multiExpandable", publicName: "multiExpandable", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, skipDisabled: { classPropertyName: "skipDisabled", publicName: "skipDisabled", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { classAttribute: "cdk-accordion-group" }, queries: [{ propertyName: "_triggers", predicate: CdkAccordionTrigger, descendants: true, isSignal: true }, { propertyName: "_panels", predicate: CdkAccordionPanel, descendants: true, isSignal: true }], exportAs: ["cdkAccordionGroup"], ngImport: i0 });
167
- }
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkAccordionGroup, decorators: [{
169
- type: Directive,
170
- args: [{
171
- selector: '[cdkAccordionGroup]',
172
- exportAs: 'cdkAccordionGroup',
173
- host: {
174
- 'class': 'cdk-accordion-group',
175
- },
176
- }]
177
- }], ctorParameters: () => [] });
178
- /**
179
- * A structural directive that marks the `ng-template` to be used as the content
180
- * for a `CdkAccordionPanel`. This content can be lazily loaded.
181
- */
182
- class CdkAccordionContent {
183
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkAccordionContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
184
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: CdkAccordionContent, isStandalone: true, selector: "ng-template[cdkAccordionContent]", hostDirectives: [{ directive: i1.DeferredContent }], ngImport: i0 });
185
- }
186
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkAccordionContent, decorators: [{
187
- type: Directive,
188
- args: [{
189
- selector: 'ng-template[cdkAccordionContent]',
190
- hostDirectives: [DeferredContent],
191
- }]
192
- }] });
193
-
194
- export { CdkAccordionContent, CdkAccordionGroup, CdkAccordionPanel, CdkAccordionTrigger };
195
- //# sourceMappingURL=accordion.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accordion.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/accordion/accordion.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 Directive,\n input,\n ElementRef,\n inject,\n contentChildren,\n afterRenderEffect,\n signal,\n model,\n booleanAttribute,\n computed,\n WritableSignal,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {DeferredContent, DeferredContentAware} from '@angular/cdk-experimental/deferred-content';\nimport {\n AccordionGroupPattern,\n AccordionPanelPattern,\n AccordionTriggerPattern,\n} from '../ui-patterns';\n\n/**\n * Represents the content panel of an accordion item. It is controlled by an\n * associated `CdkAccordionTrigger`.\n */\n@Directive({\n selector: '[cdkAccordionPanel]',\n exportAs: 'cdkAccordionPanel',\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n host: {\n 'class': 'cdk-accordion-panel',\n 'role': 'region',\n '[attr.id]': 'pattern.id()',\n '[attr.aria-labelledby]': 'pattern.accordionTrigger()?.id()',\n '[attr.inert]': 'pattern.hidden() ? true : null',\n },\n})\nexport class CdkAccordionPanel {\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware);\n\n /** A global unique identifier for the panel. */\n private readonly _id = inject(_IdGenerator).getId('cdk-accordion-trigger-');\n\n /** A local unique identifier for the panel, used to match with its trigger's value. */\n value = input.required<string>();\n\n /** The parent accordion trigger pattern that controls this panel. This is set by CdkAccordionGroup. */\n readonly accordionTrigger: WritableSignal<AccordionTriggerPattern | undefined> =\n signal(undefined);\n\n /** The UI pattern instance for this panel. */\n readonly pattern: AccordionPanelPattern = new AccordionPanelPattern({\n id: () => this._id,\n value: this.value,\n accordionTrigger: () => this.accordionTrigger(),\n });\n\n constructor() {\n // Connect the panel's hidden state to the DeferredContentAware's visibility.\n afterRenderEffect(() => {\n this._deferredContentAware.contentVisible.set(!this.pattern.hidden());\n });\n }\n}\n\n/**\n * Represents the trigger button for an accordion item. It controls the expansion\n * state of an associated `CdkAccordionPanel`.\n */\n@Directive({\n selector: '[cdkAccordionTrigger]',\n exportAs: 'cdkAccordionTrigger',\n host: {\n 'class': 'cdk-accordion-trigger',\n '[class.cdk-active]': 'pattern.active()',\n 'role': 'button',\n '[id]': 'pattern.id()',\n '[attr.aria-expanded]': 'pattern.expanded()',\n '[attr.aria-controls]': 'pattern.controls()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.disabled]': 'hardDisabled() ? true : null',\n '[attr.tabindex]': 'pattern.tabindex()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n '(focusin)': 'pattern.onFocus($event)',\n },\n})\nexport class CdkAccordionTrigger {\n /** A global unique identifier for the trigger. */\n private readonly _id = inject(_IdGenerator).getId('cdk-accordion-trigger-');\n\n /** A reference to the trigger element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkAccordionGroup. */\n private readonly _accordionGroup = inject(CdkAccordionGroup);\n\n /** A local unique identifier for the trigger, used to match with its panel's value. */\n value = input.required<string>();\n\n /** Whether the trigger is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /**\n * Whether this trigger is completely inaccessible.\n *\n * TODO(ok7sai): Consider move this to UI patterns.\n */\n readonly hardDisabled = computed(() => this.pattern.disabled() && this.pattern.tabindex() < 0);\n\n /** The accordion panel pattern controlled by this trigger. This is set by CdkAccordionGroup. */\n readonly accordionPanel: WritableSignal<AccordionPanelPattern | undefined> = signal(undefined);\n\n /** The UI pattern instance for this trigger. */\n readonly pattern: AccordionTriggerPattern = new AccordionTriggerPattern({\n id: () => this._id,\n value: this.value,\n disabled: this.disabled,\n element: () => this._elementRef.nativeElement,\n accordionGroup: computed(() => this._accordionGroup.pattern),\n accordionPanel: this.accordionPanel,\n });\n}\n\n/**\n * Container for a group of accordion items. It manages the overall state and\n * interactions of the accordion, such as keyboard navigation and expansion mode.\n */\n@Directive({\n selector: '[cdkAccordionGroup]',\n exportAs: 'cdkAccordionGroup',\n host: {\n 'class': 'cdk-accordion-group',\n },\n})\nexport class CdkAccordionGroup {\n /** A reference to the group element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The CdkAccordionTriggers nested inside this group. */\n protected readonly _triggers = contentChildren(CdkAccordionTrigger, {descendants: true});\n\n /** The CdkAccordionPanels nested inside this group. */\n protected readonly _panels = contentChildren(CdkAccordionPanel, {descendants: true});\n\n /** The text direction (ltr or rtl). */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether the entire accordion group is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** Whether multiple accordion items can be expanded simultaneously. */\n multiExpandable = input(true, {transform: booleanAttribute});\n\n /** The values of the current selected/expanded accordions. */\n value = model<string[]>([]);\n\n /** Whether disabled items should be skipped during keyboard navigation. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** Whether keyboard navigation should wrap around from the last item to the first, and vice-versa. */\n wrap = input(false, {transform: booleanAttribute});\n\n /** The UI pattern instance for this accordion group. */\n readonly pattern: AccordionGroupPattern = new AccordionGroupPattern({\n ...this,\n // TODO(ok7sai): Consider making `activeItem` an internal state in the pattern and call\n // `setDefaultState` in the CDK.\n activeItem: signal(undefined),\n items: computed(() => this._triggers().map(trigger => trigger.pattern)),\n expandedIds: this.value,\n // TODO(ok7sai): Investigate whether an accordion should support horizontal mode.\n orientation: () => 'vertical',\n element: () => this._elementRef.nativeElement,\n });\n\n constructor() {\n // Effect to link triggers with their corresponding panels and update the group's items.\n afterRenderEffect(() => {\n const triggers = this._triggers();\n const panels = this._panels();\n\n for (const trigger of triggers) {\n const panel = panels.find(p => p.value() === trigger.value());\n trigger.accordionPanel.set(panel?.pattern);\n if (panel) {\n panel.accordionTrigger.set(trigger.pattern);\n }\n }\n });\n }\n}\n\n/**\n * A structural directive that marks the `ng-template` to be used as the content\n * for a `CdkAccordionPanel`. This content can be lazily loaded.\n */\n@Directive({\n selector: 'ng-template[cdkAccordionContent]',\n hostDirectives: [DeferredContent],\n})\nexport class CdkAccordionContent {}\n"],"names":[],"mappings":";;;;;;;;;;;AA8BA;;;AAGG;MAkBU,iBAAiB,CAAA;;AAEX,IAAA,qBAAqB,GAAG,MAAM,CAAC,oBAAoB,CAAC;;IAGpD,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;;AAG3E,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAU;;AAGvB,IAAA,gBAAgB,GACvB,MAAM,CAAC,SAAS,4DAAC;;IAGV,OAAO,GAA0B,IAAI,qBAAqB,CAAC;AAClE,QAAA,EAAE,EAAE,MAAM,IAAI,CAAC,GAAG;QAClB,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,QAAA,gBAAgB,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE;AAChD,KAAA,CAAC;AAEF,IAAA,WAAA,GAAA;;QAEE,iBAAiB,CAAC,MAAK;AACrB,YAAA,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;AACvE,SAAC,CAAC;;8GAzBO,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;kGAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA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AE,CAAC,eAAe,CAAC;AAClC,iBAAA;;;;;"}
@@ -1,131 +0,0 @@
1
- import * as i0 from '@angular/core';
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';
7
-
8
- class CdkCombobox {
9
- /** The element that the combobox is attached to. */
10
- _elementRef = inject(ElementRef);
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);
35
- }
36
- });
37
- afterRenderEffect(() => {
38
- if (!this._hasBeenFocused() && this.pattern.isFocused()) {
39
- this._hasBeenFocused.set(true);
40
- }
41
- });
42
- }
43
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkCombobox, deps: [], target: i0.ɵɵFactoryTarget.Directive });
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 });
45
- }
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkCombobox, decorators: [{
47
- type: Directive,
48
- args: [{
49
- selector: '[cdkCombobox]',
50
- exportAs: 'cdkCombobox',
51
- hostDirectives: [
52
- {
53
- directive: DeferredContentAware,
54
- inputs: ['preserveContent'],
55
- },
56
- ],
57
- host: {
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)',
64
- },
65
- }]
66
- }], ctorParameters: () => [] });
67
- class CdkComboboxInput {
68
- /** The element that the combobox is attached to. */
69
- _elementRef = inject(ElementRef);
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
- });
82
- }
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 });
85
- }
86
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxInput, decorators: [{
87
- type: Directive,
88
- args: [{
89
- selector: 'input[cdkComboboxInput]',
90
- exportAs: 'cdkComboboxInput',
91
- host: {
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()',
99
- },
100
- }]
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 });
105
- }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkComboboxPopupContainer, decorators: [{
107
- type: Directive,
108
- args: [{
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',
127
- }]
128
- }] });
129
-
130
- export { CdkCombobox, CdkComboboxInput, CdkComboboxPopup, CdkComboboxPopupContainer };
131
- //# sourceMappingURL=combobox.mjs.map
@@ -1 +0,0 @@
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,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AA,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,59 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { signal, model, Directive, inject, TemplateRef, ViewContainerRef, afterRenderEffect } from '@angular/core';
3
-
4
- /**
5
- * A container directive controls the visibility of its content.
6
- */
7
- class DeferredContentAware {
8
- contentVisible = signal(false, ...(ngDevMode ? [{ debugName: "contentVisible" }] : []));
9
- preserveContent = model(false, ...(ngDevMode ? [{ debugName: "preserveContent" }] : []));
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 } }, outputs: { preserveContent: "preserveContentChange" }, ngImport: i0 });
12
- }
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: DeferredContentAware, decorators: [{
14
- type: Directive
15
- }] });
16
- /**
17
- * DeferredContent loads/unloads the content based on the visibility.
18
- * The visibilty signal is sent from a parent directive implements
19
- * DeferredContentAware.
20
- *
21
- * Use this directive as a host directive. For example:
22
- *
23
- * ```ts
24
- * @Directive({
25
- * selector: 'ng-template[cdkAccordionContent]',
26
- * hostDirectives: [DeferredContent],
27
- * })
28
- * class CdkAccordionContent {}
29
- * ```
30
- */
31
- class DeferredContent {
32
- _deferredContentAware = inject(DeferredContentAware);
33
- _templateRef = inject(TemplateRef);
34
- _viewContainerRef = inject(ViewContainerRef);
35
- _isRendered = false;
36
- constructor() {
37
- afterRenderEffect(() => {
38
- if (this._deferredContentAware.contentVisible()) {
39
- if (this._isRendered)
40
- return;
41
- this._viewContainerRef.clear();
42
- this._viewContainerRef.createEmbeddedView(this._templateRef);
43
- this._isRendered = true;
44
- }
45
- else if (!this._deferredContentAware.preserveContent()) {
46
- this._viewContainerRef.clear();
47
- this._isRendered = false;
48
- }
49
- });
50
- }
51
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: DeferredContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
52
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: DeferredContent, isStandalone: true, ngImport: i0 });
53
- }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: DeferredContent, decorators: [{
55
- type: Directive
56
- }], ctorParameters: () => [] });
57
-
58
- export { DeferredContent, DeferredContentAware };
59
- //# sourceMappingURL=deferred-content.mjs.map
@@ -1 +0,0 @@
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,MA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