Refactor #2801 - RadioButton
parent
14accb512c
commit
0eddc7f2eb
|
@ -10,13 +10,29 @@ export interface RadioButtonProps {
|
||||||
*/
|
*/
|
||||||
modelValue?: any;
|
modelValue?: any;
|
||||||
/**
|
/**
|
||||||
* Style class of the component input field.
|
* Name of the input element.
|
||||||
*/
|
*/
|
||||||
class?: any;
|
name?: string | undefined;
|
||||||
/**
|
/**
|
||||||
* Inline style of the component.
|
* When present, it specifies that the component should be disabled.
|
||||||
*/
|
*/
|
||||||
style?: any;
|
disabled?: boolean | undefined;
|
||||||
|
/**
|
||||||
|
* Identifier of the underlying input element.
|
||||||
|
*/
|
||||||
|
inputId?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Inline style of the input field.
|
||||||
|
*/
|
||||||
|
inputStyle?: any;
|
||||||
|
/**
|
||||||
|
* Style class of the input field.
|
||||||
|
*/
|
||||||
|
inputClass?: any;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
inputProps?: object | undefined;
|
||||||
/**
|
/**
|
||||||
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="containerClass" @click="onClick($event)">
|
<div :class="containerClass" @click="onClick($event)">
|
||||||
<div class="p-hidden-accessible">
|
<div class="p-hidden-accessible">
|
||||||
<input ref="input" type="radio" :id="inputId" :name="name" :checked="checked" :disabled="disabled" :value="value" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" @focus="onFocus" @blur="onBlur" v-bind="inputProps">
|
<input ref="input" type="radio" :id="inputId" :class="inputClass" :style="inputStyle" :name="name" :checked="checked" :disabled="disabled" :value="value" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
|
||||||
|
@focus="onFocus" @blur="onBlur" v-bind="inputProps">
|
||||||
</div>
|
</div>
|
||||||
<div ref="box" :class="['p-radiobutton-box', {'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused}]">
|
<div ref="box" :class="['p-radiobutton-box', {'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused}]">
|
||||||
<div class="p-radiobutton-icon"></div>
|
<div class="p-radiobutton-icon"></div>
|
||||||
|
@ -18,22 +19,18 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
value: null,
|
value: null,
|
||||||
modelValue: null,
|
modelValue: null,
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
inputId: {
|
|
||||||
type: String,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
inputProps: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
inputId: null,
|
||||||
|
inputClass: null,
|
||||||
|
inputStyle: null,
|
||||||
|
inputProps: null,
|
||||||
'aria-labelledby': {
|
'aria-labelledby': {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
|
|
|
@ -68,16 +68,34 @@ export default {
|
||||||
<td>Value binding of the checkbox.</td>
|
<td>Value binding of the checkbox.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>style</td>
|
<td>name</td>
|
||||||
<td>any</td>
|
<td>string</td>
|
||||||
|
<td>null</td>
|
||||||
|
<td>Name of the input element.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>disabled</td>
|
||||||
|
<td>boolean</td>
|
||||||
|
<td>false</td>
|
||||||
|
<td>When present, it specifies that the element should be disabled.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>inputId</td>
|
||||||
|
<td>string</td>
|
||||||
<td>null</td>
|
<td>null</td>
|
||||||
<td>Style class of the component input field.</td>
|
<td>Style class of the component input field.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>class</td>
|
<td>inputClass</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>null</td>
|
<td>null</td>
|
||||||
<td>Inline style of the component.</td>
|
<td>Style class of the input field.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>inputStyle</td>
|
||||||
|
<td>any</td>
|
||||||
|
<td>null</td>
|
||||||
|
<td>Inline style of the input field.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue