@hashicorp/design-system-components 4.20.2 → 4.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/components/hds/advanced-table/index.d.ts +15 -16
- package/declarations/components/hds/advanced-table/models/column.d.ts +38 -0
- package/declarations/components/hds/advanced-table/models/row.d.ts +2 -0
- package/declarations/components/hds/advanced-table/models/table.d.ts +15 -7
- package/declarations/components/hds/advanced-table/th-context-menu.d.ts +34 -0
- package/declarations/components/hds/advanced-table/th-resize-handle.d.ts +42 -0
- package/declarations/components/hds/advanced-table/th-sort.d.ts +13 -0
- package/declarations/components/hds/advanced-table/th.d.ts +24 -12
- package/declarations/components/hds/advanced-table/types.d.ts +2 -0
- package/declarations/components/hds/app-header/home-link.d.ts +5 -2
- package/declarations/components/hds/form/file-input/base.d.ts +4 -0
- package/declarations/components/hds/form/footer/index.d.ts +23 -0
- package/declarations/components/hds/form/header/description.d.ts +13 -0
- package/declarations/components/hds/form/header/index.d.ts +25 -0
- package/declarations/components/hds/form/header/title.d.ts +26 -0
- package/declarations/components/hds/form/index.d.ts +50 -0
- package/declarations/components/hds/form/key-value-inputs/add-row-button.d.ts +17 -0
- package/declarations/components/hds/form/key-value-inputs/delete-row-button.d.ts +23 -0
- package/declarations/components/hds/form/key-value-inputs/field.d.ts +54 -0
- package/declarations/components/hds/form/key-value-inputs/generic.d.ts +18 -0
- package/declarations/components/hds/form/key-value-inputs/index.d.ts +60 -0
- package/declarations/components/hds/form/label/index.d.ts +1 -0
- package/declarations/components/hds/form/legend/index.d.ts +2 -1
- package/declarations/components/hds/form/masked-input/base.d.ts +1 -0
- package/declarations/components/hds/form/section/header.d.ts +20 -0
- package/declarations/components/hds/form/section/index.d.ts +32 -0
- package/declarations/components/hds/form/section/multi-field-group/index.d.ts +18 -0
- package/declarations/components/hds/form/section/multi-field-group/item.d.ts +17 -0
- package/declarations/components/hds/form/select/base.d.ts +2 -0
- package/declarations/components/hds/form/separator/index.d.ts +14 -0
- package/declarations/components/hds/form/text-input/base.d.ts +2 -0
- package/declarations/components/hds/form/textarea/base.d.ts +2 -0
- package/declarations/components/hds/form/types.d.ts +24 -0
- package/declarations/components/hds/icon/index.d.ts +1 -1
- package/declarations/components/hds/layout/grid/index.d.ts +1 -0
- package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
- package/declarations/components.d.ts +16 -0
- package/declarations/template-registry.d.ts +51 -0
- package/declarations/utils/hds-aria-described-by.d.ts +3 -1
- package/dist/_app_/components/hds/advanced-table/models/column.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-context-menu.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-resize-handle.js +1 -0
- package/dist/_app_/components/hds/form/footer/index.js +1 -0
- package/dist/_app_/components/hds/form/header/description.js +1 -0
- package/dist/_app_/components/hds/form/header/index.js +1 -0
- package/dist/_app_/components/hds/form/header/title.js +1 -0
- package/dist/_app_/components/hds/form/index.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/add-row-button.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/delete-row-button.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/field.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/generic.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/index.js +1 -0
- package/dist/_app_/components/hds/form/section/header.js +1 -0
- package/dist/_app_/components/hds/form/section/index.js +1 -0
- package/dist/_app_/components/hds/form/section/multi-field-group/index.js +1 -0
- package/dist/_app_/components/hds/form/section/multi-field-group/item.js +1 -0
- package/dist/_app_/components/hds/form/separator/index.js +1 -0
- package/dist/components/hds/advanced-table/index.js +74 -78
- package/dist/components/hds/advanced-table/index.js.map +1 -1
- package/dist/components/hds/advanced-table/models/column.js +204 -0
- package/dist/components/hds/advanced-table/models/column.js.map +1 -0
- package/dist/components/hds/advanced-table/models/row.js.map +1 -1
- package/dist/components/hds/advanced-table/models/table.js +118 -7
- package/dist/components/hds/advanced-table/models/table.js.map +1 -1
- package/dist/components/hds/advanced-table/th-context-menu.js +65 -0
- package/dist/components/hds/advanced-table/th-context-menu.js.map +1 -0
- package/dist/components/hds/advanced-table/th-resize-handle.js +202 -0
- package/dist/components/hds/advanced-table/th-resize-handle.js.map +1 -0
- package/dist/components/hds/advanced-table/th-sort.js +16 -1
- package/dist/components/hds/advanced-table/th-sort.js.map +1 -1
- package/dist/components/hds/advanced-table/th.js +16 -2
- package/dist/components/hds/advanced-table/th.js.map +1 -1
- package/dist/components/hds/advanced-table/types.js.map +1 -1
- package/dist/components/hds/app-header/home-link.js +15 -5
- package/dist/components/hds/app-header/home-link.js.map +1 -1
- package/dist/components/hds/form/file-input/base.js +1 -1
- package/dist/components/hds/form/file-input/base.js.map +1 -1
- package/dist/components/hds/form/footer/index.js +26 -0
- package/dist/components/hds/form/footer/index.js.map +1 -0
- package/dist/components/hds/form/header/description.js +16 -0
- package/dist/components/hds/form/header/description.js.map +1 -0
- package/dist/components/hds/form/header/index.js +26 -0
- package/dist/components/hds/form/header/index.js.map +1 -0
- package/dist/components/hds/form/header/title.js +33 -0
- package/dist/components/hds/form/header/title.js.map +1 -0
- package/dist/components/hds/form/index.js +35 -0
- package/dist/components/hds/form/index.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/add-row-button.js +32 -0
- package/dist/components/hds/form/key-value-inputs/add-row-button.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/delete-row-button.js +49 -0
- package/dist/components/hds/form/key-value-inputs/delete-row-button.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/field.js +63 -0
- package/dist/components/hds/form/key-value-inputs/field.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/generic.js +28 -0
- package/dist/components/hds/form/key-value-inputs/generic.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/index.js +124 -0
- package/dist/components/hds/form/key-value-inputs/index.js.map +1 -0
- package/dist/components/hds/form/label/index.js +1 -1
- package/dist/components/hds/form/label/index.js.map +1 -1
- package/dist/components/hds/form/legend/index.js +1 -1
- package/dist/components/hds/form/legend/index.js.map +1 -1
- package/dist/components/hds/form/masked-input/base.js +1 -1
- package/dist/components/hds/form/masked-input/base.js.map +1 -1
- package/dist/components/hds/form/section/header.js +16 -0
- package/dist/components/hds/form/section/header.js.map +1 -0
- package/dist/components/hds/form/section/index.js +26 -0
- package/dist/components/hds/form/section/index.js.map +1 -0
- package/dist/components/hds/form/section/multi-field-group/index.js +16 -0
- package/dist/components/hds/form/section/multi-field-group/index.js.map +1 -0
- package/dist/components/hds/form/section/multi-field-group/item.js +24 -0
- package/dist/components/hds/form/section/multi-field-group/item.js.map +1 -0
- package/dist/components/hds/form/select/base.js +1 -1
- package/dist/components/hds/form/select/base.js.map +1 -1
- package/dist/components/hds/form/separator/index.js +26 -0
- package/dist/components/hds/form/separator/index.js.map +1 -0
- package/dist/components/hds/form/text-input/base.js +1 -1
- package/dist/components/hds/form/text-input/base.js.map +1 -1
- package/dist/components/hds/form/textarea/base.js +1 -1
- package/dist/components/hds/form/textarea/base.js.map +1 -1
- package/dist/components/hds/form/types.js +27 -0
- package/dist/components/hds/form/types.js.map +1 -0
- package/dist/components/hds/layout/grid/index.js +18 -0
- package/dist/components/hds/layout/grid/index.js.map +1 -1
- package/dist/components/hds/table/index.js +1 -1
- package/dist/components.js +16 -0
- package/dist/components.js.map +1 -1
- package/dist/styles/@hashicorp/design-system-components.css +299 -3
- package/dist/styles/@hashicorp/design-system-components.scss +2 -10
- package/dist/styles/components/advanced-table.scss +96 -2
- package/dist/styles/components/app-header.scss +4 -4
- package/dist/styles/components/form/index.scss +2 -0
- package/dist/styles/components/form/key-value-inputs.scss +134 -0
- package/dist/styles/components/form/layout.scss +81 -0
- package/dist/styles/components/form/super-select.scss +15 -0
- package/dist/styles/components/layout/grid.scss +1 -1
- package/dist/styles/mixins/_screen-reader-only.scss +17 -0
- package/dist/utils/hds-aria-described-by.js.map +1 -1
- package/package.json +22 -3
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
|
-
import type {
|
|
6
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
7
7
|
import type Owner from '@ember/owner';
|
|
8
8
|
import { HdsAdvancedTableDensityValues, HdsAdvancedTableVerticalAlignmentValues } from './types.ts';
|
|
9
|
-
import type { HdsAdvancedTableColumn, HdsAdvancedTableDensities, HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableOnSelectionChangeSignature,
|
|
9
|
+
import type { HdsAdvancedTableColumn, HdsAdvancedTableDensities, HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableOnSelectionChangeSignature, HdsAdvancedTableThSortOrder, HdsAdvancedTableVerticalAlignment, HdsAdvancedTableModel, HdsAdvancedTableExpandState } from './types.ts';
|
|
10
10
|
import type { HdsFormCheckboxBaseSignature } from '../form/checkbox/base.ts';
|
|
11
|
-
import type
|
|
12
|
-
import type
|
|
13
|
-
import type
|
|
11
|
+
import type HdsAdvancedTableTd from './td.ts';
|
|
12
|
+
import type HdsAdvancedTableTh from './th.ts';
|
|
13
|
+
import type HdsAdvancedTableTr from './tr.ts';
|
|
14
14
|
export declare const DENSITIES: HdsAdvancedTableDensities[];
|
|
15
15
|
export declare const DEFAULT_DENSITY = HdsAdvancedTableDensityValues.Medium;
|
|
16
16
|
export declare const VALIGNMENTS: HdsAdvancedTableVerticalAlignment[];
|
|
@@ -25,25 +25,27 @@ export interface HdsAdvancedTableSignature {
|
|
|
25
25
|
isSelectable?: boolean;
|
|
26
26
|
isStriped?: boolean;
|
|
27
27
|
model: HdsAdvancedTableModel;
|
|
28
|
-
onSelectionChange?: (selection: HdsAdvancedTableOnSelectionChangeSignature) => void;
|
|
29
|
-
onSort?: (sortBy: string, sortOrder: HdsAdvancedTableThSortOrder) => void;
|
|
30
28
|
selectionAriaLabelSuffix?: string;
|
|
31
29
|
sortBy?: string;
|
|
32
30
|
selectableColumnKey?: string;
|
|
33
31
|
sortedMessageText?: string;
|
|
34
32
|
sortOrder?: HdsAdvancedTableThSortOrder;
|
|
35
33
|
valign?: HdsAdvancedTableVerticalAlignment;
|
|
34
|
+
hasResizableColumns?: boolean;
|
|
36
35
|
hasStickyHeader?: boolean;
|
|
37
36
|
hasStickyFirstColumn?: boolean;
|
|
38
37
|
childrenKey?: string;
|
|
39
38
|
maxHeight?: string;
|
|
39
|
+
onColumnResize?: (columnKey: string, newWidth?: string) => void;
|
|
40
|
+
onSelectionChange?: (selection: HdsAdvancedTableOnSelectionChangeSignature) => void;
|
|
41
|
+
onSort?: (sortBy: string, sortOrder: HdsAdvancedTableThSortOrder) => void;
|
|
40
42
|
};
|
|
41
43
|
Blocks: {
|
|
42
44
|
body?: [
|
|
43
45
|
{
|
|
44
|
-
Td?:
|
|
45
|
-
Tr?:
|
|
46
|
-
Th?:
|
|
46
|
+
Td?: WithBoundArgs<typeof HdsAdvancedTableTd, 'align'>;
|
|
47
|
+
Tr?: WithBoundArgs<typeof HdsAdvancedTableTr, 'selectionScope' | 'isLastRow' | 'isSelectable' | 'onSelectionChange' | 'didInsert' | 'willDestroy' | 'selectionAriaLabelSuffix' | 'hasStickyColumn' | 'isStickyColumnPinned' | 'isParentRow' | 'depth' | 'displayRow'>;
|
|
48
|
+
Th?: WithBoundArgs<typeof HdsAdvancedTableTh, 'depth' | 'isExpandable' | 'isExpanded' | 'newLabel' | 'parentId' | 'scope' | 'isStickyColumn' | 'isStickyColumnPinned' | 'onClickToggle'>;
|
|
47
49
|
data?: Record<string, unknown>;
|
|
48
50
|
rowIndex?: number | string;
|
|
49
51
|
isOpen?: HdsAdvancedTableExpandState;
|
|
@@ -53,10 +55,9 @@ export interface HdsAdvancedTableSignature {
|
|
|
53
55
|
Element: HTMLDivElement;
|
|
54
56
|
}
|
|
55
57
|
export default class HdsAdvancedTable extends Component<HdsAdvancedTableSignature> {
|
|
56
|
-
private _sortBy;
|
|
57
|
-
private _sortOrder;
|
|
58
58
|
private _selectAllCheckbox?;
|
|
59
59
|
private _isSelectAllCheckboxSelected?;
|
|
60
|
+
private _tableHeight;
|
|
60
61
|
private _selectableRows;
|
|
61
62
|
private _captionId;
|
|
62
63
|
private _tableModel;
|
|
@@ -79,8 +80,6 @@ export default class HdsAdvancedTable extends Component<HdsAdvancedTableSignatur
|
|
|
79
80
|
showScrollIndicatorBottom: boolean;
|
|
80
81
|
stickyColumnOffset: string;
|
|
81
82
|
constructor(owner: Owner, args: HdsAdvancedTableSignature['Args']);
|
|
82
|
-
get getSortCriteria(): string | HdsAdvancedTableSortingFunction<unknown>;
|
|
83
|
-
get columnWidths(): string[] | undefined;
|
|
84
83
|
get identityKey(): string | undefined;
|
|
85
84
|
get childrenKey(): string;
|
|
86
85
|
get hasScrollIndicator(): boolean;
|
|
@@ -93,11 +92,11 @@ export default class HdsAdvancedTable extends Component<HdsAdvancedTableSignatur
|
|
|
93
92
|
get gridTemplateColumns(): string;
|
|
94
93
|
get classNames(): string;
|
|
95
94
|
get theadClassNames(): string;
|
|
96
|
-
private
|
|
95
|
+
private _setColumnWidth;
|
|
97
96
|
private _setUpScrollWrapper;
|
|
98
97
|
private _setUpThead;
|
|
99
|
-
setSortBy(column: string): void;
|
|
100
98
|
onSelectionChangeCallback(checkbox?: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string): void;
|
|
99
|
+
setupTableModelData(): void;
|
|
101
100
|
onSelectionAllChange(): void;
|
|
102
101
|
onSelectionRowChange(checkbox?: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string): void;
|
|
103
102
|
didInsertSelectAllCheckbox(checkbox: HdsFormCheckboxBaseSignature['Element']): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import type HdsAdvancedTableModel from './table.ts';
|
|
6
|
+
import type { HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableColumn as HdsAdvancedTableColumnType } from '../types';
|
|
7
|
+
export declare const DEFAULT_MIN_WIDTH = "150px";
|
|
8
|
+
export declare const DEFAULT_MAX_WIDTH = "800px";
|
|
9
|
+
export default class HdsAdvancedTableColumn {
|
|
10
|
+
label: string;
|
|
11
|
+
align?: HdsAdvancedTableHorizontalAlignment;
|
|
12
|
+
isExpandable?: boolean;
|
|
13
|
+
isReorderable?: boolean;
|
|
14
|
+
isSortable?: boolean;
|
|
15
|
+
isVisuallyHidden?: boolean;
|
|
16
|
+
key?: string;
|
|
17
|
+
minWidth?: `${number}px`;
|
|
18
|
+
maxWidth?: `${number}px`;
|
|
19
|
+
tooltip?: string;
|
|
20
|
+
width?: string;
|
|
21
|
+
originalWidth?: string;
|
|
22
|
+
imposedWidthDelta: number;
|
|
23
|
+
sortingFunction?: (a: unknown, b: unknown) => number;
|
|
24
|
+
table: HdsAdvancedTableModel;
|
|
25
|
+
get pxWidth(): number | undefined;
|
|
26
|
+
set pxWidth(value: number);
|
|
27
|
+
get pxMinWidth(): number | undefined;
|
|
28
|
+
get pxMaxWidth(): number | undefined;
|
|
29
|
+
constructor(args: {
|
|
30
|
+
column: HdsAdvancedTableColumnType;
|
|
31
|
+
table: HdsAdvancedTableModel;
|
|
32
|
+
});
|
|
33
|
+
private _setWidthValues;
|
|
34
|
+
setPxWidth(newPxWidth: number): void;
|
|
35
|
+
onPreviousColumnWidthRestored(): void;
|
|
36
|
+
onNextColumnWidthRestored(imposedWidthDelta: number): void;
|
|
37
|
+
restoreWidth(): void;
|
|
38
|
+
}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Copyright (c) HashiCorp, Inc.
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
|
+
import type { HdsAdvancedTableColumn } from '../types';
|
|
5
6
|
interface HdsAdvancedTableRowArgs {
|
|
6
7
|
[key: string]: unknown;
|
|
8
|
+
columns: HdsAdvancedTableColumn[];
|
|
7
9
|
id?: string;
|
|
8
10
|
childrenKey?: string;
|
|
9
11
|
}
|
|
@@ -3,22 +3,30 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
import HdsAdvancedTableRow from './row.ts';
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
import HdsAdvancedTableColumn from './column.ts';
|
|
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'>;
|
|
11
10
|
export default class HdsAdvancedTableTableModel {
|
|
11
|
+
columns: HdsAdvancedTableColumn[];
|
|
12
12
|
rows: HdsAdvancedTableRow[];
|
|
13
|
-
|
|
13
|
+
sortBy: HdsAdvancedTableTableArgs['sortBy'];
|
|
14
|
+
sortOrder: HdsAdvancedTableTableArgs['sortOrder'];
|
|
15
|
+
childrenKey?: HdsAdvancedTableTableArgs['childrenKey'];
|
|
16
|
+
hasResizableColumns?: HdsAdvancedTableTableArgs['hasResizableColumns'];
|
|
17
|
+
onSort?: HdsAdvancedTableSignature['Args']['onSort'];
|
|
14
18
|
constructor(args: HdsAdvancedTableTableArgs);
|
|
19
|
+
get sortCriteria(): string | HdsAdvancedTableSortingFunction<unknown>;
|
|
20
|
+
get sortedRows(): HdsAdvancedTableRow[];
|
|
15
21
|
get totalRowCount(): number;
|
|
16
22
|
get flattenedVisibleRows(): HdsAdvancedTableRow[];
|
|
17
23
|
get lastVisibleRow(): HdsAdvancedTableRow | undefined;
|
|
18
24
|
get hasRowsWithChildren(): boolean;
|
|
19
25
|
get allRowsAreOpen(): boolean;
|
|
20
26
|
get expandState(): HdsAdvancedTableExpandState;
|
|
21
|
-
|
|
27
|
+
setupData(args: Pick<HdsAdvancedTableTableArgs, 'model' | 'columns' | 'sortBy' | 'sortOrder'>): void;
|
|
28
|
+
restoreColumnWidths(): void;
|
|
29
|
+
setSortBy(column: string): void;
|
|
22
30
|
openAll(): void;
|
|
23
31
|
collapseAll(): void;
|
|
24
32
|
toggleAll(): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { HdsDropdownSignature } from '../dropdown/index.ts';
|
|
8
|
+
import type { HdsDropdownToggleIconSignature } from '../dropdown/toggle/icon.ts';
|
|
9
|
+
import type { HdsAdvancedTableSignature } from './index.ts';
|
|
10
|
+
import type { HdsAdvancedTableThResizeHandleSignature } from './th-resize-handle.ts';
|
|
11
|
+
interface HdsAdvancedTableThContextMenuOption {
|
|
12
|
+
key: string;
|
|
13
|
+
label: string;
|
|
14
|
+
icon: HdsDropdownToggleIconSignature['Args']['icon'];
|
|
15
|
+
action: (column: HdsAdvancedTableColumn, previousColumn?: HdsAdvancedTableColumn, nextColumn?: HdsAdvancedTableColumn, dropdownCloseCallback?: () => void) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface HdsAdvancedTableThContextMenuSignature {
|
|
18
|
+
Args: {
|
|
19
|
+
column: HdsAdvancedTableColumn;
|
|
20
|
+
previousColumn?: HdsAdvancedTableColumn;
|
|
21
|
+
nextColumn?: HdsAdvancedTableColumn;
|
|
22
|
+
hasResizableColumns?: boolean;
|
|
23
|
+
resizeHandleElement?: HdsAdvancedTableThResizeHandleSignature['Element'];
|
|
24
|
+
onColumnResize?: HdsAdvancedTableSignature['Args']['onColumnResize'];
|
|
25
|
+
};
|
|
26
|
+
Element: HdsDropdownSignature['Element'];
|
|
27
|
+
}
|
|
28
|
+
export default class HdsAdvancedTableThContextMenu extends Component<HdsAdvancedTableThContextMenuSignature> {
|
|
29
|
+
private _element;
|
|
30
|
+
get _options(): HdsAdvancedTableThContextMenuOption[];
|
|
31
|
+
resizeColumn(): void;
|
|
32
|
+
resetColumnWidth(column: HdsAdvancedTableColumn, previousColumn?: HdsAdvancedTableColumn, nextColumn?: HdsAdvancedTableColumn, dropdownCloseCallback?: () => void): void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { HdsAdvancedTableSignature } from './index.ts';
|
|
8
|
+
export interface HdsAdvancedTableThResizeHandleSignature {
|
|
9
|
+
Args: {
|
|
10
|
+
column: HdsAdvancedTableColumn;
|
|
11
|
+
nextColumn?: HdsAdvancedTableColumn;
|
|
12
|
+
hasResizableColumns: HdsAdvancedTableSignature['Args']['hasResizableColumns'];
|
|
13
|
+
tableHeight?: number;
|
|
14
|
+
onColumnResize?: HdsAdvancedTableSignature['Args']['onColumnResize'];
|
|
15
|
+
};
|
|
16
|
+
Blocks: {
|
|
17
|
+
default?: [];
|
|
18
|
+
};
|
|
19
|
+
Element: HTMLDivElement;
|
|
20
|
+
}
|
|
21
|
+
export default class HdsAdvancedTableThResizeHandle extends Component<HdsAdvancedTableThResizeHandleSignature> {
|
|
22
|
+
resizing: {
|
|
23
|
+
startX: number;
|
|
24
|
+
startColumnPxWidth: number;
|
|
25
|
+
startNextColumnPxWidth?: number;
|
|
26
|
+
} | null;
|
|
27
|
+
private _nextColumnDelta;
|
|
28
|
+
private _handleElement;
|
|
29
|
+
private _boundResize;
|
|
30
|
+
private _boundStopResize;
|
|
31
|
+
private _registerHandleElement;
|
|
32
|
+
constructor(owner: unknown, args: HdsAdvancedTableThResizeHandleSignature['Args']);
|
|
33
|
+
get height(): string | undefined;
|
|
34
|
+
get classNames(): string;
|
|
35
|
+
onColumnResize(key?: string, width?: string): void;
|
|
36
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
37
|
+
startResize(event: PointerEvent): void;
|
|
38
|
+
private _applyResizeDelta;
|
|
39
|
+
private _resize;
|
|
40
|
+
private _stopResize;
|
|
41
|
+
private _setNextColumnImposedWidthDelta;
|
|
42
|
+
}
|
|
@@ -4,22 +4,32 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
6
|
import { type FocusableElement } from 'tabbable';
|
|
7
|
+
import HdsAdvancedTableColumn from './models/column.ts';
|
|
7
8
|
import type Owner from '@ember/owner';
|
|
8
9
|
import { HdsAdvancedTableHorizontalAlignmentValues } from './types.ts';
|
|
9
10
|
import type { HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableThSortOrder, HdsAdvancedTableThSortOrderLabels } from './types.ts';
|
|
10
11
|
import type { HdsAdvancedTableThButtonSortSignature } from './th-button-sort.ts';
|
|
12
|
+
import type { HdsAdvancedTableThSignature } from './th.ts';
|
|
13
|
+
import type { HdsAdvancedTableSignature } from './index.ts';
|
|
11
14
|
export declare const ALIGNMENTS: string[];
|
|
12
15
|
export declare const DEFAULT_ALIGN = HdsAdvancedTableHorizontalAlignmentValues.Left;
|
|
13
16
|
export interface HdsAdvancedTableThSortSignature {
|
|
14
17
|
Args: {
|
|
18
|
+
column?: HdsAdvancedTableThSignature['Args']['column'];
|
|
15
19
|
align?: HdsAdvancedTableHorizontalAlignment;
|
|
20
|
+
hasResizableColumns: HdsAdvancedTableSignature['Args']['hasResizableColumns'];
|
|
16
21
|
onClickSort?: HdsAdvancedTableThButtonSortSignature['Args']['onClick'];
|
|
17
22
|
sortOrder?: HdsAdvancedTableThSortOrder;
|
|
18
23
|
tooltip?: string;
|
|
19
24
|
rowspan?: number;
|
|
20
25
|
colspan?: number;
|
|
26
|
+
previousColumn?: HdsAdvancedTableColumn;
|
|
27
|
+
nextColumn?: HdsAdvancedTableColumn;
|
|
28
|
+
tableHeight?: number;
|
|
29
|
+
isLastColumn?: boolean;
|
|
21
30
|
isStickyColumn?: boolean;
|
|
22
31
|
isStickyColumnPinned?: boolean;
|
|
32
|
+
onColumnResize?: HdsAdvancedTableSignature['Args']['onColumnResize'];
|
|
23
33
|
};
|
|
24
34
|
Blocks: {
|
|
25
35
|
default?: [];
|
|
@@ -30,12 +40,15 @@ export default class HdsAdvancedTableThSort extends Component<HdsAdvancedTableTh
|
|
|
30
40
|
private _labelId;
|
|
31
41
|
private _element;
|
|
32
42
|
private _shouldTrapFocus;
|
|
43
|
+
private _resizeHandleElement?;
|
|
33
44
|
constructor(owner: Owner, args: HdsAdvancedTableThSortSignature['Args']);
|
|
34
45
|
get ariaSort(): HdsAdvancedTableThSortOrderLabels;
|
|
35
46
|
get align(): HdsAdvancedTableHorizontalAlignment;
|
|
47
|
+
get showContextMenu(): boolean;
|
|
36
48
|
get classNames(): string;
|
|
37
49
|
onFocusTrapDeactivate(): void;
|
|
38
50
|
enableFocusTrap(): void;
|
|
39
51
|
getInitialFocus(): FocusableElement | undefined;
|
|
40
52
|
setElement(element: HTMLDivElement): void;
|
|
53
|
+
private _registerResizeHandleElement;
|
|
41
54
|
}
|
|
@@ -4,30 +4,39 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
6
|
import { type FocusableElement } from 'tabbable';
|
|
7
|
+
import HdsAdvancedTableColumn from './models/column.ts';
|
|
8
|
+
import { HdsAdvancedTableHorizontalAlignmentValues } from './types.ts';
|
|
7
9
|
import type Owner from '@ember/owner';
|
|
8
10
|
import type { HdsAdvancedTableHorizontalAlignment, HdsAdvancedTableScope, HdsAdvancedTableExpandState } from './types.ts';
|
|
9
|
-
import {
|
|
11
|
+
import type { HdsAdvancedTableSignature } from './index.ts';
|
|
10
12
|
export declare const ALIGNMENTS: string[];
|
|
11
13
|
export declare const DEFAULT_ALIGN = HdsAdvancedTableHorizontalAlignmentValues.Left;
|
|
12
14
|
export interface HdsAdvancedTableThSignature {
|
|
13
15
|
Args: {
|
|
14
16
|
align?: HdsAdvancedTableHorizontalAlignment;
|
|
15
|
-
|
|
16
|
-
scope?: HdsAdvancedTableScope;
|
|
17
|
-
tooltip?: string;
|
|
18
|
-
rowspan?: number;
|
|
17
|
+
column?: HdsAdvancedTableColumn;
|
|
19
18
|
colspan?: number;
|
|
20
|
-
newLabel?: string;
|
|
21
|
-
isExpandable?: boolean;
|
|
22
|
-
parentId?: string;
|
|
23
|
-
onClickToggle?: () => void;
|
|
24
|
-
isExpanded?: HdsAdvancedTableExpandState;
|
|
25
19
|
depth?: number;
|
|
26
|
-
didInsertExpandButton?: (button: HTMLButtonElement) => void;
|
|
27
|
-
willDestroyExpandButton?: (button: HTMLButtonElement) => void;
|
|
28
20
|
hasExpandAllButton?: boolean;
|
|
21
|
+
hasResizableColumns?: boolean;
|
|
22
|
+
isExpanded?: HdsAdvancedTableExpandState;
|
|
23
|
+
isExpandable?: boolean;
|
|
24
|
+
isLastColumn?: boolean;
|
|
29
25
|
isStickyColumn?: boolean;
|
|
30
26
|
isStickyColumnPinned?: boolean;
|
|
27
|
+
isVisuallyHidden?: boolean;
|
|
28
|
+
newLabel?: string;
|
|
29
|
+
previousColumn?: HdsAdvancedTableColumn;
|
|
30
|
+
nextColumn?: HdsAdvancedTableColumn;
|
|
31
|
+
parentId?: string;
|
|
32
|
+
rowspan?: number;
|
|
33
|
+
scope?: HdsAdvancedTableScope;
|
|
34
|
+
tooltip?: string;
|
|
35
|
+
tableHeight?: number;
|
|
36
|
+
didInsertExpandButton?: (button: HTMLButtonElement) => void;
|
|
37
|
+
onClickToggle?: () => void;
|
|
38
|
+
onColumnResize?: HdsAdvancedTableSignature['Args']['onColumnResize'];
|
|
39
|
+
willDestroyExpandButton?: (button: HTMLButtonElement) => void;
|
|
31
40
|
};
|
|
32
41
|
Blocks: {
|
|
33
42
|
default?: [];
|
|
@@ -38,6 +47,7 @@ export default class HdsAdvancedTableTh extends Component<HdsAdvancedTableThSign
|
|
|
38
47
|
private _labelId;
|
|
39
48
|
private _element;
|
|
40
49
|
private _shouldTrapFocus;
|
|
50
|
+
private _resizeHandleElement?;
|
|
41
51
|
constructor(owner: Owner, args: HdsAdvancedTableThSignature['Args']);
|
|
42
52
|
get scope(): HdsAdvancedTableScope;
|
|
43
53
|
get role(): string;
|
|
@@ -46,9 +56,11 @@ export default class HdsAdvancedTableTh extends Component<HdsAdvancedTableThSign
|
|
|
46
56
|
get colspan(): string | undefined;
|
|
47
57
|
get paddingLeft(): string | undefined;
|
|
48
58
|
get classNames(): string;
|
|
59
|
+
get showContextMenu(): boolean;
|
|
49
60
|
onFocusTrapDeactivate(): void;
|
|
50
61
|
enableFocusTrap(): void;
|
|
51
62
|
getInitialFocus(): FocusableElement | undefined;
|
|
52
63
|
setElement(element: HTMLDivElement): void;
|
|
64
|
+
private _registerResizeHandleElement;
|
|
53
65
|
private _manageExpandButton;
|
|
54
66
|
}
|
|
@@ -63,6 +63,8 @@ interface BaseHdsAdvancedTableColumn {
|
|
|
63
63
|
sortingFunction?: HdsAdvancedTableSortingFunction<unknown>;
|
|
64
64
|
tooltip?: string;
|
|
65
65
|
width?: string;
|
|
66
|
+
minWidth?: `${number}px`;
|
|
67
|
+
maxWidth?: `${number}px`;
|
|
66
68
|
}
|
|
67
69
|
interface SortableHdsAdvancedTableColumn extends BaseHdsAdvancedTableColumn {
|
|
68
70
|
isSortable: true;
|
|
@@ -8,11 +8,14 @@ import type { HdsInteractiveSignature } from '../interactive/';
|
|
|
8
8
|
export interface HdsAppHeaderHomeLinkSignature {
|
|
9
9
|
Args: HdsInteractiveSignature['Args'] & {
|
|
10
10
|
icon: HdsIconSignature['Args']['name'];
|
|
11
|
+
isIconOnly?: boolean;
|
|
11
12
|
color?: string;
|
|
12
|
-
|
|
13
|
+
text: string;
|
|
13
14
|
};
|
|
14
15
|
Element: HdsInteractiveSignature['Element'];
|
|
15
16
|
}
|
|
16
17
|
export default class HdsAppHeaderHomeLink extends Component<HdsAppHeaderHomeLinkSignature> {
|
|
17
|
-
get
|
|
18
|
+
get text(): string;
|
|
19
|
+
get icon(): HdsIconSignature['Args']['name'];
|
|
20
|
+
get isIconOnly(): boolean;
|
|
18
21
|
}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
export interface HdsFormFileInputBaseSignature {
|
|
6
|
+
Args: {
|
|
7
|
+
id?: string;
|
|
8
|
+
ariaDescribedBy?: string;
|
|
9
|
+
};
|
|
6
10
|
Element: HTMLInputElement;
|
|
7
11
|
}
|
|
8
12
|
declare const HdsFormFileInputBase: import("@ember/component/template-only").TemplateOnlyComponent<HdsFormFileInputBaseSignature>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import Component from '@glimmer/component';
|
|
6
|
+
import type { ComponentLike } from '@glint/template';
|
|
7
|
+
import type { HdsButtonSetSignature } from '../../button-set/index.ts';
|
|
8
|
+
export interface HdsFormFooterSignature {
|
|
9
|
+
Args: {
|
|
10
|
+
isFullWidth?: boolean;
|
|
11
|
+
};
|
|
12
|
+
Blocks: {
|
|
13
|
+
default: [
|
|
14
|
+
{
|
|
15
|
+
ButtonSet?: ComponentLike<HdsButtonSetSignature>;
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
};
|
|
19
|
+
Element: HTMLDivElement;
|
|
20
|
+
}
|
|
21
|
+
export default class HdsFormFooter extends Component<HdsFormFooterSignature> {
|
|
22
|
+
get classNames(): string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import type { HdsTextBodySignature } from '../../text/body.ts';
|
|
6
|
+
export interface HdsFormHeaderDescriptionSignature {
|
|
7
|
+
Blocks: {
|
|
8
|
+
default: [];
|
|
9
|
+
};
|
|
10
|
+
Element: HdsTextBodySignature['Element'];
|
|
11
|
+
}
|
|
12
|
+
declare const HdsFormHeaderDescription: import("@ember/component/template-only").TemplateOnlyComponent<HdsFormHeaderDescriptionSignature>;
|
|
13
|
+
export default HdsFormHeaderDescription;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import Component from '@glimmer/component';
|
|
6
|
+
import type { ComponentLike } from '@glint/template';
|
|
7
|
+
import type { HdsFormHeaderTitleSignature } from './title.ts';
|
|
8
|
+
import type { HdsFormHeaderDescriptionSignature } from './description.ts';
|
|
9
|
+
export interface HdsFormHeaderSignature {
|
|
10
|
+
Args: {
|
|
11
|
+
isFullWidth?: boolean;
|
|
12
|
+
};
|
|
13
|
+
Blocks: {
|
|
14
|
+
default: [
|
|
15
|
+
{
|
|
16
|
+
Title?: ComponentLike<HdsFormHeaderTitleSignature>;
|
|
17
|
+
Description?: ComponentLike<HdsFormHeaderDescriptionSignature>;
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
Element: HTMLDivElement;
|
|
22
|
+
}
|
|
23
|
+
export default class HdsFormHeader extends Component<HdsFormHeaderSignature> {
|
|
24
|
+
get classNames(): string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import Component from '@glimmer/component';
|
|
6
|
+
import type { HdsFormHeaderTitleTags } from '../types.ts';
|
|
7
|
+
import { HdsFormHeaderTitleTagValues } from '../types.ts';
|
|
8
|
+
import { HdsTextSizeValues } from '../../text/types.ts';
|
|
9
|
+
import type { HdsTextDisplaySignature } from '../../text/display.ts';
|
|
10
|
+
export declare const DEFAULT_SIZE = HdsTextSizeValues.FourHundred;
|
|
11
|
+
export declare const DEFAULT_TAG = HdsFormHeaderTitleTagValues.Div;
|
|
12
|
+
export declare const AVAILABLE_TAGS: string[];
|
|
13
|
+
export interface HdsFormHeaderTitleSignature {
|
|
14
|
+
Args: {
|
|
15
|
+
tag?: HdsFormHeaderTitleTags;
|
|
16
|
+
size?: HdsTextDisplaySignature['Args']['size'];
|
|
17
|
+
};
|
|
18
|
+
Blocks: {
|
|
19
|
+
default: [];
|
|
20
|
+
};
|
|
21
|
+
Element: HdsTextDisplaySignature['Element'];
|
|
22
|
+
}
|
|
23
|
+
export default class HdsFormHeaderTitle extends Component<HdsFormHeaderTitleSignature> {
|
|
24
|
+
get tag(): HdsFormHeaderTitleTags;
|
|
25
|
+
get size(): HdsTextDisplaySignature['Args']['size'];
|
|
26
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import Component from '@glimmer/component';
|
|
6
|
+
import HdsFormHeaderTitleComponent from './header/title.ts';
|
|
7
|
+
import { HdsFormTagValues } from './types.ts';
|
|
8
|
+
import type { HdsFormTags } from './types.ts';
|
|
9
|
+
import type Owner from '@ember/owner';
|
|
10
|
+
import type { ComponentLike, WithBoundArgs } from '@glint/template';
|
|
11
|
+
import type { HdsFormHeaderSignature } from './header/index.ts';
|
|
12
|
+
import type { HdsFormHeaderTitleSignature } from './header/title.ts';
|
|
13
|
+
import type { HdsFormHeaderDescriptionSignature } from './header/description.ts';
|
|
14
|
+
import type { HdsFormSectionSignature } from './section/index.ts';
|
|
15
|
+
import type { HdsFormSectionHeaderSignature } from './section/header.ts';
|
|
16
|
+
import type { HdsFormSectionMultiFieldGroupSignature } from './section/multi-field-group/index.ts';
|
|
17
|
+
import type { HdsFormSectionMultiFieldGroupItemSignature } from './section/multi-field-group/item.ts';
|
|
18
|
+
import type { HdsFormSeparatorSignature } from './separator/index.ts';
|
|
19
|
+
import type { HdsFormFooterSignature } from './footer/index.ts';
|
|
20
|
+
export declare const DEFAULT_TAG = HdsFormTagValues.Form;
|
|
21
|
+
export declare const AVAILABLE_TAGS: string[];
|
|
22
|
+
export interface HdsFormSignature {
|
|
23
|
+
Args: {
|
|
24
|
+
tag?: HdsFormTags;
|
|
25
|
+
sectionMaxWidth?: string;
|
|
26
|
+
};
|
|
27
|
+
Blocks: {
|
|
28
|
+
default: [
|
|
29
|
+
{
|
|
30
|
+
Header?: ComponentLike<HdsFormHeaderSignature>;
|
|
31
|
+
HeaderTitle?: ComponentLike<HdsFormHeaderTitleSignature>;
|
|
32
|
+
HeaderDescription?: ComponentLike<HdsFormHeaderDescriptionSignature>;
|
|
33
|
+
Section?: ComponentLike<HdsFormSectionSignature>;
|
|
34
|
+
SectionHeader?: ComponentLike<HdsFormSectionHeaderSignature>;
|
|
35
|
+
SectionHeaderTitle?: WithBoundArgs<typeof HdsFormHeaderTitleComponent, 'size'>;
|
|
36
|
+
SectionHeaderDescription?: ComponentLike<HdsFormHeaderDescriptionSignature>;
|
|
37
|
+
SectionMultiFieldGroup?: ComponentLike<HdsFormSectionMultiFieldGroupSignature>;
|
|
38
|
+
SectionMultiFieldGroupItem?: ComponentLike<HdsFormSectionMultiFieldGroupItemSignature>;
|
|
39
|
+
Separator?: ComponentLike<HdsFormSeparatorSignature>;
|
|
40
|
+
Footer?: ComponentLike<HdsFormFooterSignature>;
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
};
|
|
44
|
+
Element: HTMLFormElement | HTMLDivElement;
|
|
45
|
+
}
|
|
46
|
+
export default class HdsForm extends Component<HdsFormSignature> {
|
|
47
|
+
tag: HdsFormTags;
|
|
48
|
+
constructor(owner: Owner, args: HdsFormSignature['Args']);
|
|
49
|
+
get sectionMaxWidthStyle(): Record<string, string>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import Component from '@glimmer/component';
|
|
6
|
+
import type { HdsButtonSignature } from '../../button/index.ts';
|
|
7
|
+
export interface HdsFormKeyValueInputsAddRowButtonSignature {
|
|
8
|
+
Args: {
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
text?: HdsButtonSignature['Args']['text'];
|
|
11
|
+
};
|
|
12
|
+
Element: HdsButtonSignature['Element'];
|
|
13
|
+
}
|
|
14
|
+
export default class HdsFormKeyValueInputsAddRowButton extends Component<HdsFormKeyValueInputsAddRowButtonSignature> {
|
|
15
|
+
get text(): string;
|
|
16
|
+
onClick(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import Component from '@glimmer/component';
|
|
6
|
+
import type { HdsButtonSignature } from '../../button/index.ts';
|
|
7
|
+
export interface HdsFormKeyValueInputsDeleteRowButtonSignature {
|
|
8
|
+
Args: {
|
|
9
|
+
onClick?: (rowData: unknown, rowIndex: number) => void;
|
|
10
|
+
onInsert?: () => void;
|
|
11
|
+
onRemove?: () => void;
|
|
12
|
+
returnFocusTo?: HTMLFieldSetElement;
|
|
13
|
+
rowData: unknown;
|
|
14
|
+
rowIndex: number;
|
|
15
|
+
text?: HdsButtonSignature['Args']['text'];
|
|
16
|
+
};
|
|
17
|
+
Element: HdsButtonSignature['Element'];
|
|
18
|
+
}
|
|
19
|
+
export default class HdsFormKeyValueInputsDeleteRowButton extends Component<HdsFormKeyValueInputsDeleteRowButtonSignature> {
|
|
20
|
+
private _onInsert;
|
|
21
|
+
get text(): string;
|
|
22
|
+
onClick(): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import Component from '@glimmer/component';
|
|
6
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
7
|
+
import HdsFormErrorComponent from '../error/index.ts';
|
|
8
|
+
import HdsFormFileInputBaseComponent from '../file-input/base.ts';
|
|
9
|
+
import HdsFormHelperTextComponent from '../helper-text/index.ts';
|
|
10
|
+
import HdsFormLabelComponent from '../label/index.ts';
|
|
11
|
+
import HdsFormMaskedInputBaseComponent from '../masked-input/base.ts';
|
|
12
|
+
import HdsFormSelectBaseComponent from '../select/base.ts';
|
|
13
|
+
import HdsFormSuperSelectMultipleBaseComponent from '../super-select/multiple/base.ts';
|
|
14
|
+
import HdsFormSuperSelectSingleBaseComponent from '../super-select/single/base.ts';
|
|
15
|
+
import HdsFormTextareaBaseComponent from '../textarea/base.ts';
|
|
16
|
+
import HdsFormTextInputBaseComponent from '../text-input/base.ts';
|
|
17
|
+
export interface HdsFormKeyValueInputsFieldSignature {
|
|
18
|
+
Args: {
|
|
19
|
+
extraAriaDescribedBy?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
isInvalid?: boolean;
|
|
22
|
+
isOptional?: boolean;
|
|
23
|
+
isRequired?: boolean;
|
|
24
|
+
onInsert?: () => void;
|
|
25
|
+
onRemove?: () => void;
|
|
26
|
+
rowIndex: number;
|
|
27
|
+
width?: string;
|
|
28
|
+
};
|
|
29
|
+
Blocks: {
|
|
30
|
+
default?: [
|
|
31
|
+
{
|
|
32
|
+
Label?: WithBoundArgs<typeof HdsFormLabelComponent, 'contextualClass' | 'controlId' | 'hiddenText' | 'isOptional' | 'isRequired'>;
|
|
33
|
+
HelperText?: WithBoundArgs<typeof HdsFormHelperTextComponent, 'contextualClass' | 'controlId' | 'onInsert'>;
|
|
34
|
+
FileInput?: WithBoundArgs<typeof HdsFormFileInputBaseComponent, 'ariaDescribedBy' | 'id'>;
|
|
35
|
+
MaskedInput?: WithBoundArgs<typeof HdsFormMaskedInputBaseComponent, 'ariaDescribedBy' | 'id' | 'isInvalid'>;
|
|
36
|
+
Select?: WithBoundArgs<typeof HdsFormSelectBaseComponent, 'ariaDescribedBy' | 'id' | 'isInvalid'>;
|
|
37
|
+
SuperSelectSingle?: WithBoundArgs<typeof HdsFormSuperSelectSingleBaseComponent, 'ariaDescribedBy' | 'ariaLabelledBy' | 'isInvalid' | 'triggerId'>;
|
|
38
|
+
SuperSelectMultiple?: WithBoundArgs<typeof HdsFormSuperSelectMultipleBaseComponent, 'ariaDescribedBy' | 'ariaLabelledBy' | 'isInvalid' | 'triggerId'>;
|
|
39
|
+
TextInput?: WithBoundArgs<typeof HdsFormTextInputBaseComponent, 'ariaDescribedBy' | 'id' | 'isInvalid'>;
|
|
40
|
+
Textarea?: WithBoundArgs<typeof HdsFormTextareaBaseComponent, 'ariaDescribedBy' | 'id' | 'isInvalid'>;
|
|
41
|
+
Error?: WithBoundArgs<typeof HdsFormErrorComponent, 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'>;
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
};
|
|
45
|
+
Element: HTMLDivElement;
|
|
46
|
+
}
|
|
47
|
+
export default class HdsFormKeyValueInputsField extends Component<HdsFormKeyValueInputsFieldSignature> {
|
|
48
|
+
private _onInsert;
|
|
49
|
+
get id(): string;
|
|
50
|
+
get labelHiddenText(): string;
|
|
51
|
+
get labelIdPrefix(): string;
|
|
52
|
+
appendDescriptor(element: HTMLElement): void;
|
|
53
|
+
removeDescriptor(element: HTMLElement): void;
|
|
54
|
+
}
|