@ship-ui/core 0.22.15 → 0.22.16
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/assets/mcp/components.json +32 -8
- package/fesm2022/ship-ui-core-ship-a11y-keybindings.mjs +9 -0
- package/fesm2022/ship-ui-core-ship-a11y-keybindings.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-blueprint.mjs +10 -2
- package/fesm2022/ship-ui-core-ship-blueprint.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-datepicker.mjs +16 -4
- package/fesm2022/ship-ui-core-ship-datepicker.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-dialog.mjs +4 -0
- package/fesm2022/ship-ui-core-ship-dialog.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-popover.mjs +4 -0
- package/fesm2022/ship-ui-core-ship-popover.mjs.map +1 -1
- package/fesm2022/ship-ui-core-ship-table.mjs +426 -22
- package/fesm2022/ship-ui-core-ship-table.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ship-ui-core-ship-blueprint.d.ts +1 -0
- package/types/ship-ui-core-ship-datepicker.d.ts +2 -0
- package/types/ship-ui-core-ship-table.d.ts +12 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, ElementRef, Renderer2,
|
|
3
|
+
import { inject, ElementRef, Renderer2, Injector, signal, input, effect, HostListener, Directive, computed, output, model, contentChild, viewChild, untracked, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
4
4
|
import { shipComponentClasses, observeChildren } from '@ship-ui/core';
|
|
5
5
|
import { ShipA11yKeybindingsService } from '@ship-ui/core/ship-a11y-keybindings';
|
|
6
6
|
import { ShipChip } from '@ship-ui/core/ship-chip';
|
|
@@ -8,10 +8,24 @@ import { ShipIcon } from '@ship-ui/core/ship-icon';
|
|
|
8
8
|
import { ShipProgressBar } from '@ship-ui/core/ship-progress-bar';
|
|
9
9
|
|
|
10
10
|
class ShipResize {
|
|
11
|
+
#el;
|
|
12
|
+
#renderer;
|
|
13
|
+
#table;
|
|
14
|
+
#keybindings;
|
|
15
|
+
#injector;
|
|
16
|
+
#sort;
|
|
17
|
+
#startX;
|
|
18
|
+
#startWidth;
|
|
19
|
+
#resizing;
|
|
20
|
+
#animationFrameRequest; // Store request ID
|
|
11
21
|
constructor() {
|
|
12
22
|
this.#el = inject(ElementRef);
|
|
13
23
|
this.#renderer = inject(Renderer2);
|
|
14
24
|
this.#table = inject(ShipTable);
|
|
25
|
+
this.#keybindings = inject(ShipA11yKeybindingsService);
|
|
26
|
+
this.#injector = inject(Injector);
|
|
27
|
+
this.#sort = signal(null, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "#sort" }] : /* istanbul ignore next */ []));
|
|
15
29
|
this.resizable = input(true, /* @ts-ignore */
|
|
16
30
|
...(ngDevMode ? [{ debugName: "resizable" }] : /* istanbul ignore next */ []));
|
|
17
31
|
this.minWidth = input(50, /* @ts-ignore */
|
|
@@ -22,24 +36,97 @@ class ShipResize {
|
|
|
22
36
|
...(ngDevMode ? [{ debugName: "resizingClass" }] : /* istanbul ignore next */ []));
|
|
23
37
|
this.#resizing = false;
|
|
24
38
|
this.#animationFrameRequest = null; // Store request ID
|
|
39
|
+
effect(() => {
|
|
40
|
+
if (this.#sort())
|
|
41
|
+
return;
|
|
42
|
+
const hostEl = this.#el.nativeElement;
|
|
43
|
+
if (this.resizable()) {
|
|
44
|
+
const parts = [];
|
|
45
|
+
const decAction = 'table.column-resize-decrease';
|
|
46
|
+
const decShortcut = this.#keybindings.getShortcut(decAction);
|
|
47
|
+
if (decShortcut) {
|
|
48
|
+
parts.push(this.#keybindings.getDisplayShortcut(decAction) || decShortcut);
|
|
49
|
+
}
|
|
50
|
+
const incAction = 'table.column-resize-increase';
|
|
51
|
+
const incShortcut = this.#keybindings.getShortcut(incAction);
|
|
52
|
+
if (incShortcut) {
|
|
53
|
+
parts.push(this.#keybindings.getDisplayShortcut(incAction) || incShortcut);
|
|
54
|
+
}
|
|
55
|
+
if (parts.length > 0) {
|
|
56
|
+
this.#renderer.setAttribute(hostEl, 'aria-keyshortcuts', parts.join(', '));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.#renderer.removeAttribute(hostEl, 'aria-keyshortcuts');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.#renderer.removeAttribute(hostEl, 'aria-keyshortcuts');
|
|
64
|
+
}
|
|
65
|
+
});
|
|
25
66
|
}
|
|
26
|
-
#el;
|
|
27
|
-
#renderer;
|
|
28
|
-
#table;
|
|
29
|
-
#startX;
|
|
30
|
-
#startWidth;
|
|
31
|
-
#resizing;
|
|
32
|
-
#animationFrameRequest; // Store request ID
|
|
33
67
|
ngOnInit() {
|
|
34
68
|
if (!this.#table) {
|
|
35
69
|
console.error('shTableResize directive must be used within a sh-table component.');
|
|
36
70
|
return;
|
|
37
71
|
}
|
|
72
|
+
const hostEl = this.#el.nativeElement;
|
|
73
|
+
// Resolve ShipSort lazily to avoid circular DI instantiation issues
|
|
74
|
+
this.#sort.set(this.#injector.get(ShipSort, null, { optional: true, self: true }));
|
|
38
75
|
if (this.resizable()) {
|
|
39
76
|
const resizer = this.#renderer.createElement('div');
|
|
40
77
|
this.#renderer.addClass(resizer, 'sh-resizer');
|
|
41
|
-
this.#renderer.appendChild(
|
|
78
|
+
this.#renderer.appendChild(hostEl, resizer);
|
|
42
79
|
this.#renderer.listen(resizer, 'mousedown', this.#onMouseDown.bind(this));
|
|
80
|
+
if (!hostEl.hasAttribute('role')) {
|
|
81
|
+
this.#renderer.setAttribute(hostEl, 'role', 'columnheader');
|
|
82
|
+
}
|
|
83
|
+
if (!this.#sort() && !hostEl.hasAttribute('tabindex')) {
|
|
84
|
+
this.#renderer.setAttribute(hostEl, 'tabindex', '0');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
onKeyDown(event) {
|
|
89
|
+
if (!this.resizable())
|
|
90
|
+
return;
|
|
91
|
+
const target = event.target;
|
|
92
|
+
const host = this.#el.nativeElement;
|
|
93
|
+
if (target !== host &&
|
|
94
|
+
(target.tagName === 'BUTTON' ||
|
|
95
|
+
target.tagName === 'INPUT' ||
|
|
96
|
+
target.tagName === 'SELECT' ||
|
|
97
|
+
target.tagName === 'TEXTAREA' ||
|
|
98
|
+
target.closest('button, input, select, textarea, a') !== null ||
|
|
99
|
+
target.closest('[role="button"], [role="checkbox"], [role="menuitem"]') !== null)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if ((event.key === 'ArrowLeft' || event.key === 'ArrowRight') && !event.shiftKey) {
|
|
103
|
+
if (!this.#sort()) {
|
|
104
|
+
const parentRow = host.parentElement;
|
|
105
|
+
if (parentRow) {
|
|
106
|
+
const headers = Array.from(parentRow.querySelectorAll('th')).filter((el) => el.getAttribute('tabindex') === '0' || el.hasAttribute('shSort') || el.hasAttribute('shResize'));
|
|
107
|
+
const currentIndex = headers.indexOf(host);
|
|
108
|
+
if (currentIndex !== -1) {
|
|
109
|
+
const nextIndex = event.key === 'ArrowRight' ? currentIndex + 1 : currentIndex - 1;
|
|
110
|
+
if (nextIndex >= 0 && nextIndex < headers.length) {
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
headers[nextIndex].focus();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const isDecrease = this.#keybindings.matches(event, 'table.column-resize-decrease');
|
|
120
|
+
const isIncrease = this.#keybindings.matches(event, 'table.column-resize-increase');
|
|
121
|
+
if (isDecrease || isIncrease) {
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
event.stopPropagation();
|
|
124
|
+
const currentWidth = this.#el.nativeElement.offsetWidth;
|
|
125
|
+
const step = 10;
|
|
126
|
+
const targetWidth = isDecrease ? currentWidth - step : currentWidth + step;
|
|
127
|
+
const constrainedWidth = Math.max(this.minWidth(), this.maxWidth() ? Math.min(targetWidth, this.maxWidth() ?? targetWidth) : targetWidth);
|
|
128
|
+
this.#renderer.setAttribute(this.#el.nativeElement, 'size', `${constrainedWidth}px`);
|
|
129
|
+
this.#table.updateColumnSizes();
|
|
43
130
|
}
|
|
44
131
|
}
|
|
45
132
|
onMouseMove(event) {
|
|
@@ -97,7 +184,7 @@ class ShipResize {
|
|
|
97
184
|
}
|
|
98
185
|
}
|
|
99
186
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipResize, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
100
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.0", type: ShipResize, isStandalone: true, selector: "[shResize]", inputs: { resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:mousemove": "onMouseMove($event)", "document:mouseup": "onMouseUp($event)", "document:click": "onClick($event)" }, properties: { "class.resizing": "resizingClass()" } }, ngImport: i0 }); }
|
|
187
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.0", type: ShipResize, isStandalone: true, selector: "[shResize]", inputs: { resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "onKeyDown($event)", "document:mousemove": "onMouseMove($event)", "document:mouseup": "onMouseUp($event)", "document:click": "onClick($event)" }, properties: { "class.resizing": "resizingClass()" } }, ngImport: i0 }); }
|
|
101
188
|
}
|
|
102
189
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipResize, decorators: [{
|
|
103
190
|
type: Directive,
|
|
@@ -108,7 +195,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
108
195
|
'[class.resizing]': 'resizingClass()',
|
|
109
196
|
},
|
|
110
197
|
}]
|
|
111
|
-
}], propDecorators: { resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }],
|
|
198
|
+
}], ctorParameters: () => [], propDecorators: { resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], onKeyDown: [{
|
|
199
|
+
type: HostListener,
|
|
200
|
+
args: ['keydown', ['$event']]
|
|
201
|
+
}], onMouseMove: [{
|
|
112
202
|
type: HostListener,
|
|
113
203
|
args: ['document:mousemove', ['$event']]
|
|
114
204
|
}], onMouseUp: [{
|
|
@@ -122,8 +212,42 @@ class ShipSort {
|
|
|
122
212
|
constructor() {
|
|
123
213
|
this.#table = inject(ShipTable);
|
|
124
214
|
this.#keybindings = inject(ShipA11yKeybindingsService);
|
|
215
|
+
this.#injector = inject(Injector);
|
|
216
|
+
this.#el = inject(ElementRef);
|
|
217
|
+
this.#resize = signal(null, /* @ts-ignore */
|
|
218
|
+
...(ngDevMode ? [{ debugName: "#resize" }] : /* istanbul ignore next */ []));
|
|
125
219
|
this.shSort = input(/* @ts-ignore */
|
|
126
220
|
...(ngDevMode ? [undefined, { debugName: "shSort" }] : /* istanbul ignore next */ []));
|
|
221
|
+
this.tabIndex = computed(() => {
|
|
222
|
+
const resize = this.#resize();
|
|
223
|
+
return this.shSort() || (resize && resize.resizable()) ? '0' : null;
|
|
224
|
+
}, /* @ts-ignore */
|
|
225
|
+
...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
226
|
+
this.ariaKeyshortcuts = computed(() => {
|
|
227
|
+
const parts = [];
|
|
228
|
+
const resize = this.#resize();
|
|
229
|
+
if (this.shSort()) {
|
|
230
|
+
const action = 'table.sort';
|
|
231
|
+
const shortcut = this.#keybindings.getShortcut(action);
|
|
232
|
+
if (shortcut) {
|
|
233
|
+
parts.push(this.#keybindings.getDisplayShortcut(action) || shortcut);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (resize && resize.resizable()) {
|
|
237
|
+
const decAction = 'table.column-resize-decrease';
|
|
238
|
+
const decShortcut = this.#keybindings.getShortcut(decAction);
|
|
239
|
+
if (decShortcut) {
|
|
240
|
+
parts.push(this.#keybindings.getDisplayShortcut(decAction) || decShortcut);
|
|
241
|
+
}
|
|
242
|
+
const incAction = 'table.column-resize-increase';
|
|
243
|
+
const incShortcut = this.#keybindings.getShortcut(incAction);
|
|
244
|
+
if (incShortcut) {
|
|
245
|
+
parts.push(this.#keybindings.getDisplayShortcut(incAction) || incShortcut);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return parts.length > 0 ? parts.join(', ') : null;
|
|
249
|
+
}, /* @ts-ignore */
|
|
250
|
+
...(ngDevMode ? [{ debugName: "ariaKeyshortcuts" }] : /* istanbul ignore next */ []));
|
|
127
251
|
this.sortAsc = computed(() => {
|
|
128
252
|
const currentSort = this.#table.sortByColumn();
|
|
129
253
|
const thisColumn = this.shSort();
|
|
@@ -151,13 +275,59 @@ class ShipSort {
|
|
|
151
275
|
}
|
|
152
276
|
#table;
|
|
153
277
|
#keybindings;
|
|
278
|
+
#injector;
|
|
279
|
+
#el;
|
|
280
|
+
#resize;
|
|
281
|
+
ngOnInit() {
|
|
282
|
+
// Resolve ShipResize lazily to avoid circular DI instantiation issues
|
|
283
|
+
this.#resize.set(this.#injector.get(ShipResize, null, { optional: true, self: true }));
|
|
284
|
+
}
|
|
154
285
|
onKeyDown(event) {
|
|
155
|
-
if (this.shSort()
|
|
286
|
+
if (!this.shSort())
|
|
287
|
+
return;
|
|
288
|
+
const target = event.target;
|
|
289
|
+
const host = this.#el.nativeElement;
|
|
290
|
+
if (target !== host &&
|
|
291
|
+
(target.tagName === 'BUTTON' ||
|
|
292
|
+
target.tagName === 'INPUT' ||
|
|
293
|
+
target.tagName === 'SELECT' ||
|
|
294
|
+
target.tagName === 'TEXTAREA' ||
|
|
295
|
+
target.closest('button, input, select, textarea, a') !== null ||
|
|
296
|
+
target.closest('[role="button"], [role="checkbox"], [role="menuitem"]') !== null)) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
if ((event.key === 'ArrowLeft' || event.key === 'ArrowRight') && !event.shiftKey) {
|
|
300
|
+
const parentRow = host.parentElement;
|
|
301
|
+
if (parentRow) {
|
|
302
|
+
const headers = Array.from(parentRow.querySelectorAll('th')).filter((el) => el.getAttribute('tabindex') === '0' || el.hasAttribute('shSort') || el.hasAttribute('shResize'));
|
|
303
|
+
const currentIndex = headers.indexOf(host);
|
|
304
|
+
if (currentIndex !== -1) {
|
|
305
|
+
const nextIndex = event.key === 'ArrowRight' ? currentIndex + 1 : currentIndex - 1;
|
|
306
|
+
if (nextIndex >= 0 && nextIndex < headers.length) {
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
headers[nextIndex].focus();
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (this.#keybindings.matches(event, 'table.sort')) {
|
|
156
315
|
this.toggleSort(event);
|
|
157
316
|
}
|
|
158
317
|
}
|
|
159
318
|
toggleSort(event) {
|
|
160
319
|
if (event) {
|
|
320
|
+
const target = event.target;
|
|
321
|
+
const host = this.#el.nativeElement;
|
|
322
|
+
if (target !== host &&
|
|
323
|
+
(target.tagName === 'BUTTON' ||
|
|
324
|
+
target.tagName === 'INPUT' ||
|
|
325
|
+
target.tagName === 'SELECT' ||
|
|
326
|
+
target.tagName === 'TEXTAREA' ||
|
|
327
|
+
target.closest('button, input, select, textarea, a') !== null ||
|
|
328
|
+
target.closest('[role="button"], [role="checkbox"], [role="menuitem"]') !== null)) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
161
331
|
event.preventDefault();
|
|
162
332
|
}
|
|
163
333
|
if (this.#table.resizing()) {
|
|
@@ -169,7 +339,7 @@ class ShipSort {
|
|
|
169
339
|
this.#table.toggleSort(sortCol);
|
|
170
340
|
}
|
|
171
341
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipSort, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
172
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.0", type: ShipSort, isStandalone: true, selector: "[shSort]", inputs: { shSort: { classPropertyName: "shSort", publicName: "shSort", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "columnheader" }, listeners: { "click": "shSort() ? toggleSort() : null", "keydown": "onKeyDown($event)" }, properties: { "class.sortable": "!!shSort()", "attr.tabindex": "
|
|
342
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.0", type: ShipSort, isStandalone: true, selector: "[shSort]", inputs: { shSort: { classPropertyName: "shSort", publicName: "shSort", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "columnheader" }, listeners: { "click": "shSort() ? toggleSort($event) : null", "keydown": "onKeyDown($event)" }, properties: { "class.sortable": "!!shSort()", "attr.tabindex": "tabIndex()", "attr.aria-sort": "shSort() ? ariaSort() : null", "class.sort-asc": "sortAsc()", "class.sort-desc": "sortDesc()", "attr.aria-keyshortcuts": "ariaKeyshortcuts()" } }, ngImport: i0 }); }
|
|
173
343
|
}
|
|
174
344
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipSort, decorators: [{
|
|
175
345
|
type: Directive,
|
|
@@ -179,11 +349,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
179
349
|
host: {
|
|
180
350
|
role: 'columnheader',
|
|
181
351
|
'[class.sortable]': '!!shSort()',
|
|
182
|
-
'[attr.tabindex]': '
|
|
183
|
-
'(click)': 'shSort() ? toggleSort() : null',
|
|
352
|
+
'[attr.tabindex]': 'tabIndex()',
|
|
353
|
+
'(click)': 'shSort() ? toggleSort($event) : null',
|
|
184
354
|
'[attr.aria-sort]': 'shSort() ? ariaSort() : null',
|
|
185
355
|
'[class.sort-asc]': 'sortAsc()',
|
|
186
356
|
'[class.sort-desc]': 'sortDesc()',
|
|
357
|
+
'[attr.aria-keyshortcuts]': 'ariaKeyshortcuts()',
|
|
187
358
|
},
|
|
188
359
|
}]
|
|
189
360
|
}], propDecorators: { shSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "shSort", required: false }] }], onKeyDown: [{
|
|
@@ -228,6 +399,12 @@ const SCROLL_TOLERANCE = 1.5;
|
|
|
228
399
|
class ShipTable {
|
|
229
400
|
constructor() {
|
|
230
401
|
this.#el = inject(ElementRef);
|
|
402
|
+
this.#renderer = inject(Renderer2);
|
|
403
|
+
this.#keybindings = inject(ShipA11yKeybindingsService);
|
|
404
|
+
this.grid = input(false, /* @ts-ignore */
|
|
405
|
+
...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
406
|
+
this.role = computed(() => (this.grid() ? 'grid' : 'table'), /* @ts-ignore */
|
|
407
|
+
...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
231
408
|
this.loading = input(false, /* @ts-ignore */
|
|
232
409
|
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
233
410
|
this.data = input([], /* @ts-ignore */
|
|
@@ -288,6 +465,64 @@ class ShipTable {
|
|
|
288
465
|
});
|
|
289
466
|
}, /* @ts-ignore */
|
|
290
467
|
...(ngDevMode ? [{ debugName: "bodyEffect" }] : /* istanbul ignore next */ []));
|
|
468
|
+
this.gridSetupEffect = effect(() => {
|
|
469
|
+
const gridActive = this.grid();
|
|
470
|
+
const dataVal = this.data();
|
|
471
|
+
const colSignal = this.columns.signal();
|
|
472
|
+
untracked(() => {
|
|
473
|
+
const host = this.#el.nativeElement;
|
|
474
|
+
const allCells = host.querySelectorAll('th, td');
|
|
475
|
+
if (gridActive) {
|
|
476
|
+
if (allCells.length === 0)
|
|
477
|
+
return;
|
|
478
|
+
let hasZero = false;
|
|
479
|
+
allCells.forEach((cell) => {
|
|
480
|
+
if (cell.getAttribute('tabindex') === '0') {
|
|
481
|
+
hasZero = true;
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
if (!hasZero) {
|
|
485
|
+
this.#renderer.setAttribute(allCells[0], 'tabindex', '0');
|
|
486
|
+
}
|
|
487
|
+
allCells.forEach((cell) => {
|
|
488
|
+
if (cell.getAttribute('tabindex') !== '0') {
|
|
489
|
+
this.#renderer.setAttribute(cell, 'tabindex', '-1');
|
|
490
|
+
}
|
|
491
|
+
if (!cell.hasAttribute('role')) {
|
|
492
|
+
this.#renderer.setAttribute(cell, 'role', cell.tagName === 'TD' ? 'gridcell' : 'columnheader');
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
const allRows = host.querySelectorAll('tr');
|
|
496
|
+
allRows.forEach((row) => {
|
|
497
|
+
if (!row.hasAttribute('role')) {
|
|
498
|
+
this.#renderer.setAttribute(row, 'role', 'row');
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
// Clean up
|
|
504
|
+
allCells.forEach((cell) => {
|
|
505
|
+
const isHeader = cell.tagName === 'TH';
|
|
506
|
+
if (isHeader) {
|
|
507
|
+
const isInteractiveHeader = cell.classList.contains('sortable') ||
|
|
508
|
+
cell.querySelector('.sh-resizer') !== null ||
|
|
509
|
+
cell.hasAttribute('aria-keyshortcuts');
|
|
510
|
+
if (isInteractiveHeader) {
|
|
511
|
+
this.#renderer.setAttribute(cell, 'tabindex', '0');
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
this.#renderer.removeAttribute(cell, 'tabindex');
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
// Remove tabindex from td (data cells)
|
|
519
|
+
this.#renderer.removeAttribute(cell, 'tabindex');
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
}, /* @ts-ignore */
|
|
525
|
+
...(ngDevMode ? [{ debugName: "gridSetupEffect" }] : /* istanbul ignore next */ []));
|
|
291
526
|
this.resizing = signal(false, /* @ts-ignore */
|
|
292
527
|
...(ngDevMode ? [{ debugName: "resizing" }] : /* istanbul ignore next */ []));
|
|
293
528
|
this.sizeTrigger = signal(true, /* @ts-ignore */
|
|
@@ -399,6 +634,8 @@ class ShipTable {
|
|
|
399
634
|
...(ngDevMode ? [{ debugName: "e" }] : /* istanbul ignore next */ []));
|
|
400
635
|
}
|
|
401
636
|
#el;
|
|
637
|
+
#renderer;
|
|
638
|
+
#keybindings;
|
|
402
639
|
#initialData;
|
|
403
640
|
#initialDataSet;
|
|
404
641
|
updateColumnSizes() {
|
|
@@ -413,6 +650,166 @@ class ShipTable {
|
|
|
413
650
|
ngAfterViewInit() {
|
|
414
651
|
queueMicrotask(() => this.#checkScroll());
|
|
415
652
|
}
|
|
653
|
+
onFocusIn(event) {
|
|
654
|
+
if (!this.grid())
|
|
655
|
+
return;
|
|
656
|
+
const target = event.target;
|
|
657
|
+
if (!target)
|
|
658
|
+
return;
|
|
659
|
+
const cell = target.tagName === 'TH' || target.tagName === 'TD' ? target : target.closest('th, td');
|
|
660
|
+
if (cell) {
|
|
661
|
+
// Set roles dynamically for cells and rows if not present
|
|
662
|
+
if (!cell.hasAttribute('role')) {
|
|
663
|
+
this.#renderer.setAttribute(cell, 'role', cell.tagName === 'TD' ? 'gridcell' : 'columnheader');
|
|
664
|
+
}
|
|
665
|
+
const parentRow = cell.parentElement;
|
|
666
|
+
if (parentRow && !parentRow.hasAttribute('role')) {
|
|
667
|
+
this.#renderer.setAttribute(parentRow, 'role', 'row');
|
|
668
|
+
}
|
|
669
|
+
// Set tabindex="0" on focused cell and tabindex="-1" on all other cells
|
|
670
|
+
this.#renderer.setAttribute(cell, 'tabindex', '0');
|
|
671
|
+
const allCells = this.#el.nativeElement.querySelectorAll('th, td');
|
|
672
|
+
allCells.forEach((c) => {
|
|
673
|
+
if (c !== cell) {
|
|
674
|
+
this.#renderer.setAttribute(c, 'tabindex', '-1');
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
onGridKeyDown(event) {
|
|
680
|
+
if (!this.grid())
|
|
681
|
+
return;
|
|
682
|
+
if (event.key === 'Tab') {
|
|
683
|
+
const target = event.target;
|
|
684
|
+
const cell = target.tagName === 'TH' || target.tagName === 'TD' ? target : target.closest('th, td');
|
|
685
|
+
if (!cell)
|
|
686
|
+
return;
|
|
687
|
+
const focusableSelectors = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
688
|
+
const focusableChildren = Array.from(cell.querySelectorAll(focusableSelectors));
|
|
689
|
+
const row = cell.parentElement;
|
|
690
|
+
if (!row || row.tagName !== 'TR')
|
|
691
|
+
return;
|
|
692
|
+
const cellsInRow = Array.from(row.querySelectorAll('th, td'));
|
|
693
|
+
const currentColIndex = cellsInRow.indexOf(cell);
|
|
694
|
+
if (currentColIndex === -1)
|
|
695
|
+
return;
|
|
696
|
+
if (!event.shiftKey) {
|
|
697
|
+
// Forward Tab
|
|
698
|
+
const isLastChild = focusableChildren.length === 0 || target === focusableChildren[focusableChildren.length - 1];
|
|
699
|
+
const isCellSelf = target === cell;
|
|
700
|
+
if (isLastChild && !isCellSelf) {
|
|
701
|
+
// Move to next cell in row
|
|
702
|
+
if (currentColIndex < cellsInRow.length - 1) {
|
|
703
|
+
event.preventDefault();
|
|
704
|
+
this.#focusGridCell(cellsInRow[currentColIndex + 1]);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
else if (isCellSelf && focusableChildren.length === 0) {
|
|
708
|
+
// Move to next cell in row
|
|
709
|
+
if (currentColIndex < cellsInRow.length - 1) {
|
|
710
|
+
event.preventDefault();
|
|
711
|
+
this.#focusGridCell(cellsInRow[currentColIndex + 1]);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
else {
|
|
716
|
+
// Shift + Tab (Backward)
|
|
717
|
+
const isFirstChild = focusableChildren.length > 0 && target === focusableChildren[0];
|
|
718
|
+
const isCellSelf = target === cell;
|
|
719
|
+
if (isFirstChild) {
|
|
720
|
+
event.preventDefault();
|
|
721
|
+
this.#focusGridCell(cell);
|
|
722
|
+
}
|
|
723
|
+
else if (isCellSelf) {
|
|
724
|
+
if (currentColIndex > 0) {
|
|
725
|
+
event.preventDefault();
|
|
726
|
+
const prevCell = cellsInRow[currentColIndex - 1];
|
|
727
|
+
const prevFocusableChildren = Array.from(prevCell.querySelectorAll(focusableSelectors));
|
|
728
|
+
if (prevFocusableChildren.length > 0) {
|
|
729
|
+
this.#focusGridCell(prevCell);
|
|
730
|
+
prevFocusableChildren[prevFocusableChildren.length - 1].focus();
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
this.#focusGridCell(prevCell);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
const isUp = this.#keybindings.matches(event, 'grid.focus-up');
|
|
741
|
+
const isDown = this.#keybindings.matches(event, 'grid.focus-down');
|
|
742
|
+
const isLeft = this.#keybindings.matches(event, 'grid.focus-left');
|
|
743
|
+
const isRight = this.#keybindings.matches(event, 'grid.focus-right');
|
|
744
|
+
const isFirst = this.#keybindings.matches(event, 'grid.focus-first');
|
|
745
|
+
const isLast = this.#keybindings.matches(event, 'grid.focus-last');
|
|
746
|
+
if (!isUp && !isDown && !isLeft && !isRight && !isFirst && !isLast)
|
|
747
|
+
return;
|
|
748
|
+
const target = event.target;
|
|
749
|
+
if (target.tagName !== 'TH' && target.tagName !== 'TD') {
|
|
750
|
+
// Focus is inside a child control, let them operate normally
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
const row = target.parentElement;
|
|
754
|
+
if (!row || row.tagName !== 'TR')
|
|
755
|
+
return;
|
|
756
|
+
const allRows = Array.from(this.#el.nativeElement.querySelectorAll('tr'));
|
|
757
|
+
const currentRowIndex = allRows.indexOf(row);
|
|
758
|
+
if (currentRowIndex === -1)
|
|
759
|
+
return;
|
|
760
|
+
const cellsInRow = Array.from(row.querySelectorAll('th, td'));
|
|
761
|
+
const currentColIndex = cellsInRow.indexOf(target);
|
|
762
|
+
if (currentColIndex === -1)
|
|
763
|
+
return;
|
|
764
|
+
let targetRowIndex = currentRowIndex;
|
|
765
|
+
let targetColIndex = currentColIndex;
|
|
766
|
+
if (isUp) {
|
|
767
|
+
targetRowIndex = currentRowIndex - 1;
|
|
768
|
+
}
|
|
769
|
+
else if (isDown) {
|
|
770
|
+
targetRowIndex = currentRowIndex + 1;
|
|
771
|
+
}
|
|
772
|
+
else if (isLeft) {
|
|
773
|
+
targetColIndex = currentColIndex - 1;
|
|
774
|
+
}
|
|
775
|
+
else if (isRight) {
|
|
776
|
+
targetColIndex = currentColIndex + 1;
|
|
777
|
+
}
|
|
778
|
+
else if (isFirst) {
|
|
779
|
+
targetColIndex = 0;
|
|
780
|
+
}
|
|
781
|
+
else if (isLast) {
|
|
782
|
+
targetColIndex = cellsInRow.length - 1;
|
|
783
|
+
}
|
|
784
|
+
if (targetRowIndex !== currentRowIndex) {
|
|
785
|
+
const targetRow = allRows[targetRowIndex];
|
|
786
|
+
if (targetRow) {
|
|
787
|
+
const targetCells = Array.from(targetRow.querySelectorAll('th, td'));
|
|
788
|
+
const targetCell = targetCells[Math.min(currentColIndex, targetCells.length - 1)];
|
|
789
|
+
if (targetCell) {
|
|
790
|
+
event.preventDefault();
|
|
791
|
+
this.#focusGridCell(targetCell);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
else if (targetColIndex !== currentColIndex) {
|
|
796
|
+
const targetCell = cellsInRow[targetColIndex];
|
|
797
|
+
if (targetCell) {
|
|
798
|
+
event.preventDefault();
|
|
799
|
+
this.#focusGridCell(targetCell);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
#focusGridCell(cell) {
|
|
804
|
+
this.#renderer.setAttribute(cell, 'tabindex', '0');
|
|
805
|
+
cell.focus();
|
|
806
|
+
const allCells = this.#el.nativeElement.querySelectorAll('th, td');
|
|
807
|
+
allCells.forEach((c) => {
|
|
808
|
+
if (c !== cell) {
|
|
809
|
+
this.#renderer.setAttribute(c, 'tabindex', '-1');
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
416
813
|
toggleSort(column) {
|
|
417
814
|
const currentSort = this.sortByColumn();
|
|
418
815
|
const sortDir = currentSort === column ? `-${column}` : currentSort === `-${column}` ? null : column;
|
|
@@ -450,7 +847,7 @@ class ShipTable {
|
|
|
450
847
|
this.canScrollY.set(canScrollY);
|
|
451
848
|
}
|
|
452
849
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipTable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
453
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: ShipTable, isStandalone: true, selector: "sh-table", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, sortByColumn: { classPropertyName: "sortByColumn", publicName: "sortByColumn", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dataChange: "dataChange", sortByColumn: "sortByColumnChange" }, host: {
|
|
850
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: ShipTable, isStandalone: true, selector: "sh-table", inputs: { grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, sortByColumn: { classPropertyName: "sortByColumn", publicName: "sortByColumn", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dataChange: "dataChange", sortByColumn: "sortByColumnChange" }, host: { listeners: { "scroll": "onScroll()", "window:resize": "onResize($event)", "focusin": "onFocusIn($event)", "keydown": "onGridKeyDown($event)" }, properties: { "attr.role": "role()", "attr.aria-busy": "loading()", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledby()", "class": "hostClasses()", "style.grid-template-columns": "columnSizes()", "class.resizing": "resizing()", "class.can-scroll-x": "canScrollX()", "class.can-scroll-y": "canScrollY()", "class.scrolled-x": "scrollXState() >= 0", "class.scrolled-x-end": "scrollXState() === 1", "class.scrolled-y": "scrollYState() >= 0", "class.scrolled-y-end": "scrollYState() === 1" } }, queries: [{ propertyName: "content", first: true, predicate: ShipTableContent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "theadLocal", first: true, predicate: ["theadLocal"], descendants: true, isSignal: true }, { propertyName: "tbodyLocal", first: true, predicate: ["tbodyLocal"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
454
851
|
<div class="actionbar">
|
|
455
852
|
<ng-content select="[actionbar]:not([align-right])" />
|
|
456
853
|
<div class="actionbar-right">
|
|
@@ -480,7 +877,7 @@ class ShipTable {
|
|
|
480
877
|
<ng-content select="[table-no-rows]" />
|
|
481
878
|
</div>
|
|
482
879
|
}
|
|
483
|
-
`, isInline: true, styles: ["sh-table{--table-bc: var(--base-4);--table-th-bg: var(--base-2);--table-tr-bg: var(--base-1);--table-td-bg: var(--base-1);--table-th-c: var(--base-8);--table-th-f: var(--paragraph-30);--table-td-c: var(--base-8);--table-td-f: var(--paragraph-30);--table-th-p: 0 1.25rem;--table-td-p: 0 1.25rem;--table-th-mh: 3rem;--table-td-mh: 4.875rem;--table-th-g: .25rem;--table-td-g: .5rem;--table-ws: nowrap;--table-th-bw: 0;--table-td-bw: .0625rem 0 0;--table-columns: 1fr 1fr 1fr max-content;--table-sticky-bw: .0625rem}sh-table.type-a tbody>th,sh-table.type-a tbody>td,sh-table.type-a thead>th,sh-table.type-a thead>td{padding-right:0}sh-table.type-a tbody>th:first-child,sh-table.type-a tbody>td:first-child,sh-table.type-a thead>th:first-child,sh-table.type-a thead>td:first-child{padding:0}sh-table.type-b{--table-th-p: 0 .75rem;--table-td-p: 0 .75rem;--table-th-mh: 2.25rem;--table-td-mh: 3.5rem;--table-th-bw: .0625rem 0 .0625rem .0625rem;--table-td-bw: 0 0 .0625rem .0625rem;--table-sticky-bw: .0625rem}sh-table.type-b th:first-child{border-left-width:0;padding:var(--table-th-p)}sh-table.type-b td:first-child{border-left-width:0;padding:var(--table-td-p)}sh-table.type-b td.sticky,sh-table.type-b th.sticky{border-left-width:0;border-right:var(--table-sticky-bw) solid var(--table-bc)}sh-table.type-b [shStickyColumns] th,sh-table.type-b [shStickyColumns] td{border-right:var(--table-sticky-bw) solid var(--table-bc)}sh-table.type-b th.sticky-end,sh-table.type-b td.sticky-end,sh-table.type-b [shStickyColumns=end] th,sh-table.type-b [shStickyColumns=end] td{border-left:var(--table-sticky-bw) solid var(--table-bc);border-right:0}sh-table.type-b .sticky+th,sh-table.type-b .sticky+td,sh-table.type-b [shStickyColumns]+th,sh-table.type-b [shStickyColumns]+td{border-left-width:0}sh-table.type-b tr:hover td{background-color:var(--base-2)}sh-table.type-b div[table-header] tr:first-child th{border-bottom:0}sh-table.type-b tbody tr:last-child td{border-bottom-width:0}sh-table.type-b .actionbar{background-color:var(--base-2);border-width:.0625rem 0 0}sh-table{width:100%;display:grid;overflow:auto;overscroll-behavior-x:none;grid-template-columns:var(--table-columns);position:relative;container-type:inline-size}sh-table.resizing{-webkit-user-select:none;user-select:none}sh-table:has([shTableResize]) td{overflow:auto}sh-table.no-resize .sh-resizer{display:none}sh-table.no-resize td{overflow:initial}sh-table .actionbar{display:flex;align-items:center;gap:.5rem;grid-column:1/-1;position:sticky;left:0;z-index:10;background-color:var(--base-1);width:100cqw;box-sizing:border-box;padding:.5rem;border:var(--border-10);border-width:.0625rem 0;opacity:1;transition:padding .3s ease-out,border-width .3s ease-out,opacity .3s ease-out;overflow:hidden}sh-table .actionbar:empty,sh-table .actionbar:not(:has(>:not(.actionbar-right))):has(>.actionbar-right:empty){display:none}sh-table .actionbar>*{min-height:0}sh-table .actionbar .actionbar-right{display:flex;align-items:center;gap:.5rem;margin-left:auto;flex-shrink:0}sh-table .actionbar .actionbar-right:empty{display:none}sh-table tbody{position:relative}sh-table tbody:has(tr.sticky){position:sticky;top:0;z-index:1}sh-table thead{position:relative}sh-table thead:has(tr.sticky){position:sticky;top:0;z-index:2}sh-table sh-progress-bar{grid-column:1/-1;position:absolute;top:100%;transform:translateY(-50%);z-index:200}sh-table tbody,sh-table thead,sh-table tr{display:grid;grid-column:1/-1;grid-template-columns:subgrid}sh-table tr{background:var(--table-tr-bg);position:relative;z-index:0}sh-table tr.sticky{position:sticky;top:0;z-index:1}sh-table tr.sticky-end{position:sticky;bottom:0;z-index:3}sh-table tr:has(th.sticky-end) th:nth-last-child(2){padding:var(--table-th-p)}sh-table tr:has(td.sticky-end) td:nth-last-child(2){padding:var(--table-td-p)}sh-table th{display:flex;align-items:center;padding:var(--table-th-p);min-height:var(--table-th-mh);font:var(--table-th-f);line-height:1em;white-space:var(--table-ws);color:var(--table-th-c);border:0;border-color:var(--table-bc);border-style:solid;border-width:var(--table-th-bw);background:var(--table-th-bg);gap:var(--table-th-g);z-index:auto}sh-table th:hover,sh-table th.resizing{z-index:
|
|
880
|
+
`, isInline: true, styles: ["sh-table{--table-bc: var(--base-4);--table-th-bg: var(--base-2);--table-tr-bg: var(--base-1);--table-td-bg: var(--base-1);--table-th-c: var(--base-8);--table-th-f: var(--paragraph-30);--table-td-c: var(--base-8);--table-td-f: var(--paragraph-30);--table-th-p: 0 1.25rem;--table-td-p: 0 1.25rem;--table-th-mh: 3rem;--table-td-mh: 4.875rem;--table-th-g: .25rem;--table-td-g: .5rem;--table-ws: nowrap;--table-th-bw: 0;--table-td-bw: .0625rem 0 0;--table-columns: 1fr 1fr 1fr max-content;--table-sticky-bw: .0625rem}sh-table.type-a tbody>th,sh-table.type-a tbody>td,sh-table.type-a thead>th,sh-table.type-a thead>td{padding-right:0}sh-table.type-a tbody>th:first-child,sh-table.type-a tbody>td:first-child,sh-table.type-a thead>th:first-child,sh-table.type-a thead>td:first-child{padding:0}sh-table.type-b{--table-th-p: 0 .75rem;--table-td-p: 0 .75rem;--table-th-mh: 2.25rem;--table-td-mh: 3.5rem;--table-th-bw: .0625rem 0 .0625rem .0625rem;--table-td-bw: 0 0 .0625rem .0625rem;--table-sticky-bw: .0625rem}sh-table.type-b th:first-child{border-left-width:0;padding:var(--table-th-p)}sh-table.type-b td:first-child{border-left-width:0;padding:var(--table-td-p)}sh-table.type-b td.sticky,sh-table.type-b th.sticky{border-left-width:0;border-right:var(--table-sticky-bw) solid var(--table-bc)}sh-table.type-b [shStickyColumns] th,sh-table.type-b [shStickyColumns] td{border-right:var(--table-sticky-bw) solid var(--table-bc)}sh-table.type-b th.sticky-end,sh-table.type-b td.sticky-end,sh-table.type-b [shStickyColumns=end] th,sh-table.type-b [shStickyColumns=end] td{border-left:var(--table-sticky-bw) solid var(--table-bc);border-right:0}sh-table.type-b .sticky+th,sh-table.type-b .sticky+td,sh-table.type-b [shStickyColumns]+th,sh-table.type-b [shStickyColumns]+td{border-left-width:0}sh-table.type-b tr:hover td{background-color:var(--base-2)}sh-table.type-b div[table-header] tr:first-child th{border-bottom:0}sh-table.type-b tbody tr:last-child td{border-bottom-width:0}sh-table.type-b .actionbar{background-color:var(--base-2);border-width:.0625rem 0 0}sh-table{width:100%;display:grid;overflow:auto;overscroll-behavior-x:none;grid-template-columns:var(--table-columns);position:relative;container-type:inline-size}sh-table.resizing{-webkit-user-select:none;user-select:none}sh-table:has([shTableResize]) td{overflow:auto}sh-table.no-resize .sh-resizer{display:none}sh-table.no-resize td{overflow:initial}sh-table .actionbar{display:flex;align-items:center;gap:.5rem;grid-column:1/-1;position:sticky;left:0;z-index:10;background-color:var(--base-1);width:100cqw;box-sizing:border-box;padding:.5rem;border:var(--border-10);border-width:.0625rem 0;opacity:1;transition:padding .3s ease-out,border-width .3s ease-out,opacity .3s ease-out;overflow:hidden}sh-table .actionbar:empty,sh-table .actionbar:not(:has(>:not(.actionbar-right))):has(>.actionbar-right:empty){display:none}sh-table .actionbar>*{min-height:0}sh-table .actionbar .actionbar-right{display:flex;align-items:center;gap:.5rem;margin-left:auto;flex-shrink:0}sh-table .actionbar .actionbar-right:empty{display:none}sh-table tbody{position:relative}sh-table tbody:has(tr.sticky){position:sticky;top:0;z-index:1}sh-table thead{position:relative}sh-table thead:has(tr.sticky){position:sticky;top:0;z-index:2}sh-table sh-progress-bar{grid-column:1/-1;position:absolute;top:100%;transform:translateY(-50%);z-index:200}sh-table tbody,sh-table thead,sh-table tr{display:grid;grid-column:1/-1;grid-template-columns:subgrid}sh-table tr{background:var(--table-tr-bg);position:relative;z-index:0}sh-table tr.sticky{position:sticky;top:0;z-index:1}sh-table tr.sticky-end{position:sticky;bottom:0;z-index:3}sh-table tr:has(th.sticky-end) th:nth-last-child(2){padding:var(--table-th-p)}sh-table tr:has(td.sticky-end) td:nth-last-child(2){padding:var(--table-td-p)}sh-table th{display:flex;align-items:center;padding:var(--table-th-p);min-height:var(--table-th-mh);font:var(--table-th-f);line-height:1em;white-space:var(--table-ws);color:var(--table-th-c);border:0;border-color:var(--table-bc);border-style:solid;border-width:var(--table-th-bw);background:var(--table-th-bg);gap:var(--table-th-g);z-index:auto}sh-table th:focus-visible{outline:.125rem solid var(--primary-8);outline-offset:-.125rem}sh-table th:hover,sh-table th.resizing{z-index:10}sh-table th:has(.sh-resizer){position:relative;z-index:2}sh-table th.sortable{--caret-color: var(--base-10);--caret-size: .375rem;cursor:pointer;-webkit-user-select:none;user-select:none}sh-table th.sortable sh-icon{opacity:.35;transition:opacity 125ms ease-in-out}sh-table th.sortable:hover sh-icon{opacity:.7}sh-table th.sortable.sort-asc sh-icon,sh-table th.sortable.sort-desc sh-icon{opacity:1}sh-table th.sortable:not(:has(sh-icon)):after{content:\"\";border:var(--caret-size) solid transparent;width:0;height:0;opacity:0;transition:opacity 125ms ease-in-out}sh-table th.sortable:not(:has(sh-icon)).sort-desc:after{opacity:1;transform:translateY(-4px);border-bottom-color:var(--caret-color)}sh-table th.sortable:not(:has(sh-icon)).sort-asc:after{opacity:1;transform:translateY(4px);border-top-color:var(--caret-color)}sh-table th .sh-resizer{width:.75rem;height:100%;position:absolute;top:0;right:-.375rem;cursor:col-resize;z-index:5}sh-table th .sh-resizer:after{content:\"\";position:absolute;top:.3125rem;bottom:.3125rem;border-radius:.125rem;right:.3125rem;width:.1875rem;background-color:var(--base-4);transition:width .15s ease,background-color .15s ease,right .15s ease}sh-table th .sh-resizer:hover:after{width:.3125rem;right:.1875rem;background-color:var(--primary-8)}sh-table th.resizing .sh-resizer:after{width:.3125rem;right:.1875rem;background-color:var(--primary-8)}sh-table td{display:flex;align-items:center;padding:var(--table-td-p);min-height:var(--table-td-mh);gap:var(--table-td-g);color:var(--table-td-c);font:var(--table-td-f);white-space:var(--table-ws);border-color:var(--table-bc);border-style:solid;border-width:var(--table-td-bw);background:var(--table-td-bg)}sh-table td+td.sticky-end:last-child{padding:var(--table-td-p)}sh-table th.sticky,sh-table th.sticky-end,sh-table td.sticky,sh-table td.sticky-end{position:sticky;overflow:hidden;right:auto;left:0;z-index:1;padding:var(--table-td-p)}sh-table th.sticky:first-child,sh-table th.sticky-end:first-child,sh-table td.sticky:first-child,sh-table td.sticky-end:first-child{padding:var(--table-th-p)}sh-table th.sticky-end,sh-table td.sticky-end{right:0;left:auto}sh-table th.sticky,sh-table th.sticky-end{background:var(--base-1);padding:var(--table-th-p);z-index:101}sh-table th.sticky:first-child,sh-table th.sticky-end:first-child{padding:var(--table-th-p)}sh-table [shStickyColumns]{display:grid;grid-template-columns:subgrid;position:sticky;left:0;z-index:1000;border:0;border-color:var(--table-bc);border-style:solid}sh-table [shStickyColumns] th{background-color:var(--base-1)}sh-table [shStickyColumns=end]{left:auto;right:0}sh-table .span-all{grid-column:1/-1;white-space:initial;align-items:flex-start;padding:0;border-left-width:0;position:sticky;left:0;width:100cqw;box-sizing:border-box}sh-table .no-rows{display:none;grid-column:1/-1}sh-table tbody:empty+.no-rows{display:block}\n"], dependencies: [{ kind: "component", type: ShipProgressBar, selector: "sh-progress-bar", inputs: ["value", "color", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
484
881
|
}
|
|
485
882
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ShipTable, decorators: [{
|
|
486
883
|
type: Component,
|
|
@@ -515,7 +912,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
515
912
|
</div>
|
|
516
913
|
}
|
|
517
914
|
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
518
|
-
role: '
|
|
915
|
+
'[attr.role]': 'role()',
|
|
519
916
|
'[attr.aria-busy]': 'loading()',
|
|
520
917
|
'[attr.aria-label]': 'ariaLabel()',
|
|
521
918
|
'[attr.aria-labelledby]': 'ariaLabelledby()',
|
|
@@ -529,10 +926,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
529
926
|
'[class.scrolled-x-end]': 'scrollXState() === 1',
|
|
530
927
|
'[class.scrolled-y]': 'scrollYState() >= 0',
|
|
531
928
|
'[class.scrolled-y-end]': 'scrollYState() === 1',
|
|
532
|
-
}, styles: ["sh-table{--table-bc: var(--base-4);--table-th-bg: var(--base-2);--table-tr-bg: var(--base-1);--table-td-bg: var(--base-1);--table-th-c: var(--base-8);--table-th-f: var(--paragraph-30);--table-td-c: var(--base-8);--table-td-f: var(--paragraph-30);--table-th-p: 0 1.25rem;--table-td-p: 0 1.25rem;--table-th-mh: 3rem;--table-td-mh: 4.875rem;--table-th-g: .25rem;--table-td-g: .5rem;--table-ws: nowrap;--table-th-bw: 0;--table-td-bw: .0625rem 0 0;--table-columns: 1fr 1fr 1fr max-content;--table-sticky-bw: .0625rem}sh-table.type-a tbody>th,sh-table.type-a tbody>td,sh-table.type-a thead>th,sh-table.type-a thead>td{padding-right:0}sh-table.type-a tbody>th:first-child,sh-table.type-a tbody>td:first-child,sh-table.type-a thead>th:first-child,sh-table.type-a thead>td:first-child{padding:0}sh-table.type-b{--table-th-p: 0 .75rem;--table-td-p: 0 .75rem;--table-th-mh: 2.25rem;--table-td-mh: 3.5rem;--table-th-bw: .0625rem 0 .0625rem .0625rem;--table-td-bw: 0 0 .0625rem .0625rem;--table-sticky-bw: .0625rem}sh-table.type-b th:first-child{border-left-width:0;padding:var(--table-th-p)}sh-table.type-b td:first-child{border-left-width:0;padding:var(--table-td-p)}sh-table.type-b td.sticky,sh-table.type-b th.sticky{border-left-width:0;border-right:var(--table-sticky-bw) solid var(--table-bc)}sh-table.type-b [shStickyColumns] th,sh-table.type-b [shStickyColumns] td{border-right:var(--table-sticky-bw) solid var(--table-bc)}sh-table.type-b th.sticky-end,sh-table.type-b td.sticky-end,sh-table.type-b [shStickyColumns=end] th,sh-table.type-b [shStickyColumns=end] td{border-left:var(--table-sticky-bw) solid var(--table-bc);border-right:0}sh-table.type-b .sticky+th,sh-table.type-b .sticky+td,sh-table.type-b [shStickyColumns]+th,sh-table.type-b [shStickyColumns]+td{border-left-width:0}sh-table.type-b tr:hover td{background-color:var(--base-2)}sh-table.type-b div[table-header] tr:first-child th{border-bottom:0}sh-table.type-b tbody tr:last-child td{border-bottom-width:0}sh-table.type-b .actionbar{background-color:var(--base-2);border-width:.0625rem 0 0}sh-table{width:100%;display:grid;overflow:auto;overscroll-behavior-x:none;grid-template-columns:var(--table-columns);position:relative;container-type:inline-size}sh-table.resizing{-webkit-user-select:none;user-select:none}sh-table:has([shTableResize]) td{overflow:auto}sh-table.no-resize .sh-resizer{display:none}sh-table.no-resize td{overflow:initial}sh-table .actionbar{display:flex;align-items:center;gap:.5rem;grid-column:1/-1;position:sticky;left:0;z-index:10;background-color:var(--base-1);width:100cqw;box-sizing:border-box;padding:.5rem;border:var(--border-10);border-width:.0625rem 0;opacity:1;transition:padding .3s ease-out,border-width .3s ease-out,opacity .3s ease-out;overflow:hidden}sh-table .actionbar:empty,sh-table .actionbar:not(:has(>:not(.actionbar-right))):has(>.actionbar-right:empty){display:none}sh-table .actionbar>*{min-height:0}sh-table .actionbar .actionbar-right{display:flex;align-items:center;gap:.5rem;margin-left:auto;flex-shrink:0}sh-table .actionbar .actionbar-right:empty{display:none}sh-table tbody{position:relative}sh-table tbody:has(tr.sticky){position:sticky;top:0;z-index:1}sh-table thead{position:relative}sh-table thead:has(tr.sticky){position:sticky;top:0;z-index:2}sh-table sh-progress-bar{grid-column:1/-1;position:absolute;top:100%;transform:translateY(-50%);z-index:200}sh-table tbody,sh-table thead,sh-table tr{display:grid;grid-column:1/-1;grid-template-columns:subgrid}sh-table tr{background:var(--table-tr-bg);position:relative;z-index:0}sh-table tr.sticky{position:sticky;top:0;z-index:1}sh-table tr.sticky-end{position:sticky;bottom:0;z-index:3}sh-table tr:has(th.sticky-end) th:nth-last-child(2){padding:var(--table-th-p)}sh-table tr:has(td.sticky-end) td:nth-last-child(2){padding:var(--table-td-p)}sh-table th{display:flex;align-items:center;padding:var(--table-th-p);min-height:var(--table-th-mh);font:var(--table-th-f);line-height:1em;white-space:var(--table-ws);color:var(--table-th-c);border:0;border-color:var(--table-bc);border-style:solid;border-width:var(--table-th-bw);background:var(--table-th-bg);gap:var(--table-th-g);z-index:auto}sh-table th:hover,sh-table th.resizing{z-index:
|
|
533
|
-
}], propDecorators: { loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], dataChange: [{ type: i0.Output, args: ["dataChange"] }], sortByColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortByColumn", required: false }] }, { type: i0.Output, args: ["sortByColumnChange"] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], content: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ShipTableContent), { isSignal: true }] }], theadLocal: [{ type: i0.ViewChild, args: ['theadLocal', { isSignal: true }] }], tbodyLocal: [{ type: i0.ViewChild, args: ['tbodyLocal', { isSignal: true }] }], onResize: [{
|
|
929
|
+
}, styles: ["sh-table{--table-bc: var(--base-4);--table-th-bg: var(--base-2);--table-tr-bg: var(--base-1);--table-td-bg: var(--base-1);--table-th-c: var(--base-8);--table-th-f: var(--paragraph-30);--table-td-c: var(--base-8);--table-td-f: var(--paragraph-30);--table-th-p: 0 1.25rem;--table-td-p: 0 1.25rem;--table-th-mh: 3rem;--table-td-mh: 4.875rem;--table-th-g: .25rem;--table-td-g: .5rem;--table-ws: nowrap;--table-th-bw: 0;--table-td-bw: .0625rem 0 0;--table-columns: 1fr 1fr 1fr max-content;--table-sticky-bw: .0625rem}sh-table.type-a tbody>th,sh-table.type-a tbody>td,sh-table.type-a thead>th,sh-table.type-a thead>td{padding-right:0}sh-table.type-a tbody>th:first-child,sh-table.type-a tbody>td:first-child,sh-table.type-a thead>th:first-child,sh-table.type-a thead>td:first-child{padding:0}sh-table.type-b{--table-th-p: 0 .75rem;--table-td-p: 0 .75rem;--table-th-mh: 2.25rem;--table-td-mh: 3.5rem;--table-th-bw: .0625rem 0 .0625rem .0625rem;--table-td-bw: 0 0 .0625rem .0625rem;--table-sticky-bw: .0625rem}sh-table.type-b th:first-child{border-left-width:0;padding:var(--table-th-p)}sh-table.type-b td:first-child{border-left-width:0;padding:var(--table-td-p)}sh-table.type-b td.sticky,sh-table.type-b th.sticky{border-left-width:0;border-right:var(--table-sticky-bw) solid var(--table-bc)}sh-table.type-b [shStickyColumns] th,sh-table.type-b [shStickyColumns] td{border-right:var(--table-sticky-bw) solid var(--table-bc)}sh-table.type-b th.sticky-end,sh-table.type-b td.sticky-end,sh-table.type-b [shStickyColumns=end] th,sh-table.type-b [shStickyColumns=end] td{border-left:var(--table-sticky-bw) solid var(--table-bc);border-right:0}sh-table.type-b .sticky+th,sh-table.type-b .sticky+td,sh-table.type-b [shStickyColumns]+th,sh-table.type-b [shStickyColumns]+td{border-left-width:0}sh-table.type-b tr:hover td{background-color:var(--base-2)}sh-table.type-b div[table-header] tr:first-child th{border-bottom:0}sh-table.type-b tbody tr:last-child td{border-bottom-width:0}sh-table.type-b .actionbar{background-color:var(--base-2);border-width:.0625rem 0 0}sh-table{width:100%;display:grid;overflow:auto;overscroll-behavior-x:none;grid-template-columns:var(--table-columns);position:relative;container-type:inline-size}sh-table.resizing{-webkit-user-select:none;user-select:none}sh-table:has([shTableResize]) td{overflow:auto}sh-table.no-resize .sh-resizer{display:none}sh-table.no-resize td{overflow:initial}sh-table .actionbar{display:flex;align-items:center;gap:.5rem;grid-column:1/-1;position:sticky;left:0;z-index:10;background-color:var(--base-1);width:100cqw;box-sizing:border-box;padding:.5rem;border:var(--border-10);border-width:.0625rem 0;opacity:1;transition:padding .3s ease-out,border-width .3s ease-out,opacity .3s ease-out;overflow:hidden}sh-table .actionbar:empty,sh-table .actionbar:not(:has(>:not(.actionbar-right))):has(>.actionbar-right:empty){display:none}sh-table .actionbar>*{min-height:0}sh-table .actionbar .actionbar-right{display:flex;align-items:center;gap:.5rem;margin-left:auto;flex-shrink:0}sh-table .actionbar .actionbar-right:empty{display:none}sh-table tbody{position:relative}sh-table tbody:has(tr.sticky){position:sticky;top:0;z-index:1}sh-table thead{position:relative}sh-table thead:has(tr.sticky){position:sticky;top:0;z-index:2}sh-table sh-progress-bar{grid-column:1/-1;position:absolute;top:100%;transform:translateY(-50%);z-index:200}sh-table tbody,sh-table thead,sh-table tr{display:grid;grid-column:1/-1;grid-template-columns:subgrid}sh-table tr{background:var(--table-tr-bg);position:relative;z-index:0}sh-table tr.sticky{position:sticky;top:0;z-index:1}sh-table tr.sticky-end{position:sticky;bottom:0;z-index:3}sh-table tr:has(th.sticky-end) th:nth-last-child(2){padding:var(--table-th-p)}sh-table tr:has(td.sticky-end) td:nth-last-child(2){padding:var(--table-td-p)}sh-table th{display:flex;align-items:center;padding:var(--table-th-p);min-height:var(--table-th-mh);font:var(--table-th-f);line-height:1em;white-space:var(--table-ws);color:var(--table-th-c);border:0;border-color:var(--table-bc);border-style:solid;border-width:var(--table-th-bw);background:var(--table-th-bg);gap:var(--table-th-g);z-index:auto}sh-table th:focus-visible{outline:.125rem solid var(--primary-8);outline-offset:-.125rem}sh-table th:hover,sh-table th.resizing{z-index:10}sh-table th:has(.sh-resizer){position:relative;z-index:2}sh-table th.sortable{--caret-color: var(--base-10);--caret-size: .375rem;cursor:pointer;-webkit-user-select:none;user-select:none}sh-table th.sortable sh-icon{opacity:.35;transition:opacity 125ms ease-in-out}sh-table th.sortable:hover sh-icon{opacity:.7}sh-table th.sortable.sort-asc sh-icon,sh-table th.sortable.sort-desc sh-icon{opacity:1}sh-table th.sortable:not(:has(sh-icon)):after{content:\"\";border:var(--caret-size) solid transparent;width:0;height:0;opacity:0;transition:opacity 125ms ease-in-out}sh-table th.sortable:not(:has(sh-icon)).sort-desc:after{opacity:1;transform:translateY(-4px);border-bottom-color:var(--caret-color)}sh-table th.sortable:not(:has(sh-icon)).sort-asc:after{opacity:1;transform:translateY(4px);border-top-color:var(--caret-color)}sh-table th .sh-resizer{width:.75rem;height:100%;position:absolute;top:0;right:-.375rem;cursor:col-resize;z-index:5}sh-table th .sh-resizer:after{content:\"\";position:absolute;top:.3125rem;bottom:.3125rem;border-radius:.125rem;right:.3125rem;width:.1875rem;background-color:var(--base-4);transition:width .15s ease,background-color .15s ease,right .15s ease}sh-table th .sh-resizer:hover:after{width:.3125rem;right:.1875rem;background-color:var(--primary-8)}sh-table th.resizing .sh-resizer:after{width:.3125rem;right:.1875rem;background-color:var(--primary-8)}sh-table td{display:flex;align-items:center;padding:var(--table-td-p);min-height:var(--table-td-mh);gap:var(--table-td-g);color:var(--table-td-c);font:var(--table-td-f);white-space:var(--table-ws);border-color:var(--table-bc);border-style:solid;border-width:var(--table-td-bw);background:var(--table-td-bg)}sh-table td+td.sticky-end:last-child{padding:var(--table-td-p)}sh-table th.sticky,sh-table th.sticky-end,sh-table td.sticky,sh-table td.sticky-end{position:sticky;overflow:hidden;right:auto;left:0;z-index:1;padding:var(--table-td-p)}sh-table th.sticky:first-child,sh-table th.sticky-end:first-child,sh-table td.sticky:first-child,sh-table td.sticky-end:first-child{padding:var(--table-th-p)}sh-table th.sticky-end,sh-table td.sticky-end{right:0;left:auto}sh-table th.sticky,sh-table th.sticky-end{background:var(--base-1);padding:var(--table-th-p);z-index:101}sh-table th.sticky:first-child,sh-table th.sticky-end:first-child{padding:var(--table-th-p)}sh-table [shStickyColumns]{display:grid;grid-template-columns:subgrid;position:sticky;left:0;z-index:1000;border:0;border-color:var(--table-bc);border-style:solid}sh-table [shStickyColumns] th{background-color:var(--base-1)}sh-table [shStickyColumns=end]{left:auto;right:0}sh-table .span-all{grid-column:1/-1;white-space:initial;align-items:flex-start;padding:0;border-left-width:0;position:sticky;left:0;width:100cqw;box-sizing:border-box}sh-table .no-rows{display:none;grid-column:1/-1}sh-table tbody:empty+.no-rows{display:block}\n"] }]
|
|
930
|
+
}], propDecorators: { grid: [{ type: i0.Input, args: [{ isSignal: true, alias: "grid", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], dataChange: [{ type: i0.Output, args: ["dataChange"] }], sortByColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortByColumn", required: false }] }, { type: i0.Output, args: ["sortByColumnChange"] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], content: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ShipTableContent), { isSignal: true }] }], theadLocal: [{ type: i0.ViewChild, args: ['theadLocal', { isSignal: true }] }], tbodyLocal: [{ type: i0.ViewChild, args: ['tbodyLocal', { isSignal: true }] }], onResize: [{
|
|
534
931
|
type: HostListener,
|
|
535
932
|
args: ['window:resize', ['$event']]
|
|
933
|
+
}], onFocusIn: [{
|
|
934
|
+
type: HostListener,
|
|
935
|
+
args: ['focusin', ['$event']]
|
|
936
|
+
}], onGridKeyDown: [{
|
|
937
|
+
type: HostListener,
|
|
938
|
+
args: ['keydown', ['$event']]
|
|
536
939
|
}] } });
|
|
537
940
|
class ShipTableContent {
|
|
538
941
|
constructor() {
|
|
@@ -542,6 +945,7 @@ class ShipTableContent {
|
|
|
542
945
|
this.data = input([], /* @ts-ignore */
|
|
543
946
|
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
544
947
|
this.sortByColumn = this.#table.sortByColumn;
|
|
948
|
+
this.grid = this.#table.grid;
|
|
545
949
|
this.thead = viewChild('thead', /* @ts-ignore */
|
|
546
950
|
...(ngDevMode ? [{ debugName: "thead" }] : /* istanbul ignore next */ []));
|
|
547
951
|
this.tbody = viewChild('tbody', /* @ts-ignore */
|
|
@@ -607,7 +1011,7 @@ class ShipTableContent {
|
|
|
607
1011
|
[class.sticky-end]="col.sticky === 'end'"
|
|
608
1012
|
[id]="col.id + '-' + rowIndex"
|
|
609
1013
|
[attr.aria-labelledby]="col.id + ' ' + col.id + '-' + rowIndex"
|
|
610
|
-
[attr.role]="col.rowHeader ? 'rowheader' : 'cell'">
|
|
1014
|
+
[attr.role]="col.rowHeader ? 'rowheader' : grid() ? 'gridcell' : 'cell'">
|
|
611
1015
|
@if (col.cellTemplate) {
|
|
612
1016
|
<ng-container
|
|
613
1017
|
[ngTemplateOutlet]="col.cellTemplate"
|
|
@@ -693,7 +1097,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
693
1097
|
[class.sticky-end]="col.sticky === 'end'"
|
|
694
1098
|
[id]="col.id + '-' + rowIndex"
|
|
695
1099
|
[attr.aria-labelledby]="col.id + ' ' + col.id + '-' + rowIndex"
|
|
696
|
-
[attr.role]="col.rowHeader ? 'rowheader' : 'cell'">
|
|
1100
|
+
[attr.role]="col.rowHeader ? 'rowheader' : grid() ? 'gridcell' : 'cell'">
|
|
697
1101
|
@if (col.cellTemplate) {
|
|
698
1102
|
<ng-container
|
|
699
1103
|
[ngTemplateOutlet]="col.cellTemplate"
|