Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
feat(input): added readonly attr
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Oct 18, 2020
1 parent 7d7fd1c commit 20dba55
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
13 changes: 7 additions & 6 deletions dev/typescript/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export default defineComponent({
'color',
'customField1',
'customStyles',
'readonly',
],
fields: {
name: {
Expand All @@ -109,16 +110,10 @@ export default defineComponent({
label: 'Email',
type: 'email',
validations: [emailValidator],
/* customClass: 'active text-red', */
customClass: {
active: true,
'text-blue': true,
},
/* customClass: {
active: true,
'text-blue': true,
}, */
/* customClass: ['active', 'text-red'], */
} as EmailInput,
password: {
label: 'Password',
Expand Down Expand Up @@ -208,6 +203,12 @@ export default defineComponent({
border: '1px solid teal',
},
} as TextInput,
readonly: {
label: 'Readonly',
type: 'text',
value: 'Alvaro',
readonly: true,
} as TextInput,
},
});
Expand Down
1 change: 1 addition & 0 deletions src/components/number-input/NumberInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default defineComponent({
disabled: props?.control?.disabled,
placeholder: props?.control?.placeholder,
required: props.control.required,
readonly: props?.control.readonly,
autocomplete: props.control.autocomplete,
ariaLabel: props.control.ariaLabel,
ariaLabelledBy: props.control.ariaLabelledBy,
Expand Down
7 changes: 5 additions & 2 deletions src/components/select-input/SelectInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ export default defineComponent({
{
id: props.control.name,
name: props?.control?.name || '',
class: ['form-control'],
value: props?.control?.value,
disabled: props?.control?.disabled,
placeholder: props?.control?.placeholder,
required: props.control.required,
readonly: props?.control.readonly,
ariaLabel: props.control.ariaLabel,
ariaLabelledBy: props.control.ariaLabelledBy,
ariaRequired: props.control.required,
class: ['form-control'],
value: props?.control?.value,
onFocus,
onBlur,
onChange,
Expand Down
1 change: 1 addition & 0 deletions src/components/text-area-input/TextAreaInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default defineComponent({
placeholder: props?.control?.placeholder,
required: props.control.required,
autocomplete: props.control.autocomplete,
readonly: props?.control.readonly,
ariaLabel: props.control.ariaLabel,
ariaLabelledBy: props.control.ariaLabelledBy,
ariaRequired: props.control.required,
Expand Down
1 change: 1 addition & 0 deletions src/components/text-input/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default defineComponent({
disabled: props.control.disabled,
placeholder: props.control.placeholder,
required: props.control.required,
readonly: props?.control.readonly,
autocomplete: props.control.autocomplete,
ariaRequired: props.control.required,
ariaLabel: props.control.ariaLabel,
Expand Down
1 change: 1 addition & 0 deletions src/core/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface InputBase {
customStyles?: string | string[] | BindingObject | BindingObject[] | unknown;
placeholder?: string;
autocomplete?: string;
readonly?: boolean;
validations?: FormValidation[];
}

Expand Down

0 comments on commit 20dba55

Please sign in to comment.