@hashicorp/design-system-components 4.23.1 → 4.24.0-rc-20250923215537

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 (83) hide show
  1. package/declarations/components/hds/advanced-table/index.d.ts +13 -3
  2. package/declarations/components/hds/advanced-table/models/column.d.ts +9 -2
  3. package/declarations/components/hds/advanced-table/models/row.d.ts +5 -1
  4. package/declarations/components/hds/advanced-table/models/table.d.ts +13 -2
  5. package/declarations/components/hds/advanced-table/td.d.ts +1 -1
  6. package/declarations/components/hds/advanced-table/th-context-menu.d.ts +16 -7
  7. package/declarations/components/hds/advanced-table/th-reorder-drop-target.d.ts +32 -0
  8. package/declarations/components/hds/advanced-table/th-reorder-handle.d.ts +24 -0
  9. package/declarations/components/hds/advanced-table/th-resize-handle.d.ts +2 -1
  10. package/declarations/components/hds/advanced-table/th-sort.d.ts +11 -3
  11. package/declarations/components/hds/advanced-table/th.d.ts +11 -4
  12. package/declarations/components/hds/advanced-table/tr.d.ts +7 -1
  13. package/declarations/components/hds/advanced-table/types.d.ts +15 -0
  14. package/declarations/components/hds/advanced-table/utils.d.ts +5 -0
  15. package/declarations/components/hds/dropdown/toggle/icon.d.ts +1 -1
  16. package/declarations/components/hds/flyout/index.d.ts +4 -1
  17. package/declarations/components/hds/form/index.d.ts +1 -1
  18. package/declarations/components/hds/form/key-value-inputs/index.d.ts +4 -4
  19. package/declarations/components/hds/form/radio-card/index.d.ts +2 -2
  20. package/declarations/components/hds/modal/index.d.ts +4 -2
  21. package/declarations/components/hds/popover-primitive/index.d.ts +3 -0
  22. package/declarations/components/hds/separator/index.d.ts +1 -1
  23. package/declarations/components/hds/stepper/list/step.d.ts +1 -1
  24. package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
  25. package/declarations/components/hds/table/index.d.ts +5 -5
  26. package/declarations/components/hds/table/td.d.ts +1 -1
  27. package/declarations/components/hds/table/th-sort.d.ts +1 -1
  28. package/declarations/components/hds/table/th.d.ts +1 -1
  29. package/declarations/template-registry.d.ts +6 -0
  30. package/dist/_app_/components/hds/advanced-table/th-reorder-drop-target.js +1 -0
  31. package/dist/_app_/components/hds/advanced-table/th-reorder-handle.js +1 -0
  32. package/dist/_app_/components/hds/advanced-table/utils.js +1 -0
  33. package/dist/components/hds/advanced-table/index.js +77 -17
  34. package/dist/components/hds/advanced-table/index.js.map +1 -1
  35. package/dist/components/hds/advanced-table/models/column.js +58 -13
  36. package/dist/components/hds/advanced-table/models/column.js.map +1 -1
  37. package/dist/components/hds/advanced-table/models/row.js +38 -3
  38. package/dist/components/hds/advanced-table/models/row.js.map +1 -1
  39. package/dist/components/hds/advanced-table/models/table.js +146 -2
  40. package/dist/components/hds/advanced-table/models/table.js.map +1 -1
  41. package/dist/components/hds/advanced-table/td.js.map +1 -1
  42. package/dist/components/hds/advanced-table/th-context-menu.js +124 -50
  43. package/dist/components/hds/advanced-table/th-context-menu.js.map +1 -1
  44. package/dist/components/hds/advanced-table/th-reorder-drop-target.js +133 -0
  45. package/dist/components/hds/advanced-table/th-reorder-drop-target.js.map +1 -0
  46. package/dist/components/hds/advanced-table/th-reorder-handle.js +104 -0
  47. package/dist/components/hds/advanced-table/th-reorder-handle.js.map +1 -0
  48. package/dist/components/hds/advanced-table/th-resize-handle.js +44 -21
  49. package/dist/components/hds/advanced-table/th-resize-handle.js.map +1 -1
  50. package/dist/components/hds/advanced-table/th-sort.js +20 -8
  51. package/dist/components/hds/advanced-table/th-sort.js.map +1 -1
  52. package/dist/components/hds/advanced-table/th.js +19 -7
  53. package/dist/components/hds/advanced-table/th.js.map +1 -1
  54. package/dist/components/hds/advanced-table/tr.js +1 -1
  55. package/dist/components/hds/advanced-table/tr.js.map +1 -1
  56. package/dist/components/hds/advanced-table/types.js +6 -1
  57. package/dist/components/hds/advanced-table/types.js.map +1 -1
  58. package/dist/components/hds/advanced-table/utils.js +23 -0
  59. package/dist/components/hds/advanced-table/utils.js.map +1 -0
  60. package/dist/components/hds/dropdown/toggle/icon.js.map +1 -1
  61. package/dist/components/hds/flyout/index.js +29 -6
  62. package/dist/components/hds/flyout/index.js.map +1 -1
  63. package/dist/components/hds/form/index.js.map +1 -1
  64. package/dist/components/hds/form/key-value-inputs/index.js.map +1 -1
  65. package/dist/components/hds/form/radio-card/index.js.map +1 -1
  66. package/dist/components/hds/modal/index.js +51 -37
  67. package/dist/components/hds/modal/index.js.map +1 -1
  68. package/dist/components/hds/popover-primitive/index.js +51 -35
  69. package/dist/components/hds/popover-primitive/index.js.map +1 -1
  70. package/dist/components/hds/separator/index.js.map +1 -1
  71. package/dist/components/hds/stepper/list/step.js.map +1 -1
  72. package/dist/components/hds/table/index.js.map +1 -1
  73. package/dist/components/hds/table/td.js.map +1 -1
  74. package/dist/components/hds/table/th-sort.js.map +1 -1
  75. package/dist/components/hds/table/th.js.map +1 -1
  76. package/dist/components.js +1 -1
  77. package/dist/styles/@hashicorp/design-system-components.css +196 -62
  78. package/dist/styles/components/advanced-table.scss +155 -6
  79. package/dist/styles/mixins/_focus-ring.scss +43 -0
  80. package/package.json +5 -2
  81. package/translations/hds/components/advanced-table/en-us.yaml +1 -0
  82. package/translations/hds/components/advanced-table/th-context-menu/en-us.yaml +3 -0
  83. package/translations/hds/components/advanced-table/th-reorder-handle/en-us.yaml +2 -0
