pull/2809/head
Tuğçe Küçükoğlu 2022-07-22 21:55:07 +03:00
parent de236bdf6c
commit e1b9982b22
4 changed files with 43 additions and 9 deletions

View File

@ -29,6 +29,12 @@ const ChipsProps = [
default: "false", default: "false",
description: "Whether to allow duplicate values or not." description: "Whether to allow duplicate values or not."
}, },
{
name: "disabled",
type: "boolean",
default: "false",
description: "When present, it specifies that the element should be disabled."
},
{ {
name: "inputId", name: "inputId",
type: "string", type: "string",
@ -36,10 +42,16 @@ const ChipsProps = [
description: "Identifier of the focus input to match a label defined for the chips." description: "Identifier of the focus input to match a label defined for the chips."
}, },
{ {
name: "disabled", name: "inputClass",
type: "boolean", type: "string",
default: "false", default: "null",
description: "When present, it specifies that the element should be disabled." description: "Style class of the input field."
},
{
name: "inputStyle",
type: "any",
default: "null",
description: "Inline style of the input field."
}, },
{ {
name: "'aria-labelledby'", name: "'aria-labelledby'",

View File

@ -43,6 +43,14 @@ export interface ChipsProps {
* Identifier of the focus input to match a label defined for the chips. * Identifier of the focus input to match a label defined for the chips.
*/ */
inputId?: string | undefined; inputId?: string | undefined;
/**
* Style class of the input field.
*/
inputClass?: any | undefined;
/**
* Inline style of the input field.
*/
inputStyle?: any | undefined;
/** /**
* *
*/ */

View File

@ -8,7 +8,7 @@
<span class="p-chips-token-icon pi pi-times-circle" @click="removeItem($event, i)"></span> <span class="p-chips-token-icon pi pi-times-circle" @click="removeItem($event, i)"></span>
</li> </li>
<li class="p-chips-input-token"> <li class="p-chips-input-token">
<input ref="input" type="text" :id="inputId" :disabled="disabled || maxedOut" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" <input ref="input" type="text" :id="inputId" :class="inputClass" :style="inputStyle" :disabled="disabled || maxedOut" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
@focus="onFocus($event)" @blur="onBlur($event)" @input="onInput" @keydown="onKeyDown($event)" @paste="onPaste($event)" v-bind="inputProps"> @focus="onFocus($event)" @blur="onBlur($event)" @input="onInput" @keydown="onKeyDown($event)" @paste="onPaste($event)" v-bind="inputProps">
</li> </li>
</ul> </ul>
@ -41,6 +41,8 @@ export default {
default: true default: true
}, },
inputId: null, inputId: null,
inputClass: null,
inputStyle: null,
inputProps: null, inputProps: null,
disabled: { disabled: {
type: Boolean, type: Boolean,

View File

@ -77,6 +77,12 @@ import Chips from 'primevue/chips';
<td>true</td> <td>true</td>
<td>Whether to allow duplicate values or not.</td> <td>Whether to allow duplicate values or not.</td>
</tr> </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> <tr>
<td>inputId</td> <td>inputId</td>
<td>string</td> <td>string</td>
@ -84,10 +90,16 @@ import Chips from 'primevue/chips';
<td>Style class of the component input field.</td> <td>Style class of the component input field.</td>
</tr> </tr>
<tr> <tr>
<td>disabled</td> <td>inputClass</td>
<td>boolean</td> <td>string</td>
<td>false</td> <td>null</td>
<td>When present, it specifies that the element should be disabled.</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>