@hashicorp/design-system-components
Version:
Helios Design System Components
48 lines (47 loc) • 2.05 kB
TypeScript
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import { HdsAdvancedTableScopeValues } from './types.ts';
import type { HdsAdvancedTableScope, HdsAdvancedTableThSortOrder } from './types.ts';
import type { HdsFormCheckboxBaseSignature } from '../form/checkbox/base.ts';
import type { HdsAdvancedTableSignature } from './index.ts';
import type { HdsAdvancedTableThSelectableSignature } from './th-selectable.ts';
export interface BaseHdsAdvancedTableTrSignature {
Args: {
selectableColumnKey?: HdsAdvancedTableSignature['Args']['selectableColumnKey'];
isLastRow?: boolean;
isSelectable?: boolean;
isSelected?: false;
isParentRow?: boolean;
selectionAriaLabelSuffix?: string;
selectionKey?: string;
selectionScope?: HdsAdvancedTableScope;
sortBySelectedOrder?: HdsAdvancedTableThSortOrder;
depth?: number;
didInsert?: (checkbox: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string) => void;
onSelectionChange?: (checkbox?: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string) => void;
willDestroy?: () => void;
onClickSortBySelected?: HdsAdvancedTableThSelectableSignature['Args']['onClickSortBySelected'];
displayRow?: boolean;
hasStickyColumn?: boolean;
isStickyColumnPinned?: boolean;
};
Blocks: {
default?: [];
};
Element: HTMLDivElement;
}
export interface SelectableHdsAdvancedTableTrArgs extends BaseHdsAdvancedTableTrSignature {
Args: BaseHdsAdvancedTableTrSignature['Args'] & {
isSelectable: true;
selectionScope?: HdsAdvancedTableScopeValues.Row;
selectionKey: string;
};
}
export type HdsAdvancedTableTrSignature = BaseHdsAdvancedTableTrSignature | SelectableHdsAdvancedTableTrArgs;
export default class HdsAdvancedTableTr extends Component<HdsAdvancedTableTrSignature> {
get selectionKey(): string | undefined;
get classNames(): string;
}