@@ -3,39 +3,45 @@
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
  import Component from '@glimmer/component';
6
- import type { WithBoundArgs } from '@glint/template';
7
6
  import type Owner from '@ember/owner';
7
+ import type { WithBoundArgs } from '@glint/template';
8
8
  import { HdsAdvancedTableDensityValues, HdsAdvancedTableVerticalAlignmentValues } from './types.ts';
9
- import type { HdsAdvancedTableColumn, HdsAdvancedTableDensities, HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableOnSelectionChangeSignature, HdsAdvancedTableThSortOrder, HdsAdvancedTableVerticalAlignment, HdsAdvancedTableModel, HdsAdvancedTableExpandState } from './types.ts';
9
+ import type { HdsAdvancedTableColumn, HdsAdvancedTableDensities, HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableOnSelectionChangeSignature, HdsAdvancedTableThSortOrder, HdsAdvancedTableVerticalAlignment, HdsAdvancedTableModel, HdsAdvancedTableExpandState, HdsAdvancedTableColumnReorderCallback } from './types.ts';
10
10
  import type { HdsFormCheckboxBaseSignature } from '../form/checkbox/base.ts';
11
11
  import type HdsAdvancedTableTd from './td.ts';
12
12
  import type HdsAdvancedTableTh from './th.ts';
13
13
  import type HdsAdvancedTableTr from './tr.ts';
14
+ import type HdsIntlService from '../../../services/hds-intl.ts';
14
15
  export declare const DENSITIES: HdsAdvancedTableDensities[];
15
16
  export declare const DEFAULT_DENSITY = HdsAdvancedTableDensityValues.Medium;
16
17
  export declare const VALIGNMENTS: HdsAdvancedTableVerticalAlignment[];
17
18
  export declare const DEFAULT_VALIGN = HdsAdvancedTableVerticalAlignmentValues.Top;
