diff --git a/app/imports/ui/components/computation/ComputedForCreature.vue b/app/imports/ui/components/computation/ComputedForCreature.vue index 096d412f..a676a4fe 100644 --- a/app/imports/ui/components/computation/ComputedForCreature.vue +++ b/app/imports/ui/components/computation/ComputedForCreature.vue @@ -11,7 +11,7 @@ import Computed from '/imports/ui/components/computation/Computed.vue'; export default { inject: { - computationContext: { default: {} } + context: { default: {} } }, components: { Computed, @@ -24,8 +24,8 @@ export default { }, computed: { scope(){ - return this.computationContext.creature && - this.computationContext.creature.variables; + return this.context.creature && + this.context.creature.variables; } } } diff --git a/app/imports/ui/components/global/DatePicker.vue b/app/imports/ui/components/global/DatePicker.vue index 42c77778..9aa2ff74 100644 --- a/app/imports/ui/components/global/DatePicker.vue +++ b/app/imports/ui/components/global/DatePicker.vue @@ -1,5 +1,5 @@ diff --git a/app/imports/ui/properties/forms/BuffForm.vue b/app/imports/ui/properties/forms/BuffForm.vue index 876e4dd6..d8d5cb01 100644 --- a/app/imports/ui/properties/forms/BuffForm.vue +++ b/app/imports/ui/properties/forms/BuffForm.vue @@ -4,47 +4,34 @@ label="Name" :value="model.name" :error-messages="errors.name" - :debounce-time="debounceTime" - @change="(value, ack) => $emit('change', {path: ['name'], value, ack})" + @change="change('name', ...arguments)" /> diff --git a/app/imports/ui/properties/forms/ContainerForm.vue b/app/imports/ui/properties/forms/ContainerForm.vue index cbd3fd7a..f8d4183f 100644 --- a/app/imports/ui/properties/forms/ContainerForm.vue +++ b/app/imports/ui/properties/forms/ContainerForm.vue @@ -4,8 +4,7 @@ label="Name" :value="model.name" :error-messages="errors.name" - :debounce-time="debounceTime" - @change="(value, ack) => $emit('change', {path: ['name'], value, ack})" + @change="change('name', ...arguments)" />
- - @@ -63,24 +59,12 @@ diff --git a/app/imports/ui/properties/forms/DamageForm.vue b/app/imports/ui/properties/forms/DamageForm.vue index 0e399fbd..d29eb568 100644 --- a/app/imports/ui/properties/forms/DamageForm.vue +++ b/app/imports/ui/properties/forms/DamageForm.vue @@ -6,8 +6,7 @@ style="flex-basis: 300px;" :value="model.amount" :error-messages="errors.amount" - :debounce-time="debounceTime" - @change="(value, ack) => $emit('change', {path: ['amount'], value, ack})" + @change="change('amount', ...arguments)" /> +export default { + mixins: [propertyFormMixin], +} + diff --git a/app/imports/ui/properties/forms/ProficiencyForm.vue b/app/imports/ui/properties/forms/ProficiencyForm.vue index 76278e3c..2d526355 100644 --- a/app/imports/ui/properties/forms/ProficiencyForm.vue +++ b/app/imports/ui/properties/forms/ProficiencyForm.vue @@ -4,8 +4,7 @@ label="Name" :value="model.name" :error-messages="errors.name" - :debounce-time="debounceTime" - @change="(value, ack) => $emit('change', {path: ['name'], value, ack})" + @change="change('name', ...arguments)" />
@@ -32,30 +30,13 @@ diff --git a/app/imports/ui/properties/forms/ResourcesForm.vue b/app/imports/ui/properties/forms/ResourcesForm.vue index 7c7b8772..f82b5450 100644 --- a/app/imports/ui/properties/forms/ResourcesForm.vue +++ b/app/imports/ui/properties/forms/ResourcesForm.vue @@ -53,20 +53,17 @@ +import saveListMixin from '/imports/ui/properties/forms/shared/lists/saveListMixin.js'; +import propertyFormMixin from '/imports/ui/properties/forms/shared/propertyFormMixin.js'; - +export default { + mixins: [saveListMixin, propertyFormMixin], +}; + diff --git a/app/imports/ui/properties/forms/SkillForm.vue b/app/imports/ui/properties/forms/SkillForm.vue index 1b4b1738..5d1595e6 100644 --- a/app/imports/ui/properties/forms/SkillForm.vue +++ b/app/imports/ui/properties/forms/SkillForm.vue @@ -5,8 +5,7 @@ label="Name" :value="model.name" :error-messages="errors.name" - :debounce-time="debounceTime" - @change="(value, ack) => $emit('change', {path: ['name'], value, ack})" + @change="change('name', ...arguments)" /> @@ -75,26 +69,14 @@ import ProficiencySelect from '/imports/ui/properties/forms/shared/ProficiencySelect.vue'; import FormSection from '/imports/ui/properties/forms/shared/FormSection.vue'; import createListOfProperties from '/imports/ui/properties/forms/shared/lists/createListOfProperties.js'; + import propertyFormMixin from '/imports/ui/properties/forms/shared/propertyFormMixin.js'; export default { components: { ProficiencySelect, FormSection, }, - props: { - model: { - type: Object, - default: () => ({}), - }, - errors: { - type: Object, - default: () => ({}), - }, - debounceTime: { - type: Number, - default: undefined, - }, - }, + mixins: [propertyFormMixin], data(){return{ skillTypes: [ { diff --git a/app/imports/ui/properties/forms/SpellForm.vue b/app/imports/ui/properties/forms/SpellForm.vue index b0dec3a1..26216e88 100644 --- a/app/imports/ui/properties/forms/SpellForm.vue +++ b/app/imports/ui/properties/forms/SpellForm.vue @@ -4,8 +4,7 @@ label="Name" :value="model.name" :error-messages="errors.name" - :debounce-time="debounceTime" - @change="(value, ack) => $emit('change', {path: ['name'], value, ack})" + @change="change('name', ...arguments)" />
-
- - - -
- import FormSection, { FormSections } from '/imports/ui/properties/forms/shared/FormSection.vue'; import ActionForm from '/imports/ui/properties/forms/ActionForm.vue' + import propertyFormMixin from '/imports/ui/properties/forms/shared/propertyFormMixin.js'; export default { components: { @@ -137,20 +129,7 @@ FormSection, ActionForm, }, - props: { - model: { - type: Object, - default: () => ({}), - }, - errors: { - type: Object, - default: () => ({}), - }, - debounceTime: { - type: Number, - default: undefined, - }, - }, + mixins: [propertyFormMixin], data(){return { magicSchools: [ { diff --git a/app/imports/ui/properties/forms/SpellListForm.vue b/app/imports/ui/properties/forms/SpellListForm.vue index b6b414a9..f9f44511 100644 --- a/app/imports/ui/properties/forms/SpellListForm.vue +++ b/app/imports/ui/properties/forms/SpellListForm.vue @@ -5,45 +5,31 @@ label="Name" :value="model.name" :error-messages="errors.name" - :debounce-time="debounceTime" - @change="(value, ack) => $emit('change', {path: ['name'], value, ack})" + @change="change('name', ...arguments)" />