@angular/aria 21.0.0-next.8 → 21.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_adev_assets/aria-accordion.json +373 -0
- package/_adev_assets/aria-combobox.json +383 -0
- package/_adev_assets/aria-grid.json +578 -0
- package/_adev_assets/aria-listbox.json +511 -0
- package/_adev_assets/aria-menu.json +752 -0
- package/_adev_assets/aria-radio-group.json +389 -0
- package/_adev_assets/aria-tabs.json +987 -0
- package/_adev_assets/aria-toolbar.json +717 -0
- package/_adev_assets/aria-tree.json +1067 -0
- package/fesm2022/_widget-chunk.mjs +827 -0
- package/fesm2022/_widget-chunk.mjs.map +1 -0
- package/fesm2022/accordion.mjs +371 -172
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -2
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +304 -114
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs +89 -49
- package/fesm2022/deferred-content.mjs.map +1 -1
- package/fesm2022/grid.mjs +517 -0
- package/fesm2022/grid.mjs.map +1 -0
- package/fesm2022/listbox.mjs +384 -183
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +535 -0
- package/fesm2022/menu.mjs.map +1 -0
- package/fesm2022/private.mjs +2347 -0
- package/fesm2022/private.mjs.map +1 -0
- package/fesm2022/radio-group.mjs +320 -179
- package/fesm2022/radio-group.mjs.map +1 -1
- package/fesm2022/tabs.mjs +483 -274
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +330 -199
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +511 -309
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +14 -6
- package/types/_grid-chunk.d.ts +546 -0
- package/types/accordion.d.ts +4 -4
- package/types/combobox.d.ts +18 -5
- package/types/deferred-content.d.ts +1 -0
- package/types/grid.d.ts +111 -0
- package/types/listbox.d.ts +6 -3
- package/types/menu.d.ts +158 -0
- package/types/{ui-patterns.d.ts → private.d.ts} +333 -133
- package/types/radio-group.d.ts +5 -3
- package/types/tabs.d.ts +4 -4
- package/types/toolbar.d.ts +4 -4
- package/types/tree.d.ts +17 -32
- package/fesm2022/ui-patterns.mjs +0 -2504
- package/fesm2022/ui-patterns.mjs.map +0 -1
|
@@ -1,59 +1,99 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, model, Directive, inject, TemplateRef, ViewContainerRef, afterRenderEffect } from '@angular/core';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* A container directive controls the visibility of its content.
|
|
6
|
-
*/
|
|
7
4
|
class DeferredContentAware {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
contentVisible = signal(false, ...(ngDevMode ? [{
|
|
6
|
+
debugName: "contentVisible"
|
|
7
|
+
}] : []));
|
|
8
|
+
preserveContent = model(false, ...(ngDevMode ? [{
|
|
9
|
+
debugName: "preserveContent"
|
|
10
|
+
}] : []));
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
|
+
minVersion: "12.0.0",
|
|
13
|
+
version: "20.2.0-next.2",
|
|
14
|
+
ngImport: i0,
|
|
15
|
+
type: DeferredContentAware,
|
|
16
|
+
deps: [],
|
|
17
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
18
|
+
});
|
|
19
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
20
|
+
minVersion: "17.1.0",
|
|
21
|
+
version: "20.2.0-next.2",
|
|
22
|
+
type: DeferredContentAware,
|
|
23
|
+
isStandalone: true,
|
|
24
|
+
inputs: {
|
|
25
|
+
preserveContent: {
|
|
26
|
+
classPropertyName: "preserveContent",
|
|
27
|
+
publicName: "preserveContent",
|
|
28
|
+
isSignal: true,
|
|
29
|
+
isRequired: false,
|
|
30
|
+
transformFunction: null
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
outputs: {
|
|
34
|
+
preserveContent: "preserveContentChange"
|
|
35
|
+
},
|
|
36
|
+
ngImport: i0
|
|
37
|
+
});
|
|
12
38
|
}
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
* ```ts
|
|
24
|
-
* @Directive({
|
|
25
|
-
* selector: 'ng-template[AccordionContent]',
|
|
26
|
-
* hostDirectives: [DeferredContent],
|
|
27
|
-
* })
|
|
28
|
-
* class AccordionContent {}
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
40
|
+
minVersion: "12.0.0",
|
|
41
|
+
version: "20.2.0-next.2",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
type: DeferredContentAware,
|
|
44
|
+
decorators: [{
|
|
45
|
+
type: Directive
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
31
48
|
class DeferredContent {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
_deferredContentAware = inject(DeferredContentAware, {
|
|
50
|
+
optional: true
|
|
51
|
+
});
|
|
52
|
+
_templateRef = inject(TemplateRef);
|
|
53
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
54
|
+
_isRendered = false;
|
|
55
|
+
deferredContentAware = signal(this._deferredContentAware, ...(ngDevMode ? [{
|
|
56
|
+
debugName: "deferredContentAware"
|
|
57
|
+
}] : []));
|
|
58
|
+
constructor() {
|
|
59
|
+
afterRenderEffect(() => {
|
|
60
|
+
if (this.deferredContentAware()?.contentVisible()) {
|
|
61
|
+
if (this._isRendered) return;
|
|
62
|
+
this._viewContainerRef.clear();
|
|
63
|
+
this._viewContainerRef.createEmbeddedView(this._templateRef);
|
|
64
|
+
this._isRendered = true;
|
|
65
|
+
} else if (!this.deferredContentAware()?.preserveContent()) {
|
|
66
|
+
this._viewContainerRef.clear();
|
|
67
|
+
this._isRendered = false;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
72
|
+
minVersion: "12.0.0",
|
|
73
|
+
version: "20.2.0-next.2",
|
|
74
|
+
ngImport: i0,
|
|
75
|
+
type: DeferredContent,
|
|
76
|
+
deps: [],
|
|
77
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
78
|
+
});
|
|
79
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
80
|
+
minVersion: "14.0.0",
|
|
81
|
+
version: "20.2.0-next.2",
|
|
82
|
+
type: DeferredContent,
|
|
83
|
+
isStandalone: true,
|
|
84
|
+
ngImport: i0
|
|
85
|
+
});
|
|
53
86
|
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
55
|
-
|
|
56
|
-
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
88
|
+
minVersion: "12.0.0",
|
|
89
|
+
version: "20.2.0-next.2",
|
|
90
|
+
ngImport: i0,
|
|
91
|
+
type: DeferredContent,
|
|
92
|
+
decorators: [{
|
|
93
|
+
type: Directive
|
|
94
|
+
}],
|
|
95
|
+
ctorParameters: () => []
|
|
96
|
+
});
|
|
57
97
|
|
|
58
98
|
export { DeferredContent, DeferredContentAware };
|
|
59
99
|
//# sourceMappingURL=deferred-content.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferred-content.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/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[AccordionContent]',\n * hostDirectives: [DeferredContent],\n * })\n * class AccordionContent {}\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.
|
|
1
|
+
{"version":3,"file":"deferred-content.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/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[AccordionContent]',\n * hostDirectives: [DeferredContent],\n * })\n * class AccordionContent {}\n * ```\n */\n@Directive()\nexport class DeferredContent {\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainerRef = inject(ViewContainerRef);\n private _isRendered = false;\n\n readonly deferredContentAware = signal(this._deferredContentAware);\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":["contentVisible","signal","ngDevMode","debugName","deferredContentAware","_isRendered","_viewContainerRef","clear","createEmbeddedView","_templateRef"],"mappings":";;;;EAuBWA,cAAA,GAAAC,MAAA,CAAA,KAAA,EAAA,IAAAC,SAAA,GAAA,CAAA;IAAAC,SAAA,EAAA;AAAA,GAAA,CAAA,GAAA,EAAA,CAAA,CAAA;;;AAIX,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+BM,CAAA,MAAA;MAAW,IAAAC,IAAAA,CAAAA,oBAA8B,IAAAJ,cAAmB,EAAA,EAAA;QACrD,IAAA,IAAA,CAAkBK,WAAA,EACvB;QACF,IAAA,CAAAC,iBAAA,CAAAC,KAAA,EAAA;AAEJ,QAAA,IAAA,CAAAD,iBAAA,CAAAE,kBAAA,CAAA,IAAA,CAAAC,YAAA,CAAA;;;8BArBQ,CAAAF,KAAA,EAAA;AAAA,QAAA,IAAA,CAAAF,WAAA,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, ElementRef, contentChildren, computed, input, booleanAttribute, afterRenderEffect, Directive, contentChild, model } from '@angular/core';
|
|
4
|
+
import { GridPattern, GridRowPattern, GridCellPattern, GridCellWidgetPattern } from './_widget-chunk.mjs';
|
|
5
|
+
|
|
6
|
+
class Grid {
|
|
7
|
+
_elementRef = inject(ElementRef);
|
|
8
|
+
_rows = contentChildren(GridRow, ...(ngDevMode ? [{
|
|
9
|
+
debugName: "_rows"
|
|
10
|
+
}] : []));
|
|
11
|
+
_rowPatterns = computed(() => this._rows().map(r => r._pattern), ...(ngDevMode ? [{
|
|
12
|
+
debugName: "_rowPatterns"
|
|
13
|
+
}] : []));
|
|
14
|
+
element = computed(() => this._elementRef.nativeElement, ...(ngDevMode ? [{
|
|
15
|
+
debugName: "element"
|
|
16
|
+
}] : []));
|
|
17
|
+
enableSelection = input(false, ...(ngDevMode ? [{
|
|
18
|
+
debugName: "enableSelection",
|
|
19
|
+
transform: booleanAttribute
|
|
20
|
+
}] : [{
|
|
21
|
+
transform: booleanAttribute
|
|
22
|
+
}]));
|
|
23
|
+
disabled = input(false, ...(ngDevMode ? [{
|
|
24
|
+
debugName: "disabled",
|
|
25
|
+
transform: booleanAttribute
|
|
26
|
+
}] : [{
|
|
27
|
+
transform: booleanAttribute
|
|
28
|
+
}]));
|
|
29
|
+
skipDisabled = input(true, ...(ngDevMode ? [{
|
|
30
|
+
debugName: "skipDisabled",
|
|
31
|
+
transform: booleanAttribute
|
|
32
|
+
}] : [{
|
|
33
|
+
transform: booleanAttribute
|
|
34
|
+
}]));
|
|
35
|
+
focusMode = input('roving', ...(ngDevMode ? [{
|
|
36
|
+
debugName: "focusMode"
|
|
37
|
+
}] : []));
|
|
38
|
+
rowWrap = input('loop', ...(ngDevMode ? [{
|
|
39
|
+
debugName: "rowWrap"
|
|
40
|
+
}] : []));
|
|
41
|
+
colWrap = input('loop', ...(ngDevMode ? [{
|
|
42
|
+
debugName: "colWrap"
|
|
43
|
+
}] : []));
|
|
44
|
+
_pattern = new GridPattern({
|
|
45
|
+
...this,
|
|
46
|
+
rows: this._rowPatterns,
|
|
47
|
+
getCell: e => this._getCell(e)
|
|
48
|
+
});
|
|
49
|
+
constructor() {
|
|
50
|
+
afterRenderEffect(() => this._pattern.resetStateEffect());
|
|
51
|
+
afterRenderEffect(() => this._pattern.focusEffect());
|
|
52
|
+
}
|
|
53
|
+
_getCell(element) {
|
|
54
|
+
const cellElement = element.closest('[ngGridCell]');
|
|
55
|
+
if (cellElement === undefined) return;
|
|
56
|
+
const widgetElement = element.closest('[ngGridCellWidget]');
|
|
57
|
+
for (const row of this._rowPatterns()) {
|
|
58
|
+
for (const cell of row.inputs.cells()) {
|
|
59
|
+
if (cell.element() === cellElement || widgetElement !== undefined && cell.element() === widgetElement) {
|
|
60
|
+
return cell;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
67
|
+
minVersion: "12.0.0",
|
|
68
|
+
version: "20.2.0-next.2",
|
|
69
|
+
ngImport: i0,
|
|
70
|
+
type: Grid,
|
|
71
|
+
deps: [],
|
|
72
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
73
|
+
});
|
|
74
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
75
|
+
minVersion: "17.2.0",
|
|
76
|
+
version: "20.2.0-next.2",
|
|
77
|
+
type: Grid,
|
|
78
|
+
isStandalone: true,
|
|
79
|
+
selector: "[ngGrid]",
|
|
80
|
+
inputs: {
|
|
81
|
+
enableSelection: {
|
|
82
|
+
classPropertyName: "enableSelection",
|
|
83
|
+
publicName: "enableSelection",
|
|
84
|
+
isSignal: true,
|
|
85
|
+
isRequired: false,
|
|
86
|
+
transformFunction: null
|
|
87
|
+
},
|
|
88
|
+
disabled: {
|
|
89
|
+
classPropertyName: "disabled",
|
|
90
|
+
publicName: "disabled",
|
|
91
|
+
isSignal: true,
|
|
92
|
+
isRequired: false,
|
|
93
|
+
transformFunction: null
|
|
94
|
+
},
|
|
95
|
+
skipDisabled: {
|
|
96
|
+
classPropertyName: "skipDisabled",
|
|
97
|
+
publicName: "skipDisabled",
|
|
98
|
+
isSignal: true,
|
|
99
|
+
isRequired: false,
|
|
100
|
+
transformFunction: null
|
|
101
|
+
},
|
|
102
|
+
focusMode: {
|
|
103
|
+
classPropertyName: "focusMode",
|
|
104
|
+
publicName: "focusMode",
|
|
105
|
+
isSignal: true,
|
|
106
|
+
isRequired: false,
|
|
107
|
+
transformFunction: null
|
|
108
|
+
},
|
|
109
|
+
rowWrap: {
|
|
110
|
+
classPropertyName: "rowWrap",
|
|
111
|
+
publicName: "rowWrap",
|
|
112
|
+
isSignal: true,
|
|
113
|
+
isRequired: false,
|
|
114
|
+
transformFunction: null
|
|
115
|
+
},
|
|
116
|
+
colWrap: {
|
|
117
|
+
classPropertyName: "colWrap",
|
|
118
|
+
publicName: "colWrap",
|
|
119
|
+
isSignal: true,
|
|
120
|
+
isRequired: false,
|
|
121
|
+
transformFunction: null
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
host: {
|
|
125
|
+
attributes: {
|
|
126
|
+
"role": "grid"
|
|
127
|
+
},
|
|
128
|
+
listeners: {
|
|
129
|
+
"keydown": "_pattern.onKeydown($event)",
|
|
130
|
+
"pointerdown": "_pattern.onPointerdown($event)",
|
|
131
|
+
"pointermove": "_pattern.onPointermove($event)",
|
|
132
|
+
"pointerup": "_pattern.onPointerup($event)",
|
|
133
|
+
"focusin": "_pattern.onFocusIn($event)",
|
|
134
|
+
"focusout": "_pattern.onFocusOut($event)"
|
|
135
|
+
},
|
|
136
|
+
properties: {
|
|
137
|
+
"tabindex": "_pattern.tabIndex()",
|
|
138
|
+
"attr.aria-disabled": "_pattern.disabled()",
|
|
139
|
+
"attr.aria-activedescendant": "_pattern.activeDescendant()"
|
|
140
|
+
},
|
|
141
|
+
classAttribute: "grid"
|
|
142
|
+
},
|
|
143
|
+
queries: [{
|
|
144
|
+
propertyName: "_rows",
|
|
145
|
+
predicate: GridRow,
|
|
146
|
+
isSignal: true
|
|
147
|
+
}],
|
|
148
|
+
exportAs: ["ngGrid"],
|
|
149
|
+
ngImport: i0
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
153
|
+
minVersion: "12.0.0",
|
|
154
|
+
version: "20.2.0-next.2",
|
|
155
|
+
ngImport: i0,
|
|
156
|
+
type: Grid,
|
|
157
|
+
decorators: [{
|
|
158
|
+
type: Directive,
|
|
159
|
+
args: [{
|
|
160
|
+
selector: '[ngGrid]',
|
|
161
|
+
exportAs: 'ngGrid',
|
|
162
|
+
host: {
|
|
163
|
+
'class': 'grid',
|
|
164
|
+
'role': 'grid',
|
|
165
|
+
'[tabindex]': '_pattern.tabIndex()',
|
|
166
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
167
|
+
'[attr.aria-activedescendant]': '_pattern.activeDescendant()',
|
|
168
|
+
'(keydown)': '_pattern.onKeydown($event)',
|
|
169
|
+
'(pointerdown)': '_pattern.onPointerdown($event)',
|
|
170
|
+
'(pointermove)': '_pattern.onPointermove($event)',
|
|
171
|
+
'(pointerup)': '_pattern.onPointerup($event)',
|
|
172
|
+
'(focusin)': '_pattern.onFocusIn($event)',
|
|
173
|
+
'(focusout)': '_pattern.onFocusOut($event)'
|
|
174
|
+
}
|
|
175
|
+
}]
|
|
176
|
+
}],
|
|
177
|
+
ctorParameters: () => []
|
|
178
|
+
});
|
|
179
|
+
class GridRow {
|
|
180
|
+
_elementRef = inject(ElementRef);
|
|
181
|
+
_cells = contentChildren(GridCell, ...(ngDevMode ? [{
|
|
182
|
+
debugName: "_cells"
|
|
183
|
+
}] : []));
|
|
184
|
+
_cellPatterns = computed(() => this._cells().map(c => c._pattern), ...(ngDevMode ? [{
|
|
185
|
+
debugName: "_cellPatterns"
|
|
186
|
+
}] : []));
|
|
187
|
+
_grid = inject(Grid);
|
|
188
|
+
grid = computed(() => this._grid._pattern, ...(ngDevMode ? [{
|
|
189
|
+
debugName: "grid"
|
|
190
|
+
}] : []));
|
|
191
|
+
element = computed(() => this._elementRef.nativeElement, ...(ngDevMode ? [{
|
|
192
|
+
debugName: "element"
|
|
193
|
+
}] : []));
|
|
194
|
+
role = input('row', ...(ngDevMode ? [{
|
|
195
|
+
debugName: "role"
|
|
196
|
+
}] : []));
|
|
197
|
+
rowIndex = input(...(ngDevMode ? [undefined, {
|
|
198
|
+
debugName: "rowIndex"
|
|
199
|
+
}] : []));
|
|
200
|
+
_pattern = new GridRowPattern({
|
|
201
|
+
...this,
|
|
202
|
+
cells: this._cellPatterns
|
|
203
|
+
});
|
|
204
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
205
|
+
minVersion: "12.0.0",
|
|
206
|
+
version: "20.2.0-next.2",
|
|
207
|
+
ngImport: i0,
|
|
208
|
+
type: GridRow,
|
|
209
|
+
deps: [],
|
|
210
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
211
|
+
});
|
|
212
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
213
|
+
minVersion: "17.2.0",
|
|
214
|
+
version: "20.2.0-next.2",
|
|
215
|
+
type: GridRow,
|
|
216
|
+
isStandalone: true,
|
|
217
|
+
selector: "[ngGridRow]",
|
|
218
|
+
inputs: {
|
|
219
|
+
role: {
|
|
220
|
+
classPropertyName: "role",
|
|
221
|
+
publicName: "role",
|
|
222
|
+
isSignal: true,
|
|
223
|
+
isRequired: false,
|
|
224
|
+
transformFunction: null
|
|
225
|
+
},
|
|
226
|
+
rowIndex: {
|
|
227
|
+
classPropertyName: "rowIndex",
|
|
228
|
+
publicName: "rowIndex",
|
|
229
|
+
isSignal: true,
|
|
230
|
+
isRequired: false,
|
|
231
|
+
transformFunction: null
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
host: {
|
|
235
|
+
properties: {
|
|
236
|
+
"attr.role": "role()"
|
|
237
|
+
},
|
|
238
|
+
classAttribute: "grid-row"
|
|
239
|
+
},
|
|
240
|
+
queries: [{
|
|
241
|
+
propertyName: "_cells",
|
|
242
|
+
predicate: GridCell,
|
|
243
|
+
isSignal: true
|
|
244
|
+
}],
|
|
245
|
+
exportAs: ["ngGridRow"],
|
|
246
|
+
ngImport: i0
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
250
|
+
minVersion: "12.0.0",
|
|
251
|
+
version: "20.2.0-next.2",
|
|
252
|
+
ngImport: i0,
|
|
253
|
+
type: GridRow,
|
|
254
|
+
decorators: [{
|
|
255
|
+
type: Directive,
|
|
256
|
+
args: [{
|
|
257
|
+
selector: '[ngGridRow]',
|
|
258
|
+
exportAs: 'ngGridRow',
|
|
259
|
+
host: {
|
|
260
|
+
'class': 'grid-row',
|
|
261
|
+
'[attr.role]': 'role()'
|
|
262
|
+
}
|
|
263
|
+
}]
|
|
264
|
+
}]
|
|
265
|
+
});
|
|
266
|
+
class GridCell {
|
|
267
|
+
_elementRef = inject(ElementRef);
|
|
268
|
+
_widgets = contentChild(GridCellWidget, ...(ngDevMode ? [{
|
|
269
|
+
debugName: "_widgets"
|
|
270
|
+
}] : []));
|
|
271
|
+
_widgetPattern = computed(() => this._widgets()?._pattern, ...(ngDevMode ? [{
|
|
272
|
+
debugName: "_widgetPattern"
|
|
273
|
+
}] : []));
|
|
274
|
+
_row = inject(GridRow);
|
|
275
|
+
_id = inject(_IdGenerator).getId('ng-grid-cell-');
|
|
276
|
+
element = computed(() => this._elementRef.nativeElement, ...(ngDevMode ? [{
|
|
277
|
+
debugName: "element"
|
|
278
|
+
}] : []));
|
|
279
|
+
role = input('gridcell', ...(ngDevMode ? [{
|
|
280
|
+
debugName: "role"
|
|
281
|
+
}] : []));
|
|
282
|
+
rowSpan = input(1, ...(ngDevMode ? [{
|
|
283
|
+
debugName: "rowSpan"
|
|
284
|
+
}] : []));
|
|
285
|
+
colSpan = input(1, ...(ngDevMode ? [{
|
|
286
|
+
debugName: "colSpan"
|
|
287
|
+
}] : []));
|
|
288
|
+
rowIndex = input(...(ngDevMode ? [undefined, {
|
|
289
|
+
debugName: "rowIndex"
|
|
290
|
+
}] : []));
|
|
291
|
+
colIndex = input(...(ngDevMode ? [undefined, {
|
|
292
|
+
debugName: "colIndex"
|
|
293
|
+
}] : []));
|
|
294
|
+
disabled = input(false, ...(ngDevMode ? [{
|
|
295
|
+
debugName: "disabled",
|
|
296
|
+
transform: booleanAttribute
|
|
297
|
+
}] : [{
|
|
298
|
+
transform: booleanAttribute
|
|
299
|
+
}]));
|
|
300
|
+
selected = model(false, ...(ngDevMode ? [{
|
|
301
|
+
debugName: "selected"
|
|
302
|
+
}] : []));
|
|
303
|
+
selectable = input(true, ...(ngDevMode ? [{
|
|
304
|
+
debugName: "selectable"
|
|
305
|
+
}] : []));
|
|
306
|
+
_pattern = new GridCellPattern({
|
|
307
|
+
...this,
|
|
308
|
+
id: () => this._id,
|
|
309
|
+
grid: this._row.grid,
|
|
310
|
+
row: () => this._row._pattern,
|
|
311
|
+
widget: this._widgetPattern
|
|
312
|
+
});
|
|
313
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
314
|
+
minVersion: "12.0.0",
|
|
315
|
+
version: "20.2.0-next.2",
|
|
316
|
+
ngImport: i0,
|
|
317
|
+
type: GridCell,
|
|
318
|
+
deps: [],
|
|
319
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
320
|
+
});
|
|
321
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
322
|
+
minVersion: "17.2.0",
|
|
323
|
+
version: "20.2.0-next.2",
|
|
324
|
+
type: GridCell,
|
|
325
|
+
isStandalone: true,
|
|
326
|
+
selector: "[ngGridCell]",
|
|
327
|
+
inputs: {
|
|
328
|
+
role: {
|
|
329
|
+
classPropertyName: "role",
|
|
330
|
+
publicName: "role",
|
|
331
|
+
isSignal: true,
|
|
332
|
+
isRequired: false,
|
|
333
|
+
transformFunction: null
|
|
334
|
+
},
|
|
335
|
+
rowSpan: {
|
|
336
|
+
classPropertyName: "rowSpan",
|
|
337
|
+
publicName: "rowSpan",
|
|
338
|
+
isSignal: true,
|
|
339
|
+
isRequired: false,
|
|
340
|
+
transformFunction: null
|
|
341
|
+
},
|
|
342
|
+
colSpan: {
|
|
343
|
+
classPropertyName: "colSpan",
|
|
344
|
+
publicName: "colSpan",
|
|
345
|
+
isSignal: true,
|
|
346
|
+
isRequired: false,
|
|
347
|
+
transformFunction: null
|
|
348
|
+
},
|
|
349
|
+
rowIndex: {
|
|
350
|
+
classPropertyName: "rowIndex",
|
|
351
|
+
publicName: "rowIndex",
|
|
352
|
+
isSignal: true,
|
|
353
|
+
isRequired: false,
|
|
354
|
+
transformFunction: null
|
|
355
|
+
},
|
|
356
|
+
colIndex: {
|
|
357
|
+
classPropertyName: "colIndex",
|
|
358
|
+
publicName: "colIndex",
|
|
359
|
+
isSignal: true,
|
|
360
|
+
isRequired: false,
|
|
361
|
+
transformFunction: null
|
|
362
|
+
},
|
|
363
|
+
disabled: {
|
|
364
|
+
classPropertyName: "disabled",
|
|
365
|
+
publicName: "disabled",
|
|
366
|
+
isSignal: true,
|
|
367
|
+
isRequired: false,
|
|
368
|
+
transformFunction: null
|
|
369
|
+
},
|
|
370
|
+
selected: {
|
|
371
|
+
classPropertyName: "selected",
|
|
372
|
+
publicName: "selected",
|
|
373
|
+
isSignal: true,
|
|
374
|
+
isRequired: false,
|
|
375
|
+
transformFunction: null
|
|
376
|
+
},
|
|
377
|
+
selectable: {
|
|
378
|
+
classPropertyName: "selectable",
|
|
379
|
+
publicName: "selectable",
|
|
380
|
+
isSignal: true,
|
|
381
|
+
isRequired: false,
|
|
382
|
+
transformFunction: null
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
outputs: {
|
|
386
|
+
selected: "selectedChange"
|
|
387
|
+
},
|
|
388
|
+
host: {
|
|
389
|
+
properties: {
|
|
390
|
+
"attr.role": "role()",
|
|
391
|
+
"attr.id": "_pattern.id()",
|
|
392
|
+
"attr.rowspan": "_pattern.rowSpan()",
|
|
393
|
+
"attr.colspan": "_pattern.colSpan()",
|
|
394
|
+
"attr.data-active": "_pattern.active()",
|
|
395
|
+
"attr.aria-disabled": "_pattern.disabled()",
|
|
396
|
+
"attr.aria-rowspan": "_pattern.rowSpan()",
|
|
397
|
+
"attr.aria-colspan": "_pattern.colSpan()",
|
|
398
|
+
"attr.aria-rowindex": "_pattern.ariaRowIndex()",
|
|
399
|
+
"attr.aria-colindex": "_pattern.ariaColIndex()",
|
|
400
|
+
"attr.aria-selected": "_pattern.ariaSelected()",
|
|
401
|
+
"tabindex": "_pattern.tabIndex()"
|
|
402
|
+
},
|
|
403
|
+
classAttribute: "grid-cell"
|
|
404
|
+
},
|
|
405
|
+
queries: [{
|
|
406
|
+
propertyName: "_widgets",
|
|
407
|
+
first: true,
|
|
408
|
+
predicate: GridCellWidget,
|
|
409
|
+
descendants: true,
|
|
410
|
+
isSignal: true
|
|
411
|
+
}],
|
|
412
|
+
exportAs: ["ngGridCell"],
|
|
413
|
+
ngImport: i0
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
417
|
+
minVersion: "12.0.0",
|
|
418
|
+
version: "20.2.0-next.2",
|
|
419
|
+
ngImport: i0,
|
|
420
|
+
type: GridCell,
|
|
421
|
+
decorators: [{
|
|
422
|
+
type: Directive,
|
|
423
|
+
args: [{
|
|
424
|
+
selector: '[ngGridCell]',
|
|
425
|
+
exportAs: 'ngGridCell',
|
|
426
|
+
host: {
|
|
427
|
+
'class': 'grid-cell',
|
|
428
|
+
'[attr.role]': 'role()',
|
|
429
|
+
'[attr.id]': '_pattern.id()',
|
|
430
|
+
'[attr.rowspan]': '_pattern.rowSpan()',
|
|
431
|
+
'[attr.colspan]': '_pattern.colSpan()',
|
|
432
|
+
'[attr.data-active]': '_pattern.active()',
|
|
433
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
434
|
+
'[attr.aria-rowspan]': '_pattern.rowSpan()',
|
|
435
|
+
'[attr.aria-colspan]': '_pattern.colSpan()',
|
|
436
|
+
'[attr.aria-rowindex]': '_pattern.ariaRowIndex()',
|
|
437
|
+
'[attr.aria-colindex]': '_pattern.ariaColIndex()',
|
|
438
|
+
'[attr.aria-selected]': '_pattern.ariaSelected()',
|
|
439
|
+
'[tabindex]': '_pattern.tabIndex()'
|
|
440
|
+
}
|
|
441
|
+
}]
|
|
442
|
+
}]
|
|
443
|
+
});
|
|
444
|
+
class GridCellWidget {
|
|
445
|
+
_elementRef = inject(ElementRef);
|
|
446
|
+
_cell = inject(GridCell);
|
|
447
|
+
element = computed(() => this._elementRef.nativeElement, ...(ngDevMode ? [{
|
|
448
|
+
debugName: "element"
|
|
449
|
+
}] : []));
|
|
450
|
+
activate = model(false, ...(ngDevMode ? [{
|
|
451
|
+
debugName: "activate"
|
|
452
|
+
}] : []));
|
|
453
|
+
_pattern = new GridCellWidgetPattern({
|
|
454
|
+
...this,
|
|
455
|
+
cell: () => this._cell._pattern
|
|
456
|
+
});
|
|
457
|
+
focus() {
|
|
458
|
+
this.element().focus();
|
|
459
|
+
}
|
|
460
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
461
|
+
minVersion: "12.0.0",
|
|
462
|
+
version: "20.2.0-next.2",
|
|
463
|
+
ngImport: i0,
|
|
464
|
+
type: GridCellWidget,
|
|
465
|
+
deps: [],
|
|
466
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
467
|
+
});
|
|
468
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
469
|
+
minVersion: "17.1.0",
|
|
470
|
+
version: "20.2.0-next.2",
|
|
471
|
+
type: GridCellWidget,
|
|
472
|
+
isStandalone: true,
|
|
473
|
+
selector: "[ngGridCellWidget]",
|
|
474
|
+
inputs: {
|
|
475
|
+
activate: {
|
|
476
|
+
classPropertyName: "activate",
|
|
477
|
+
publicName: "activate",
|
|
478
|
+
isSignal: true,
|
|
479
|
+
isRequired: false,
|
|
480
|
+
transformFunction: null
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
outputs: {
|
|
484
|
+
activate: "activateChange"
|
|
485
|
+
},
|
|
486
|
+
host: {
|
|
487
|
+
properties: {
|
|
488
|
+
"attr.data-active": "_pattern.active()",
|
|
489
|
+
"tabindex": "_pattern.tabIndex()"
|
|
490
|
+
},
|
|
491
|
+
classAttribute: "grid-cell-widget"
|
|
492
|
+
},
|
|
493
|
+
exportAs: ["ngGridCellWidget"],
|
|
494
|
+
ngImport: i0
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
498
|
+
minVersion: "12.0.0",
|
|
499
|
+
version: "20.2.0-next.2",
|
|
500
|
+
ngImport: i0,
|
|
501
|
+
type: GridCellWidget,
|
|
502
|
+
decorators: [{
|
|
503
|
+
type: Directive,
|
|
504
|
+
args: [{
|
|
505
|
+
selector: '[ngGridCellWidget]',
|
|
506
|
+
exportAs: 'ngGridCellWidget',
|
|
507
|
+
host: {
|
|
508
|
+
'class': 'grid-cell-widget',
|
|
509
|
+
'[attr.data-active]': '_pattern.active()',
|
|
510
|
+
'[tabindex]': '_pattern.tabIndex()'
|
|
511
|
+
}
|
|
512
|
+
}]
|
|
513
|
+
}]
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
export { Grid, GridCell, GridCellWidget, GridRow };
|
|
517
|
+
//# sourceMappingURL=grid.mjs.map
|