-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Front end input update feature (#17)
* add lock/unlock feature | Fix Bootstrap53Dto * Auto stash before rebase of "main" * update fe input types * add StringInput | add IntInput | add FloatInput | Fix SizeInput | FixColorInput | Fix cs * fix download file name
- Loading branch information
Showing
9 changed files
with
413 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<div> | ||
<label class="fw-bold text-muted text-capitalize" :for="modelValue.label">{{ modelValue.label }}</label> | ||
<div class="input-group w-100"> | ||
<!-- Input for float values --> | ||
<input | ||
type="number" | ||
step="0.01" | ||
class="form-control" | ||
v-model="computedFloat" | ||
@input="emitUpdatedValue" | ||
aria-label="Float value input" | ||
placeholder="Enter a float value" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "FloatInput", | ||
props: { | ||
modelValue: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
// Computed property to handle the float value | ||
computedFloat: { | ||
get() { | ||
return this.modelValue.value !== null && this.modelValue.value !== undefined | ||
? parseFloat(this.modelValue.value) | ||
: parseFloat(this.modelValue.default) || 0; | ||
}, | ||
set(newValue) { | ||
this.$set(this.modelValue, "value", newValue); | ||
}, | ||
}, | ||
}, | ||
methods: { | ||
emitUpdatedValue() { | ||
this.$emit("update:modelValue", this.modelValue); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<div> | ||
<label class="fw-bold text-muted text-capitalize" :for="modelValue.label">{{ modelValue.label }}</label> | ||
<div class="input-group w-100"> | ||
<!-- Input for integer values --> | ||
<input | ||
type="number" | ||
step="1" | ||
class="form-control" | ||
v-model="computedInteger" | ||
@input="emitUpdatedValue" | ||
aria-label="Integer value input" | ||
placeholder="Enter an integer" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "IntegerInput", | ||
props: { | ||
modelValue: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
// Computed property to handle integer values, defaulting if value is null | ||
computedInteger: { | ||
get() { | ||
return this.modelValue.value !== null && this.modelValue.value !== undefined | ||
? parseInt(this.modelValue.value, 10) | ||
: parseInt(this.modelValue.default, 10) || 0; | ||
}, | ||
set(newValue) { | ||
this.$set(this.modelValue, "value", parseInt(newValue, 10)); | ||
}, | ||
}, | ||
}, | ||
methods: { | ||
emitUpdatedValue() { | ||
// Emit the updated modelValue object to the parent | ||
this.$emit("update:modelValue", this.modelValue); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<div> | ||
<label class="fw-bold text-muted text-capitalize" :for="modelValue.label">{{ modelValue.label }}</label> | ||
<div class="input-group w-100"> | ||
<!-- Input for string values --> | ||
<input | ||
type="text" | ||
class="form-control" | ||
v-model="computedString" | ||
@input="emitUpdatedValue" | ||
aria-label="String value input" | ||
placeholder="Enter a text value" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "StringInput", | ||
props: { | ||
modelValue: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
// Computed property for string value, using modelValue.value or falling back to modelValue.default | ||
computedString: { | ||
get() { | ||
return this.modelValue.value !== null && this.modelValue.value !== undefined | ||
? this.modelValue.value | ||
: this.modelValue.default || ""; | ||
}, | ||
set(newValue) { | ||
this.$set(this.modelValue, "value", newValue); | ||
}, | ||
}, | ||
}, | ||
methods: { | ||
emitUpdatedValue() { | ||
// Emit the updated modelValue object to the parent | ||
this.$emit("update:modelValue", this.modelValue); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.