Skip to content

Commit

Permalink
InputNumber | placeholder prop
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Aug 12, 2022
1 parent 8ff6f37 commit c6d34c9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api-generator/components/inputnumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ const InputNumberProps = [
default: "false",
description: "When present, it specifies that an input field is read-only."
},
{
name: "placeholder",
type: "string",
default: "null",
description: "Placeholder text for the input."
},
{
name: "inputId",
type: "string",
Expand Down
4 changes: 4 additions & 0 deletions src/components/inputnumber/InputNumber.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ export interface InputNumberProps {
* When present, it specifies that an input field is read-only.
*/
readonly?: boolean | undefined;
/**
* Placeholder text for the input.
*/
placeholder?: boolean | undefined;
/**
* Identifier of the focus input to match a label defined for the chips.
*/
Expand Down
6 changes: 5 additions & 1 deletion src/components/inputnumber/InputNumber.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<span :class="containerClass">
<INInputText ref="input" class="p-inputnumber-input" role="spinbutton" :id="inputId" :class="inputClass" :style="inputStyle" :value="formattedValue" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="modelValue" :readonly="readonly" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
<INInputText ref="input" class="p-inputnumber-input" role="spinbutton" :id="inputId" :class="inputClass" :style="inputStyle" :value="formattedValue" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="modelValue" :readonly="readonly" :placeholder="placeholder" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
@input="onUserInput" @keydown="onInputKeyDown" @keypress="onInputKeyPress" @paste="onPaste" @click="onInputClick" @focus="onInputFocus" @blur="onInputBlur" v-bind="inputProps"/>
<span class="p-inputnumber-button-group" v-if="showButtons && buttonLayout === 'stacked'">
<INButton :class="upButtonClass" :icon="incrementButtonIcon" v-on="upButtonListeners" :disabled="disabled" :tabindex="-1" aria-hidden="true" v-bind="incrementButtonProps" />
Expand Down Expand Up @@ -115,6 +115,10 @@ export default {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: null
},
inputId: null,
inputClass: null,
inputStyle: null,
Expand Down
6 changes: 6 additions & 0 deletions src/views/inputnumber/InputNumberDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ Vertical
<td>false</td>
<td>When present, it specifies that an input field is read-only.</td>
</tr>
<tr>
<td>placeholder</td>
<td>string</td>
<td>null</td>
<td>Placeholder text for the input.</td>
</tr>
<tr>
<td>inputId</td>
<td>string</td>
Expand Down

0 comments on commit c6d34c9

Please sign in to comment.