@nextcloud/vue
Version:
Nextcloud vue components
41 lines (40 loc) • 2.96 kB
JavaScript
import "../assets/index49.css";
import n from "./NcActions.mjs";
import { G as a } from "../chunks/GenRandomId-1e1b509a.mjs";
import o from "vue-material-design-icons/ChevronRight.vue";
import { n as i } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs";
const s = { name: "NcBreadcrumb", components: { NcActions: n, ChevronRight: o }, props: { name: { type: String, required: !0 }, title: { type: String, default: null }, to: { type: [String, Object], default: void 0 }, exact: { type: Boolean, default: !1 }, href: { type: String, default: void 0 }, icon: { type: String, default: "" }, disableDrop: { type: Boolean, default: !1 }, forceMenu: { type: Boolean, default: !1 }, open: { type: Boolean, default: !1 } }, emits: ["update:open", "dropped"], data() {
return { hovering: !1, crumbId: `crumb-id-${a()}` };
}, computed: { tag() {
return this.to ? "router-link" : "a";
}, linkAttributes() {
return this.to ? { to: this.to, exact: this.exact, ...this.$attrs } : { href: this.href, ...this.$attrs };
} }, methods: { onOpenChange(t) {
this.$emit("update:open", t);
}, dropped(t) {
return this.disableDrop || (this.$emit("dropped", t, this.to || this.href), this.$parent.$emit("dropped", t, this.to || this.href), this.hovering = !1), !1;
}, dragEnter(t) {
this.disableDrop || (this.hovering = !0);
}, dragLeave(t) {
this.disableDrop || t.target.contains(t.relatedTarget) || this.$refs.crumb.contains(t.relatedTarget) || (this.hovering = !1);
} } };
var u = function() {
var t = this, e = t._self._c;
return e("li", t._b({ ref: "crumb", staticClass: "vue-crumb", class: { "vue-crumb--hovered": t.hovering }, attrs: { draggable: "false" }, on: { dragstart: function(r) {
return r.preventDefault(), (() => {
}).apply(null, arguments);
}, drop: function(r) {
return r.preventDefault(), t.dropped.apply(null, arguments);
}, dragover: function(r) {
return r.preventDefault(), (() => {
}).apply(null, arguments);
}, dragenter: t.dragEnter, dragleave: t.dragLeave } }, "li", t._d({}, [t.crumbId, ""])), [(t.name || t.icon) && !t.$slots.default ? e(t.tag, t._g(t._b({ tag: "component", attrs: { title: t.title } }, "component", t.linkAttributes, !1), t.$listeners), [t._t("icon", function() {
return [t.icon ? e("span", { staticClass: "icon", class: t.icon }) : e("span", [t._v(t._s(t.name))])];
})], 2) : t._e(), t.$slots.default ? e("NcActions", { ref: "actions", attrs: { type: "tertiary", "force-menu": t.forceMenu, open: t.open, "menu-name": t.name, title: t.title, "force-name": !0, container: `.vue-crumb[${t.crumbId}]` }, on: { "update:open": t.onOpenChange }, scopedSlots: t._u([{ key: "icon", fn: function() {
return [t._t("menu-icon")];
}, proxy: !0 }], null, !0) }, [t._t("default")], 2) : t._e(), e("ChevronRight", { staticClass: "vue-crumb__separator", attrs: { size: 20 } })], 1);
}, l = [], p = i(s, u, l, !1, null, "2e235682", null, null);
const g = p.exports;
export {
g as default
};