diff options
author | Zero~Informatique | 2021-07-02 22:59:56 +0200 |
---|---|---|
committer | Zero~Informatique | 2021-07-03 00:05:22 +0200 |
commit | 92cb34b719b481faf417760f307241e8f6d777a9 (patch) | |
tree | ba33af35b8bb07e6c1c19b84f6c3af37c791584c /viewer/src/components/LdTagInput.vue | |
parent | 9165cc1efcf7791f78b61b2c51a9de651b1b09aa (diff) | |
download | ldgallery-92cb34b719b481faf417760f307241e8f6d777a9.tar.gz |
viewer: types normalization - tag.d.ts
GitHub: closes #301
Diffstat (limited to 'viewer/src/components/LdTagInput.vue')
-rw-r--r-- | viewer/src/components/LdTagInput.vue | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/viewer/src/components/LdTagInput.vue b/viewer/src/components/LdTagInput.vue index ef585f0..855813a 100644 --- a/viewer/src/components/LdTagInput.vue +++ b/viewer/src/components/LdTagInput.vue | |||
@@ -40,22 +40,23 @@ | |||
40 | </template> | 40 | </template> |
41 | 41 | ||
42 | <script lang="ts"> | 42 | <script lang="ts"> |
43 | import { TagIndex, TagSearch } from "@/@types/tag"; | ||
43 | import IndexFactory from "@/services/indexfactory"; | 44 | import IndexFactory from "@/services/indexfactory"; |
44 | import { Component, Emit, Prop, PropSync, Vue } from "vue-property-decorator"; | 45 | import { Component, Emit, Prop, PropSync, Vue } from "vue-property-decorator"; |
45 | 46 | ||
46 | @Component | 47 | @Component |
47 | export default class LdTagInput extends Vue { | 48 | export default class LdTagInput extends Vue { |
48 | @Prop({ required: true }) readonly tagsIndex!: Tag.Index; | 49 | @Prop({ required: true }) readonly tagsIndex!: TagIndex; |
49 | @PropSync("searchFilters", { type: Array, required: true }) model!: Tag.Search[]; | 50 | @PropSync("searchFilters", { type: Array, required: true }) model!: TagSearch[]; |
50 | 51 | ||
51 | currentFilter: string = ""; | 52 | currentFilter: string = ""; |
52 | filteredTags: Tag.Search[] = []; | 53 | filteredTags: TagSearch[] = []; |
53 | 54 | ||
54 | displayOption(option: Tag.Search): string { | 55 | displayOption(option: TagSearch): string { |
55 | return `${option.display} (${option.items.length})`; | 56 | return `${option.display} (${option.items.length})`; |
56 | } | 57 | } |
57 | 58 | ||
58 | filterAlreadyPresent(newSearch: Tag.Search) { | 59 | filterAlreadyPresent(newSearch: TagSearch) { |
59 | return !this.model.find( | 60 | return !this.model.find( |
60 | currentSearch => | 61 | currentSearch => |
61 | currentSearch.tag === newSearch.tag && (!currentSearch.parent || currentSearch.parent === newSearch.parent) | 62 | currentSearch.tag === newSearch.tag && (!currentSearch.parent || currentSearch.parent === newSearch.parent) |