diff --git a/components/lib/togglebutton/ToggleButton.d.ts b/components/lib/togglebutton/ToggleButton.d.ts index 57b997061..e2c8df251 100755 --- a/components/lib/togglebutton/ToggleButton.d.ts +++ b/components/lib/togglebutton/ToggleButton.d.ts @@ -10,6 +10,60 @@ import { InputHTMLAttributes, VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +export declare type ToggleButtonPassThroughOptionType = ToggleButtonPassThroughAttributes | ((options: ToggleButtonPassThroughMethodOptions) => ToggleButtonPassThroughAttributes) | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface ToggleButtonPassThroughMethodOptions { + props: ToggleButtonProps; + state: ToggleButtonState; +} + +/** + * Custom passthrough(pt) options. + * @see {@link ToggleButtonProps.pt} + */ +export interface ToggleButtonPassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: ToggleButtonPassThroughOptionType; + /** + * Uses to pass attributes to the input aria's DOM element. + */ + inputAria?: ToggleButtonPassThroughOptionType; + /** + * Uses to pass attributes to the input's DOM element. + */ + input?: ToggleButtonPassThroughOptionType; + /** + * Uses to pass attributes to the icon's DOM element. + */ + icon?: ToggleButtonPassThroughOptionType; + /** + * Uses to pass attributes to the label's DOM element. + */ + label?: ToggleButtonPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface ToggleButtonPassThroughAttributes { + [key: string]: any; +} + +/** + * Defines current inline state in ToggleButton component. + */ +export interface ToggleButtonState { + /** + * Focused state as a number. + */ + focused: boolean; +} + /** * Defines valid properties in ToggleButton component. */ @@ -77,6 +131,11 @@ export interface ToggleButtonProps { * Establishes a string value that labels the component. */ 'aria-label'?: string | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {ToggleButtonPassThroughOptions} + */ + pt?: ToggleButtonPassThroughOptions; } /** diff --git a/components/lib/togglebutton/ToggleButton.vue b/components/lib/togglebutton/ToggleButton.vue index 5954950ec..a5b68e52b 100755 --- a/components/lib/togglebutton/ToggleButton.vue +++ b/components/lib/togglebutton/ToggleButton.vue @@ -1,6 +1,6 @@ diff --git a/doc/togglebutton/pt/PTImage.vue b/doc/togglebutton/pt/PTImage.vue new file mode 100644 index 000000000..9ac50d6b4 --- /dev/null +++ b/doc/togglebutton/pt/PTImage.vue @@ -0,0 +1,8 @@ + diff --git a/doc/togglebutton/pt/index.vue b/doc/togglebutton/pt/index.vue new file mode 100644 index 000000000..33c500bb2 --- /dev/null +++ b/doc/togglebutton/pt/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/doc/tristatecheckbox/pt/index.vue b/doc/tristatecheckbox/pt/index.vue index 3272c69b2..597bf4d49 100644 --- a/doc/tristatecheckbox/pt/index.vue +++ b/doc/tristatecheckbox/pt/index.vue @@ -1,7 +1,7 @@