@nextcloud/vue
Version:
Nextcloud vue components
39 lines (38 loc) • 2.87 kB
JavaScript
import "../assets/index8.css";
import { N as i, u as e } from "../chunks/index-7aa3fc24.mjs";
import { N as n } from "../chunks/index-cd3f1f8f.mjs";
import r from "./NcIconSvgWrapper.mjs";
import "../chunks/IsMobileState-e1fe5f58.mjs";
import "@nextcloud/router";
/* empty css */import { n as o } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs";
import "linkify-string";
import "escape-html";
import "striptags";
import "vue";
const c = 8, s = 32, l = { name: "NcListItemIcon", components: { NcAvatar: i, NcHighlight: n, NcIconSvgWrapper: r }, mixins: [e], props: { name: { type: String, required: !0 }, subname: { type: String, default: "" }, icon: { type: String, default: "" }, iconSvg: { type: String, default: "" }, iconName: { type: String, default: "" }, search: { type: String, default: "" }, avatarSize: { type: Number, default: s }, noMargin: { type: Boolean, default: !1 }, displayName: { type: String, default: null }, isNoUser: { type: Boolean, default: !1 }, id: { type: String, default: null } }, data() {
return { margin: c };
}, computed: { hasIcon() {
return this.icon !== "";
}, hasIconSvg() {
return this.iconSvg !== "";
}, isValidSubname() {
var t, a;
return ((a = (t = this.subname) == null ? void 0 : t.trim) == null ? void 0 : a.call(t)) !== "";
}, isSizeBigEnough() {
return this.avatarSize >= s;
}, cssVars() {
const t = this.noMargin ? 0 : this.margin;
return { "--height": this.avatarSize + 2 * t + "px", "--margin": this.margin + "px" };
} }, beforeMount() {
!this.isNoUser && !this.subname && this.fetchUserStatus(this.user);
} };
var p = function() {
var t = this, a = t._self._c;
return a("span", t._g({ staticClass: "option", style: t.cssVars, attrs: { id: t.id } }, t.$listeners), [a("NcAvatar", t._b({ staticClass: "option__avatar", attrs: { "disable-menu": !0, "disable-tooltip": !0, "display-name": t.displayName || t.name, "is-no-user": t.isNoUser, size: t.avatarSize } }, "NcAvatar", t.$attrs, !1)), a("div", { staticClass: "option__details" }, [a("NcHighlight", { staticClass: "option__lineone", attrs: { text: t.name, search: t.search } }), t.isValidSubname && t.isSizeBigEnough ? a("NcHighlight", { staticClass: "option__linetwo", attrs: { text: t.subname, search: t.search } }) : t.hasStatus ? a("span", [a("span", [t._v(t._s(t.userStatus.icon))]), a("span", [t._v(t._s(t.userStatus.message))])]) : t._e()], 1), t._t("default", function() {
return [t.hasIconSvg ? a("NcIconSvgWrapper", { staticClass: "option__icon", attrs: { svg: t.iconSvg, name: t.iconName } }) : t.hasIcon ? a("span", { staticClass: "icon option__icon", class: t.icon, attrs: { "aria-label": t.iconName } }) : t._e()];
})], 2);
}, u = [], m = o(l, p, u, !1, null, "9b44a778", null, null);
const x = m.exports;
export {
x as default
};