@luzmo/ngx-lucero 2.4.2 → 2.5.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.
@@ -0,0 +1,155 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/table';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-table-head-cell>
7
+ *
8
+ * @slot (default) - Column header content.
9
+ */
10
+ export class LuzmoTableHeadCell {
11
+ elementRef = inject(ElementRef);
12
+ renderer = inject(Renderer2);
13
+ destroyRef = inject(DestroyRef);
14
+ host = this.elementRef.nativeElement;
15
+ listenerCleanup = [];
16
+ /** The underlying custom element instance. Use to call imperative methods. */
17
+ get nativeElement() {
18
+ return this.host;
19
+ }
20
+ role;
21
+ /** Pressed state while Space is held on a sortable header. */
22
+ active;
23
+ /** Whether activating the header sorts the table. */
24
+ sortable;
25
+ /** Current sort direction. Unset when the column is not sorted. */
26
+ sortDirection;
27
+ /** Item key the column sorts by. Sent as `sortKey` in `luzmo-table-sorted`. */
28
+ sortKey;
29
+ /** Stable column identifier. Defaults to `sortKey`, then the column index. */
30
+ columnId;
31
+ /** Fixed column width, in pixels. */
32
+ width;
33
+ /** Minimum column width, in pixels. */
34
+ minWidth;
35
+ /** Maximum column width, in pixels. */
36
+ maxWidth;
37
+ /** Whether the header shows a resize handle. */
38
+ resizable;
39
+ /** Maximum number of header lines before the text truncates. Unset wraps. Also the default clamp for the column's cells. */
40
+ lineClamp;
41
+ /** A sortable header was activated. `detail` is `{ sortKey, sortDirection }`. Cancel it in data mode to skip the client sort. Cancel it on this header to keep sibling sort directions unchanged. */
42
+ luzmoTableSorted = output({ alias: 'luzmo-table-sorted' });
43
+ constructor() {
44
+ this.bindEvents();
45
+ this.destroyRef.onDestroy(() => {
46
+ for (const cleanup of this.listenerCleanup) {
47
+ cleanup();
48
+ }
49
+ });
50
+ }
51
+ ngOnChanges(changes) {
52
+ for (const key of Object.keys(changes)) {
53
+ switch (key) {
54
+ case 'role':
55
+ this.setHostProperty('role', changes['role'].currentValue);
56
+ break;
57
+ case 'active':
58
+ this.setHostProperty('active', changes['active'].currentValue);
59
+ break;
60
+ case 'sortable':
61
+ this.setHostProperty('sortable', changes['sortable'].currentValue);
62
+ break;
63
+ case 'sortDirection':
64
+ this.setHostProperty('sortDirection', changes['sortDirection'].currentValue);
65
+ break;
66
+ case 'sortKey':
67
+ this.setHostProperty('sortKey', changes['sortKey'].currentValue);
68
+ break;
69
+ case 'columnId':
70
+ this.setHostProperty('columnId', changes['columnId'].currentValue);
71
+ break;
72
+ case 'width':
73
+ this.setHostProperty('width', changes['width'].currentValue);
74
+ break;
75
+ case 'minWidth':
76
+ this.setHostProperty('minWidth', changes['minWidth'].currentValue);
77
+ break;
78
+ case 'maxWidth':
79
+ this.setHostProperty('maxWidth', changes['maxWidth'].currentValue);
80
+ break;
81
+ case 'resizable':
82
+ this.setHostProperty('resizable', changes['resizable'].currentValue);
83
+ break;
84
+ case 'lineClamp':
85
+ this.setHostProperty('lineClamp', changes['lineClamp'].currentValue);
86
+ break;
87
+ default:
88
+ break;
89
+ }
90
+ }
91
+ }
92
+ /**
93
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
94
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
95
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
96
+ * undefined / null by clearing their bindings.
97
+ */
98
+ setHostProperty(key, value) {
99
+ this.renderer.setProperty(this.host, key, value);
100
+ }
101
+ bindEvents() {
102
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-table-sorted', (event) => {
103
+ this.luzmoTableSorted.emit(event);
104
+ }));
105
+ }
106
+ static ɵfac = function LuzmoTableHeadCell_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoTableHeadCell)(); };
107
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoTableHeadCell, selectors: [["luzmo-table-head-cell"]], inputs: { role: "role", active: "active", sortable: "sortable", sortDirection: "sortDirection", sortKey: "sortKey", columnId: "columnId", width: "width", minWidth: "minWidth", maxWidth: "maxWidth", resizable: "resizable", lineClamp: "lineClamp" }, outputs: { luzmoTableSorted: "luzmo-table-sorted" }, exportAs: ["luzmoTableHeadCell"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoTableHeadCell_Template(rf, ctx) { if (rf & 1) {
108
+ i0.ɵɵprojectionDef();
109
+ i0.ɵɵprojection(0);
110
+ } }, encapsulation: 2 });
111
+ }
112
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoTableHeadCell, [{
113
+ type: Component,
114
+ args: [{
115
+ selector: 'luzmo-table-head-cell',
116
+ exportAs: 'luzmoTableHeadCell',
117
+ standalone: true,
118
+ changeDetection: ChangeDetectionStrategy.OnPush,
119
+ template: '<ng-content />'
120
+ }]
121
+ }], () => [], { role: [{
122
+ type: Input,
123
+ args: [{ alias: 'role' }]
124
+ }], active: [{
125
+ type: Input,
126
+ args: [{ alias: 'active' }]
127
+ }], sortable: [{
128
+ type: Input,
129
+ args: [{ alias: 'sortable' }]
130
+ }], sortDirection: [{
131
+ type: Input,
132
+ args: [{ alias: 'sortDirection' }]
133
+ }], sortKey: [{
134
+ type: Input,
135
+ args: [{ alias: 'sortKey' }]
136
+ }], columnId: [{
137
+ type: Input,
138
+ args: [{ alias: 'columnId' }]
139
+ }], width: [{
140
+ type: Input,
141
+ args: [{ alias: 'width' }]
142
+ }], minWidth: [{
143
+ type: Input,
144
+ args: [{ alias: 'minWidth' }]
145
+ }], maxWidth: [{
146
+ type: Input,
147
+ args: [{ alias: 'maxWidth' }]
148
+ }], resizable: [{
149
+ type: Input,
150
+ args: [{ alias: 'resizable' }]
151
+ }], lineClamp: [{
152
+ type: Input,
153
+ args: [{ alias: 'lineClamp' }]
154
+ }], luzmoTableSorted: [{ type: i0.Output, args: ["luzmo-table-sorted"] }] }); })();
155
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoTableHeadCell, { className: "LuzmoTableHeadCell", filePath: "components/table-head-cell.ts", lineNumber: 17 }); })();
@@ -0,0 +1,30 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/table';
3
+ import type { LuzmoTableHead as LuzmoTableHeadHostElement } from '@luzmo/lucero/table';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoTableHead implements OnChanges {
6
+ private readonly elementRef;
7
+ private readonly renderer;
8
+ private readonly destroyRef;
9
+ private readonly host;
10
+ private readonly listenerCleanup;
11
+ /** The underlying custom element instance. Use to call imperative methods. */
12
+ get nativeElement(): LuzmoTableHeadHostElement;
13
+ role?: string;
14
+ /** Whether any row is selected. Mirrored from the table. */
15
+ selected?: boolean;
16
+ constructor();
17
+ ngOnChanges(changes: SimpleChanges): void;
18
+ /**
19
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
20
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
21
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
22
+ * undefined / null by clearing their bindings.
23
+ */
24
+ private setHostProperty;
25
+ private bindEvents;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoTableHead, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoTableHead, "luzmo-table-head", ["luzmoTableHead"], { "role": { "alias": "role"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; }, {}, never, ["*"], true, never>;
28
+ }
29
+ /** The underlying custom element type for LuzmoTableHead */
30
+ export type LuzmoTableHeadElement = LuzmoTableHeadHostElement;
@@ -0,0 +1,79 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/table';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-table-head>
7
+ *
8
+ * @slot (default) - `luzmo-table-head-cell` elements.
9
+ */
10
+ export class LuzmoTableHead {
11
+ elementRef = inject(ElementRef);
12
+ renderer = inject(Renderer2);
13
+ destroyRef = inject(DestroyRef);
14
+ host = this.elementRef.nativeElement;
15
+ listenerCleanup = [];
16
+ /** The underlying custom element instance. Use to call imperative methods. */
17
+ get nativeElement() {
18
+ return this.host;
19
+ }
20
+ role;
21
+ /** Whether any row is selected. Mirrored from the table. */
22
+ selected;
23
+ constructor() {
24
+ this.bindEvents();
25
+ this.destroyRef.onDestroy(() => {
26
+ for (const cleanup of this.listenerCleanup) {
27
+ cleanup();
28
+ }
29
+ });
30
+ }
31
+ ngOnChanges(changes) {
32
+ for (const key of Object.keys(changes)) {
33
+ switch (key) {
34
+ case 'role':
35
+ this.setHostProperty('role', changes['role'].currentValue);
36
+ break;
37
+ case 'selected':
38
+ this.setHostProperty('selected', changes['selected'].currentValue);
39
+ break;
40
+ default:
41
+ break;
42
+ }
43
+ }
44
+ }
45
+ /**
46
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
47
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
48
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
49
+ * undefined / null by clearing their bindings.
50
+ */
51
+ setHostProperty(key, value) {
52
+ this.renderer.setProperty(this.host, key, value);
53
+ }
54
+ bindEvents() {
55
+ // No custom events for this wrapper.
56
+ }
57
+ static ɵfac = function LuzmoTableHead_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoTableHead)(); };
58
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoTableHead, selectors: [["luzmo-table-head"]], inputs: { role: "role", selected: "selected" }, exportAs: ["luzmoTableHead"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoTableHead_Template(rf, ctx) { if (rf & 1) {
59
+ i0.ɵɵprojectionDef();
60
+ i0.ɵɵprojection(0);
61
+ } }, encapsulation: 2 });
62
+ }
63
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoTableHead, [{
64
+ type: Component,
65
+ args: [{
66
+ selector: 'luzmo-table-head',
67
+ exportAs: 'luzmoTableHead',
68
+ standalone: true,
69
+ changeDetection: ChangeDetectionStrategy.OnPush,
70
+ template: '<ng-content />'
71
+ }]
72
+ }], () => [], { role: [{
73
+ type: Input,
74
+ args: [{ alias: 'role' }]
75
+ }], selected: [{
76
+ type: Input,
77
+ args: [{ alias: 'selected' }]
78
+ }] }); })();
79
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoTableHead, { className: "LuzmoTableHead", filePath: "components/table-head.ts", lineNumber: 17 }); })();
@@ -0,0 +1,32 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/table';
3
+ import type { LuzmoTableRowDetails as LuzmoTableRowDetailsHostElement } from '@luzmo/lucero/table';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoTableRowDetails implements OnChanges {
6
+ private readonly elementRef;
7
+ private readonly renderer;
8
+ private readonly destroyRef;
9
+ private readonly host;
10
+ private readonly listenerCleanup;
11
+ /** The underlying custom element instance. Use to call imperative methods. */
12
+ get nativeElement(): LuzmoTableRowDetailsHostElement;
13
+ role?: string;
14
+ /** Whether the details row is shown. Set by the table from the owning row. */
15
+ open?: boolean;
16
+ /** The closing animation finished and the details row is hidden. */
17
+ readonly luzmoTableDetailsCollapsed: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
18
+ constructor();
19
+ ngOnChanges(changes: SimpleChanges): void;
20
+ /**
21
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
22
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
23
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
24
+ * undefined / null by clearing their bindings.
25
+ */
26
+ private setHostProperty;
27
+ private bindEvents;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoTableRowDetails, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoTableRowDetails, "luzmo-table-row-details", ["luzmoTableRowDetails"], { "role": { "alias": "role"; "required": false; }; "open": { "alias": "open"; "required": false; }; }, { "luzmoTableDetailsCollapsed": "luzmo-table-details-collapsed"; }, never, ["*"], true, never>;
30
+ }
31
+ /** The underlying custom element type for LuzmoTableRowDetails */
32
+ export type LuzmoTableRowDetailsElement = LuzmoTableRowDetailsHostElement;
@@ -0,0 +1,83 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/table';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-table-row-details>
7
+ *
8
+ * @slot (default) - Details content. A nested `luzmo-table` needs its own accessible name.
9
+ */
10
+ export class LuzmoTableRowDetails {
11
+ elementRef = inject(ElementRef);
12
+ renderer = inject(Renderer2);
13
+ destroyRef = inject(DestroyRef);
14
+ host = this.elementRef.nativeElement;
15
+ listenerCleanup = [];
16
+ /** The underlying custom element instance. Use to call imperative methods. */
17
+ get nativeElement() {
18
+ return this.host;
19
+ }
20
+ role;
21
+ /** Whether the details row is shown. Set by the table from the owning row. */
22
+ open;
23
+ /** The closing animation finished and the details row is hidden. */
24
+ luzmoTableDetailsCollapsed = output({ alias: 'luzmo-table-details-collapsed' });
25
+ constructor() {
26
+ this.bindEvents();
27
+ this.destroyRef.onDestroy(() => {
28
+ for (const cleanup of this.listenerCleanup) {
29
+ cleanup();
30
+ }
31
+ });
32
+ }
33
+ ngOnChanges(changes) {
34
+ for (const key of Object.keys(changes)) {
35
+ switch (key) {
36
+ case 'role':
37
+ this.setHostProperty('role', changes['role'].currentValue);
38
+ break;
39
+ case 'open':
40
+ this.setHostProperty('open', changes['open'].currentValue);
41
+ break;
42
+ default:
43
+ break;
44
+ }
45
+ }
46
+ }
47
+ /**
48
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
49
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
50
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
51
+ * undefined / null by clearing their bindings.
52
+ */
53
+ setHostProperty(key, value) {
54
+ this.renderer.setProperty(this.host, key, value);
55
+ }
56
+ bindEvents() {
57
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-table-details-collapsed', (event) => {
58
+ this.luzmoTableDetailsCollapsed.emit(event);
59
+ }));
60
+ }
61
+ static ɵfac = function LuzmoTableRowDetails_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoTableRowDetails)(); };
62
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoTableRowDetails, selectors: [["luzmo-table-row-details"]], inputs: { role: "role", open: "open" }, outputs: { luzmoTableDetailsCollapsed: "luzmo-table-details-collapsed" }, exportAs: ["luzmoTableRowDetails"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoTableRowDetails_Template(rf, ctx) { if (rf & 1) {
63
+ i0.ɵɵprojectionDef();
64
+ i0.ɵɵprojection(0);
65
+ } }, encapsulation: 2 });
66
+ }
67
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoTableRowDetails, [{
68
+ type: Component,
69
+ args: [{
70
+ selector: 'luzmo-table-row-details',
71
+ exportAs: 'luzmoTableRowDetails',
72
+ standalone: true,
73
+ changeDetection: ChangeDetectionStrategy.OnPush,
74
+ template: '<ng-content />'
75
+ }]
76
+ }], () => [], { role: [{
77
+ type: Input,
78
+ args: [{ alias: 'role' }]
79
+ }], open: [{
80
+ type: Input,
81
+ args: [{ alias: 'open' }]
82
+ }], luzmoTableDetailsCollapsed: [{ type: i0.Output, args: ["luzmo-table-details-collapsed"] }] }); })();
83
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoTableRowDetails, { className: "LuzmoTableRowDetails", filePath: "components/table-row-details.ts", lineNumber: 17 }); })();
@@ -0,0 +1,38 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/table';
3
+ import type { LuzmoTableRow as LuzmoTableRowHostElement } from '@luzmo/lucero/table';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoTableRow implements OnChanges {
6
+ private readonly elementRef;
7
+ private readonly renderer;
8
+ private readonly destroyRef;
9
+ private readonly host;
10
+ private readonly listenerCleanup;
11
+ /** The underlying custom element instance. Use to call imperative methods. */
12
+ get nativeElement(): LuzmoTableRowHostElement;
13
+ role?: string;
14
+ /** Selection value. Defaults to the row's position when empty. */
15
+ value?: string;
16
+ /** Whether the row is selected. Mirrored from the table's `selected`. */
17
+ selected?: boolean;
18
+ /** Whether the row can be selected. Set by the table while it `selects`. */
19
+ selectable?: boolean;
20
+ /** Whether the row's details are shown. */
21
+ expanded?: boolean;
22
+ /** Whether the row has a details sibling or data-mode details renderer. */
23
+ expandable?: boolean;
24
+ constructor();
25
+ ngOnChanges(changes: SimpleChanges): void;
26
+ /**
27
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
28
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
29
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
30
+ * undefined / null by clearing their bindings.
31
+ */
32
+ private setHostProperty;
33
+ private bindEvents;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoTableRow, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoTableRow, "luzmo-table-row", ["luzmoTableRow"], { "role": { "alias": "role"; "required": false; }; "value": { "alias": "value"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "expandable": { "alias": "expandable"; "required": false; }; }, {}, never, ["*"], true, never>;
36
+ }
37
+ /** The underlying custom element type for LuzmoTableRow */
38
+ export type LuzmoTableRowElement = LuzmoTableRowHostElement;
@@ -0,0 +1,111 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/table';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-table-row>
7
+ *
8
+ * @slot (default) - `luzmo-table-cell` elements of the row.
9
+ */
10
+ export class LuzmoTableRow {
11
+ elementRef = inject(ElementRef);
12
+ renderer = inject(Renderer2);
13
+ destroyRef = inject(DestroyRef);
14
+ host = this.elementRef.nativeElement;
15
+ listenerCleanup = [];
16
+ /** The underlying custom element instance. Use to call imperative methods. */
17
+ get nativeElement() {
18
+ return this.host;
19
+ }
20
+ role;
21
+ /** Selection value. Defaults to the row's position when empty. */
22
+ value;
23
+ /** Whether the row is selected. Mirrored from the table's `selected`. */
24
+ selected;
25
+ /** Whether the row can be selected. Set by the table while it `selects`. */
26
+ selectable;
27
+ /** Whether the row's details are shown. */
28
+ expanded;
29
+ /** Whether the row has a details sibling or data-mode details renderer. */
30
+ expandable;
31
+ constructor() {
32
+ this.bindEvents();
33
+ this.destroyRef.onDestroy(() => {
34
+ for (const cleanup of this.listenerCleanup) {
35
+ cleanup();
36
+ }
37
+ });
38
+ }
39
+ ngOnChanges(changes) {
40
+ for (const key of Object.keys(changes)) {
41
+ switch (key) {
42
+ case 'role':
43
+ this.setHostProperty('role', changes['role'].currentValue);
44
+ break;
45
+ case 'value':
46
+ this.setHostProperty('value', changes['value'].currentValue);
47
+ break;
48
+ case 'selected':
49
+ this.setHostProperty('selected', changes['selected'].currentValue);
50
+ break;
51
+ case 'selectable':
52
+ this.setHostProperty('selectable', changes['selectable'].currentValue);
53
+ break;
54
+ case 'expanded':
55
+ this.setHostProperty('expanded', changes['expanded'].currentValue);
56
+ break;
57
+ case 'expandable':
58
+ this.setHostProperty('expandable', changes['expandable'].currentValue);
59
+ break;
60
+ default:
61
+ break;
62
+ }
63
+ }
64
+ }
65
+ /**
66
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
67
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
68
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
69
+ * undefined / null by clearing their bindings.
70
+ */
71
+ setHostProperty(key, value) {
72
+ this.renderer.setProperty(this.host, key, value);
73
+ }
74
+ bindEvents() {
75
+ // No custom events for this wrapper.
76
+ }
77
+ static ɵfac = function LuzmoTableRow_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoTableRow)(); };
78
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoTableRow, selectors: [["luzmo-table-row"]], inputs: { role: "role", value: "value", selected: "selected", selectable: "selectable", expanded: "expanded", expandable: "expandable" }, exportAs: ["luzmoTableRow"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoTableRow_Template(rf, ctx) { if (rf & 1) {
79
+ i0.ɵɵprojectionDef();
80
+ i0.ɵɵprojection(0);
81
+ } }, encapsulation: 2 });
82
+ }
83
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoTableRow, [{
84
+ type: Component,
85
+ args: [{
86
+ selector: 'luzmo-table-row',
87
+ exportAs: 'luzmoTableRow',
88
+ standalone: true,
89
+ changeDetection: ChangeDetectionStrategy.OnPush,
90
+ template: '<ng-content />'
91
+ }]
92
+ }], () => [], { role: [{
93
+ type: Input,
94
+ args: [{ alias: 'role' }]
95
+ }], value: [{
96
+ type: Input,
97
+ args: [{ alias: 'value' }]
98
+ }], selected: [{
99
+ type: Input,
100
+ args: [{ alias: 'selected' }]
101
+ }], selectable: [{
102
+ type: Input,
103
+ args: [{ alias: 'selectable' }]
104
+ }], expanded: [{
105
+ type: Input,
106
+ args: [{ alias: 'expanded' }]
107
+ }], expandable: [{
108
+ type: Input,
109
+ args: [{ alias: 'expandable' }]
110
+ }] }); })();
111
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoTableRow, { className: "LuzmoTableRow", filePath: "components/table-row.ts", lineNumber: 17 }); })();
@@ -0,0 +1,75 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/table';
3
+ import type { LuzmoTable as LuzmoTableHostElement } from '@luzmo/lucero/table';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoTable implements OnChanges {
6
+ private readonly elementRef;
7
+ private readonly renderer;
8
+ private readonly destroyRef;
9
+ private readonly host;
10
+ private readonly listenerCleanup;
11
+ /** The underlying custom element instance. Use to call imperative methods. */
12
+ get nativeElement(): LuzmoTableHostElement;
13
+ role?: string;
14
+ /** Row density. Unset is regular. */
15
+ density?: ('compact' | 'spacious');
16
+ /** Use the accent color for selected rows and checkboxes. */
17
+ emphasized?: boolean;
18
+ /** Remove the outer border and background. */
19
+ quiet?: boolean;
20
+ /** Scroll the body inside the table's block size, keeping the head in view. */
21
+ scroller?: boolean;
22
+ /** Row selection mode. Unset disables selection. */
23
+ selects?: ('single' | 'multiple');
24
+ /** Selected row values. */
25
+ selected?: string[];
26
+ /** Accessible name of the select-all checkbox. Overrides `labels.selectAll`. */
27
+ selectAllLabel?: string;
28
+ /** Row records. Setting an array switches the table to data mode. */
29
+ items?: (Record<string, unknown>)[];
30
+ /** Stable, unique selection value of a data-mode row. Defaults to the item index. */
31
+ itemValue?: unknown;
32
+ /** Accessible name of a data-mode row checkbox. Defaults to the first column's text, then `labels.selectRow`. */
33
+ itemLabel?: unknown;
34
+ /** Cell content of a data-mode row. Return `luzmo-table-cell` elements. */
35
+ renderItem?: unknown;
36
+ /** Expanded row values. Setting `renderDetails` enables data-mode disclosure. */
37
+ expanded?: string[];
38
+ /** Details content of a data-mode row. Its presence enables row disclosure for every non-information row. */
39
+ renderDetails?: unknown;
40
+ /** Resized column widths, in pixels, keyed by column id. A resize updates this map without changing `columns`. */
41
+ columnWidths?: Record<string, number>;
42
+ /** Data-mode columns, used when no `luzmo-table-head` is slotted. */
43
+ columns?: unknown;
44
+ /** Mount only the visible rows. Data mode only; needs a bounded block size. */
45
+ virtualized?: boolean;
46
+ /** Translatable copy. */
47
+ labels?: unknown;
48
+ size?: ('xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl');
49
+ /** `selected` changed. Cancel it to keep the previous selection. */
50
+ readonly changeEvent: import("@angular/core").OutputEmitterRef<Event>;
51
+ /** A sortable header was activated. `detail` is `{ sortKey, sortDirection }`. Cancel it in data mode to skip the client sort. */
52
+ readonly luzmoTableSorted: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
53
+ /** A row's details were expanded or collapsed. `detail` is `{ value, expanded }`. Cancel it to keep the previous state. */
54
+ readonly luzmoTableRowToggle: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
55
+ /** A column resize committed. `detail` is `{ columnId, width, columnWidths }`. */
56
+ readonly luzmoColumnResized: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
57
+ /** The mounted window of a virtualized table changed. `detail` is `{ first, last }`. */
58
+ readonly luzmoRangeChanged: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
59
+ constructor();
60
+ ngOnChanges(changes: SimpleChanges): void;
61
+ /**
62
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
63
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
64
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
65
+ * undefined / null by clearing their bindings.
66
+ */
67
+ private setHostProperty;
68
+ private bindEvents;
69
+ /** Moves focus to the grid's current cell. */
70
+ focus(options?: FocusOptions): void;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoTable, never>;
72
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoTable, "luzmo-table", ["luzmoTable"], { "role": { "alias": "role"; "required": false; }; "density": { "alias": "density"; "required": false; }; "emphasized": { "alias": "emphasized"; "required": false; }; "quiet": { "alias": "quiet"; "required": false; }; "scroller": { "alias": "scroller"; "required": false; }; "selects": { "alias": "selects"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "selectAllLabel": { "alias": "selectAllLabel"; "required": false; }; "items": { "alias": "items"; "required": false; }; "itemValue": { "alias": "itemValue"; "required": false; }; "itemLabel": { "alias": "itemLabel"; "required": false; }; "renderItem": { "alias": "renderItem"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "renderDetails": { "alias": "renderDetails"; "required": false; }; "columnWidths": { "alias": "columnWidths"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "virtualized": { "alias": "virtualized"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "changeEvent": "changeEvent"; "luzmoTableSorted": "luzmo-table-sorted"; "luzmoTableRowToggle": "luzmo-table-row-toggle"; "luzmoColumnResized": "luzmo-column-resized"; "luzmoRangeChanged": "luzmo-range-changed"; }, never, ["*"], true, never>;
73
+ }
74
+ /** The underlying custom element type for LuzmoTable */
75
+ export type LuzmoTableElement = LuzmoTableHostElement;