@dialpad/dialtone-vue 3.30.1 → 3.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dialtone-vue.umd.js
CHANGED
|
@@ -33,6 +33,30 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".enter-active,.leave-active{overflow:h
|
|
|
33
33
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
34
34
|
|
|
35
35
|
|
|
36
|
+
/***/ }),
|
|
37
|
+
|
|
38
|
+
/***/ 901:
|
|
39
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
40
|
+
|
|
41
|
+
"use strict";
|
|
42
|
+
__webpack_require__.r(__webpack_exports__);
|
|
43
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
44
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
45
|
+
/* harmony export */ });
|
|
46
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81);
|
|
47
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
48
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645);
|
|
49
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
50
|
+
// Imports
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
54
|
+
// Module
|
|
55
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".d-avatar--image-loaded{background-color:initial;background-image:unset}", ""]);
|
|
56
|
+
// Exports
|
|
57
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
58
|
+
|
|
59
|
+
|
|
36
60
|
/***/ }),
|
|
37
61
|
|
|
38
62
|
/***/ 6:
|
|
@@ -552,6 +576,22 @@ var update = add("d75292b8", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
552
576
|
|
|
553
577
|
/***/ }),
|
|
554
578
|
|
|
579
|
+
/***/ 156:
|
|
580
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
581
|
+
|
|
582
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
583
|
+
|
|
584
|
+
// load the styles
|
|
585
|
+
var content = __webpack_require__(901);
|
|
586
|
+
if(content.__esModule) content = content.default;
|
|
587
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
588
|
+
if(content.locals) module.exports = content.locals;
|
|
589
|
+
// add the styles to the DOM
|
|
590
|
+
var add = (__webpack_require__(402)/* ["default"] */ .Z)
|
|
591
|
+
var update = add("49001dd1", content, true, {"sourceMap":false,"shadowMode":false});
|
|
592
|
+
|
|
593
|
+
/***/ }),
|
|
594
|
+
|
|
555
595
|
/***/ 840:
|
|
556
596
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
557
597
|
|
|
@@ -1140,7 +1180,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1140
1180
|
|
|
1141
1181
|
// EXPORTS
|
|
1142
1182
|
__webpack_require__.d(__webpack_exports__, {
|
|
1143
|
-
"AVATAR_COLOR_MODIFIERS": () => (/* reexport */ AVATAR_COLOR_MODIFIERS),
|
|
1144
1183
|
"AVATAR_KIND_MODIFIERS": () => (/* reexport */ AVATAR_KIND_MODIFIERS),
|
|
1145
1184
|
"AVATAR_SIZE_MODIFIERS": () => (/* reexport */ AVATAR_SIZE_MODIFIERS),
|
|
1146
1185
|
"BADGE_KIND_MODIFIERS": () => (/* reexport */ BADGE_KIND_MODIFIERS),
|
|
@@ -1282,25 +1321,31 @@ if (typeof window !== 'undefined') {
|
|
|
1282
1321
|
|
|
1283
1322
|
;// CONCATENATED MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
1284
1323
|
const external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject = require("vue");
|
|
1285
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/avatar/avatar.vue?vue&type=template&id=
|
|
1324
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/avatar/avatar.vue?vue&type=template&id=52a431d8
|
|
1286
1325
|
|
|
1287
1326
|
const _hoisted_1 = ["id"];
|
|
1327
|
+
const _hoisted_2 = {
|
|
1328
|
+
key: 1
|
|
1329
|
+
};
|
|
1288
1330
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1289
1331
|
const _component_dt_presence = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("dt-presence");
|
|
1290
1332
|
|
|
1291
1333
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementBlock)("div", {
|
|
1292
1334
|
id: $props.id,
|
|
1293
|
-
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.normalizeClass)(['d-avatar', $data.AVATAR_KIND_MODIFIERS[$data.kind], $data.AVATAR_SIZE_MODIFIERS[$props.size], $
|
|
1335
|
+
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.normalizeClass)(['d-avatar', $data.AVATAR_KIND_MODIFIERS[$data.kind], $data.AVATAR_SIZE_MODIFIERS[$props.size], $props.avatarClass]),
|
|
1336
|
+
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.normalizeStyle)($options.initialKindStyle),
|
|
1294
1337
|
"data-qa": "dt-avatar"
|
|
1295
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderSlot)(_ctx.$slots, "default"
|
|
1296
|
-
key: 0
|
|
1338
|
+
}, [$options.showDefaultSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderSlot)(_ctx.$slots, "default", {
|
|
1339
|
+
key: 0
|
|
1340
|
+
}) : $options.showInitials ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementBlock)("span", _hoisted_2, (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.toDisplayString)($data.formattedInitials), 1)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true), $props.presence ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_dt_presence, (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.mergeProps)({
|
|
1341
|
+
key: 2,
|
|
1297
1342
|
presence: $props.presence,
|
|
1298
1343
|
class: ['d-avatar__presence', $data.AVATAR_PRESENCE_SIZE_MODIFIERS[$props.size]]
|
|
1299
1344
|
}, $props.presenceProps, {
|
|
1300
1345
|
"data-qa": "dt-presence"
|
|
1301
|
-
}), null, 16, ["presence", "class"])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true)],
|
|
1346
|
+
}), null, 16, ["presence", "class"])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true)], 14, _hoisted_1);
|
|
1302
1347
|
}
|
|
1303
|
-
;// CONCATENATED MODULE: ./components/avatar/avatar.vue?vue&type=template&id=
|
|
1348
|
+
;// CONCATENATED MODULE: ./components/avatar/avatar.vue?vue&type=template&id=52a431d8
|
|
1304
1349
|
|
|
1305
1350
|
;// CONCATENATED MODULE: ./common/constants.js
|
|
1306
1351
|
/* TODO: Move and sort these in a constants directory
|
|
@@ -1387,6 +1432,15 @@ function getUniqueString() {
|
|
|
1387
1432
|
let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_PREFIX;
|
|
1388
1433
|
return `${prefix}${UNIQUE_ID_COUNTER++}`;
|
|
1389
1434
|
}
|
|
1435
|
+
/**
|
|
1436
|
+
* Returns a random element from array
|
|
1437
|
+
* @param array
|
|
1438
|
+
* @returns {*}
|
|
1439
|
+
*/
|
|
1440
|
+
|
|
1441
|
+
function getRandomElement(array) {
|
|
1442
|
+
return array[Math.floor(Math.random() * array.length)];
|
|
1443
|
+
}
|
|
1390
1444
|
function formatMessages(messages) {
|
|
1391
1445
|
if (!messages) {
|
|
1392
1446
|
return [];
|
|
@@ -1482,6 +1536,7 @@ const pascalCaseToKebabCase = string => {
|
|
|
1482
1536
|
};
|
|
1483
1537
|
/* harmony default export */ const utils = ({
|
|
1484
1538
|
getUniqueString,
|
|
1539
|
+
getRandomElement,
|
|
1485
1540
|
formatMessages,
|
|
1486
1541
|
filterFormattedMessages,
|
|
1487
1542
|
hasFormattedMessageOfType,
|
|
@@ -1493,7 +1548,7 @@ const pascalCaseToKebabCase = string => {
|
|
|
1493
1548
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/presence/presence.vue?vue&type=template&id=85037b42
|
|
1494
1549
|
|
|
1495
1550
|
const presencevue_type_template_id_85037b42_hoisted_1 = ["aria-live"];
|
|
1496
|
-
const
|
|
1551
|
+
const presencevue_type_template_id_85037b42_hoisted_2 = {
|
|
1497
1552
|
key: 0,
|
|
1498
1553
|
"data-qa": "dt-presence-sr-text",
|
|
1499
1554
|
class: "sr-only"
|
|
@@ -1504,7 +1559,7 @@ function presencevue_type_template_id_85037b42_render(_ctx, _cache, $props, $set
|
|
|
1504
1559
|
"data-qa": "dt-presence",
|
|
1505
1560
|
role: "status",
|
|
1506
1561
|
"aria-live": _ctx.$attrs.ariaLive || 'off'
|
|
1507
|
-
}, [$props.srText ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementBlock)("span",
|
|
1562
|
+
}, [$props.srText ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementBlock)("span", presencevue_type_template_id_85037b42_hoisted_2, (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.toDisplayString)($props.srText), 1)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div", {
|
|
1508
1563
|
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.normalizeClass)(["d-presence__inner", {
|
|
1509
1564
|
'd-presence__inner--active': $props.presence === 'active',
|
|
1510
1565
|
'd-presence__inner--away': $props.presence === 'away',
|
|
@@ -1579,43 +1634,35 @@ const AVATAR_KIND_MODIFIERS = {
|
|
|
1579
1634
|
initials: 'd-avatar--initials'
|
|
1580
1635
|
};
|
|
1581
1636
|
const AVATAR_SIZE_MODIFIERS = {
|
|
1637
|
+
xs: 'd-avatar--xs',
|
|
1582
1638
|
sm: 'd-avatar--sm',
|
|
1583
1639
|
md: 'd-avatar--md',
|
|
1584
|
-
lg: 'd-avatar--lg'
|
|
1640
|
+
lg: 'd-avatar--lg',
|
|
1641
|
+
xl: 'd-avatar--xl'
|
|
1585
1642
|
};
|
|
1586
1643
|
const AVATAR_PRESENCE_SIZE_MODIFIERS = {
|
|
1587
1644
|
md: 'd-avatar__presence--md',
|
|
1588
1645
|
lg: 'd-avatar__presence--lg'
|
|
1589
1646
|
};
|
|
1590
|
-
const AVATAR_COLOR_MODIFIERS = {
|
|
1591
|
-
base: '',
|
|
1592
|
-
'orange-200': 'd-avatar--orange-200',
|
|
1593
|
-
'orange-300': 'd-avatar--orange-300',
|
|
1594
|
-
'orange-400': 'd-avatar--orange-400',
|
|
1595
|
-
'orange-500': 'd-avatar--orange-500',
|
|
1596
|
-
'magenta-100': 'd-avatar--magenta-100',
|
|
1597
|
-
'magenta-200': 'd-avatar--magenta-200',
|
|
1598
|
-
'magenta-300': 'd-avatar--magenta-300',
|
|
1599
|
-
'magenta-400': 'd-avatar--magenta-400',
|
|
1600
|
-
'purple-200': 'd-avatar--purple-200',
|
|
1601
|
-
'purple-300': 'd-avatar--purple-300',
|
|
1602
|
-
'purple-400': 'd-avatar--purple-400',
|
|
1603
|
-
'purple-500': 'd-avatar--purple-500',
|
|
1604
|
-
'gold-100': 'd-avatar--gold-100',
|
|
1605
|
-
'gold-200': 'd-avatar--gold-200',
|
|
1606
|
-
'gold-300': 'd-avatar--gold-300',
|
|
1607
|
-
'gold-500': 'd-avatar--gold-500'
|
|
1608
|
-
};
|
|
1609
1647
|
const AVATAR_ICON_SIZES = {
|
|
1648
|
+
xs: '100',
|
|
1610
1649
|
sm: '200',
|
|
1611
1650
|
md: '400',
|
|
1612
|
-
lg: '500'
|
|
1651
|
+
lg: '500',
|
|
1652
|
+
xl: '600'
|
|
1653
|
+
};
|
|
1654
|
+
const AVATAR_ANGLES = [45, -45, 90, -90, 135, -135, 180, -180];
|
|
1655
|
+
const GRADIENT_COLORS = {
|
|
1656
|
+
with100: ['purple-100', 'magenta-100', 'gold-100', 'blue-100'],
|
|
1657
|
+
with200: ['purple-200', 'magenta-200', 'gold-200', 'blue-200']
|
|
1613
1658
|
};
|
|
1659
|
+
const MAX_GRADIENT_COLORS = 3;
|
|
1660
|
+
const MAX_GRADIENT_COLORS_100 = 2;
|
|
1614
1661
|
/* harmony default export */ const avatar_constants = ({
|
|
1615
1662
|
AVATAR_KIND_MODIFIERS,
|
|
1616
1663
|
AVATAR_SIZE_MODIFIERS,
|
|
1617
|
-
|
|
1618
|
-
|
|
1664
|
+
AVATAR_ICON_SIZES,
|
|
1665
|
+
AVATAR_ANGLES
|
|
1619
1666
|
});
|
|
1620
1667
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/avatar/avatar.vue?vue&type=script&lang=js
|
|
1621
1668
|
|
|
@@ -1648,7 +1695,7 @@ const AVATAR_ICON_SIZES = {
|
|
|
1648
1695
|
|
|
1649
1696
|
/**
|
|
1650
1697
|
* The size of the avatar
|
|
1651
|
-
* @values sm, md, lg
|
|
1698
|
+
* @values xs, sm, md, lg, xl
|
|
1652
1699
|
*/
|
|
1653
1700
|
size: {
|
|
1654
1701
|
type: String,
|
|
@@ -1656,20 +1703,6 @@ const AVATAR_ICON_SIZES = {
|
|
|
1656
1703
|
validator: size => Object.keys(AVATAR_SIZE_MODIFIERS).includes(size)
|
|
1657
1704
|
},
|
|
1658
1705
|
|
|
1659
|
-
/**
|
|
1660
|
-
* The color of the avatar
|
|
1661
|
-
* @values base
|
|
1662
|
-
* orange-200, orange-300, orange-400, orange-500,
|
|
1663
|
-
* pink-300, pink-400, pink-500, pink-600,
|
|
1664
|
-
* purple-200, purple-300, purple-500, purple-600,
|
|
1665
|
-
* yellow-200, yellow-300, yellow-400, yellow-500
|
|
1666
|
-
*/
|
|
1667
|
-
color: {
|
|
1668
|
-
type: String,
|
|
1669
|
-
default: 'base',
|
|
1670
|
-
validator: color => Object.keys(AVATAR_COLOR_MODIFIERS).includes(color)
|
|
1671
|
-
},
|
|
1672
|
-
|
|
1673
1706
|
/**
|
|
1674
1707
|
* Used to customize the avatar container
|
|
1675
1708
|
*/
|
|
@@ -1694,40 +1727,98 @@ const AVATAR_ICON_SIZES = {
|
|
|
1694
1727
|
presenceProps: {
|
|
1695
1728
|
type: Object,
|
|
1696
1729
|
default: () => ({})
|
|
1730
|
+
},
|
|
1731
|
+
|
|
1732
|
+
/**
|
|
1733
|
+
* Initials to be shown in the avatar. Used as fallback if image fails to load.
|
|
1734
|
+
*/
|
|
1735
|
+
initials: {
|
|
1736
|
+
type: String,
|
|
1737
|
+
default: ''
|
|
1697
1738
|
}
|
|
1698
1739
|
},
|
|
1699
1740
|
|
|
1700
1741
|
data() {
|
|
1701
1742
|
return {
|
|
1702
1743
|
// initials, image or icon
|
|
1703
|
-
kind: '
|
|
1744
|
+
kind: 'image',
|
|
1704
1745
|
AVATAR_SIZE_MODIFIERS: AVATAR_SIZE_MODIFIERS,
|
|
1705
|
-
AVATAR_COLOR_MODIFIERS: AVATAR_COLOR_MODIFIERS,
|
|
1706
1746
|
AVATAR_KIND_MODIFIERS: AVATAR_KIND_MODIFIERS,
|
|
1707
|
-
AVATAR_PRESENCE_SIZE_MODIFIERS: AVATAR_PRESENCE_SIZE_MODIFIERS
|
|
1747
|
+
AVATAR_PRESENCE_SIZE_MODIFIERS: AVATAR_PRESENCE_SIZE_MODIFIERS,
|
|
1748
|
+
imageLoadedSuccessfully: null,
|
|
1749
|
+
slottedInitials: '',
|
|
1750
|
+
formattedInitials: ''
|
|
1708
1751
|
};
|
|
1709
1752
|
},
|
|
1710
1753
|
|
|
1754
|
+
computed: {
|
|
1755
|
+
showDefaultSlot() {
|
|
1756
|
+
return this.kind !== 'initials' && this.imageLoadedSuccessfully !== false;
|
|
1757
|
+
},
|
|
1758
|
+
|
|
1759
|
+
showInitials() {
|
|
1760
|
+
return this.kind === 'initials' || this.initials;
|
|
1761
|
+
},
|
|
1762
|
+
|
|
1763
|
+
initialKindStyle() {
|
|
1764
|
+
const randomGradientColorStops = this.randomizeGradientColorStops();
|
|
1765
|
+
return {
|
|
1766
|
+
'--avatar-gradient-angle': `${this.randomizeGradientAngle()}deg`,
|
|
1767
|
+
'--avatar-gradient-stop-1': `var(--${randomGradientColorStops[0]})`,
|
|
1768
|
+
'--avatar-gradient-stop-2': `var(--${randomGradientColorStops[1]})`,
|
|
1769
|
+
'--avatar-gradient-stop-3': `var(--${randomGradientColorStops[2]})`
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
},
|
|
1774
|
+
|
|
1711
1775
|
mounted() {
|
|
1712
1776
|
this.init();
|
|
1713
1777
|
},
|
|
1714
1778
|
|
|
1715
1779
|
updated() {
|
|
1716
|
-
this.
|
|
1780
|
+
if (this.kind === 'initials') {
|
|
1781
|
+
this.slottedInitials = this.$el.children[0].textContent;
|
|
1782
|
+
this.formatInitials(this.slottedInitials);
|
|
1783
|
+
}
|
|
1717
1784
|
},
|
|
1718
1785
|
|
|
1719
1786
|
methods: {
|
|
1720
1787
|
init() {
|
|
1721
|
-
const firstChild = this.$el.children[0];
|
|
1788
|
+
const firstChild = this.$el.children[0] || this.$el;
|
|
1722
1789
|
|
|
1723
1790
|
if (firstChild) {
|
|
1724
1791
|
this.setKind(firstChild);
|
|
1725
1792
|
|
|
1726
1793
|
if (this.kind === 'image') {
|
|
1727
1794
|
firstChild.classList.add('d-avatar__image');
|
|
1795
|
+
this.validateImageAttrsPresence();
|
|
1796
|
+
firstChild.addEventListener('error', () => {
|
|
1797
|
+
this.formatInitials(this.initials);
|
|
1798
|
+
this.imageLoadedSuccessfully = false;
|
|
1799
|
+
});
|
|
1800
|
+
firstChild.addEventListener('load', () => {
|
|
1801
|
+
firstChild.classList.add('d-avatar--image-loaded');
|
|
1802
|
+
this.imageLoadedSuccessfully = true;
|
|
1803
|
+
});
|
|
1728
1804
|
}
|
|
1729
1805
|
|
|
1730
|
-
this.
|
|
1806
|
+
if (this.kind === 'initials') {
|
|
1807
|
+
this.slottedInitials = firstChild.textContent;
|
|
1808
|
+
this.formatInitials(this.slottedInitials);
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
|
|
1813
|
+
formatInitials(initials) {
|
|
1814
|
+
if (!initials) return;
|
|
1815
|
+
|
|
1816
|
+
if (this.size === 'xs') {
|
|
1817
|
+
this.formattedInitials = '';
|
|
1818
|
+
} else if (this.size === 'sm') {
|
|
1819
|
+
this.formattedInitials = initials.trim()[0];
|
|
1820
|
+
} else {
|
|
1821
|
+
this.formattedInitials = initials.trim().slice(0, 2);
|
|
1731
1822
|
}
|
|
1732
1823
|
},
|
|
1733
1824
|
|
|
@@ -1757,25 +1848,50 @@ const AVATAR_ICON_SIZES = {
|
|
|
1757
1848
|
return (element === null || element === void 0 ? void 0 : (_element$tagName2 = element.tagName) === null || _element$tagName2 === void 0 ? void 0 : _element$tagName2.toUpperCase()) === 'IMG';
|
|
1758
1849
|
},
|
|
1759
1850
|
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1851
|
+
randomizeGradientAngle() {
|
|
1852
|
+
return getRandomElement(AVATAR_ANGLES);
|
|
1853
|
+
},
|
|
1854
|
+
|
|
1855
|
+
randomizeGradientColorStops() {
|
|
1856
|
+
const colors = new Set(); // get 3 unique colors, 2 from colorsWith100 and one from colorsWith200
|
|
1857
|
+
|
|
1858
|
+
while (colors.size < MAX_GRADIENT_COLORS) {
|
|
1859
|
+
if (colors.size === MAX_GRADIENT_COLORS_100) {
|
|
1860
|
+
colors.add(getRandomElement(GRADIENT_COLORS.with200));
|
|
1861
|
+
} else {
|
|
1862
|
+
colors.add(getRandomElement(GRADIENT_COLORS.with100));
|
|
1765
1863
|
}
|
|
1766
1864
|
}
|
|
1865
|
+
|
|
1866
|
+
const shuffledColors = Array.from(colors).sort(() => 0.5 - Math.random());
|
|
1867
|
+
return shuffledColors;
|
|
1868
|
+
},
|
|
1869
|
+
|
|
1870
|
+
validateImageAttrsPresence() {
|
|
1871
|
+
const isSrcMissing = !this.$el.children[0].getAttribute('src');
|
|
1872
|
+
const isAltMissing = !this.$el.children[0].getAttribute('alt');
|
|
1873
|
+
|
|
1874
|
+
if (isSrcMissing || isAltMissing) {
|
|
1875
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.warn)('src and alt attributes are required for image avatars', this);
|
|
1876
|
+
}
|
|
1767
1877
|
}
|
|
1768
1878
|
|
|
1769
1879
|
}
|
|
1770
1880
|
});
|
|
1771
1881
|
;// CONCATENATED MODULE: ./components/avatar/avatar.vue?vue&type=script&lang=js
|
|
1772
1882
|
|
|
1883
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-74.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-74.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-74.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-74.use[3]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-74.use[4]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/avatar/avatar.vue?vue&type=style&index=0&id=52a431d8&lang=less
|
|
1884
|
+
var avatarvue_type_style_index_0_id_52a431d8_lang_less = __webpack_require__(156);
|
|
1885
|
+
;// CONCATENATED MODULE: ./components/avatar/avatar.vue?vue&type=style&index=0&id=52a431d8&lang=less
|
|
1886
|
+
|
|
1773
1887
|
;// CONCATENATED MODULE: ./components/avatar/avatar.vue
|
|
1774
1888
|
|
|
1775
1889
|
|
|
1776
1890
|
|
|
1777
1891
|
|
|
1778
1892
|
;
|
|
1893
|
+
|
|
1894
|
+
|
|
1779
1895
|
const avatar_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(avatarvue_type_script_lang_js, [['render',render]])
|
|
1780
1896
|
|
|
1781
1897
|
/* harmony default export */ const avatar = (avatar_exports_);
|
|
@@ -19419,26 +19535,26 @@ const callbar_button_with_popover_exports_ = /*#__PURE__*/(0,exportHelper/* defa
|
|
|
19419
19535
|
/* harmony default export */ const callbar_button_with_popover = (callbar_button_with_popover_exports_);
|
|
19420
19536
|
;// CONCATENATED MODULE: ./recipes/buttons/callbar_button_with_popover/index.js
|
|
19421
19537
|
|
|
19422
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./recipes/list_items/contact_info/contact_info.vue?vue&type=template&id=
|
|
19538
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./recipes/list_items/contact_info/contact_info.vue?vue&type=template&id=9fe40f88
|
|
19423
19539
|
|
|
19424
|
-
const
|
|
19540
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_1 = {
|
|
19425
19541
|
class: "d-ps-relative",
|
|
19426
19542
|
"data-qa": "contact-info-left"
|
|
19427
19543
|
};
|
|
19428
|
-
const
|
|
19429
|
-
const
|
|
19544
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_2 = ["src", "alt"];
|
|
19545
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_3 = {
|
|
19430
19546
|
"data-qa": "contact-info-header"
|
|
19431
19547
|
};
|
|
19432
|
-
const
|
|
19548
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_4 = {
|
|
19433
19549
|
"data-qa": "contact-info-subtitle"
|
|
19434
19550
|
};
|
|
19435
|
-
const
|
|
19551
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_5 = {
|
|
19436
19552
|
"data-qa": "contact-info-bottom"
|
|
19437
19553
|
};
|
|
19438
|
-
const
|
|
19554
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_6 = {
|
|
19439
19555
|
"data-qa": "contact-info-right"
|
|
19440
19556
|
};
|
|
19441
|
-
function
|
|
19557
|
+
function contact_infovue_type_template_id_9fe40f88_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19442
19558
|
const _component_dt_avatar = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("dt-avatar");
|
|
19443
19559
|
|
|
19444
19560
|
const _component_dt_list_item = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("dt-list-item");
|
|
@@ -19449,7 +19565,7 @@ function contact_infovue_type_template_id_c1f377a8_render(_ctx, _cache, $props,
|
|
|
19449
19565
|
"element-type": "div",
|
|
19450
19566
|
"data-qa": "contact-info"
|
|
19451
19567
|
}, {
|
|
19452
|
-
left: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19568
|
+
left: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div", contact_infovue_type_template_id_9fe40f88_hoisted_1, [$props.avatarSrc ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_dt_avatar, {
|
|
19453
19569
|
key: 0,
|
|
19454
19570
|
size: "lg"
|
|
19455
19571
|
}, {
|
|
@@ -19457,29 +19573,27 @@ function contact_infovue_type_template_id_c1f377a8_render(_ctx, _cache, $props,
|
|
|
19457
19573
|
"data-qa": "dt-contact-avatar",
|
|
19458
19574
|
src: $props.avatarSrc,
|
|
19459
19575
|
alt: $props.avatarInitials
|
|
19460
|
-
}, null, 8,
|
|
19576
|
+
}, null, 8, contact_infovue_type_template_id_9fe40f88_hoisted_2)]),
|
|
19461
19577
|
_: 1
|
|
19462
19578
|
})) : $props.avatarInitials ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_dt_avatar, {
|
|
19463
19579
|
key: 1,
|
|
19464
|
-
|
|
19465
|
-
size: "lg",
|
|
19466
|
-
color: $props.avatarColor
|
|
19580
|
+
size: "lg"
|
|
19467
19581
|
}, {
|
|
19468
19582
|
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createTextVNode)((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.toDisplayString)($props.avatarInitials), 1)]),
|
|
19469
19583
|
_: 1
|
|
19470
|
-
}
|
|
19584
|
+
})) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true), $options.showUserStatus ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementBlock)("div", {
|
|
19471
19585
|
key: 2,
|
|
19472
19586
|
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.normalizeClass)(['d-ba', 'd-bc-white', 'd-baw2', 'd-bar2', 'd-ps-absolute', 'd-bn1', 'd-rn1', 'd-w20p', 'd-h20p', $data.USER_STATUS_COLOR_MODIFIERS[$props.userStatusColor]]),
|
|
19473
19587
|
"data-qa": "contact-info-user-status"
|
|
19474
19588
|
}, " ", 2)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true)])]),
|
|
19475
|
-
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19476
|
-
subtitle: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19477
|
-
bottom: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19478
|
-
right: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19589
|
+
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div", contact_infovue_type_template_id_9fe40f88_hoisted_3, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderSlot)(_ctx.$slots, "header")])]),
|
|
19590
|
+
subtitle: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div", contact_infovue_type_template_id_9fe40f88_hoisted_4, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderSlot)(_ctx.$slots, "subtitle")])]),
|
|
19591
|
+
bottom: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div", contact_infovue_type_template_id_9fe40f88_hoisted_5, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderSlot)(_ctx.$slots, "bottom")])]),
|
|
19592
|
+
right: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div", contact_infovue_type_template_id_9fe40f88_hoisted_6, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderSlot)(_ctx.$slots, "right")])]),
|
|
19479
19593
|
_: 3
|
|
19480
19594
|
}, 8, ["id", "role"]);
|
|
19481
19595
|
}
|
|
19482
|
-
;// CONCATENATED MODULE: ./recipes/list_items/contact_info/contact_info.vue?vue&type=template&id=
|
|
19596
|
+
;// CONCATENATED MODULE: ./recipes/list_items/contact_info/contact_info.vue?vue&type=template&id=9fe40f88
|
|
19483
19597
|
|
|
19484
19598
|
;// CONCATENATED MODULE: ./recipes/list_items/contact_info/contact_info_constants.js
|
|
19485
19599
|
const USER_STATUS_COLOR_MODIFIERS = {
|
|
@@ -19496,7 +19610,6 @@ const USER_STATUS_COLOR_MODIFIERS = {
|
|
|
19496
19610
|
|
|
19497
19611
|
|
|
19498
19612
|
|
|
19499
|
-
|
|
19500
19613
|
/* harmony default export */ const contact_infovue_type_script_lang_js = ({
|
|
19501
19614
|
name: 'DtRecipeContactInfo',
|
|
19502
19615
|
components: {
|
|
@@ -19548,15 +19661,6 @@ const USER_STATUS_COLOR_MODIFIERS = {
|
|
|
19548
19661
|
default: ''
|
|
19549
19662
|
},
|
|
19550
19663
|
|
|
19551
|
-
/**
|
|
19552
|
-
* Background color of initials letters in avatar.
|
|
19553
|
-
*/
|
|
19554
|
-
avatarColor: {
|
|
19555
|
-
type: String,
|
|
19556
|
-
default: 'base',
|
|
19557
|
-
validator: color => Object.keys(AVATAR_COLOR_MODIFIERS).includes(color)
|
|
19558
|
-
},
|
|
19559
|
-
|
|
19560
19664
|
/**
|
|
19561
19665
|
* Status color of user from contact.
|
|
19562
19666
|
*/
|
|
@@ -19588,7 +19692,7 @@ const USER_STATUS_COLOR_MODIFIERS = {
|
|
|
19588
19692
|
|
|
19589
19693
|
|
|
19590
19694
|
;
|
|
19591
|
-
const contact_info_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(contact_infovue_type_script_lang_js, [['render',
|
|
19695
|
+
const contact_info_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(contact_infovue_type_script_lang_js, [['render',contact_infovue_type_template_id_9fe40f88_render]])
|
|
19592
19696
|
|
|
19593
19697
|
/* harmony default export */ const contact_info = (contact_info_exports_);
|
|
19594
19698
|
;// CONCATENATED MODULE: ./recipes/list_items/contact_info/index.js
|