From a4052ffee8bc7c6c8a69eba5120b5c6c2d951b0f Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Tue, 12 Mar 2024 19:18:52 +0000 Subject: Add items --- components/editor/EditorSidebar.vue | 16 +++++- components/editor/EditorSidebarItem.vue | 66 ++++++++++++++++++++++ .../editor/task/EditorTaskConfigurationRow.vue | 2 +- 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 components/editor/EditorSidebarItem.vue (limited to 'components/editor') diff --git a/components/editor/EditorSidebar.vue b/components/editor/EditorSidebar.vue index 992dd86..48e187f 100644 --- a/components/editor/EditorSidebar.vue +++ b/components/editor/EditorSidebar.vue @@ -24,7 +24,7 @@ const setSelectedType = (type: 'quests' | 'items') => { - + Items @@ -34,6 +34,13 @@ const setSelectedType = (type: 'quests' | 'items') => { +

{{ session.quests.length }} quest{{ session.quests.length === 1 ? '' : 's' }}, {{ + session.categories.length }} + categor{{ session.categories.length === 1 ? 'y' : 'ies' }}

+ +
+ +

{{ session.items.length }} item{{ session.items.length === 1 ? '' : 's' }}

@@ -99,5 +106,12 @@ const setSelectedType = (type: 'quests' | 'items') => { bottom: 0; width: 100% } + + #count { + margin: 0.5rem 0; + font-size: 0.7rem; + text-align: center; + color: var(--color-text-mute); + } } \ No newline at end of file diff --git a/components/editor/EditorSidebarItem.vue b/components/editor/EditorSidebarItem.vue new file mode 100644 index 0000000..4696bb1 --- /dev/null +++ b/components/editor/EditorSidebarItem.vue @@ -0,0 +1,66 @@ + + + + + \ No newline at end of file diff --git a/components/editor/task/EditorTaskConfigurationRow.vue b/components/editor/task/EditorTaskConfigurationRow.vue index 666669d..c00896f 100644 --- a/components/editor/task/EditorTaskConfigurationRow.vue +++ b/components/editor/task/EditorTaskConfigurationRow.vue @@ -41,7 +41,7 @@ if (props.initialValue !== currentValue.value) { emit('update', currentValue.value); } -const error = computed(() => currentValue.value === undefined || currentValue.value === null || currentValue.value === '' || (Array.isArray(currentValue.value) && currentValue.value.length === 0)); +const error = computed(() => currentValue.value === undefined || currentValue.value === null || currentValue.value === '' || (Array.isArray(currentValue.value) && currentValue.value.length === 0) || (typeof currentValue.value === 'object' && Object.keys(currentValue.value).length === 0)); const updateValue = (value: any) => { currentValue.value = value; }; -- cgit v1.2.3-70-g09d2