mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props
This commit is contained in:
parent
d38e6d8be6
commit
75d4b4cf03
219 changed files with 5168 additions and 5259 deletions
208
types/Slider/Slider.d.ts
vendored
208
types/Slider/Slider.d.ts
vendored
|
@ -1,109 +1,111 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface SliderProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Specify the value of the slider
|
||||
* @default 0
|
||||
*/
|
||||
value?: number;
|
||||
|
||||
/**
|
||||
* Set the maximum slider value
|
||||
* @default 100
|
||||
*/
|
||||
max?: number;
|
||||
|
||||
/**
|
||||
* Specify the label for the max value
|
||||
* @default ""
|
||||
*/
|
||||
maxLabel?: string;
|
||||
|
||||
/**
|
||||
* Set the minimum slider value
|
||||
* @default 0
|
||||
*/
|
||||
min?: number;
|
||||
|
||||
/**
|
||||
* Specify the label for the min value
|
||||
* @default ""
|
||||
*/
|
||||
minLabel?: string;
|
||||
|
||||
/**
|
||||
* Set the step value
|
||||
* @default 1
|
||||
*/
|
||||
step?: number;
|
||||
|
||||
/**
|
||||
* Set the step multiplier value
|
||||
* @default 4
|
||||
*/
|
||||
stepMultiplier?: number;
|
||||
|
||||
/**
|
||||
* Set to `true` to require a value
|
||||
* @default false
|
||||
*/
|
||||
required?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the input type
|
||||
* @default "number"
|
||||
*/
|
||||
inputType?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the slider
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to hide the text input
|
||||
* @default false
|
||||
*/
|
||||
hideTextInput?: boolean;
|
||||
|
||||
/**
|
||||
* Set an id for the slider div element
|
||||
* @default "ccs-" + Math.random().toString(36)
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to indicate an invalid state
|
||||
* @default false
|
||||
*/
|
||||
invalid?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the label text
|
||||
* @default ""
|
||||
*/
|
||||
labelText?: string;
|
||||
|
||||
/**
|
||||
* Set a name for the slider element
|
||||
* @default ""
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLDivElement;
|
||||
}
|
||||
|
||||
export default class Slider {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Specify the value of the slider
|
||||
* @default 0
|
||||
*/
|
||||
value?: number;
|
||||
|
||||
/**
|
||||
* Set the maximum slider value
|
||||
* @default 100
|
||||
*/
|
||||
max?: number;
|
||||
|
||||
/**
|
||||
* Specify the label for the max value
|
||||
* @default ""
|
||||
*/
|
||||
maxLabel?: string;
|
||||
|
||||
/**
|
||||
* Set the minimum slider value
|
||||
* @default 0
|
||||
*/
|
||||
min?: number;
|
||||
|
||||
/**
|
||||
* Specify the label for the min value
|
||||
* @default ""
|
||||
*/
|
||||
minLabel?: string;
|
||||
|
||||
/**
|
||||
* Set the step value
|
||||
* @default 1
|
||||
*/
|
||||
step?: number;
|
||||
|
||||
/**
|
||||
* Set the step multiplier value
|
||||
* @default 4
|
||||
*/
|
||||
stepMultiplier?: number;
|
||||
|
||||
/**
|
||||
* Set to `true` to require a value
|
||||
* @default false
|
||||
*/
|
||||
required?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the input type
|
||||
* @default "number"
|
||||
*/
|
||||
inputType?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the slider
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to hide the text input
|
||||
* @default false
|
||||
*/
|
||||
hideTextInput?: boolean;
|
||||
|
||||
/**
|
||||
* Set an id for the slider div element
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to indicate an invalid state
|
||||
* @default false
|
||||
*/
|
||||
invalid?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the label text
|
||||
* @default ""
|
||||
*/
|
||||
labelText?: string;
|
||||
|
||||
/**
|
||||
* Set a name for the slider element
|
||||
* @default ""
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLElement;
|
||||
};
|
||||
|
||||
$$prop_def: SliderProps;
|
||||
$$slot_def: {};
|
||||
|
||||
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
|
||||
|
|
17
types/Slider/SliderSkeleton.d.ts
vendored
17
types/Slider/SliderSkeleton.d.ts
vendored
|
@ -1,14 +1,15 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export default class SliderSkeleton {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Set to `true` to hide the label text
|
||||
* @default false
|
||||
*/
|
||||
hideLabel?: boolean;
|
||||
};
|
||||
export interface SliderSkeletonProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set to `true` to hide the label text
|
||||
* @default false
|
||||
*/
|
||||
hideLabel?: boolean;
|
||||
}
|
||||
|
||||
export default class SliderSkeleton {
|
||||
$$prop_def: SliderSkeletonProps;
|
||||
$$slot_def: {};
|
||||
|
||||
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue