@argus-table/angular 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Joessst-Dev and Argus Table contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,107 @@
1
- # Temporary Holding Version
1
+ # @argus-table/angular
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Angular components for [`<argus-table>`](https://www.npmjs.com/package/argus-table): `ArgusTableComponent` and `ArgusColumnComponent`, with typed inputs, typed outputs and two-way binding. The row type is inferred from `[data]`, and strict templates check your bindings against it.
4
+
5
+ **[Docs and live examples](https://joessst-dev.github.io/argus-table/)** · [GitHub](https://github.com/Joessst-Dev/argus-table)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm i @argus-table/angular @argus-table/themes
11
+ ```
12
+
13
+ `argus-table` comes with it. Angular 20, 21 or 22.
14
+
15
+ ## A first table
16
+
17
+ The components sit on the element's own tag, so you write `<argus-table>` as usual, with no `CUSTOM_ELEMENTS_SCHEMA`:
18
+
19
+ ```ts
20
+ import { Component, input, signal } from '@angular/core';
21
+ import { ArgusTableComponent, type ColumnDef, type SortState } from '@argus-table/angular';
22
+
23
+ interface Order {
24
+ id: string;
25
+ customer: string;
26
+ total: number;
27
+ }
28
+
29
+ @Component({
30
+ selector: 'app-orders',
31
+ imports: [ArgusTableComponent],
32
+ template: `
33
+ <argus-table
34
+ aria-label="Orders"
35
+ style="height: 400px"
36
+ [columns]="columns"
37
+ [data]="orders()"
38
+ [(sorting)]="sorting"
39
+ (rowClick)="open($event.detail.row)"
40
+ />
41
+ `,
42
+ })
43
+ export class OrdersComponent {
44
+ readonly orders = input.required<Order[]>();
45
+ readonly sorting = signal<SortState>([]);
46
+ readonly columns: ColumnDef<Order>[] = [
47
+ { id: 'id', header: 'Order', accessor: 'id', width: 90, pin: 'start' },
48
+ {
49
+ id: 'customer',
50
+ header: 'Customer',
51
+ accessor: 'customer',
52
+ width: { flex: 1 },
53
+ sortable: true,
54
+ },
55
+ { id: 'total', header: 'Total', accessor: 'total', width: 110, align: 'end', sortable: true },
56
+ ];
57
+
58
+ open(order: Order) {}
59
+ }
60
+ ```
61
+
62
+ Add `@import '@argus-table/themes/default.css';` to your global styles for the default theme.
63
+
64
+ - **Inputs** set the element's properties: `columns`, `data`, `dataSource`, `pinnedRows`, `getRowId`, `rowHeight`, `density`, `overscan`, `sorting`, `columnSizing` and `columnOrder`. Other attributes (`aria-label`, `class`, `style`, …) stay on the element. `null`, as from the `async` pipe, means unset.
65
+ - **Outputs** emit the element's `CustomEvent`: `sortChange`, `columnResize`, `columnReorder`, `cellClick`, `rowClick`, `rangeChange` and `loadError`. In `(rowClick)`, `$event.detail.row` has your row type. The details are in the [`argus-table` README](https://www.npmjs.com/package/argus-table).
66
+ - **Cells:** a column's `cell` function returns a string, a number, a DOM node or a Lit template. Angular templates in cells are planned.
67
+ - **Height:** the table virtualizes its rows, so it needs a bounded height. Its default is 400 px.
68
+
69
+ ## Two-way binding
70
+
71
+ `[(sorting)]`, `[(columnSizing)]` and `[(columnOrder)]` keep a value in sync with the table; `sortingChange`, `columnSizingChange` and `columnOrderChange` emit the new value. Leave one unbound and the table keeps that state itself. A one-way `[sorting]` is controlled: a header click only emits the proposed order, and nothing changes until you set it.
72
+
73
+ ## Methods
74
+
75
+ A view query gives the component, with `refresh()`, `scrollToRow(index)`, `autosizeColumns(ids?)` and the `element`:
76
+
77
+ ```ts
78
+ readonly table = viewChild.required(ArgusTableComponent);
79
+
80
+ top() {
81
+ void this.table().scrollToRow(0);
82
+ }
83
+ ```
84
+
85
+ ## Columns as children
86
+
87
+ `ArgusColumnComponent` sits on `<argus-column>`, so columns can come from `@for`. Attributes work as in HTML (`width="90"`, `sortable`, `resizable="false"`), and inputs take values:
88
+
89
+ ```ts
90
+ @Component({
91
+ imports: [ArgusTableComponent, ArgusColumnComponent],
92
+ template: `
93
+ <argus-table [data]="orders">
94
+ <argus-column column-id="id" header="Order" accessor="id" width="90" pin="start" />
95
+ @for (c of extra; track c.id) {
96
+ <argus-column [columnId]="c.id" [header]="c.label" [accessor]="c.id" sortable />
97
+ }
98
+ </argus-table>
99
+ `,
100
+ })
101
+ ```
102
+
103
+ A non-empty `columns` input wins over the children.
104
+
105
+ ## License
106
+
107
+ MIT
package/dist/README.md ADDED
@@ -0,0 +1,107 @@
1
+ # @argus-table/angular
2
+
3
+ Angular components for [`<argus-table>`](https://www.npmjs.com/package/argus-table): `ArgusTableComponent` and `ArgusColumnComponent`, with typed inputs, typed outputs and two-way binding. The row type is inferred from `[data]`, and strict templates check your bindings against it.
4
+
5
+ **[Docs and live examples](https://joessst-dev.github.io/argus-table/)** · [GitHub](https://github.com/Joessst-Dev/argus-table)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm i @argus-table/angular @argus-table/themes
11
+ ```
12
+
13
+ `argus-table` comes with it. Angular 20, 21 or 22.
14
+
15
+ ## A first table
16
+
17
+ The components sit on the element's own tag, so you write `<argus-table>` as usual, with no `CUSTOM_ELEMENTS_SCHEMA`:
18
+
19
+ ```ts
20
+ import { Component, input, signal } from '@angular/core';
21
+ import { ArgusTableComponent, type ColumnDef, type SortState } from '@argus-table/angular';
22
+
23
+ interface Order {
24
+ id: string;
25
+ customer: string;
26
+ total: number;
27
+ }
28
+
29
+ @Component({
30
+ selector: 'app-orders',
31
+ imports: [ArgusTableComponent],
32
+ template: `
33
+ <argus-table
34
+ aria-label="Orders"
35
+ style="height: 400px"
36
+ [columns]="columns"
37
+ [data]="orders()"
38
+ [(sorting)]="sorting"
39
+ (rowClick)="open($event.detail.row)"
40
+ />
41
+ `,
42
+ })
43
+ export class OrdersComponent {
44
+ readonly orders = input.required<Order[]>();
45
+ readonly sorting = signal<SortState>([]);
46
+ readonly columns: ColumnDef<Order>[] = [
47
+ { id: 'id', header: 'Order', accessor: 'id', width: 90, pin: 'start' },
48
+ {
49
+ id: 'customer',
50
+ header: 'Customer',
51
+ accessor: 'customer',
52
+ width: { flex: 1 },
53
+ sortable: true,
54
+ },
55
+ { id: 'total', header: 'Total', accessor: 'total', width: 110, align: 'end', sortable: true },
56
+ ];
57
+
58
+ open(order: Order) {}
59
+ }
60
+ ```
61
+
62
+ Add `@import '@argus-table/themes/default.css';` to your global styles for the default theme.
63
+
64
+ - **Inputs** set the element's properties: `columns`, `data`, `dataSource`, `pinnedRows`, `getRowId`, `rowHeight`, `density`, `overscan`, `sorting`, `columnSizing` and `columnOrder`. Other attributes (`aria-label`, `class`, `style`, …) stay on the element. `null`, as from the `async` pipe, means unset.
65
+ - **Outputs** emit the element's `CustomEvent`: `sortChange`, `columnResize`, `columnReorder`, `cellClick`, `rowClick`, `rangeChange` and `loadError`. In `(rowClick)`, `$event.detail.row` has your row type. The details are in the [`argus-table` README](https://www.npmjs.com/package/argus-table).
66
+ - **Cells:** a column's `cell` function returns a string, a number, a DOM node or a Lit template. Angular templates in cells are planned.
67
+ - **Height:** the table virtualizes its rows, so it needs a bounded height. Its default is 400 px.
68
+
69
+ ## Two-way binding
70
+
71
+ `[(sorting)]`, `[(columnSizing)]` and `[(columnOrder)]` keep a value in sync with the table; `sortingChange`, `columnSizingChange` and `columnOrderChange` emit the new value. Leave one unbound and the table keeps that state itself. A one-way `[sorting]` is controlled: a header click only emits the proposed order, and nothing changes until you set it.
72
+
73
+ ## Methods
74
+
75
+ A view query gives the component, with `refresh()`, `scrollToRow(index)`, `autosizeColumns(ids?)` and the `element`:
76
+
77
+ ```ts
78
+ readonly table = viewChild.required(ArgusTableComponent);
79
+
80
+ top() {
81
+ void this.table().scrollToRow(0);
82
+ }
83
+ ```
84
+
85
+ ## Columns as children
86
+
87
+ `ArgusColumnComponent` sits on `<argus-column>`, so columns can come from `@for`. Attributes work as in HTML (`width="90"`, `sortable`, `resizable="false"`), and inputs take values:
88
+
89
+ ```ts
90
+ @Component({
91
+ imports: [ArgusTableComponent, ArgusColumnComponent],
92
+ template: `
93
+ <argus-table [data]="orders">
94
+ <argus-column column-id="id" header="Order" accessor="id" width="90" pin="start" />
95
+ @for (c of extra; track c.id) {
96
+ <argus-column [columnId]="c.id" [header]="c.label" [accessor]="c.id" sortable />
97
+ }
98
+ </argus-table>
99
+ `,
100
+ })
101
+ ```
102
+
103
+ A non-empty `columns` input wins over the children.
104
+
105
+ ## License
106
+
107
+ MIT
@@ -0,0 +1,324 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, ViewEncapsulation, inject } from "@angular/core";
3
+ import "argus-table";
4
+ function setProperty(element, property, attribute, value) {
5
+ if (attribute !== void 0) {
6
+ if (typeof value === "string") {
7
+ element.setAttribute(attribute, value);
8
+ return;
9
+ }
10
+ if (value == null) element.removeAttribute(attribute);
11
+ }
12
+ element[property] = value ?? void 0;
13
+ }
14
+ var ArgusTableComponent = class ArgusTableComponent {
15
+ constructor() {
16
+ this.element = inject(ElementRef).nativeElement;
17
+ this.sortChange = new EventEmitter();
18
+ this.sortingChange = new EventEmitter();
19
+ this.columnResize = new EventEmitter();
20
+ this.columnSizingChange = new EventEmitter();
21
+ this.columnReorder = new EventEmitter();
22
+ this.columnOrderChange = new EventEmitter();
23
+ this.cellClick = new EventEmitter();
24
+ this.rowClick = new EventEmitter();
25
+ this.rangeChange = new EventEmitter();
26
+ this.loadError = new EventEmitter();
27
+ }
28
+ set columns(value) {
29
+ setProperty(this.element, "columns", void 0, value);
30
+ }
31
+ set data(value) {
32
+ setProperty(this.element, "data", void 0, value);
33
+ }
34
+ set dataSource(value) {
35
+ setProperty(this.element, "dataSource", void 0, value);
36
+ }
37
+ set pinnedRows(value) {
38
+ setProperty(this.element, "pinnedRows", void 0, value);
39
+ }
40
+ set getRowId(value) {
41
+ setProperty(this.element, "getRowId", void 0, value);
42
+ }
43
+ set rowHeight(value) {
44
+ setProperty(this.element, "rowHeight", "row-height", value);
45
+ }
46
+ set density(value) {
47
+ setProperty(this.element, "density", "density", value);
48
+ }
49
+ set overscan(value) {
50
+ setProperty(this.element, "overscan", "overscan", value);
51
+ }
52
+ set sorting(value) {
53
+ setProperty(this.element, "sorting", void 0, value);
54
+ }
55
+ set columnSizing(value) {
56
+ setProperty(this.element, "columnSizing", void 0, value);
57
+ }
58
+ set columnOrder(value) {
59
+ setProperty(this.element, "columnOrder", void 0, value);
60
+ }
61
+ refresh(...args) {
62
+ return this.element.refresh(...args);
63
+ }
64
+ autosizeColumns(...args) {
65
+ return this.element.autosizeColumns(...args);
66
+ }
67
+ scrollToRow(...args) {
68
+ return this.element.scrollToRow(...args);
69
+ }
70
+ handleSortChange(event) {
71
+ if (event.target !== this.element) return;
72
+ const e = event;
73
+ this.sortChange.emit(e);
74
+ this.sortingChange.emit(e.detail.sorting);
75
+ }
76
+ handleColumnResize(event) {
77
+ if (event.target !== this.element) return;
78
+ const e = event;
79
+ this.columnResize.emit(e);
80
+ this.columnSizingChange.emit(e.detail.sizing);
81
+ }
82
+ handleColumnReorder(event) {
83
+ if (event.target !== this.element) return;
84
+ const e = event;
85
+ this.columnReorder.emit(e);
86
+ this.columnOrderChange.emit(e.detail.order);
87
+ }
88
+ handleCellClick(event) {
89
+ if (event.target !== this.element) return;
90
+ const e = event;
91
+ this.cellClick.emit(e);
92
+ }
93
+ handleRowClick(event) {
94
+ if (event.target !== this.element) return;
95
+ const e = event;
96
+ this.rowClick.emit(e);
97
+ }
98
+ handleRangeChange(event) {
99
+ if (event.target !== this.element) return;
100
+ const e = event;
101
+ this.rangeChange.emit(e);
102
+ }
103
+ handleLoadError(event) {
104
+ if (event.target !== this.element) return;
105
+ const e = event;
106
+ this.loadError.emit(e);
107
+ }
108
+ static {
109
+ this.ɵfac = i0.ɵɵngDeclareFactory({
110
+ minVersion: "12.0.0",
111
+ version: "22.2.5",
112
+ ngImport: i0,
113
+ type: ArgusTableComponent,
114
+ deps: [],
115
+ target: i0.ɵɵFactoryTarget.Component
116
+ });
117
+ }
118
+ static {
119
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
120
+ minVersion: "14.0.0",
121
+ version: "22.2.5",
122
+ type: ArgusTableComponent,
123
+ isStandalone: true,
124
+ selector: "argus-table",
125
+ inputs: {
126
+ columns: "columns",
127
+ data: "data",
128
+ dataSource: "dataSource",
129
+ pinnedRows: "pinnedRows",
130
+ getRowId: "getRowId",
131
+ rowHeight: "rowHeight",
132
+ density: "density",
133
+ overscan: "overscan",
134
+ sorting: "sorting",
135
+ columnSizing: "columnSizing",
136
+ columnOrder: "columnOrder"
137
+ },
138
+ outputs: {
139
+ sortChange: "sortChange",
140
+ sortingChange: "sortingChange",
141
+ columnResize: "columnResize",
142
+ columnSizingChange: "columnSizingChange",
143
+ columnReorder: "columnReorder",
144
+ columnOrderChange: "columnOrderChange",
145
+ cellClick: "cellClick",
146
+ rowClick: "rowClick",
147
+ rangeChange: "rangeChange",
148
+ loadError: "loadError"
149
+ },
150
+ host: { listeners: {
151
+ "argus-sort-change": "handleSortChange($event)",
152
+ "argus-column-resize": "handleColumnResize($event)",
153
+ "argus-column-reorder": "handleColumnReorder($event)",
154
+ "argus-cell-click": "handleCellClick($event)",
155
+ "argus-row-click": "handleRowClick($event)",
156
+ "argus-range-change": "handleRangeChange($event)",
157
+ "argus-load-error": "handleLoadError($event)"
158
+ } },
159
+ ngImport: i0,
160
+ template: "<ng-content />",
161
+ isInline: true,
162
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
163
+ encapsulation: i0.ViewEncapsulation.None
164
+ });
165
+ }
166
+ };
167
+ i0.ɵɵngDeclareClassMetadata({
168
+ minVersion: "12.0.0",
169
+ version: "22.2.5",
170
+ ngImport: i0,
171
+ type: ArgusTableComponent,
172
+ decorators: [{
173
+ type: Component,
174
+ args: [{
175
+ selector: "argus-table",
176
+ template: "<ng-content />",
177
+ changeDetection: ChangeDetectionStrategy.OnPush,
178
+ encapsulation: ViewEncapsulation.None,
179
+ host: {
180
+ "(argus-sort-change)": "handleSortChange($event)",
181
+ "(argus-column-resize)": "handleColumnResize($event)",
182
+ "(argus-column-reorder)": "handleColumnReorder($event)",
183
+ "(argus-cell-click)": "handleCellClick($event)",
184
+ "(argus-row-click)": "handleRowClick($event)",
185
+ "(argus-range-change)": "handleRangeChange($event)",
186
+ "(argus-load-error)": "handleLoadError($event)"
187
+ }
188
+ }]
189
+ }],
190
+ propDecorators: {
191
+ columns: [{ type: Input }],
192
+ data: [{ type: Input }],
193
+ dataSource: [{ type: Input }],
194
+ pinnedRows: [{ type: Input }],
195
+ getRowId: [{ type: Input }],
196
+ rowHeight: [{ type: Input }],
197
+ density: [{ type: Input }],
198
+ overscan: [{ type: Input }],
199
+ sorting: [{ type: Input }],
200
+ columnSizing: [{ type: Input }],
201
+ columnOrder: [{ type: Input }],
202
+ sortChange: [{ type: Output }],
203
+ sortingChange: [{ type: Output }],
204
+ columnResize: [{ type: Output }],
205
+ columnSizingChange: [{ type: Output }],
206
+ columnReorder: [{ type: Output }],
207
+ columnOrderChange: [{ type: Output }],
208
+ cellClick: [{ type: Output }],
209
+ rowClick: [{ type: Output }],
210
+ rangeChange: [{ type: Output }],
211
+ loadError: [{ type: Output }]
212
+ }
213
+ });
214
+ var ArgusColumnComponent = class ArgusColumnComponent {
215
+ constructor() {
216
+ this.element = inject(ElementRef).nativeElement;
217
+ }
218
+ set columnId(value) {
219
+ setProperty(this.element, "columnId", "column-id", value);
220
+ }
221
+ set header(value) {
222
+ setProperty(this.element, "header", "header", value);
223
+ }
224
+ set accessor(value) {
225
+ setProperty(this.element, "accessor", "accessor", value);
226
+ }
227
+ set cell(value) {
228
+ setProperty(this.element, "cell", void 0, value);
229
+ }
230
+ set width(value) {
231
+ setProperty(this.element, "width", "width", value);
232
+ }
233
+ set minWidth(value) {
234
+ setProperty(this.element, "minWidth", "min-width", value);
235
+ }
236
+ set maxWidth(value) {
237
+ setProperty(this.element, "maxWidth", "max-width", value);
238
+ }
239
+ set pin(value) {
240
+ setProperty(this.element, "pin", "pin", value);
241
+ }
242
+ set align(value) {
243
+ setProperty(this.element, "align", "align", value);
244
+ }
245
+ set sortable(value) {
246
+ setProperty(this.element, "sortable", "sortable", value);
247
+ }
248
+ set resizable(value) {
249
+ setProperty(this.element, "resizable", "resizable", value);
250
+ }
251
+ set reorderable(value) {
252
+ setProperty(this.element, "reorderable", "reorderable", value);
253
+ }
254
+ static {
255
+ this.ɵfac = i0.ɵɵngDeclareFactory({
256
+ minVersion: "12.0.0",
257
+ version: "22.2.5",
258
+ ngImport: i0,
259
+ type: ArgusColumnComponent,
260
+ deps: [],
261
+ target: i0.ɵɵFactoryTarget.Component
262
+ });
263
+ }
264
+ static {
265
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
266
+ minVersion: "14.0.0",
267
+ version: "22.2.5",
268
+ type: ArgusColumnComponent,
269
+ isStandalone: true,
270
+ selector: "argus-column",
271
+ inputs: {
272
+ columnId: "columnId",
273
+ header: "header",
274
+ accessor: "accessor",
275
+ cell: "cell",
276
+ width: "width",
277
+ minWidth: "minWidth",
278
+ maxWidth: "maxWidth",
279
+ pin: "pin",
280
+ align: "align",
281
+ sortable: "sortable",
282
+ resizable: "resizable",
283
+ reorderable: "reorderable"
284
+ },
285
+ ngImport: i0,
286
+ template: "<ng-content />",
287
+ isInline: true,
288
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
289
+ encapsulation: i0.ViewEncapsulation.None
290
+ });
291
+ }
292
+ };
293
+ i0.ɵɵngDeclareClassMetadata({
294
+ minVersion: "12.0.0",
295
+ version: "22.2.5",
296
+ ngImport: i0,
297
+ type: ArgusColumnComponent,
298
+ decorators: [{
299
+ type: Component,
300
+ args: [{
301
+ selector: "argus-column",
302
+ template: "<ng-content />",
303
+ changeDetection: ChangeDetectionStrategy.OnPush,
304
+ encapsulation: ViewEncapsulation.None
305
+ }]
306
+ }],
307
+ propDecorators: {
308
+ columnId: [{ type: Input }],
309
+ header: [{ type: Input }],
310
+ accessor: [{ type: Input }],
311
+ cell: [{ type: Input }],
312
+ width: [{ type: Input }],
313
+ minWidth: [{ type: Input }],
314
+ maxWidth: [{ type: Input }],
315
+ pin: [{ type: Input }],
316
+ align: [{ type: Input }],
317
+ sortable: [{ type: Input }],
318
+ resizable: [{ type: Input }],
319
+ reorderable: [{ type: Input }]
320
+ }
321
+ });
322
+ export { ArgusColumnComponent, ArgusTableComponent };
323
+
324
+ //# sourceMappingURL=argus-table-angular.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"argus-table-angular.mjs","names":[],"sources":["../../src/set-property.ts","../../src/generated/elements.ts"],"sourcesContent":["// Registers the elements, and writes inputs to them.\nimport 'argus-table';\n\n/**\n * Sets an element property from an input. A string for a property that has an\n * attribute goes to the attribute instead, so the element converts it as it\n * would in HTML: Angular passes `<argus-column width=\"90\">` to the `width`\n * input as `'90'`, which the element reads as 90 px. `null` (say from the\n * `async` pipe) means `undefined`, which hands state back to the element.\n */\nexport function setProperty(\n element: HTMLElement,\n property: string,\n attribute: string | undefined,\n value: unknown,\n): void {\n if (attribute !== undefined) {\n if (typeof value === 'string') {\n element.setAttribute(attribute, value);\n return;\n }\n // A value set as a string earlier stays in the attribute; clear it so the\n // attribute and the property agree.\n if (value == null) element.removeAttribute(attribute);\n }\n (element as unknown as Record<string, unknown>)[property] = value ?? undefined;\n}\n","// Generated by tools/generate-wrappers from argus-table's Custom Elements Manifest.\n// Don't edit by hand: run `pnpm --filter @argus-table/angular generate`.\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport type {\n ArgusTable as ArgusTableElement,\n ArgusColumn as ArgusColumnElement,\n CellClickDetail,\n ColumnReorderDetail,\n ColumnResizeDetail,\n LoadErrorDetail,\n RangeChangeDetail,\n RowClickDetail,\n SortChangeDetail,\n} from 'argus-table';\nimport { setProperty } from '../set-property.js';\n\n/** `<argus-table>` as an Angular component, on the element's own tag. */\n@Component({\n selector: 'argus-table',\n template: '<ng-content />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '(argus-sort-change)': 'handleSortChange($event)',\n '(argus-column-resize)': 'handleColumnResize($event)',\n '(argus-column-reorder)': 'handleColumnReorder($event)',\n '(argus-cell-click)': 'handleCellClick($event)',\n '(argus-row-click)': 'handleRowClick($event)',\n '(argus-range-change)': 'handleRangeChange($event)',\n '(argus-load-error)': 'handleLoadError($event)',\n },\n})\nexport class ArgusTableComponent<T = unknown> {\n /** The `<argus-table>` element. */\n readonly element: ArgusTableElement<T> =\n inject<ElementRef<ArgusTableElement<T>>>(ElementRef).nativeElement;\n\n /** Column definitions. Property only: functions can't be attributes. While empty, the table reads its `<argus-column>` children instead. `null` or `undefined` means `[]`. */\n @Input() set columns(value: ArgusTableElement<T>['columns'] | null | undefined) {\n setProperty(this.element, 'columns', undefined, value);\n }\n\n /** The rows to show. Replace the array to update; changes inside it aren't detected. `null` or `undefined` means `[]`. */\n @Input() set data(value: ArgusTableElement<T>['data'] | null | undefined) {\n setProperty(this.element, 'data', undefined, value);\n }\n\n /** Loads rows page by page as they scroll into view, instead of `data`: `{ getRows({ start, end, sorting, signal }), pageSize? }`, where `end` is exclusive and `getRows` resolves to `{ rows, total? }`. Without a `total`, the table grows as pages arrive and a short page marks the end. Sorting happens on the server: a new order reloads from the top. While set, it wins over `data`. Replace the object to change `getRows` or `pageSize`. */\n @Input() set dataSource(value: ArgusTableElement<T>['dataSource'] | null | undefined) {\n setProperty(this.element, 'dataSource', undefined, value);\n }\n\n /** Rows fixed below the header (`top`) and at the bottom of the view (`bottom`), such as a totals row: `{ top?: T[], bottom?: T[] }`. They are separate objects, not rows of `data`: columns read them the same way, but they are never sorted and work the same with a `dataSource`. A `cell` function gets `pinned: 'top' | 'bottom'` in its context. Replace the object to update. */\n @Input() set pinnedRows(value: ArgusTableElement<T>['pinnedRows'] | null | undefined) {\n setProperty(this.element, 'pinnedRows', undefined, value);\n }\n\n /** Returns a stable id for a row. Default: the row's index (in `data`, or among all `dataSource` rows). */\n @Input() set getRowId(value: ArgusTableElement<T>['getRowId'] | null | undefined) {\n setProperty(this.element, 'getRowId', undefined, value);\n }\n\n /** Row height in px. Unset: the density (or the `--argus-row-height` token) decides. */\n @Input() set rowHeight(\n value: ArgusTableElement<T>['rowHeight'] | `${number}` | null | undefined,\n ) {\n setProperty(this.element, 'rowHeight', 'row-height', value);\n }\n\n /** Row density: `compact`, `comfortable` or `spacious`. */\n @Input() set density(value: ArgusTableElement<T>['density'] | null | undefined) {\n setProperty(this.element, 'density', 'density', value);\n }\n\n /** Rows rendered above and below the visible ones. `null` or `undefined` means the default, 6. */\n @Input() set overscan(value: ArgusTableElement<T>['overscan'] | `${number}` | null | undefined) {\n setProperty(this.element, 'overscan', 'overscan', value);\n }\n\n /** The sort order, e.g. `[{ id: 'total', desc: true }]`; `[]` when unsorted. Unset, the table keeps it itself and header clicks change it. Once set, it is controlled: a click only fires `argus-sort-change` with the proposed order, and nothing changes until you set the property. Set `undefined` to hand it back. */\n @Input() set sorting(value: ArgusTableElement<T>['sorting'] | null | undefined) {\n setProperty(this.element, 'sorting', undefined, value);\n }\n\n /** Resized widths in px by column id, e.g. `{ name: 240 }`. A resized flex column becomes fixed. Uncontrolled until set, like `sorting`: once set, a resize only fires `argus-column-resize` with the proposed widths. `undefined` hands it back. */\n @Input() set columnSizing(value: ArgusTableElement<T>['columnSizing'] | null | undefined) {\n setProperty(this.element, 'columnSizing', undefined, value);\n }\n\n /** The column order: column ids as the table shows them, e.g. `['id', 'total', 'customer']`. `[]` (the default) keeps the order of `columns`. Each pin group (start-pinned, scrolling, end-pinned) takes its columns in this order; unknown ids are ignored and columns it doesn't list follow the listed ones of their group. After a move it holds every column id. Uncontrolled until set, like `sorting`: once set, a move only fires `argus-column-reorder` with the proposed order. `undefined` hands it back. */\n @Input() set columnOrder(value: ArgusTableElement<T>['columnOrder'] | null | undefined) {\n setProperty(this.element, 'columnOrder', undefined, value);\n }\n\n /** `argus-sort-change`: A sortable header was clicked, or activated with Enter or Space. `detail: { sorting }`: the new order, or the proposed one when `sorting` is controlled. */\n @Output() readonly sortChange = new EventEmitter<CustomEvent<SortChangeDetail>>();\n\n /** The new `sorting` from `argus-sort-change`, for `[(sorting)]`. */\n @Output() readonly sortingChange = new EventEmitter<ArgusTableElement<T>['sorting']>();\n\n /** `argus-column-resize`: A column was resized: by dragging its handle, with Alt+Arrow on its header, by a double-click on its handle (fit to content) or by `autosizeColumns()`. `detail: { columnId, width, sizing }`: the new widths, or the proposed ones when `columnSizing` is controlled. Fires on every frame of a drag, and once per column that `autosizeColumns()` changes. */\n @Output() readonly columnResize = new EventEmitter<CustomEvent<ColumnResizeDetail>>();\n\n /** The new `columnSizing` from `argus-column-resize`, for `[(columnSizing)]`. */\n @Output() readonly columnSizingChange = new EventEmitter<ArgusTableElement<T>['columnSizing']>();\n\n /** `argus-column-reorder`: A column was moved: by dragging its header, or with Alt+Shift+Arrow on its focused header. Columns move within their own group (start-pinned, scrolling, end-pinned). `detail: { columnId, order }`: the new order, or the proposed one when `columnOrder` is controlled. Fires once per move, on drop. */\n @Output() readonly columnReorder = new EventEmitter<CustomEvent<ColumnReorderDetail>>();\n\n /** The new `columnOrder` from `argus-column-reorder`, for `[(columnOrder)]`. */\n @Output() readonly columnOrderChange = new EventEmitter<ArgusTableElement<T>['columnOrder']>();\n\n /** `argus-cell-click`: A body or pinned-row cell was clicked, or Enter was pressed on it. `detail: { row, columnId, value, pinned? }`; `pinned` is `'top'` or `'bottom'` for a pinned row. Fires before `argus-row-click`. */\n @Output() readonly cellClick = new EventEmitter<CustomEvent<CellClickDetail<T>>>();\n\n /** `argus-row-click`: A body or pinned row was clicked, or Enter was pressed on one of its cells. `detail: { row, rowId, index, pinned? }`; for a pinned row, `index` is its index in its list. */\n @Output() readonly rowClick = new EventEmitter<CustomEvent<RowClickDetail<T>>>();\n\n /** `argus-range-change`: The visible rows changed. `detail: { start, end }` (row indices, inclusive). */\n @Output() readonly rangeChange = new EventEmitter<CustomEvent<RangeChangeDetail>>();\n\n /** `argus-load-error`: A `dataSource` page failed to load: `getRows()` rejected or threw. `detail: { error, start, end }` (`end` exclusive). The rows show a Retry button. */\n @Output() readonly loadError = new EventEmitter<CustomEvent<LoadErrorDetail>>();\n\n /** Calls the element's `refresh()`. */\n refresh(\n ...args: Parameters<ArgusTableElement<T>['refresh']>\n ): ReturnType<ArgusTableElement<T>['refresh']> {\n return this.element.refresh(...args);\n }\n\n /** Calls the element's `autosizeColumns()`. */\n autosizeColumns(\n ...args: Parameters<ArgusTableElement<T>['autosizeColumns']>\n ): ReturnType<ArgusTableElement<T>['autosizeColumns']> {\n return this.element.autosizeColumns(...args);\n }\n\n /** Calls the element's `scrollToRow()`. */\n scrollToRow(\n ...args: Parameters<ArgusTableElement<T>['scrollToRow']>\n ): ReturnType<ArgusTableElement<T>['scrollToRow']> {\n return this.element.scrollToRow(...args);\n }\n\n protected handleSortChange(event: Event): void {\n // Events bubble: skip those of a table nested in a cell.\n if (event.target !== this.element) return;\n const e = event as CustomEvent<SortChangeDetail>;\n this.sortChange.emit(e);\n this.sortingChange.emit(e.detail.sorting);\n }\n\n protected handleColumnResize(event: Event): void {\n // Events bubble: skip those of a table nested in a cell.\n if (event.target !== this.element) return;\n const e = event as CustomEvent<ColumnResizeDetail>;\n this.columnResize.emit(e);\n this.columnSizingChange.emit(e.detail.sizing);\n }\n\n protected handleColumnReorder(event: Event): void {\n // Events bubble: skip those of a table nested in a cell.\n if (event.target !== this.element) return;\n const e = event as CustomEvent<ColumnReorderDetail>;\n this.columnReorder.emit(e);\n this.columnOrderChange.emit(e.detail.order);\n }\n\n protected handleCellClick(event: Event): void {\n // Events bubble: skip those of a table nested in a cell.\n if (event.target !== this.element) return;\n const e = event as CustomEvent<CellClickDetail<T>>;\n this.cellClick.emit(e);\n }\n\n protected handleRowClick(event: Event): void {\n // Events bubble: skip those of a table nested in a cell.\n if (event.target !== this.element) return;\n const e = event as CustomEvent<RowClickDetail<T>>;\n this.rowClick.emit(e);\n }\n\n protected handleRangeChange(event: Event): void {\n // Events bubble: skip those of a table nested in a cell.\n if (event.target !== this.element) return;\n const e = event as CustomEvent<RangeChangeDetail>;\n this.rangeChange.emit(e);\n }\n\n protected handleLoadError(event: Event): void {\n // Events bubble: skip those of a table nested in a cell.\n if (event.target !== this.element) return;\n const e = event as CustomEvent<LoadErrorDetail>;\n this.loadError.emit(e);\n }\n}\n\n/** `<argus-column>` as an Angular component, on the element's own tag. */\n@Component({\n selector: 'argus-column',\n template: '<ng-content />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class ArgusColumnComponent<T = unknown> {\n /** The `<argus-column>` element. */\n readonly element: ArgusColumnElement<T> =\n inject<ElementRef<ArgusColumnElement<T>>>(ElementRef).nativeElement;\n\n /** Stable key, used in state objects, events and persistence. Must be unique within the table. */\n @Input() set columnId(value: ArgusColumnElement<T>['columnId'] | null | undefined) {\n setProperty(this.element, 'columnId', 'column-id', value);\n }\n\n /** Header content: text as an attribute; a Lit template, a node or a function as a property. */\n @Input() set header(value: ArgusColumnElement<T>['header'] | null | undefined) {\n setProperty(this.element, 'header', 'header', value);\n }\n\n /** How to read the cell value: a property path such as `customer.name`, or (as a property) a function of the row and its index. */\n @Input() set accessor(value: ArgusColumnElement<T>['accessor'] | null | undefined) {\n setProperty(this.element, 'accessor', 'accessor', value);\n }\n\n /** Cell content from the row: `(row, context) => content`. Property only; wins over a `<template>` child. */\n @Input() set cell(value: ArgusColumnElement<T>['cell'] | null | undefined) {\n setProperty(this.element, 'cell', undefined, value);\n }\n\n /** Width: `90` (px), `auto` to fit the content, or `2fr` for a share of the free space. Default: 150 px. */\n @Input() set width(\n value:\n | ArgusColumnElement<T>['width']\n | `${number}`\n | `${number}px`\n | `${number}fr`\n | null\n | undefined,\n ) {\n setProperty(this.element, 'width', 'width', value);\n }\n\n /** Lower bound for resizing and for flex columns, in px. Default: 40. */\n @Input() set minWidth(value: ArgusColumnElement<T>['minWidth'] | `${number}` | null | undefined) {\n setProperty(this.element, 'minWidth', 'min-width', value);\n }\n\n /** Upper bound for resizing, in px. Default: no limit. */\n @Input() set maxWidth(value: ArgusColumnElement<T>['maxWidth'] | `${number}` | null | undefined) {\n setProperty(this.element, 'maxWidth', 'max-width', value);\n }\n\n /** Pins the column to the `start` or `end` side. */\n @Input() set pin(value: ArgusColumnElement<T>['pin'] | null | undefined) {\n setProperty(this.element, 'pin', 'pin', value);\n }\n\n /** Text alignment: `start`, `center` or `end`. Default: `start`. */\n @Input() set align(value: ArgusColumnElement<T>['align'] | null | undefined) {\n setProperty(this.element, 'align', 'align', value);\n }\n\n /** Whether the header can be clicked to sort. Default: `false`. */\n @Input() set sortable(\n value: ArgusColumnElement<T>['sortable'] | '' | 'true' | 'false' | null | undefined,\n ) {\n setProperty(this.element, 'sortable', 'sortable', value);\n }\n\n /** Whether the column can be resized. Default: `true`; `resizable=\"false\"` turns it off. */\n @Input() set resizable(\n value: ArgusColumnElement<T>['resizable'] | '' | 'true' | 'false' | null | undefined,\n ) {\n setProperty(this.element, 'resizable', 'resizable', value);\n }\n\n /** Whether the column can be moved. Default: `true`; `reorderable=\"false\"` turns it off. */\n @Input() set reorderable(\n value: ArgusColumnElement<T>['reorderable'] | '' | 'true' | 'false' | null | undefined,\n ) {\n setProperty(this.element, 'reorderable', 'reorderable', value);\n }\n}\n"],"mappings":";;;AAUA,SAAgB,YACd,SACA,UACA,WACA,OAAc;CAEd,IAAI,cAAc,QAAW;EAC3B,IAAI,OAAO,UAAU,UAAU;GAC7B,QAAQ,aAAa,WAAW,KAAK;GACrC;EACF;EAGA,IAAI,SAAS,MAAM,QAAQ,gBAAgB,SAAS;CACtD;CACC,QAA+C,YAAY,SAAS;AACvE;ACeA,IAAa,sBAAb,MAAa,oBAAmB;CAfhC,cAAA;EAiBW,KAAA,UACP,OAAyC,UAAU,CAAC,CAAC;EA4DpC,KAAA,aAAa,IAAI,aAAY;EAG7B,KAAA,gBAAgB,IAAI,aAAY;EAGhC,KAAA,eAAe,IAAI,aAAY;EAG/B,KAAA,qBAAqB,IAAI,aAAY;EAGrC,KAAA,gBAAgB,IAAI,aAAY;EAGhC,KAAA,oBAAoB,IAAI,aAAY;EAGpC,KAAA,YAAY,IAAI,aAAY;EAG5B,KAAA,WAAW,IAAI,aAAY;EAG3B,KAAA,cAAc,IAAI,aAAY;EAG9B,KAAA,YAAY,IAAI,aAAY;CA0EhD;CA9JC,IAAa,QAAQ,OAAyD;EAC5E,YAAY,KAAK,SAAS,WAAW,QAAW,KAAK;CACvD;CAGA,IAAa,KAAK,OAAsD;EACtE,YAAY,KAAK,SAAS,QAAQ,QAAW,KAAK;CACpD;CAGA,IAAa,WAAW,OAA4D;EAClF,YAAY,KAAK,SAAS,cAAc,QAAW,KAAK;CAC1D;CAGA,IA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,aAKA,MAAA,M;E,SAKA,MAAA,M;E,UAKA,MAAA,M;E,aAaA,MAAA,M;E,aAKA,MAAA,M;E,QAKA,MAAA,M;E,UAKA,MAAA,M;E,aAKA,MAAA,M;E,cAOA,MAAA,M;E,gBAOA,MAAA,M"}
@@ -0,0 +1,202 @@
1
+ import * as i0 from "@angular/core";
2
+ import { EventEmitter } from "@angular/core";
3
+ import { ArgusColumn, ArgusColumn as ArgusColumnElement, ArgusTable, ArgusTable as ArgusTableElement, CellClickDetail, CellClickDetail as CellClickDetail$1, CellContent, CellContext, ColumnAlign, ColumnDef, ColumnOrderState, ColumnPin, ColumnReorderDetail, ColumnReorderDetail as ColumnReorderDetail$1, ColumnResizeDetail, ColumnResizeDetail as ColumnResizeDetail$1, ColumnSizingState, ColumnWidth, DataSource, Density, LoadErrorDetail, LoadErrorDetail as LoadErrorDetail$1, PinnedRows, RangeChangeDetail, RangeChangeDetail as RangeChangeDetail$1, RowClickDetail, RowClickDetail as RowClickDetail$1, RowPin, RowsRequest, RowsResponse, SortChangeDetail, SortChangeDetail as SortChangeDetail$1, SortItem, SortState } from "argus-table";
4
+ /** `<argus-table>` as an Angular component, on the element's own tag. */
5
+ export declare class ArgusTableComponent<T = unknown> {
6
+ /** The `<argus-table>` element. */
7
+ readonly element: ArgusTable<T>;
8
+ /** Column definitions. Property only: functions can't be attributes. While empty, the table reads its `<argus-column>` children instead. `null` or `undefined` means `[]`. */
9
+ set columns(value: ArgusTable<T>['columns'] | null | undefined);
10
+ /** The rows to show. Replace the array to update; changes inside it aren't detected. `null` or `undefined` means `[]`. */
11
+ set data(value: ArgusTable<T>['data'] | null | undefined);
12
+ /** Loads rows page by page as they scroll into view, instead of `data`: `{ getRows({ start, end, sorting, signal }), pageSize? }`, where `end` is exclusive and `getRows` resolves to `{ rows, total? }`. Without a `total`, the table grows as pages arrive and a short page marks the end. Sorting happens on the server: a new order reloads from the top. While set, it wins over `data`. Replace the object to change `getRows` or `pageSize`. */
13
+ set dataSource(value: ArgusTable<T>['dataSource'] | null | undefined);
14
+ /** Rows fixed below the header (`top`) and at the bottom of the view (`bottom`), such as a totals row: `{ top?: T[], bottom?: T[] }`. They are separate objects, not rows of `data`: columns read them the same way, but they are never sorted and work the same with a `dataSource`. A `cell` function gets `pinned: 'top' | 'bottom'` in its context. Replace the object to update. */
15
+ set pinnedRows(value: ArgusTable<T>['pinnedRows'] | null | undefined);
16
+ /** Returns a stable id for a row. Default: the row's index (in `data`, or among all `dataSource` rows). */
17
+ set getRowId(value: ArgusTable<T>['getRowId'] | null | undefined);
18
+ /** Row height in px. Unset: the density (or the `--argus-row-height` token) decides. */
19
+ set rowHeight(value: ArgusTable<T>['rowHeight'] | `${number}` | null | undefined);
20
+ /** Row density: `compact`, `comfortable` or `spacious`. */
21
+ set density(value: ArgusTable<T>['density'] | null | undefined);
22
+ /** Rows rendered above and below the visible ones. `null` or `undefined` means the default, 6. */
23
+ set overscan(value: ArgusTable<T>['overscan'] | `${number}` | null | undefined);
24
+ /** The sort order, e.g. `[{ id: 'total', desc: true }]`; `[]` when unsorted. Unset, the table keeps it itself and header clicks change it. Once set, it is controlled: a click only fires `argus-sort-change` with the proposed order, and nothing changes until you set the property. Set `undefined` to hand it back. */
25
+ set sorting(value: ArgusTable<T>['sorting'] | null | undefined);
26
+ /** Resized widths in px by column id, e.g. `{ name: 240 }`. A resized flex column becomes fixed. Uncontrolled until set, like `sorting`: once set, a resize only fires `argus-column-resize` with the proposed widths. `undefined` hands it back. */
27
+ set columnSizing(value: ArgusTable<T>['columnSizing'] | null | undefined);
28
+ /** The column order: column ids as the table shows them, e.g. `['id', 'total', 'customer']`. `[]` (the default) keeps the order of `columns`. Each pin group (start-pinned, scrolling, end-pinned) takes its columns in this order; unknown ids are ignored and columns it doesn't list follow the listed ones of their group. After a move it holds every column id. Uncontrolled until set, like `sorting`: once set, a move only fires `argus-column-reorder` with the proposed order. `undefined` hands it back. */
29
+ set columnOrder(value: ArgusTable<T>['columnOrder'] | null | undefined);
30
+ /** `argus-sort-change`: A sortable header was clicked, or activated with Enter or Space. `detail: { sorting }`: the new order, or the proposed one when `sorting` is controlled. */
31
+ readonly sortChange: EventEmitter<CustomEvent<SortChangeDetail$1>>;
32
+ /** The new `sorting` from `argus-sort-change`, for `[(sorting)]`. */
33
+ readonly sortingChange: EventEmitter<import("argus-table").SortState>;
34
+ /** `argus-column-resize`: A column was resized: by dragging its handle, with Alt+Arrow on its header, by a double-click on its handle (fit to content) or by `autosizeColumns()`. `detail: { columnId, width, sizing }`: the new widths, or the proposed ones when `columnSizing` is controlled. Fires on every frame of a drag, and once per column that `autosizeColumns()` changes. */
35
+ readonly columnResize: EventEmitter<CustomEvent<ColumnResizeDetail$1>>;
36
+ /** The new `columnSizing` from `argus-column-resize`, for `[(columnSizing)]`. */
37
+ readonly columnSizingChange: EventEmitter<import("argus-table").ColumnSizingState>;
38
+ /** `argus-column-reorder`: A column was moved: by dragging its header, or with Alt+Shift+Arrow on its focused header. Columns move within their own group (start-pinned, scrolling, end-pinned). `detail: { columnId, order }`: the new order, or the proposed one when `columnOrder` is controlled. Fires once per move, on drop. */
39
+ readonly columnReorder: EventEmitter<CustomEvent<ColumnReorderDetail$1>>;
40
+ /** The new `columnOrder` from `argus-column-reorder`, for `[(columnOrder)]`. */
41
+ readonly columnOrderChange: EventEmitter<import("argus-table").ColumnOrderState>;
42
+ /** `argus-cell-click`: A body or pinned-row cell was clicked, or Enter was pressed on it. `detail: { row, columnId, value, pinned? }`; `pinned` is `'top'` or `'bottom'` for a pinned row. Fires before `argus-row-click`. */
43
+ readonly cellClick: EventEmitter<CustomEvent<CellClickDetail$1<T>>>;
44
+ /** `argus-row-click`: A body or pinned row was clicked, or Enter was pressed on one of its cells. `detail: { row, rowId, index, pinned? }`; for a pinned row, `index` is its index in its list. */
45
+ readonly rowClick: EventEmitter<CustomEvent<RowClickDetail$1<T>>>;
46
+ /** `argus-range-change`: The visible rows changed. `detail: { start, end }` (row indices, inclusive). */
47
+ readonly rangeChange: EventEmitter<CustomEvent<RangeChangeDetail$1>>;
48
+ /** `argus-load-error`: A `dataSource` page failed to load: `getRows()` rejected or threw. `detail: { error, start, end }` (`end` exclusive). The rows show a Retry button. */
49
+ readonly loadError: EventEmitter<CustomEvent<LoadErrorDetail$1>>;
50
+ /** Calls the element's `refresh()`. */
51
+ refresh(...args: Parameters<ArgusTable<T>['refresh']>): ReturnType<ArgusTable<T>['refresh']>;
52
+ /** Calls the element's `autosizeColumns()`. */
53
+ autosizeColumns(...args: Parameters<ArgusTable<T>['autosizeColumns']>): ReturnType<ArgusTable<T>['autosizeColumns']>;
54
+ /** Calls the element's `scrollToRow()`. */
55
+ scrollToRow(...args: Parameters<ArgusTable<T>['scrollToRow']>): ReturnType<ArgusTable<T>['scrollToRow']>;
56
+ protected handleSortChange(event: Event): void;
57
+ protected handleColumnResize(event: Event): void;
58
+ protected handleColumnReorder(event: Event): void;
59
+ protected handleCellClick(event: Event): void;
60
+ protected handleRowClick(event: Event): void;
61
+ protected handleRangeChange(event: Event): void;
62
+ protected handleLoadError(event: Event): void;
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<ArgusTableComponent<any>, never>;
64
+ static ɵcmp: i0.ɵɵComponentDeclaration<ArgusTableComponent<any>, "argus-table", never, {
65
+ "columns": {
66
+ "alias": "columns";
67
+ "required": false;
68
+ };
69
+ "data": {
70
+ "alias": "data";
71
+ "required": false;
72
+ };
73
+ "dataSource": {
74
+ "alias": "dataSource";
75
+ "required": false;
76
+ };
77
+ "pinnedRows": {
78
+ "alias": "pinnedRows";
79
+ "required": false;
80
+ };
81
+ "getRowId": {
82
+ "alias": "getRowId";
83
+ "required": false;
84
+ };
85
+ "rowHeight": {
86
+ "alias": "rowHeight";
87
+ "required": false;
88
+ };
89
+ "density": {
90
+ "alias": "density";
91
+ "required": false;
92
+ };
93
+ "overscan": {
94
+ "alias": "overscan";
95
+ "required": false;
96
+ };
97
+ "sorting": {
98
+ "alias": "sorting";
99
+ "required": false;
100
+ };
101
+ "columnSizing": {
102
+ "alias": "columnSizing";
103
+ "required": false;
104
+ };
105
+ "columnOrder": {
106
+ "alias": "columnOrder";
107
+ "required": false;
108
+ };
109
+ }, {
110
+ "sortChange": "sortChange";
111
+ "sortingChange": "sortingChange";
112
+ "columnResize": "columnResize";
113
+ "columnSizingChange": "columnSizingChange";
114
+ "columnReorder": "columnReorder";
115
+ "columnOrderChange": "columnOrderChange";
116
+ "cellClick": "cellClick";
117
+ "rowClick": "rowClick";
118
+ "rangeChange": "rangeChange";
119
+ "loadError": "loadError";
120
+ }, never, ["*"], true, never>;
121
+ }
122
+ /** `<argus-column>` as an Angular component, on the element's own tag. */
123
+ export declare class ArgusColumnComponent<T = unknown> {
124
+ /** The `<argus-column>` element. */
125
+ readonly element: ArgusColumn<T>;
126
+ /** Stable key, used in state objects, events and persistence. Must be unique within the table. */
127
+ set columnId(value: ArgusColumn<T>['columnId'] | null | undefined);
128
+ /** Header content: text as an attribute; a Lit template, a node or a function as a property. */
129
+ set header(value: ArgusColumn<T>['header'] | null | undefined);
130
+ /** How to read the cell value: a property path such as `customer.name`, or (as a property) a function of the row and its index. */
131
+ set accessor(value: ArgusColumn<T>['accessor'] | null | undefined);
132
+ /** Cell content from the row: `(row, context) => content`. Property only; wins over a `<template>` child. */
133
+ set cell(value: ArgusColumn<T>['cell'] | null | undefined);
134
+ /** Width: `90` (px), `auto` to fit the content, or `2fr` for a share of the free space. Default: 150 px. */
135
+ set width(value: ArgusColumn<T>['width'] | `${number}` | `${number}px` | `${number}fr` | null | undefined);
136
+ /** Lower bound for resizing and for flex columns, in px. Default: 40. */
137
+ set minWidth(value: ArgusColumn<T>['minWidth'] | `${number}` | null | undefined);
138
+ /** Upper bound for resizing, in px. Default: no limit. */
139
+ set maxWidth(value: ArgusColumn<T>['maxWidth'] | `${number}` | null | undefined);
140
+ /** Pins the column to the `start` or `end` side. */
141
+ set pin(value: ArgusColumn<T>['pin'] | null | undefined);
142
+ /** Text alignment: `start`, `center` or `end`. Default: `start`. */
143
+ set align(value: ArgusColumn<T>['align'] | null | undefined);
144
+ /** Whether the header can be clicked to sort. Default: `false`. */
145
+ set sortable(value: ArgusColumn<T>['sortable'] | '' | 'true' | 'false' | null | undefined);
146
+ /** Whether the column can be resized. Default: `true`; `resizable="false"` turns it off. */
147
+ set resizable(value: ArgusColumn<T>['resizable'] | '' | 'true' | 'false' | null | undefined);
148
+ /** Whether the column can be moved. Default: `true`; `reorderable="false"` turns it off. */
149
+ set reorderable(value: ArgusColumn<T>['reorderable'] | '' | 'true' | 'false' | null | undefined);
150
+ static ɵfac: i0.ɵɵFactoryDeclaration<ArgusColumnComponent<any>, never>;
151
+ static ɵcmp: i0.ɵɵComponentDeclaration<ArgusColumnComponent<any>, "argus-column", never, {
152
+ "columnId": {
153
+ "alias": "columnId";
154
+ "required": false;
155
+ };
156
+ "header": {
157
+ "alias": "header";
158
+ "required": false;
159
+ };
160
+ "accessor": {
161
+ "alias": "accessor";
162
+ "required": false;
163
+ };
164
+ "cell": {
165
+ "alias": "cell";
166
+ "required": false;
167
+ };
168
+ "width": {
169
+ "alias": "width";
170
+ "required": false;
171
+ };
172
+ "minWidth": {
173
+ "alias": "minWidth";
174
+ "required": false;
175
+ };
176
+ "maxWidth": {
177
+ "alias": "maxWidth";
178
+ "required": false;
179
+ };
180
+ "pin": {
181
+ "alias": "pin";
182
+ "required": false;
183
+ };
184
+ "align": {
185
+ "alias": "align";
186
+ "required": false;
187
+ };
188
+ "sortable": {
189
+ "alias": "sortable";
190
+ "required": false;
191
+ };
192
+ "resizable": {
193
+ "alias": "resizable";
194
+ "required": false;
195
+ };
196
+ "reorderable": {
197
+ "alias": "reorderable";
198
+ "required": false;
199
+ };
200
+ }, {}, never, ["*"], true, never>;
201
+ }
202
+ export type { ArgusColumnElement, ArgusTableElement, CellClickDetail, CellContent, CellContext, ColumnAlign, ColumnDef, ColumnOrderState, ColumnPin, ColumnReorderDetail, ColumnResizeDetail, ColumnSizingState, ColumnWidth, DataSource, Density, LoadErrorDetail, PinnedRows, RangeChangeDetail, RowClickDetail, RowPin, RowsRequest, RowsResponse, SortChangeDetail, SortItem, SortState };
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@argus-table/angular",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Angular components for argus-table: typed inputs, outputs and two-way binding for <argus-table> and <argus-column>.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Joessst-Dev/argus-table.git",
9
+ "directory": "packages/angular"
10
+ },
11
+ "type": "module",
12
+ "nx": {
13
+ "name": "angular",
14
+ "implicitDependencies": [
15
+ "generate-wrappers"
16
+ ]
17
+ },
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/types/argus-table-angular.d.ts",
21
+ "default": "./dist/fesm2022/argus-table-angular.mjs"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "types": "./dist/types/argus-table-angular.d.ts",
26
+ "files": [
27
+ "dist",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
31
+ "sideEffects": false,
32
+ "dependencies": {
33
+ "tslib": "^2.8.1",
34
+ "argus-table": "0.2.0"
35
+ },
36
+ "peerDependencies": {
37
+ "@angular/core": "^20.0.0 || ^21.0.0 || ^22.0.0"
38
+ },
39
+ "devDependencies": {
40
+ "@angular/common": "^22.2.5",
41
+ "@angular/compiler": "^22.2.5",
42
+ "@angular/compiler-cli": "^22.2.5",
43
+ "@angular/core": "^22.2.5",
44
+ "@angular/platform-browser": "^22.2.5",
45
+ "@arethetypeswrong/cli": "^0.18.5",
46
+ "@vitest/browser-playwright": "^5.1.0",
47
+ "ng-packagr": "^22.2.6",
48
+ "playwright": "1.63.0",
49
+ "publint": "^0.3.25",
50
+ "rxjs": "^7.8.2",
51
+ "vite": "^8.3.5",
52
+ "vitest": "^5.1.0"
53
+ },
54
+ "publishConfig": {
55
+ "access": "public"
56
+ },
57
+ "scripts": {
58
+ "build": "ng-packagr -p ng-package.json -c tsconfig.lib.json && node scripts/clean-dist.mjs && publint --strict && attw --pack . --profile esm-only",
59
+ "generate": "node ../../tools/generate-wrappers/src/cli.ts angular",
60
+ "typecheck": "tsc -p tsconfig.json --noEmit && ngc -p tsconfig.types.json",
61
+ "lint": "node ../../tools/generate-wrappers/src/cli.ts angular --check && eslint .",
62
+ "test": "vitest run"
63
+ }
6
64
  }