2019-09-28 21:42:04 +03:00
|
|
|
<template>
|
2020-06-26 04:39:14 -07:00
|
|
|
<div>
|
|
|
|
|
<v-row
|
|
|
|
|
dense
|
|
|
|
|
align="center"
|
|
|
|
|
>
|
2023-06-09 13:09:41 -04:00
|
|
|
<v-col :cols="labelCols || (12 - (inputCols || 8))">
|
2020-07-31 13:50:50 -07:00
|
|
|
<tooltipped-label
|
|
|
|
|
:tooltip="tooltip"
|
|
|
|
|
:text="name"
|
|
|
|
|
/>
|
2020-06-26 04:39:14 -07:00
|
|
|
</v-col>
|
2020-07-31 13:50:50 -07:00
|
|
|
<v-col :cols="inputCols || 8">
|
2020-06-26 04:39:14 -07:00
|
|
|
<v-text-field
|
|
|
|
|
v-model="localValue"
|
|
|
|
|
dark
|
|
|
|
|
dense
|
2020-07-31 13:50:50 -07:00
|
|
|
color="accent"
|
2020-06-26 04:39:14 -07:00
|
|
|
:disabled="disabled"
|
|
|
|
|
:error-messages="errorMessage"
|
2020-07-31 13:50:50 -07:00
|
|
|
:rules="rules"
|
|
|
|
|
class="mt-1 pt-2"
|
2020-06-26 04:39:14 -07:00
|
|
|
@keydown="handleKeyboard"
|
|
|
|
|
/>
|
|
|
|
|
</v-col>
|
|
|
|
|
</v-row>
|
|
|
|
|
</div>
|
2019-09-28 21:42:04 +03:00
|
|
|
</template>
|
2022-12-01 13:42:21 -05:00
|
|
|
|
2019-09-28 21:42:04 +03:00
|
|
|
<script>
|
2020-07-31 13:50:50 -07:00
|
|
|
import TooltippedLabel from "./cv-tooltipped-label";
|
|
|
|
|
|
2019-09-28 21:42:04 +03:00
|
|
|
export default {
|
|
|
|
|
name: 'Input',
|
2020-07-31 13:50:50 -07:00
|
|
|
components: {
|
|
|
|
|
TooltippedLabel
|
|
|
|
|
},
|
|
|
|
|
// eslint-disable-next-line vue/require-prop-types
|
2023-06-09 13:09:41 -04:00
|
|
|
props: ['name', 'value', 'disabled', 'errorMessage', 'inputCols', 'labelCols', 'rules', 'tooltip'],
|
2019-09-28 21:42:04 +03:00
|
|
|
data() {
|
2019-10-29 23:58:06 +02:00
|
|
|
return {}
|
2019-09-28 21:42:04 +03:00
|
|
|
},
|
2019-10-29 23:58:06 +02:00
|
|
|
computed: {
|
|
|
|
|
localValue: {
|
|
|
|
|
get() {
|
2019-09-28 21:42:04 +03:00
|
|
|
return this.value;
|
|
|
|
|
},
|
2019-10-29 23:58:06 +02:00
|
|
|
set(value) {
|
|
|
|
|
this.$emit('input', value);
|
2019-09-28 21:42:04 +03:00
|
|
|
}
|
|
|
|
|
}
|
2020-06-26 04:39:14 -07:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleKeyboard(event) {
|
|
|
|
|
if (event.key === "Enter") {
|
|
|
|
|
this.$emit("Enter");
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-28 21:42:04 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2020-07-31 13:50:50 -07:00
|
|
|
<style lang="css" scoped>
|
2021-11-21 17:22:56 -08:00
|
|
|
</style>
|