@scania/tegel
Version:
Tegel Design System
62 lines (61 loc) • 2.39 kB
TypeScript
import { EventEmitter } from '../../stencil-public-runtime';
/**
* @slot prefix - Slot for the prefix icon.
* @slot label - Slot for the label text.
* @slot suffix - Slot for the suffix icon.
*/
export declare class TdsChip {
host: HTMLElement;
/** Type of Chip, depends on usage */
type: 'button' | 'radio' | 'checkbox';
/** Size of the Chip component */
size: 'sm' | 'lg';
/** ID used for internal Chip functionality and events, must be unique.
*
* **NOTE**: If you're listening for input events, you need to set this ID yourself to identify the input,
* as the default ID is random and will be different every time.
*/
chipId: string;
/** Controls component's checked attribute. Valid only for type checkbox and radio. */
checked: boolean;
/** Name for the checkbox or radio input element. Also creates a reference between label and input. Valid only for type checkbox and radio. */
name: string;
/** Value of input. Valid only for type checkbox and radio. */
value: string;
/** Sets the Chip in a disabled state */
disabled: boolean;
/** Value to be used for the aria-label attribute */
tdsAriaLabel: string;
/** Sends unique Chip identifier and value when it is changed (checked/unchecked).
* Valid only for type checkbox and radio.
* If no ID is specified, a random one will be generated.
* To use this listener, don't use the randomized ID, use a specific one of your choosing. */
tdsChange: EventEmitter<{
chipId: string;
value: string;
checked?: boolean;
}>;
/** @internal Emit checked value if type is radio */
internalRadioOnChange: EventEmitter<{
chipId: string;
checked: boolean;
groupName: string;
}>;
private handleChange;
handleInternaRadioChange(event: CustomEvent<{
chipId: string;
checked: boolean;
groupName: string;
}>): void;
/** Sends unique Chip identifier when Chip is clicked.
* Valid only for type button.
* If no ID is specified, a random one will be generated.
* To use this listener, don't use the randomized ID, use a specific one of your choosing. */
tdsClick: EventEmitter<{
chipId: string;
}>;
private handleClick;
private renderInputAttributes;
connectedCallback(): void;
render(): any;
}