diff options
author | zeroinformatique | 2021-07-03 00:48:53 +0200 |
---|---|---|
committer | GitHub | 2021-07-03 00:48:53 +0200 |
commit | b6605e2c4ee73ac8b994624098344db5e44ac07d (patch) | |
tree | 5ed06cc5ecdabe070f6fdb9bc4f9a8a3b435cbe6 /viewer/src/components/LdTagInput.vue | |
parent | 08ac32103fb5f8cca1861267dfd07a7c0d2faf62 (diff) | |
parent | 1f0377c1b4c2959c73fe4e368673f057ef369917 (diff) | |
download | ldgallery-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.vue | 15 |
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"> |
43 | import { Component, Vue, Prop, PropSync, Emit } from "vue-property-decorator"; | 43 | import { TagIndex, TagSearch } from "@/@types/tag"; |
44 | import { Operation } from "@/@types/Operation"; | ||
45 | import Navigation from "@/services/navigation"; | ||
46 | import IndexFactory from "@/services/indexfactory"; | 44 | import IndexFactory from "@/services/indexfactory"; |
45 | import { Component, Emit, Prop, PropSync, Vue } from "vue-property-decorator"; | ||
47 | 46 | ||
48 | @Component | 47 | @Component |
49 | export default class LdTagInput extends Vue { | 48 | export 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) |