@nextcloud/vue
Version:
Nextcloud vue components
37 lines (36 loc) • 2.93 kB
JavaScript
import "../assets/index17.css";
import { N as o } from "../chunks/index-7aa3fc24.mjs";
import i from "./NcActions.mjs";
import s from "./NcActionButton.mjs";
import { n as l } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs";
const c = { name: "NcDashboardWidgetItem", components: { NcAvatar: o, NcActions: i, NcActionButton: s }, props: { id: { type: [String, Number], default: void 0 }, targetUrl: { type: String, default: void 0 }, avatarUrl: { type: String, default: void 0 }, avatarUsername: { type: String, default: void 0 }, avatarIsNoUser: { type: Boolean, default: !1 }, overlayIconUrl: { type: String, default: void 0 }, mainText: { type: String, required: !0 }, subText: { type: String, default: "" }, itemMenu: { type: Object, default: () => ({}) }, forceMenu: { type: Boolean, default: !0 } }, data() {
return { hovered: !1 };
}, computed: { item() {
return { id: this.id, targetUrl: this.targetUrl, avatarUrl: this.avatarUrl, avatarUsername: this.avatarUsername, overlayIconUrl: this.overlayIconUrl, mainText: this.mainText, subText: this.subText };
}, gotMenu() {
return Object.keys(this.itemMenu).length !== 0 || !!this.$slots.actions;
}, gotOverlayIcon() {
return this.overlayIconUrl && this.overlayIconUrl !== "";
} }, methods: { onLinkClick(t) {
t.target.closest(".action-item") && t.preventDefault();
} } };
var u = function() {
var t = this, e = t._self._c;
return e("div", { on: { mouseover: function(a) {
t.hovered = !0;
}, mouseleave: function(a) {
t.hovered = !1;
} } }, [e(t.targetUrl ? "a" : "div", { tag: "component", class: { "item-list__entry": !0, "item-list__entry--has-actions-menu": t.gotMenu }, attrs: { href: t.targetUrl, target: t.targetUrl ? "_blank" : void 0 }, on: { click: t.onLinkClick } }, [t._t("avatar", function() {
return [e("NcAvatar", { staticClass: "item-avatar", attrs: { size: 44, url: t.avatarUrl, user: t.avatarUsername, "is-no-user": t.avatarIsNoUser, "show-user-status": !t.gotOverlayIcon } })];
}, { avatarUrl: t.avatarUrl, avatarUsername: t.avatarUsername }), t.overlayIconUrl ? e("img", { staticClass: "item-icon", attrs: { alt: "", src: t.overlayIconUrl } }) : t._e(), e("div", { staticClass: "item__details" }, [e("h3", { attrs: { title: t.mainText } }, [t._v(" " + t._s(t.mainText) + " ")]), e("span", { staticClass: "message", attrs: { title: t.subText } }, [t._v(" " + t._s(t.subText) + " ")])]), t.gotMenu ? e("NcActions", { attrs: { "force-menu": t.forceMenu } }, [t._t("actions", function() {
return t._l(t.itemMenu, function(a, r) {
return e("NcActionButton", { key: r, attrs: { icon: a.icon, "close-after-click": !0 }, on: { click: function(n) {
return n.preventDefault(), n.stopPropagation(), t.$emit(r, t.item);
} } }, [t._v(" " + t._s(a.text) + " ")]);
});
})], 2) : t._e()], 2)], 1);
}, v = [], m = l(c, u, v, !1, null, "2ff3cd9a", null, null);
const y = m.exports;
export {
y as default
};