@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
164 lines (163 loc) • 3.98 kB
JavaScript
import { extractVueListeners as e, safeConcatStrings as t } from "../../common/utils/index.js";
import { t as n } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
import r from "../avatar/avatar.js";
import i from "../emoji-text-wrapper/emoji-text-wrapper.js";
import a from "../general-row/general-row.js";
import { createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, mergeProps as p, normalizeClass as m, openBlock as h, resolveComponent as g, toDisplayString as _, toHandlers as v, withCtx as y } from "vue";
import { DtIconUser as b } from "@dialpad/dialtone-icons/vue3";
//#region recipes/leftbar/contact_row/contact_row.vue
var x = {
compatConfig: { MODE: 3 },
name: "DtRecipeContactRow",
components: {
DtAvatar: r,
DtRecipeGeneralRow: a,
DtEmojiTextWrapper: i,
DtIconUser: b
},
inheritAttrs: !1,
props: {
avatarSrc: {
type: String,
default: ""
},
avatarPresence: {
type: String,
default: null
},
avatarSeed: {
type: String,
default: null
},
avatarColor: {
type: String,
default: null
},
presenceText: {
type: String,
default: ""
},
name: {
type: String,
required: !0
},
userStatus: {
type: String,
default: ""
},
muted: {
type: Boolean,
default: !1
},
unreadCount: {
type: String,
default: null
},
hasUnreads: {
type: Boolean,
default: !1
},
selected: {
type: Boolean,
default: !1
},
noInitials: {
type: Boolean,
default: !1
},
isTyping: {
type: Boolean,
default: !1
},
hasCallButton: {
type: Boolean,
default: !0
}
},
emits: ["call"],
computed: {
presenceFontColorClass() {
return {
active: "d-recipe-contact-row--active",
busy: "d-recipe-contact-row--busy",
away: "d-recipe-contact-row--away"
}[this.avatarPresence];
},
contactRowListeners() {
return e(this.$attrs);
},
contactDescription() {
return t([
this.name,
this.presenceText,
this.userStatus
]);
}
}
}, S = { class: "d-recipe-leftbar-row__status" };
function C(e, t, n, r, i, a) {
let b = g("dt-icon-user"), x = g("dt-avatar"), C = g("dt-emoji-text-wrapper"), w = g("dt-recipe-general-row");
return h(), o(w, p({
"unread-count": n.unreadCount,
description: a.contactDescription,
"has-unreads": n.hasUnreads,
selected: n.selected,
"has-call-button": n.hasCallButton,
muted: n.muted,
"is-typing": n.isTyping
}, e.$attrs, { "data-qa": "contact-row" }, v(a.contactRowListeners), { onCall: t[0] || (t[0] = (t) => e.$emit("call", t)) }), {
left: y(() => [f(x, {
"full-name": n.name,
"image-src": n.avatarSrc,
color: n.avatarColor,
"image-alt": "",
size: "sm",
seed: n.avatarSeed,
presence: n.avatarPresence
}, u({ _: 2 }, [n.noInitials ? {
name: "icon",
fn: y(() => [f(b, { size: "200" })]),
key: "0"
} : void 0]), 1032, [
"full-name",
"image-src",
"color",
"seed",
"presence"
])]),
label: y(() => [f(C, {
class: "d-recipe-leftbar-row__description",
"data-qa": "dt-recipe-leftbar-row-description",
size: "200"
}, {
default: y(() => [d(_(n.name), 1)]),
_: 1
}), l("div", S, [n.presenceText ? (h(), c("span", {
key: 0,
"data-qa": "dt-recipe-leftbar-row-presence-text",
class: m(["d-recipe-leftbar-row__meta-context", a.presenceFontColorClass])
}, _(n.presenceText), 3)) : s("", !0), n.userStatus ? (h(), o(C, {
key: 1,
size: "100",
"element-type": "span",
"data-qa": "dt-recipe-leftbar-row-user-status",
class: "d-recipe-leftbar-row__meta-custom"
}, {
default: y(() => [d(_(n.userStatus), 1)]),
_: 1
})) : s("", !0)])]),
_: 1
}, 16, [
"unread-count",
"description",
"has-unreads",
"selected",
"has-call-button",
"muted",
"is-typing"
]);
}
var w = /* @__PURE__ */ n(x, [["render", C]]);
//#endregion
export { w as default };
//# sourceMappingURL=contact-row.js.map