@su-labs/tree-table 0.0.0-stage → 19.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [22.0.0] - 2026-11-17
9
+
10
+ ### Added
11
+
12
+ - `su-lib-tree-table`: rows with child rows (`children`) that open and close, with a button or the keyboard; `expanded` to start open, and `toggled` with every open row's id
13
+ - Data parents (a normal row with its own cells) and group rows (`rowKind`, `groupLabel`): a heading across the table over its children
14
+ - `numbered`: a first column with each row's number, `nested` (1.1, 1.2), `restart` or `continue` per parent (`numbering`), and `unnumbered` rows that don't count, e.g. group rows
15
+ - Merged cells: a column's `span(value, row)` returns `{ rows, columns }`, rendered as real `rowspan` and `colspan` cells
16
+ - The table's sorting (siblings within each parent), search (a match keeps its parents open on view), paging by top-level rows, pinned top-level rows with their children (`rowPinning`, `pinnedRows`), pinned columns, the Columns menu (`columnControls`), the sticky header (`maxHeight`), custom cells (`suTableCell`), `rowClass` and every `--su-table-*` variable, plus `--su-tree-table-*` ones for the tree
17
+ - `role="treegrid"` with `aria-level`, `aria-expanded`, `aria-setsize` and `aria-posinset`; one row in the tab order, the up and down arrows, Home and End move between rows, the right arrow opens a row or moves to its first child, the left arrow closes it or moves to its parent, Enter and Space open or close it
18
+ - `labels` to replace the texts (`SU_TREE_TABLE_LABELS`)
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yevheniy Alekseyev <yev.alekseyev@gmail.com>
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,223 @@
1
- # Temporary Holding Version
1
+ # Tree Table
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
+ `@su-labs/tree-table`
4
+
5
+ ![Angular Version](https://img.shields.io/badge/Angular-v22-DD0031?style=for-the-badge&logo=angular&logoColor=white)
6
+ ![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)
7
+ ![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)
8
+ ![Version](https://img.shields.io/npm/v/@su-labs/tree-table?style=for-the-badge)
9
+
10
+ Accessible tree tables for Angular: rows with child rows that open and close, with the look and features of
11
+ [`@su-labs/table`](https://www.npmjs.com/package/@su-labs/table).
12
+
13
+ > **Not using Angular?** The same logic is in [`@su-labs/core/tree-table`](https://www.npmjs.com/package/@su-labs/core).
14
+
15
+ ## Features
16
+
17
+ - **Nested rows**: any depth; a parent is a **data row** with its own cells, or a **group row**, a heading across the
18
+ table over its children
19
+ - **Numbering**: a numbers column that **nests** (1, 1.1, 1.2), **restarts** or **continues** through the children,
20
+ chosen per parent, with group rows (or any rows) left unnumbered
21
+ - **Merged cells**: a column merges a cell with the cells below or after it, as real `rowspan` and `colspan` cells
22
+ - **From the table**: sorting, search, paging, pinned rows and columns, the Columns menu, a sticky header, custom
23
+ cells and the `--su-table-*` theming
24
+ - **Accessible**: `role="treegrid"` with `aria-level`, `aria-expanded`, `aria-setsize` and `aria-posinset`, and the
25
+ arrow keys to move, open and close rows
26
+
27
+ ## Installation
28
+
29
+ ```bash
30
+ npm install @su-labs/tree-table@ng19
31
+ ```
32
+
33
+ This is the Angular 19 version. For the newest Angular, install `@su-labs/tree-table` without a tag.
34
+
35
+ Peer dependencies: `@angular/core` and `@angular/common` 19.
36
+
37
+ ## Quick Start
38
+
39
+ ```ts
40
+ import { SuTreeTableColumns, SuTreeTableComponent } from '@su-labs/tree-table';
41
+
42
+ interface Item {
43
+ readonly id: string;
44
+ readonly name: string;
45
+ readonly unit?: string;
46
+ readonly price?: number;
47
+ readonly isGroup?: boolean;
48
+ readonly children?: readonly Item[];
49
+ }
50
+
51
+ @Component({
52
+ selector: 'app-price-list',
53
+ imports: [SuTreeTableComponent],
54
+ template: `
55
+ <su-lib-tree-table
56
+ caption="Price list"
57
+ numbered
58
+ searchable
59
+ [columns]="columns"
60
+ [rows]="items()"
61
+ [rowId]="itemId"
62
+ [children]="childrenOf"
63
+ [rowKind]="kindOf"
64
+ [unnumbered]="isGroup"
65
+ [expanded]="['fruit']" />
66
+ `,
67
+ })
68
+ export class PriceListPage {
69
+ protected readonly items = signal<readonly Item[]>([]);
70
+ protected readonly itemId = (item: Item) => item.id;
71
+ protected readonly childrenOf = (item: Item) => item.children;
72
+ protected readonly kindOf = (item: Item) => (item.isGroup ? 'group' : 'data');
73
+ protected readonly isGroup = (item: Item) => item.isGroup === true;
74
+
75
+ protected readonly columns: SuTreeTableColumns<Item> = [
76
+ { key: 'name', header: 'Item', sortable: true },
77
+ { key: 'unit', header: 'Unit' },
78
+ {
79
+ key: 'price',
80
+ header: 'Price',
81
+ sortable: true,
82
+ align: 'end',
83
+ format: price => (price === undefined ? '' : `€${price}`),
84
+ },
85
+ ];
86
+ }
87
+ ```
88
+
89
+ ## Data parents and group rows
90
+
91
+ Every row with `children` opens and closes. By default it's a **data row**: it has its own cells, like any other row.
92
+ Mark a row as a **group** with `rowKind` and it becomes a heading across the table, over its children, with no cells of
93
+ its own; its text is the first column's, or `groupLabel(row)`.
94
+
95
+ ## Numbering
96
+
97
+ `numbered` adds a first column with each row's number. `numbering` says how a parent's children are counted, for every
98
+ parent or per parent with a function:
99
+
100
+ | `numbering` | A parent numbered 2 | Then |
101
+ | -------------------- | ------------------- | ---- |
102
+ | `'nested'` (default) | children 2.1, 2.2 | 3 |
103
+ | `'restart'` | children 1, 2 | 3 |
104
+ | `'continue'` | children 3, 4 | 5 |
105
+
106
+ `unnumbered(row)` leaves rows without a number, and they don't count: e.g. `(row) => row.isGroup` numbers only the data
107
+ rows. Under an unnumbered group, `nested` children start again from 1 in each group, while `continue` keeps one count
108
+ across the groups. Numbers count the whole tree in the order on screen, open or not, so closing, opening or searching
109
+ doesn't change them; sorting does.
110
+
111
+ ## Merged cells
112
+
113
+ A column's `span(value, row)` returns how many cells this one takes: `rows` below it and `columns` after it, itself
114
+ included.
115
+
116
+ ```ts
117
+ { key: 'unit', header: 'Unit', span: (unit, item) => (item.id === 'apples' ? { rows: 2 } : null) },
118
+ { key: 'note', header: 'Note', span: (note, item) => (item.isTotal ? { columns: 2 } : null) },
119
+ ```
120
+
121
+ They render as real `rowspan` and `colspan` cells, so screen readers read each merged cell with every row and column it
122
+ covers. A row span stops at a group row, at the end of its parent's rows and at the end of the page, and a column span
123
+ stays within its column's pinned side. The first column holds the open and close buttons, so it's never merged down.
124
+
125
+ ## Search, sorting, paging and pinned rows
126
+
127
+ - **Search** (`searchable`) keeps the rows that match, the parents on the way to them (opened to show them) and the
128
+ matches' own children; a group row matches on its text
129
+ - **Sorting** sorts each parent's children by the column, and the top-level rows, never mixing levels
130
+ - **Paging** (`pageSize`, `pageSizes`) counts top-level rows, so a parent and its children always share a page
131
+ - **Pinned rows** (`rowPinning`, `pinnedRows`) are top-level rows, kept above the others with their children
132
+
133
+ Pinned columns, the Columns menu, `maxHeight` and custom cells work as in
134
+ [`@su-labs/table`](https://www.npmjs.com/package/@su-labs/table#pinned-columns).
135
+
136
+ ## Custom cells
137
+
138
+ ```html
139
+ <su-lib-tree-table
140
+ caption="Price list"
141
+ [columns]="columns"
142
+ [rows]="items()"
143
+ [children]="childrenOf">
144
+ <ng-template
145
+ suTableCell="price"
146
+ [suTableCellOf]="items()"
147
+ let-item
148
+ let-text="text">
149
+ <strong>{{ text }}</strong>
150
+ </ng-template>
151
+ </su-lib-tree-table>
152
+ ```
153
+
154
+ Import `SuTableCellDirective` from `@su-labs/tree-table` too.
155
+
156
+ ## API
157
+
158
+ ### Inputs
159
+
160
+ | Input | Default | Description |
161
+ | --------------------------- | ----------------------- | -------------------------------------------------------------------------------------------- |
162
+ | `columns` | — | `SuTreeTableColumns<TRow>`: like table columns without `edit`, plus `span` |
163
+ | `rows` | — | The top-level rows, each with its children |
164
+ | `caption` | — | The table's name for screen readers |
165
+ | `showCaption` | `false` | Shows the caption on screen too |
166
+ | `rowId` | each row object | The row's identity; keeps open and pinned rows when new rows arrive |
167
+ | `children` | — | A row's child rows, e.g. `(item) => item.children` |
168
+ | `rowKind` | every row `'data'` | `'group'` for heading rows across the table |
169
+ | `groupLabel` | the first column's text | A group row's text |
170
+ | `expanded` | `false` | The ids of the rows open to start with, or `true` for every one |
171
+ | `numbered` | `false` | A first column with each row's number |
172
+ | `numbering` | `'nested'` | `'nested'`, `'restart'` or `'continue'`, or a function of the parent row |
173
+ | `unnumbered` | — | Rows without a number |
174
+ | `columnControls` | `false` | The Columns menu |
175
+ | `searchable` | `false` | A search box above the table |
176
+ | `pageSize` / `pageSizes` | `'all'` / `[]` | Top-level rows per page, and the sizes to choose from |
177
+ | `rowPinning` / `pinnedRows` | `false` / — | A Pin button on each top-level row, and the ids pinned to start with |
178
+ | `maxHeight` | — | Any CSS length: the table scrolls inside, keeping the header and pinned rows in view |
179
+ | `rowClass` | — | Extra classes for a row, e.g. `is-muted` or `is-highlighted` |
180
+ | `labels` | English | `Partial<SuTreeTableLabels>`: the table's texts plus `expandRow`, `collapseRow` and `number` |
181
+
182
+ ### Outputs
183
+
184
+ | Output | Payload |
185
+ | ------------------ | ------------------------------------------------------------ |
186
+ | `toggled` | `{ row, expanded, expandedIds }` after a row opens or closes |
187
+ | `sortChange` | `{ key, direction } \| null` |
188
+ | `searchChange` | The query, once typing pauses |
189
+ | `pageChange` | `{ page, pageSize }`, the page from 0 |
190
+ | `pinnedRowsChange` | The ids of the pinned rows, in pin order |
191
+ | `columnsChange` | Every column's state after a change in the Columns menu |
192
+
193
+ ## Keyboard
194
+
195
+ One row is in the tab order; the arrow keys move between rows.
196
+
197
+ | Key | Does |
198
+ | ------------------------------ | -------------------------------------------------------------- |
199
+ | ↓ / ↑ | Next or previous row |
200
+ | Home / End | First or last row on screen |
201
+ | → | Opens a closed row, or moves to the first child of an open one |
202
+ | ← | Closes an open row, or moves to the parent |
203
+ | Enter or Space | Opens or closes the row |
204
+ | Column heading: Enter or Space | Sorts by it |
205
+
206
+ ## Styling
207
+
208
+ Every `--su-table-*` variable of [`@su-labs/table`](https://www.npmjs.com/package/@su-labs/table#variables) works here
209
+ too, so one theme styles both. The tree adds:
210
+
211
+ | Variable | Default |
212
+ | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
213
+ | `--su-tree-table-indent` | `1.25rem`, per level |
214
+ | `--su-tree-table-cell-start` | `0.4rem`, the first cell's start padding |
215
+ | `--su-tree-table-toggle-size` / `--su-tree-table-toggle-gap` / `--su-tree-table-toggle-radius` | `1.5rem` / `0.25rem` / `6px` |
216
+ | `--su-tree-table-toggle-color` / `--su-tree-table-toggle-hover-background` | `inherit` / a soft tint of the text |
217
+ | `--su-tree-table-group-background` / `--su-tree-table-group-color` / `--su-tree-table-group-font-weight` | `rgb(0 0 0 / 0.04)` / `inherit` / `600` |
218
+ | `--su-tree-table-number-color` | the text at 65% |
219
+ | `--su-tree-table-merged-background` / `--su-tree-table-merged-vertical-align` / `--su-tree-table-merged-border` | `transparent` / `middle` / the row border |
220
+
221
+ ## Browser Compatibility
222
+
223
+ Uses `color-mix()` and `position: sticky`: Chrome, Edge, Firefox and Safari from 2023 on.
@@ -0,0 +1,386 @@
1
+ import { SuTreeTableController, SU_TREE_TABLE_LABELS } from '@su-labs/core/tree-table';
2
+ export { SU_TREE_TABLE_LABELS } from '@su-labs/core/tree-table';
3
+ import { SuTableCellDirective, SuTablePaginatorComponent, SuTablePinDirective, SuTableToolbarComponent } from '@su-labs/table';
4
+ export { SuTableCellDirective } from '@su-labs/table';
5
+ import { NgTemplateOutlet } from '@angular/common';
6
+ import * as i0 from '@angular/core';
7
+ import { ChangeDetectionStrategy, Component, input, output, booleanAttribute, inject, ElementRef, contentChildren, signal, computed, DestroyRef, effect, untracked, afterRenderEffect } from '@angular/core';
8
+ import { suPinOffsets } from '@su-labs/core/table';
9
+
10
+ /** The pin drawn on pinned columns and pin buttons, as in `@su-labs/table`: `<svg suTreeTablePinIcon></svg>` */
11
+ class SuTreeTablePinIconComponent {
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuTreeTablePinIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: SuTreeTablePinIconComponent, isStandalone: true, selector: "svg[suTreeTablePinIcon]", host: { attributes: { "viewBox": "0 0 16 16", "aria-hidden": "true", "fill": "currentColor" } }, ngImport: i0, template: `<svg:path
14
+ d="M10 1.5 14.5 6l-1.6 1.6-1-.3-2.4 2.4.2 2.8-1.3 1.3L6 11 2.5 14.5 1.5 13.5 5 10 2.2 7.6l1.3-1.3 2.8.2 2.4-2.4-.3-1z" />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
15
+ }
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuTreeTablePinIconComponent, decorators: [{
17
+ type: Component,
18
+ args: [{
19
+ selector: 'svg[suTreeTablePinIcon]',
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ host: { viewBox: '0 0 16 16', 'aria-hidden': 'true', fill: 'currentColor' },
22
+ template: `<svg:path
23
+ d="M10 1.5 14.5 6l-1.6 1.6-1-.3-2.4 2.4.2 2.8-1.3 1.3L6 11 2.5 14.5 1.5 13.5 5 10 2.2 7.6l1.3-1.3 2.8.2 2.4-2.4-.3-1z" />`,
24
+ }]
25
+ }] });
26
+
27
+ /** A row's open and close button, or the room for one on a row without children, so every row's text lines up */
28
+ class SuTreeTableToggleComponent {
29
+ /** Whether the row's children show; null for a row without children */
30
+ expanded = input.required();
31
+ /** The button's name, e.g. “Expand Fruit” */
32
+ label = input.required();
33
+ toggle = output();
34
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuTreeTableToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
35
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: SuTreeTableToggleComponent, isStandalone: true, selector: "su-lib-tree-table-toggle", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { toggle: "toggle" }, ngImport: i0, template: "@if (expanded() !== null) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"su-tree-table-toggle\"\n [class.is-expanded]=\"expanded()\"\n [attr.aria-label]=\"label()\"\n (click)=\"toggle.emit()\"\n >\n <span class=\"su-tree-table-chevron\" aria-hidden=\"true\"></span>\n </button>\n}\n", styles: [":host{display:inline-flex;flex:none;height:var(--su-tree-table-toggle-size, 1.5rem);margin-inline-end:var(--su-tree-table-toggle-gap, .25rem);vertical-align:middle;width:var(--su-tree-table-toggle-size, 1.5rem)}.su-tree-table-toggle{align-items:center;background:transparent;border:none;border-radius:var(--su-tree-table-toggle-radius, 6px);color:var(--su-tree-table-toggle-color, inherit);cursor:pointer;display:inline-flex;height:100%;justify-content:center;padding:0;width:100%}.su-tree-table-toggle:hover{background:var(--su-tree-table-toggle-hover-background, color-mix(in srgb, currentColor 10%, transparent))}.su-tree-table-chevron{border-block-start:2px solid currentColor;border-inline-end:2px solid currentColor;height:.45rem;transform:rotate(45deg);width:.45rem}.su-tree-table-chevron:dir(rtl){transform:rotate(-45deg)}.is-expanded .su-tree-table-chevron{transform:rotate(135deg)}@media(prefers-reduced-motion:no-preference){.su-tree-table-chevron{transition:transform .15s ease}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
36
+ }
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuTreeTableToggleComponent, decorators: [{
38
+ type: Component,
39
+ args: [{ selector: 'su-lib-tree-table-toggle', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (expanded() !== null) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"su-tree-table-toggle\"\n [class.is-expanded]=\"expanded()\"\n [attr.aria-label]=\"label()\"\n (click)=\"toggle.emit()\"\n >\n <span class=\"su-tree-table-chevron\" aria-hidden=\"true\"></span>\n </button>\n}\n", styles: [":host{display:inline-flex;flex:none;height:var(--su-tree-table-toggle-size, 1.5rem);margin-inline-end:var(--su-tree-table-toggle-gap, .25rem);vertical-align:middle;width:var(--su-tree-table-toggle-size, 1.5rem)}.su-tree-table-toggle{align-items:center;background:transparent;border:none;border-radius:var(--su-tree-table-toggle-radius, 6px);color:var(--su-tree-table-toggle-color, inherit);cursor:pointer;display:inline-flex;height:100%;justify-content:center;padding:0;width:100%}.su-tree-table-toggle:hover{background:var(--su-tree-table-toggle-hover-background, color-mix(in srgb, currentColor 10%, transparent))}.su-tree-table-chevron{border-block-start:2px solid currentColor;border-inline-end:2px solid currentColor;height:.45rem;transform:rotate(45deg);width:.45rem}.su-tree-table-chevron:dir(rtl){transform:rotate(-45deg)}.is-expanded .su-tree-table-chevron{transform:rotate(135deg)}@media(prefers-reduced-motion:no-preference){.su-tree-table-chevron{transition:transform .15s ease}}\n"] }]
40
+ }] });
41
+
42
+ let nextTreeTableId = 0;
43
+ /** The room, in pixels, the pinned columns leave for the scrolling ones before they stop sticking */
44
+ const MIN_SCROLLING_WIDTH = 96;
45
+ /** How long typing pauses, in milliseconds, before the search runs */
46
+ const SEARCH_DELAY = 200;
47
+ /**
48
+ * An accessible tree table (`role="treegrid"`) over `SuTreeTableController` from `@su-labs/core/tree-table`: rows
49
+ * with child rows that open and close, data or group parents, numbering, merged cells, and the table's sorting,
50
+ * search, paging, pinned rows and columns, Columns menu and `--su-table-*` theming.
51
+ */
52
+ class SuTreeTableComponent {
53
+ columns = input.required();
54
+ /** The top-level rows, each with its children */
55
+ rows = input.required();
56
+ /** The table's name for screen readers, shown as its caption */
57
+ caption = input.required();
58
+ /** Shows the caption on screen too @default false */
59
+ showCaption = input(false, { transform: booleanAttribute });
60
+ /** The row's identity, e.g. the API's id; keeps open rows and pins across new rows */
61
+ rowId = input();
62
+ /** A row's child rows, e.g. `(item) => item.children`; a row without any is a leaf */
63
+ children = input();
64
+ /** Which rows are group rows, a heading across the table over their children; every row is a data row by default */
65
+ rowKind = input();
66
+ /** A group row's text; by default the first column's text */
67
+ groupLabel = input();
68
+ /** The rows open to start with, or `true` for every one @default false */
69
+ expanded = input();
70
+ /** A first column with each row's number @default false */
71
+ numbered = input(false, { transform: booleanAttribute });
72
+ /** How children are numbered, for every parent or per parent: `nested` (1.1), `restart` or `continue` @default 'nested' */
73
+ numbering = input();
74
+ /** Rows left without a number, that don't count, e.g. `(row) => row.isGroup` */
75
+ unnumbered = input();
76
+ /** A Columns button with a menu to show or hide columns and the pin in their headings @default false */
77
+ columnControls = input(false, { transform: booleanAttribute });
78
+ /** A search box above the table; a match keeps its parents on view @default false */
79
+ searchable = input(false, { transform: booleanAttribute });
80
+ /** The most the table grows before it scrolls inside, any CSS length; the header and pinned rows stay in view */
81
+ maxHeight = input();
82
+ /** Extra classes for a row; the table styles `is-muted` and `is-highlighted` */
83
+ rowClass = input();
84
+ /** Top-level rows per page, each with its children; without it, every row shows @default 'all' */
85
+ pageSize = input();
86
+ /** The page sizes people choose from under the table, e.g. `[10, 25, 'all']` */
87
+ pageSizes = input([]);
88
+ /** A Pin button on each top-level row, keeping it and its children above the others on every page @default false */
89
+ rowPinning = input(false, { transform: booleanAttribute });
90
+ /** The ids of the top-level rows pinned to start with */
91
+ pinnedRows = input();
92
+ /** Texts to replace, e.g. in the page's language */
93
+ labels = input({});
94
+ toggled = output();
95
+ sortChange = output();
96
+ /** The search changed, after typing paused */
97
+ searchChange = output();
98
+ /** The pinned rows changed: their ids, in pin order */
99
+ pinnedRowsChange = output();
100
+ /** A column was shown, hidden, pinned or unpinned: every column's state, e.g. to save it */
101
+ columnsChange = output();
102
+ pageChange = output();
103
+ controller = new SuTreeTableController();
104
+ host = inject(ElementRef);
105
+ cellTemplates = contentChildren(SuTableCellDirective);
106
+ /** The row to move the focus to once it renders, after a key press */
107
+ focusTarget = signal(null);
108
+ searchTimer;
109
+ headerWidths = signal([]);
110
+ scrollerWidth = signal(0);
111
+ headerHeight = signal(0);
112
+ pinnedRowHeights = signal([]);
113
+ headerLayout = computed(() => `${this.state()
114
+ .columns.map(column => `${String(column.key)}:${column.pinned}`)
115
+ .join()}|${this.numbered()}|${this.rowPinning()}|${this.state()
116
+ .pinnedRows.map(row => row.id)
117
+ .join()}`);
118
+ tableId = `su-tree-table-${nextTreeTableId++}`;
119
+ state = signal(this.controller.state.get());
120
+ text = computed(() => ({
121
+ ...SU_TREE_TABLE_LABELS,
122
+ ...this.labels(),
123
+ }));
124
+ /** The pinned rows, then the current page */
125
+ bodyRows = computed(() => {
126
+ const { pinnedRows, rows } = this.state();
127
+ return [...pinnedRows, ...rows];
128
+ });
129
+ /** The one row in the tab order: the last one focused while it's on screen, else the first */
130
+ activeRowId = signal(null);
131
+ tabRowId = computed(() => {
132
+ const rows = this.bodyRows();
133
+ const active = this.activeRowId();
134
+ return rows.some(row => row.id === active) ? active : (rows[0]?.id ?? null);
135
+ });
136
+ scrolledFromStart = signal(false);
137
+ moreAtEnd = signal(false);
138
+ scrolledFromTop = signal(false);
139
+ /** Where each pinned row sticks: under the header and the pinned rows above it */
140
+ pinnedRowTops = computed(() => {
141
+ let top = this.headerHeight();
142
+ return this.pinnedRowHeights().map(height => {
143
+ const rowTop = top;
144
+ top += height;
145
+ return rowTop;
146
+ });
147
+ });
148
+ columnSlot = computed(() => Number(this.numbered()));
149
+ /**
150
+ * Where each header slot sticks, in order: the numbers, the columns and the pin buttons. The numbers stay with
151
+ * columns pinned to the start, the pin buttons with columns pinned to the end.
152
+ */
153
+ placements = computed(() => {
154
+ const columns = this.state().columns;
155
+ const numberPin = columns.some(column => column.pinned === 'start')
156
+ ? 'start'
157
+ : null;
158
+ const actionsPin = columns.some(column => column.pinned === 'end')
159
+ ? 'end'
160
+ : null;
161
+ return suPinOffsets([
162
+ ...(this.numbered() ? [numberPin] : []),
163
+ ...columns.map(column => column.pinned),
164
+ ...(this.rowPinning() ? [actionsPin] : []),
165
+ ], this.headerWidths(), this.scrollerWidth(), MIN_SCROLLING_WIDTH);
166
+ });
167
+ columnCount = computed(() => this.state().columns.length +
168
+ Number(this.numbered()) +
169
+ Number(this.rowPinning()));
170
+ constructor() {
171
+ const unsubscribe = this.controller.state.subscribe(state => this.state.set(state));
172
+ inject(DestroyRef).onDestroy(() => {
173
+ unsubscribe();
174
+ clearTimeout(this.searchTimer);
175
+ });
176
+ effect(() => {
177
+ const options = {
178
+ columns: this.columns(),
179
+ rowId: this.rowId(),
180
+ children: this.children(),
181
+ rowKind: this.rowKind(),
182
+ groupLabel: this.groupLabel(),
183
+ numbering: this.numbering(),
184
+ unnumbered: this.unnumbered(),
185
+ labels: this.labels(),
186
+ pageSizes: this.pageSizes(),
187
+ };
188
+ untracked(() => this.controller.configure(options));
189
+ });
190
+ effect(() => {
191
+ const rows = this.rows();
192
+ untracked(() => this.controller.setRows(rows));
193
+ });
194
+ effect(() => {
195
+ const expanded = this.expanded();
196
+ if (expanded !== undefined) {
197
+ untracked(() => this.controller.configure({ expanded }));
198
+ }
199
+ });
200
+ effect(() => {
201
+ const pinnedRows = this.pinnedRows();
202
+ if (pinnedRows !== undefined) {
203
+ untracked(() => this.controller.configure({ pinnedRows }));
204
+ }
205
+ });
206
+ effect(() => {
207
+ const pageSize = this.pageSize();
208
+ if (pageSize !== undefined) {
209
+ untracked(() => this.controller.configure({ pageSize }));
210
+ }
211
+ });
212
+ afterRenderEffect(onCleanup => {
213
+ this.headerLayout();
214
+ if (typeof ResizeObserver === 'undefined') {
215
+ return;
216
+ }
217
+ const host = this.host.nativeElement;
218
+ const scroller = host.querySelector('.su-table-scroll');
219
+ const headers = [...host.querySelectorAll('thead th')];
220
+ const head = host.querySelector('thead');
221
+ const pinnedRows = [
222
+ ...host.querySelectorAll('tbody > tr.is-pinned-row'),
223
+ ];
224
+ const observer = new ResizeObserver(() => {
225
+ this.headerHeight.set(head?.getBoundingClientRect().height ?? 0);
226
+ const heights = pinnedRows.map(row => row.getBoundingClientRect().height);
227
+ const currentHeights = untracked(() => this.pinnedRowHeights());
228
+ if (heights.length !== currentHeights.length ||
229
+ heights.some((height, index) => height !== currentHeights[index])) {
230
+ this.pinnedRowHeights.set(heights);
231
+ }
232
+ const widths = headers.map(header => header.getBoundingClientRect().width);
233
+ const current = untracked(() => this.headerWidths());
234
+ if (widths.length !== current.length ||
235
+ widths.some((width, index) => width !== current[index])) {
236
+ this.headerWidths.set(widths);
237
+ }
238
+ if (scroller) {
239
+ this.scrollerWidth.set(scroller.clientWidth);
240
+ this.updateScrollEdges(scroller);
241
+ }
242
+ });
243
+ [...headers, ...pinnedRows].forEach(element => observer.observe(element));
244
+ if (scroller) {
245
+ observer.observe(scroller);
246
+ }
247
+ onCleanup(() => observer.disconnect());
248
+ });
249
+ afterRenderEffect(() => {
250
+ const id = this.focusTarget();
251
+ this.state();
252
+ if (id === null) {
253
+ return;
254
+ }
255
+ const row = this.rowElement(id);
256
+ if (row) {
257
+ row.focus();
258
+ this.focusTarget.set(null);
259
+ }
260
+ });
261
+ }
262
+ cellTemplate(key) {
263
+ return (this.cellTemplates().find(cell => cell.key() === String(key))?.template ??
264
+ null);
265
+ }
266
+ rowClassOf(row) {
267
+ return this.rowClass()?.(row.data) ?? null;
268
+ }
269
+ toggle(row) {
270
+ this.activeRowId.set(row.id);
271
+ this.controller.toggle(row.id);
272
+ this.emitToggle(row);
273
+ }
274
+ /** Keys on the focused row itself move between rows and open or close them; keys on its buttons stay theirs */
275
+ onRowKey(event, row) {
276
+ if (event.target !== event.currentTarget) {
277
+ return;
278
+ }
279
+ const before = row.expanded;
280
+ const result = this.controller.rowKey(row.id, event.key);
281
+ if (!result.handled) {
282
+ return;
283
+ }
284
+ event.preventDefault();
285
+ this.activeRowId.set(result.focusId);
286
+ this.focusTarget.set(result.focusId);
287
+ if (this.controller.isExpanded(row.id) !== before && before !== null) {
288
+ this.emitToggle(row);
289
+ }
290
+ }
291
+ onRowFocus(id) {
292
+ this.activeRowId.set(id);
293
+ }
294
+ /** The pin in a heading unpins its column, or pins it back to the side it was set up with (by default the start) */
295
+ toggleColumnPin(key, pinned) {
296
+ const setUpPin = this.columns().find(column => column.key === key)?.pinned;
297
+ this.controller.pinColumn(key, pinned ? null : (setUpPin ?? 'start'));
298
+ this.columnsChange.emit(this.state().allColumns);
299
+ }
300
+ setColumnPinnable({ key, pinnable, }) {
301
+ this.controller.setColumnPinnable(key, pinnable);
302
+ this.columnsChange.emit(this.state().allColumns);
303
+ }
304
+ setColumnsVisible(visible) {
305
+ this.controller.setColumnsVisible(visible);
306
+ this.columnsChange.emit(this.state().allColumns);
307
+ }
308
+ setColumnVisible({ key, visible, }) {
309
+ this.controller.setColumnVisible(key, visible);
310
+ this.columnsChange.emit(this.state().allColumns);
311
+ }
312
+ /** Narrows the rows once typing pauses, so each keystroke isn't announced */
313
+ search(query) {
314
+ clearTimeout(this.searchTimer);
315
+ this.searchTimer = setTimeout(() => {
316
+ this.controller.search(query);
317
+ this.searchChange.emit(query);
318
+ }, SEARCH_DELAY);
319
+ }
320
+ onScroll(event) {
321
+ if (event.target instanceof HTMLElement) {
322
+ this.updateScrollEdges(event.target);
323
+ }
324
+ }
325
+ sortBy(key) {
326
+ this.controller.sortBy(key);
327
+ this.sortChange.emit(this.state().sort);
328
+ }
329
+ pinRow(id) {
330
+ this.controller.pinRow(id);
331
+ this.pinnedRowsChange.emit(this.state()
332
+ .pinnedRows.filter(row => row.level === 1)
333
+ .map(row => row.id));
334
+ }
335
+ setPage(page) {
336
+ this.controller.setPage(page);
337
+ this.emitPage();
338
+ }
339
+ setPageSize(pageSize) {
340
+ this.controller.setPageSize(pageSize);
341
+ this.emitPage();
342
+ }
343
+ rowElement(id) {
344
+ return ([
345
+ ...this.host.nativeElement.querySelectorAll('tbody > tr[data-su-tree-row]'),
346
+ ].find(row => row.dataset['suTreeRow'] === String(id)) ?? null);
347
+ }
348
+ emitToggle(row) {
349
+ this.toggled.emit({
350
+ row: row.data,
351
+ expanded: this.controller.isExpanded(row.id),
352
+ expandedIds: this.controller.expandedIds(),
353
+ });
354
+ }
355
+ /** Shadows show on the pinned edges only while columns or rows are scrolled under them */
356
+ updateScrollEdges(scroller) {
357
+ this.scrolledFromTop.set(scroller.scrollTop > 1);
358
+ const position = Math.abs(scroller.scrollLeft);
359
+ this.scrolledFromStart.set(position > 1);
360
+ this.moreAtEnd.set(position < scroller.scrollWidth - scroller.clientWidth - 1);
361
+ }
362
+ emitPage() {
363
+ const { page, pageSize } = this.state().pagination;
364
+ this.pageChange.emit({ page, pageSize });
365
+ }
366
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuTreeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
367
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: SuTreeTableComponent, isStandalone: true, selector: "su-lib-tree-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: true, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: true, transformFunction: null }, showCaption: { classPropertyName: "showCaption", publicName: "showCaption", isSignal: true, isRequired: false, transformFunction: null }, rowId: { classPropertyName: "rowId", publicName: "rowId", isSignal: true, isRequired: false, transformFunction: null }, children: { classPropertyName: "children", publicName: "children", isSignal: true, isRequired: false, transformFunction: null }, rowKind: { classPropertyName: "rowKind", publicName: "rowKind", isSignal: true, isRequired: false, transformFunction: null }, groupLabel: { classPropertyName: "groupLabel", publicName: "groupLabel", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, numbered: { classPropertyName: "numbered", publicName: "numbered", isSignal: true, isRequired: false, transformFunction: null }, numbering: { classPropertyName: "numbering", publicName: "numbering", isSignal: true, isRequired: false, transformFunction: null }, unnumbered: { classPropertyName: "unnumbered", publicName: "unnumbered", isSignal: true, isRequired: false, transformFunction: null }, columnControls: { classPropertyName: "columnControls", publicName: "columnControls", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizes: { classPropertyName: "pageSizes", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null }, rowPinning: { classPropertyName: "rowPinning", publicName: "rowPinning", isSignal: true, isRequired: false, transformFunction: null }, pinnedRows: { classPropertyName: "pinnedRows", publicName: "pinnedRows", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggled: "toggled", sortChange: "sortChange", searchChange: "searchChange", pinnedRowsChange: "pinnedRowsChange", columnsChange: "columnsChange", pageChange: "pageChange" }, host: { classAttribute: "su-tree-table" }, queries: [{ propertyName: "cellTemplates", predicate: SuTableCellDirective, isSignal: true }], ngImport: i0, template: "@let current = state();\n@let t = text();\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\n@let pinnedCount = current.pinnedRows.length;\n@if (searchable() || columnControls()) {\n <su-lib-table-toolbar\n [labels]=\"t\"\n [controlId]=\"tableId\"\n [searchable]=\"searchable()\"\n [query]=\"current.query\"\n [columnControls]=\"columnControls()\"\n [columns]=\"current.allColumns\"\n (queryChange)=\"search($event)\"\n (pinnableChange)=\"setColumnPinnable($event)\"\n (visibilityChange)=\"setColumnVisible($event)\"\n (allVisibilityChange)=\"setColumnsVisible($event)\"\n />\n}\n\n<div\n class=\"su-table-scroll\"\n [class.is-scrolled-start]=\"scrolledFromStart()\"\n [class.has-more-end]=\"moreAtEnd()\"\n [class.is-scrolled-top]=\"scrolledFromTop()\"\n [class.has-pinned-rows]=\"current.pinnedRows.length > 0\"\n [style.max-height]=\"maxHeight()\"\n (scroll)=\"onScroll($event)\"\n>\n <table class=\"su-table-grid\" role=\"treegrid\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (numbered()) {\n <th scope=\"col\" class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ t.number }}</th>\n }\n @for (column of current.columns; track column.key; let columnIndex = $index) {\n <th\n scope=\"col\"\n class=\"su-table-align-{{ column.align }}\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + columnIndex]\"\n [attr.aria-sort]=\"column.sort === 'none' ? null : column.sort\"\n >\n @if (column.sortable) {\n <button type=\"button\" class=\"su-table-sort\" (click)=\"sortBy(column.key)\">\n {{ column.header }}\n <span class=\"su-table-sort-icon is-{{ column.sort }}\" aria-hidden=\"true\"></span>\n </button>\n } @else {\n {{ column.header }}\n }\n @if (column.pinnable) {\n <button\n type=\"button\"\n class=\"su-table-header-pin\"\n [attr.aria-label]=\"t.pinColumn(column.header)\"\n [attr.aria-pressed]=\"column.pinned !== null\"\n (click)=\"toggleColumnPin(column.key, column.pinned)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTreeTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (rowPinning()) {\n <th scope=\"col\" class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">{{ t.actions }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of bodyRows(); track row.id; let rowIndex = $index) {\n <tr\n [attr.data-su-tree-row]=\"row.id\"\n [attr.tabindex]=\"row.id === tabRowId() ? 0 : -1\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-posinset]=\"row.position\"\n [attr.aria-setsize]=\"row.siblings\"\n [attr.aria-expanded]=\"row.expanded\"\n [class]=\"rowClassOf(row)\"\n [class.su-tree-table-row]=\"true\"\n [class.is-group]=\"row.kind === 'group'\"\n [class.is-pinned-row]=\"rowIndex < pinnedCount\"\n [class.is-last-pinned-row]=\"rowIndex === pinnedCount - 1\"\n [style.--su-table-row-top]=\"rowIndex < pinnedCount ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [style.--su-tree-table-level]=\"row.level - 1\"\n (keydown)=\"onRowKey($event, row)\"\n (focus)=\"onRowFocus(row.id)\"\n >\n @if (numbered()) {\n <td class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ row.number }}</td>\n }\n @if (row.kind === 'group') {\n <td\n role=\"rowheader\"\n class=\"su-tree-table-group-cell su-tree-table-tree-cell\"\n [attr.colspan]=\"current.columns.length\"\n >\n <span class=\"su-tree-table-group-label\">\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n {{ row.label }}\n </span>\n </td>\n } @else {\n @for (cell of row.cells; track cell.key) {\n @let column = current.columns[cell.columnIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : 'gridcell'\"\n [attr.rowspan]=\"cell.rowSpan > 1 ? cell.rowSpan : null\"\n [attr.colspan]=\"cell.colSpan > 1 ? cell.colSpan : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.su-tree-table-tree-cell]=\"cell.columnIndex === 0\"\n [class.is-merged]=\"cell.rowSpan > 1 || cell.colSpan > 1\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + cell.columnIndex]\"\n >\n @if (cell.columnIndex === 0) {\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n }\n @if (cellTemplate(cell.key); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row.data, text: cell.text }\" />\n } @else {\n {{ cell.text }}\n }\n </td>\n }\n }\n @if (rowPinning()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n @if (row.level === 1) {\n <div class=\"su-table-actions\">\n <button\n type=\"button\"\n class=\"su-table-button su-table-pin-button\"\n [attr.aria-pressed]=\"row.pinned\"\n [attr.aria-label]=\"t.pinRow + ', ' + row.label\"\n (click)=\"pinRow(row.id)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n </div>\n }\n </td>\n }\n </tr>\n }\n @if (current.rows.length === 0) {\n <tr>\n <td class=\"su-table-empty\" [attr.colspan]=\"columnCount()\">\n {{ current.searching ? t.noMatches(current.query) : t.empty }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div>\n\n@if (current.pagination.pageSizes.length > 0 || current.pagination.pageSize !== 'all') {\n <su-lib-table-paginator\n [pagination]=\"current.pagination\"\n [labels]=\"t\"\n [controlId]=\"tableId + '-page-size'\"\n (pageChange)=\"setPage($event)\"\n (pageSizeChange)=\"setPageSize($event)\"\n />\n}\n\n<div class=\"su-table-visually-hidden\" role=\"status\">{{ current.announcement }}</div>\n\n", styles: [":host{color:var(--su-table-text-color, inherit);display:block;min-width:0;font-family:var(--su-table-font-family, inherit);font-size:var(--su-table-font-size, .95rem)}.su-table-scroll{border:var(--su-table-border, 1px solid rgba(0, 0, 0, .12));border-radius:var(--su-table-radius, 10px);overflow:auto}.su-table-grid{background:var(--su-table-background, transparent);border-collapse:separate;border-spacing:0;min-width:100%}caption{caption-side:top;color:var(--su-table-caption-color, inherit);font-size:var(--su-table-caption-font-size, inherit);font-weight:600;padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start}th,td{background-image:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent));border-bottom:var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08));padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start;vertical-align:var(--su-table-cell-vertical-align, middle)}thead th{--su-table-row-tint: var(--su-table-header-background, rgb(0 0 0 / .03));border-bottom:var(--su-table-header-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)));color:var(--su-table-header-color, inherit);font-size:var(--su-table-header-font-size, inherit);font-weight:var(--su-table-header-font-weight, 600);letter-spacing:var(--su-table-header-letter-spacing, normal);padding:var(--su-table-header-padding, var(--su-table-cell-padding, .6rem .75rem));text-transform:var(--su-table-header-text-transform, none);white-space:nowrap}.is-sorted{--su-table-cell-tint: var(--su-table-sorted-background, transparent)}td.is-editable:hover,th.is-editable:hover{--su-table-cell-tint: var(--su-table-editable-hover-background, color-mix(in srgb, currentColor 6%, transparent))}.su-table-row-header{font-weight:var(--su-table-row-header-weight, 600)}tbody tr:last-child>*{border-bottom:none}tbody tr{--su-table-row-tint: var(--su-table-row-background, transparent);background:var(--su-table-row-tint);color:var(--su-table-row-color, inherit)}tbody tr:nth-child(2n){--su-table-row-tint: var(--su-table-stripe-background, var(--su-table-row-background, transparent))}tbody tr.is-muted{--su-table-row-tint: var(--su-table-muted-background, transparent);color:color-mix(in srgb,currentColor var(--su-table-muted-text, 55%),transparent)}tbody tr.is-highlighted{--su-table-row-tint: var(--su-table-highlight-background, color-mix(in srgb, #f59e0b 14%, transparent))}tbody tr:hover{--su-table-row-tint: var(--su-table-hover-background, rgb(0 0 0 / .025))}tbody tr.is-selected{--su-table-row-tint: var(--su-table-selected-background, color-mix(in srgb, #2563eb 8%, transparent));color:var(--su-table-selected-color, inherit)}tbody tr.is-editing{--su-table-row-tint: var(--su-table-editing-background, color-mix(in srgb, #2563eb 5%, transparent))}tbody tr.is-pinned-row{--su-table-row-tint: var(--su-table-pinned-row-background, color-mix(in srgb, #2563eb 6%, transparent))}tbody tr.is-last-pinned-row>*{border-bottom:var(--su-table-pinned-row-border, 2px solid color-mix(in srgb, #2563eb 40%, transparent))}tbody tr.is-grabbed,tbody tr.is-dragging{--su-table-row-tint: var(--su-table-grabbed-background, color-mix(in srgb, #2563eb 14%, transparent));outline:var(--su-table-grabbed-outline, 2px solid color-mix(in srgb, #2563eb 60%, transparent));outline-offset:-2px}tbody tr.is-dragging{background:linear-gradient(var(--su-table-row-tint),var(--su-table-row-tint)),var(--su-table-dragging-background, Canvas);box-shadow:var(--su-table-dragging-shadow, 0 8px 24px rgba(0, 0, 0, .18));cursor:grabbing;position:relative;z-index:3}tbody tr.is-drop-before>*{box-shadow:inset 0 var(--su-table-drop-line-width, 2px) 0 var(--su-table-drop-line-color, #2563eb)}tbody tr.is-drop-after>*{box-shadow:inset 0 calc(-1 * var(--su-table-drop-line-width, 2px)) 0 var(--su-table-drop-line-color, #2563eb)}thead th,tbody tr.is-pinned-row>*,.is-pinned-start,.is-pinned-end{background:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent)),linear-gradient(var(--su-table-row-tint, transparent),var(--su-table-row-tint, transparent)),var(--su-table-pinned-background, Canvas);position:sticky;z-index:1}thead th{top:0;z-index:4}thead th.is-pinned-start,thead th.is-pinned-end{z-index:5}tbody tr.is-pinned-row>*{top:var(--su-table-row-top, 0);z-index:2}tbody tr.is-pinned-row>*.is-pinned-start,tbody tr.is-pinned-row>*.is-pinned-end{z-index:3}.is-scrolled-top:not(.has-pinned-rows) thead th,.is-scrolled-top tr.is-last-pinned-row>*{box-shadow:var(--su-table-sticky-shadow, 0 6px 8px -6px rgba(0, 0, 0, .25))}.is-pinned-edge:after{content:\"\";inset-block:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:1rem}.is-pinned-start.is-pinned-edge{border-inline-end:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.is-pinned-end.is-pinned-edge{border-inline-start:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.su-table-pinned-icon{margin-inline-start:.35rem;opacity:.45;vertical-align:-1px}.su-table-header-pin{background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;margin-inline-start:.2rem;opacity:.3;padding:.2rem;vertical-align:middle}.su-table-header-pin:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-header-pin:hover{opacity:.7}.su-table-header-pin[aria-pressed=true]{color:var(--su-table-accent, #2563eb);opacity:1}.is-pinned-start.is-pinned-edge:after{background:linear-gradient(to right,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-start:100%}.is-pinned-end.is-pinned-edge:after{background:linear-gradient(to left,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-end:100%}.is-scrolled-start .is-pinned-start.is-pinned-edge:after,.has-more-end .is-pinned-end.is-pinned-edge:after{opacity:1}@media(prefers-reduced-motion:no-preference){.is-dragging-rows tbody tr:not(.is-dragging){transition:transform .15s ease-out}}td.is-editable,th.is-editable{cursor:text}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-handle-cell,.su-table-select-cell{text-align:center;width:1%}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.su-table-sort{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:inline-flex;font:inherit;letter-spacing:inherit;text-transform:inherit;gap:.35rem;margin:-.2rem -.35rem;padding:.2rem .35rem}.su-table-sort-icon{border-left:.3rem solid transparent;border-right:.3rem solid transparent;height:0;opacity:.35;width:0}.su-table-sort-icon.is-none,.su-table-sort-icon.is-ascending{border-bottom:.4rem solid currentColor}.su-table-sort-icon.is-descending{border-top:.4rem solid currentColor}.su-table-sort-icon.is-ascending,.su-table-sort-icon.is-descending{opacity:1}.su-table-handle{background:none;border:none;border-radius:4px;color:var(--su-table-handle-color, inherit);cursor:grab;display:inline-flex;padding:.35rem .3rem;touch-action:none}.su-table-handle:active{cursor:grabbing}.su-table-grip{background-image:radial-gradient(currentColor 1.2px,transparent 1.4px);background-size:6px 6px;display:block;height:18px;opacity:.6;width:12px}.su-table-button{background:var(--su-table-button-background, transparent);border:var(--su-table-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-table-button-radius, 6px);color:var(--su-table-button-color, inherit);cursor:pointer;font:inherit;font-size:.875em;padding:var(--su-table-button-padding, .3rem .7rem);white-space:nowrap}.su-table-button:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-button:disabled{cursor:not-allowed;opacity:.45}.su-table-button.is-primary{background:var(--su-table-primary-background, #111);border-color:transparent;color:var(--su-table-primary-color, #fff)}.su-table-button.is-danger{border-color:var(--su-table-danger-border, color-mix(in srgb, #b42318 35%, transparent));color:var(--su-table-danger-color, #b42318)}.su-table-button.is-quiet{border-color:transparent}.su-table-button.su-table-pin-button{align-items:center;display:inline-flex;gap:.3rem}.su-table-button.su-table-pin-button svg{opacity:.5}.su-table-button.su-table-pin-button[aria-pressed=true]{border-color:var(--su-table-accent, #2563eb);color:var(--su-table-accent, #2563eb)}.su-table-button.su-table-pin-button[aria-pressed=true] svg{opacity:1}.su-table-sort:focus-visible,.su-table-handle:focus-visible,.su-table-checkbox:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-checkbox{accent-color:var(--su-table-accent, #2563eb);height:var(--su-table-checkbox-size, 1rem);margin:0;width:var(--su-table-checkbox-size, 1rem)}.su-table-toolbar,.su-table-bulk{background:var(--su-table-panel-background, rgba(0, 0, 0, .03));border-radius:var(--su-table-radius, 10px);margin-bottom:.75rem;padding:.6rem .75rem}.su-table-toolbar{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.su-table-toolbar-count{font-weight:600;margin-right:auto}.su-table-bulk-title{font-size:1rem;margin:0 0 .75rem}.su-table-bulk-fields{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.su-table-bulk-field{display:flex;flex-direction:column;gap:.3rem}.su-table-label{font-size:.85em;font-weight:600}.su-table-bulk-actions{display:flex;gap:.5rem;margin-top:.75rem}.su-table-empty{opacity:.7;padding:1.5rem;text-align:center}.su-table-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:no-preference){tbody tr{transition:background-color .12s ease-out}}tbody tr.su-tree-table-row:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:-2px}.su-tree-table-tree-cell{padding-inline-start:calc(var(--su-tree-table-cell-start, .4rem) + var(--su-tree-table-level, 0) * var(--su-tree-table-indent, 1.25rem));white-space:nowrap}.su-tree-table-number{color:var(--su-tree-table-number-color, color-mix(in srgb, currentColor 65%, transparent));font-variant-numeric:tabular-nums;white-space:nowrap;width:1%}tbody tr.is-group{--su-table-row-tint: var(--su-tree-table-group-background, rgb(0 0 0 / .04));color:var(--su-tree-table-group-color, inherit);font-weight:var(--su-tree-table-group-font-weight, 600)}.su-tree-table-group-label{align-items:center;display:inline-flex;inset-inline-start:0;position:sticky}td.is-merged{--su-table-cell-tint: var(--su-tree-table-merged-background, transparent);vertical-align:var(--su-tree-table-merged-vertical-align, middle)}td[rowspan]{border-inline:var(--su-tree-table-merged-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SuTablePaginatorComponent, selector: "su-lib-table-paginator", inputs: ["pagination", "labels", "controlId"], outputs: ["pageChange", "pageSizeChange"] }, { kind: "directive", type: SuTablePinDirective, selector: "[suTablePin]", inputs: ["suTablePin"] }, { kind: "component", type: SuTableToolbarComponent, selector: "su-lib-table-toolbar", inputs: ["labels", "controlId", "searchable", "query", "columnControls", "columns"], outputs: ["queryChange", "pinnableChange", "visibilityChange", "allVisibilityChange"] }, { kind: "component", type: SuTreeTablePinIconComponent, selector: "svg[suTreeTablePinIcon]" }, { kind: "component", type: SuTreeTableToggleComponent, selector: "su-lib-tree-table-toggle", inputs: ["expanded", "label"], outputs: ["toggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
368
+ }
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuTreeTableComponent, decorators: [{
370
+ type: Component,
371
+ args: [{ selector: 'su-lib-tree-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
372
+ NgTemplateOutlet,
373
+ SuTablePaginatorComponent,
374
+ SuTablePinDirective,
375
+ SuTableToolbarComponent,
376
+ SuTreeTablePinIconComponent,
377
+ SuTreeTableToggleComponent,
378
+ ], host: { class: 'su-tree-table' }, template: "@let current = state();\n@let t = text();\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\n@let pinnedCount = current.pinnedRows.length;\n@if (searchable() || columnControls()) {\n <su-lib-table-toolbar\n [labels]=\"t\"\n [controlId]=\"tableId\"\n [searchable]=\"searchable()\"\n [query]=\"current.query\"\n [columnControls]=\"columnControls()\"\n [columns]=\"current.allColumns\"\n (queryChange)=\"search($event)\"\n (pinnableChange)=\"setColumnPinnable($event)\"\n (visibilityChange)=\"setColumnVisible($event)\"\n (allVisibilityChange)=\"setColumnsVisible($event)\"\n />\n}\n\n<div\n class=\"su-table-scroll\"\n [class.is-scrolled-start]=\"scrolledFromStart()\"\n [class.has-more-end]=\"moreAtEnd()\"\n [class.is-scrolled-top]=\"scrolledFromTop()\"\n [class.has-pinned-rows]=\"current.pinnedRows.length > 0\"\n [style.max-height]=\"maxHeight()\"\n (scroll)=\"onScroll($event)\"\n>\n <table class=\"su-table-grid\" role=\"treegrid\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (numbered()) {\n <th scope=\"col\" class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ t.number }}</th>\n }\n @for (column of current.columns; track column.key; let columnIndex = $index) {\n <th\n scope=\"col\"\n class=\"su-table-align-{{ column.align }}\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + columnIndex]\"\n [attr.aria-sort]=\"column.sort === 'none' ? null : column.sort\"\n >\n @if (column.sortable) {\n <button type=\"button\" class=\"su-table-sort\" (click)=\"sortBy(column.key)\">\n {{ column.header }}\n <span class=\"su-table-sort-icon is-{{ column.sort }}\" aria-hidden=\"true\"></span>\n </button>\n } @else {\n {{ column.header }}\n }\n @if (column.pinnable) {\n <button\n type=\"button\"\n class=\"su-table-header-pin\"\n [attr.aria-label]=\"t.pinColumn(column.header)\"\n [attr.aria-pressed]=\"column.pinned !== null\"\n (click)=\"toggleColumnPin(column.key, column.pinned)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTreeTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (rowPinning()) {\n <th scope=\"col\" class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">{{ t.actions }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of bodyRows(); track row.id; let rowIndex = $index) {\n <tr\n [attr.data-su-tree-row]=\"row.id\"\n [attr.tabindex]=\"row.id === tabRowId() ? 0 : -1\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-posinset]=\"row.position\"\n [attr.aria-setsize]=\"row.siblings\"\n [attr.aria-expanded]=\"row.expanded\"\n [class]=\"rowClassOf(row)\"\n [class.su-tree-table-row]=\"true\"\n [class.is-group]=\"row.kind === 'group'\"\n [class.is-pinned-row]=\"rowIndex < pinnedCount\"\n [class.is-last-pinned-row]=\"rowIndex === pinnedCount - 1\"\n [style.--su-table-row-top]=\"rowIndex < pinnedCount ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [style.--su-tree-table-level]=\"row.level - 1\"\n (keydown)=\"onRowKey($event, row)\"\n (focus)=\"onRowFocus(row.id)\"\n >\n @if (numbered()) {\n <td class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ row.number }}</td>\n }\n @if (row.kind === 'group') {\n <td\n role=\"rowheader\"\n class=\"su-tree-table-group-cell su-tree-table-tree-cell\"\n [attr.colspan]=\"current.columns.length\"\n >\n <span class=\"su-tree-table-group-label\">\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n {{ row.label }}\n </span>\n </td>\n } @else {\n @for (cell of row.cells; track cell.key) {\n @let column = current.columns[cell.columnIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : 'gridcell'\"\n [attr.rowspan]=\"cell.rowSpan > 1 ? cell.rowSpan : null\"\n [attr.colspan]=\"cell.colSpan > 1 ? cell.colSpan : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.su-tree-table-tree-cell]=\"cell.columnIndex === 0\"\n [class.is-merged]=\"cell.rowSpan > 1 || cell.colSpan > 1\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + cell.columnIndex]\"\n >\n @if (cell.columnIndex === 0) {\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n }\n @if (cellTemplate(cell.key); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row.data, text: cell.text }\" />\n } @else {\n {{ cell.text }}\n }\n </td>\n }\n }\n @if (rowPinning()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n @if (row.level === 1) {\n <div class=\"su-table-actions\">\n <button\n type=\"button\"\n class=\"su-table-button su-table-pin-button\"\n [attr.aria-pressed]=\"row.pinned\"\n [attr.aria-label]=\"t.pinRow + ', ' + row.label\"\n (click)=\"pinRow(row.id)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n </div>\n }\n </td>\n }\n </tr>\n }\n @if (current.rows.length === 0) {\n <tr>\n <td class=\"su-table-empty\" [attr.colspan]=\"columnCount()\">\n {{ current.searching ? t.noMatches(current.query) : t.empty }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div>\n\n@if (current.pagination.pageSizes.length > 0 || current.pagination.pageSize !== 'all') {\n <su-lib-table-paginator\n [pagination]=\"current.pagination\"\n [labels]=\"t\"\n [controlId]=\"tableId + '-page-size'\"\n (pageChange)=\"setPage($event)\"\n (pageSizeChange)=\"setPageSize($event)\"\n />\n}\n\n<div class=\"su-table-visually-hidden\" role=\"status\">{{ current.announcement }}</div>\n\n", styles: [":host{color:var(--su-table-text-color, inherit);display:block;min-width:0;font-family:var(--su-table-font-family, inherit);font-size:var(--su-table-font-size, .95rem)}.su-table-scroll{border:var(--su-table-border, 1px solid rgba(0, 0, 0, .12));border-radius:var(--su-table-radius, 10px);overflow:auto}.su-table-grid{background:var(--su-table-background, transparent);border-collapse:separate;border-spacing:0;min-width:100%}caption{caption-side:top;color:var(--su-table-caption-color, inherit);font-size:var(--su-table-caption-font-size, inherit);font-weight:600;padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start}th,td{background-image:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent));border-bottom:var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08));padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start;vertical-align:var(--su-table-cell-vertical-align, middle)}thead th{--su-table-row-tint: var(--su-table-header-background, rgb(0 0 0 / .03));border-bottom:var(--su-table-header-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)));color:var(--su-table-header-color, inherit);font-size:var(--su-table-header-font-size, inherit);font-weight:var(--su-table-header-font-weight, 600);letter-spacing:var(--su-table-header-letter-spacing, normal);padding:var(--su-table-header-padding, var(--su-table-cell-padding, .6rem .75rem));text-transform:var(--su-table-header-text-transform, none);white-space:nowrap}.is-sorted{--su-table-cell-tint: var(--su-table-sorted-background, transparent)}td.is-editable:hover,th.is-editable:hover{--su-table-cell-tint: var(--su-table-editable-hover-background, color-mix(in srgb, currentColor 6%, transparent))}.su-table-row-header{font-weight:var(--su-table-row-header-weight, 600)}tbody tr:last-child>*{border-bottom:none}tbody tr{--su-table-row-tint: var(--su-table-row-background, transparent);background:var(--su-table-row-tint);color:var(--su-table-row-color, inherit)}tbody tr:nth-child(2n){--su-table-row-tint: var(--su-table-stripe-background, var(--su-table-row-background, transparent))}tbody tr.is-muted{--su-table-row-tint: var(--su-table-muted-background, transparent);color:color-mix(in srgb,currentColor var(--su-table-muted-text, 55%),transparent)}tbody tr.is-highlighted{--su-table-row-tint: var(--su-table-highlight-background, color-mix(in srgb, #f59e0b 14%, transparent))}tbody tr:hover{--su-table-row-tint: var(--su-table-hover-background, rgb(0 0 0 / .025))}tbody tr.is-selected{--su-table-row-tint: var(--su-table-selected-background, color-mix(in srgb, #2563eb 8%, transparent));color:var(--su-table-selected-color, inherit)}tbody tr.is-editing{--su-table-row-tint: var(--su-table-editing-background, color-mix(in srgb, #2563eb 5%, transparent))}tbody tr.is-pinned-row{--su-table-row-tint: var(--su-table-pinned-row-background, color-mix(in srgb, #2563eb 6%, transparent))}tbody tr.is-last-pinned-row>*{border-bottom:var(--su-table-pinned-row-border, 2px solid color-mix(in srgb, #2563eb 40%, transparent))}tbody tr.is-grabbed,tbody tr.is-dragging{--su-table-row-tint: var(--su-table-grabbed-background, color-mix(in srgb, #2563eb 14%, transparent));outline:var(--su-table-grabbed-outline, 2px solid color-mix(in srgb, #2563eb 60%, transparent));outline-offset:-2px}tbody tr.is-dragging{background:linear-gradient(var(--su-table-row-tint),var(--su-table-row-tint)),var(--su-table-dragging-background, Canvas);box-shadow:var(--su-table-dragging-shadow, 0 8px 24px rgba(0, 0, 0, .18));cursor:grabbing;position:relative;z-index:3}tbody tr.is-drop-before>*{box-shadow:inset 0 var(--su-table-drop-line-width, 2px) 0 var(--su-table-drop-line-color, #2563eb)}tbody tr.is-drop-after>*{box-shadow:inset 0 calc(-1 * var(--su-table-drop-line-width, 2px)) 0 var(--su-table-drop-line-color, #2563eb)}thead th,tbody tr.is-pinned-row>*,.is-pinned-start,.is-pinned-end{background:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent)),linear-gradient(var(--su-table-row-tint, transparent),var(--su-table-row-tint, transparent)),var(--su-table-pinned-background, Canvas);position:sticky;z-index:1}thead th{top:0;z-index:4}thead th.is-pinned-start,thead th.is-pinned-end{z-index:5}tbody tr.is-pinned-row>*{top:var(--su-table-row-top, 0);z-index:2}tbody tr.is-pinned-row>*.is-pinned-start,tbody tr.is-pinned-row>*.is-pinned-end{z-index:3}.is-scrolled-top:not(.has-pinned-rows) thead th,.is-scrolled-top tr.is-last-pinned-row>*{box-shadow:var(--su-table-sticky-shadow, 0 6px 8px -6px rgba(0, 0, 0, .25))}.is-pinned-edge:after{content:\"\";inset-block:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:1rem}.is-pinned-start.is-pinned-edge{border-inline-end:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.is-pinned-end.is-pinned-edge{border-inline-start:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.su-table-pinned-icon{margin-inline-start:.35rem;opacity:.45;vertical-align:-1px}.su-table-header-pin{background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;margin-inline-start:.2rem;opacity:.3;padding:.2rem;vertical-align:middle}.su-table-header-pin:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-header-pin:hover{opacity:.7}.su-table-header-pin[aria-pressed=true]{color:var(--su-table-accent, #2563eb);opacity:1}.is-pinned-start.is-pinned-edge:after{background:linear-gradient(to right,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-start:100%}.is-pinned-end.is-pinned-edge:after{background:linear-gradient(to left,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-end:100%}.is-scrolled-start .is-pinned-start.is-pinned-edge:after,.has-more-end .is-pinned-end.is-pinned-edge:after{opacity:1}@media(prefers-reduced-motion:no-preference){.is-dragging-rows tbody tr:not(.is-dragging){transition:transform .15s ease-out}}td.is-editable,th.is-editable{cursor:text}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-handle-cell,.su-table-select-cell{text-align:center;width:1%}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.su-table-sort{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:inline-flex;font:inherit;letter-spacing:inherit;text-transform:inherit;gap:.35rem;margin:-.2rem -.35rem;padding:.2rem .35rem}.su-table-sort-icon{border-left:.3rem solid transparent;border-right:.3rem solid transparent;height:0;opacity:.35;width:0}.su-table-sort-icon.is-none,.su-table-sort-icon.is-ascending{border-bottom:.4rem solid currentColor}.su-table-sort-icon.is-descending{border-top:.4rem solid currentColor}.su-table-sort-icon.is-ascending,.su-table-sort-icon.is-descending{opacity:1}.su-table-handle{background:none;border:none;border-radius:4px;color:var(--su-table-handle-color, inherit);cursor:grab;display:inline-flex;padding:.35rem .3rem;touch-action:none}.su-table-handle:active{cursor:grabbing}.su-table-grip{background-image:radial-gradient(currentColor 1.2px,transparent 1.4px);background-size:6px 6px;display:block;height:18px;opacity:.6;width:12px}.su-table-button{background:var(--su-table-button-background, transparent);border:var(--su-table-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-table-button-radius, 6px);color:var(--su-table-button-color, inherit);cursor:pointer;font:inherit;font-size:.875em;padding:var(--su-table-button-padding, .3rem .7rem);white-space:nowrap}.su-table-button:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-button:disabled{cursor:not-allowed;opacity:.45}.su-table-button.is-primary{background:var(--su-table-primary-background, #111);border-color:transparent;color:var(--su-table-primary-color, #fff)}.su-table-button.is-danger{border-color:var(--su-table-danger-border, color-mix(in srgb, #b42318 35%, transparent));color:var(--su-table-danger-color, #b42318)}.su-table-button.is-quiet{border-color:transparent}.su-table-button.su-table-pin-button{align-items:center;display:inline-flex;gap:.3rem}.su-table-button.su-table-pin-button svg{opacity:.5}.su-table-button.su-table-pin-button[aria-pressed=true]{border-color:var(--su-table-accent, #2563eb);color:var(--su-table-accent, #2563eb)}.su-table-button.su-table-pin-button[aria-pressed=true] svg{opacity:1}.su-table-sort:focus-visible,.su-table-handle:focus-visible,.su-table-checkbox:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-checkbox{accent-color:var(--su-table-accent, #2563eb);height:var(--su-table-checkbox-size, 1rem);margin:0;width:var(--su-table-checkbox-size, 1rem)}.su-table-toolbar,.su-table-bulk{background:var(--su-table-panel-background, rgba(0, 0, 0, .03));border-radius:var(--su-table-radius, 10px);margin-bottom:.75rem;padding:.6rem .75rem}.su-table-toolbar{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.su-table-toolbar-count{font-weight:600;margin-right:auto}.su-table-bulk-title{font-size:1rem;margin:0 0 .75rem}.su-table-bulk-fields{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.su-table-bulk-field{display:flex;flex-direction:column;gap:.3rem}.su-table-label{font-size:.85em;font-weight:600}.su-table-bulk-actions{display:flex;gap:.5rem;margin-top:.75rem}.su-table-empty{opacity:.7;padding:1.5rem;text-align:center}.su-table-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:no-preference){tbody tr{transition:background-color .12s ease-out}}tbody tr.su-tree-table-row:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:-2px}.su-tree-table-tree-cell{padding-inline-start:calc(var(--su-tree-table-cell-start, .4rem) + var(--su-tree-table-level, 0) * var(--su-tree-table-indent, 1.25rem));white-space:nowrap}.su-tree-table-number{color:var(--su-tree-table-number-color, color-mix(in srgb, currentColor 65%, transparent));font-variant-numeric:tabular-nums;white-space:nowrap;width:1%}tbody tr.is-group{--su-table-row-tint: var(--su-tree-table-group-background, rgb(0 0 0 / .04));color:var(--su-tree-table-group-color, inherit);font-weight:var(--su-tree-table-group-font-weight, 600)}.su-tree-table-group-label{align-items:center;display:inline-flex;inset-inline-start:0;position:sticky}td.is-merged{--su-table-cell-tint: var(--su-tree-table-merged-background, transparent);vertical-align:var(--su-tree-table-merged-vertical-align, middle)}td[rowspan]{border-inline:var(--su-tree-table-merged-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)))}\n"] }]
379
+ }], ctorParameters: () => [] });
380
+
381
+ /**
382
+ * Generated bundle index. Do not edit.
383
+ */
384
+
385
+ export { SuTreeTableComponent };
386
+ //# sourceMappingURL=su-labs-tree-table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"su-labs-tree-table.mjs","sources":["../../../../compat/angular-19/build/tree-table/src/lib/tree-table-pin-icon/tree-table-pin-icon.component.ts","../../../../compat/angular-19/build/tree-table/src/lib/tree-table-toggle/tree-table-toggle.component.ts","../../../../compat/angular-19/build/tree-table/src/lib/tree-table-toggle/tree-table-toggle.component.html","../../../../compat/angular-19/build/tree-table/src/lib/tree-table/tree-table.component.ts","../../../../compat/angular-19/build/tree-table/src/lib/tree-table/tree-table.component.html","../../../../compat/angular-19/build/tree-table/src/su-labs-tree-table.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n/** The pin drawn on pinned columns and pin buttons, as in `@su-labs/table`: `<svg suTreeTablePinIcon></svg>` */\n@Component({\n selector: 'svg[suTreeTablePinIcon]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { viewBox: '0 0 16 16', 'aria-hidden': 'true', fill: 'currentColor' },\n template: `<svg:path\n d=\"M10 1.5 14.5 6l-1.6 1.6-1-.3-2.4 2.4.2 2.8-1.3 1.3L6 11 2.5 14.5 1.5 13.5 5 10 2.2 7.6l1.3-1.3 2.8.2 2.4-2.4-.3-1z\" />`,\n})\nexport class SuTreeTablePinIconComponent {}\n","import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\n\n/** A row's open and close button, or the room for one on a row without children, so every row's text lines up */\n@Component({\n selector: 'su-lib-tree-table-toggle',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './tree-table-toggle.component.html',\n styleUrl: './tree-table-toggle.component.scss',\n})\nexport class SuTreeTableToggleComponent {\n /** Whether the row's children show; null for a row without children */\n readonly expanded = input.required<boolean | null>();\n /** The button's name, e.g. “Expand Fruit” */\n readonly label = input.required<string>();\n readonly toggle = output();\n}\n","@if (expanded() !== null) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"su-tree-table-toggle\"\n [class.is-expanded]=\"expanded()\"\n [attr.aria-label]=\"label()\"\n (click)=\"toggle.emit()\"\n >\n <span class=\"su-tree-table-chevron\" aria-hidden=\"true\"></span>\n </button>\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { afterRenderEffect, booleanAttribute, ChangeDetectionStrategy, Component, computed, contentChildren, DestroyRef, effect, ElementRef, inject, input, output, signal, TemplateRef, untracked } from '@angular/core';\nimport { SuTableColumnState, SuTablePageSize, SuTablePin, SuTableRowId, SuTableSort, suPinOffsets } from '@su-labs/core/table';\nimport { SU_TREE_TABLE_LABELS, SuTreeTableColumns, SuTreeTableController, SuTreeTableLabels, SuTreeTableNumbering, SuTreeTableRowKind, SuTreeTableRowView } from '@su-labs/core/tree-table';\nimport { SuTableCellContext, SuTableCellDirective, SuTablePaginatorComponent, SuTablePinDirective, SuTablePinnableChange, SuTablePinPlacement, SuTableToolbarComponent, SuTableVisibilityChange } from '@su-labs/table';\nimport { SuTreeTablePinIconComponent } from '../tree-table-pin-icon/tree-table-pin-icon.component';\nimport { SuTreeTableToggleComponent } from '../tree-table-toggle/tree-table-toggle.component';\n\n/** A row was opened or closed */\nexport interface SuTreeTableToggleEvent<TRow extends object> {\n readonly row: TRow;\n readonly expanded: boolean;\n /** Every open row with children, at any level */\n readonly expandedIds: readonly SuTableRowId[];\n}\n\n/** The page on screen and how many top-level rows it shows */\nexport interface SuTreeTablePageEvent {\n /** From 0 */\n readonly page: number;\n readonly pageSize: SuTablePageSize;\n}\n\nlet nextTreeTableId = 0;\n\n/** The room, in pixels, the pinned columns leave for the scrolling ones before they stop sticking */\nconst MIN_SCROLLING_WIDTH = 96;\n\n/** How long typing pauses, in milliseconds, before the search runs */\nconst SEARCH_DELAY = 200;\n\n/**\n * An accessible tree table (`role=\"treegrid\"`) over `SuTreeTableController` from `@su-labs/core/tree-table`: rows\n * with child rows that open and close, data or group parents, numbering, merged cells, and the table's sorting,\n * search, paging, pinned rows and columns, Columns menu and `--su-table-*` theming.\n */\n@Component({\n selector: 'su-lib-tree-table',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgTemplateOutlet,\n SuTablePaginatorComponent,\n SuTablePinDirective,\n SuTableToolbarComponent,\n SuTreeTablePinIconComponent,\n SuTreeTableToggleComponent,\n ],\n templateUrl: './tree-table.component.html',\n styleUrl: './tree-table.component.scss',\n host: { class: 'su-tree-table' },\n})\nexport class SuTreeTableComponent<TRow extends object> {\n readonly columns = input.required<SuTreeTableColumns<TRow>>();\n /** The top-level rows, each with its children */\n readonly rows = input.required<readonly TRow[]>();\n /** The table's name for screen readers, shown as its caption */\n readonly caption = input.required<string>();\n /** Shows the caption on screen too @default false */\n readonly showCaption = input(false, { transform: booleanAttribute });\n /** The row's identity, e.g. the API's id; keeps open rows and pins across new rows */\n readonly rowId = input<(row: TRow) => SuTableRowId>();\n /** A row's child rows, e.g. `(item) => item.children`; a row without any is a leaf */\n readonly children =\n input<(row: TRow) => readonly TRow[] | null | undefined>();\n /** Which rows are group rows, a heading across the table over their children; every row is a data row by default */\n readonly rowKind = input<(row: TRow) => SuTreeTableRowKind>();\n /** A group row's text; by default the first column's text */\n readonly groupLabel = input<(row: TRow) => string>();\n /** The rows open to start with, or `true` for every one @default false */\n readonly expanded = input<readonly SuTableRowId[] | boolean>();\n /** A first column with each row's number @default false */\n readonly numbered = input(false, { transform: booleanAttribute });\n /** How children are numbered, for every parent or per parent: `nested` (1.1), `restart` or `continue` @default 'nested' */\n readonly numbering = input<\n SuTreeTableNumbering | ((row: TRow) => SuTreeTableNumbering)\n >();\n /** Rows left without a number, that don't count, e.g. `(row) => row.isGroup` */\n readonly unnumbered = input<(row: TRow) => boolean>();\n /** A Columns button with a menu to show or hide columns and the pin in their headings @default false */\n readonly columnControls = input(false, { transform: booleanAttribute });\n /** A search box above the table; a match keeps its parents on view @default false */\n readonly searchable = input(false, { transform: booleanAttribute });\n /** The most the table grows before it scrolls inside, any CSS length; the header and pinned rows stay in view */\n readonly maxHeight = input<string>();\n /** Extra classes for a row; the table styles `is-muted` and `is-highlighted` */\n readonly rowClass = input<(row: TRow) => string | null>();\n /** Top-level rows per page, each with its children; without it, every row shows @default 'all' */\n readonly pageSize = input<SuTablePageSize>();\n /** The page sizes people choose from under the table, e.g. `[10, 25, 'all']` */\n readonly pageSizes = input<readonly SuTablePageSize[]>([]);\n /** A Pin button on each top-level row, keeping it and its children above the others on every page @default false */\n readonly rowPinning = input(false, { transform: booleanAttribute });\n /** The ids of the top-level rows pinned to start with */\n readonly pinnedRows = input<readonly SuTableRowId[]>();\n /** Texts to replace, e.g. in the page's language */\n readonly labels = input<Partial<SuTreeTableLabels>>({});\n\n readonly toggled = output<SuTreeTableToggleEvent<TRow>>();\n readonly sortChange = output<SuTableSort<TRow> | null>();\n /** The search changed, after typing paused */\n readonly searchChange = output<string>();\n /** The pinned rows changed: their ids, in pin order */\n readonly pinnedRowsChange = output<readonly SuTableRowId[]>();\n /** A column was shown, hidden, pinned or unpinned: every column's state, e.g. to save it */\n readonly columnsChange = output<readonly SuTableColumnState<TRow>[]>();\n readonly pageChange = output<SuTreeTablePageEvent>();\n\n private readonly controller = new SuTreeTableController<TRow>();\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly cellTemplates = contentChildren(SuTableCellDirective);\n /** The row to move the focus to once it renders, after a key press */\n private readonly focusTarget = signal<SuTableRowId | null>(null);\n private searchTimer: ReturnType<typeof setTimeout> | undefined;\n private readonly headerWidths = signal<readonly number[]>([]);\n private readonly scrollerWidth = signal(0);\n private readonly headerHeight = signal(0);\n private readonly pinnedRowHeights = signal<readonly number[]>([]);\n private readonly headerLayout = computed(\n () =>\n `${this.state()\n .columns.map(column => `${String(column.key)}:${column.pinned}`)\n .join()}|${this.numbered()}|${this.rowPinning()}|${this.state()\n .pinnedRows.map(row => row.id)\n .join()}`\n );\n\n protected readonly tableId = `su-tree-table-${nextTreeTableId++}`;\n protected readonly state = signal(this.controller.state.get());\n protected readonly text = computed<SuTreeTableLabels>(() => ({\n ...SU_TREE_TABLE_LABELS,\n ...this.labels(),\n }));\n /** The pinned rows, then the current page */\n protected readonly bodyRows = computed(() => {\n const { pinnedRows, rows } = this.state();\n return [...pinnedRows, ...rows];\n });\n /** The one row in the tab order: the last one focused while it's on screen, else the first */\n protected readonly activeRowId = signal<SuTableRowId | null>(null);\n protected readonly tabRowId = computed(() => {\n const rows = this.bodyRows();\n const active = this.activeRowId();\n return rows.some(row => row.id === active) ? active : (rows[0]?.id ?? null);\n });\n protected readonly scrolledFromStart = signal(false);\n protected readonly moreAtEnd = signal(false);\n protected readonly scrolledFromTop = signal(false);\n /** Where each pinned row sticks: under the header and the pinned rows above it */\n protected readonly pinnedRowTops = computed(() => {\n let top = this.headerHeight();\n return this.pinnedRowHeights().map(height => {\n const rowTop = top;\n top += height;\n return rowTop;\n });\n });\n protected readonly columnSlot = computed(() => Number(this.numbered()));\n /**\n * Where each header slot sticks, in order: the numbers, the columns and the pin buttons. The numbers stay with\n * columns pinned to the start, the pin buttons with columns pinned to the end.\n */\n protected readonly placements = computed<\n readonly (SuTablePinPlacement | null)[]\n >(() => {\n const columns = this.state().columns;\n const numberPin: SuTablePin | null = columns.some(\n column => column.pinned === 'start'\n )\n ? 'start'\n : null;\n const actionsPin: SuTablePin | null = columns.some(\n column => column.pinned === 'end'\n )\n ? 'end'\n : null;\n return suPinOffsets(\n [\n ...(this.numbered() ? [numberPin] : []),\n ...columns.map(column => column.pinned),\n ...(this.rowPinning() ? [actionsPin] : []),\n ],\n this.headerWidths(),\n this.scrollerWidth(),\n MIN_SCROLLING_WIDTH\n );\n });\n protected readonly columnCount = computed(\n () =>\n this.state().columns.length +\n Number(this.numbered()) +\n Number(this.rowPinning())\n );\n\n constructor() {\n const unsubscribe = this.controller.state.subscribe(state =>\n this.state.set(state)\n );\n inject(DestroyRef).onDestroy(() => {\n unsubscribe();\n clearTimeout(this.searchTimer);\n });\n effect(() => {\n const options = {\n columns: this.columns(),\n rowId: this.rowId(),\n children: this.children(),\n rowKind: this.rowKind(),\n groupLabel: this.groupLabel(),\n numbering: this.numbering(),\n unnumbered: this.unnumbered(),\n labels: this.labels(),\n pageSizes: this.pageSizes(),\n };\n untracked(() => this.controller.configure(options));\n });\n effect(() => {\n const rows = this.rows();\n untracked(() => this.controller.setRows(rows));\n });\n effect(() => {\n const expanded = this.expanded();\n if (expanded !== undefined) {\n untracked(() => this.controller.configure({ expanded }));\n }\n });\n effect(() => {\n const pinnedRows = this.pinnedRows();\n if (pinnedRows !== undefined) {\n untracked(() => this.controller.configure({ pinnedRows }));\n }\n });\n effect(() => {\n const pageSize = this.pageSize();\n if (pageSize !== undefined) {\n untracked(() => this.controller.configure({ pageSize }));\n }\n });\n afterRenderEffect(onCleanup => {\n this.headerLayout();\n if (typeof ResizeObserver === 'undefined') {\n return;\n }\n const host = this.host.nativeElement;\n const scroller = host.querySelector<HTMLElement>('.su-table-scroll');\n const headers = [...host.querySelectorAll<HTMLElement>('thead th')];\n const head = host.querySelector<HTMLElement>('thead');\n const pinnedRows = [\n ...host.querySelectorAll<HTMLElement>('tbody > tr.is-pinned-row'),\n ];\n const observer = new ResizeObserver(() => {\n this.headerHeight.set(head?.getBoundingClientRect().height ?? 0);\n const heights = pinnedRows.map(\n row => row.getBoundingClientRect().height\n );\n const currentHeights = untracked(() => this.pinnedRowHeights());\n if (\n heights.length !== currentHeights.length ||\n heights.some((height, index) => height !== currentHeights[index])\n ) {\n this.pinnedRowHeights.set(heights);\n }\n const widths = headers.map(\n header => header.getBoundingClientRect().width\n );\n const current = untracked(() => this.headerWidths());\n if (\n widths.length !== current.length ||\n widths.some((width, index) => width !== current[index])\n ) {\n this.headerWidths.set(widths);\n }\n if (scroller) {\n this.scrollerWidth.set(scroller.clientWidth);\n this.updateScrollEdges(scroller);\n }\n });\n [...headers, ...pinnedRows].forEach(element => observer.observe(element));\n if (scroller) {\n observer.observe(scroller);\n }\n onCleanup(() => observer.disconnect());\n });\n afterRenderEffect(() => {\n const id = this.focusTarget();\n this.state();\n if (id === null) {\n return;\n }\n const row = this.rowElement(id);\n if (row) {\n row.focus();\n this.focusTarget.set(null);\n }\n });\n }\n\n protected cellTemplate(\n key: keyof TRow\n ): TemplateRef<SuTableCellContext<object>> | null {\n return (\n this.cellTemplates().find(cell => cell.key() === String(key))?.template ??\n null\n );\n }\n\n protected rowClassOf(row: SuTreeTableRowView<TRow>): string | null {\n return this.rowClass()?.(row.data) ?? null;\n }\n\n protected toggle(row: SuTreeTableRowView<TRow>): void {\n this.activeRowId.set(row.id);\n this.controller.toggle(row.id);\n this.emitToggle(row);\n }\n\n /** Keys on the focused row itself move between rows and open or close them; keys on its buttons stay theirs */\n protected onRowKey(\n event: KeyboardEvent,\n row: SuTreeTableRowView<TRow>\n ): void {\n if (event.target !== event.currentTarget) {\n return;\n }\n const before = row.expanded;\n const result = this.controller.rowKey(row.id, event.key);\n if (!result.handled) {\n return;\n }\n event.preventDefault();\n this.activeRowId.set(result.focusId);\n this.focusTarget.set(result.focusId);\n if (this.controller.isExpanded(row.id) !== before && before !== null) {\n this.emitToggle(row);\n }\n }\n\n protected onRowFocus(id: SuTableRowId): void {\n this.activeRowId.set(id);\n }\n\n /** The pin in a heading unpins its column, or pins it back to the side it was set up with (by default the start) */\n protected toggleColumnPin(key: keyof TRow, pinned: SuTablePin | null): void {\n const setUpPin = this.columns().find(column => column.key === key)?.pinned;\n this.controller.pinColumn(key, pinned ? null : (setUpPin ?? 'start'));\n this.columnsChange.emit(this.state().allColumns);\n }\n\n protected setColumnPinnable({\n key,\n pinnable,\n }: SuTablePinnableChange<TRow>): void {\n this.controller.setColumnPinnable(key, pinnable);\n this.columnsChange.emit(this.state().allColumns);\n }\n\n protected setColumnsVisible(visible: boolean): void {\n this.controller.setColumnsVisible(visible);\n this.columnsChange.emit(this.state().allColumns);\n }\n\n protected setColumnVisible({\n key,\n visible,\n }: SuTableVisibilityChange<TRow>): void {\n this.controller.setColumnVisible(key, visible);\n this.columnsChange.emit(this.state().allColumns);\n }\n\n /** Narrows the rows once typing pauses, so each keystroke isn't announced */\n protected search(query: string): void {\n clearTimeout(this.searchTimer);\n this.searchTimer = setTimeout(() => {\n this.controller.search(query);\n this.searchChange.emit(query);\n }, SEARCH_DELAY);\n }\n\n protected onScroll(event: Event): void {\n if (event.target instanceof HTMLElement) {\n this.updateScrollEdges(event.target);\n }\n }\n\n protected sortBy(key: keyof TRow): void {\n this.controller.sortBy(key);\n this.sortChange.emit(this.state().sort);\n }\n\n protected pinRow(id: SuTableRowId): void {\n this.controller.pinRow(id);\n this.pinnedRowsChange.emit(\n this.state()\n .pinnedRows.filter(row => row.level === 1)\n .map(row => row.id)\n );\n }\n\n protected setPage(page: number): void {\n this.controller.setPage(page);\n this.emitPage();\n }\n\n protected setPageSize(pageSize: SuTablePageSize): void {\n this.controller.setPageSize(pageSize);\n this.emitPage();\n }\n\n private rowElement(id: SuTableRowId): HTMLElement | null {\n return (\n [\n ...this.host.nativeElement.querySelectorAll<HTMLElement>(\n 'tbody > tr[data-su-tree-row]'\n ),\n ].find(row => row.dataset['suTreeRow'] === String(id)) ?? null\n );\n }\n\n private emitToggle(row: SuTreeTableRowView<TRow>): void {\n this.toggled.emit({\n row: row.data,\n expanded: this.controller.isExpanded(row.id),\n expandedIds: this.controller.expandedIds(),\n });\n }\n\n /** Shadows show on the pinned edges only while columns or rows are scrolled under them */\n private updateScrollEdges(scroller: HTMLElement): void {\n this.scrolledFromTop.set(scroller.scrollTop > 1);\n const position = Math.abs(scroller.scrollLeft);\n this.scrolledFromStart.set(position > 1);\n this.moreAtEnd.set(\n position < scroller.scrollWidth - scroller.clientWidth - 1\n );\n }\n\n private emitPage(): void {\n const { page, pageSize } = this.state().pagination;\n this.pageChange.emit({ page, pageSize });\n }\n}\n","@let current = state();\n@let t = text();\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\n@let pinnedCount = current.pinnedRows.length;\n@if (searchable() || columnControls()) {\n <su-lib-table-toolbar\n [labels]=\"t\"\n [controlId]=\"tableId\"\n [searchable]=\"searchable()\"\n [query]=\"current.query\"\n [columnControls]=\"columnControls()\"\n [columns]=\"current.allColumns\"\n (queryChange)=\"search($event)\"\n (pinnableChange)=\"setColumnPinnable($event)\"\n (visibilityChange)=\"setColumnVisible($event)\"\n (allVisibilityChange)=\"setColumnsVisible($event)\"\n />\n}\n\n<div\n class=\"su-table-scroll\"\n [class.is-scrolled-start]=\"scrolledFromStart()\"\n [class.has-more-end]=\"moreAtEnd()\"\n [class.is-scrolled-top]=\"scrolledFromTop()\"\n [class.has-pinned-rows]=\"current.pinnedRows.length > 0\"\n [style.max-height]=\"maxHeight()\"\n (scroll)=\"onScroll($event)\"\n>\n <table class=\"su-table-grid\" role=\"treegrid\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (numbered()) {\n <th scope=\"col\" class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ t.number }}</th>\n }\n @for (column of current.columns; track column.key; let columnIndex = $index) {\n <th\n scope=\"col\"\n class=\"su-table-align-{{ column.align }}\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + columnIndex]\"\n [attr.aria-sort]=\"column.sort === 'none' ? null : column.sort\"\n >\n @if (column.sortable) {\n <button type=\"button\" class=\"su-table-sort\" (click)=\"sortBy(column.key)\">\n {{ column.header }}\n <span class=\"su-table-sort-icon is-{{ column.sort }}\" aria-hidden=\"true\"></span>\n </button>\n } @else {\n {{ column.header }}\n }\n @if (column.pinnable) {\n <button\n type=\"button\"\n class=\"su-table-header-pin\"\n [attr.aria-label]=\"t.pinColumn(column.header)\"\n [attr.aria-pressed]=\"column.pinned !== null\"\n (click)=\"toggleColumnPin(column.key, column.pinned)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTreeTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (rowPinning()) {\n <th scope=\"col\" class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">{{ t.actions }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of bodyRows(); track row.id; let rowIndex = $index) {\n <tr\n [attr.data-su-tree-row]=\"row.id\"\n [attr.tabindex]=\"row.id === tabRowId() ? 0 : -1\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-posinset]=\"row.position\"\n [attr.aria-setsize]=\"row.siblings\"\n [attr.aria-expanded]=\"row.expanded\"\n [class]=\"rowClassOf(row)\"\n [class.su-tree-table-row]=\"true\"\n [class.is-group]=\"row.kind === 'group'\"\n [class.is-pinned-row]=\"rowIndex < pinnedCount\"\n [class.is-last-pinned-row]=\"rowIndex === pinnedCount - 1\"\n [style.--su-table-row-top]=\"rowIndex < pinnedCount ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [style.--su-tree-table-level]=\"row.level - 1\"\n (keydown)=\"onRowKey($event, row)\"\n (focus)=\"onRowFocus(row.id)\"\n >\n @if (numbered()) {\n <td class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ row.number }}</td>\n }\n @if (row.kind === 'group') {\n <td\n role=\"rowheader\"\n class=\"su-tree-table-group-cell su-tree-table-tree-cell\"\n [attr.colspan]=\"current.columns.length\"\n >\n <span class=\"su-tree-table-group-label\">\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n {{ row.label }}\n </span>\n </td>\n } @else {\n @for (cell of row.cells; track cell.key) {\n @let column = current.columns[cell.columnIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : 'gridcell'\"\n [attr.rowspan]=\"cell.rowSpan > 1 ? cell.rowSpan : null\"\n [attr.colspan]=\"cell.colSpan > 1 ? cell.colSpan : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.su-tree-table-tree-cell]=\"cell.columnIndex === 0\"\n [class.is-merged]=\"cell.rowSpan > 1 || cell.colSpan > 1\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + cell.columnIndex]\"\n >\n @if (cell.columnIndex === 0) {\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n }\n @if (cellTemplate(cell.key); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row.data, text: cell.text }\" />\n } @else {\n {{ cell.text }}\n }\n </td>\n }\n }\n @if (rowPinning()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n @if (row.level === 1) {\n <div class=\"su-table-actions\">\n <button\n type=\"button\"\n class=\"su-table-button su-table-pin-button\"\n [attr.aria-pressed]=\"row.pinned\"\n [attr.aria-label]=\"t.pinRow + ', ' + row.label\"\n (click)=\"pinRow(row.id)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n </div>\n }\n </td>\n }\n </tr>\n }\n @if (current.rows.length === 0) {\n <tr>\n <td class=\"su-table-empty\" [attr.colspan]=\"columnCount()\">\n {{ current.searching ? t.noMatches(current.query) : t.empty }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div>\n\n@if (current.pagination.pageSizes.length > 0 || current.pagination.pageSize !== 'all') {\n <su-lib-table-paginator\n [pagination]=\"current.pagination\"\n [labels]=\"t\"\n [controlId]=\"tableId + '-page-size'\"\n (pageChange)=\"setPage($event)\"\n (pageSizeChange)=\"setPageSize($event)\"\n />\n}\n\n<div class=\"su-table-visually-hidden\" role=\"status\">{{ current.announcement }}</div>\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAEA;MAQa,2BAA2B,CAAA;wGAA3B,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,aAAA,EAAA,MAAA,EAAA,MAAA,EAAA,cAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAH5B,CAAA;AACkH,6HAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAEjH,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAPvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yBAAyB;oBACnC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE;AAC3E,oBAAA,QAAQ,EAAE,CAAA;AACkH,6HAAA,CAAA;AAC7H,iBAAA;;;ACPD;MA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,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,uBAAuB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,WAAA,EAAA,YAAA,EAAA,OAAA,EAAA,gBAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,qBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACvB,2BAA2B,oEAC3B,0BAA0B,EAAA,QAAA,EAAA,0BAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAMjB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,eAAA,EACZ,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,gBAAgB;wBAChB,yBAAyB;wBACzB,mBAAmB;wBACnB,uBAAuB;wBACvB,2BAA2B;wBAC3B,0BAA0B;AAC3B,qBAAA,EAAA,IAAA,EAGK,EAAE,KAAK,EAAE,eAAe,EAAE,EAAA,QAAA,EAAA,62OAAA,EAAA,MAAA,EAAA,CAAA,2mVAAA,CAAA,EAAA;;;AEjDlC;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@su-labs/tree-table" />
5
+ export * from './public-api';
@@ -0,0 +1,132 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import { SuTableColumnState, SuTablePageSize, SuTablePin, SuTableRowId, SuTableSort } from '@su-labs/core/table';
3
+ import { SuTreeTableColumns, SuTreeTableLabels, SuTreeTableNumbering, SuTreeTableRowKind, SuTreeTableRowView } from '@su-labs/core/tree-table';
4
+ import { SuTableCellContext, SuTablePinnableChange, SuTablePinPlacement, SuTableVisibilityChange } from '@su-labs/table';
5
+ import * as i0 from "@angular/core";
6
+ /** A row was opened or closed */
7
+ export interface SuTreeTableToggleEvent<TRow extends object> {
8
+ readonly row: TRow;
9
+ readonly expanded: boolean;
10
+ /** Every open row with children, at any level */
11
+ readonly expandedIds: readonly SuTableRowId[];
12
+ }
13
+ /** The page on screen and how many top-level rows it shows */
14
+ export interface SuTreeTablePageEvent {
15
+ /** From 0 */
16
+ readonly page: number;
17
+ readonly pageSize: SuTablePageSize;
18
+ }
19
+ /**
20
+ * An accessible tree table (`role="treegrid"`) over `SuTreeTableController` from `@su-labs/core/tree-table`: rows
21
+ * with child rows that open and close, data or group parents, numbering, merged cells, and the table's sorting,
22
+ * search, paging, pinned rows and columns, Columns menu and `--su-table-*` theming.
23
+ */
24
+ export declare class SuTreeTableComponent<TRow extends object> {
25
+ readonly columns: import("@angular/core").InputSignal<SuTreeTableColumns<TRow>>;
26
+ /** The top-level rows, each with its children */
27
+ readonly rows: import("@angular/core").InputSignal<readonly TRow[]>;
28
+ /** The table's name for screen readers, shown as its caption */
29
+ readonly caption: import("@angular/core").InputSignal<string>;
30
+ /** Shows the caption on screen too @default false */
31
+ readonly showCaption: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
32
+ /** The row's identity, e.g. the API's id; keeps open rows and pins across new rows */
33
+ readonly rowId: import("@angular/core").InputSignal<((row: TRow) => SuTableRowId) | undefined>;
34
+ /** A row's child rows, e.g. `(item) => item.children`; a row without any is a leaf */
35
+ readonly children: import("@angular/core").InputSignal<((row: TRow) => readonly TRow[] | null | undefined) | undefined>;
36
+ /** Which rows are group rows, a heading across the table over their children; every row is a data row by default */
37
+ readonly rowKind: import("@angular/core").InputSignal<((row: TRow) => SuTreeTableRowKind) | undefined>;
38
+ /** A group row's text; by default the first column's text */
39
+ readonly groupLabel: import("@angular/core").InputSignal<((row: TRow) => string) | undefined>;
40
+ /** The rows open to start with, or `true` for every one @default false */
41
+ readonly expanded: import("@angular/core").InputSignal<boolean | readonly SuTableRowId[] | undefined>;
42
+ /** A first column with each row's number @default false */
43
+ readonly numbered: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
44
+ /** How children are numbered, for every parent or per parent: `nested` (1.1), `restart` or `continue` @default 'nested' */
45
+ readonly numbering: import("@angular/core").InputSignal<SuTreeTableNumbering | ((row: TRow) => SuTreeTableNumbering) | undefined>;
46
+ /** Rows left without a number, that don't count, e.g. `(row) => row.isGroup` */
47
+ readonly unnumbered: import("@angular/core").InputSignal<((row: TRow) => boolean) | undefined>;
48
+ /** A Columns button with a menu to show or hide columns and the pin in their headings @default false */
49
+ readonly columnControls: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
50
+ /** A search box above the table; a match keeps its parents on view @default false */
51
+ readonly searchable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
52
+ /** The most the table grows before it scrolls inside, any CSS length; the header and pinned rows stay in view */
53
+ readonly maxHeight: import("@angular/core").InputSignal<string | undefined>;
54
+ /** Extra classes for a row; the table styles `is-muted` and `is-highlighted` */
55
+ readonly rowClass: import("@angular/core").InputSignal<((row: TRow) => string | null) | undefined>;
56
+ /** Top-level rows per page, each with its children; without it, every row shows @default 'all' */
57
+ readonly pageSize: import("@angular/core").InputSignal<SuTablePageSize | undefined>;
58
+ /** The page sizes people choose from under the table, e.g. `[10, 25, 'all']` */
59
+ readonly pageSizes: import("@angular/core").InputSignal<readonly SuTablePageSize[]>;
60
+ /** A Pin button on each top-level row, keeping it and its children above the others on every page @default false */
61
+ readonly rowPinning: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
62
+ /** The ids of the top-level rows pinned to start with */
63
+ readonly pinnedRows: import("@angular/core").InputSignal<readonly SuTableRowId[] | undefined>;
64
+ /** Texts to replace, e.g. in the page's language */
65
+ readonly labels: import("@angular/core").InputSignal<Partial<SuTreeTableLabels>>;
66
+ readonly toggled: import("@angular/core").OutputEmitterRef<SuTreeTableToggleEvent<TRow>>;
67
+ readonly sortChange: import("@angular/core").OutputEmitterRef<SuTableSort<TRow> | null>;
68
+ /** The search changed, after typing paused */
69
+ readonly searchChange: import("@angular/core").OutputEmitterRef<string>;
70
+ /** The pinned rows changed: their ids, in pin order */
71
+ readonly pinnedRowsChange: import("@angular/core").OutputEmitterRef<readonly SuTableRowId[]>;
72
+ /** A column was shown, hidden, pinned or unpinned: every column's state, e.g. to save it */
73
+ readonly columnsChange: import("@angular/core").OutputEmitterRef<readonly SuTableColumnState<TRow>[]>;
74
+ readonly pageChange: import("@angular/core").OutputEmitterRef<SuTreeTablePageEvent>;
75
+ private readonly controller;
76
+ private readonly host;
77
+ private readonly cellTemplates;
78
+ /** The row to move the focus to once it renders, after a key press */
79
+ private readonly focusTarget;
80
+ private searchTimer;
81
+ private readonly headerWidths;
82
+ private readonly scrollerWidth;
83
+ private readonly headerHeight;
84
+ private readonly pinnedRowHeights;
85
+ private readonly headerLayout;
86
+ protected readonly tableId: string;
87
+ protected readonly state: import("@angular/core").WritableSignal<import("@su-labs/core/tree-table").SuTreeTableState<TRow>>;
88
+ protected readonly text: import("@angular/core").Signal<SuTreeTableLabels>;
89
+ /** The pinned rows, then the current page */
90
+ protected readonly bodyRows: import("@angular/core").Signal<SuTreeTableRowView<TRow>[]>;
91
+ /** The one row in the tab order: the last one focused while it's on screen, else the first */
92
+ protected readonly activeRowId: import("@angular/core").WritableSignal<SuTableRowId | null>;
93
+ protected readonly tabRowId: import("@angular/core").Signal<SuTableRowId | null>;
94
+ protected readonly scrolledFromStart: import("@angular/core").WritableSignal<boolean>;
95
+ protected readonly moreAtEnd: import("@angular/core").WritableSignal<boolean>;
96
+ protected readonly scrolledFromTop: import("@angular/core").WritableSignal<boolean>;
97
+ /** Where each pinned row sticks: under the header and the pinned rows above it */
98
+ protected readonly pinnedRowTops: import("@angular/core").Signal<number[]>;
99
+ protected readonly columnSlot: import("@angular/core").Signal<number>;
100
+ /**
101
+ * Where each header slot sticks, in order: the numbers, the columns and the pin buttons. The numbers stay with
102
+ * columns pinned to the start, the pin buttons with columns pinned to the end.
103
+ */
104
+ protected readonly placements: import("@angular/core").Signal<readonly (SuTablePinPlacement | null)[]>;
105
+ protected readonly columnCount: import("@angular/core").Signal<number>;
106
+ constructor();
107
+ protected cellTemplate(key: keyof TRow): TemplateRef<SuTableCellContext<object>> | null;
108
+ protected rowClassOf(row: SuTreeTableRowView<TRow>): string | null;
109
+ protected toggle(row: SuTreeTableRowView<TRow>): void;
110
+ /** Keys on the focused row itself move between rows and open or close them; keys on its buttons stay theirs */
111
+ protected onRowKey(event: KeyboardEvent, row: SuTreeTableRowView<TRow>): void;
112
+ protected onRowFocus(id: SuTableRowId): void;
113
+ /** The pin in a heading unpins its column, or pins it back to the side it was set up with (by default the start) */
114
+ protected toggleColumnPin(key: keyof TRow, pinned: SuTablePin | null): void;
115
+ protected setColumnPinnable({ key, pinnable, }: SuTablePinnableChange<TRow>): void;
116
+ protected setColumnsVisible(visible: boolean): void;
117
+ protected setColumnVisible({ key, visible, }: SuTableVisibilityChange<TRow>): void;
118
+ /** Narrows the rows once typing pauses, so each keystroke isn't announced */
119
+ protected search(query: string): void;
120
+ protected onScroll(event: Event): void;
121
+ protected sortBy(key: keyof TRow): void;
122
+ protected pinRow(id: SuTableRowId): void;
123
+ protected setPage(page: number): void;
124
+ protected setPageSize(pageSize: SuTablePageSize): void;
125
+ private rowElement;
126
+ private emitToggle;
127
+ /** Shadows show on the pinned edges only while columns or rows are scrolled under them */
128
+ private updateScrollEdges;
129
+ private emitPage;
130
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuTreeTableComponent<any>, never>;
131
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuTreeTableComponent<any>, "su-lib-tree-table", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "caption": { "alias": "caption"; "required": true; "isSignal": true; }; "showCaption": { "alias": "showCaption"; "required": false; "isSignal": true; }; "rowId": { "alias": "rowId"; "required": false; "isSignal": true; }; "children": { "alias": "children"; "required": false; "isSignal": true; }; "rowKind": { "alias": "rowKind"; "required": false; "isSignal": true; }; "groupLabel": { "alias": "groupLabel"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "numbered": { "alias": "numbered"; "required": false; "isSignal": true; }; "numbering": { "alias": "numbering"; "required": false; "isSignal": true; }; "unnumbered": { "alias": "unnumbered"; "required": false; "isSignal": true; }; "columnControls": { "alias": "columnControls"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "rowClass": { "alias": "rowClass"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageSizes": { "alias": "pageSizes"; "required": false; "isSignal": true; }; "rowPinning": { "alias": "rowPinning"; "required": false; "isSignal": true; }; "pinnedRows": { "alias": "pinnedRows"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; }, { "toggled": "toggled"; "sortChange": "sortChange"; "searchChange": "searchChange"; "pinnedRowsChange": "pinnedRowsChange"; "columnsChange": "columnsChange"; "pageChange": "pageChange"; }, ["cellTemplates"], never, true, never>;
132
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ /** The pin drawn on pinned columns and pin buttons, as in `@su-labs/table`: `<svg suTreeTablePinIcon></svg>` */
3
+ export declare class SuTreeTablePinIconComponent {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuTreeTablePinIconComponent, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuTreeTablePinIconComponent, "svg[suTreeTablePinIcon]", never, {}, {}, never, never, true, never>;
6
+ }
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ /** A row's open and close button, or the room for one on a row without children, so every row's text lines up */
3
+ export declare class SuTreeTableToggleComponent {
4
+ /** Whether the row's children show; null for a row without children */
5
+ readonly expanded: import("@angular/core").InputSignal<boolean | null>;
6
+ /** The button's name, e.g. “Expand Fruit” */
7
+ readonly label: import("@angular/core").InputSignal<string>;
8
+ readonly toggle: import("@angular/core").OutputEmitterRef<void>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuTreeTableToggleComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuTreeTableToggleComponent, "su-lib-tree-table-toggle", never, { "expanded": { "alias": "expanded"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; }, { "toggle": "toggle"; }, never, never, true, never>;
11
+ }
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "@su-labs/tree-table",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "19.0.0",
4
+ "description": "Accessible tree tables for Angular: rows with child rows that open and close, data or group parents, numbering that nests, restarts or continues, merged cells, and the table's sorting, search, paging, pinned rows and columns, themeable with CSS variables.",
5
+ "keywords": [
6
+ "angular",
7
+ "tree-table",
8
+ "treegrid",
9
+ "tree",
10
+ "table",
11
+ "data-table",
12
+ "nested-rows",
13
+ "rowspan",
14
+ "colspan",
15
+ "accessible",
16
+ "signals",
17
+ "themeable",
18
+ "css-variables"
19
+ ],
20
+ "author": {
21
+ "name": "Yevheniy Alekseyev",
22
+ "email": "yev.alekseyev@gmail.com",
23
+ "url": "https://github.com/Greezaaa"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/Greezaaa/settings-utils-lib.git",
28
+ "directory": "projects/su-labs/tree-table"
29
+ },
30
+ "homepage": "https://su-labs.dev/tree-table/",
31
+ "bugs": {
32
+ "url": "https://github.com/Greezaaa/settings-utils-lib/issues"
33
+ },
34
+ "peerDependencies": {
35
+ "@angular/common": "^19.0.0",
36
+ "@angular/core": "^19.0.0"
37
+ },
38
+ "dependencies": {
39
+ "@su-labs/core": "1.11.0",
40
+ "@su-labs/table": "19.1.4",
41
+ "tslib": "^2.3.0"
42
+ },
43
+ "sideEffects": false,
44
+ "license": "MIT",
45
+ "module": "fesm2022/su-labs-tree-table.mjs",
46
+ "typings": "index.d.ts",
47
+ "exports": {
48
+ "./package.json": {
49
+ "default": "./package.json"
50
+ },
51
+ ".": {
52
+ "types": "./index.d.ts",
53
+ "default": "./fesm2022/su-labs-tree-table.mjs"
54
+ }
55
+ }
6
56
  }
@@ -0,0 +1,5 @@
1
+ export { SU_TREE_TABLE_LABELS } from '@su-labs/core/tree-table';
2
+ export type { SuTreeTableColumn, SuTreeTableColumns, SuTreeTableLabels, SuTreeTableNumbering, SuTreeTableRowKind, SuTreeTableSpan, } from '@su-labs/core/tree-table';
3
+ export { SuTableCellDirective } from '@su-labs/table';
4
+ export type { SuTableCellContext } from '@su-labs/table';
5
+ export * from './lib/tree-table/tree-table.component';