@ship-ui/core 0.22.15 → 0.22.17

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