This commit is contained in:
mertsincan 2024-01-14 13:38:51 +00:00
parent c06c73e285
commit bd5b3f7c6a
22 changed files with 258 additions and 463 deletions

View file

@ -30,6 +30,10 @@ export interface InputSwitchPassThroughMethodOptions {
* Defines current inline state.
*/
state: InputSwitchState;
/**
* Defines current options.
*/
context: InputSwitchContext;
/**
* Defines valid attributes.
*/
@ -53,18 +57,14 @@ export interface InputSwitchPassThroughOptions {
* Used to pass attributes to the root's DOM element.
*/
root?: InputSwitchPassThroughOptionType;
/**
* Used to pass attributes to the input's DOM element.
*/
input?: InputSwitchPassThroughOptionType;
/**
* Used to pass attributes to the slider's DOM element.
*/
slider?: InputSwitchPassThroughOptionType;
/**
* Used to pass attributes to the hidden input wrapper's DOM element.
*/
hiddenInputWrapper?: InputSwitchPassThroughOptionType;
/**
* Used to pass attributes to the hidden input's DOM element.
*/
hiddenInput?: InputSwitchPassThroughOptionType;
/**
* Used to manage all lifecycle hooks.
* @see {@link BaseComponent.ComponentHooks}
@ -83,11 +83,7 @@ export interface InputSwitchPassThroughAttributes {
* Defines current inline state in InputSwitch component.
*/
export interface InputSwitchState {
/**
* Current focus state as a boolean.
* @defaultValue false
*/
focused: boolean;
[key: string]: any;
}
/**
@ -114,6 +110,15 @@ export interface InputSwitchProps {
* @defaultValue false
*/
disabled?: boolean | undefined;
/**
* When present, it specifies that an input field is read-only.
* @default false
*/
readonly?: boolean | undefined;
/**
* Index of the element in tabbing order.
*/
tabindex?: number | undefined;
/**
* Identifier of the underlying input element.
*/
@ -155,6 +160,22 @@ export interface InputSwitchProps {
unstyled?: boolean;
}
/**
* Defines current options in InputSwitch component.
*/
export interface InputSwitchContext {
/**
* Current checked state of the item as a boolean.
* @defaultValue false
*/
checked: boolean;
/**
* Current disabled state of the item as a boolean.
* @defaultValue false
*/
disabled: boolean;
}
export interface InputSwitchSlots {}
/**
@ -166,21 +187,21 @@ export interface InputSwitchEmits {
* @param {boolean} value - New value.
*/
'update:modelValue'(value: boolean): void;
/**
* Callback to invoke on click.
* @param {Event} event - Browser event.
*/
click(event: Event): void;
/**
* Callback to invoke on value change.
* @param {Event} event - Browser event.
*/
change(event: Event): void;
/**
* Callback to invoke on value change.
* @param {boolean} value - New value.
* Callback to invoke when the component receives focus.
* @param {Event} event - Browser event.
*/
input(value: boolean): void;
focus(event: Event): void;
/**
* Callback to invoke when the component loses focus.
* @param {Event} event - Browser event.
*/
blur(event: Event): void;
}
/**