Added item and container forms
This commit is contained in:
@@ -13,9 +13,14 @@ let ContainerSchema = schema({
|
||||
optional: true,
|
||||
trim: false
|
||||
},
|
||||
isCarried: {
|
||||
carried: {
|
||||
type: Boolean,
|
||||
defaultValue: true,
|
||||
optional: true,
|
||||
},
|
||||
contentsWeightless: {
|
||||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
weight: {
|
||||
type: Number,
|
||||
|
||||
80
app/imports/ui/forms/ContainerForm.vue
Normal file
80
app/imports/ui/forms/ContainerForm.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template lang="html">
|
||||
<div class="attribute-form">
|
||||
<text-field
|
||||
label="Name"
|
||||
:value="model.name"
|
||||
@change="(value, ack) => $emit('change', {path: ['name'], value, ack})"
|
||||
:error-messages="errors.name"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<div class="layout row wrap">
|
||||
<text-field
|
||||
label="Value"
|
||||
suffix="gp"
|
||||
type="number"
|
||||
min="0"
|
||||
hint="The value of the item in gold pieces, using decimals for values less than 1 gp"
|
||||
class="mx-1"
|
||||
style="flex-basis: 300px;"
|
||||
:value="model.value"
|
||||
@change="(value, ack) => $emit('change', {path: ['value'], value, ack})"
|
||||
:error-messages="errors.value"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<text-field
|
||||
label="Weight"
|
||||
suffix="lbs"
|
||||
type="number"
|
||||
min="0"
|
||||
class="mx-1"
|
||||
style="flex-basis: 300px;"
|
||||
:value="model.weight"
|
||||
@change="(value, ack) => $emit('change', {path: ['weight'], value, ack})"
|
||||
:error-messages="errors.weight"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
</div>
|
||||
<text-area
|
||||
label="Description"
|
||||
:value="model.description"
|
||||
:error-messages="errors.description"
|
||||
@change="(value, ack) => $emit('change', {path: ['description'], value, ack})"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<form-section name="Advanced" standalone>
|
||||
<v-switch
|
||||
label="Carried"
|
||||
:input-value="model.carried"
|
||||
:error-messages="errors.carried"
|
||||
@change="e => $emit('change', {path: ['carried'], value})"
|
||||
/>
|
||||
<v-switch
|
||||
label="Contents are weightless"
|
||||
:input-value="model.contentsWeightless"
|
||||
:error-messages="errors.contentsWeightless"
|
||||
@change="e => $emit('change', {path: ['contentsWeightless'], value})"
|
||||
/>
|
||||
</form-section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FormSection from '/imports/ui/forms/components/FormSection.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FormSection,
|
||||
},
|
||||
props: {
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
errors: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
debounceTime: Number,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
96
app/imports/ui/forms/ItemForm.vue
Normal file
96
app/imports/ui/forms/ItemForm.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template lang="html">
|
||||
<div class="attribute-form">
|
||||
<text-field
|
||||
label="Name"
|
||||
:value="model.name"
|
||||
@change="(value, ack) => $emit('change', {path: ['name'], value, ack})"
|
||||
:error-messages="errors.name"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<text-field
|
||||
label="Plural name"
|
||||
:value="model.plural"
|
||||
@change="(value, ack) => $emit('change', {path: ['plural'], value, ack})"
|
||||
:error-messages="errors.plural"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<div class="layout row wrap">
|
||||
<text-field
|
||||
label="Value"
|
||||
suffix="gp"
|
||||
type="number"
|
||||
min="0"
|
||||
hint="The value of the item in gold pieces, using decimals for values less than 1 gp"
|
||||
class="mx-1"
|
||||
style="flex-basis: 300px;"
|
||||
:value="model.value"
|
||||
@change="(value, ack) => $emit('change', {path: ['value'], value, ack})"
|
||||
:error-messages="errors.value"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<text-field
|
||||
label="Weight"
|
||||
suffix="lbs"
|
||||
type="number"
|
||||
min="0"
|
||||
class="mx-1"
|
||||
style="flex-basis: 300px;"
|
||||
:value="model.weight"
|
||||
@change="(value, ack) => $emit('change', {path: ['weight'], value, ack})"
|
||||
:error-messages="errors.weight"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
</div>
|
||||
<text-field
|
||||
label="Quantity"
|
||||
type="number"
|
||||
min="0"
|
||||
:value="model.quantity"
|
||||
@change="(value, ack) => $emit('change', {path: ['quantity'], value, ack})"
|
||||
:error-messages="errors.quantity"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<text-area
|
||||
label="Description"
|
||||
:value="model.description"
|
||||
:error-messages="errors.description"
|
||||
@change="(value, ack) => $emit('change', {path: ['description'], value, ack})"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<form-section name="Advanced" standalone>
|
||||
<v-switch
|
||||
label="Requires attunement"
|
||||
:input-value="model.requiresAttunement"
|
||||
:error-messages="errors.requiresAttunement"
|
||||
@change="e => $emit('change', {path: ['requiresAttunement'], value})"
|
||||
/>
|
||||
<v-switch
|
||||
label="Show increment buttons"
|
||||
:input-value="model.showIncrement"
|
||||
:error-messages="errors.showIncrement"
|
||||
@change="e => $emit('change', {path: ['showIncrement'], value})"
|
||||
/>
|
||||
</form-section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FormSection from '/imports/ui/forms/components/FormSection.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FormSection,
|
||||
},
|
||||
props: {
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
errors: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
debounceTime: Number,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -1,12 +1,14 @@
|
||||
import ActionForm from '/imports/ui/forms/ActionForm.vue';
|
||||
import AttributeForm from '/imports/ui/forms/AttributeForm.vue';
|
||||
import BuffForm from '/imports/ui/forms/BuffForm.vue';
|
||||
import ContainerForm from '/imports/ui/forms/ContainerForm.vue';
|
||||
import ClassLevelForm from '/imports/ui/forms/ClassLevelForm.vue';
|
||||
import DamageMultiplierForm from '/imports/ui/forms/DamageMultiplierForm.vue';
|
||||
import EffectForm from '/imports/ui/forms/EffectForm.vue';
|
||||
import ExperienceForm from '/imports/ui/forms/ExperienceForm.vue';
|
||||
import FeatureForm from '/imports/ui/forms/FeatureForm.vue';
|
||||
import FolderForm from '/imports/ui/forms/FolderForm.vue';
|
||||
import ItemForm from '/imports/ui/forms/ItemForm.vue';
|
||||
import NoteForm from '/imports/ui/forms/NoteForm.vue';
|
||||
import ProficiencyForm from '/imports/ui/forms/ProficiencyForm.vue';
|
||||
import RollForm from '/imports/ui/forms/RollForm.vue';
|
||||
@@ -18,12 +20,14 @@ export default {
|
||||
action: ActionForm,
|
||||
attribute: AttributeForm,
|
||||
buff: BuffForm,
|
||||
container: ContainerForm,
|
||||
classLevel: ClassLevelForm,
|
||||
damageMultiplier: DamageMultiplierForm,
|
||||
experience:ExperienceForm,
|
||||
effect: EffectForm,
|
||||
feature: FeatureForm,
|
||||
folder: FolderForm,
|
||||
item: ItemForm,
|
||||
note: NoteForm,
|
||||
proficiency: ProficiencyForm,
|
||||
roll: RollForm,
|
||||
|
||||
Reference in New Issue
Block a user