19
+ export declare const BORDER_WIDTH = 1;
18
20
  export interface HdsAdvancedTableSignature {
19
21
  Args: {
20
22
  align?: HdsAdvancedTableHorizontalAlignment;
21
23
  caption?: string;
22
24
  columns: HdsAdvancedTableColumn[];
25
+ columnOrder?: string[];
23
26
  density?: HdsAdvancedTableDensities;
24
27
  identityKey?: string;
25
28
  isSelectable?: boolean;
26
29
  isStriped?: boolean;
27
30
  model: HdsAdvancedTableModel;
31
+ reorderedMessageText?: string;
28
32
  selectionAriaLabelSuffix?: string;
29
33
  sortBy?: string;
30
34
  selectableColumnKey?: string;
31
35
  sortedMessageText?: string;
32
36
  sortOrder?: HdsAdvancedTableThSortOrder;
33
37
  valign?: HdsAdvancedTableVerticalAlignment;
38
+ hasReorderableColumns?: boolean;
34
39
  hasResizableColumns?: boolean;
35
40
  hasStickyHeader?: boolean;
36
41
  hasStickyFirstColumn?: boolean;
37
42
  childrenKey?: string;
38
43
  maxHeight?: string;
44
+ onColumnReorder?: HdsAdvancedTableColumnReorderCallback;
39
45
  onColumnResize?: (columnKey: string, newWidth?: string) => void;
40
46
  onSelectionChange?: (selection: HdsAdvancedTableOnSelectionChangeSignature) => void;
41
47
  onSort?: (sortBy: string, sortOrder: HdsAdvancedTableThSortOrder) => void;
@@ -55,6 +61,7 @@ export interface HdsAdvancedTableSignature {
55
61
  Element: HTMLDivElement;
56
62
  }
57
63
  export default class HdsAdvancedTable extends Component<HdsAdvancedTableSignature> {
64
+ hdsIntl: HdsIntlService;
58
65
  private _selectAllCheckbox?;
59
66
  private _isSelectAllCheckboxSelected?;
60
67
  private _tableHeight;
@@ -70,12 +77,12 @@ export default class HdsAdvancedTable extends Component<HdsAdvancedTableSignatur
70
77
  height: string;
71
78
  left: string;
72
79
  right: string;
73
- top: string;
74
80
  width: string;
75
81
  };
76
82
  isStickyColumnPinned: boolean;
77
83
  isStickyHeaderPinned: boolean;
78
84
  hasPinnedFirstColumn: boolean | undefined;
85
+ reorderedMessageText: string;
79
86
  showScrollIndicatorLeft: boolean;
80
87
  showScrollIndicatorRight: boolean;
81
88
  showScrollIndicatorTop: boolean;
@@ -98,9 +105,12 @@ export default class HdsAdvancedTable extends Component<HdsAdvancedTableSignatur
98
105
  private _registerGridElement;
99
106
  private _registerThElement;
100
107
  private _setUpScrollWrapper;
108
+ private _runAssertions;
101
109
  private _setUpThead;
110
+ private _onColumnReorder;
102
111
  onSelectionChangeCallback(checkbox?: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string): void;
103
112
  setupTableModelData(): void;
113
+ updateTableModelColumnOrder(): void;
104
114
  onSelectionAllChange(): void;
105
115
  onSelectionRowChange(checkbox?: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string): void;
106
116
  didInsertSelectAllCheckbox(checkbox: HdsFormCheckboxBaseSignature['Element']): void;
@@ -2,28 +2,34 @@
2
2
  * Copyright (c) HashiCorp, Inc.
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
+ import type { HdsAdvancedTableThReorderHandleSignature } from '../th-reorder-handle.ts';
5
6
  import type HdsAdvancedTableModel from './table.ts';
6
- import type { HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableColumn as HdsAdvancedTableColumnType } from '../types';
7
+ import type { HdsDropdownToggleButtonSignature } from '../../dropdown/toggle/button.ts';
8
+ import type { HdsAdvancedTableCell, HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableColumn as HdsAdvancedTableColumnType } from '../types';
7
9
  export declare const DEFAULT_WIDTH = "1fr";
8
10
  export declare const DEFAULT_MIN_WIDTH = "150px";
9
11
  export declare const DEFAULT_MAX_WIDTH = "800px";
10
12
  export default class HdsAdvancedTableColumn {
11
13
  label: string;
12
14
  align?: HdsAdvancedTableHorizontalAlignment;
15
+ isBeingDragged: boolean;
13
16
  isExpandable?: boolean;
14
17
  isSortable?: boolean;
15
18
  isVisuallyHidden?: boolean;
16
19
  key: string;
17
20
  tooltip?: string;
21
+ sortingFunction?: (a: unknown, b: unknown) => number;
18
22
  thElement?: HTMLDivElement;
23
+ reorderHandleElement?: HdsAdvancedTableThReorderHandleSignature['Element'];
24
+ thContextMenuToggleElement?: HdsDropdownToggleButtonSignature['Element'];
19
25
  transientWidth?: `${number}px`;
20
26
  width: string;
21
27
  minWidth: `${number}px`;
22
28
  maxWidth: `${number}px`;
23
29
  originalWidth: string;
24
30
  widthDebts: Record<string, number>;
25
- sortingFunction?: (a: unknown, b: unknown) => number;
26
31
  table: HdsAdvancedTableModel;
32
+ get cells(): HdsAdvancedTableCell[];
27
33
  get appliedWidth(): string;
28
34
  get pxAppliedWidth(): number | undefined;
29
35
  get pxTransientWidth(): number | undefined;
@@ -48,6 +54,7 @@ export default class HdsAdvancedTableColumn {
48
54
  private payWidthDebts;
49
55
  private settleWidthDebts;
50
56
  private _setWidthValues;
57
+ focusReorderHandle(): void;
51
58
  setPxTransientWidth(newPxWidth: number): void;
52
59
  restoreWidth(): void;
53
60
  }
@@ -2,21 +2,25 @@
2
2
  * Copyright (c) HashiCorp, Inc.
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
- import type { HdsAdvancedTableColumn } from '../types';
5
+ import type { HdsAdvancedTableColumn, HdsAdvancedTableCell } from '../types';
6
6
  interface HdsAdvancedTableRowArgs {
7
7
  [key: string]: unknown;
8
8
  columns: HdsAdvancedTableColumn[];
9
9
  id?: string;
10
10
  childrenKey?: string;
11
+ columnOrder?: string[];
11
12
  }
12
13
  export default class HdsAdvancedTableRow {
13
14
  id: string;
14
15
  [key: string]: unknown;
15
16
  isOpen: boolean;
17
+ cells: HdsAdvancedTableCell[];
18
+ columnOrder: string[];
16
19
  children: HdsAdvancedTableRow[];
17
20
  childrenKey: string;
18
21
  get hasChildren(): boolean;
19
22
  get showChildren(): boolean;
23
+ get orderedCells(): HdsAdvancedTableCell[];
20
24
  constructor(args: HdsAdvancedTableRowArgs);
21
25
  openAll(): void;
22
26
  collapseAll(): void;
@@ -5,18 +5,25 @@
5
5
  import HdsAdvancedTableRow from './row.ts';
6
6
  import HdsAdvancedTableColumn from './column.ts';
7
7
  import type { HdsAdvancedTableSignature } from '../index.ts';
8
- import type { HdsAdvancedTableExpandState, HdsAdvancedTableSortingFunction } from '../types';
9
- type HdsAdvancedTableTableArgs = Pick<HdsAdvancedTableSignature['Args'], 'model' | 'columns' | 'childrenKey' | 'hasResizableColumns' | 'sortBy' | 'sortOrder' | 'onSort'>;
8
+ import type { HdsAdvancedTableExpandState, HdsAdvancedTableCell, HdsAdvancedTableColumnReorderCallback, HdsAdvancedTableColumnReorderSide, HdsAdvancedTableSortingFunction } from '../types';
9
+ type HdsAdvancedTableTableArgs = Pick<HdsAdvancedTableSignature['Args'], 'model' | 'columns' | 'columnOrder' | 'childrenKey' | 'hasResizableColumns' | 'sortBy' | 'sortOrder' | 'onSort' | 'onColumnReorder' | 'onColumnResize'>;
10
10
  export default class HdsAdvancedTableTableModel {
11
11
  columns: HdsAdvancedTableColumn[];
12
+ columnOrder: string[];
13
+ reorderDraggedColumn: HdsAdvancedTableColumn | null;
14
+ reorderHoveredColumn: HdsAdvancedTableColumn | null;
12
15
  rows: HdsAdvancedTableRow[];
13
16
  sortBy: HdsAdvancedTableTableArgs['sortBy'];
14
17
  sortOrder: HdsAdvancedTableTableArgs['sortOrder'];
15
18
  gridElement?: HTMLDivElement;
16
19
  childrenKey?: HdsAdvancedTableTableArgs['childrenKey'];
17
20
  hasResizableColumns?: HdsAdvancedTableTableArgs['hasResizableColumns'];
21
+ onColumnReorder?: HdsAdvancedTableColumnReorderCallback;
18
22
  onSort?: HdsAdvancedTableSignature['Args']['onSort'];
19
23
  constructor(args: HdsAdvancedTableTableArgs);
24
+ get hasColumnBeingDragged(): boolean;
25
+ get reorderDraggedColumnCells(): HdsAdvancedTableCell[];
26
+ get orderedColumns(): HdsAdvancedTableColumn[];
20
27
  get sortCriteria(): string | HdsAdvancedTableSortingFunction<unknown>;
21
28
  get sortedRows(): HdsAdvancedTableRow[];
22
29
  get totalRowCount(): number;
@@ -36,5 +43,9 @@ export default class HdsAdvancedTableTableModel {
36
43
  openAll(): void;
37
44
  collapseAll(): void;
38
45
  toggleAll(): void;
46
+ stepColumn(column: HdsAdvancedTableColumn, step: number): void;
47
+ moveColumnToTerminalPosition(column: HdsAdvancedTableColumn, position: 'start' | 'end'): void;
48
+ moveColumnToTarget(sourceColumn: HdsAdvancedTableColumn, targetColumn: HdsAdvancedTableColumn, side: HdsAdvancedTableColumnReorderSide): void;
49
+ moveColumnToDropTarget(targetColumn: HdsAdvancedTableColumn, side: HdsAdvancedTableColumnReorderSide): void;
39
50
  }
40
51
  export {};
@@ -6,7 +6,7 @@ import Component from '@glimmer/component';
6
6
  import { type FocusableElement } from 'tabbable';
7
7
  import type { HdsAdvancedTableHorizontalAlignment } from './types.ts';
8
8
  import { HdsAdvancedTableHorizontalAlignmentValues } from './types.ts';
9
- export declare const ALIGNMENTS: string[];
9
+ export declare const ALIGNMENTS: HdsAdvancedTableHorizontalAlignment[];
10
10
  export declare const DEFAULT_ALIGN = HdsAdvancedTableHorizontalAlignmentValues.Left;
11
11
  export interface HdsAdvancedTableTdSignature {
12
12
  Args: {
@@ -7,19 +7,22 @@ import type HdsAdvancedTableColumn from './models/column.ts';
7
7
  import type { HdsDropdownSignature } from '../dropdown/index.ts';
8
8
  import type { HdsDropdownToggleIconSignature } from '../dropdown/toggle/icon.ts';
9
9
  import type { HdsAdvancedTableSignature } from './index.ts';
10
+ import type { HdsAdvancedTableThReorderHandleSignature } from './th-reorder-handle.ts';
10
11
  import type { HdsAdvancedTableThResizeHandleSignature } from './th-resize-handle.ts';
11
12
  import type HdsIntlService from '../../../services/hds-intl.ts';
12
13
  interface HdsAdvancedTableThContextMenuOption {
13
14
  key: string;
14
- label: string;
15
- icon: HdsDropdownToggleIconSignature['Args']['icon'];
16
- action: (column: HdsAdvancedTableColumn, dropdownCloseCallback: () => void) => void;
15
+ icon?: HdsDropdownToggleIconSignature['Args']['icon'];
16
+ label?: string;
17
+ action?: (dropdownCloseCallback: () => void) => void;
17
18
  }
18
19
  export interface HdsAdvancedTableThContextMenuSignature {
19
20
  Args: {
20
21
  column: HdsAdvancedTableColumn;
21
- isStickyColumn?: boolean;
22
22
  hasResizableColumns?: boolean;
23
+ hasReorderableColumns?: boolean;
24
+ isStickyColumn?: boolean;
25
+ reorderHandleElement?: HdsAdvancedTableThReorderHandleSignature['Element'];
23
26
  resizeHandleElement?: HdsAdvancedTableThResizeHandleSignature['Element'];
24
27
  onColumnResize?: HdsAdvancedTableSignature['Args']['onColumnResize'];
25
28
  onPinFirstColumn?: () => void;
@@ -29,9 +32,15 @@ export interface HdsAdvancedTableThContextMenuSignature {
29
32
  export default class HdsAdvancedTableThContextMenu extends Component<HdsAdvancedTableThContextMenuSignature> {
30
33
  hdsIntl: HdsIntlService;
31
34
  private _element;
35
+ get _resizeOptions(): HdsAdvancedTableThContextMenuOption[];
36
+ get _reorderOptions(): HdsAdvancedTableThContextMenuOption[];
37
+ get _stickyColumnOptions(): HdsAdvancedTableThContextMenuOption[];
32
38
  get _options(): HdsAdvancedTableThContextMenuOption[];
33
- resizeColumn(): void;
34
- resetColumnWidth(column: HdsAdvancedTableColumn, dropdownCloseCallback: () => void): void;
35
- pinFirstColumn(column: HdsAdvancedTableColumn, dropdownCloseCallback: () => void): void;
39
+ private _registerDropdownToggleElement;
40
+ private _resizeColumn;
41
+ private _resetColumnWidth;
42
+ private _moveColumn;
43
+ private _moveColumnToPosition;
44
+ private _pinFirstColumn;
36
45
  }
37
46
  export {};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+ import Component from '@glimmer/component';
6
+ import type HdsAdvancedTableColumn from './models/column.ts';
7
+ import type { HdsAdvancedTableColumnReorderSide } from './types.ts';
8
+ import type { HdsAdvancedTableSignature } from './index.ts';
9
+ export interface HdsAdvancedTableThReorderDropTargetSignature {
10
+ Args: {
11
+ column: HdsAdvancedTableColumn;
12
+ hasSelectableRows?: HdsAdvancedTableSignature['Args']['isSelectable'];
13
+ tableHeight?: number;
14
+ onReorderDrop?: (column: HdsAdvancedTableColumn, side: HdsAdvancedTableColumnReorderSide) => void;
15
+ };
16
+ Blocks: {
17
+ default?: [];
18
+ };
19
+ Element: HTMLDivElement;
20
+ }
21
+ export default class HdsAdvancedTableThReorderDropTarget extends Component<HdsAdvancedTableThReorderDropTargetSignature> {
22
+ private _dragSide;
23
+ private _isUpdateQueued;
24
+ private _element;
25
+ private _registerElement;
26
+ private _getDragSide;
27
+ get isDraggingOver(): boolean;
28
+ get classNames(): string;
29
+ get height(): string | undefined;
30
+ handleDragOver(event: DragEvent): void;
31
+ handleDrop(event: DragEvent): void;
32
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+ import Component from '@glimmer/component';
6
+ import type HdsAdvancedTableColumn from './models/column.ts';
7
+ export interface HdsAdvancedTableThReorderHandleSignature {
8
+ Args: {
9
+ column: HdsAdvancedTableColumn;
10
+ tableHeight?: number;
11
+ onReorderDragStart: (column: HdsAdvancedTableColumn) => void;
12
+ onReorderDragEnd?: () => void;
13
+ };
14
+ Blocks: {
15
+ default?: [];
16
+ };
17
+ Element: HTMLDivElement;
18
+ }
19
+ export default class HdsAdvancedTableThReorderHandle extends Component<HdsAdvancedTableThReorderHandleSignature> {
20
+ private _registerElement;
21
+ handleDragStart(event: DragEvent): void;
22
+ handleDragEnd(): void;
23
+ handleKeydown(event: KeyboardEvent): void;
24
+ }
@@ -8,7 +8,6 @@ import type { HdsAdvancedTableSignature } from './index.ts';
8
8
  export interface HdsAdvancedTableThResizeHandleSignature {
9
9
  Args: {
10
10
  column: HdsAdvancedTableColumn;
11
- hasResizableColumns: HdsAdvancedTableSignature['Args']['hasResizableColumns'];
12
11
  tableHeight?: number;
13
12
  onColumnResize?: HdsAdvancedTableSignature['Args']['onColumnResize'];
14
13
  };
@@ -24,6 +23,8 @@ export default class HdsAdvancedTableThResizeHandle extends Component<HdsAdvance
24
23
  startNextColumnPxWidth?: number;
25
24
  } | null;
26
25
  private _transientDelta;
26
+ private _isUpdateQueued;
27
+ private _lastPointerEvent;
27
28
  private _handleElement;
28
29
  private _boundResize;
29
30
  private _boundStopResize;
@@ -6,17 +6,20 @@ import Component from '@glimmer/component';
6
6
  import { type FocusableElement } from 'tabbable';
7
7
  import type Owner from '@ember/owner';
8
8
  import { HdsAdvancedTableHorizontalAlignmentValues } from './types.ts';
9
- import type { HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableThSortOrder, HdsAdvancedTableThSortOrderLabels } from './types.ts';
9
+ import type { HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableThSortOrder, HdsAdvancedTableThSortOrderLabels, HdsAdvancedTableColumnReorderSide } from './types.ts';
10
10
  import type { HdsAdvancedTableThButtonSortSignature } from './th-button-sort.ts';
11
11
  import type { HdsAdvancedTableThSignature } from './th.ts';
12
12
  import type { HdsAdvancedTableSignature } from './index.ts';
13
- export declare const ALIGNMENTS: string[];
13
+ import type HdsAdvancedTableColumn from './models/column.ts';
14
+ export declare const ALIGNMENTS: HdsAdvancedTableHorizontalAlignment[];
14
15
  export declare const DEFAULT_ALIGN = HdsAdvancedTableHorizontalAlignmentValues.Left;
15
16
  export interface HdsAdvancedTableThSortSignature {
16
17
  Args: {
17
18
  column?: HdsAdvancedTableThSignature['Args']['column'];
18
19
  align?: HdsAdvancedTableHorizontalAlignment;
20
+ hasReorderableColumns?: HdsAdvancedTableSignature['Args']['hasReorderableColumns'];
19
21
  hasResizableColumns?: HdsAdvancedTableSignature['Args']['hasResizableColumns'];
22
+ hasSelectableRows?: HdsAdvancedTableSignature['Args']['isSelectable'];
20
23
  onClickSort?: HdsAdvancedTableThButtonSortSignature['Args']['onClick'];
21
24
  sortOrder?: HdsAdvancedTableThSortOrder;
22
25
  tooltip?: string;
@@ -27,6 +30,9 @@ export interface HdsAdvancedTableThSortSignature {
27
30
  isStickyColumnPinned?: boolean;
28
31
  onColumnResize?: HdsAdvancedTableSignature['Args']['onColumnResize'];
29
32
  onPinFirstColumn?: () => void;
33
+ onReorderDragEnd?: () => void;
34
+ onReorderDragStart?: (column: HdsAdvancedTableColumn) => void;
35
+ onReorderDrop?: (column: HdsAdvancedTableColumn, side: HdsAdvancedTableColumnReorderSide) => void;
30
36
  };
31
37
  Blocks: {
32
38
  default?: [];
@@ -37,15 +43,17 @@ export default class HdsAdvancedTableThSort extends Component<HdsAdvancedTableTh
37
43
  private _labelId;
38
44
  private _element;
39
45
  private _shouldTrapFocus;
46
+ private _reorderHandleElement?;
40
47
  private _resizeHandleElement?;
41
48
  constructor(owner: Owner, args: HdsAdvancedTableThSortSignature['Args']);
42
49
  get ariaSort(): HdsAdvancedTableThSortOrderLabels;
43
50
  get align(): HdsAdvancedTableHorizontalAlignment;
44
- get showContextMenu(): boolean;
45
51
  get classNames(): string;
52
+ handleDragStart(column: HdsAdvancedTableColumn): void;
46
53
  onFocusTrapDeactivate(): void;
47
54
  enableFocusTrap(): void;
48
55
  getInitialFocus(): FocusableElement | undefined;
49
56
  setElement(element: HTMLDivElement): void;
57
+ private _registerReorderHandleElement;
50
58
  private _registerResizeHandleElement;
51
59
  }
@@ -7,9 +7,9 @@ import { type FocusableElement } from 'tabbable';
7
7
  import HdsAdvancedTableColumn from './models/column.ts';
8
8
  import { HdsAdvancedTableHorizontalAlignmentValues } from './types.ts';
9
9
  import type Owner from '@ember/owner';
10
- import type { HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableScope, HdsAdvancedTableExpandState } from './types.ts';
10
+ import type { HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableScope, HdsAdvancedTableExpandState, HdsAdvancedTableColumnReorderSide } from './types.ts';
11
11
  import type { HdsAdvancedTableSignature } from './index.ts';
12
- export declare const ALIGNMENTS: string[];
12
+ export declare const ALIGNMENTS: HdsAdvancedTableHorizontalAlignment[];
13
13
  export declare const DEFAULT_ALIGN = HdsAdvancedTableHorizontalAlignmentValues.Left;
14
14
  export interface HdsAdvancedTableThSignature {
15
15
  Args: {
@@ -18,7 +18,9 @@ export interface HdsAdvancedTableThSignature {
18
18
  colspan?: number;
19
19
  depth?: number;
20
20
  hasExpandAllButton?: boolean;
21
- hasResizableColumns?: boolean;
21
+ hasReorderableColumns?: HdsAdvancedTableSignature['Args']['hasReorderableColumns'];
22
+ hasResizableColumns?: HdsAdvancedTableSignature['Args']['hasResizableColumns'];
23
+ hasSelectableRows?: HdsAdvancedTableSignature['Args']['isSelectable'];
22
24
  isExpanded?: HdsAdvancedTableExpandState;
23
25
  isExpandable?: boolean;
24
26
  isStickyColumn?: boolean;
@@ -34,6 +36,9 @@ export interface HdsAdvancedTableThSignature {
34
36
  onClickToggle?: () => void;
35
37
  onColumnResize?: HdsAdvancedTableSignature['Args']['onColumnResize'];
36
38
  onPinFirstColumn?: () => void;
39
+ onReorderDragEnd?: () => void;
40
+ onReorderDragStart?: (column: HdsAdvancedTableColumn) => void;
41
+ onReorderDrop?: (column: HdsAdvancedTableColumn, side: HdsAdvancedTableColumnReorderSide) => void;
37
42
  willDestroyExpandButton?: (button: HTMLButtonElement) => void;
38
43
  };
39
44
  Blocks: {
@@ -45,6 +50,7 @@ export default class HdsAdvancedTableTh extends Component<HdsAdvancedTableThSign
45
50
  private _labelId;
46
51
  private _element;
47
52
  private _shouldTrapFocus;
53
+ private _reorderHandleElement?;
48
54
  private _resizeHandleElement?;
49
55
  constructor(owner: Owner, args: HdsAdvancedTableThSignature['Args']);
50
56
  get scope(): HdsAdvancedTableScope;
@@ -54,11 +60,12 @@ export default class HdsAdvancedTableTh extends Component<HdsAdvancedTableThSign
54
60
  get colspan(): string | undefined;
55
61
  get paddingLeft(): string | undefined;
56
62
  get classNames(): string;
57
- get showContextMenu(): boolean;
63
+ handleDragStart(column: HdsAdvancedTableColumn): void;
58
64
  onFocusTrapDeactivate(): void;
59
65
  enableFocusTrap(): void;
60
66
  getInitialFocus(): FocusableElement | undefined;
61
67
  setElement(element: HTMLDivElement): void;
68
+ private _registerReorderHandleElement;
62
69
  private _registerResizeHandleElement;
63
70
  private _manageExpandButton;
64
71
  }
@@ -7,6 +7,7 @@ import type { HdsAdvancedTableScope, HdsAdvancedTableThSortOrder } from './types
7
7
  import type { HdsFormCheckboxBaseSignature } from '../form/checkbox/base.ts';
8
8
  import type { HdsAdvancedTableSignature } from './index.ts';
9
9
  import type { HdsAdvancedTableThSelectableSignature } from './th-selectable.ts';
10
+ import type HdsAdvancedTableRow from './models/row.ts';
10
11
  export interface BaseHdsAdvancedTableTrSignature {
11
12
  Args: {
12
13
  selectableColumnKey?: HdsAdvancedTableSignature['Args']['selectableColumnKey'];
@@ -14,6 +15,7 @@ export interface BaseHdsAdvancedTableTrSignature {
14
15
  isSelectable?: boolean;
15
16
  isSelected?: boolean;
16
17
  isParentRow?: boolean;
18
+ data?: HdsAdvancedTableRow;
17
19
  selectionAriaLabelSuffix?: string;
18
20
  selectionKey?: string;
19
21
  selectionScope?: HdsAdvancedTableScope;
@@ -28,7 +30,11 @@ export interface BaseHdsAdvancedTableTrSignature {
28
30
  isStickyColumnPinned?: boolean;
29
31
  };
30
32
  Blocks: {
31
- default?: [];
33
+ default?: [
34
+ {
35
+ orderedCells?: HdsAdvancedTableRow['cells'];
36
+ }
37
+ ];
32
38
  };
33
39
  Element: HTMLDivElement;
34
40
  }
@@ -87,4 +87,19 @@ export interface HdsAdvancedTableOnSelectionChangeSignature {
87
87
  }[];
88
88
  }
89
89
  export type HdsAdvancedTableModel = Array<Record<string, unknown>>;
90
+ export type HdsAdvancedTableColumnResizeCallback = (columnKey: string, newWidth?: string) => void;
91
+ export type HdsAdvancedTableColumnReorderCallback = ({ column, newOrder, insertedAt, }: {
92
+ column: HdsAdvancedTableColumn;
93
+ newOrder: string[];
94
+ insertedAt: number;
95
+ }) => void;
96
+ export interface HdsAdvancedTableCell {
97
+ columnKey: string;
98
+ content: unknown;
99
+ }
100
+ export declare enum HdsAdvancedTableColumnReorderSideValues {
101
+ Left = "left",
102
+ Right = "right"
103
+ }
104
+ export type HdsAdvancedTableColumnReorderSide = `${HdsAdvancedTableColumnReorderSideValues}`;
90
105
  export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+ export declare function requestAnimationFrameWaiter(callback: () => void): number;
@@ -10,7 +10,7 @@ import type { ModifierLike } from '@glint/template';
10
10
  import type { SetupPrimitiveToggleModifier } from '../../popover-primitive/index.ts';
11
11
  import type Owner from '@ember/owner';
12
12
  export declare const DEFAULT_SIZE = HdsDropdownToggleIconSizeValues.Medium;
13
- export declare const SIZES: string[];
13
+ export declare const SIZES: HdsDropdownToggleIconSizes[];
14
14
  export interface HdsDropdownToggleIconSignature {
15
15
  Args: {
16
16
  hasChevron?: boolean;
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import Component from '@glimmer/component';
6
6
  import type { WithBoundArgs } from '@glint/template';
7
+ import type Owner from '@ember/owner';
7
8
  import type { HdsFlyoutSizes } from './types.ts';
8
9
  import { HdsFlyoutSizesValues } from './types.ts';
9
10
  import HdsDialogPrimitiveBodyComponent from '../dialog-primitive/body.ts';
@@ -37,6 +38,8 @@ export default class HdsFlyout extends Component<HdsFlyoutSignature> {
37
38
  _element: HTMLDialogElement;
38
39
  private _body;
39
40
  private _bodyInitialOverflowValue;
41
+ private _clickHandler;
42
+ constructor(owner: Owner, args: HdsFlyoutSignature['Args']);
40
43
  /**
41
44
  * Sets the size of the flyout
42
45
  * Accepted values: medium, large
@@ -57,7 +60,7 @@ export default class HdsFlyout extends Component<HdsFlyoutSignature> {
57
60
  */
58
61
  get classNames(): string;
59
62
  registerOnCloseCallback(event: Event): void;
60
- didInsert(element: HTMLDialogElement): void;
63
+ private _registerDialog;
61
64
  willDestroyNode(): void;
62
65
  open(): void;
63
66
  onDismiss(): Promise<void>;
@@ -18,7 +18,7 @@ import type { HdsFormSectionMultiFieldGroupItemSignature } from './section/multi
18
18
  import type { HdsFormSeparatorSignature } from './separator/index.ts';
19
19
  import type { HdsFormFooterSignature } from './footer/index.ts';
20
20
  export declare const DEFAULT_TAG = HdsFormTagValues.Form;
21
- export declare const AVAILABLE_TAGS: string[];
21
+ export declare const AVAILABLE_TAGS: HdsFormTags[];
22
22
  export interface HdsFormSignature {
23
23
  Args: {
24
24
  tag?: HdsFormTags;
@@ -13,9 +13,9 @@ import HdsFormKeyValueInputsGenericComponent from './generic.ts';
13
13
  import HdsFormLegendComponent from '../legend/index.ts';
14
14
  import type { HdsFormKeyValueInputsAddRowButtonSignature } from './add-row-button.ts';
15
15
  import type { HdsYieldSignature } from '../../yield/index.ts';
16
- export interface HdsFormKeyValueInputsSignature {
16
+ export interface HdsFormKeyValueInputsSignature<T = unknown> {
17
17
  Args: {
18
- data: Array<unknown>;
18
+ data: Array<T>;
19
19
  extraAriaDescribedBy?: string;
20
20
  isOptional?: boolean;
21
21
  isRequired?: boolean;
@@ -33,7 +33,7 @@ export interface HdsFormKeyValueInputsSignature {
33
33
  Field?: WithBoundArgs<typeof HdsFormKeyValueInputsFieldComponent, 'onInsert' | 'onRemove' | 'rowIndex'>;
34
34
  Generic?: WithBoundArgs<typeof HdsFormKeyValueInputsGenericComponent, 'onInsert' | 'onRemove'>;
35
35
  DeleteRowButton?: WithBoundArgs<typeof HdsFormKeyValueInputsDeleteRowButtonComponent, 'onInsert' | 'onRemove' | 'returnFocusTo' | 'rowData' | 'rowIndex'>;
36
- rowData?: unknown;
36
+ rowData?: T;
37
37
  rowIndex?: number;
38
38
  }
39
39
  ];
@@ -47,7 +47,7 @@ export interface HdsFormKeyValueInputsSignature {
47
47
  };
48
48
  Element: HTMLFieldSetElement;
49
49
  }
50
- export default class HdsFormKeyValueInputs extends Component<HdsFormKeyValueInputsSignature> {
50
+ export default class HdsFormKeyValueInputs<T = unknown> extends Component<HdsFormKeyValueInputsSignature<T>> {
51
51
  private _element;
52
52
  _gridTemplateColumns: string;
53
53
  get glueId(): string;
@@ -14,8 +14,8 @@ import type { HdsYieldSignature } from '../../yield';
14
14
  import type { HdsFormRadioCardControlPositions, HdsFormRadioCardAlignments } from './types';
15
15
  export declare const DEFAULT_CONTROL_POSITION = HdsFormRadioCardControlPositionValues.Bottom;
16
16
  export declare const DEFAULT_ALIGNMENT = HdsFormRadioCardAlignmentValues.Left;
17
- export declare const CONTROL_POSITIONS: string[];
18
- export declare const ALIGNMENTS: string[];
17
+ export declare const CONTROL_POSITIONS: HdsFormRadioCardControlPositions[];
18
+ export declare const ALIGNMENTS: HdsFormRadioCardAlignments[];
19
19
  export interface HdsFormRadioCardSignature {
20
20
  Args: {
21
21
  name?: string;
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import Component from '@glimmer/component';
6
6
  import type { WithBoundArgs } from '@glint/template';
7
+ import type Owner from '@ember/owner';
7
8
  import type { HdsModalSizes, HdsModalColors } from './types.ts';
8
9
  import HdsDialogPrimitiveHeaderComponent from '../dialog-primitive/header.ts';
9
10
  import HdsDialogPrimitiveBodyComponent from '../dialog-primitive/body.ts';
@@ -38,14 +39,15 @@ export default class HdsModal extends Component<HdsModalSignature> {
38
39
  private _element;
39
40
  private _body;
40
41
  private _bodyInitialOverflowValue;
42
+ private _clickHandler;
43
+ constructor(owner: Owner, args: HdsModalSignature['Args']);
41
44
  get isDismissDisabled(): boolean;
42
45
  get size(): HdsModalSizes;
43
46
  get color(): HdsModalColors;
44
47
  get id(): string;
45
48
  get classNames(): string;
46
49
  registerOnCloseCallback(event: Event): void;
47
- didInsert(element: HTMLDialogElement): void;
48
- willDestroyNode(): void;
50
+ private _registerDialog;
49
51
  open(): void;
50
52
  onDismiss(): Promise<void>;
51
53
  }
@@ -48,6 +48,7 @@ export interface SetupPrimitivePopoverModifier {
48
48
  export default class HdsPopoverPrimitive extends Component<HdsPopoverPrimitiveSignature> {
49
49
  private _isOpen;
50
50
  private _isClosing;
51
+ private _anchoredPositionOptions?;
51
52
  private _containerElement?;
52
53
  private _toggleElement?;
53
54
  private _popoverElement?;
@@ -78,6 +79,8 @@ export default class HdsPopoverPrimitive extends Component<HdsPopoverPrimitiveSi
78
79
  };
79
80
  Element: HTMLElement;
80
81
  }>;
82
+ private _applyAnchoredPositionModifier;
83
+ private _linkToggleAndPopover;
81
84
  showPopover(): void;
82
85
  hidePopover(_event?: Event): void;
83
86
  togglePopover(): void;
@@ -6,7 +6,7 @@ import Component from '@glimmer/component';
6
6
  import { HdsSeparatorSpacingValues } from './types.ts';
7
7
  import type { HdsSeparatorSpacing } from './types.ts';
8
8
  export declare const DEFAULT_SPACING = HdsSeparatorSpacingValues.TwentyFour;
9
- export declare const SPACING: string[];
9
+ export declare const SPACING: HdsSeparatorSpacing[];
10
10
  export interface HdsSeparatorSignature {
11
11
  Args: {
12
12
  spacing?: HdsSeparatorSpacing;
@@ -6,7 +6,7 @@ import Component from '@glimmer/component';
6
6
  import { HdsStepperStatusesValues } from '../types.ts';
7
7
  import type { HdsStepperListStepIds, HdsStepperStatuses, HdsStepperTitleTags } from '../types.ts';
8
8
  export declare const DEFAULT_STATUS = HdsStepperStatusesValues.Incomplete;
9
- export declare const STATUSES: string[];
9
+ export declare const STATUSES: HdsStepperStatuses[];
10
10
  export declare const MAPPING_STATUS_TO_SR_ONLY_TEXT: Record<HdsStepperStatusesValues, string>;
11
11
  export interface HdsStepperListStepSignature {
12
12
  Args: {