@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
103 lines (102 loc) • 2.75 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 { DialtoneLocalization as r } from "../../localization/index.js";
import i from "../general-row/general-row.js";
import { createBlock as a, createVNode as o, mergeProps as s, openBlock as c, resolveComponent as l, toHandlers as u, withCtx as d } from "vue";
import { DtIconUsers as f } from "@dialpad/dialtone-icons/vue3";
//#region recipes/leftbar/group_row/group_row.vue
var p = {
compatConfig: { MODE: 3 },
name: "DtRecipeGroupRow",
components: {
DtIconUsers: f,
DtRecipeGeneralRow: i
},
inheritAttrs: !1,
props: {
names: {
type: String,
required: !0
},
unreadCount: {
type: String,
default: null
},
unreadMentionCount: {
type: String,
default: null
},
hasUnreads: {
type: Boolean,
default: !1
},
selected: {
type: Boolean,
default: !1
},
isTyping: {
type: Boolean,
default: !1
}
},
data() {
return { i18n: new r() };
},
computed: {
groupCount() {
return this.names.split(",").length;
},
messageCount() {
return isNaN(this.unreadCount) ? this.unreadCount : Number(this.unreadCount);
},
mentionCount() {
return isNaN(this.unreadMentionCount) ? this.unreadMentionCount : Number(this.unreadMentionCount);
},
unreadCountTooltip() {
return t([this.unreadCount && this.i18n.$t("DIALTONE_UNREAD_MESSAGE_COUNT_TEXT", { unreadCount: this.messageCount }), this.unreadMentionCount && this.i18n.$t("DIALTONE_UNREAD_MENTION_COUNT_TEXT", { unreadCount: this.mentionCount })]);
},
typingTooltip() {
return this.isTyping && this.i18n.$t("DIALTONE_TYPING_TEXT");
},
ariaLabel() {
return t([
this.typingTooltip,
this.i18n.$t("DIALTONE_GROUP_ROW_GROUP_COUNT_TEXT", { count: this.groupCount }),
this.names,
this.unreadCountTooltip
]);
},
contactRowListeners() {
return e(this.$attrs);
}
}
};
function m(e, t, n, r, i, f) {
let p = l("dt-icon-users"), m = l("dt-recipe-general-row");
return c(), a(m, s({
description: n.names,
"aria-label": f.ariaLabel,
"unread-count": n.unreadCount,
"has-unreads": n.hasUnreads,
"unread-mention-count": n.unreadMentionCount,
"unread-count-tooltip": f.unreadCountTooltip,
selected: n.selected,
"is-typing": n.isTyping
}, e.$attrs, u(f.contactRowListeners)), {
left: d(() => [o(p, { size: "300" })]),
_: 1
}, 16, [
"description",
"aria-label",
"unread-count",
"has-unreads",
"unread-mention-count",
"unread-count-tooltip",
"selected",
"is-typing"
]);
}
var h = /* @__PURE__ */ n(p, [["render", m]]);
//#endregion
export { h as default };
//# sourceMappingURL=group-row.js.map