Added forms for Class level, damage multiplier, experience, folder, note, proficiency
This commit is contained in:
66
app/imports/ui/forms/ClassLevelForm.vue
Normal file
66
app/imports/ui/forms/ClassLevelForm.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<template lang="html">
|
||||
<div class="class-form">
|
||||
<div class="layout column align-center">
|
||||
<text-field
|
||||
label="Level"
|
||||
type="number"
|
||||
class="base-value-field text-xs-center large-format no-flex"
|
||||
:value="model.level"
|
||||
@change="(value, ack) => $emit('change', {path: ['level'], value, ack})"
|
||||
:error-messages="errors.level"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
</div>
|
||||
<div class="layout row wrap">
|
||||
<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="Variable name"
|
||||
:value="model.variableName"
|
||||
style="flex-basis: 300px;"
|
||||
@change="(value, ack) => $emit('change', {path: ['variableName'], value, ack})"
|
||||
hint="Use this name in formulae to reference this class"
|
||||
:error-messages="errors.variableName"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<text-field
|
||||
label="Base Class Variable name"
|
||||
:value="model.baseClass"
|
||||
style="flex-basis: 300px;"
|
||||
@change="(value, ack) => $emit('change', {path: ['baseClass'], value, ack})"
|
||||
hint="This is the name of the class this class level belongs to"
|
||||
:error-messages="errors.baseClass"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
</div>
|
||||
</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>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
133
app/imports/ui/forms/DamageMultiplierForm.vue
Normal file
133
app/imports/ui/forms/DamageMultiplierForm.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<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">
|
||||
<smart-select
|
||||
label="Damage Type"
|
||||
style="flex-basis: 300px;"
|
||||
:items="damageTypes"
|
||||
:value="model.damageType"
|
||||
:error-messages="errors.damageType"
|
||||
:menu-props="{auto: true, lazy: true}"
|
||||
@change="(value, ack) => $emit('change', {path: ['damageType'], value, ack})"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<smart-select
|
||||
label="Value"
|
||||
style="flex-basis: 300px;"
|
||||
:items="values"
|
||||
:value="model.value"
|
||||
:error-messages="errors.value"
|
||||
:menu-props="{auto: true, lazy: true}"
|
||||
@change="(value, ack) => $emit('change', {path: ['value'], value, ack})"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FormSection from '/imports/ui/forms/components/FormSection.vue';
|
||||
import DAMAGE_TYPES from '/imports/constants/DAMAGE_TYPES.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FormSection,
|
||||
},
|
||||
props: {
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
errors: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
debounceTime: Number,
|
||||
},
|
||||
data(){return {
|
||||
damageTypes: [
|
||||
{
|
||||
value: "bludgeoning",
|
||||
text: "Bludgeoning",
|
||||
}, {
|
||||
value: "piercing",
|
||||
text: "Piercing",
|
||||
}, {
|
||||
value: "slashing",
|
||||
text: "Slashing",
|
||||
}, {
|
||||
value: "magicalBludgeoning",
|
||||
text: "Magical Bludgeoning",
|
||||
}, {
|
||||
value: "magicalPiercing",
|
||||
text: "Magical Piercing",
|
||||
}, {
|
||||
value: "magicalSlashing",
|
||||
text: "Magical Slashing",
|
||||
}, {
|
||||
value: "acid",
|
||||
text: "Acid",
|
||||
}, {
|
||||
value: "cold",
|
||||
text: "Cold",
|
||||
}, {
|
||||
value: "fire",
|
||||
text: "Fire",
|
||||
}, {
|
||||
value: "force",
|
||||
text: "Force",
|
||||
}, {
|
||||
value: "lightning",
|
||||
text: "Lightning",
|
||||
}, {
|
||||
value: "necrotic",
|
||||
text: "Necrotic",
|
||||
}, {
|
||||
value: "poison",
|
||||
text: "Poison",
|
||||
}, {
|
||||
value: "psychic",
|
||||
text: "Psychic",
|
||||
}, {
|
||||
value: "radiant",
|
||||
text: "Radiant",
|
||||
}, {
|
||||
value: "thunder",
|
||||
text: "Thunder",
|
||||
},
|
||||
],
|
||||
values: [
|
||||
{
|
||||
value: 0,
|
||||
text: "Immunity",
|
||||
}, {
|
||||
value: 0.5,
|
||||
text: "Resistance",
|
||||
}, {
|
||||
value: 2,
|
||||
text: "Vulnerability",
|
||||
},
|
||||
],
|
||||
};},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
.no-flex {
|
||||
flex: initial;
|
||||
}
|
||||
.layout.row.wrap {
|
||||
margin-right: -8px;
|
||||
}
|
||||
.layout.row.wrap > *{
|
||||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||
74
app/imports/ui/forms/ExperienceForm.vue
Normal file
74
app/imports/ui/forms/ExperienceForm.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template lang="html">
|
||||
<div class="class-form">
|
||||
<div class="layout column align-center">
|
||||
<text-field
|
||||
label="XP"
|
||||
type="number"
|
||||
class="base-value-field text-xs-center large-format no-flex"
|
||||
:value="model.value"
|
||||
@change="(value, ack) => $emit('change', {path: ['value'], value, ack})"
|
||||
:error-messages="errors.value"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
</div>
|
||||
<div class="layout row wrap">
|
||||
<text-field
|
||||
label="Title"
|
||||
style="flex-basis: 300px;"
|
||||
:value="model.title"
|
||||
@change="(value, ack) => $emit('change', {path: ['title'], value, ack})"
|
||||
:error-messages="errors.title"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<text-field
|
||||
label="In-World date"
|
||||
:value="model.worldDate"
|
||||
style="flex-basis: 300px;"
|
||||
@change="(value, ack) => $emit('change', {path: ['worldDate'], value, ack})"
|
||||
hint="The date in-game that the experience occured"
|
||||
:error-messages="errors.worldDate"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
<date-picker
|
||||
label="Real date"
|
||||
:value="model.date"
|
||||
style="flex-basis: 300px;"
|
||||
@change="(value, ack) => $emit('change', {path: ['date'], value, ack})"
|
||||
hint="Real life date"
|
||||
:error-messages="errors.date"
|
||||
: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"
|
||||
/>
|
||||
</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>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
33
app/imports/ui/forms/FolderForm.vue
Normal file
33
app/imports/ui/forms/FolderForm.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template lang="html">
|
||||
<div class="folder-form">
|
||||
<div class="layout row wrap">
|
||||
<text-field
|
||||
label="Name"
|
||||
style="flex-basis: 300px;"
|
||||
:value="model.name"
|
||||
@change="(value, ack) => $emit('change', {path: ['name'], value, ack})"
|
||||
:error-messages="errors.name"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
errors: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
debounceTime: Number,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
37
app/imports/ui/forms/NoteForm.vue
Normal file
37
app/imports/ui/forms/NoteForm.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template lang="html">
|
||||
<div class="feature-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-area
|
||||
label="Description"
|
||||
:value="model.description"
|
||||
:error-messages="errors.description"
|
||||
@change="(value, ack) => $emit('change', {path: ['description'], value, ack})"
|
||||
:debounce-time="debounceTime"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
errors: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
debounceTime: Number,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
115
app/imports/ui/forms/ProficiencyForm.vue
Normal file
115
app/imports/ui/forms/ProficiencyForm.vue
Normal file
@@ -0,0 +1,115 @@
|
||||
<template lang="html">
|
||||
<div class="layout row wrap justify-start proficiency-form">
|
||||
<text-field
|
||||
label="Skill"
|
||||
class="mr-2"
|
||||
append-icon="arrow_drop_down"
|
||||
item-text="name"
|
||||
item-value="skill"
|
||||
:menu-props="{transition: 'slide-y-transition', lazy: true}"
|
||||
:value="model.skill"
|
||||
:items="undefined"
|
||||
@change="(value, ack) => $emit('change', {path: ['skill'], value, ack})"
|
||||
/>
|
||||
<smart-select
|
||||
label="Proficiency"
|
||||
append-icon="arrow_drop_down"
|
||||
class="mr-2 ml-3"
|
||||
:menu-props="{transition: 'slide-y-transition', lazy: true}"
|
||||
:items="values"
|
||||
:value="model.value"
|
||||
@change="(value, ack) => $emit('change', {path: ['value'], value, ack})"
|
||||
>
|
||||
<v-icon
|
||||
class="icon"
|
||||
slot="prepend"
|
||||
:class="iconClass"
|
||||
>{{displayedIcon}}</v-icon>
|
||||
</smart-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const ICON_SPIN_DURATION = 300;
|
||||
export default {
|
||||
props: {
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
stats: {
|
||||
type: Array,
|
||||
},
|
||||
},
|
||||
data(){ return {
|
||||
displayedIcon: 'radio_button_unchecked',
|
||||
iconClass: '',
|
||||
values: [
|
||||
{value: 1, text: 'Proficient'},
|
||||
{value: 0.5, text: 'Half proficiency bonus'},
|
||||
{value: 2, text: 'Double proficiency bonuys'},
|
||||
],
|
||||
}},
|
||||
methods: {
|
||||
proficiencyIcon(value){
|
||||
if (value == 0.5){
|
||||
return 'brightness_2';
|
||||
} else if (value == 1) {
|
||||
return 'brightness_1'
|
||||
} else if (value == 2){
|
||||
return 'album'
|
||||
} else {
|
||||
return 'radio_button_unchecked';
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'model.value': {
|
||||
immediate: true,
|
||||
handler(newValue, oldValue, e){
|
||||
let newIcon = this.proficiencyIcon(newValue);
|
||||
if (!oldValue){
|
||||
// Skip animation
|
||||
this.displayedIcon = newIcon;
|
||||
} else {
|
||||
this.iconClass="leaving";
|
||||
setTimeout(() => {
|
||||
this.displayedIcon = newIcon;
|
||||
this.iconClass="arriving";
|
||||
requestAnimationFrame(() => {
|
||||
this.iconClass="";
|
||||
});
|
||||
}, ICON_SPIN_DURATION / 2);
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
.theme--light .icon {
|
||||
color: black;
|
||||
}
|
||||
.icon {
|
||||
min-width: 30px;
|
||||
transition: transform 0.15s linear, opacity 0.15s ease;
|
||||
transform-origin: 18px center;
|
||||
margin-left: -12px;
|
||||
}
|
||||
.icon.leaving {
|
||||
transform: translateY(-24px);
|
||||
opacity: 0;
|
||||
}
|
||||
.icon.arriving {
|
||||
transform: translateY(24px);
|
||||
opacity: 0;
|
||||
transition: none;
|
||||
}
|
||||
.hidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
.proficiency-form > div {
|
||||
flex-basis: 220px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +1,25 @@
|
||||
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 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 NoteForm from '/imports/ui/forms/NoteForm.vue';
|
||||
import ProficiencyForm from '/imports/ui/forms/ProficiencyForm.vue';
|
||||
|
||||
export default {
|
||||
action: ActionForm,
|
||||
attribute: AttributeForm,
|
||||
buff: BuffForm,
|
||||
classLevel: ClassLevelForm,
|
||||
damageMultiplier: DamageMultiplierForm,
|
||||
experience:ExperienceForm,
|
||||
effect: EffectForm,
|
||||
feature: FeatureForm,
|
||||
folder: FolderForm,
|
||||
note: NoteForm,
|
||||
proficiency: ProficiencyForm,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user