@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
1 lines • 4.57 kB
Source Map (JSON)
{"version":3,"file":"group-row.cjs","names":[],"sources":["../../../recipes/leftbar/group_row/group_row.vue"],"sourcesContent":["<template>\n <dt-recipe-general-row\n :description=\"names\"\n :aria-label=\"ariaLabel\"\n :unread-count=\"unreadCount\"\n :has-unreads=\"hasUnreads\"\n :unread-mention-count=\"unreadMentionCount\"\n :unread-count-tooltip=\"unreadCountTooltip\"\n :selected=\"selected\"\n :is-typing=\"isTyping\"\n v-bind=\"$attrs\"\n v-on=\"contactRowListeners\"\n >\n <template #left>\n <dt-icon-users\n size=\"300\"\n />\n </template>\n </dt-recipe-general-row>\n</template>\n\n<script>\nimport { DtRecipeGeneralRow } from '@/recipes/leftbar/general_row';\nimport { DtIconUsers } from '@dialpad/dialtone-icons/vue3';\nimport { safeConcatStrings, extractVueListeners } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtRecipeGroupRow',\n\n components: {\n DtIconUsers,\n DtRecipeGeneralRow,\n },\n\n inheritAttrs: false,\n\n props: {\n\n /**\n * Names of the group members\n */\n names: {\n type: String,\n required: true,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: String,\n default: null,\n },\n\n /**\n * Number of unread mention messages\n */\n unreadMentionCount: {\n type: String,\n default: null,\n },\n\n /**\n * Styles the row with an increased font weight to convey it has unreads. This must be true to see\n * the unread count badge.\n */\n hasUnreads: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows an \"is typing\" animation over the avatar when true.\n */\n isTyping: {\n type: Boolean,\n default: false,\n },\n },\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n groupCount () {\n return this.names.split(',').length;\n },\n\n messageCount () {\n return isNaN(this.unreadCount)\n ? this.unreadCount\n : Number(this.unreadCount);\n },\n\n mentionCount () {\n return isNaN(this.unreadMentionCount)\n ? this.unreadMentionCount\n : Number(this.unreadMentionCount);\n },\n\n unreadCountTooltip () {\n return safeConcatStrings([\n this.unreadCount && this.i18n.$t('DIALTONE_UNREAD_MESSAGE_COUNT_TEXT', { unreadCount: this.messageCount }),\n this.unreadMentionCount && this.i18n.$t('DIALTONE_UNREAD_MENTION_COUNT_TEXT', { unreadCount: this.mentionCount }),\n ]);\n },\n\n typingTooltip () {\n return this.isTyping && this.i18n.$t('DIALTONE_TYPING_TEXT');\n },\n\n ariaLabel () {\n return safeConcatStrings([\n this.typingTooltip,\n this.i18n.$t('DIALTONE_GROUP_ROW_GROUP_COUNT_TEXT', { count: this.groupCount }),\n this.names,\n this.unreadCountTooltip,\n ]);\n },\n\n contactRowListeners () {\n return extractVueListeners(this.$attrs);\n },\n },\n};\n</script>\n"],"mappings":"wVA2BA,IAAK,EAAU,CACb,aAAc,CAAE,KAAM,EAAG,CACzB,KAAM,mBAEN,WAAY,CACV,oDAAA,YACA,mBAAA,EAAA,QACD,CAED,aAAc,GAEd,MAAO,CAKL,MAAO,CACL,KAAM,OACN,SAAU,GACX,CAKD,YAAa,CACX,KAAM,OACN,QAAS,KACV,CAKD,mBAAoB,CAClB,KAAM,OACN,QAAS,KACV,CAMD,WAAY,CACV,KAAM,QACN,QAAS,GACV,CAKD,SAAU,CACR,KAAM,QACN,QAAS,GACV,CAKD,SAAU,CACR,KAAM,QACN,QAAS,GACV,CACF,CAED,MAAQ,CACN,MAAO,CACL,KAAM,IAAI,EAAA,qBACX,EAGH,SAAU,CACR,YAAc,CACZ,OAAO,KAAK,MAAM,MAAM,IAAI,CAAC,QAG/B,cAAgB,CACd,OAAO,MAAM,KAAK,YAAW,CACzB,KAAK,YACL,OAAO,KAAK,YAAY,EAG9B,cAAgB,CACd,OAAO,MAAM,KAAK,mBAAkB,CAChC,KAAK,mBACL,OAAO,KAAK,mBAAmB,EAGrC,oBAAsB,CACpB,OAAO,EAAA,kBAAkB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