carbon-components-svelte
Version:
Svelte implementation of the Carbon Design System
85 lines (69 loc) • 1.83 kB
TypeScript
import { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
export type CarbonTimePickerSelectContext = {
selectedValue: import("svelte/store").Writable<number | string>;
};
type $RestProps = SvelteHTMLElements["div"];
type $Props = {
/**
* Specify the select value.
* @default ""
*/
value?: number | string;
/**
* Set to `true` to disable the select
* @default false
*/
disabled?: boolean;
/**
* Set to `true` for the select to be read-only
* @default false
*/
readonly?: boolean;
/**
* Specify the ARIA label for the chevron icon
* @default "Open list of options"
*/
iconDescription?: string;
/**
* Specify the label text
* @default ""
*/
labelText?: string;
/**
* Set an id for the select element
* @default `ccs-${Math.random().toString(36)}`
*/
id?: string;
/**
* Specify a name attribute for the select element.
* @default undefined
*/
name?: string;
/**
* Obtain a reference to the select HTML element.
* @default null
*/
ref?: null | HTMLSelectElement;
labelChildren?: (this: void) => void;
children?: (this: void) => void;
[key: `data-${string}`]: unknown;
};
export type TimePickerSelectProps = Omit<$RestProps, keyof $Props> & $Props;
export default class TimePickerSelect extends SvelteComponentTyped<
TimePickerSelectProps,
{
blur: WindowEventMap["blur"];
change: WindowEventMap["change"];
click: WindowEventMap["click"];
focus: WindowEventMap["focus"];
input: WindowEventMap["input"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
mouseover: WindowEventMap["mouseover"];
},
{
default: Record<string, never>;
labelChildren: Record<string, never>;
}
> {}