@nextcloud/vue 9.10.0 → 9.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/assets/NcActionInput.css +66 -66
- package/dist/assets/NcActions.css +12 -12
- package/dist/assets/NcAppNavigationItem.css +54 -52
- package/dist/assets/NcAppNavigationList.css +2 -26
- package/dist/assets/NcAppNavigationNewItem.css +9 -7
- package/dist/assets/NcAppNavigationSettings.css +6 -6
- package/dist/assets/NcAppSettingsDialog.css +3 -3
- package/dist/assets/NcAppSettingsShortcutsSection.css +1 -1
- package/dist/assets/NcAppSidebar.css +130 -76
- package/dist/assets/NcAppSidebarTab.css +4 -4
- package/dist/assets/NcAssistantButton.css +9 -9
- package/dist/assets/NcAssistantContent.css +3 -3
- package/dist/assets/NcAssistantIcon.css +4 -4
- package/dist/assets/NcAvatar.css +26 -26
- package/dist/assets/NcBlurHash.css +2 -2
- package/dist/assets/NcDateTimePicker.css +234 -234
- package/dist/assets/NcFilePicker.css +1 -1
- package/dist/assets/NcFormBox.css +11 -11
- package/dist/assets/NcFormBoxButton.css +2 -2
- package/dist/assets/NcFormBoxItem.css +15 -15
- package/dist/assets/NcFormBoxSwitch.css +2 -2
- package/dist/assets/NcFormGroup.css +7 -7
- package/dist/assets/NcHotkey.css +8 -8
- package/dist/assets/NcHotkeyList.css +2 -2
- package/dist/assets/NcIconToggleSwitch.css +4 -4
- package/dist/assets/NcKbd.css +3 -3
- package/dist/assets/NcModal.css +69 -63
- package/dist/assets/NcPopover.css +16 -16
- package/dist/assets/NcProfileHoverCard.css +82 -59
- package/dist/assets/NcRadioGroup.css +2 -2
- package/dist/assets/NcRadioGroupButton.css +14 -14
- package/dist/assets/NcRichContenteditable.css +17 -17
- package/dist/assets/NcRichText.css +2 -2
- package/dist/assets/NcSelect.css +25 -0
- package/dist/assets/NcUploadPicker.css +41 -0
- package/dist/assets/autolink.css +3 -3
- package/dist/chunks/NcActionInput.mjs +4 -4
- package/dist/chunks/NcActionInput.mjs.map +1 -1
- package/dist/chunks/NcActions.mjs +4 -4
- package/dist/chunks/NcActions.mjs.map +1 -1
- package/dist/chunks/NcAppContent.mjs +4 -4
- package/dist/chunks/NcAppContent.mjs.map +1 -1
- package/dist/chunks/NcAppNavigation.mjs +2 -2
- package/dist/chunks/NcAppNavigationItem.mjs +6 -29
- package/dist/chunks/NcAppNavigationItem.mjs.map +1 -1
- package/dist/chunks/NcAppNavigationList.mjs +8 -138
- package/dist/chunks/NcAppNavigationList.mjs.map +1 -1
- package/dist/chunks/NcAppNavigationNewItem.mjs +1 -1
- package/dist/chunks/NcAppNavigationNewItem.mjs.map +1 -1
- package/dist/chunks/NcAppNavigationSearch.mjs +2 -2
- package/dist/chunks/NcAppNavigationSettings.mjs +8 -8
- package/dist/chunks/NcAppSettingsDialog.mjs +5 -5
- package/dist/chunks/NcAppSettingsShortcutsSection.mjs +3 -3
- package/dist/chunks/NcAppSidebar.mjs +165 -31
- package/dist/chunks/NcAppSidebar.mjs.map +1 -1
- package/dist/chunks/NcAppSidebarTab.mjs +12 -5
- package/dist/chunks/NcAppSidebarTab.mjs.map +1 -1
- package/dist/chunks/NcAssistantButton.mjs +7 -7
- package/dist/chunks/NcAssistantContent.mjs +3 -3
- package/dist/chunks/NcAssistantIcon.mjs +4 -4
- package/dist/chunks/NcAvatar.mjs +17 -4
- package/dist/chunks/NcAvatar.mjs.map +1 -1
- package/dist/chunks/NcBlurHash.mjs +2 -2
- package/dist/chunks/NcCheckboxRadioSwitch.mjs +1 -1
- package/dist/chunks/NcCollectionList.mjs +3 -3
- package/dist/chunks/NcColorPicker.mjs +2 -2
- package/dist/chunks/NcContent.mjs +2 -2
- package/dist/chunks/NcDashboardWidget.mjs +4 -4
- package/dist/chunks/NcDashboardWidget.mjs.map +1 -1
- package/dist/chunks/NcDateTimePicker.mjs +7 -4
- package/dist/chunks/NcDateTimePicker.mjs.map +1 -1
- package/dist/chunks/NcDateTimePickerNative.mjs +2 -2
- package/dist/chunks/NcDialogButton.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/chunks/NcEmojiPicker.mjs +2 -2
- package/dist/chunks/NcFilePicker.mjs +6 -5
- package/dist/chunks/NcFilePicker.mjs.map +1 -1
- package/dist/chunks/NcFormBox.mjs +5 -5
- package/dist/chunks/NcFormBoxButton.mjs +2 -2
- package/dist/chunks/NcFormBoxItem.mjs +8 -8
- package/dist/chunks/NcFormBoxSwitch.mjs +2 -2
- package/dist/chunks/NcFormGroup.mjs +7 -7
- package/dist/chunks/NcHotkey.mjs +4 -4
- package/dist/chunks/NcHotkeyList.mjs +4 -4
- package/dist/chunks/NcIconToggleSwitch.mjs +2 -2
- package/dist/chunks/NcKbd.mjs +4 -4
- package/dist/chunks/NcModal.mjs +13 -8
- package/dist/chunks/NcModal.mjs.map +1 -1
- package/dist/chunks/NcPasswordField.mjs +2 -2
- package/dist/chunks/NcPopover.mjs +2 -2
- package/dist/chunks/NcProfileHoverCard.mjs +205 -157
- package/dist/chunks/NcProfileHoverCard.mjs.map +1 -1
- package/dist/chunks/NcRadioGroup.mjs +2 -2
- package/dist/chunks/NcRadioGroupButton.mjs +6 -6
- package/dist/chunks/NcReferenceWidget.mjs +2 -2
- package/dist/chunks/NcRelatedResourcesPanel.mjs +4 -4
- package/dist/chunks/NcRichContenteditable.mjs +12 -12
- package/dist/chunks/NcRichText.mjs +3 -3
- package/dist/chunks/NcRichText.mjs.map +1 -1
- package/dist/chunks/NcSelect.mjs +74 -5
- package/dist/chunks/NcSelect.mjs.map +1 -1
- package/dist/chunks/NcSettingsSection.mjs +2 -2
- package/dist/chunks/NcSettingsSelectGroup.mjs +2 -2
- package/dist/chunks/NcTextField.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/chunks/NcTimezonePicker.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/chunks/NcUploadPicker.mjs +269 -0
- package/dist/chunks/NcUploadPicker.mjs.map +1 -0
- package/dist/chunks/NcUserStatusIcon.mjs +2 -2
- package/dist/chunks/_l10n.mjs +86 -84
- package/dist/chunks/_l10n.mjs.map +1 -1
- package/dist/chunks/autolink.mjs +3 -3
- package/dist/chunks/colors.mjs +2 -2
- package/dist/chunks/mdi.mjs +7 -5
- package/dist/chunks/mdi.mjs.map +1 -1
- package/dist/chunks/referencePickerModal.mjs +5 -5
- package/dist/components/NcActionInput/NcActionInput.vue.d.ts +38 -10
- package/dist/components/NcActions/NcActions.vue.d.ts +1 -1
- package/dist/components/NcAppNavigationCaption/NcAppNavigationCaption.vue.d.ts +1 -1
- package/dist/components/NcAppNavigationItem/NcAppNavigationItem.vue.d.ts +1 -5
- package/dist/components/NcAppNavigationList/NcAppNavigationList.vue.d.ts +1 -57
- package/dist/components/NcAppSidebar/NcAppSidebar.vue.d.ts +20 -1
- package/dist/components/NcAppSidebar/NcAppSidebarTabs.vue.d.ts +43 -0
- package/dist/components/NcAppSidebar/NcAppSidebarTabsButton.vue.d.ts +5 -0
- package/dist/components/NcAppSidebarTab/NcAppSidebarTab.vue.d.ts +14 -4
- package/dist/components/NcAvatar/NcAvatar.vue.d.ts +10 -1
- package/dist/components/NcBreadcrumb/NcBreadcrumb.vue.d.ts +1 -1
- package/dist/components/NcBreadcrumbs/NcBreadcrumbs.vue.d.ts +2 -2
- package/dist/components/NcCollectionList/NcCollectionList.vue.d.ts +41 -5
- package/dist/components/NcCollectionList/NcCollectionListItem.vue.d.ts +6 -2
- package/dist/components/NcDashboardWidget/NcDashboardWidget.vue.d.ts +11 -3
- package/dist/components/NcDashboardWidgetItem/NcDashboardWidgetItem.vue.d.ts +6 -2
- package/dist/components/NcDateTimePicker/NcDateTimePicker.vue.d.ts +7 -7
- package/dist/components/NcFilePicker/NcFilePicker.vue.d.ts +7 -0
- package/dist/components/NcListItem/NcListItem.vue.d.ts +1 -1
- package/dist/components/NcListItemIcon/NcListItemIcon.vue.d.ts +6 -2
- package/dist/components/NcProfileHoverCard/NcProfileHoverCard.vue.d.ts +6 -0
- package/dist/components/NcRichText/NcReferencePicker/NcProviderList.vue.d.ts +30 -2
- package/dist/components/NcRichText/NcReferencePicker/NcReferencePicker.vue.d.ts +60 -4
- package/dist/components/NcRichText/NcReferencePicker/NcReferencePickerModal.vue.d.ts +60 -4
- package/dist/components/NcRichText/NcReferencePicker/NcSearch.vue.d.ts +30 -2
- package/dist/components/NcSelect/NcSelect.vue.d.ts +39 -2
- package/dist/components/NcSelectTags/NcSelectTags.vue.d.ts +30 -2
- package/dist/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue.d.ts +30 -2
- package/dist/components/NcUploadPicker/NcUploadPicker.vue.d.ts +180 -0
- package/dist/components/NcUploadPicker/index.d.ts +6 -0
- package/dist/components/NcUploadPicker/index.mjs +5 -0
- package/dist/components/NcUploadPicker/index.mjs.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/useFormatDateTime/index.mjs +2 -2
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +25 -11
- package/dist/chunks/highlight.mjs +0 -5
- package/dist/chunks/highlight.mjs.map +0 -1
- package/dist/components/NcAppNavigationList/highlight.d.ts +0 -12
|
@@ -4,7 +4,7 @@ import { openBlock, createElementBlock, mergeProps, createElementVNode, toDispla
|
|
|
4
4
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
|
|
5
5
|
import { C as ChevronDown } from "./ChevronDown.mjs";
|
|
6
6
|
import { C as ChevronUp } from "./ChevronUp.mjs";
|
|
7
|
-
import { r as register,
|
|
7
|
+
import { r as register, O as t22, a as t, b as t53, P as t24 } from "./_l10n.mjs";
|
|
8
8
|
import { i as isLegacy34 } from "./legacy.mjs";
|
|
9
9
|
import { N as NcButton } from "./NcButton.mjs";
|
|
10
10
|
import { N as NcInputConfirmCancel } from "./NcInputConfirmCancel.mjs";
|
|
@@ -12,7 +12,6 @@ import { useIsMobile } from "../composables/useIsMobile/index.mjs";
|
|
|
12
12
|
import { c as createElementId } from "./createElementId.mjs";
|
|
13
13
|
import { N as NcActionButton } from "./NcActionButton.mjs";
|
|
14
14
|
import { N as NcActions } from "./NcActions.mjs";
|
|
15
|
-
import { A as APP_NAVIGATION_HIGHLIGHT } from "./highlight.mjs";
|
|
16
15
|
import { N as NcLoadingIcon } from "./NcLoadingIcon.mjs";
|
|
17
16
|
import { _ as _sfc_main$4 } from "./NcVNodes.vue_vue_type_script_lang.mjs";
|
|
18
17
|
const _sfc_main$3 = {
|
|
@@ -166,7 +165,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
166
165
|
}, 8, ["class", "aria-label", "variant", "onClick"]);
|
|
167
166
|
}
|
|
168
167
|
const NcAppNavigationIconCollapsible = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-cfbd3794"]]);
|
|
169
|
-
register(t24,
|
|
168
|
+
register(t24, t53);
|
|
170
169
|
const _sfc_main = {
|
|
171
170
|
name: "NcAppNavigationItem",
|
|
172
171
|
components: {
|
|
@@ -179,10 +178,6 @@ const _sfc_main = {
|
|
|
179
178
|
Pencil,
|
|
180
179
|
Undo
|
|
181
180
|
},
|
|
182
|
-
inject: {
|
|
183
|
-
// Provided by NcAppNavigationList, absent when used outside of one
|
|
184
|
-
highlight: { from: APP_NAVIGATION_HIGHLIGHT, default: null }
|
|
185
|
-
},
|
|
186
181
|
props: {
|
|
187
182
|
/**
|
|
188
183
|
* If you are not using vue-router you can use the property to set this item as the active navigation entry.
|
|
@@ -405,21 +400,7 @@ const _sfc_main = {
|
|
|
405
400
|
mounted() {
|
|
406
401
|
this.actionsBoundariesElement = document.querySelector("#content-vue") || void 0;
|
|
407
402
|
},
|
|
408
|
-
beforeUnmount() {
|
|
409
|
-
this.releaseHighlight();
|
|
410
|
-
},
|
|
411
403
|
methods: {
|
|
412
|
-
/** Ask the parent list to move its highlight onto this entry */
|
|
413
|
-
requestHighlight() {
|
|
414
|
-
if (this.editingActive) {
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
this.highlight?.show(this.$refs.entry);
|
|
418
|
-
},
|
|
419
|
-
/** Tell the parent list this entry no longer wants the highlight */
|
|
420
|
-
releaseHighlight() {
|
|
421
|
-
this.highlight?.hide(this.$refs.entry);
|
|
422
|
-
},
|
|
423
404
|
// sync opened menu state with prop
|
|
424
405
|
onMenuToggle(state) {
|
|
425
406
|
this.$emit("update:menuOpen", state);
|
|
@@ -550,15 +531,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
550
531
|
(openBlock(), createBlock(resolveDynamicComponent($options.isRouterLink ? "router-link" : "NcVNodes"), normalizeProps(guardReactiveProps({ ...$options.isRouterLink && { custom: true, to: $props.to } })), {
|
|
551
532
|
default: withCtx(({ href: routerLinkHref, navigate, isActive }) => [
|
|
552
533
|
createElementVNode("div", {
|
|
553
|
-
ref: "entry",
|
|
554
534
|
class: normalizeClass(["app-navigation-entry", {
|
|
555
535
|
"app-navigation-entry--editing": $data.editingActive,
|
|
556
536
|
"app-navigation-entry--deleted": $props.undo,
|
|
557
537
|
"app-navigation-entry--legacy": $setup.isLegacy34,
|
|
558
538
|
active: $props.to && isActive || $props.active
|
|
559
|
-
}])
|
|
560
|
-
onPointerenter: _cache[4] || (_cache[4] = (...args) => $options.requestHighlight && $options.requestHighlight(...args)),
|
|
561
|
-
onFocusin: _cache[5] || (_cache[5] = (...args) => $options.requestHighlight && $options.requestHighlight(...args))
|
|
539
|
+
}])
|
|
562
540
|
}, [
|
|
563
541
|
!$props.undo ? (openBlock(), createElementBlock("a", {
|
|
564
542
|
key: 0,
|
|
@@ -578,9 +556,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
578
556
|
class: normalizeClass(["app-navigation-entry-icon", { [$props.icon]: $props.icon }])
|
|
579
557
|
}, [
|
|
580
558
|
$props.loading ? (openBlock(), createBlock(_component_NcLoadingIcon, { key: 0 })) : renderSlot(_ctx.$slots, "icon", {
|
|
581
|
-
key: 1,
|
|
582
559
|
active: $props.active || $props.to && isActive
|
|
583
|
-
}, void 0, true)
|
|
560
|
+
}, void 0, true, 1)
|
|
584
561
|
], 2),
|
|
585
562
|
createElementVNode("span", {
|
|
586
563
|
class: normalizeClass(["app-navigation-entry__name", { "hidden-visually": $data.editingActive }])
|
|
@@ -660,7 +637,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
660
637
|
onClick: withModifiers($options.toggleCollapse, ["prevent", "stop"])
|
|
661
638
|
}, null, 8, ["active", "open", "onClick"])) : createCommentVNode("", true),
|
|
662
639
|
renderSlot(_ctx.$slots, "extra", {}, void 0, true)
|
|
663
|
-
],
|
|
640
|
+
], 2)
|
|
664
641
|
]),
|
|
665
642
|
_: 3
|
|
666
643
|
}, 16)),
|
|
@@ -669,7 +646,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
669
646
|
])) : createCommentVNode("", true)
|
|
670
647
|
], 10, _hoisted_1);
|
|
671
648
|
}
|
|
672
|
-
const NcAppNavigationItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
649
|
+
const NcAppNavigationItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6cae7342"]]);
|
|
673
650
|
export {
|
|
674
651
|
NcAppNavigationItem as N
|
|
675
652
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcAppNavigationItem.mjs","sources":["../../node_modules/vue-material-design-icons/Pencil.vue","../../node_modules/vue-material-design-icons/Undo.vue","../../src/components/NcAppNavigationItem/NcAppNavigationIconCollapsible.vue","../../src/components/NcAppNavigationItem/NcAppNavigationItem.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon pencil-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"PencilIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon undo-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UndoIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<!-- Button to expand or collapse children -->\n\t<NcButton\n\t\tclass=\"icon-collapse\"\n\t\t:class=\"{\n\t\t\t'icon-collapse--active': active,\n\t\t\t'icon-collapse--open': open,\n\t\t}\"\n\t\t:aria-label=\"labelButton\"\n\t\t:variant=\"(active && isLegacy34) ? 'tertiary-on-primary' : 'tertiary'\"\n\t\t@click=\"onClick\">\n\t\t<template #icon>\n\t\t\t<ChevronUp\n\t\t\t\tv-if=\"open\"\n\t\t\t\t:size=\"20\" />\n\t\t\t<ChevronDown\n\t\t\t\tv-else\n\t\t\t\t:size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport ChevronDown from 'vue-material-design-icons/ChevronDown.vue'\nimport ChevronUp from 'vue-material-design-icons/ChevronUp.vue'\nimport { t } from '../../l10n.ts'\nimport { isLegacy34 } from '../../utils/legacy.ts'\nimport NcButton from '../NcButton/index.ts'\n\nexport default {\n\tname: 'NcAppNavigationIconCollapsible',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tChevronDown,\n\t\tChevronUp,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Is the list currently open (or collapsed)\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Is the navigation item currently active.\n\t\t */\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\temits: ['click'],\n\n\tsetup() {\n\t\treturn { isLegacy34 }\n\t},\n\n\tcomputed: {\n\t\tlabelButton() {\n\t\t\treturn this.open ? t('Collapse menu') : t('Open menu')\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonClick(e) {\n\t\t\tthis.$emit('click', e)\n\t\t},\n\t},\n\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.icon-collapse {\n\tposition: relative;\n\tinset-inline-end: 0;\n\n\t// the whole navigation item is hovered thus will have the hover color - to distinguish we need to set a different color here.\n\t&:hover {\n\t\tbackground-color: var(--color-background-dark) !important;\n\t}\n\t&--active:hover {\n\t\tbackground-color: var(--color-primary-element) !important;\n\t}\n}\n</style>\n","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### Usage\n\n#### Simple element\n\n* With an icon:\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem name=\"My name\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Check :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationItem>\n\t\t</ul>\n\t</template>\n\t<script>\n\timport Check from 'vue-material-design-icons/Check.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tCheck,\n\t\t},\n\t}\n\t</script>\n```\n* With a spinning loader instead of the icon:\n\n```vue\n<ul>\n\t<NcAppNavigationItem name=\"Loading Item\" :loading=\"true\" />\n</ul>\n```\n* With an active state (only needed when not using `vue-router` and the `to` property, otherwise this is set automatically)\n\n```vue\n<ul>\n\t<NcAppNavigationItem name=\"Current page\" :active=\"true\" />\n</ul>\n```\n\n* Using different icons based on the active state (e.g. using vue-router and showing the filled variant for the current route):\n\n```vue\n<template>\n\t<ul>\n\t\t<NcAppNavigationItem name=\"Current page\" :active=\"true\">\n\t\t\t<template #icon=\"{ active }\">\n\t\t\t\t<NcIconSvgWrapper :path=\"active ? mdiFolder : mdiFolderOutline\" />\n\t\t\t</template>\n\t\t</NcAppNavigationItem>\n\t\t<NcAppNavigationItem name=\"Other page\">\n\t\t\t<template #icon=\"{ active }\">\n\t\t\t\t<NcIconSvgWrapper :path=\"active ? mdiFolder : mdiFolderOutline\" />\n\t\t\t</template>\n\t\t</NcAppNavigationItem>\n\t</ul>\n</template>\n<script>\nimport { mdiFolder, mdiFolderOutline } from '@mdi/js'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmdiFolder,\n\t\t\tmdiFolderOutline,\n\t\t}\n\t},\n}\n</script>\n```\n\n#### Element with actions\nWrap the children in a template. If you have more than 2 actions, a popover menu and a menu\nbutton will be automatically created.\n\n```vue\n\t<template>\n\t\t<div id=\"app-navigation-vue-action\"><!-- Just a wrapper necessary in the docs. Not needed when NcAppNavigation is correctly used as parent. -->\n\t\t\t<ul>\n\t\t\t\t<NcAppNavigationItem name=\"Item with actions\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Check :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t<template #actions>\n\t\t\t\t\t\t<NcActionButton @click=\"alert('Edit')\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\tEdit\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionButton @click=\"alert('Delete')\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\tDelete\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionLink name=\"Link\" href=\"https://nextcloud.com\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<OpenInNew :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t</template>\n\t\t\t\t</NcAppNavigationItem>\n\t\t\t</ul>\n\t\t</div>\n\t</template>\n\t<script>\n\timport Check from 'vue-material-design-icons/Check.vue'\n\timport Delete from 'vue-material-design-icons/Delete.vue'\n\timport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\n\timport Pencil from 'vue-material-design-icons/Pencil.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tCheck,\n\t\t\tDelete,\n\t\t\tOpenInNew,\n\t\t\tPencil,\n\t\t},\n\t\tmethods: {\n\t\t\talert(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\n#### Element with counter\nJust nest the counter in a template within `<NcAppNavigationItem>` and add `#counter` to it.\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem name=\"Item with counter\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconFolderOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<template #counter>\n\t\t\t\t\t<NcCounterBubble :count=\"90\" />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationItem>\n\t\t</ul>\n\t</template>\n\t<script>\n\timport IconFolderOutline from 'vue-material-design-icons/FolderOutline.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tIconFolderOutline,\n\t\t},\n\t}\n\t</script>\n```\n\n#### Element with children\n\nWrap the children in a template with the `slot` property and use the prop `allowCollapse` to choose whether to allow or\nprevent the user from collapsing the items.\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem name=\"Item with children\" :allowCollapse=\"true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconFolderOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<template #counter>\n\t\t\t\t\t<NcCounterBubble :count=\"90\" />\n\t\t\t\t</template>\n\t\t\t\t<template #actions>\n\t\t\t\t\t<NcActionButton @click=\"alert('Edit')\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\tEdit\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton @click=\"alert('Delete')\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionLink name=\"Link\" href=\"https://nextcloud.com\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<OpenInNew :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionLink>\n\t\t\t\t</template>\n\t\t\t\t<template #default>\n\t\t\t\t\t<NcAppNavigationItem name=\"AppNavigationItemChild1\" />\n\t\t\t\t\t<NcAppNavigationItem name=\"AppNavigationItemChild2\" />\n\t\t\t\t\t<NcAppNavigationItem name=\"AppNavigationItemChild3\" />\n\t\t\t\t\t<NcAppNavigationItem name=\"AppNavigationItemChild4\" />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationItem>\n\t\t</ul>\n\t</template>\n\t<script>\n\timport IconFolderOutline from 'vue-material-design-icons/FolderOutline.vue'\n\timport Delete from 'vue-material-design-icons/Delete.vue'\n\timport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\n\timport Pencil from 'vue-material-design-icons/Pencil.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tIconFolderOutline,\n\t\t\tDelete,\n\t\t\tOpenInNew,\n\t\t\tPencil,\n\t\t},\n\t\tmethods: {\n\t\t\talert(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\n#### Editable element\nAdd the prop `:editable=true` and an edit placeholder if you need it. By default\nthe placeholder is the previous name of the element.\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem name=\"Editable Item\" :editable=\"true\"\n\t\t\t\teditPlaceholder=\"your_placeholder_here\" @update:name=\"function(value){alert(value)}\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconFolderOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationItem>\n\t\t</ul>\n\t</template>\n\t<script>\n\timport IconFolderOutline from 'vue-material-design-icons/FolderOutline.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tIconFolderOutline,\n\t\t},\n\t\tmethods: {\n\t\t\talert(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\n#### Undo element\nJust set the `undo` and `name` props. When clicking the undo button, an `undo` event is emitted.\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem :undo=\"true\" name=\"Deleted important entry\" @undo=\"alert('undo delete')\" />\n\t\t</ul>\n\t</template>\n\t<script>\n\texport default {\n\t\tmethods: {\n\t\t\talert(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\n#### Link element\nHref that start by http will be treated as external and opened in a new tab\n```\n<div>\n\t<ul>\n\t\t<NcAppNavigationItem name=\"Files\" href=\"/index.php/apps/files\" />\n\t\t<NcAppNavigationItem name=\"Nextcloud\" href=\"https://nextcloud.com\" />\n\t</ul>\n</div>\n```\n\n#### Custom title\n```\n<ul>\n\t<NcAppNavigationItem name=\"Nextcloud\" title=\"Open the Nextcloud website\" href=\"https://nextcloud.com\" />\n</ul>\n```\n\n#### Pinned element\nJust set the `pinned` prop.\n```\n<ul>\n\t<NcAppNavigationItem name=\"Pinned item\" :pinned=\"true\" />\n</ul>\n```\n</docs>\n\n<template>\n\t<li\n\t\t:id=\"id\"\n\t\t:class=\"{\n\t\t\t'app-navigation-entry--opened': opened,\n\t\t\t'app-navigation-entry--pinned': pinned,\n\t\t\t'app-navigation-entry--collapsible': allowCollapse && !!$slots.default,\n\t\t}\"\n\t\tclass=\"app-navigation-entry-wrapper\">\n\t\t<component\n\t\t\t:is=\"isRouterLink ? 'router-link' : 'NcVNodes'\"\n\t\t\tv-slot=\"{ href: routerLinkHref, navigate, isActive }\"\n\t\t\tv-bind=\"{ ...isRouterLink && { custom: true, to } }\">\n\t\t\t<div\n\t\t\t\tref=\"entry\"\n\t\t\t\tclass=\"app-navigation-entry\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'app-navigation-entry--editing': editingActive,\n\t\t\t\t\t'app-navigation-entry--deleted': undo,\n\t\t\t\t\t'app-navigation-entry--legacy': isLegacy34,\n\t\t\t\t\tactive: (to && isActive) || active,\n\t\t\t\t}\"\n\t\t\t\t@pointerenter=\"requestHighlight\"\n\t\t\t\t@focusin=\"requestHighlight\">\n\t\t\t\t<!-- Icon and name -->\n\t\t\t\t<a\n\t\t\t\t\tv-if=\"!undo\"\n\t\t\t\t\tclass=\"app-navigation-entry-link\"\n\t\t\t\t\t:aria-current=\"active || (to && isActive) ? 'page' : undefined\"\n\t\t\t\t\t:aria-description=\"ariaDescription\"\n\t\t\t\t\t:aria-expanded=\"!!$slots.default ? opened.toString() : undefined\"\n\t\t\t\t\t:href=\"href || routerLinkHref || '#'\"\n\t\t\t\t\t:target=\"isExternal(href) ? '_blank' : undefined\"\n\t\t\t\t\t:title=\"title || name\"\n\t\t\t\t\t@blur=\"handleBlur\"\n\t\t\t\t\t@click=\"onClick($event, navigate, routerLinkHref)\"\n\t\t\t\t\t@focus=\"handleFocus\"\n\t\t\t\t\t@keydown.tab.exact=\"handleTab\">\n\n\t\t\t\t\t<!-- icon if not collapsible -->\n\t\t\t\t\t<!-- never show the icon over the collapsible if mobile -->\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"app-navigation-entry-icon\"\n\t\t\t\t\t\t:class=\"{ [icon]: icon }\">\n\t\t\t\t\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t\t\t\t\t<!-- @slot Slot for the optional leading icon. This slots get the `active`-slot attribute passed which is based on the vue-routers active route or the `active` prop. -->\n\t\t\t\t\t\t<slot v-else name=\"icon\" :active=\"active || (to && isActive)\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class=\"app-navigation-entry__name\" :class=\"{ 'hidden-visually': editingActive }\">\n\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t</span>\n\t\t\t\t\t<div v-if=\"editingActive\" class=\"editingContainer\">\n\t\t\t\t\t\t<NcInputConfirmCancel\n\t\t\t\t\t\t\tref=\"editingInput\"\n\t\t\t\t\t\t\tv-model=\"editingValue\"\n\t\t\t\t\t\t\t:placeholder=\"editPlaceholder !== '' ? editPlaceholder : name\"\n\t\t\t\t\t\t\t:primary=\"(to && isActive) || active\"\n\t\t\t\t\t\t\t@cancel=\"cancelEditing\"\n\t\t\t\t\t\t\t@confirm=\"handleEditingDone\" />\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\n\t\t\t\t<!-- undo entry -->\n\t\t\t\t<div v-if=\"undo\" class=\"app-navigation-entry__deleted\">\n\t\t\t\t\t<div class=\"app-navigation-entry__deleted-description\">\n\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Counter and Actions -->\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"(!!$slots.actions || !!$slots.counter || editable || undo) && !editingActive\"\n\t\t\t\t\tclass=\"app-navigation-entry__utils\"\n\t\t\t\t\t:class=\"{ 'app-navigation-entry__utils--display-actions': forceDisplayActions || menuOpenLocalValue || menuOpen }\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"!!$slots.counter\"\n\t\t\t\t\t\tclass=\"app-navigation-entry__counter-wrapper\">\n\t\t\t\t\t\t<!-- @slot Slot for the `NcCounterBubble` -->\n\t\t\t\t\t\t<slot name=\"counter\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<NcActions\n\t\t\t\t\t\tv-if=\"!!$slots.actions || (editable && !editingActive) || undo\"\n\t\t\t\t\t\tref=\"actions\"\n\t\t\t\t\t\tclass=\"app-navigation-entry__actions\"\n\t\t\t\t\t\tcontainer=\"#app-navigation-vue\"\n\t\t\t\t\t\t:boundariesElement=\"actionsBoundariesElement\"\n\t\t\t\t\t\t:inline=\"inlineActions\"\n\t\t\t\t\t\t:placement=\"menuPlacement\"\n\t\t\t\t\t\t:open=\"menuOpen\"\n\t\t\t\t\t\t:forceMenu=\"forceMenu\"\n\t\t\t\t\t\t:defaultIcon=\"menuIcon\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@update:open=\"onMenuToggle\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<!-- @slot Slot for the custom menu icon -->\n\t\t\t\t\t\t\t<slot name=\"menu-icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"editable && !editingActive\"\n\t\t\t\t\t\t\t:aria-label=\"editButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"handleEdit\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"undo\"\n\t\t\t\t\t\t\t:aria-label=\"undoButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"handleUndo\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Undo :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<!-- @slot Slot for additional `NcAction*` -->\n\t\t\t\t\t\t<slot name=\"actions\" />\n\t\t\t\t\t</NcActions>\n\t\t\t\t</div>\n\t\t\t\t<NcAppNavigationIconCollapsible\n\t\t\t\t\tv-if=\"allowCollapse && !!$slots.default\"\n\t\t\t\t\t:active=\"(to && isActive) || active\"\n\t\t\t\t\t:open=\"opened\"\n\t\t\t\t\t@click.prevent.stop=\"toggleCollapse\" />\n\n\t\t\t\t<!-- @slot Slot for anything (virtual) that should be mounted in the component, like a related modal -->\n\t\t\t\t<slot name=\"extra\" />\n\t\t\t</div>\n\t\t</component>\n\t\t<!-- Children elements -->\n\t\t<ul v-if=\"canHaveChildren && !!$slots.default\" class=\"app-navigation-entry__children\">\n\t\t\t<!-- @slot Slot for children -->\n\t\t\t<slot />\n\t\t</ul>\n\t</li>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Undo from 'vue-material-design-icons/Undo.vue'\nimport NcAppNavigationIconCollapsible from './NcAppNavigationIconCollapsible.vue'\nimport NcInputConfirmCancel from './NcInputConfirmCancel.vue'\nimport { useIsMobile } from '../../composables/useIsMobile/index.js'\nimport { t } from '../../l10n.ts'\nimport { createElementId } from '../../utils/createElementId.ts'\nimport { isLegacy34 } from '../../utils/legacy.ts'\nimport NcActionButton from '../NcActionButton/index.js'\nimport NcActions from '../NcActions/index.js'\nimport { APP_NAVIGATION_HIGHLIGHT } from '../NcAppNavigationList/highlight.ts'\nimport NcLoadingIcon from '../NcLoadingIcon/index.ts'\nimport NcVNodes from '../NcVNodes/index.ts'\n\nexport default {\n\tname: 'NcAppNavigationItem',\n\n\tcomponents: {\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcAppNavigationIconCollapsible,\n\t\tNcInputConfirmCancel,\n\t\tNcLoadingIcon,\n\t\tNcVNodes,\n\t\tPencil,\n\t\tUndo,\n\t},\n\n\tinject: {\n\t\t// Provided by NcAppNavigationList, absent when used outside of one\n\t\thighlight: { from: APP_NAVIGATION_HIGHLIGHT, default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * If you are not using vue-router you can use the property to set this item as the active navigation entry.\n\t\t * When using vue-router and the `to` property this is set automatically.\n\t\t */\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The main text content of the entry.\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The title attribute of the element.\n\t\t */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the list item element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => createElementId(),\n\t\t\tvalidator: (id) => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * Refers to the icon on the left, this prop accepts a class\n\t\t * like 'icon-category-enabled'.\n\t\t */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Displays a loading animated icon on the left of the element\n\t\t * instead of the icon.\n\t\t */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Passing in a route will make the root element of this\n\t\t * component a `<router-link />` that points to that route.\n\t\t * By leaving this blank, the root element will be a `<li>`.\n\t\t */\n\t\tto: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * A direct link. This will be used as the `href` attribute.\n\t\t * This will ignore any `to` prop being defined.\n\t\t */\n\t\thref: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Gives the possibility to collapse the children elements into the\n\t\t * parent element (true) or expands the children elements (false).\n\t\t */\n\t\tallowCollapse: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Makes the name of the item editable by providing an `ActionButton`\n\t\t * component that toggles a form\n\t\t */\n\t\teditable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Only for 'editable' items, sets label for the edit action button.\n\t\t */\n\t\teditLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Only for items in 'editable' mode, sets the placeholder text for the editing form.\n\t\t */\n\t\teditPlaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Pins the item to the bottom left area, above the settings. Do not\n\t\t * place 'non-pinned' `AppnavigationItem` components below `pinned`\n\t\t * ones.\n\t\t */\n\t\tpinned: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Puts the item in the 'undo' state.\n\t\t */\n\t\tundo: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The navigation collapsible state (synced)\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The actions menu open state (synced)\n\t\t */\n\t\tmenuOpen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Force the actions to display in a three dot menu\n\t\t */\n\t\tforceMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The action's menu default icon\n\t\t */\n\t\tmenuIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * The action's menu direction\n\t\t */\n\t\tmenuPlacement: {\n\t\t\ttype: String,\n\t\t\tdefault: 'bottom',\n\t\t},\n\n\t\t/**\n\t\t * Entry aria details\n\t\t */\n\t\tariaDescription: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * To be used only when the elements in the actions menu are very important\n\t\t */\n\t\tforceDisplayActions: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Number of action items outside the menu\n\t\t */\n\t\tinlineActions: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:menuOpen',\n\t\t'update:open',\n\t\t'update:name',\n\t\t'click',\n\t\t'undo',\n\t],\n\n\tsetup() {\n\t\treturn {\n\t\t\tisMobile: useIsMobile(),\n\t\t\tisLegacy34,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tactionsBoundariesElement: undefined,\n\t\t\teditingValue: '',\n\t\t\topened: this.open, // Collapsible state\n\t\t\teditingActive: false,\n\t\t\t/**\n\t\t\t * Tracks the open state of the actions menu\n\t\t\t */\n\t\t\tmenuOpenLocalValue: false,\n\t\t\tfocused: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisRouterLink() {\n\t\t\treturn this.to && !this.href\n\t\t},\n\n\t\t// Checks if the component is already a children of another\n\t\t// instance of AppNavigationItem\n\t\tcanHaveChildren() {\n\t\t\tif (this.$parent.$options._componentTag === 'AppNavigationItem') {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\teditButtonAriaLabel() {\n\t\t\treturn this.editLabel ? this.editLabel : t('Edit item')\n\t\t},\n\n\t\tundoButtonAriaLabel() {\n\t\t\treturn t('Undo changes')\n\t\t},\n\t},\n\n\twatch: {\n\t\topen(newVal) {\n\t\t\tthis.opened = newVal\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.actionsBoundariesElement = document.querySelector('#content-vue') || undefined\n\t},\n\n\tbeforeUnmount() {\n\t\t// Release the highlight, e.g. when a virtual scroller drops this entry\n\t\tthis.releaseHighlight()\n\t},\n\n\tmethods: {\n\t\t/** Ask the parent list to move its highlight onto this entry */\n\t\trequestHighlight() {\n\t\t\t// Entries being edited have their own UI\n\t\t\tif (this.editingActive) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.highlight?.show(this.$refs.entry)\n\t\t},\n\n\t\t/** Tell the parent list this entry no longer wants the highlight */\n\t\treleaseHighlight() {\n\t\t\tthis.highlight?.hide(this.$refs.entry)\n\t\t},\n\n\t\t// sync opened menu state with prop\n\t\tonMenuToggle(state) {\n\t\t\tthis.$emit('update:menuOpen', state)\n\t\t\tthis.menuOpenLocalValue = state\n\t\t},\n\n\t\t// toggle the collapsible state\n\t\ttoggleCollapse() {\n\t\t\tthis.opened = !this.opened\n\t\t\tthis.$emit('update:open', this.opened)\n\t\t},\n\n\t\t/**\n\t\t * Handle link click\n\t\t *\n\t\t * @param {PointerEvent} event - Native click event\n\t\t * @param {(event: PointerEvent) => void} [navigate] - VueRouter link's navigate if any\n\t\t * @param {string} [routerLinkHref] - VueRouter link's href\n\t\t */\n\t\tonClick(event, navigate, routerLinkHref) {\n\t\t\t// Always forward native event\n\t\t\tthis.$emit('click', event)\n\t\t\t// Do not navigate with control keys - it is opening in a new tab\n\t\t\tif (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Prevent default link behaviour if it's a router-link and navigate manually\n\t\t\tif (routerLinkHref) {\n\t\t\t\tnavigate?.(event)\n\t\t\t\tevent.preventDefault()\n\t\t\t\t// On mobile, close app-navigation when navigating so it doesn't overlay content\n\t\t\t\tif (this.isMobile) {\n\t\t\t\t\temit('toggle-navigation', { open: false })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Edition methods\n\t\thandleEdit() {\n\t\t\tthis.editingValue = this.name\n\t\t\tthis.editingActive = true\n\t\t\tthis.onMenuToggle(false)\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.$refs.editingInput.focusInput()\n\t\t\t})\n\t\t},\n\n\t\tcancelEditing() {\n\t\t\tthis.editingActive = false\n\t\t},\n\n\t\thandleEditingDone() {\n\t\t\tthis.$emit('update:name', this.editingValue)\n\t\t\tthis.editingValue = ''\n\t\t\tthis.editingActive = false\n\t\t},\n\n\t\t// Undo methods\n\t\thandleUndo() {\n\t\t\tthis.$emit('undo')\n\t\t},\n\n\t\t/**\n\t\t * Show actions upon focus\n\t\t */\n\t\thandleFocus() {\n\t\t\tthis.focused = true\n\t\t},\n\n\t\thandleBlur() {\n\t\t\tthis.focused = false\n\t\t},\n\n\t\t/**\n\t\t * This method checks if the root element of the component is focused and\n\t\t * if that's the case it focuses the actions button if available\n\t\t *\n\t\t * @param {Event} e the keydown event\n\t\t */\n\t\thandleTab(e) {\n\t\t\tif (this.editingActive) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst actionsContainer = this.$el?.querySelector('.app-navigation-entry__utils')\n\t\t\tif (!actionsContainer) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst focusableElement = actionsContainer.querySelector('button')\n\t\t\tif (this.focused && focusableElement) {\n\t\t\t\te.preventDefault()\n\t\t\t\tfocusableElement.focus()\n\t\t\t\tthis.focused = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Is this an external link\n\t\t *\n\t\t * @param {string} href The link to check\n\t\t * @return {boolean} Whether it is external or not\n\t\t */\n\t\tisExternal(href) {\n\t\t\t// Match any protocol\n\t\t\treturn href && href.match(/[a-z]+:\\/\\//i)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n@use '../../assets/NcAppNavigationItem.scss';\n</style>\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_createElementVNode","_openBlock","_createBlock","NcVNodes","_normalizeClass","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_withCtx","_renderSlot","_createVNode","_toDisplayString","_createTextVNode"],"mappings":";;;;;;;;;;;;;;;;AAoBA,MAAKA,cAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO,CAAC,OAAO;AAAA,EACf,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA;IAER,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AACF;;;AAxBY,MAAAC,eAAA,EAAA,GAAE,sJAAqJ;;;sBAXjKC,mBAeO,QAfPC,WAAc,KAAA,QAAM;AAAA,IACb,eAAa,OAAA,QAAK,OAAA;AAAA,IAClB,cAAY,OAAA;AAAA,IACb,OAAM;AAAA,IACN,MAAK;AAAA,IACJ,SAAK,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA,YAAE,KAAA,MAAK,SAAU,MAAM;AAAA;kBACjCD,mBAQM,OAAA;AAAA,MARA,MAAM,OAAA;AAAA,MACP,OAAM;AAAA,MACL,OAAO,OAAA;AAAA,MACP,QAAQ,OAAA;AAAA,MACT,SAAQ;AAAA;MACXE,mBAEO,QAFPH,cAEO;AAAA,QADQ,OAAA,SAAbI,UAAA,GAAAH,mBAAuC,uCAAhB,OAAA,KAAK,GAAA,CAAA;;;;;;ACOpC,MAAKF,cAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO,CAAC,OAAO;AAAA,EACf,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA;IAER,WAAW;AAAA,MACT,MAAM;AAAA,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B;AAAA,gBAAzBO,WAAyB,KAAA,QAAA,aAAA,CAAA,GAAA,QAAA,IAAA;AAAA;+BAE1B,MAQiB;AAAA,gBAPV,OAAA,aAAa,MAAA,8BADpBP,YAQiB,2BAAA;AAAA;kBANf,cAAY,SAAA;AAAA,kBACZ,SAAO,SAAA;AAAA;kBACG,cACV,MAAqB;AAAA,oBAArBQ,YAAqB,mBAAA,EAAZ,MAAM,GAAE,CAAA;AAAA;mCACP,MACX;AAAA,oBADWE,gBAAA,sBACR,OAAA,SAAS,GAAA,CAAA;AAAA;;;gBAGN,OAAA,qBADPV,YAOiB,2BAAA;AAAA;kBALf,cAAY,SAAA;AAAA,kBACZ,SAAO,SAAA;AAAA;kBACG,cACV,MAAmB;AAAA,oBAAnBQ,YAAmB,iBAAA,EAAZ,MAAM,GAAE,CAAA;AAAA;;;gBAIjBD,WAAuB,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA;;;;UAIlB,OAAA,iBAAa,CAAA,CAAM,KAAA,OAAO,wBADjCP,YAIwC,2CAAA;AAAA;YAFtC,QAAS,OAAA,MAAM,YAAa,OAAA;AAAA,YAC5B,MAAM,MAAA;AAAA,YACN,uBAAoB,SAAA,gBAAc,CAAA,WAAA,MAAA,CAAA;AAAA;UAGpCO,WAAqB,KAAA,QAAA,SAAA,CAAA,GAAA,QAAA,IAAA;AAAA;;;;IAIb,SAAA,mBAAe,CAAA,CAAM,KAAA,OAAO,WAAtCR,aAAAH,mBAGK,MAHL,YAGK;AAAA,MADJW,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA;;;;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"NcAppNavigationItem.mjs","sources":["../../node_modules/vue-material-design-icons/Pencil.vue","../../node_modules/vue-material-design-icons/Undo.vue","../../src/components/NcAppNavigationItem/NcAppNavigationIconCollapsible.vue","../../src/components/NcAppNavigationItem/NcAppNavigationItem.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon pencil-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"PencilIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon undo-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"UndoIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<!-- Button to expand or collapse children -->\n\t<NcButton\n\t\tclass=\"icon-collapse\"\n\t\t:class=\"{\n\t\t\t'icon-collapse--active': active,\n\t\t\t'icon-collapse--open': open,\n\t\t}\"\n\t\t:aria-label=\"labelButton\"\n\t\t:variant=\"(active && isLegacy34) ? 'tertiary-on-primary' : 'tertiary'\"\n\t\t@click=\"onClick\">\n\t\t<template #icon>\n\t\t\t<ChevronUp\n\t\t\t\tv-if=\"open\"\n\t\t\t\t:size=\"20\" />\n\t\t\t<ChevronDown\n\t\t\t\tv-else\n\t\t\t\t:size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport ChevronDown from 'vue-material-design-icons/ChevronDown.vue'\nimport ChevronUp from 'vue-material-design-icons/ChevronUp.vue'\nimport { t } from '../../l10n.ts'\nimport { isLegacy34 } from '../../utils/legacy.ts'\nimport NcButton from '../NcButton/index.ts'\n\nexport default {\n\tname: 'NcAppNavigationIconCollapsible',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tChevronDown,\n\t\tChevronUp,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Is the list currently open (or collapsed)\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Is the navigation item currently active.\n\t\t */\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\temits: ['click'],\n\n\tsetup() {\n\t\treturn { isLegacy34 }\n\t},\n\n\tcomputed: {\n\t\tlabelButton() {\n\t\t\treturn this.open ? t('Collapse menu') : t('Open menu')\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonClick(e) {\n\t\t\tthis.$emit('click', e)\n\t\t},\n\t},\n\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.icon-collapse {\n\tposition: relative;\n\tinset-inline-end: 0;\n\n\t// the whole navigation item is hovered thus will have the hover color - to distinguish we need to set a different color here.\n\t&:hover {\n\t\tbackground-color: var(--color-background-dark) !important;\n\t}\n\t&--active:hover {\n\t\tbackground-color: var(--color-primary-element) !important;\n\t}\n}\n</style>\n","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### Usage\n\n#### Simple element\n\n* With an icon:\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem name=\"My name\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Check :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationItem>\n\t\t</ul>\n\t</template>\n\t<script>\n\timport Check from 'vue-material-design-icons/Check.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tCheck,\n\t\t},\n\t}\n\t</script>\n```\n* With a spinning loader instead of the icon:\n\n```vue\n<ul>\n\t<NcAppNavigationItem name=\"Loading Item\" :loading=\"true\" />\n</ul>\n```\n* With an active state (only needed when not using `vue-router` and the `to` property, otherwise this is set automatically)\n\n```vue\n<ul>\n\t<NcAppNavigationItem name=\"Current page\" :active=\"true\" />\n</ul>\n```\n\n* Using different icons based on the active state (e.g. using vue-router and showing the filled variant for the current route):\n\n```vue\n<template>\n\t<ul>\n\t\t<NcAppNavigationItem name=\"Current page\" :active=\"true\">\n\t\t\t<template #icon=\"{ active }\">\n\t\t\t\t<NcIconSvgWrapper :path=\"active ? mdiFolder : mdiFolderOutline\" />\n\t\t\t</template>\n\t\t</NcAppNavigationItem>\n\t\t<NcAppNavigationItem name=\"Other page\">\n\t\t\t<template #icon=\"{ active }\">\n\t\t\t\t<NcIconSvgWrapper :path=\"active ? mdiFolder : mdiFolderOutline\" />\n\t\t\t</template>\n\t\t</NcAppNavigationItem>\n\t</ul>\n</template>\n<script>\nimport { mdiFolder, mdiFolderOutline } from '@mdi/js'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmdiFolder,\n\t\t\tmdiFolderOutline,\n\t\t}\n\t},\n}\n</script>\n```\n\n#### Element with actions\nWrap the children in a template. If you have more than 2 actions, a popover menu and a menu\nbutton will be automatically created.\n\n```vue\n\t<template>\n\t\t<div id=\"app-navigation-vue-action\"><!-- Just a wrapper necessary in the docs. Not needed when NcAppNavigation is correctly used as parent. -->\n\t\t\t<ul>\n\t\t\t\t<NcAppNavigationItem name=\"Item with actions\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Check :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t<template #actions>\n\t\t\t\t\t\t<NcActionButton @click=\"alert('Edit')\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\tEdit\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionButton @click=\"alert('Delete')\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\tDelete\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionLink name=\"Link\" href=\"https://nextcloud.com\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<OpenInNew :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t</template>\n\t\t\t\t</NcAppNavigationItem>\n\t\t\t</ul>\n\t\t</div>\n\t</template>\n\t<script>\n\timport Check from 'vue-material-design-icons/Check.vue'\n\timport Delete from 'vue-material-design-icons/Delete.vue'\n\timport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\n\timport Pencil from 'vue-material-design-icons/Pencil.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tCheck,\n\t\t\tDelete,\n\t\t\tOpenInNew,\n\t\t\tPencil,\n\t\t},\n\t\tmethods: {\n\t\t\talert(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\n#### Element with counter\nJust nest the counter in a template within `<NcAppNavigationItem>` and add `#counter` to it.\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem name=\"Item with counter\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconFolderOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<template #counter>\n\t\t\t\t\t<NcCounterBubble :count=\"90\" />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationItem>\n\t\t</ul>\n\t</template>\n\t<script>\n\timport IconFolderOutline from 'vue-material-design-icons/FolderOutline.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tIconFolderOutline,\n\t\t},\n\t}\n\t</script>\n```\n\n#### Element with children\n\nWrap the children in a template with the `slot` property and use the prop `allowCollapse` to choose whether to allow or\nprevent the user from collapsing the items.\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem name=\"Item with children\" :allowCollapse=\"true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconFolderOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<template #counter>\n\t\t\t\t\t<NcCounterBubble :count=\"90\" />\n\t\t\t\t</template>\n\t\t\t\t<template #actions>\n\t\t\t\t\t<NcActionButton @click=\"alert('Edit')\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\tEdit\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton @click=\"alert('Delete')\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionLink name=\"Link\" href=\"https://nextcloud.com\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<OpenInNew :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionLink>\n\t\t\t\t</template>\n\t\t\t\t<template #default>\n\t\t\t\t\t<NcAppNavigationItem name=\"AppNavigationItemChild1\" />\n\t\t\t\t\t<NcAppNavigationItem name=\"AppNavigationItemChild2\" />\n\t\t\t\t\t<NcAppNavigationItem name=\"AppNavigationItemChild3\" />\n\t\t\t\t\t<NcAppNavigationItem name=\"AppNavigationItemChild4\" />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationItem>\n\t\t</ul>\n\t</template>\n\t<script>\n\timport IconFolderOutline from 'vue-material-design-icons/FolderOutline.vue'\n\timport Delete from 'vue-material-design-icons/Delete.vue'\n\timport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\n\timport Pencil from 'vue-material-design-icons/Pencil.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tIconFolderOutline,\n\t\t\tDelete,\n\t\t\tOpenInNew,\n\t\t\tPencil,\n\t\t},\n\t\tmethods: {\n\t\t\talert(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\n#### Editable element\nAdd the prop `:editable=true` and an edit placeholder if you need it. By default\nthe placeholder is the previous name of the element.\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem name=\"Editable Item\" :editable=\"true\"\n\t\t\t\teditPlaceholder=\"your_placeholder_here\" @update:name=\"function(value){alert(value)}\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<IconFolderOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t</NcAppNavigationItem>\n\t\t</ul>\n\t</template>\n\t<script>\n\timport IconFolderOutline from 'vue-material-design-icons/FolderOutline.vue'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tIconFolderOutline,\n\t\t},\n\t\tmethods: {\n\t\t\talert(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\n#### Undo element\nJust set the `undo` and `name` props. When clicking the undo button, an `undo` event is emitted.\n\n```vue\n\t<template>\n\t\t<ul>\n\t\t\t<NcAppNavigationItem :undo=\"true\" name=\"Deleted important entry\" @undo=\"alert('undo delete')\" />\n\t\t</ul>\n\t</template>\n\t<script>\n\texport default {\n\t\tmethods: {\n\t\t\talert(msg) {\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t},\n\t}\n\t</script>\n```\n\n#### Link element\nHref that start by http will be treated as external and opened in a new tab\n```\n<div>\n\t<ul>\n\t\t<NcAppNavigationItem name=\"Files\" href=\"/index.php/apps/files\" />\n\t\t<NcAppNavigationItem name=\"Nextcloud\" href=\"https://nextcloud.com\" />\n\t</ul>\n</div>\n```\n\n#### Custom title\n```\n<ul>\n\t<NcAppNavigationItem name=\"Nextcloud\" title=\"Open the Nextcloud website\" href=\"https://nextcloud.com\" />\n</ul>\n```\n\n#### Pinned element\nJust set the `pinned` prop.\n```\n<ul>\n\t<NcAppNavigationItem name=\"Pinned item\" :pinned=\"true\" />\n</ul>\n```\n</docs>\n\n<template>\n\t<li\n\t\t:id=\"id\"\n\t\t:class=\"{\n\t\t\t'app-navigation-entry--opened': opened,\n\t\t\t'app-navigation-entry--pinned': pinned,\n\t\t\t'app-navigation-entry--collapsible': allowCollapse && !!$slots.default,\n\t\t}\"\n\t\tclass=\"app-navigation-entry-wrapper\">\n\t\t<component\n\t\t\t:is=\"isRouterLink ? 'router-link' : 'NcVNodes'\"\n\t\t\tv-slot=\"{ href: routerLinkHref, navigate, isActive }\"\n\t\t\tv-bind=\"{ ...isRouterLink && { custom: true, to } }\">\n\t\t\t<div\n\t\t\t\tclass=\"app-navigation-entry\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'app-navigation-entry--editing': editingActive,\n\t\t\t\t\t'app-navigation-entry--deleted': undo,\n\t\t\t\t\t'app-navigation-entry--legacy': isLegacy34,\n\t\t\t\t\tactive: (to && isActive) || active,\n\t\t\t\t}\">\n\t\t\t\t<!-- Icon and name -->\n\t\t\t\t<a\n\t\t\t\t\tv-if=\"!undo\"\n\t\t\t\t\tclass=\"app-navigation-entry-link\"\n\t\t\t\t\t:aria-current=\"active || (to && isActive) ? 'page' : undefined\"\n\t\t\t\t\t:aria-description=\"ariaDescription\"\n\t\t\t\t\t:aria-expanded=\"!!$slots.default ? opened.toString() : undefined\"\n\t\t\t\t\t:href=\"href || routerLinkHref || '#'\"\n\t\t\t\t\t:target=\"isExternal(href) ? '_blank' : undefined\"\n\t\t\t\t\t:title=\"title || name\"\n\t\t\t\t\t@blur=\"handleBlur\"\n\t\t\t\t\t@click=\"onClick($event, navigate, routerLinkHref)\"\n\t\t\t\t\t@focus=\"handleFocus\"\n\t\t\t\t\t@keydown.tab.exact=\"handleTab\">\n\n\t\t\t\t\t<!-- icon if not collapsible -->\n\t\t\t\t\t<!-- never show the icon over the collapsible if mobile -->\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"app-navigation-entry-icon\"\n\t\t\t\t\t\t:class=\"{ [icon]: icon }\">\n\t\t\t\t\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t\t\t\t\t<!-- @slot Slot for the optional leading icon. This slots get the `active`-slot attribute passed which is based on the vue-routers active route or the `active` prop. -->\n\t\t\t\t\t\t<slot v-else name=\"icon\" :active=\"active || (to && isActive)\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class=\"app-navigation-entry__name\" :class=\"{ 'hidden-visually': editingActive }\">\n\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t</span>\n\t\t\t\t\t<div v-if=\"editingActive\" class=\"editingContainer\">\n\t\t\t\t\t\t<NcInputConfirmCancel\n\t\t\t\t\t\t\tref=\"editingInput\"\n\t\t\t\t\t\t\tv-model=\"editingValue\"\n\t\t\t\t\t\t\t:placeholder=\"editPlaceholder !== '' ? editPlaceholder : name\"\n\t\t\t\t\t\t\t:primary=\"(to && isActive) || active\"\n\t\t\t\t\t\t\t@cancel=\"cancelEditing\"\n\t\t\t\t\t\t\t@confirm=\"handleEditingDone\" />\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\n\t\t\t\t<!-- undo entry -->\n\t\t\t\t<div v-if=\"undo\" class=\"app-navigation-entry__deleted\">\n\t\t\t\t\t<div class=\"app-navigation-entry__deleted-description\">\n\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Counter and Actions -->\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"(!!$slots.actions || !!$slots.counter || editable || undo) && !editingActive\"\n\t\t\t\t\tclass=\"app-navigation-entry__utils\"\n\t\t\t\t\t:class=\"{ 'app-navigation-entry__utils--display-actions': forceDisplayActions || menuOpenLocalValue || menuOpen }\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"!!$slots.counter\"\n\t\t\t\t\t\tclass=\"app-navigation-entry__counter-wrapper\">\n\t\t\t\t\t\t<!-- @slot Slot for the `NcCounterBubble` -->\n\t\t\t\t\t\t<slot name=\"counter\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<NcActions\n\t\t\t\t\t\tv-if=\"!!$slots.actions || (editable && !editingActive) || undo\"\n\t\t\t\t\t\tref=\"actions\"\n\t\t\t\t\t\tclass=\"app-navigation-entry__actions\"\n\t\t\t\t\t\tcontainer=\"#app-navigation-vue\"\n\t\t\t\t\t\t:boundariesElement=\"actionsBoundariesElement\"\n\t\t\t\t\t\t:inline=\"inlineActions\"\n\t\t\t\t\t\t:placement=\"menuPlacement\"\n\t\t\t\t\t\t:open=\"menuOpen\"\n\t\t\t\t\t\t:forceMenu=\"forceMenu\"\n\t\t\t\t\t\t:defaultIcon=\"menuIcon\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t@update:open=\"onMenuToggle\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<!-- @slot Slot for the custom menu icon -->\n\t\t\t\t\t\t\t<slot name=\"menu-icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"editable && !editingActive\"\n\t\t\t\t\t\t\t:aria-label=\"editButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"handleEdit\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"undo\"\n\t\t\t\t\t\t\t:aria-label=\"undoButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"handleUndo\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Undo :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<!-- @slot Slot for additional `NcAction*` -->\n\t\t\t\t\t\t<slot name=\"actions\" />\n\t\t\t\t\t</NcActions>\n\t\t\t\t</div>\n\t\t\t\t<NcAppNavigationIconCollapsible\n\t\t\t\t\tv-if=\"allowCollapse && !!$slots.default\"\n\t\t\t\t\t:active=\"(to && isActive) || active\"\n\t\t\t\t\t:open=\"opened\"\n\t\t\t\t\t@click.prevent.stop=\"toggleCollapse\" />\n\n\t\t\t\t<!-- @slot Slot for anything (virtual) that should be mounted in the component, like a related modal -->\n\t\t\t\t<slot name=\"extra\" />\n\t\t\t</div>\n\t\t</component>\n\t\t<!-- Children elements -->\n\t\t<ul v-if=\"canHaveChildren && !!$slots.default\" class=\"app-navigation-entry__children\">\n\t\t\t<!-- @slot Slot for children -->\n\t\t\t<slot />\n\t\t</ul>\n\t</li>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Undo from 'vue-material-design-icons/Undo.vue'\nimport NcAppNavigationIconCollapsible from './NcAppNavigationIconCollapsible.vue'\nimport NcInputConfirmCancel from './NcInputConfirmCancel.vue'\nimport { useIsMobile } from '../../composables/useIsMobile/index.js'\nimport { t } from '../../l10n.ts'\nimport { createElementId } from '../../utils/createElementId.ts'\nimport { isLegacy34 } from '../../utils/legacy.ts'\nimport NcActionButton from '../NcActionButton/index.js'\nimport NcActions from '../NcActions/index.js'\nimport NcLoadingIcon from '../NcLoadingIcon/index.ts'\nimport NcVNodes from '../NcVNodes/index.ts'\n\nexport default {\n\tname: 'NcAppNavigationItem',\n\n\tcomponents: {\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcAppNavigationIconCollapsible,\n\t\tNcInputConfirmCancel,\n\t\tNcLoadingIcon,\n\t\tNcVNodes,\n\t\tPencil,\n\t\tUndo,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * If you are not using vue-router you can use the property to set this item as the active navigation entry.\n\t\t * When using vue-router and the `to` property this is set automatically.\n\t\t */\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The main text content of the entry.\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The title attribute of the element.\n\t\t */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the list item element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => createElementId(),\n\t\t\tvalidator: (id) => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * Refers to the icon on the left, this prop accepts a class\n\t\t * like 'icon-category-enabled'.\n\t\t */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Displays a loading animated icon on the left of the element\n\t\t * instead of the icon.\n\t\t */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Passing in a route will make the root element of this\n\t\t * component a `<router-link />` that points to that route.\n\t\t * By leaving this blank, the root element will be a `<li>`.\n\t\t */\n\t\tto: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * A direct link. This will be used as the `href` attribute.\n\t\t * This will ignore any `to` prop being defined.\n\t\t */\n\t\thref: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Gives the possibility to collapse the children elements into the\n\t\t * parent element (true) or expands the children elements (false).\n\t\t */\n\t\tallowCollapse: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Makes the name of the item editable by providing an `ActionButton`\n\t\t * component that toggles a form\n\t\t */\n\t\teditable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Only for 'editable' items, sets label for the edit action button.\n\t\t */\n\t\teditLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Only for items in 'editable' mode, sets the placeholder text for the editing form.\n\t\t */\n\t\teditPlaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Pins the item to the bottom left area, above the settings. Do not\n\t\t * place 'non-pinned' `AppnavigationItem` components below `pinned`\n\t\t * ones.\n\t\t */\n\t\tpinned: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Puts the item in the 'undo' state.\n\t\t */\n\t\tundo: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The navigation collapsible state (synced)\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The actions menu open state (synced)\n\t\t */\n\t\tmenuOpen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Force the actions to display in a three dot menu\n\t\t */\n\t\tforceMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The action's menu default icon\n\t\t */\n\t\tmenuIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * The action's menu direction\n\t\t */\n\t\tmenuPlacement: {\n\t\t\ttype: String,\n\t\t\tdefault: 'bottom',\n\t\t},\n\n\t\t/**\n\t\t * Entry aria details\n\t\t */\n\t\tariaDescription: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * To be used only when the elements in the actions menu are very important\n\t\t */\n\t\tforceDisplayActions: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Number of action items outside the menu\n\t\t */\n\t\tinlineActions: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:menuOpen',\n\t\t'update:open',\n\t\t'update:name',\n\t\t'click',\n\t\t'undo',\n\t],\n\n\tsetup() {\n\t\treturn {\n\t\t\tisMobile: useIsMobile(),\n\t\t\tisLegacy34,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tactionsBoundariesElement: undefined,\n\t\t\teditingValue: '',\n\t\t\topened: this.open, // Collapsible state\n\t\t\teditingActive: false,\n\t\t\t/**\n\t\t\t * Tracks the open state of the actions menu\n\t\t\t */\n\t\t\tmenuOpenLocalValue: false,\n\t\t\tfocused: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisRouterLink() {\n\t\t\treturn this.to && !this.href\n\t\t},\n\n\t\t// Checks if the component is already a children of another\n\t\t// instance of AppNavigationItem\n\t\tcanHaveChildren() {\n\t\t\tif (this.$parent.$options._componentTag === 'AppNavigationItem') {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\teditButtonAriaLabel() {\n\t\t\treturn this.editLabel ? this.editLabel : t('Edit item')\n\t\t},\n\n\t\tundoButtonAriaLabel() {\n\t\t\treturn t('Undo changes')\n\t\t},\n\t},\n\n\twatch: {\n\t\topen(newVal) {\n\t\t\tthis.opened = newVal\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.actionsBoundariesElement = document.querySelector('#content-vue') || undefined\n\t},\n\n\tmethods: {\n\t\t// sync opened menu state with prop\n\t\tonMenuToggle(state) {\n\t\t\tthis.$emit('update:menuOpen', state)\n\t\t\tthis.menuOpenLocalValue = state\n\t\t},\n\n\t\t// toggle the collapsible state\n\t\ttoggleCollapse() {\n\t\t\tthis.opened = !this.opened\n\t\t\tthis.$emit('update:open', this.opened)\n\t\t},\n\n\t\t/**\n\t\t * Handle link click\n\t\t *\n\t\t * @param {PointerEvent} event - Native click event\n\t\t * @param {(event: PointerEvent) => void} [navigate] - VueRouter link's navigate if any\n\t\t * @param {string} [routerLinkHref] - VueRouter link's href\n\t\t */\n\t\tonClick(event, navigate, routerLinkHref) {\n\t\t\t// Always forward native event\n\t\t\tthis.$emit('click', event)\n\t\t\t// Do not navigate with control keys - it is opening in a new tab\n\t\t\tif (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Prevent default link behaviour if it's a router-link and navigate manually\n\t\t\tif (routerLinkHref) {\n\t\t\t\tnavigate?.(event)\n\t\t\t\tevent.preventDefault()\n\t\t\t\t// On mobile, close app-navigation when navigating so it doesn't overlay content\n\t\t\t\tif (this.isMobile) {\n\t\t\t\t\temit('toggle-navigation', { open: false })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Edition methods\n\t\thandleEdit() {\n\t\t\tthis.editingValue = this.name\n\t\t\tthis.editingActive = true\n\t\t\tthis.onMenuToggle(false)\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.$refs.editingInput.focusInput()\n\t\t\t})\n\t\t},\n\n\t\tcancelEditing() {\n\t\t\tthis.editingActive = false\n\t\t},\n\n\t\thandleEditingDone() {\n\t\t\tthis.$emit('update:name', this.editingValue)\n\t\t\tthis.editingValue = ''\n\t\t\tthis.editingActive = false\n\t\t},\n\n\t\t// Undo methods\n\t\thandleUndo() {\n\t\t\tthis.$emit('undo')\n\t\t},\n\n\t\t/**\n\t\t * Show actions upon focus\n\t\t */\n\t\thandleFocus() {\n\t\t\tthis.focused = true\n\t\t},\n\n\t\thandleBlur() {\n\t\t\tthis.focused = false\n\t\t},\n\n\t\t/**\n\t\t * This method checks if the root element of the component is focused and\n\t\t * if that's the case it focuses the actions button if available\n\t\t *\n\t\t * @param {Event} e the keydown event\n\t\t */\n\t\thandleTab(e) {\n\t\t\tif (this.editingActive) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst actionsContainer = this.$el?.querySelector('.app-navigation-entry__utils')\n\t\t\tif (!actionsContainer) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst focusableElement = actionsContainer.querySelector('button')\n\t\t\tif (this.focused && focusableElement) {\n\t\t\t\te.preventDefault()\n\t\t\t\tfocusableElement.focus()\n\t\t\t\tthis.focused = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Is this an external link\n\t\t *\n\t\t * @param {string} href The link to check\n\t\t * @return {boolean} Whether it is external or not\n\t\t */\n\t\tisExternal(href) {\n\t\t\t// Match any protocol\n\t\t\treturn href && href.match(/[a-z]+:\\/\\//i)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n@use '../../assets/NcAppNavigationItem.scss';\n</style>\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_createElementVNode","_openBlock","_createBlock","NcVNodes","_normalizeClass","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_withCtx","_renderSlot","_createVNode","_toDisplayString","_createTextVNode"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAKA,cAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO,CAAC,OAAO;AAAA,EACf,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA;IAER,WAAW;AAAA,MACT,MAAM;AAA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HL,YAGK;AAAA,MADJW,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -1,146 +1,16 @@
|
|
|
1
1
|
import '../assets/NcAppNavigationList.css';
|
|
2
|
-
import {
|
|
3
|
-
import { A as APP_NAVIGATION_HIGHLIGHT } from "./highlight.mjs";
|
|
2
|
+
import { openBlock, createElementBlock, renderSlot } from "vue";
|
|
4
3
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
|
|
5
|
-
const _sfc_main =
|
|
6
|
-
name: "NcAppNavigationList"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[APP_NAVIGATION_HIGHLIGHT]: {
|
|
10
|
-
show: this.show,
|
|
11
|
-
hide: this.hide
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
data() {
|
|
16
|
-
return {
|
|
17
|
-
/** Entry the highlight is on, as reported by that entry itself */
|
|
18
|
-
entry: null,
|
|
19
|
-
/** Whether the highlight is shown */
|
|
20
|
-
visible: false,
|
|
21
|
-
/** Whether position changes should transition (slide) or snap */
|
|
22
|
-
animated: false,
|
|
23
|
-
/** Whether the highlight sits on the active entry (turns transparent) */
|
|
24
|
-
overActive: false,
|
|
25
|
-
/** Vertical offset of the highlight inside the scrollable content */
|
|
26
|
-
top: 0,
|
|
27
|
-
/** Height of the highlight */
|
|
28
|
-
height: 0,
|
|
29
|
-
/** Pending animation frame for re-measuring while scrolling */
|
|
30
|
-
scrollFrame: 0
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
computed: {
|
|
34
|
-
highlightStyle() {
|
|
35
|
-
return {
|
|
36
|
-
transform: `translateY(${this.top}px)`,
|
|
37
|
-
height: `${this.height}px`
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
beforeUnmount() {
|
|
42
|
-
if (this.scrollFrame) {
|
|
43
|
-
cancelAnimationFrame(this.scrollFrame);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
methods: {
|
|
47
|
-
/**
|
|
48
|
-
* Move the highlight onto an entry. It slides there if already visible,
|
|
49
|
-
* otherwise it snaps into place so it does not slide in from the entry
|
|
50
|
-
* that was hovered before. Over the active entry it turns transparent so
|
|
51
|
-
* that entry keeps its own static highlight.
|
|
52
|
-
*
|
|
53
|
-
* @param entry the entry element asking for the highlight
|
|
54
|
-
*/
|
|
55
|
-
show(entry) {
|
|
56
|
-
this.entry = entry;
|
|
57
|
-
this.overActive = entry.classList.contains("active");
|
|
58
|
-
if (this.visible) {
|
|
59
|
-
this.animated = true;
|
|
60
|
-
this.measure();
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
this.animated = false;
|
|
64
|
-
this.measure();
|
|
65
|
-
this.visible = true;
|
|
66
|
-
this.$nextTick(() => requestAnimationFrame(() => {
|
|
67
|
-
this.animated = true;
|
|
68
|
-
}));
|
|
69
|
-
},
|
|
70
|
-
/**
|
|
71
|
-
* Hide the highlight if it is on the given entry, e.g. because that entry
|
|
72
|
-
* is being removed. While the pointer only moves between entries the
|
|
73
|
-
* highlight stays visible, so it can slide on to the next one.
|
|
74
|
-
*
|
|
75
|
-
* @param entry the entry element that no longer wants the highlight
|
|
76
|
-
*/
|
|
77
|
-
hide(entry) {
|
|
78
|
-
if (this.entry === entry) {
|
|
79
|
-
this.hideNow();
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
/** Hide the highlight, as the pointer or focus left the list */
|
|
83
|
-
hideNow() {
|
|
84
|
-
this.visible = false;
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* Hide the highlight once focus leaves the list entirely
|
|
88
|
-
*
|
|
89
|
-
* @param event the focusout event
|
|
90
|
-
*/
|
|
91
|
-
onFocusOut(event) {
|
|
92
|
-
const list = this.$refs.list;
|
|
93
|
-
if (!list.contains(event.relatedTarget)) {
|
|
94
|
-
this.hideNow();
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
/** Read the current entry's geometry relative to the list content */
|
|
98
|
-
measure() {
|
|
99
|
-
const list = this.$refs.list;
|
|
100
|
-
if (!list || !this.entry) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const entryRect = this.entry.getBoundingClientRect();
|
|
104
|
-
const listRect = list.getBoundingClientRect();
|
|
105
|
-
this.top = entryRect.top - listRect.top + list.scrollTop;
|
|
106
|
-
this.height = entryRect.height;
|
|
107
|
-
},
|
|
108
|
-
/**
|
|
109
|
-
* Keep the highlight on its entry while scrolling. Needed because a
|
|
110
|
-
* virtual scroller repositions its entries as the list scrolls.
|
|
111
|
-
*/
|
|
112
|
-
onScroll() {
|
|
113
|
-
if (!this.visible || this.scrollFrame) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
this.scrollFrame = requestAnimationFrame(() => {
|
|
117
|
-
this.scrollFrame = 0;
|
|
118
|
-
this.measure();
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
});
|
|
4
|
+
const _sfc_main = {
|
|
5
|
+
name: "NcAppNavigationList"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_1 = { class: "app-navigation-list" };
|
|
123
8
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
124
|
-
return openBlock(), createElementBlock("ul",
|
|
125
|
-
ref: "list",
|
|
126
|
-
class: normalizeClass(["app-navigation-list", { "app-navigation-list--animated-highlight": _ctx.visible }]),
|
|
127
|
-
onPointerleave: _cache[0] || (_cache[0] = (...args) => _ctx.hideNow && _ctx.hideNow(...args)),
|
|
128
|
-
onFocusout: _cache[1] || (_cache[1] = (...args) => _ctx.onFocusOut && _ctx.onFocusOut(...args)),
|
|
129
|
-
onScrollPassive: _cache[2] || (_cache[2] = (...args) => _ctx.onScroll && _ctx.onScroll(...args))
|
|
130
|
-
}, [
|
|
131
|
-
createElementVNode("div", {
|
|
132
|
-
class: normalizeClass(["app-navigation-list__highlight", {
|
|
133
|
-
"app-navigation-list__highlight--visible": _ctx.visible,
|
|
134
|
-
"app-navigation-list__highlight--animated": _ctx.animated,
|
|
135
|
-
"app-navigation-list__highlight--over-active": _ctx.overActive
|
|
136
|
-
}]),
|
|
137
|
-
style: normalizeStyle(_ctx.highlightStyle),
|
|
138
|
-
"aria-hidden": "true"
|
|
139
|
-
}, null, 6),
|
|
9
|
+
return openBlock(), createElementBlock("ul", _hoisted_1, [
|
|
140
10
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
141
|
-
]
|
|
11
|
+
]);
|
|
142
12
|
}
|
|
143
|
-
const NcAppNavigationList = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
13
|
+
const NcAppNavigationList = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-d72957ed"]]);
|
|
144
14
|
export {
|
|
145
15
|
NcAppNavigationList as N
|
|
146
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcAppNavigationList.mjs","sources":["../../src/components/NcAppNavigationList/NcAppNavigationList.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\n\nList wrapper for use in NcAppNavigation.\n\nThe list renders a single hover/focus highlight that slides between entries\ninstead of every entry painting its own hover background. When it slides onto\nthe active entry it turns transparent, so the active entry keeps its own\nstatic highlight.\n\nEntries ask for the highlight themselves - `NcAppNavigationItem` does this out\nof the box. The list never inspects the DOM to find out what is hovered, so it\nalso works when entries are rendered by a virtual scroller. If no entry ever\nasks for it the per-entry hover background is used as a fallback.\n\n#### Example\n\nUsage with NcAppNavigationCaption as a heading.\n\n```vue\n<NcAppNavigation>\n\t<NcAppNavigationList>\n\t\t<NcAppNavigationItem name=\"First\" />\n\t\t<NcAppNavigationItem name=\"Second\" />\n\t\t<NcAppNavigationItem name=\"Third\" />\n\t</NcAppNavigationList>\n\t<NcAppNavigationCaption name=\"Sections\" is-heading />\n\t<NcAppNavigationList>\n\t\t<NcAppNavigationItem name=\"Foo\" />\n\t\t<NcAppNavigationItem name=\"Bar\" />\n\t\t<NcAppNavigationItem name=\"Baz\" />\n\t</NcAppNavigationList>\n</NcAppNavigation>\n```\n</docs>\n\n<template>\n\t<ul\n\t\tref=\"list\"\n\t\tclass=\"app-navigation-list\"\n\t\t:class=\"{ 'app-navigation-list--animated-highlight': visible }\"\n\t\t@pointerleave=\"hideNow\"\n\t\t@focusout=\"onFocusOut\"\n\t\t@scroll.passive=\"onScroll\">\n\t\t<div\n\t\t\tclass=\"app-navigation-list__highlight\"\n\t\t\t:class=\"{\n\t\t\t\t'app-navigation-list__highlight--visible': visible,\n\t\t\t\t'app-navigation-list__highlight--animated': animated,\n\t\t\t\t'app-navigation-list__highlight--over-active': overActive,\n\t\t\t}\"\n\t\t\t:style=\"highlightStyle\"\n\t\t\taria-hidden=\"true\" />\n\t\t<slot />\n\t</ul>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nimport { APP_NAVIGATION_HIGHLIGHT } from './highlight.ts'\n\nexport default defineComponent({\n\tname: 'NcAppNavigationList',\n\n\tprovide() {\n\t\treturn {\n\t\t\t[APP_NAVIGATION_HIGHLIGHT]: {\n\t\t\t\tshow: this.show,\n\t\t\t\thide: this.hide,\n\t\t\t},\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Entry the highlight is on, as reported by that entry itself */\n\t\t\tentry: null as HTMLElement | null,\n\t\t\t/** Whether the highlight is shown */\n\t\t\tvisible: false,\n\t\t\t/** Whether position changes should transition (slide) or snap */\n\t\t\tanimated: false,\n\t\t\t/** Whether the highlight sits on the active entry (turns transparent) */\n\t\t\toverActive: false,\n\t\t\t/** Vertical offset of the highlight inside the scrollable content */\n\t\t\ttop: 0,\n\t\t\t/** Height of the highlight */\n\t\t\theight: 0,\n\t\t\t/** Pending animation frame for re-measuring while scrolling */\n\t\t\tscrollFrame: 0,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\thighlightStyle(): Record<string, string> {\n\t\t\treturn {\n\t\t\t\ttransform: `translateY(${this.top}px)`,\n\t\t\t\theight: `${this.height}px`,\n\t\t\t}\n\t\t},\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.scrollFrame) {\n\t\t\tcancelAnimationFrame(this.scrollFrame)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Move the highlight onto an entry. It slides there if already visible,\n\t\t * otherwise it snaps into place so it does not slide in from the entry\n\t\t * that was hovered before. Over the active entry it turns transparent so\n\t\t * that entry keeps its own static highlight.\n\t\t *\n\t\t * @param entry the entry element asking for the highlight\n\t\t */\n\t\tshow(entry: HTMLElement) {\n\t\t\tthis.entry = entry\n\t\t\tthis.overActive = entry.classList.contains('active')\n\t\t\tif (this.visible) {\n\t\t\t\tthis.animated = true\n\t\t\t\tthis.measure()\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Re-appearing: snap to the new position, then allow sliding again\n\t\t\tthis.animated = false\n\t\t\tthis.measure()\n\t\t\tthis.visible = true\n\t\t\tthis.$nextTick(() => requestAnimationFrame(() => {\n\t\t\t\tthis.animated = true\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Hide the highlight if it is on the given entry, e.g. because that entry\n\t\t * is being removed. While the pointer only moves between entries the\n\t\t * highlight stays visible, so it can slide on to the next one.\n\t\t *\n\t\t * @param entry the entry element that no longer wants the highlight\n\t\t */\n\t\thide(entry: HTMLElement) {\n\t\t\tif (this.entry === entry) {\n\t\t\t\tthis.hideNow()\n\t\t\t}\n\t\t},\n\n\t\t/** Hide the highlight, as the pointer or focus left the list */\n\t\thideNow() {\n\t\t\tthis.visible = false\n\t\t},\n\n\t\t/**\n\t\t * Hide the highlight once focus leaves the list entirely\n\t\t *\n\t\t * @param event the focusout event\n\t\t */\n\t\tonFocusOut(event: FocusEvent) {\n\t\t\tconst list = this.$refs.list as HTMLElement\n\t\t\tif (!list.contains(event.relatedTarget as Node | null)) {\n\t\t\t\tthis.hideNow()\n\t\t\t}\n\t\t},\n\n\t\t/** Read the current entry's geometry relative to the list content */\n\t\tmeasure() {\n\t\t\tconst list = this.$refs.list as HTMLElement | undefined\n\t\t\tif (!list || !this.entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst entryRect = this.entry.getBoundingClientRect()\n\t\t\tconst listRect = list.getBoundingClientRect()\n\t\t\tthis.top = entryRect.top - listRect.top + list.scrollTop\n\t\t\tthis.height = entryRect.height\n\t\t},\n\n\t\t/**\n\t\t * Keep the highlight on its entry while scrolling. Needed because a\n\t\t * virtual scroller repositions its entries as the list scrolls.\n\t\t */\n\t\tonScroll() {\n\t\t\tif (!this.visible || this.scrollFrame) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.scrollFrame = requestAnimationFrame(() => {\n\t\t\t\tthis.scrollFrame = 0\n\t\t\t\tthis.measure()\n\t\t\t})\n\t\t},\n\t},\n})\n</script>\n\n<style lang=\"scss\" scoped>\n.app-navigation-list {\n\tposition: relative;\n\twidth: 100%;\n\toverflow-x: hidden;\n\toverflow-y: auto;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--default-grid-baseline, 4px);\n\tpadding: var(--app-navigation-padding);\n\tisolation: isolate; // keep the highlight layered predictably within the list\n\n\t&__highlight {\n\t\t// Half of --animation-quick, so the highlight keeps up with the pointer\n\t\t--highlight-animation-duration: calc(var(--animation-quick) / 2);\n\t\tposition: absolute;\n\t\tinset-inline: var(--app-navigation-padding);\n\t\ttop: 0;\n\t\theight: 0;\n\t\t// As the first positioned child it paints below the entry wrappers\n\t\t// (also positioned), so it sits behind the entry content.\n\t\tz-index: 0;\n\t\tpointer-events: none;\n\t\topacity: 0;\n\t\tborder-radius: var(--border-radius-element);\n\t\t// Matches the per-entry hover background of non-legacy entries.\n\t\tbackground-color: color-mix(in srgb, var(--color-primary-element) 8%, transparent);\n\t\t// Only the position is transitioned, height snaps. Entries in a list are\n\t\t// usually equally high, so this is not visible, and it keeps the slide off\n\t\t// the layout path.\n\t\twill-change: transform;\n\t\t// The fade and the background morph are always transitioned; sliding is\n\t\t// opt-in via --animated so the highlight snaps when it (re)appears.\n\t\t// ease-out so it leaves the old entry immediately and feels responsive.\n\t\ttransition:\n\t\t\topacity var(--highlight-animation-duration) ease-out,\n\t\t\tbackground-color var(--highlight-animation-duration) ease-out;\n\n\t\t&--animated {\n\t\t\ttransition:\n\t\t\t\ttransform var(--highlight-animation-duration) ease-out,\n\t\t\t\topacity var(--highlight-animation-duration) ease-out,\n\t\t\t\tbackground-color var(--highlight-animation-duration) ease-out;\n\t\t}\n\n\t\t&--visible {\n\t\t\topacity: 1;\n\t\t}\n\n\t\t// Over the active entry the highlight turns transparent so the active\n\t\t// entry's own static highlight shows through unchanged, while the\n\t\t// highlight still slides on and off it for a continuous motion.\n\t\t&--over-active {\n\t\t\tbackground-color: transparent;\n\t\t}\n\t}\n\t// Reduced motion is handled globally: the --animation-quick variable is\n\t// collapsed under a prefers-reduced-motion media query by the server theme,\n\t// so these transitions become instant without a component-level override.\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_normalizeStyle","_renderSlot"],"mappings":";;;AAkEA,MAAA,YAAe,gBAAgB;AAAA,EAC9B,MAAM;AAAA,EAEN,UAAU;AACT,WAAO;AAAA,MACN,CAAC,wBAAwB,GAAG;AAAA,QAC3B,MAAM,KAAK;AAAA,QACX,MAAM,KAAK;AAAA,MAAA;AAAA,IACZ;AAAA,EAEF;AAAA,EAEA,OAAO;AACN,WAAO;AAAA;AAAA,MAEN,OAAO;AAAA;AAAA,MAEP,SAAS;AAAA;AAAA,MAET,UAAU;AAAA;AAAA,MAEV,YAAY;AAAA;AAAA,MAEZ,KAAK;AAAA;AAAA,MAEL,QAAQ;AAAA;AAAA,MAER,aAAa;AAAA,IAAA;AAAA,EAEf;AAAA,EAE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AAA,IACzB;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,WAAW;AACV,UAAI,CAAC,KAAK,WAAW,KAAK,aAAa;AACtC;AAAA,MACD;AACA,WAAK,cAAc,sBAAsB,MAAM;AAC9C,aAAK,cAAc;AACnB,aAAK,QAAA;AAAA,MACN,CAAC;AAAA,IACF;AAAA,EAAA;AAEF,CAAC;;sBAxJAA,mBAiBK,MAAA;AAAA,IAhBJ,KAAI;AAAA,IACJ,OAAKC,eAAA,CAAC,uBAAqB,EAAA,2CAC0B,KAAA,QAAA,CAAO,CAAA;AAAA,IAC3D,gBAAY,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA,IAAA,SAAE,KAAA,WAAA,KAAA,QAAA,GAAA,IAAA;AAAA,IACd,YAAQ,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA,IAAA,SAAE,KAAA,cAAA,KAAA,WAAA,GAAA,IAAA;AAAA,IAAA,iBAAA,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA,IAAA,SACM,KAAA,YAAA,KAAA,SAAA,GAAA,IAAA;AAAA,EAAA,GAAA;AAAA,IACjBC,mBAQsB,OAAA;AAAA,MAPrB,OAAKD,gBAAC,kCAAgC;AAAA,QAAA,2CACmB,KAAA;AAAA,QAAA,4CAAyD,KAAA;AAAA,QAAA,+CAA6D,KAAA;AAAA,MAAA,CAAA,CAAA;AAAA,MAK9K,OAAKE,eAAE,KAAA,cAAc;AAAA,MACtB,eAAY;AAAA,IAAA,GAAA,MAAA,CAAA;AAAA,IACbC,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA,EAAA,GAAA,EAAA;;;"}
|
|
1
|
+
{"version":3,"file":"NcAppNavigationList.mjs","sources":["../../src/components/NcAppNavigationList/NcAppNavigationList.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\n\nList wrapper for use in NcAppNavigation.\n\n#### Example\n\nUsage with NcAppNavigationCaption as a heading.\n\n```vue\n<NcAppNavigation>\n\t<NcAppNavigationList>\n\t\t<NcAppNavigationItem name=\"First\" />\n\t\t<NcAppNavigationItem name=\"Second\" />\n\t\t<NcAppNavigationItem name=\"Third\" />\n\t</NcAppNavigationList>\n\t<NcAppNavigationCaption name=\"Sections\" is-heading />\n\t<NcAppNavigationList>\n\t\t<NcAppNavigationItem name=\"Foo\" />\n\t\t<NcAppNavigationItem name=\"Bar\" />\n\t\t<NcAppNavigationItem name=\"Baz\" />\n\t</NcAppNavigationList>\n</NcAppNavigation>\n```\n</docs>\n\n<template>\n\t<ul class=\"app-navigation-list\">\n\t\t<slot />\n\t</ul>\n</template>\n\n<script lang=\"ts\">\nexport default {\n\tname: 'NcAppNavigationList',\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.app-navigation-list {\n\tposition: relative;\n\twidth: 100%;\n\toverflow-x: hidden;\n\toverflow-y: auto;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--default-grid-baseline, 4px);\n\tpadding: var(--app-navigation-padding);\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_renderSlot"],"mappings":";;AAsCA,MAAA,YAAe;AAAA,EACd,MAAM;AACP;AARK,MAAA,aAAA,EAAA,OAAM,sBAAA;;AAAV,SAAAA,UAAA,GAAAC,mBAEK,MAFL,YAEK;AAAA,IADJC,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA,EAAA,CAAA;;;"}
|
|
@@ -94,7 +94,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
94
94
|
createElementVNode("span", {
|
|
95
95
|
class: normalizeClass(["app-navigation-entry-icon", { [$props.icon]: !$props.loading }])
|
|
96
96
|
}, [
|
|
97
|
-
$props.loading ? (openBlock(), createBlock(_component_NcLoadingIcon, { key: 0 })) : renderSlot(_ctx.$slots, "icon", {
|
|
97
|
+
$props.loading ? (openBlock(), createBlock(_component_NcLoadingIcon, { key: 0 })) : renderSlot(_ctx.$slots, "icon", {}, void 0, true, 1)
|
|
98
98
|
], 2),
|
|
99
99
|
!$data.newItemActive ? (openBlock(), createElementBlock("span", {
|
|
100
100
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcAppNavigationNewItem.mjs","sources":["../../src/components/NcAppNavigationNewItem/NcAppNavigationNewItem.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Usage\n\n#### New Item element\n```vue\n\t<template>\n\t\t<NcAppNavigationNewItem name=\"New Item\" @new-item=\"function(value){alert(value)}\">\n\t\t\t<template #icon>\n\t\t\t\t<Plus :size=\"20\" />\n\t\t\t</template>\n\t\t</NcAppNavigationNewItem>\n\t</template>\n\t<script>\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tPlus,\n\t\t},\n\t}\n\t</script>\n```\n\n#### New Item element with a loading animation instead of the icon\n```vue\n\t<template>\n\t\t<NcAppNavigationNewItem name=\"New Item\" :loading=\"true\">\n\t\t\t<template #icon>\n\t\t\t\t<Plus :size=\"20\" />\n\t\t\t</template>\n\t\t</NcAppNavigationNewItem>\n\t</template>\n\t<script>\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tPlus,\n\t\t},\n\t}\n\t</script>\n```\n</docs>\n\n<template>\n\t<li\n\t\tclass=\"app-navigation-entry\"\n\t\t:class=\"{\n\t\t\t'app-navigation-entry--newItemActive': newItemActive,\n\t\t}\">\n\t\t<!-- New Item -->\n\t\t<button class=\"app-navigation-entry-button\" @click=\"handleNewItem\">\n\t\t\t<span\n\t\t\t\tclass=\"app-navigation-entry-icon\"\n\t\t\t\t:class=\"{ [icon]: !loading }\">\n\t\t\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t\t\t<slot v-else name=\"icon\" />\n\t\t\t</span>\n\n\t\t\t<span v-if=\"!newItemActive\" class=\"app-navigation-new-item__name\" :title=\"name\">\n\t\t\t\t{{ name }}\n\t\t\t</span>\n\n\t\t\t<!-- new Item input -->\n\t\t\t<span v-if=\"newItemActive\" class=\"newItemContainer\">\n\t\t\t\t<NcInputConfirmCancel\n\t\t\t\t\tref=\"newItemInput\"\n\t\t\t\t\tv-model=\"newItemValue\"\n\t\t\t\t\t:placeholder=\"editPlaceholder !== '' ? editPlaceholder : name\"\n\t\t\t\t\t@cancel=\"cancelNewItem\"\n\t\t\t\t\t@confirm=\"handleNewItemDone\" />\n\t\t\t</span>\n\t\t</button>\n\t</li>\n</template>\n\n<script>\nimport NcInputConfirmCancel from '../NcAppNavigationItem/NcInputConfirmCancel.vue'\nimport NcLoadingIcon from '../NcLoadingIcon/index.ts'\n\nexport default {\n\tname: 'NcAppNavigationNewItem',\n\n\tcomponents: {\n\t\tNcInputConfirmCancel,\n\t\tNcLoadingIcon,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The name of the element.\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Refers to the icon on the left, this prop accepts a class\n\t\t * like 'icon-category-enabled'.\n\t\t */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Displays a loading animated icon on the left of the element\n\t\t * instead of the icon.\n\t\t */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Only for 'editable' items, sets label for the edit action button.\n\t\t */\n\t\teditLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Sets the placeholder text for the editing form.\n\t\t */\n\t\teditPlaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['newItem'],\n\n\tdata() {\n\t\treturn {\n\t\t\tnewItemValue: '',\n\t\t\tnewItemActive: false,\n\t\t}\n\t},\n\n\tmethods: {\n\t\thandleNewItem() {\n\t\t\tif (!this.loading) {\n\t\t\t\tthis.newItemActive = true\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tthis.$refs.newItemInput.focusInput()\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\n\t\tcancelNewItem() {\n\t\t\tthis.newItemActive = false\n\t\t},\n\n\t\thandleNewItemDone() {\n\t\t\tthis.$emit('newItem', this.newItemValue)\n\t\t\tthis.newItemValue = ''\n\t\t\tthis.newItemActive = false\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n@use '../../assets/NcAppNavigationItem.scss';\n\n.app-navigation-new-item__name {\n\toverflow: hidden;\n\tmax-width: 100%;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\tpadding-inline-start: 7px;\n\tfont-size: 14px;\n}\n\n.newItemContainer {\n\twidth: calc(100% - var(--default-clickable-area));\n\tmargin: auto;\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_normalizeClass","_createBlock","_renderSlot","_openBlock","_createVNode"],"mappings":";;;;AAqFA,MAAK,YAAU;AAAA,EACd,MAAM;AAAA,EAEN,YAAY;AAAA,IACX;AAAA,IACA;AAAA;EAGD,OAAO;AAAA;AAAA;AAAA;AAAA,IAIN,MAAM;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA;;;;;IAOX,MAAM;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOV,SAAS;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMV,WAAW;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMV,iBAAiB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA;;EAIX,OAAO,CAAC,SAAS;AAAA,EAEjB,OAAO;AACN,WAAO;AAAA,MACN,cAAc;AAAA,MACd,eAAe;AAAA,IAChB;AAAA,EACD;AAAA,EAEA,SAAS;AAAA,IACR,gBAAgB;AACf,UAAI,CAAC,KAAK,SAAS;AAClB,aAAK,gBAAgB;AACrB,aAAK,UAAU,MAAM;AACpB,eAAK,MAAM,aAAa,WAAU;AAAA,QACnC,CAAC;AAAA,MACF;AAAA,IACD;AAAA,IAEA,gBAAgB;AACf,WAAK,gBAAgB;AAAA,IACtB;AAAA,IAEA,oBAAoB;AACnB,WAAK,MAAM,WAAW,KAAK,YAAY;AACvC,WAAK,eAAe;AACpB,WAAK,gBAAgB;AAAA,IACtB;AAAA;AAEF;;;;EAjG8B,OAAM;;;;;sBAnBnCA,mBA4BK,MAAA;AAAA,IA3BJ,uBAAM,wBAAsB;AAAA,6CACwB,MAAA;AAAA;;IAIpDC,mBAqBS,UAAA;AAAA,MArBD,OAAM;AAAA,MAA+B,gDAAO,SAAA,iBAAA,SAAA,cAAA,GAAA,IAAA;AAAA;MACnDA,mBAKO,QAAA;AAAA,QAJN,OAAKC,eAAA,CAAC,6BAA2B,EAAA,CACtB,OAAA,IAAI,IAAI,OAAA,SAAO,CAAA;AAAA;QACL,OAAA,wBAArBC,YAAgC,0BAAA,EAAA,KAAA,EAAA,CAAA,KAChCC,WAA2B,KAAA,QAAA,QAAA,
|
|
1
|
+
{"version":3,"file":"NcAppNavigationNewItem.mjs","sources":["../../src/components/NcAppNavigationNewItem/NcAppNavigationNewItem.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Usage\n\n#### New Item element\n```vue\n\t<template>\n\t\t<NcAppNavigationNewItem name=\"New Item\" @new-item=\"function(value){alert(value)}\">\n\t\t\t<template #icon>\n\t\t\t\t<Plus :size=\"20\" />\n\t\t\t</template>\n\t\t</NcAppNavigationNewItem>\n\t</template>\n\t<script>\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tPlus,\n\t\t},\n\t}\n\t</script>\n```\n\n#### New Item element with a loading animation instead of the icon\n```vue\n\t<template>\n\t\t<NcAppNavigationNewItem name=\"New Item\" :loading=\"true\">\n\t\t\t<template #icon>\n\t\t\t\t<Plus :size=\"20\" />\n\t\t\t</template>\n\t\t</NcAppNavigationNewItem>\n\t</template>\n\t<script>\n\timport Plus from 'vue-material-design-icons/Plus'\n\n\texport default {\n\t\tcomponents: {\n\t\t\tPlus,\n\t\t},\n\t}\n\t</script>\n```\n</docs>\n\n<template>\n\t<li\n\t\tclass=\"app-navigation-entry\"\n\t\t:class=\"{\n\t\t\t'app-navigation-entry--newItemActive': newItemActive,\n\t\t}\">\n\t\t<!-- New Item -->\n\t\t<button class=\"app-navigation-entry-button\" @click=\"handleNewItem\">\n\t\t\t<span\n\t\t\t\tclass=\"app-navigation-entry-icon\"\n\t\t\t\t:class=\"{ [icon]: !loading }\">\n\t\t\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t\t\t<slot v-else name=\"icon\" />\n\t\t\t</span>\n\n\t\t\t<span v-if=\"!newItemActive\" class=\"app-navigation-new-item__name\" :title=\"name\">\n\t\t\t\t{{ name }}\n\t\t\t</span>\n\n\t\t\t<!-- new Item input -->\n\t\t\t<span v-if=\"newItemActive\" class=\"newItemContainer\">\n\t\t\t\t<NcInputConfirmCancel\n\t\t\t\t\tref=\"newItemInput\"\n\t\t\t\t\tv-model=\"newItemValue\"\n\t\t\t\t\t:placeholder=\"editPlaceholder !== '' ? editPlaceholder : name\"\n\t\t\t\t\t@cancel=\"cancelNewItem\"\n\t\t\t\t\t@confirm=\"handleNewItemDone\" />\n\t\t\t</span>\n\t\t</button>\n\t</li>\n</template>\n\n<script>\nimport NcInputConfirmCancel from '../NcAppNavigationItem/NcInputConfirmCancel.vue'\nimport NcLoadingIcon from '../NcLoadingIcon/index.ts'\n\nexport default {\n\tname: 'NcAppNavigationNewItem',\n\n\tcomponents: {\n\t\tNcInputConfirmCancel,\n\t\tNcLoadingIcon,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The name of the element.\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Refers to the icon on the left, this prop accepts a class\n\t\t * like 'icon-category-enabled'.\n\t\t */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Displays a loading animated icon on the left of the element\n\t\t * instead of the icon.\n\t\t */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Only for 'editable' items, sets label for the edit action button.\n\t\t */\n\t\teditLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Sets the placeholder text for the editing form.\n\t\t */\n\t\teditPlaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['newItem'],\n\n\tdata() {\n\t\treturn {\n\t\t\tnewItemValue: '',\n\t\t\tnewItemActive: false,\n\t\t}\n\t},\n\n\tmethods: {\n\t\thandleNewItem() {\n\t\t\tif (!this.loading) {\n\t\t\t\tthis.newItemActive = true\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tthis.$refs.newItemInput.focusInput()\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\n\t\tcancelNewItem() {\n\t\t\tthis.newItemActive = false\n\t\t},\n\n\t\thandleNewItemDone() {\n\t\t\tthis.$emit('newItem', this.newItemValue)\n\t\t\tthis.newItemValue = ''\n\t\t\tthis.newItemActive = false\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n@use '../../assets/NcAppNavigationItem.scss';\n\n.app-navigation-new-item__name {\n\toverflow: hidden;\n\tmax-width: 100%;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\tpadding-inline-start: 7px;\n\tfont-size: 14px;\n}\n\n.newItemContainer {\n\twidth: calc(100% - var(--default-clickable-area));\n\tmargin: auto;\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_normalizeClass","_createBlock","_renderSlot","_openBlock","_createVNode"],"mappings":";;;;AAqFA,MAAK,YAAU;AAAA,EACd,MAAM;AAAA,EAEN,YAAY;AAAA,IACX;AAAA,IACA;AAAA;EAGD,OAAO;AAAA;AAAA;AAAA;AAAA,IAIN,MAAM;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA;;;;;IAOX,MAAM;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOV,SAAS;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMV,WAAW;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMV,iBAAiB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA;;EAIX,OAAO,CAAC,SAAS;AAAA,EAEjB,OAAO;AACN,WAAO;AAAA,MACN,cAAc;AAAA,MACd,eAAe;AAAA,IAChB;AAAA,EACD;AAAA,EAEA,SAAS;AAAA,IACR,gBAAgB;AACf,UAAI,CAAC,KAAK,SAAS;AAClB,aAAK,gBAAgB;AACrB,aAAK,UAAU,MAAM;AACpB,eAAK,MAAM,aAAa,WAAU;AAAA,QACnC,CAAC;AAAA,MACF;AAAA,IACD;AAAA,IAEA,gBAAgB;AACf,WAAK,gBAAgB;AAAA,IACtB;AAAA,IAEA,oBAAoB;AACnB,WAAK,MAAM,WAAW,KAAK,YAAY;AACvC,WAAK,eAAe;AACpB,WAAK,gBAAgB;AAAA,IACtB;AAAA;AAEF;;;;EAjG8B,OAAM;;;;;sBAnBnCA,mBA4BK,MAAA;AAAA,IA3BJ,uBAAM,wBAAsB;AAAA,6CACwB,MAAA;AAAA;;IAIpDC,mBAqBS,UAAA;AAAA,MArBD,OAAM;AAAA,MAA+B,gDAAO,SAAA,iBAAA,SAAA,cAAA,GAAA,IAAA;AAAA;MACnDA,mBAKO,QAAA;AAAA,QAJN,OAAKC,eAAA,CAAC,6BAA2B,EAAA,CACtB,OAAA,IAAI,IAAI,OAAA,SAAO,CAAA;AAAA;QACL,OAAA,wBAArBC,YAAgC,0BAAA,EAAA,KAAA,EAAA,CAAA,KAChCC,WAA2B,KAAA,QAAA,QAAA,CAAA,GAAA,QAAA,MAAA,CAAA;AAAA;OAGf,MAAA,8BAAbJ,mBAEO,QAAA;AAAA;QAFqB,OAAM;AAAA,QAAiC,OAAO,OAAA;AAAA,yBACtE,OAAA,IAAI,GAAA,GAAA,UAAA;MAII,MAAA,iBAAZK,aAAAL,mBAOO,QAPP,YAOO;AAAA,QANNM,YAKgC,iCAAA;AAAA,UAJ/B,KAAI;AAAA,sBACK,MAAA;AAAA,uEAAA,MAAA,eAAY;AAAA,UACpB,aAAa,OAAA,oBAAe,KAAU,OAAA,kBAAkB,OAAA;AAAA,UACxD,UAAQ,SAAA;AAAA,UACR,WAAS,SAAA;AAAA;;;;;;"}
|
|
@@ -3,9 +3,9 @@ import { defineComponent, useModel, useSlots, ref, useTemplateRef, watch, openBl
|
|
|
3
3
|
import { useFocusWithin } from "@vueuse/core";
|
|
4
4
|
import { I as IconClose } from "./Close.mjs";
|
|
5
5
|
import { N as NcInputField } from "./NcInputField.mjs";
|
|
6
|
-
import { r as register, C as
|
|
6
|
+
import { r as register, C as t46, v as t17, a as t } from "./_l10n.mjs";
|
|
7
7
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
|
|
8
|
-
register(t17,
|
|
8
|
+
register(t17, t46);
|
|
9
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
10
|
__name: "NcAppNavigationSearch",
|
|
11
11
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -4,11 +4,11 @@ import { x as mdiCog, y as mdiCogOutline } from "./mdi.mjs";
|
|
|
4
4
|
import { onClickOutside } from "@vueuse/core";
|
|
5
5
|
import { N as NcButton } from "./NcButton.mjs";
|
|
6
6
|
import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper.mjs";
|
|
7
|
-
import { r as register, B as
|
|
7
|
+
import { r as register, B as t49, a as t } from "./_l10n.mjs";
|
|
8
8
|
import { c as createElementId } from "./createElementId.mjs";
|
|
9
9
|
import { a as isLegacy } from "./legacy.mjs";
|
|
10
10
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
|
|
11
|
-
register(
|
|
11
|
+
register(t49);
|
|
12
12
|
const _hoisted_1 = ["id"];
|
|
13
13
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
14
|
__name: "NcAppNavigationSettings",
|
|
@@ -74,12 +74,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
-
const container = "
|
|
78
|
-
const header = "
|
|
79
|
-
const button = "
|
|
80
|
-
const content = "
|
|
81
|
-
const animationActive = "
|
|
82
|
-
const animationStop = "
|
|
77
|
+
const container = "_container_2uWBM";
|
|
78
|
+
const header = "_header_jtpAp";
|
|
79
|
+
const button = "_button_9llR-";
|
|
80
|
+
const content = "_content_CW2CF";
|
|
81
|
+
const animationActive = "_animationActive_Lz0UV";
|
|
82
|
+
const animationStop = "_animationStop_lwpSi";
|
|
83
83
|
const style0 = {
|
|
84
84
|
container,
|
|
85
85
|
header,
|
|
@@ -7,7 +7,7 @@ import { u as useLocalizedAppName, A as APP_VERSION } from "./appName.mjs";
|
|
|
7
7
|
import { A as APP_SETTINGS_LEGACY_DESIGN_KEY, a as APP_SETTINGS_REGISTRATION_KEY } from "./useAppSettingsDialog.mjs";
|
|
8
8
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
|
|
9
9
|
import { useIsMobile } from "../composables/useIsMobile/index.mjs";
|
|
10
|
-
import { r as register,
|
|
10
|
+
import { r as register, J as t50, a as t } from "./_l10n.mjs";
|
|
11
11
|
import { i as isLegacy34 } from "./legacy.mjs";
|
|
12
12
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
13
13
|
__name: "NcAppSettingsDialogVersion",
|
|
@@ -21,10 +21,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
const appSettingsDialogVersion = "
|
|
25
|
-
const appSettingsDialogVersion__legacy = "
|
|
24
|
+
const appSettingsDialogVersion = "_appSettingsDialogVersion_j2PVw";
|
|
25
|
+
const appSettingsDialogVersion__legacy = "_appSettingsDialogVersion__legacy_JGPJ9";
|
|
26
26
|
const style0 = {
|
|
27
|
-
"material-design-icon": "_material-design-
|
|
27
|
+
"material-design-icon": "_material-design-icon_aR3lm",
|
|
28
28
|
appSettingsDialogVersion,
|
|
29
29
|
appSettingsDialogVersion__legacy
|
|
30
30
|
};
|
|
@@ -32,7 +32,7 @@ const cssModules = {
|
|
|
32
32
|
"$style": style0
|
|
33
33
|
};
|
|
34
34
|
const NcAppSettingsDialogVersion = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules]]);
|
|
35
|
-
register(
|
|
35
|
+
register(t50);
|
|
36
36
|
const _hoisted_1 = {
|
|
37
37
|
key: 0,
|
|
38
38
|
class: "app-settings__title"
|