Skip to content

Commit

Permalink
MINOR: add of readonly props within textarea component (#147)
Browse files Browse the repository at this point in the history
* add of readonly props within textarea component

* add of doc informations for readonly props
  • Loading branch information
pvilalta authored Dec 22, 2021
1 parent 2185599 commit 785c3dc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
:value="modelValue"
:placeholder="placeholder"
:disabled="disabled"
:readonly="readonly"
@input="$emit('update:modelValue', $event.currentTarget.value)"
/>
<label :for="name">{{ label }}</label>
Expand Down Expand Up @@ -61,6 +62,10 @@ export default {
type: String,
default: "",
},
readonly: {
type: Boolean,
default: false,
},
width: {
type: [Number, String],
default: "150px",
Expand Down
18 changes: 18 additions & 0 deletions src/web/views/Components/Textarea/Textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
:autofocus="getAutofocus()"
:placeholder="getPlaceholder()"
:disabled="getDisabled()"
:readonly="getReadonly()"
/>
</template>

<template #parameters>
<BIMDataCheckbox text="autofocus" v-model="autofocus" />
<BIMDataCheckbox text="placeholder" v-model="placeholder" />
<BIMDataCheckbox text="disabled" v-model="disabled" />
<BIMDataCheckbox text="readonly" v-model="readonly" />
</template>

<template #import>
Expand All @@ -41,6 +43,8 @@
{{ autofocus ? ':autofocus="true"' : "" }}
{{ placeholder ? ':placeholder="true"' : "" }}
{{ disabled ? ':disabled="true"' : "" }}
{{ readonly ? ':readonly="true"' : "" }}

/&gt;
</pre>
</template>
Expand Down Expand Up @@ -78,6 +82,7 @@ export default {
autofocus: false,
placeholder: false,
disabled: false,
readonly: false,
propsData: [
["Props", "Type", "Default value", "Description"],
[
Expand Down Expand Up @@ -122,6 +127,12 @@ export default {
"false",
"Use this boolean to disabled your textarea.",
],
[
"readonly",
"Boolean",
"false",
"Use this boolean to make your textarea readonly.",
],
],
};
},
Expand All @@ -146,6 +157,13 @@ export default {
return false;
}
},
getReadonly() {
if (this.readonly) {
return true;
} else {
return false;
}
},
},
};
</script>

0 comments on commit 785c3dc

Please sign in to comment.