aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdTagInput.vue
diff options
context:
space:
mode:
authorzeroinformatique2021-07-03 00:48:53 +0200
committerGitHub2021-07-03 00:48:53 +0200
commitb6605e2c4ee73ac8b994624098344db5e44ac07d (patch)
tree5ed06cc5ecdabe070f6fdb9bc4f9a8a3b435cbe6 /viewer/src/components/LdTagInput.vue
parent08ac32103fb5f8cca1861267dfd07a7c0d2faf62 (diff)
parent1f0377c1b4c2959c73fe4e368673f057ef369917 (diff)
downloadldgallery-b6605e2c4ee73ac8b994624098344db5e44ac07d.tar.gz
Merge pull request #302 from ldgallery/oz-types-normalization
viewer: types normalization
Diffstat (limited to 'viewer/src/components/LdTagInput.vue')
-rw-r--r--viewer/src/components/LdTagInput.vue15
1 files changed, 7 insertions, 8 deletions
diff --git a/viewer/src/components/LdTagInput.vue b/viewer/src/components/LdTagInput.vue
index ce83ba8..855813a 100644
--- a/viewer/src/components/LdTagInput.vue
+++ b/viewer/src/components/LdTagInput.vue
@@ -40,24 +40,23 @@
40</template> 40</template>
41 41
42<script lang="ts"> 42<script lang="ts">
43import { Component, Vue, Prop, PropSync, Emit } from "vue-property-decorator"; 43import { TagIndex, TagSearch } from "@/@types/tag";
44import { Operation } from "@/@types/Operation";
45import Navigation from "@/services/navigation";
46import IndexFactory from "@/services/indexfactory"; 44import IndexFactory from "@/services/indexfactory";
45import { Component, Emit, Prop, PropSync, Vue } from "vue-property-decorator";
47 46
48@Component 47@Component
49export default class LdTagInput extends Vue { 48export default class LdTagInput extends Vue {
50 @Prop({ required: true }) readonly tagsIndex!: Tag.Index; 49 @Prop({ required: true }) readonly tagsIndex!: TagIndex;
51 @PropSync("searchFilters", { type: Array, required: true }) model!: Tag.Search[]; 50 @PropSync("searchFilters", { type: Array, required: true }) model!: TagSearch[];
52 51
53 currentFilter: string = ""; 52 currentFilter: string = "";
54 filteredTags: Tag.Search[] = []; 53 filteredTags: TagSearch[] = [];
55 54
56 displayOption(option: Tag.Search): string { 55 displayOption(option: TagSearch): string {
57 return `${option.display} (${option.items.length})`; 56 return `${option.display} (${option.items.length})`;
58 } 57 }
59 58
60 filterAlreadyPresent(newSearch: Tag.Search) { 59 filterAlreadyPresent(newSearch: TagSearch) {
61 return !this.model.find( 60 return !this.model.find(
62 currentSearch => 61 currentSearch =>
63 currentSearch.tag === newSearch.tag && (!currentSearch.parent || currentSearch.parent === newSearch.parent) 62 currentSearch.tag === newSearch.tag && (!currentSearch.parent || currentSearch.parent === newSearch.parent)