@sixbell-telco/sdk 3.3.1 → 4.1.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 +137 -1
- package/README.md +47 -47
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/_index.css +673 -76
- package/components/audio-player/README.md +1 -0
- package/components/audio-player/button-play/button-play.component.d.ts +3 -0
- package/components/audio-player/src/audio-player.component.d.ts +8 -0
- package/components/audio-player/volume-control/volume-control.component.d.ts +3 -0
- package/components/button/README.md +13 -0
- package/components/button/src/button.component.d.ts +30 -5
- package/components/data-table/README.md +53 -3
- package/components/data-table/expandable/expandable.component.d.ts +15 -2
- package/components/data-table/public-api.d.ts +2 -0
- package/components/data-table/sortable-header/sortable-header.component.d.ts +15 -1
- package/components/data-table/src/aria-sort.d.ts +22 -0
- package/components/data-table/src/data-table-context.service.d.ts +11 -3
- package/components/data-table/src/data-table.component.d.ts +39 -3
- package/components/data-table/src/sort-icon.component.d.ts +22 -0
- package/components/data-table/src/toggle-size.d.ts +7 -0
- package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +13 -0
- package/components/dialog/README.md +1 -0
- package/components/dialog/src/dialog.component.d.ts +9 -2
- package/components/divider/src/divider.component.d.ts +5 -0
- package/components/dropdown/README.md +21 -0
- package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +4 -0
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +36 -0
- package/components/dropdown/src/dropdown-item-focus.d.ts +6 -0
- package/components/dropdown/src/dropdown.component.d.ts +5 -2
- package/components/dual-list/src/dual-list.component.d.ts +6 -0
- package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +6 -0
- package/components/forms/combobox/src/combobox.component.d.ts +7 -0
- package/components/forms/date-picker/README.md +2 -0
- package/components/forms/date-picker/src/date-picker.component.d.ts +6 -0
- package/components/forms/select/src/select.component.d.ts +3 -0
- package/components/icon/README.md +8 -1
- package/components/icon/src/icon.component.d.ts +9 -1
- package/components/notification/README.md +8 -0
- package/components/notification/src/notification.component.d.ts +8 -1
- package/components/paginator/README.md +1 -0
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +7 -1
- package/components/paginator/src/paginator.component.d.ts +10 -0
- package/components/sonner/toaster/src/toaster.component.d.ts +2 -1
- package/components/table/README.md +25 -0
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table-loading.d.ts +18 -0
- package/components/table/src/table.component.d.ts +32 -4
- package/components/text/README.md +1 -0
- package/components/tooltip/src/tooltip.component.d.ts +2 -0
- package/directives/text/src/text.directive.d.ts +2 -2
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +48 -10
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +83 -4
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +34 -33
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +429 -361
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +42 -22
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +8 -2
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +7 -7
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +247 -47
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +10 -3
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +16 -8
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +13 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +9 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +8 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +3 -15
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +12 -4
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +17 -8
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +24 -5
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +2 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +2 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +99 -22
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +21 -3
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +944 -0
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-cn.mjs +2 -3
- package/fesm2022/sixbell-telco-sdk-utils-cn.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-http.mjs +39 -0
- package/fesm2022/sixbell-telco-sdk-utils-http.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs +150 -0
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +103 -4
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +71 -2
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/layouts/README.md +278 -0
- package/layouts/index.d.ts +5 -0
- package/layouts/public-api.d.ts +23 -0
- package/layouts/src/app-layout/app-layout.component.d.ts +83 -0
- package/layouts/src/layout-account.d.ts +16 -0
- package/layouts/src/layout-logo.d.ts +10 -0
- package/layouts/src/layout-switcher/layout-switcher.component.d.ts +13 -0
- package/layouts/src/layout.config.d.ts +22 -0
- package/layouts/src/layout.service.d.ts +17 -0
- package/layouts/src/menu/menu-active.d.ts +24 -0
- package/layouts/src/menu/menu-animation.d.ts +34 -0
- package/layouts/src/menu/menu-search.d.ts +13 -0
- package/layouts/src/menu/menu-sections.d.ts +23 -0
- package/layouts/src/menu/menu-url.d.ts +12 -0
- package/layouts/src/menu/menu.model.d.ts +15 -0
- package/layouts/src/navbar/navbar.component.d.ts +33 -0
- package/layouts/src/page-banner/page-banner.component.d.ts +40 -0
- package/layouts/src/side-menu/side-menu.component.d.ts +89 -0
- package/layouts/src/user-menu/user-menu.component.d.ts +91 -0
- package/package.json +26 -15
- package/utils/cn/src/cn.d.ts +1 -1
- package/utils/http/README.md +26 -0
- package/utils/http/index.d.ts +5 -0
- package/utils/http/public-api.d.ts +3 -0
- package/utils/http/src/bearer-token.interceptor.d.ts +19 -0
- package/utils/http/src/http-context.d.ts +3 -0
- package/utils/mfe/README.md +35 -0
- package/utils/mfe/index.d.ts +5 -0
- package/utils/mfe/public-api.d.ts +5 -0
- package/utils/mfe/src/mfe-shadow-root.d.ts +23 -0
- package/utils/mfe/src/mfe-shadow-shell.component.d.ts +20 -0
- package/utils/mfe/src/provide-mfe-shadow-shell.d.ts +20 -0
- package/utils/mfe/src/shadow-root-overlay-container.d.ts +13 -0
- package/utils/theme/README.md +14 -0
- package/utils/theme/public-api.d.ts +3 -1
- package/utils/theme/src/models/theme.d.ts +18 -0
- package/utils/theme/src/scheme-favicon/scheme-favicon.d.ts +26 -0
- package/utils/theme/src/theme-assets/theme-assets.service.d.ts +31 -1
- package/utils/theme/src/theme-assets/theme-assets.types.d.ts +6 -0
- package/utils/translation/README.md +12 -0
- package/utils/translation/public-api.d.ts +4 -0
- package/utils/translation/src/title-strategy/translated-title-strategy.d.ts +27 -0
- package/utils/translation/src/translated-label/translated-label.d.ts +21 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { injectFlexRenderContext } from '@tanstack/angular-table';
|
|
2
2
|
export * from '@tanstack/angular-table';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { signal, Injectable, inject, input, output,
|
|
5
|
-
import { matMoreVert,
|
|
6
|
-
import { TableActionsComponent, resolveTableSize, getTableHierarchyTypographyClasses,
|
|
4
|
+
import { signal, computed, Injectable, inject, input, output, ChangeDetectionStrategy, Component, ElementRef, afterRenderEffect, DestroyRef } from '@angular/core';
|
|
5
|
+
import { matMoreVert, matSwapVert, matArrowUpward, matKeyboardArrowDown, matInfo } from '@sixbell-telco/sdk/components/icon/material/baseline';
|
|
6
|
+
import { TableActionsComponent, resolveTableSize, getTableSizeTokens, getTableHierarchyTypographyClasses, injectTableLoadingSkeleton, tableContainer } from '@sixbell-telco/sdk/components/table';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
9
9
|
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
10
|
-
import { CheckboxComponent } from '@sixbell-telco/sdk/components/forms/checkbox';
|
|
11
10
|
import { TextDirective } from '@sixbell-telco/sdk/directives/text';
|
|
11
|
+
import { TranslatePipe, TranslateService } from '@sixbell-telco/sdk/utils/translation';
|
|
12
|
+
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
13
|
+
import { CheckboxComponent } from '@sixbell-telco/sdk/components/forms/checkbox';
|
|
12
14
|
import { heroDocumentText } from '@ng-icons/heroicons/outline';
|
|
13
15
|
import { matSearchOff } from '@ng-icons/material-icons/baseline';
|
|
14
16
|
import { SelectComponent } from '@sixbell-telco/sdk/components/forms/select';
|
|
15
17
|
import { PaginatorComponent } from '@sixbell-telco/sdk/components/paginator';
|
|
16
|
-
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
17
|
-
import { TranslateService, TranslatePipe } from '@sixbell-telco/sdk/utils/translation';
|
|
18
18
|
import { cva } from 'class-variance-authority';
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -22,15 +22,28 @@ import { cva } from 'class-variance-authority';
|
|
|
22
22
|
* This allows sub-components to automatically sync their sizes with the parent data table
|
|
23
23
|
*/
|
|
24
24
|
class DataTableContextService {
|
|
25
|
+
sizeSource = signal(null);
|
|
26
|
+
fallbackSize = signal('sm');
|
|
25
27
|
/**
|
|
26
|
-
* Current table size that sub-components
|
|
28
|
+
* Current table size that sub-components read. It follows the bound data table size from the
|
|
29
|
+
* first read on, so sub-components never render a default size before the table input applies.
|
|
27
30
|
*/
|
|
28
|
-
size =
|
|
31
|
+
size = computed(() => {
|
|
32
|
+
const source = this.sizeSource();
|
|
33
|
+
return source ? source() : this.fallbackSize();
|
|
34
|
+
});
|
|
29
35
|
/**
|
|
30
|
-
*
|
|
36
|
+
* Bind the size to a signal, read lazily - called by the main data table component
|
|
37
|
+
*/
|
|
38
|
+
bindSize(size) {
|
|
39
|
+
this.sizeSource.set(size);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Set a fixed size, replacing any bound size
|
|
31
43
|
*/
|
|
32
44
|
setSize(size) {
|
|
33
|
-
this.
|
|
45
|
+
this.sizeSource.set(null);
|
|
46
|
+
this.fallbackSize.set(size);
|
|
34
47
|
}
|
|
35
48
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
36
49
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableContextService });
|
|
@@ -156,6 +169,224 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
156
169
|
args: [{ selector: 'st-data-table-empty-actions', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n" }]
|
|
157
170
|
}] });
|
|
158
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Maps a TanStack sort state to the `aria-sort` value of its column header.
|
|
174
|
+
*
|
|
175
|
+
* Returns `null` for an unsorted column so `[attr.aria-sort]` removes the attribute:
|
|
176
|
+
* ARIA asks for `aria-sort` on the sorted header only.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```html
|
|
180
|
+
* <th [attr.aria-sort]="getDataTableAriaSort(header.column.getIsSorted())">...</th>
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
function getDataTableAriaSort(state) {
|
|
184
|
+
if (state === 'asc')
|
|
185
|
+
return 'ascending';
|
|
186
|
+
if (state === 'desc')
|
|
187
|
+
return 'descending';
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* @internal
|
|
192
|
+
* Keeps `aria-sort` on the closest column header (`th` or `[role=columnheader]`) of the host element in sync.
|
|
193
|
+
*/
|
|
194
|
+
function syncClosestHeaderAriaSort(state, enabled) {
|
|
195
|
+
const host = inject(ElementRef).nativeElement;
|
|
196
|
+
let header = null;
|
|
197
|
+
let written = null;
|
|
198
|
+
const clear = () => {
|
|
199
|
+
if (header && written !== null && header.getAttribute('aria-sort') === written) {
|
|
200
|
+
header.removeAttribute('aria-sort');
|
|
201
|
+
}
|
|
202
|
+
written = null;
|
|
203
|
+
};
|
|
204
|
+
afterRenderEffect({
|
|
205
|
+
write: () => {
|
|
206
|
+
const value = enabled() ? getDataTableAriaSort(state()) : null;
|
|
207
|
+
const closest = host.closest('th, [role="columnheader"]');
|
|
208
|
+
if (closest !== header) {
|
|
209
|
+
clear();
|
|
210
|
+
header = closest;
|
|
211
|
+
}
|
|
212
|
+
if (!header)
|
|
213
|
+
return;
|
|
214
|
+
if (value === null) {
|
|
215
|
+
clear();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
header.setAttribute('aria-sort', value);
|
|
219
|
+
written = value;
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
inject(DestroyRef).onDestroy(clear);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const GLYPH_CLASS = 'col-start-1 row-start-1 inline-flex transition-[opacity,rotate] duration-200 ease-in-out motion-reduce:transition-none';
|
|
226
|
+
/**
|
|
227
|
+
* @internal
|
|
228
|
+
* Sort glyph shared by the sortable headers. The neutral glyph and the arrow are stacked boxes that
|
|
229
|
+
* cross-fade, and the arrow rotates to point down for descending. The `st-icon` host is `display: contents`,
|
|
230
|
+
* so the transitions run on wrapping spans. The arrow keeps its last direction while it fades out.
|
|
231
|
+
*/
|
|
232
|
+
class DataTableSortIconComponent {
|
|
233
|
+
sortState = input(false);
|
|
234
|
+
size = input('xs');
|
|
235
|
+
iconDefaultSort = matSwapVert;
|
|
236
|
+
iconAscending = matArrowUpward;
|
|
237
|
+
lastDirection = 'asc';
|
|
238
|
+
direction = computed(() => {
|
|
239
|
+
const state = this.sortState();
|
|
240
|
+
if (state)
|
|
241
|
+
this.lastDirection = state;
|
|
242
|
+
return this.lastDirection;
|
|
243
|
+
});
|
|
244
|
+
dataSort = computed(() => {
|
|
245
|
+
switch (this.sortState()) {
|
|
246
|
+
case 'asc':
|
|
247
|
+
return 'ascending';
|
|
248
|
+
case 'desc':
|
|
249
|
+
return 'descending';
|
|
250
|
+
default:
|
|
251
|
+
return 'none';
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
neutralClass = computed(() => cn(GLYPH_CLASS, this.sortState() ? 'opacity-0' : 'opacity-100'));
|
|
255
|
+
arrowClass = computed(() => cn(GLYPH_CLASS, this.sortState() ? 'opacity-100' : 'opacity-0', this.direction() === 'desc' && 'rotate-180'));
|
|
256
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSortIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
257
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: DataTableSortIconComponent, isStandalone: true, selector: "st-data-table-sort-icon", inputs: { sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "contents" }, ngImport: i0, template: `
|
|
258
|
+
<span data-st-sort-icon [attr.data-sort]="dataSort()" aria-hidden="true" class="inline-grid place-items-center">
|
|
259
|
+
<span data-st-sort-glyph="none" [class]="neutralClass()">
|
|
260
|
+
<st-icon [icon]="iconDefaultSort" [size]="size()"></st-icon>
|
|
261
|
+
</span>
|
|
262
|
+
<span data-st-sort-glyph="arrow" [class]="arrowClass()">
|
|
263
|
+
<st-icon [icon]="iconAscending" [size]="size()"></st-icon>
|
|
264
|
+
</span>
|
|
265
|
+
</span>
|
|
266
|
+
`, isInline: true, dependencies: [{ kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
267
|
+
}
|
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSortIconComponent, decorators: [{
|
|
269
|
+
type: Component,
|
|
270
|
+
args: [{
|
|
271
|
+
standalone: true,
|
|
272
|
+
selector: 'st-data-table-sort-icon',
|
|
273
|
+
imports: [IconComponent],
|
|
274
|
+
template: `
|
|
275
|
+
<span data-st-sort-icon [attr.data-sort]="dataSort()" aria-hidden="true" class="inline-grid place-items-center">
|
|
276
|
+
<span data-st-sort-glyph="none" [class]="neutralClass()">
|
|
277
|
+
<st-icon [icon]="iconDefaultSort" [size]="size()"></st-icon>
|
|
278
|
+
</span>
|
|
279
|
+
<span data-st-sort-glyph="arrow" [class]="arrowClass()">
|
|
280
|
+
<st-icon [icon]="iconAscending" [size]="size()"></st-icon>
|
|
281
|
+
</span>
|
|
282
|
+
</span>
|
|
283
|
+
`,
|
|
284
|
+
host: { class: 'contents' },
|
|
285
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
286
|
+
}]
|
|
287
|
+
}] });
|
|
288
|
+
|
|
289
|
+
const TOGGLE_BUTTON_SIZE = { xs: 'xs', sm: 'xs', md: 'sm', lg: 'sm', xl: 'md' };
|
|
290
|
+
const TOGGLE_ICON_SIZE = { xs: 'xs', sm: 'xs', md: 'sm', lg: 'sm', xl: 'md' };
|
|
291
|
+
/** @internal Button size of the expand toggles for a data table size */
|
|
292
|
+
function getToggleButtonSize(size) {
|
|
293
|
+
return TOGGLE_BUTTON_SIZE[resolveTableSize(size)];
|
|
294
|
+
}
|
|
295
|
+
/** @internal Icon size of the expand and sort toggles for a data table size */
|
|
296
|
+
function getToggleIconSize(size) {
|
|
297
|
+
return TOGGLE_ICON_SIZE[resolveTableSize(size)];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Toggle cell that shows or hides a custom sub-component (detail row) for its row.
|
|
302
|
+
*
|
|
303
|
+
* @remarks
|
|
304
|
+
* Rows that can show details get an icon-only toggle named by `sdk.dataTable.showDetails`, with
|
|
305
|
+
* `aria-expanded` on the inner button. Other rows get a disabled info button named by
|
|
306
|
+
* `sdk.dataTable.detailsUnavailable`. The click does not reach the row, so row click handlers do not fire.
|
|
307
|
+
* `st-data-table-sub-toggle-cell` renders this component.
|
|
308
|
+
*/
|
|
309
|
+
class DataTableSubComponentToggleCellComponent {
|
|
310
|
+
/** The table row instance */
|
|
311
|
+
row = input.required();
|
|
312
|
+
/** Whether the sub-component of this row is shown */
|
|
313
|
+
isExpanded = input.required();
|
|
314
|
+
/** Emits the row id when the toggle is pressed */
|
|
315
|
+
toggled = output();
|
|
316
|
+
/** Whether this row has a sub-component to show */
|
|
317
|
+
canToggleSubComponent = input(false);
|
|
318
|
+
iconChevronDown = matKeyboardArrowDown;
|
|
319
|
+
iconInfo = matInfo;
|
|
320
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSubComponentToggleCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
321
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DataTableSubComponentToggleCellComponent, isStandalone: true, selector: "st-data-table-sub-component-toggle-cell", inputs: { row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null }, isExpanded: { classPropertyName: "isExpanded", publicName: "isExpanded", isSignal: true, isRequired: true, transformFunction: null }, canToggleSubComponent: { classPropertyName: "canToggleSubComponent", publicName: "canToggleSubComponent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggled: "toggled" }, ngImport: i0, template: `
|
|
322
|
+
@if (canToggleSubComponent()) {
|
|
323
|
+
<st-button
|
|
324
|
+
variant="secondary"
|
|
325
|
+
size="xs"
|
|
326
|
+
[circle]="true"
|
|
327
|
+
[ghost]="true"
|
|
328
|
+
[stopPropagation]="true"
|
|
329
|
+
(triggered)="toggled.emit(row().id)"
|
|
330
|
+
[ariaLabel]="'sdk.dataTable.showDetails' | translate"
|
|
331
|
+
[ariaExpanded]="isExpanded()"
|
|
332
|
+
>
|
|
333
|
+
<span data-st-chevron class="inline-flex" [class.is-open]="isExpanded()">
|
|
334
|
+
<st-icon [icon]="iconChevronDown" size="sm"></st-icon>
|
|
335
|
+
</span>
|
|
336
|
+
</st-button>
|
|
337
|
+
} @else {
|
|
338
|
+
<st-button
|
|
339
|
+
variant="secondary"
|
|
340
|
+
size="xs"
|
|
341
|
+
[circle]="true"
|
|
342
|
+
[ghost]="true"
|
|
343
|
+
[ariaLabel]="'sdk.dataTable.detailsUnavailable' | translate"
|
|
344
|
+
[disabled]="true"
|
|
345
|
+
>
|
|
346
|
+
<st-icon [icon]="iconInfo" size="sm"></st-icon>
|
|
347
|
+
</st-button>
|
|
348
|
+
}
|
|
349
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
350
|
+
}
|
|
351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSubComponentToggleCellComponent, decorators: [{
|
|
352
|
+
type: Component,
|
|
353
|
+
args: [{
|
|
354
|
+
standalone: true,
|
|
355
|
+
selector: 'st-data-table-sub-component-toggle-cell',
|
|
356
|
+
imports: [CommonModule, IconComponent, ButtonComponent, TranslatePipe],
|
|
357
|
+
template: `
|
|
358
|
+
@if (canToggleSubComponent()) {
|
|
359
|
+
<st-button
|
|
360
|
+
variant="secondary"
|
|
361
|
+
size="xs"
|
|
362
|
+
[circle]="true"
|
|
363
|
+
[ghost]="true"
|
|
364
|
+
[stopPropagation]="true"
|
|
365
|
+
(triggered)="toggled.emit(row().id)"
|
|
366
|
+
[ariaLabel]="'sdk.dataTable.showDetails' | translate"
|
|
367
|
+
[ariaExpanded]="isExpanded()"
|
|
368
|
+
>
|
|
369
|
+
<span data-st-chevron class="inline-flex" [class.is-open]="isExpanded()">
|
|
370
|
+
<st-icon [icon]="iconChevronDown" size="sm"></st-icon>
|
|
371
|
+
</span>
|
|
372
|
+
</st-button>
|
|
373
|
+
} @else {
|
|
374
|
+
<st-button
|
|
375
|
+
variant="secondary"
|
|
376
|
+
size="xs"
|
|
377
|
+
[circle]="true"
|
|
378
|
+
[ghost]="true"
|
|
379
|
+
[ariaLabel]="'sdk.dataTable.detailsUnavailable' | translate"
|
|
380
|
+
[disabled]="true"
|
|
381
|
+
>
|
|
382
|
+
<st-icon [icon]="iconInfo" size="sm"></st-icon>
|
|
383
|
+
</st-button>
|
|
384
|
+
}
|
|
385
|
+
`,
|
|
386
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
387
|
+
}]
|
|
388
|
+
}] });
|
|
389
|
+
|
|
159
390
|
/**
|
|
160
391
|
* Expandable cell component that shows row data and expand/collapse toggle
|
|
161
392
|
*/
|
|
@@ -180,100 +411,72 @@ class DataTableExpandableCellComponent {
|
|
|
180
411
|
* @internal
|
|
181
412
|
* Computes button size based on data table size
|
|
182
413
|
*/
|
|
183
|
-
buttonSize = computed(() =>
|
|
184
|
-
switch (this.dataTableContext.size()) {
|
|
185
|
-
case 'xs':
|
|
186
|
-
return 'xs';
|
|
187
|
-
case 'sm':
|
|
188
|
-
return 'xs';
|
|
189
|
-
case 'md':
|
|
190
|
-
return 'sm';
|
|
191
|
-
case 'lg':
|
|
192
|
-
return 'sm';
|
|
193
|
-
case 'xl':
|
|
194
|
-
return 'md';
|
|
195
|
-
default:
|
|
196
|
-
return 'xs';
|
|
197
|
-
}
|
|
198
|
-
});
|
|
414
|
+
buttonSize = computed(() => getToggleButtonSize(this.dataTableContext.size()));
|
|
199
415
|
/**
|
|
200
416
|
* @internal
|
|
201
417
|
* Computes icon size based on data table size
|
|
202
418
|
*/
|
|
203
|
-
iconSize = computed(() =>
|
|
204
|
-
switch (this.dataTableContext.size()) {
|
|
205
|
-
case 'xs':
|
|
206
|
-
return 'xs';
|
|
207
|
-
case 'sm':
|
|
208
|
-
return 'xs';
|
|
209
|
-
case 'md':
|
|
210
|
-
return 'sm';
|
|
211
|
-
case 'lg':
|
|
212
|
-
return 'sm';
|
|
213
|
-
case 'xl':
|
|
214
|
-
return 'md';
|
|
215
|
-
default:
|
|
216
|
-
return 'xs';
|
|
217
|
-
}
|
|
218
|
-
});
|
|
419
|
+
iconSize = computed(() => getToggleIconSize(this.dataTableContext.size()));
|
|
219
420
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableExpandableCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
220
421
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DataTableExpandableCellComponent, isStandalone: true, selector: "st-data-table-expandable-cell", ngImport: i0, template: `
|
|
221
|
-
<div [style.--depth]="row.depth">
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
>
|
|
234
|
-
<st-icon
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
422
|
+
<div [style.--depth]="row.depth" class="flex items-center gap-1">
|
|
423
|
+
@if (row.getCanExpand()) {
|
|
424
|
+
<st-button
|
|
425
|
+
variant="base"
|
|
426
|
+
[size]="buttonSize()"
|
|
427
|
+
[square]="true"
|
|
428
|
+
[link]="true"
|
|
429
|
+
[stopPropagation]="true"
|
|
430
|
+
(triggered)="row.getToggleExpandedHandler()()"
|
|
431
|
+
[ariaLabel]="'sdk.dataTable.expandRow' | translate"
|
|
432
|
+
[ariaExpanded]="row.getIsExpanded()"
|
|
433
|
+
>
|
|
434
|
+
<span data-st-chevron class="inline-flex" [class.is-open]="row.getIsExpanded()">
|
|
435
|
+
<st-icon [icon]="iconChevronDown" [size]="iconSize()"></st-icon>
|
|
436
|
+
</span>
|
|
437
|
+
</st-button>
|
|
438
|
+
} @else {
|
|
439
|
+
<!-- Same box as the toggle, kept out of the tab order and the accessibility tree, so the column stays aligned -->
|
|
440
|
+
<span data-st-expander-spacer aria-hidden="true" class="invisible inline-flex">
|
|
441
|
+
<st-button variant="base" [size]="buttonSize()" [square]="true" [link]="true" [disabled]="true">
|
|
442
|
+
<st-icon [icon]="iconChevronDown" [size]="iconSize()"></st-icon>
|
|
239
443
|
</st-button>
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
{{ context.getValue() }}
|
|
244
|
-
</div>
|
|
444
|
+
</span>
|
|
445
|
+
}
|
|
446
|
+
<span>{{ context.getValue() }}</span>
|
|
245
447
|
</div>
|
|
246
|
-
`, isInline: true, styles: [":host
|
|
448
|
+
`, isInline: true, styles: [":host>div{padding-inline-start:calc(2rem * var(--depth, 0))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
247
449
|
}
|
|
248
450
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableExpandableCellComponent, decorators: [{
|
|
249
451
|
type: Component,
|
|
250
|
-
args: [{ standalone: true, selector: 'st-data-table-expandable-cell', imports: [CommonModule, IconComponent, ButtonComponent], template: `
|
|
251
|
-
<div [style.--depth]="row.depth">
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
>
|
|
264
|
-
<st-icon
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
452
|
+
args: [{ standalone: true, selector: 'st-data-table-expandable-cell', imports: [CommonModule, IconComponent, ButtonComponent, TranslatePipe], template: `
|
|
453
|
+
<div [style.--depth]="row.depth" class="flex items-center gap-1">
|
|
454
|
+
@if (row.getCanExpand()) {
|
|
455
|
+
<st-button
|
|
456
|
+
variant="base"
|
|
457
|
+
[size]="buttonSize()"
|
|
458
|
+
[square]="true"
|
|
459
|
+
[link]="true"
|
|
460
|
+
[stopPropagation]="true"
|
|
461
|
+
(triggered)="row.getToggleExpandedHandler()()"
|
|
462
|
+
[ariaLabel]="'sdk.dataTable.expandRow' | translate"
|
|
463
|
+
[ariaExpanded]="row.getIsExpanded()"
|
|
464
|
+
>
|
|
465
|
+
<span data-st-chevron class="inline-flex" [class.is-open]="row.getIsExpanded()">
|
|
466
|
+
<st-icon [icon]="iconChevronDown" [size]="iconSize()"></st-icon>
|
|
467
|
+
</span>
|
|
468
|
+
</st-button>
|
|
469
|
+
} @else {
|
|
470
|
+
<!-- Same box as the toggle, kept out of the tab order and the accessibility tree, so the column stays aligned -->
|
|
471
|
+
<span data-st-expander-spacer aria-hidden="true" class="invisible inline-flex">
|
|
472
|
+
<st-button variant="base" [size]="buttonSize()" [square]="true" [link]="true" [disabled]="true">
|
|
473
|
+
<st-icon [icon]="iconChevronDown" [size]="iconSize()"></st-icon>
|
|
269
474
|
</st-button>
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
{{ context.getValue() }}
|
|
274
|
-
</div>
|
|
475
|
+
</span>
|
|
476
|
+
}
|
|
477
|
+
<span>{{ context.getValue() }}</span>
|
|
275
478
|
</div>
|
|
276
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host
|
|
479
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host>div{padding-inline-start:calc(2rem * var(--depth, 0))}\n"] }]
|
|
277
480
|
}] });
|
|
278
481
|
/**
|
|
279
482
|
* Expandable header cell component with sorting capability and expand all functionality
|
|
@@ -303,6 +506,14 @@ class DataTableExpandableHeaderCellComponent {
|
|
|
303
506
|
* Event emitted when sort toggle is requested
|
|
304
507
|
*/
|
|
305
508
|
sortToggle = output();
|
|
509
|
+
/**
|
|
510
|
+
* Set `aria-sort` on the closest column header while the column is sorted
|
|
511
|
+
* @defaultValue true
|
|
512
|
+
*/
|
|
513
|
+
syncHeaderAriaSort = input(true);
|
|
514
|
+
constructor() {
|
|
515
|
+
syncClosestHeaderAriaSort(this.sortState, computed(() => this.canSort() && this.syncHeaderAriaSort()));
|
|
516
|
+
}
|
|
306
517
|
/**
|
|
307
518
|
* Get the table instance from context
|
|
308
519
|
*/
|
|
@@ -319,42 +530,17 @@ class DataTableExpandableHeaderCellComponent {
|
|
|
319
530
|
* @internal
|
|
320
531
|
* Computes button size based on data table size
|
|
321
532
|
*/
|
|
322
|
-
buttonSize = computed(() =>
|
|
323
|
-
switch (this.dataTableContext.size()) {
|
|
324
|
-
case 'xs':
|
|
325
|
-
return 'xs';
|
|
326
|
-
case 'sm':
|
|
327
|
-
return 'xs';
|
|
328
|
-
case 'md':
|
|
329
|
-
return 'sm';
|
|
330
|
-
case 'lg':
|
|
331
|
-
return 'sm';
|
|
332
|
-
case 'xl':
|
|
333
|
-
return 'md';
|
|
334
|
-
default:
|
|
335
|
-
return 'xs';
|
|
336
|
-
}
|
|
337
|
-
});
|
|
533
|
+
buttonSize = computed(() => getToggleButtonSize(this.dataTableContext.size()));
|
|
338
534
|
/**
|
|
339
535
|
* @internal
|
|
340
536
|
* Computes icon size based on data table size
|
|
341
537
|
*/
|
|
342
|
-
iconSize = computed(() =>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
case 'md':
|
|
349
|
-
return 'sm';
|
|
350
|
-
case 'lg':
|
|
351
|
-
return 'sm';
|
|
352
|
-
case 'xl':
|
|
353
|
-
return 'md';
|
|
354
|
-
default:
|
|
355
|
-
return 'xs';
|
|
356
|
-
}
|
|
357
|
-
});
|
|
538
|
+
iconSize = computed(() => getToggleIconSize(this.dataTableContext.size()));
|
|
539
|
+
/**
|
|
540
|
+
* @internal
|
|
541
|
+
* Typography preset of the column label, matching the table header cells
|
|
542
|
+
*/
|
|
543
|
+
labelPreset = computed(() => getTableSizeTokens(this.dataTableContext.size()).headerPreset);
|
|
358
544
|
/**
|
|
359
545
|
* @internal
|
|
360
546
|
* Computes the appropriate icon based on current sort state
|
|
@@ -383,7 +569,7 @@ class DataTableExpandableHeaderCellComponent {
|
|
|
383
569
|
}
|
|
384
570
|
});
|
|
385
571
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableExpandableHeaderCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
386
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DataTableExpandableHeaderCellComponent, isStandalone: true, selector: "st-data-table-expandable-header-cell", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, canSort: { classPropertyName: "canSort", publicName: "canSort", isSignal: true, isRequired: false, transformFunction: null }, sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortToggle: "sortToggle" }, ngImport: i0, template: `
|
|
572
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DataTableExpandableHeaderCellComponent, isStandalone: true, selector: "st-data-table-expandable-header-cell", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, canSort: { classPropertyName: "canSort", publicName: "canSort", isSignal: true, isRequired: false, transformFunction: null }, sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null }, syncHeaderAriaSort: { classPropertyName: "syncHeaderAriaSort", publicName: "syncHeaderAriaSort", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortToggle: "sortToggle" }, ngImport: i0, template: `
|
|
387
573
|
<div class="inline-flex items-center gap-1">
|
|
388
574
|
<st-button
|
|
389
575
|
variant="base"
|
|
@@ -391,18 +577,15 @@ class DataTableExpandableHeaderCellComponent {
|
|
|
391
577
|
[square]="true"
|
|
392
578
|
[link]="true"
|
|
393
579
|
[stopPropagation]="true"
|
|
394
|
-
(triggered)="context.table.
|
|
395
|
-
|
|
396
|
-
[
|
|
580
|
+
(triggered)="context.table.toggleAllRowsExpanded()"
|
|
581
|
+
[ariaLabel]="'sdk.dataTable.expandAllRows' | translate"
|
|
582
|
+
[ariaExpanded]="context.table.getIsAllRowsExpanded()"
|
|
397
583
|
>
|
|
398
|
-
<st-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
[size]="iconSize()"
|
|
402
|
-
></st-icon>
|
|
584
|
+
<span data-st-chevron class="inline-flex" [class.is-open]="context.table.getIsAllRowsExpanded()">
|
|
585
|
+
<st-icon [icon]="iconChevronDown" [size]="iconSize()"></st-icon>
|
|
586
|
+
</span>
|
|
403
587
|
</st-button>
|
|
404
|
-
|
|
405
|
-
<span class="font-bold">{{ label() }}</span>
|
|
588
|
+
<span [stText]="labelPreset()" class="font-heading font-semibold">{{ label() }}</span>
|
|
406
589
|
<!-- Button for sorting -->
|
|
407
590
|
@if (canSort()) {
|
|
408
591
|
<st-button
|
|
@@ -412,26 +595,20 @@ class DataTableExpandableHeaderCellComponent {
|
|
|
412
595
|
[ghost]="true"
|
|
413
596
|
[stopPropagation]="true"
|
|
414
597
|
(triggered)="sortToggle.emit()"
|
|
415
|
-
|
|
416
|
-
[attr.aria-label]="'Sort by ' + label()"
|
|
417
|
-
[attr.aria-sort]="computedAriaSortAttribute()"
|
|
598
|
+
[ariaLabel]="'sdk.dataTable.sortBy' | translate: { column: label() }"
|
|
418
599
|
>
|
|
419
|
-
<st-icon
|
|
420
|
-
class="transition-transform duration-300 ease-in-out group-aria-[sort=ascending]:rotate-0 group-aria-[sort=descending]:rotate-180"
|
|
421
|
-
[icon]="currentSortIcon()"
|
|
422
|
-
[size]="iconSize()"
|
|
423
|
-
></st-icon>
|
|
600
|
+
<st-data-table-sort-icon [sortState]="sortState()" [size]="iconSize()"></st-data-table-sort-icon>
|
|
424
601
|
</st-button>
|
|
425
602
|
}
|
|
426
603
|
</div>
|
|
427
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type:
|
|
604
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "component", type: DataTableSortIconComponent, selector: "st-data-table-sort-icon", inputs: ["sortState", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
428
605
|
}
|
|
429
606
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableExpandableHeaderCellComponent, decorators: [{
|
|
430
607
|
type: Component,
|
|
431
608
|
args: [{
|
|
432
609
|
standalone: true,
|
|
433
610
|
selector: 'st-data-table-expandable-header-cell',
|
|
434
|
-
imports: [CommonModule, IconComponent,
|
|
611
|
+
imports: [CommonModule, ButtonComponent, TextDirective, TranslatePipe, IconComponent, DataTableSortIconComponent],
|
|
435
612
|
template: `
|
|
436
613
|
<div class="inline-flex items-center gap-1">
|
|
437
614
|
<st-button
|
|
@@ -440,18 +617,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
440
617
|
[square]="true"
|
|
441
618
|
[link]="true"
|
|
442
619
|
[stopPropagation]="true"
|
|
443
|
-
(triggered)="context.table.
|
|
444
|
-
|
|
445
|
-
[
|
|
620
|
+
(triggered)="context.table.toggleAllRowsExpanded()"
|
|
621
|
+
[ariaLabel]="'sdk.dataTable.expandAllRows' | translate"
|
|
622
|
+
[ariaExpanded]="context.table.getIsAllRowsExpanded()"
|
|
446
623
|
>
|
|
447
|
-
<st-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
[size]="iconSize()"
|
|
451
|
-
></st-icon>
|
|
624
|
+
<span data-st-chevron class="inline-flex" [class.is-open]="context.table.getIsAllRowsExpanded()">
|
|
625
|
+
<st-icon [icon]="iconChevronDown" [size]="iconSize()"></st-icon>
|
|
626
|
+
</span>
|
|
452
627
|
</st-button>
|
|
453
|
-
|
|
454
|
-
<span class="font-bold">{{ label() }}</span>
|
|
628
|
+
<span [stText]="labelPreset()" class="font-heading font-semibold">{{ label() }}</span>
|
|
455
629
|
<!-- Button for sorting -->
|
|
456
630
|
@if (canSort()) {
|
|
457
631
|
<st-button
|
|
@@ -461,24 +635,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
461
635
|
[ghost]="true"
|
|
462
636
|
[stopPropagation]="true"
|
|
463
637
|
(triggered)="sortToggle.emit()"
|
|
464
|
-
|
|
465
|
-
[attr.aria-label]="'Sort by ' + label()"
|
|
466
|
-
[attr.aria-sort]="computedAriaSortAttribute()"
|
|
638
|
+
[ariaLabel]="'sdk.dataTable.sortBy' | translate: { column: label() }"
|
|
467
639
|
>
|
|
468
|
-
<st-icon
|
|
469
|
-
class="transition-transform duration-300 ease-in-out group-aria-[sort=ascending]:rotate-0 group-aria-[sort=descending]:rotate-180"
|
|
470
|
-
[icon]="currentSortIcon()"
|
|
471
|
-
[size]="iconSize()"
|
|
472
|
-
></st-icon>
|
|
640
|
+
<st-data-table-sort-icon [sortState]="sortState()" [size]="iconSize()"></st-data-table-sort-icon>
|
|
473
641
|
</st-button>
|
|
474
642
|
}
|
|
475
643
|
</div>
|
|
476
644
|
`,
|
|
477
645
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
478
646
|
}]
|
|
479
|
-
}] });
|
|
647
|
+
}], ctorParameters: () => [] });
|
|
480
648
|
/**
|
|
481
|
-
* Sub-component toggle cell for controlling custom sub-component visibility
|
|
649
|
+
* Sub-component toggle cell for controlling custom sub-component visibility.
|
|
650
|
+
* Renders `st-data-table-sub-component-toggle-cell`; both selectors behave the same.
|
|
482
651
|
*/
|
|
483
652
|
class DataTableSubToggleCellComponent {
|
|
484
653
|
/**
|
|
@@ -509,84 +678,28 @@ class DataTableSubToggleCellComponent {
|
|
|
509
678
|
this.toggled.emit(this.row().id);
|
|
510
679
|
}
|
|
511
680
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSubToggleCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
512
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
[stopPropagation]="true"
|
|
521
|
-
(triggered)="handleToggle()"
|
|
522
|
-
[attr.aria-expanded]="isExpanded()"
|
|
523
|
-
[attr.title]="isExpanded() ? 'Hide Details' : 'Show Details'"
|
|
524
|
-
>
|
|
525
|
-
<st-icon
|
|
526
|
-
class="transition-transform duration-300 ease-in-out group-aria-[expanded=false]:rotate-0 group-aria-[expanded=true]:rotate-180"
|
|
527
|
-
[icon]="expandIcon"
|
|
528
|
-
size="sm"
|
|
529
|
-
></st-icon>
|
|
530
|
-
<span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
|
|
531
|
-
</st-button>
|
|
532
|
-
} @else {
|
|
533
|
-
<!-- Display an informational icon if a sub-component cannot be shown for this row -->
|
|
534
|
-
<st-button
|
|
535
|
-
variant="secondary"
|
|
536
|
-
size="xs"
|
|
537
|
-
[circle]="true"
|
|
538
|
-
[ghost]="true"
|
|
539
|
-
[attr.aria-expanded]="isExpanded()"
|
|
540
|
-
[attr.title]="isExpanded() ? 'Hide Details' : 'Show Details'"
|
|
541
|
-
[disabled]="true"
|
|
542
|
-
>
|
|
543
|
-
<st-icon [icon]="infoIcon" size="sm"></st-icon>
|
|
544
|
-
<span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
|
|
545
|
-
</st-button>
|
|
546
|
-
}
|
|
547
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
681
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: DataTableSubToggleCellComponent, isStandalone: true, selector: "st-data-table-sub-toggle-cell", inputs: { row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null }, isExpanded: { classPropertyName: "isExpanded", publicName: "isExpanded", isSignal: true, isRequired: false, transformFunction: null }, canToggleSubComponent: { classPropertyName: "canToggleSubComponent", publicName: "canToggleSubComponent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggled: "toggled" }, ngImport: i0, template: `
|
|
682
|
+
<st-data-table-sub-component-toggle-cell
|
|
683
|
+
[row]="row()"
|
|
684
|
+
[isExpanded]="isExpanded()"
|
|
685
|
+
[canToggleSubComponent]="canToggleSubComponent()"
|
|
686
|
+
(toggled)="toggled.emit($event)"
|
|
687
|
+
></st-data-table-sub-component-toggle-cell>
|
|
688
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DataTableSubComponentToggleCellComponent, selector: "st-data-table-sub-component-toggle-cell", inputs: ["row", "isExpanded", "canToggleSubComponent"], outputs: ["toggled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
548
689
|
}
|
|
549
690
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSubToggleCellComponent, decorators: [{
|
|
550
691
|
type: Component,
|
|
551
692
|
args: [{
|
|
552
693
|
standalone: true,
|
|
553
694
|
selector: 'st-data-table-sub-toggle-cell',
|
|
554
|
-
imports: [
|
|
695
|
+
imports: [DataTableSubComponentToggleCellComponent],
|
|
555
696
|
template: `
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
class="group"
|
|
563
|
-
[stopPropagation]="true"
|
|
564
|
-
(triggered)="handleToggle()"
|
|
565
|
-
[attr.aria-expanded]="isExpanded()"
|
|
566
|
-
[attr.title]="isExpanded() ? 'Hide Details' : 'Show Details'"
|
|
567
|
-
>
|
|
568
|
-
<st-icon
|
|
569
|
-
class="transition-transform duration-300 ease-in-out group-aria-[expanded=false]:rotate-0 group-aria-[expanded=true]:rotate-180"
|
|
570
|
-
[icon]="expandIcon"
|
|
571
|
-
size="sm"
|
|
572
|
-
></st-icon>
|
|
573
|
-
<span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
|
|
574
|
-
</st-button>
|
|
575
|
-
} @else {
|
|
576
|
-
<!-- Display an informational icon if a sub-component cannot be shown for this row -->
|
|
577
|
-
<st-button
|
|
578
|
-
variant="secondary"
|
|
579
|
-
size="xs"
|
|
580
|
-
[circle]="true"
|
|
581
|
-
[ghost]="true"
|
|
582
|
-
[attr.aria-expanded]="isExpanded()"
|
|
583
|
-
[attr.title]="isExpanded() ? 'Hide Details' : 'Show Details'"
|
|
584
|
-
[disabled]="true"
|
|
585
|
-
>
|
|
586
|
-
<st-icon [icon]="infoIcon" size="sm"></st-icon>
|
|
587
|
-
<span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
|
|
588
|
-
</st-button>
|
|
589
|
-
}
|
|
697
|
+
<st-data-table-sub-component-toggle-cell
|
|
698
|
+
[row]="row()"
|
|
699
|
+
[isExpanded]="isExpanded()"
|
|
700
|
+
[canToggleSubComponent]="canToggleSubComponent()"
|
|
701
|
+
(toggled)="toggled.emit($event)"
|
|
702
|
+
></st-data-table-sub-component-toggle-cell>
|
|
590
703
|
`,
|
|
591
704
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
592
705
|
}]
|
|
@@ -712,6 +825,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
712
825
|
/**
|
|
713
826
|
* Sortable header component for data table columns
|
|
714
827
|
*
|
|
828
|
+
* @remarks
|
|
829
|
+
* Render it inside the column's `th`. It sets `aria-sort` on that closest `th` (or `[role=columnheader]`)
|
|
830
|
+
* while the column is sorted and removes it when the column is unsorted. Set `syncHeaderAriaSort` to `false`
|
|
831
|
+
* to manage the attribute yourself with {@link getDataTableAriaSort}.
|
|
832
|
+
*
|
|
833
|
+
* The icon cross-fades between the neutral sort glyph (unsorted) and an arrow that points up for ascending
|
|
834
|
+
* and rotates to point down for descending. The transitions are skipped under `prefers-reduced-motion`.
|
|
835
|
+
*
|
|
715
836
|
* @example
|
|
716
837
|
* ```typescript
|
|
717
838
|
* flexRenderComponent(DataTableSortableHeaderComponent, {
|
|
@@ -739,6 +860,14 @@ class DataTableSortableHeaderComponent {
|
|
|
739
860
|
* Event emitted when sort toggle is requested
|
|
740
861
|
*/
|
|
741
862
|
sortToggle = output();
|
|
863
|
+
/**
|
|
864
|
+
* Set `aria-sort` on the closest column header while the column is sorted
|
|
865
|
+
* @defaultValue true
|
|
866
|
+
*/
|
|
867
|
+
syncHeaderAriaSort = input(true);
|
|
868
|
+
constructor() {
|
|
869
|
+
syncClosestHeaderAriaSort(this.sortState, this.syncHeaderAriaSort);
|
|
870
|
+
}
|
|
742
871
|
/** @internal */
|
|
743
872
|
iconDefaultSort = matSwapVert;
|
|
744
873
|
/** @internal */
|
|
@@ -827,7 +956,7 @@ class DataTableSortableHeaderComponent {
|
|
|
827
956
|
}
|
|
828
957
|
});
|
|
829
958
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSortableHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
830
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: DataTableSortableHeaderComponent, isStandalone: true, selector: "st-data-table-sortable-header", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortToggle: "sortToggle" }, ngImport: i0, template: `
|
|
959
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: DataTableSortableHeaderComponent, isStandalone: true, selector: "st-data-table-sortable-header", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null }, syncHeaderAriaSort: { classPropertyName: "syncHeaderAriaSort", publicName: "syncHeaderAriaSort", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortToggle: "sortToggle" }, ngImport: i0, template: `
|
|
831
960
|
<div class="inline-flex items-center gap-1">
|
|
832
961
|
<span [stText]="labelPreset()" class="font-heading font-semibold">{{ label() }}</span>
|
|
833
962
|
<st-button
|
|
@@ -837,25 +966,19 @@ class DataTableSortableHeaderComponent {
|
|
|
837
966
|
[ghost]="true"
|
|
838
967
|
[stopPropagation]="true"
|
|
839
968
|
(triggered)="sortToggle.emit()"
|
|
840
|
-
|
|
841
|
-
[attr.aria-label]="'Sort by ' + label()"
|
|
842
|
-
[attr.aria-sort]="computedAriaSortAttribute()"
|
|
969
|
+
[ariaLabel]="'sdk.dataTable.sortBy' | translate: { column: label() }"
|
|
843
970
|
>
|
|
844
|
-
<st-icon
|
|
845
|
-
class="transition-transform duration-300 ease-in-out group-aria-[sort=ascending]:rotate-0 group-aria-[sort=descending]:rotate-180"
|
|
846
|
-
[icon]="currentSortIcon()"
|
|
847
|
-
[size]="iconSize()"
|
|
848
|
-
></st-icon>
|
|
971
|
+
<st-data-table-sort-icon [sortState]="sortState()" [size]="iconSize()"></st-data-table-sort-icon>
|
|
849
972
|
</st-button>
|
|
850
973
|
</div>
|
|
851
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type:
|
|
974
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: DataTableSortIconComponent, selector: "st-data-table-sort-icon", inputs: ["sortState", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
852
975
|
}
|
|
853
976
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSortableHeaderComponent, decorators: [{
|
|
854
977
|
type: Component,
|
|
855
978
|
args: [{
|
|
856
979
|
standalone: true,
|
|
857
980
|
selector: 'st-data-table-sortable-header',
|
|
858
|
-
imports: [CommonModule,
|
|
981
|
+
imports: [CommonModule, ButtonComponent, TextDirective, TranslatePipe, DataTableSortIconComponent],
|
|
859
982
|
template: `
|
|
860
983
|
<div class="inline-flex items-center gap-1">
|
|
861
984
|
<span [stText]="labelPreset()" class="font-heading font-semibold">{{ label() }}</span>
|
|
@@ -866,21 +989,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
866
989
|
[ghost]="true"
|
|
867
990
|
[stopPropagation]="true"
|
|
868
991
|
(triggered)="sortToggle.emit()"
|
|
869
|
-
|
|
870
|
-
[attr.aria-label]="'Sort by ' + label()"
|
|
871
|
-
[attr.aria-sort]="computedAriaSortAttribute()"
|
|
992
|
+
[ariaLabel]="'sdk.dataTable.sortBy' | translate: { column: label() }"
|
|
872
993
|
>
|
|
873
|
-
<st-icon
|
|
874
|
-
class="transition-transform duration-300 ease-in-out group-aria-[sort=ascending]:rotate-0 group-aria-[sort=descending]:rotate-180"
|
|
875
|
-
[icon]="currentSortIcon()"
|
|
876
|
-
[size]="iconSize()"
|
|
877
|
-
></st-icon>
|
|
994
|
+
<st-data-table-sort-icon [sortState]="sortState()" [size]="iconSize()"></st-data-table-sort-icon>
|
|
878
995
|
</st-button>
|
|
879
996
|
</div>
|
|
880
997
|
`,
|
|
881
998
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
882
999
|
}]
|
|
883
|
-
}] });
|
|
1000
|
+
}], ctorParameters: () => [] });
|
|
884
1001
|
|
|
885
1002
|
const DATA_TABLE_FOOTER_LAYOUT_BY_SIZE = {
|
|
886
1003
|
xs: {
|
|
@@ -921,11 +1038,11 @@ const dataTableContent = cva([
|
|
|
921
1038
|
'relative',
|
|
922
1039
|
'text-pretty',
|
|
923
1040
|
'[&_th]:bg-base-300 [&_th]:text-base-content',
|
|
1041
|
+
'[&_thead_td]:bg-base-300 [&_thead_td]:text-base-content',
|
|
924
1042
|
'[&_th]:px-4',
|
|
925
1043
|
'[&_td]:px-4',
|
|
926
1044
|
'[&_tbody_tr]:border-transparent',
|
|
927
1045
|
'rounded-t-box',
|
|
928
|
-
'[&_tbody_tr]:border-transparent',
|
|
929
1046
|
], {
|
|
930
1047
|
variants: {
|
|
931
1048
|
size: {
|
|
@@ -948,7 +1065,7 @@ const dataTableContent = cva([
|
|
|
948
1065
|
*
|
|
949
1066
|
* @example
|
|
950
1067
|
* ```html
|
|
951
|
-
* <st-data-table
|
|
1068
|
+
* <st-data-table size="md" height="lg">
|
|
952
1069
|
* <table>
|
|
953
1070
|
* <thead>
|
|
954
1071
|
* <tr>
|
|
@@ -961,7 +1078,7 @@ const dataTableContent = cva([
|
|
|
961
1078
|
* </tr>
|
|
962
1079
|
* </tbody>
|
|
963
1080
|
* </table>
|
|
964
|
-
* </st-data-table
|
|
1081
|
+
* </st-data-table>
|
|
965
1082
|
* ```
|
|
966
1083
|
*/
|
|
967
1084
|
class DataTableContainerComponent {
|
|
@@ -983,12 +1100,49 @@ class DataTableContainerComponent {
|
|
|
983
1100
|
* @defaultValue 'sm'
|
|
984
1101
|
*/
|
|
985
1102
|
size = input('sm');
|
|
1103
|
+
/**
|
|
1104
|
+
* Table container height preset, shared with `st-table`.
|
|
1105
|
+
* The container is the only scroll container, so `pinRows` keeps the header in view
|
|
1106
|
+
* when a fixed preset (`sm`, `md`, `lg`, `xl`) or `full` inside a sized parent limits the height.
|
|
1107
|
+
* @defaultValue 'auto'
|
|
1108
|
+
*/
|
|
1109
|
+
height = input('auto');
|
|
986
1110
|
constructor() {
|
|
987
|
-
|
|
988
|
-
effect(() => {
|
|
989
|
-
this.dataTableContext.setSize(this.resolvedSize());
|
|
990
|
-
});
|
|
1111
|
+
this.dataTableContext.bindSize(this.resolvedSize);
|
|
991
1112
|
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Show a loading state: the projected header and the table frame stay in place and the body
|
|
1115
|
+
* shows skeleton rows. The table is marked `aria-busy` and a status message is announced.
|
|
1116
|
+
* The empty states are not shown while loading.
|
|
1117
|
+
* @defaultValue false
|
|
1118
|
+
*/
|
|
1119
|
+
loading = input(false);
|
|
1120
|
+
/**
|
|
1121
|
+
* Number of skeleton rows shown while loading. Defaults to the page size (`pagination.itemsPerPage`).
|
|
1122
|
+
* @defaultValue null
|
|
1123
|
+
*/
|
|
1124
|
+
loadingRows = input(null);
|
|
1125
|
+
/**
|
|
1126
|
+
* Highlight body rows on hover with the `--color-table-row-hover` tint (12% `base-content` by default)
|
|
1127
|
+
* layered over each cell's own background, so zebra rows and pinned first-column cells follow it
|
|
1128
|
+
* @defaultValue true
|
|
1129
|
+
*/
|
|
1130
|
+
rowHover = input(true);
|
|
1131
|
+
skeleton = injectTableLoadingSkeleton({
|
|
1132
|
+
loading: this.loading,
|
|
1133
|
+
rowCount: computed(() => this.loadingRows() ?? this.pagination().itemsPerPage),
|
|
1134
|
+
size: this.resolvedSize,
|
|
1135
|
+
});
|
|
1136
|
+
/** @internal */
|
|
1137
|
+
skeletonRows = this.skeleton.rows;
|
|
1138
|
+
/** @internal */
|
|
1139
|
+
skeletonColumns = this.skeleton.columns;
|
|
1140
|
+
/** @internal */
|
|
1141
|
+
skeletonClass = this.skeleton.cellClass;
|
|
1142
|
+
/** @internal */
|
|
1143
|
+
showNoData = computed(() => !this.loading() && this.hasNoData());
|
|
1144
|
+
/** @internal */
|
|
1145
|
+
showNoResults = computed(() => !this.loading() && this.hasNoResults());
|
|
992
1146
|
/**
|
|
993
1147
|
* Enable sticky header row
|
|
994
1148
|
* @defaultValue false
|
|
@@ -1153,122 +1307,36 @@ class DataTableContainerComponent {
|
|
|
1153
1307
|
'table-pin-cols': this.pinColumns(),
|
|
1154
1308
|
'table-zebra': this.zebra(),
|
|
1155
1309
|
'table-bordered': this.bordered(),
|
|
1310
|
+
'table-row-hover': this.rowHover(),
|
|
1156
1311
|
}));
|
|
1157
1312
|
/**
|
|
1158
1313
|
* @internal
|
|
1159
1314
|
* Computes table container classes based on height input
|
|
1160
1315
|
*/
|
|
1161
|
-
tableContainerClass = computed(() => cn('
|
|
1316
|
+
tableContainerClass = computed(() => cn(tableContainer({ containerHeight: this.height() }), 'w-full flex-grow overflow-x-auto'));
|
|
1162
1317
|
/**
|
|
1163
1318
|
* @internal
|
|
1164
1319
|
* Computes outer container classes based on size
|
|
1165
1320
|
*/
|
|
1166
|
-
containerClass = computed(() =>
|
|
1167
|
-
|
|
1168
|
-
'
|
|
1169
|
-
|
|
1170
|
-
|
|
1321
|
+
containerClass = computed(() => {
|
|
1322
|
+
const size = this.resolvedSize();
|
|
1323
|
+
return cn('rounded-box border-neutral @container flex min-w-0 flex-col border border-solid', {
|
|
1324
|
+
'gap-3 pb-3': size === 'xs' || size === 'sm' || size === 'md',
|
|
1325
|
+
'gap-4 pb-4': size === 'lg',
|
|
1326
|
+
'gap-5 pb-5': size === 'xl',
|
|
1327
|
+
});
|
|
1328
|
+
});
|
|
1171
1329
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1172
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DataTableContainerComponent, isStandalone: true, selector: "st-data-table", inputs: { noDataIcon: { classPropertyName: "noDataIcon", publicName: "noDataIcon", isSignal: true, isRequired: false, transformFunction: null }, noResultsIcon: { classPropertyName: "noResultsIcon", publicName: "noResultsIcon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, pinRows: { classPropertyName: "pinRows", publicName: "pinRows", isSignal: true, isRequired: false, transformFunction: null }, pinColumns: { classPropertyName: "pinColumns", publicName: "pinColumns", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "zebra", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, paginatorType: { classPropertyName: "paginatorType", publicName: "paginatorType", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, hasActiveFiltersCallback: { classPropertyName: "hasActiveFiltersCallback", publicName: "hasActiveFiltersCallback", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged" }, providers: [DataTableContextService], ngImport: i0, template: "<div [class]=\"containerClass()\">\n\t<!-- Table container -->\n\t<div [class]=\"tableContainerClass()\">\n\t\t<div class=\"w-full
|
|
1330
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DataTableContainerComponent, isStandalone: true, selector: "st-data-table", inputs: { noDataIcon: { classPropertyName: "noDataIcon", publicName: "noDataIcon", isSignal: true, isRequired: false, transformFunction: null }, noResultsIcon: { classPropertyName: "noResultsIcon", publicName: "noResultsIcon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingRows: { classPropertyName: "loadingRows", publicName: "loadingRows", isSignal: true, isRequired: false, transformFunction: null }, rowHover: { classPropertyName: "rowHover", publicName: "rowHover", isSignal: true, isRequired: false, transformFunction: null }, pinRows: { classPropertyName: "pinRows", publicName: "pinRows", isSignal: true, isRequired: false, transformFunction: null }, pinColumns: { classPropertyName: "pinColumns", publicName: "pinColumns", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "zebra", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, paginatorType: { classPropertyName: "paginatorType", publicName: "paginatorType", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, hasActiveFiltersCallback: { classPropertyName: "hasActiveFiltersCallback", publicName: "hasActiveFiltersCallback", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged" }, providers: [DataTableContextService], ngImport: i0, template: "<div [class]=\"containerClass()\">\n\t<span role=\"status\" class=\"sr-only\">\n\t\t@if (loading()) {\n\t\t\t{{ 'sdk.dataTable.loading' | translate }}\n\t\t}\n\t</span>\n\t<!-- Table container -->\n\t<div [class]=\"tableContainerClass()\">\n\t\t<div class=\"w-full\">\n\t\t\t@if (showNoData()) {\n\t\t\t\t<!-- No data state -->\n\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-1.5 py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40\">\n\t\t\t\t\t\t<st-icon [icon]=\"noDataIcon()\" size=\"lg\" color=\"base-content\" class=\"mx-auto opacity-40\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-0.5\">\n\t\t\t\t\t\t<h3 stText=\"6\" class=\"text-base-content/60\">{{ 'sdk.dataTable.noData.title' | translate }}</h3>\n\t\t\t\t\t\t<p stText=\"8\" class=\"text-base-content/40\">{{ 'sdk.dataTable.noData.message' | translate }}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (showNoResults()) {\n\t\t\t\t<!-- No results from filters state -->\n\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-1.5 py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40\">\n\t\t\t\t\t\t<st-icon [icon]=\"noResultsIcon()\" size=\"xl\" color=\"base-content\" class=\"mx-auto opacity-40\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-0.5\">\n\t\t\t\t\t\t<h3 stText=\"6\" class=\"text-base-content/60\">{{ 'sdk.dataTable.noResults.title' | translate }}</h3>\n\t\t\t\t\t\t<p stText=\"8\" class=\"text-base-content/40\">{{ 'sdk.dataTable.noResults.message' | translate }}</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"mt-3\">\n\t\t\t\t\t\t<ng-content select=\"st-data-table-empty-actions\"></ng-content>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else {\n\t\t\t\t<table [class]=\"tableClass()\" [attr.aria-busy]=\"loading() || null\">\n\t\t\t\t\t<ng-content select=\"caption, colgroup\"></ng-content>\n\t\t\t\t\t<ng-content select=\"thead\"></ng-content>\n\t\t\t\t\t@if (loading()) {\n\t\t\t\t\t\t<tbody data-st-skeleton aria-hidden=\"true\">\n\t\t\t\t\t\t\t@for (row of skeletonRows(); track row) {\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t@for (column of skeletonColumns(); track column) {\n\t\t\t\t\t\t\t\t\t\t<td><div [class]=\"skeletonClass()\"></div></td>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t} @else {\n\t\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t\t}\n\t\t\t\t</table>\n\t\t\t}\n\t\t</div>\n\t</div>\n\n\t<!-- Pagination from showcase -->\n\t<div [class]=\"footerWrapperClass()\">\n\t\t<!-- Divider -->\n\t\t<div [class]=\"footerDividerClass()\"></div>\n\t\t<!-- Paginator Container -->\n\t\t<div [class]=\"footerContentClass()\">\n\t\t\t<!-- Entries range text -->\n\t\t\t<div class=\"flex items-center justify-end\">\n\t\t\t\t<span [stText]=\"paginatorTextSize()\">{{ 'sdk.dataTable.entriesRange' | translate: { range: paginationRange(), total: totalItems() } }}</span>\n\t\t\t</div>\n\n\t\t\t<!-- Paginator -->\n\t\t\t<div class=\"flex justify-center\">\n\t\t\t\t<st-paginator\n\t\t\t\t\t[pages]=\"totalPages()\"\n\t\t\t\t\t[currentPage]=\"pagination().currentPage\"\n\t\t\t\t\t[size]=\"footerPaginatorSize()\"\n\t\t\t\t\t[maxSize]=\"maxSize()\"\n\t\t\t\t\ttype=\"default\"\n\t\t\t\t\t(pageChanged)=\"handlePageChange($event)\"\n\t\t\t\t></st-paginator>\n\t\t\t</div>\n\n\t\t\t<!-- Entries per page dropdown -->\n\t\t\t<div class=\"flex items-center justify-end\">\n\t\t\t\t<span class=\"sr-only\">{{ 'sdk.dataTable.entriesByPage' | translate }}</span>\n\t\t\t\t<st-select\n\t\t\t\t\t[options]=\"entriesPerPageOptions()\"\n\t\t\t\t\t[value]=\"pagination().itemsPerPage\"\n\t\t\t\t\tvalueKey=\"value\"\n\t\t\t\t\tdisplayKey=\"text\"\n\t\t\t\t\t[size]=\"footerSelectSize()\"\n\t\t\t\t\t(valueUpdated)=\"handlePageSizeChange($event)\"\n\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t[allowClear]=\"false\"\n\t\t\t\t></st-select>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: PaginatorComponent, selector: "st-paginator", inputs: ["paginatorId", "maxSize", "type", "pages", "size", "currentPage"], outputs: ["pageChanged", "currentPageChange"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "component", type: SelectComponent, selector: "st-select", inputs: ["variant", "size", "showOptional", "optionalText", "ghost", "name", "placeholder", "label", "value", "options", "displayKey", "valueKey", "allowClear", "parentForm", "formControlName", "disabled", "stopPropagation"], outputs: ["valueChange", "disabledChange", "blurred", "valueUpdated", "clicked", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1173
1331
|
}
|
|
1174
1332
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableContainerComponent, decorators: [{
|
|
1175
1333
|
type: Component,
|
|
1176
|
-
args: [{ selector: 'st-data-table', imports: [CommonModule, PaginatorComponent, TextDirective, SelectComponent, TranslatePipe, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [DataTableContextService], template: "<div [class]=\"containerClass()\">\n\t<!-- Table container -->\n\t<div [class]=\"tableContainerClass()\">\n\t\t<div class=\"w-full
|
|
1334
|
+
args: [{ selector: 'st-data-table', imports: [CommonModule, PaginatorComponent, TextDirective, SelectComponent, TranslatePipe, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [DataTableContextService], template: "<div [class]=\"containerClass()\">\n\t<span role=\"status\" class=\"sr-only\">\n\t\t@if (loading()) {\n\t\t\t{{ 'sdk.dataTable.loading' | translate }}\n\t\t}\n\t</span>\n\t<!-- Table container -->\n\t<div [class]=\"tableContainerClass()\">\n\t\t<div class=\"w-full\">\n\t\t\t@if (showNoData()) {\n\t\t\t\t<!-- No data state -->\n\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-1.5 py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40\">\n\t\t\t\t\t\t<st-icon [icon]=\"noDataIcon()\" size=\"lg\" color=\"base-content\" class=\"mx-auto opacity-40\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-0.5\">\n\t\t\t\t\t\t<h3 stText=\"6\" class=\"text-base-content/60\">{{ 'sdk.dataTable.noData.title' | translate }}</h3>\n\t\t\t\t\t\t<p stText=\"8\" class=\"text-base-content/40\">{{ 'sdk.dataTable.noData.message' | translate }}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (showNoResults()) {\n\t\t\t\t<!-- No results from filters state -->\n\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-1.5 py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40\">\n\t\t\t\t\t\t<st-icon [icon]=\"noResultsIcon()\" size=\"xl\" color=\"base-content\" class=\"mx-auto opacity-40\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-0.5\">\n\t\t\t\t\t\t<h3 stText=\"6\" class=\"text-base-content/60\">{{ 'sdk.dataTable.noResults.title' | translate }}</h3>\n\t\t\t\t\t\t<p stText=\"8\" class=\"text-base-content/40\">{{ 'sdk.dataTable.noResults.message' | translate }}</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"mt-3\">\n\t\t\t\t\t\t<ng-content select=\"st-data-table-empty-actions\"></ng-content>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else {\n\t\t\t\t<table [class]=\"tableClass()\" [attr.aria-busy]=\"loading() || null\">\n\t\t\t\t\t<ng-content select=\"caption, colgroup\"></ng-content>\n\t\t\t\t\t<ng-content select=\"thead\"></ng-content>\n\t\t\t\t\t@if (loading()) {\n\t\t\t\t\t\t<tbody data-st-skeleton aria-hidden=\"true\">\n\t\t\t\t\t\t\t@for (row of skeletonRows(); track row) {\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t@for (column of skeletonColumns(); track column) {\n\t\t\t\t\t\t\t\t\t\t<td><div [class]=\"skeletonClass()\"></div></td>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t} @else {\n\t\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t\t}\n\t\t\t\t</table>\n\t\t\t}\n\t\t</div>\n\t</div>\n\n\t<!-- Pagination from showcase -->\n\t<div [class]=\"footerWrapperClass()\">\n\t\t<!-- Divider -->\n\t\t<div [class]=\"footerDividerClass()\"></div>\n\t\t<!-- Paginator Container -->\n\t\t<div [class]=\"footerContentClass()\">\n\t\t\t<!-- Entries range text -->\n\t\t\t<div class=\"flex items-center justify-end\">\n\t\t\t\t<span [stText]=\"paginatorTextSize()\">{{ 'sdk.dataTable.entriesRange' | translate: { range: paginationRange(), total: totalItems() } }}</span>\n\t\t\t</div>\n\n\t\t\t<!-- Paginator -->\n\t\t\t<div class=\"flex justify-center\">\n\t\t\t\t<st-paginator\n\t\t\t\t\t[pages]=\"totalPages()\"\n\t\t\t\t\t[currentPage]=\"pagination().currentPage\"\n\t\t\t\t\t[size]=\"footerPaginatorSize()\"\n\t\t\t\t\t[maxSize]=\"maxSize()\"\n\t\t\t\t\ttype=\"default\"\n\t\t\t\t\t(pageChanged)=\"handlePageChange($event)\"\n\t\t\t\t></st-paginator>\n\t\t\t</div>\n\n\t\t\t<!-- Entries per page dropdown -->\n\t\t\t<div class=\"flex items-center justify-end\">\n\t\t\t\t<span class=\"sr-only\">{{ 'sdk.dataTable.entriesByPage' | translate }}</span>\n\t\t\t\t<st-select\n\t\t\t\t\t[options]=\"entriesPerPageOptions()\"\n\t\t\t\t\t[value]=\"pagination().itemsPerPage\"\n\t\t\t\t\tvalueKey=\"value\"\n\t\t\t\t\tdisplayKey=\"text\"\n\t\t\t\t\t[size]=\"footerSelectSize()\"\n\t\t\t\t\t(valueUpdated)=\"handlePageSizeChange($event)\"\n\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t[allowClear]=\"false\"\n\t\t\t\t></st-select>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n" }]
|
|
1177
1335
|
}], ctorParameters: () => [] });
|
|
1178
1336
|
|
|
1179
|
-
class DataTableSubComponentToggleCellComponent {
|
|
1180
|
-
row = input.required();
|
|
1181
|
-
isExpanded = input.required(); // Current state of the sub-component for this row
|
|
1182
|
-
toggled = output(); // Emits row.id when clicked to trigger parent component update
|
|
1183
|
-
// Input to determine if this specific row is eligible to display a sub-component
|
|
1184
|
-
canToggleSubComponent = input(false);
|
|
1185
|
-
iconChevronDown = matKeyboardArrowDown;
|
|
1186
|
-
iconInfo = matInfo;
|
|
1187
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSubComponentToggleCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1188
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DataTableSubComponentToggleCellComponent, isStandalone: true, selector: "st-data-table-sub-component-toggle-cell", inputs: { row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null }, isExpanded: { classPropertyName: "isExpanded", publicName: "isExpanded", isSignal: true, isRequired: true, transformFunction: null }, canToggleSubComponent: { classPropertyName: "canToggleSubComponent", publicName: "canToggleSubComponent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggled: "toggled" }, ngImport: i0, template: `
|
|
1189
|
-
@if (canToggleSubComponent()) {
|
|
1190
|
-
<st-button
|
|
1191
|
-
variant="secondary"
|
|
1192
|
-
size="xs"
|
|
1193
|
-
[circle]="true"
|
|
1194
|
-
[ghost]="true"
|
|
1195
|
-
class="group"
|
|
1196
|
-
(click)="toggled.emit(row().id)"
|
|
1197
|
-
[attr.aria-expanded]="isExpanded()"
|
|
1198
|
-
title="{{ isExpanded() ? 'Hide Details' : 'Show Details' }}"
|
|
1199
|
-
>
|
|
1200
|
-
<st-icon
|
|
1201
|
-
class="transition-transform duration-300 ease-in-out group-aria-[expanded=false]:rotate-0 group-aria-[expanded=true]:rotate-180"
|
|
1202
|
-
[icon]="iconChevronDown"
|
|
1203
|
-
size="sm"
|
|
1204
|
-
></st-icon>
|
|
1205
|
-
<span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
|
|
1206
|
-
</st-button>
|
|
1207
|
-
} @else {
|
|
1208
|
-
<!-- Display an informational icon if a sub-component cannot be shown for this row -->
|
|
1209
|
-
<st-button
|
|
1210
|
-
variant="secondary"
|
|
1211
|
-
size="xs"
|
|
1212
|
-
[circle]="true"
|
|
1213
|
-
[ghost]="true"
|
|
1214
|
-
[attr.aria-expanded]="isExpanded()"
|
|
1215
|
-
title="{{ isExpanded() ? 'Hide Details' : 'Show Details' }}"
|
|
1216
|
-
[disabled]="true"
|
|
1217
|
-
>
|
|
1218
|
-
<st-icon [icon]="iconInfo" size="sm"></st-icon>
|
|
1219
|
-
<span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
|
|
1220
|
-
</st-button>
|
|
1221
|
-
}
|
|
1222
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1223
|
-
}
|
|
1224
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DataTableSubComponentToggleCellComponent, decorators: [{
|
|
1225
|
-
type: Component,
|
|
1226
|
-
args: [{
|
|
1227
|
-
standalone: true,
|
|
1228
|
-
selector: 'st-data-table-sub-component-toggle-cell',
|
|
1229
|
-
imports: [CommonModule, IconComponent, ButtonComponent],
|
|
1230
|
-
template: `
|
|
1231
|
-
@if (canToggleSubComponent()) {
|
|
1232
|
-
<st-button
|
|
1233
|
-
variant="secondary"
|
|
1234
|
-
size="xs"
|
|
1235
|
-
[circle]="true"
|
|
1236
|
-
[ghost]="true"
|
|
1237
|
-
class="group"
|
|
1238
|
-
(click)="toggled.emit(row().id)"
|
|
1239
|
-
[attr.aria-expanded]="isExpanded()"
|
|
1240
|
-
title="{{ isExpanded() ? 'Hide Details' : 'Show Details' }}"
|
|
1241
|
-
>
|
|
1242
|
-
<st-icon
|
|
1243
|
-
class="transition-transform duration-300 ease-in-out group-aria-[expanded=false]:rotate-0 group-aria-[expanded=true]:rotate-180"
|
|
1244
|
-
[icon]="iconChevronDown"
|
|
1245
|
-
size="sm"
|
|
1246
|
-
></st-icon>
|
|
1247
|
-
<span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
|
|
1248
|
-
</st-button>
|
|
1249
|
-
} @else {
|
|
1250
|
-
<!-- Display an informational icon if a sub-component cannot be shown for this row -->
|
|
1251
|
-
<st-button
|
|
1252
|
-
variant="secondary"
|
|
1253
|
-
size="xs"
|
|
1254
|
-
[circle]="true"
|
|
1255
|
-
[ghost]="true"
|
|
1256
|
-
[attr.aria-expanded]="isExpanded()"
|
|
1257
|
-
title="{{ isExpanded() ? 'Hide Details' : 'Show Details' }}"
|
|
1258
|
-
[disabled]="true"
|
|
1259
|
-
>
|
|
1260
|
-
<st-icon [icon]="iconInfo" size="sm"></st-icon>
|
|
1261
|
-
<span class="sr-only">{{ isExpanded() ? 'Hide Details' : 'Show Details' }}</span>
|
|
1262
|
-
</st-button>
|
|
1263
|
-
}
|
|
1264
|
-
`,
|
|
1265
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1266
|
-
}]
|
|
1267
|
-
}] });
|
|
1268
|
-
|
|
1269
1337
|
/**
|
|
1270
1338
|
* Generated bundle index. Do not edit.
|
|
1271
1339
|
*/
|
|
1272
1340
|
|
|
1273
|
-
export { DataTableActionsComponent, DataTableContainerComponent, DataTableEmptyActionsComponent, DataTableExpandableCellComponent, DataTableExpandableHeaderCellComponent, DataTableHeadSelectionComponent, DataTableRowSelectionComponent, DataTableSortableHeaderComponent, DataTableSubComponentToggleCellComponent, DataTableSubToggleCellComponent, dataTableContent };
|
|
1341
|
+
export { DataTableActionsComponent, DataTableContainerComponent, DataTableEmptyActionsComponent, DataTableExpandableCellComponent, DataTableExpandableHeaderCellComponent, DataTableHeadSelectionComponent, DataTableRowSelectionComponent, DataTableSortableHeaderComponent, DataTableSubComponentToggleCellComponent, DataTableSubToggleCellComponent, dataTableContent, getDataTableAriaSort };
|
|
1274
1342
|
//# sourceMappingURL=sixbell-telco-sdk-components-data-table.mjs.map
|