Refactor #3922 - For ToggleButton

This commit is contained in:
Tuğçe Küçükoğlu 2023-05-09 11:57:03 +03:00
parent 53b595a236
commit f624aa2b9f
3 changed files with 22 additions and 26 deletions

View file

@ -29,14 +29,6 @@ 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.
*/
@ -45,6 +37,14 @@ export interface ToggleButtonPassThroughOptions {
* Uses to pass attributes to the label's DOM element.
*/
label?: ToggleButtonPassThroughOptionType;
/**
* Uses to pass attributes to the hidden input wrapper's DOM element.
*/
hiddenInputWrapper?: ToggleButtonPassThroughOptionType;
/**
* Uses to pass attributes to the hidden input's DOM element.
*/
hiddenInput?: ToggleButtonPassThroughOptionType;
}
/**

View file

@ -1,6 +1,6 @@
<template>
<div ref="container" v-ripple :class="buttonClass" @click="onClick($event)" v-bind="ptm('root')">
<span class="p-hidden-accessible" v-bind="ptm('inputAria')">
<span class="p-hidden-accessible" v-bind="ptm('hiddenInputWrapper')">
<input
:id="inputId"
type="checkbox"
@ -13,7 +13,7 @@
:aria-label="ariaLabel"
@focus="onFocus($event)"
@blur="onBlur($event)"
v-bind="{ ...inputProps, ...ptm('input') }"
v-bind="{ ...inputProps, ...ptm('hiddenInput') }"
/>
</span>
<slot name="icon" :value="modelValue" :class="iconClass">