-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #677 from ben/vue-theme-domain
Vue theme/domain sheet
- Loading branch information
Showing
11 changed files
with
96 additions
and
131 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
41 changes: 0 additions & 41 deletions
41
src/module/item/delve-theme-domain/delvethemeordomainsheet.ts
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
import { VueItemSheet } from '../../vue/vueitemsheet' | ||
import delveThemeDomainSheet from '../../vue/delve-theme-domain-sheet.vue' | ||
|
||
export class ThemeDomainSheet extends VueItemSheet { | ||
static get defaultOptions() { | ||
return mergeObject(super.defaultOptions, { | ||
height: 650, | ||
rootComponent: delveThemeDomainSheet, | ||
} as any) | ||
} | ||
} |
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,75 @@ | ||
<template> | ||
<div class="flexcol" :class="$style.sheetStyles"> | ||
<SheetHeaderBasic class="nogrow" :document="data.item" /> | ||
|
||
<input | ||
class="nogrow" | ||
type="text" | ||
v-model="typedSystem.summary" | ||
:placeholder="$t('IRONSWORN.Summary')" | ||
@blur="save" | ||
/> | ||
<MceEditor v-model="typedSystem.description" style="flex-basis: 8rem" /> | ||
|
||
<h3 class="nogrow">{{ $t('IRONSWORN.DELVESITE.Features') }}</h3> | ||
<table> | ||
<tbody> | ||
<tr v-for="feature in typedSystem.features"> | ||
<td>{{ formattedRange(feature.range) }}</td> | ||
<td> | ||
<input type="text" v-model="feature.text" @blur="save" /> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h3 class="nogrow">{{ $t('IRONSWORN.DELVESITE.Dangers') }}</h3> | ||
<table> | ||
<tbody> | ||
<tr v-for="danger in typedSystem.dangers"> | ||
<td>{{ formattedRange(danger.range) }}</td> | ||
<td> | ||
<input type="text" v-model="danger.text" @blur="save" /> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</template> | ||
|
||
<style lang="less" module> | ||
.sheetStyles { | ||
gap: var(--ironsworn-spacer-md); | ||
h3 { | ||
margin: var(--ironsworn-spacer-lg) 0 0 0; | ||
} | ||
} | ||
</style> | ||
|
||
<script setup lang="ts"> | ||
import { inject, provide, computed } from 'vue' | ||
import { DelveThemeDataPropertiesData } from '../item/itemtypes' | ||
import MceEditor from './components/mce-editor.vue' | ||
import { $ItemKey, ItemKey } from './provisions' | ||
import SheetHeaderBasic from './sheet-header-basic.vue' | ||
const $item = inject($ItemKey) | ||
const props = defineProps<{ data: { item: any } }>() | ||
provide(ItemKey, computed(() => props.data.item) as any) | ||
const typedSystem = props.data.item.system as DelveThemeDataPropertiesData | ||
function formattedRange(range: [number, number]): string { | ||
if (range[0] === range[1]) return `${range[0]}` | ||
return `${range[0]}–${range[1]}` | ||
} | ||
function save() { | ||
const { summary, description, features, dangers } = typedSystem | ||
$item?.update({ | ||
system: { summary, description, features, dangers }, | ||
}) | ||
} | ||
</script> |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.