\n\t\n\t\t 5\"\n\t\t\tv-model=\"searchQuery\"\n\t\t\ttype=\"search\"\n\t\t\t:label=\"t('systemtags', 'Search tags')\" />\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t{{ tag.displayName }}\n\t\t\n\t\t\n\t\t\t{{ t('systemtags', 'No tags available') }}\n\t\t\n\t
\n\n\n\n","/*!\n * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { IFileListFilterChip, IFileListFilterWithUi, INode } from '@nextcloud/files'\nimport type { TagWithId } from '../types.ts'\n\nimport svgTagOutline from '@mdi/svg/svg/tag-outline.svg?raw'\nimport { FileListFilter, registerFileListFilter } from '@nextcloud/files'\nimport { t } from '@nextcloud/l10n'\nimport { defineCustomElement } from 'vue'\nimport FileListFilterTagsCE from '../components/FileListFilterTags.vue'\nimport { getNodeSystemTags } from '../utils.ts'\n\nconst tagName = 'systemtags-file-list-filter-tags'\n\nclass TagsFilter extends FileListFilter implements IFileListFilterWithUi {\n\t#selectedTags: TagWithId[] = []\n\n\tpublic readonly displayName = t('systemtags', 'Tags')\n\tpublic readonly iconSvgInline = svgTagOutline\n\tpublic readonly tagName = tagName\n\n\tconstructor() {\n\t\tsuper('systemtags:tags', 75)\n\t}\n\n\tpublic filter(nodes: INode[]): INode[] {\n\t\tif (this.#selectedTags.length === 0) {\n\t\t\treturn nodes\n\t\t}\n\n\t\tconst selectedNames = this.#selectedTags.map((tag) => tag.displayName)\n\t\treturn nodes.filter((node) => {\n\t\t\tconst nodeTags = getNodeSystemTags(node)\n\t\t\treturn selectedNames.some((name) => nodeTags.includes(name))\n\t\t})\n\t}\n\n\tpublic reset(): void {\n\t\tthis.dispatchEvent(new CustomEvent('reset'))\n\t}\n\n\tpublic get selectedTags(): TagWithId[] {\n\t\treturn this.#selectedTags\n\t}\n\n\tpublic setTags(tags?: TagWithId[]): void {\n\t\tthis.#selectedTags = tags ?? []\n\t\tthis.filterUpdated()\n\n\t\tconst chips: IFileListFilterChip[] = this.#selectedTags.map((tag) => ({\n\t\t\ticon: svgTagOutline,\n\t\t\ttext: tag.displayName,\n\t\t\tonclick: () => {\n\t\t\t\tthis.dispatchEvent(new CustomEvent('deselect', { detail: tag.id }))\n\t\t\t\tthis.setTags(this.#selectedTags.filter((t) => t.id !== tag.id))\n\t\t\t},\n\t\t}))\n\t\tthis.updateChips(chips)\n\t}\n}\n\nexport type { TagsFilter }\n\n/**\n * Register the file list filter by system tags\n */\nexport function registerTagsFilter() {\n\tconst TagsFilterElement = defineCustomElement(FileListFilterTagsCE, { shadowRoot: false })\n\tcustomElements.define(tagName, TagsFilterElement)\n\tregisterFileListFilter(new TagsFilter())\n}\n","/*!\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { registerFileAction } from '@nextcloud/files'\nimport { registerDavProperty } from '@nextcloud/files/dav'\nimport { action as bulkSystemTagsAction } from './files_actions/bulkSystemTagsAction.ts'\nimport { registerFileSidebarAction } from './files_actions/filesSidebarAction.ts'\nimport { action as inlineSystemTagsAction } from './files_actions/inlineSystemTagsAction.ts'\nimport { action as openInFilesAction } from './files_actions/openInFilesAction.ts'\nimport { registerTagsFilter } from './files_filters/TagsFilter.ts'\nimport { registerSystemTagsView } from './files_views/systemtagsView.ts'\n\nregisterDavProperty('nc:system-tags')\nregisterFileAction(bulkSystemTagsAction)\nregisterFileAction(inlineSystemTagsAction)\nregisterFileAction(openInFilesAction)\n\nregisterSystemTagsView()\nregisterFileSidebarAction()\nregisterTagsFilter()\n"],"file":"systemtags-init.mjs"}