@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.
|
@@ -23,6 +23,30 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".enter-active,.leave-active{overflow:h
|
|
|
23
23
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
/***/ }),
|
|
27
|
+
|
|
28
|
+
/***/ 772:
|
|
29
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
30
|
+
|
|
31
|
+
"use strict";
|
|
32
|
+
__webpack_require__.r(__webpack_exports__);
|
|
33
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
34
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
35
|
+
/* harmony export */ });
|
|
36
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81);
|
|
37
|
+
/* 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__);
|
|
38
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645);
|
|
39
|
+
/* 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__);
|
|
40
|
+
// Imports
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
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()));
|
|
44
|
+
// Module
|
|
45
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".d-avatar--image-loaded{background-color:initial;background-image:unset}", ""]);
|
|
46
|
+
// Exports
|
|
47
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
48
|
+
|
|
49
|
+
|
|
26
50
|
/***/ }),
|
|
27
51
|
|
|
28
52
|
/***/ 869:
|
|
@@ -542,6 +566,22 @@ var update = add("e1cef0bc", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
542
566
|
|
|
543
567
|
/***/ }),
|
|
544
568
|
|
|
569
|
+
/***/ 224:
|
|
570
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
571
|
+
|
|
572
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
573
|
+
|
|
574
|
+
// load the styles
|
|
575
|
+
var content = __webpack_require__(772);
|
|
576
|
+
if(content.__esModule) content = content.default;
|
|
577
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
578
|
+
if(content.locals) module.exports = content.locals;
|
|
579
|
+
// add the styles to the DOM
|
|
580
|
+
var add = (__webpack_require__(402)/* ["default"] */ .Z)
|
|
581
|
+
var update = add("7326dee6", content, true, {"sourceMap":false,"shadowMode":false});
|
|
582
|
+
|
|
583
|
+
/***/ }),
|
|
584
|
+
|
|
545
585
|
/***/ 704:
|
|
546
586
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
547
587
|
|
|
@@ -1130,7 +1170,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1130
1170
|
|
|
1131
1171
|
// EXPORTS
|
|
1132
1172
|
__webpack_require__.d(__webpack_exports__, {
|
|
1133
|
-
"AVATAR_COLOR_MODIFIERS": () => (/* reexport */ AVATAR_COLOR_MODIFIERS),
|
|
1134
1173
|
"AVATAR_KIND_MODIFIERS": () => (/* reexport */ AVATAR_KIND_MODIFIERS),
|
|
1135
1174
|
"AVATAR_SIZE_MODIFIERS": () => (/* reexport */ AVATAR_SIZE_MODIFIERS),
|
|
1136
1175
|
"BADGE_KIND_MODIFIERS": () => (/* reexport */ BADGE_KIND_MODIFIERS),
|
|
@@ -1272,25 +1311,31 @@ if (typeof window !== 'undefined') {
|
|
|
1272
1311
|
|
|
1273
1312
|
;// CONCATENATED MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
1274
1313
|
const external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject = require("vue");
|
|
1275
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=
|
|
1314
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
1276
1315
|
|
|
1277
1316
|
const _hoisted_1 = ["id"];
|
|
1317
|
+
const _hoisted_2 = {
|
|
1318
|
+
key: 1
|
|
1319
|
+
};
|
|
1278
1320
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1279
1321
|
const _component_dt_presence = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("dt-presence");
|
|
1280
1322
|
|
|
1281
1323
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementBlock)("div", {
|
|
1282
1324
|
id: $props.id,
|
|
1283
|
-
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], $
|
|
1325
|
+
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]),
|
|
1326
|
+
style: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.normalizeStyle)($options.initialKindStyle),
|
|
1284
1327
|
"data-qa": "dt-avatar"
|
|
1285
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderSlot)(_ctx.$slots, "default"
|
|
1286
|
-
key: 0
|
|
1328
|
+
}, [$options.showDefaultSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderSlot)(_ctx.$slots, "default", {
|
|
1329
|
+
key: 0
|
|
1330
|
+
}) : $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)({
|
|
1331
|
+
key: 2,
|
|
1287
1332
|
presence: $props.presence,
|
|
1288
1333
|
class: ['d-avatar__presence', $data.AVATAR_PRESENCE_SIZE_MODIFIERS[$props.size]]
|
|
1289
1334
|
}, $props.presenceProps, {
|
|
1290
1335
|
"data-qa": "dt-presence"
|
|
1291
|
-
}), null, 16, ["presence", "class"])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true)],
|
|
1336
|
+
}), null, 16, ["presence", "class"])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true)], 14, _hoisted_1);
|
|
1292
1337
|
}
|
|
1293
|
-
;// CONCATENATED MODULE: ./components/avatar/avatar.vue?vue&type=template&id=
|
|
1338
|
+
;// CONCATENATED MODULE: ./components/avatar/avatar.vue?vue&type=template&id=52a431d8
|
|
1294
1339
|
|
|
1295
1340
|
;// CONCATENATED MODULE: ./common/constants.js
|
|
1296
1341
|
/* TODO: Move and sort these in a constants directory
|
|
@@ -1377,6 +1422,15 @@ function getUniqueString() {
|
|
|
1377
1422
|
let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_PREFIX;
|
|
1378
1423
|
return `${prefix}${UNIQUE_ID_COUNTER++}`;
|
|
1379
1424
|
}
|
|
1425
|
+
/**
|
|
1426
|
+
* Returns a random element from array
|
|
1427
|
+
* @param array
|
|
1428
|
+
* @returns {*}
|
|
1429
|
+
*/
|
|
1430
|
+
|
|
1431
|
+
function getRandomElement(array) {
|
|
1432
|
+
return array[Math.floor(Math.random() * array.length)];
|
|
1433
|
+
}
|
|
1380
1434
|
function formatMessages(messages) {
|
|
1381
1435
|
if (!messages) {
|
|
1382
1436
|
return [];
|
|
@@ -1472,6 +1526,7 @@ const pascalCaseToKebabCase = string => {
|
|
|
1472
1526
|
};
|
|
1473
1527
|
/* harmony default export */ const utils = ({
|
|
1474
1528
|
getUniqueString,
|
|
1529
|
+
getRandomElement,
|
|
1475
1530
|
formatMessages,
|
|
1476
1531
|
filterFormattedMessages,
|
|
1477
1532
|
hasFormattedMessageOfType,
|
|
@@ -1483,7 +1538,7 @@ const pascalCaseToKebabCase = string => {
|
|
|
1483
1538
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
1484
1539
|
|
|
1485
1540
|
const presencevue_type_template_id_85037b42_hoisted_1 = ["aria-live"];
|
|
1486
|
-
const
|
|
1541
|
+
const presencevue_type_template_id_85037b42_hoisted_2 = {
|
|
1487
1542
|
key: 0,
|
|
1488
1543
|
"data-qa": "dt-presence-sr-text",
|
|
1489
1544
|
class: "sr-only"
|
|
@@ -1494,7 +1549,7 @@ function presencevue_type_template_id_85037b42_render(_ctx, _cache, $props, $set
|
|
|
1494
1549
|
"data-qa": "dt-presence",
|
|
1495
1550
|
role: "status",
|
|
1496
1551
|
"aria-live": _ctx.$attrs.ariaLive || 'off'
|
|
1497
|
-
}, [$props.srText ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementBlock)("span",
|
|
1552
|
+
}, [$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", {
|
|
1498
1553
|
class: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.normalizeClass)(["d-presence__inner", {
|
|
1499
1554
|
'd-presence__inner--active': $props.presence === 'active',
|
|
1500
1555
|
'd-presence__inner--away': $props.presence === 'away',
|
|
@@ -1569,43 +1624,35 @@ const AVATAR_KIND_MODIFIERS = {
|
|
|
1569
1624
|
initials: 'd-avatar--initials'
|
|
1570
1625
|
};
|
|
1571
1626
|
const AVATAR_SIZE_MODIFIERS = {
|
|
1627
|
+
xs: 'd-avatar--xs',
|
|
1572
1628
|
sm: 'd-avatar--sm',
|
|
1573
1629
|
md: 'd-avatar--md',
|
|
1574
|
-
lg: 'd-avatar--lg'
|
|
1630
|
+
lg: 'd-avatar--lg',
|
|
1631
|
+
xl: 'd-avatar--xl'
|
|
1575
1632
|
};
|
|
1576
1633
|
const AVATAR_PRESENCE_SIZE_MODIFIERS = {
|
|
1577
1634
|
md: 'd-avatar__presence--md',
|
|
1578
1635
|
lg: 'd-avatar__presence--lg'
|
|
1579
1636
|
};
|
|
1580
|
-
const AVATAR_COLOR_MODIFIERS = {
|
|
1581
|
-
base: '',
|
|
1582
|
-
'orange-200': 'd-avatar--orange-200',
|
|
1583
|
-
'orange-300': 'd-avatar--orange-300',
|
|
1584
|
-
'orange-400': 'd-avatar--orange-400',
|
|
1585
|
-
'orange-500': 'd-avatar--orange-500',
|
|
1586
|
-
'magenta-100': 'd-avatar--magenta-100',
|
|
1587
|
-
'magenta-200': 'd-avatar--magenta-200',
|
|
1588
|
-
'magenta-300': 'd-avatar--magenta-300',
|
|
1589
|
-
'magenta-400': 'd-avatar--magenta-400',
|
|
1590
|
-
'purple-200': 'd-avatar--purple-200',
|
|
1591
|
-
'purple-300': 'd-avatar--purple-300',
|
|
1592
|
-
'purple-400': 'd-avatar--purple-400',
|
|
1593
|
-
'purple-500': 'd-avatar--purple-500',
|
|
1594
|
-
'gold-100': 'd-avatar--gold-100',
|
|
1595
|
-
'gold-200': 'd-avatar--gold-200',
|
|
1596
|
-
'gold-300': 'd-avatar--gold-300',
|
|
1597
|
-
'gold-500': 'd-avatar--gold-500'
|
|
1598
|
-
};
|
|
1599
1637
|
const AVATAR_ICON_SIZES = {
|
|
1638
|
+
xs: '100',
|
|
1600
1639
|
sm: '200',
|
|
1601
1640
|
md: '400',
|
|
1602
|
-
lg: '500'
|
|
1641
|
+
lg: '500',
|
|
1642
|
+
xl: '600'
|
|
1643
|
+
};
|
|
1644
|
+
const AVATAR_ANGLES = [45, -45, 90, -90, 135, -135, 180, -180];
|
|
1645
|
+
const GRADIENT_COLORS = {
|
|
1646
|
+
with100: ['purple-100', 'magenta-100', 'gold-100', 'blue-100'],
|
|
1647
|
+
with200: ['purple-200', 'magenta-200', 'gold-200', 'blue-200']
|
|
1603
1648
|
};
|
|
1649
|
+
const MAX_GRADIENT_COLORS = 3;
|
|
1650
|
+
const MAX_GRADIENT_COLORS_100 = 2;
|
|
1604
1651
|
/* harmony default export */ const avatar_constants = ({
|
|
1605
1652
|
AVATAR_KIND_MODIFIERS,
|
|
1606
1653
|
AVATAR_SIZE_MODIFIERS,
|
|
1607
|
-
|
|
1608
|
-
|
|
1654
|
+
AVATAR_ICON_SIZES,
|
|
1655
|
+
AVATAR_ANGLES
|
|
1609
1656
|
});
|
|
1610
1657
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/avatar/avatar.vue?vue&type=script&lang=js
|
|
1611
1658
|
|
|
@@ -1638,7 +1685,7 @@ const AVATAR_ICON_SIZES = {
|
|
|
1638
1685
|
|
|
1639
1686
|
/**
|
|
1640
1687
|
* The size of the avatar
|
|
1641
|
-
* @values sm, md, lg
|
|
1688
|
+
* @values xs, sm, md, lg, xl
|
|
1642
1689
|
*/
|
|
1643
1690
|
size: {
|
|
1644
1691
|
type: String,
|
|
@@ -1646,20 +1693,6 @@ const AVATAR_ICON_SIZES = {
|
|
|
1646
1693
|
validator: size => Object.keys(AVATAR_SIZE_MODIFIERS).includes(size)
|
|
1647
1694
|
},
|
|
1648
1695
|
|
|
1649
|
-
/**
|
|
1650
|
-
* The color of the avatar
|
|
1651
|
-
* @values base
|
|
1652
|
-
* orange-200, orange-300, orange-400, orange-500,
|
|
1653
|
-
* pink-300, pink-400, pink-500, pink-600,
|
|
1654
|
-
* purple-200, purple-300, purple-500, purple-600,
|
|
1655
|
-
* yellow-200, yellow-300, yellow-400, yellow-500
|
|
1656
|
-
*/
|
|
1657
|
-
color: {
|
|
1658
|
-
type: String,
|
|
1659
|
-
default: 'base',
|
|
1660
|
-
validator: color => Object.keys(AVATAR_COLOR_MODIFIERS).includes(color)
|
|
1661
|
-
},
|
|
1662
|
-
|
|
1663
1696
|
/**
|
|
1664
1697
|
* Used to customize the avatar container
|
|
1665
1698
|
*/
|
|
@@ -1684,40 +1717,98 @@ const AVATAR_ICON_SIZES = {
|
|
|
1684
1717
|
presenceProps: {
|
|
1685
1718
|
type: Object,
|
|
1686
1719
|
default: () => ({})
|
|
1720
|
+
},
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* Initials to be shown in the avatar. Used as fallback if image fails to load.
|
|
1724
|
+
*/
|
|
1725
|
+
initials: {
|
|
1726
|
+
type: String,
|
|
1727
|
+
default: ''
|
|
1687
1728
|
}
|
|
1688
1729
|
},
|
|
1689
1730
|
|
|
1690
1731
|
data() {
|
|
1691
1732
|
return {
|
|
1692
1733
|
// initials, image or icon
|
|
1693
|
-
kind: '
|
|
1734
|
+
kind: 'image',
|
|
1694
1735
|
AVATAR_SIZE_MODIFIERS: AVATAR_SIZE_MODIFIERS,
|
|
1695
|
-
AVATAR_COLOR_MODIFIERS: AVATAR_COLOR_MODIFIERS,
|
|
1696
1736
|
AVATAR_KIND_MODIFIERS: AVATAR_KIND_MODIFIERS,
|
|
1697
|
-
AVATAR_PRESENCE_SIZE_MODIFIERS: AVATAR_PRESENCE_SIZE_MODIFIERS
|
|
1737
|
+
AVATAR_PRESENCE_SIZE_MODIFIERS: AVATAR_PRESENCE_SIZE_MODIFIERS,
|
|
1738
|
+
imageLoadedSuccessfully: null,
|
|
1739
|
+
slottedInitials: '',
|
|
1740
|
+
formattedInitials: ''
|
|
1698
1741
|
};
|
|
1699
1742
|
},
|
|
1700
1743
|
|
|
1744
|
+
computed: {
|
|
1745
|
+
showDefaultSlot() {
|
|
1746
|
+
return this.kind !== 'initials' && this.imageLoadedSuccessfully !== false;
|
|
1747
|
+
},
|
|
1748
|
+
|
|
1749
|
+
showInitials() {
|
|
1750
|
+
return this.kind === 'initials' || this.initials;
|
|
1751
|
+
},
|
|
1752
|
+
|
|
1753
|
+
initialKindStyle() {
|
|
1754
|
+
const randomGradientColorStops = this.randomizeGradientColorStops();
|
|
1755
|
+
return {
|
|
1756
|
+
'--avatar-gradient-angle': `${this.randomizeGradientAngle()}deg`,
|
|
1757
|
+
'--avatar-gradient-stop-1': `var(--${randomGradientColorStops[0]})`,
|
|
1758
|
+
'--avatar-gradient-stop-2': `var(--${randomGradientColorStops[1]})`,
|
|
1759
|
+
'--avatar-gradient-stop-3': `var(--${randomGradientColorStops[2]})`
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
},
|
|
1764
|
+
|
|
1701
1765
|
mounted() {
|
|
1702
1766
|
this.init();
|
|
1703
1767
|
},
|
|
1704
1768
|
|
|
1705
1769
|
updated() {
|
|
1706
|
-
this.
|
|
1770
|
+
if (this.kind === 'initials') {
|
|
1771
|
+
this.slottedInitials = this.$el.children[0].textContent;
|
|
1772
|
+
this.formatInitials(this.slottedInitials);
|
|
1773
|
+
}
|
|
1707
1774
|
},
|
|
1708
1775
|
|
|
1709
1776
|
methods: {
|
|
1710
1777
|
init() {
|
|
1711
|
-
const firstChild = this.$el.children[0];
|
|
1778
|
+
const firstChild = this.$el.children[0] || this.$el;
|
|
1712
1779
|
|
|
1713
1780
|
if (firstChild) {
|
|
1714
1781
|
this.setKind(firstChild);
|
|
1715
1782
|
|
|
1716
1783
|
if (this.kind === 'image') {
|
|
1717
1784
|
firstChild.classList.add('d-avatar__image');
|
|
1785
|
+
this.validateImageAttrsPresence();
|
|
1786
|
+
firstChild.addEventListener('error', () => {
|
|
1787
|
+
this.formatInitials(this.initials);
|
|
1788
|
+
this.imageLoadedSuccessfully = false;
|
|
1789
|
+
});
|
|
1790
|
+
firstChild.addEventListener('load', () => {
|
|
1791
|
+
firstChild.classList.add('d-avatar--image-loaded');
|
|
1792
|
+
this.imageLoadedSuccessfully = true;
|
|
1793
|
+
});
|
|
1718
1794
|
}
|
|
1719
1795
|
|
|
1720
|
-
this.
|
|
1796
|
+
if (this.kind === 'initials') {
|
|
1797
|
+
this.slottedInitials = firstChild.textContent;
|
|
1798
|
+
this.formatInitials(this.slottedInitials);
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
},
|
|
1802
|
+
|
|
1803
|
+
formatInitials(initials) {
|
|
1804
|
+
if (!initials) return;
|
|
1805
|
+
|
|
1806
|
+
if (this.size === 'xs') {
|
|
1807
|
+
this.formattedInitials = '';
|
|
1808
|
+
} else if (this.size === 'sm') {
|
|
1809
|
+
this.formattedInitials = initials.trim()[0];
|
|
1810
|
+
} else {
|
|
1811
|
+
this.formattedInitials = initials.trim().slice(0, 2);
|
|
1721
1812
|
}
|
|
1722
1813
|
},
|
|
1723
1814
|
|
|
@@ -1747,25 +1838,50 @@ const AVATAR_ICON_SIZES = {
|
|
|
1747
1838
|
return (element === null || element === void 0 ? void 0 : (_element$tagName2 = element.tagName) === null || _element$tagName2 === void 0 ? void 0 : _element$tagName2.toUpperCase()) === 'IMG';
|
|
1748
1839
|
},
|
|
1749
1840
|
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1841
|
+
randomizeGradientAngle() {
|
|
1842
|
+
return getRandomElement(AVATAR_ANGLES);
|
|
1843
|
+
},
|
|
1844
|
+
|
|
1845
|
+
randomizeGradientColorStops() {
|
|
1846
|
+
const colors = new Set(); // get 3 unique colors, 2 from colorsWith100 and one from colorsWith200
|
|
1847
|
+
|
|
1848
|
+
while (colors.size < MAX_GRADIENT_COLORS) {
|
|
1849
|
+
if (colors.size === MAX_GRADIENT_COLORS_100) {
|
|
1850
|
+
colors.add(getRandomElement(GRADIENT_COLORS.with200));
|
|
1851
|
+
} else {
|
|
1852
|
+
colors.add(getRandomElement(GRADIENT_COLORS.with100));
|
|
1755
1853
|
}
|
|
1756
1854
|
}
|
|
1855
|
+
|
|
1856
|
+
const shuffledColors = Array.from(colors).sort(() => 0.5 - Math.random());
|
|
1857
|
+
return shuffledColors;
|
|
1858
|
+
},
|
|
1859
|
+
|
|
1860
|
+
validateImageAttrsPresence() {
|
|
1861
|
+
const isSrcMissing = !this.$el.children[0].getAttribute('src');
|
|
1862
|
+
const isAltMissing = !this.$el.children[0].getAttribute('alt');
|
|
1863
|
+
|
|
1864
|
+
if (isSrcMissing || isAltMissing) {
|
|
1865
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.warn)('src and alt attributes are required for image avatars', this);
|
|
1866
|
+
}
|
|
1757
1867
|
}
|
|
1758
1868
|
|
|
1759
1869
|
}
|
|
1760
1870
|
});
|
|
1761
1871
|
;// CONCATENATED MODULE: ./components/avatar/avatar.vue?vue&type=script&lang=js
|
|
1762
1872
|
|
|
1873
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.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
|
|
1874
|
+
var avatarvue_type_style_index_0_id_52a431d8_lang_less = __webpack_require__(224);
|
|
1875
|
+
;// CONCATENATED MODULE: ./components/avatar/avatar.vue?vue&type=style&index=0&id=52a431d8&lang=less
|
|
1876
|
+
|
|
1763
1877
|
;// CONCATENATED MODULE: ./components/avatar/avatar.vue
|
|
1764
1878
|
|
|
1765
1879
|
|
|
1766
1880
|
|
|
1767
1881
|
|
|
1768
1882
|
;
|
|
1883
|
+
|
|
1884
|
+
|
|
1769
1885
|
const avatar_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(avatarvue_type_script_lang_js, [['render',render]])
|
|
1770
1886
|
|
|
1771
1887
|
/* harmony default export */ const avatar = (avatar_exports_);
|
|
@@ -19409,26 +19525,26 @@ const callbar_button_with_popover_exports_ = /*#__PURE__*/(0,exportHelper/* defa
|
|
|
19409
19525
|
/* harmony default export */ const callbar_button_with_popover = (callbar_button_with_popover_exports_);
|
|
19410
19526
|
;// CONCATENATED MODULE: ./recipes/buttons/callbar_button_with_popover/index.js
|
|
19411
19527
|
|
|
19412
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=
|
|
19528
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
19413
19529
|
|
|
19414
|
-
const
|
|
19530
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_1 = {
|
|
19415
19531
|
class: "d-ps-relative",
|
|
19416
19532
|
"data-qa": "contact-info-left"
|
|
19417
19533
|
};
|
|
19418
|
-
const
|
|
19419
|
-
const
|
|
19534
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_2 = ["src", "alt"];
|
|
19535
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_3 = {
|
|
19420
19536
|
"data-qa": "contact-info-header"
|
|
19421
19537
|
};
|
|
19422
|
-
const
|
|
19538
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_4 = {
|
|
19423
19539
|
"data-qa": "contact-info-subtitle"
|
|
19424
19540
|
};
|
|
19425
|
-
const
|
|
19541
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_5 = {
|
|
19426
19542
|
"data-qa": "contact-info-bottom"
|
|
19427
19543
|
};
|
|
19428
|
-
const
|
|
19544
|
+
const contact_infovue_type_template_id_9fe40f88_hoisted_6 = {
|
|
19429
19545
|
"data-qa": "contact-info-right"
|
|
19430
19546
|
};
|
|
19431
|
-
function
|
|
19547
|
+
function contact_infovue_type_template_id_9fe40f88_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19432
19548
|
const _component_dt_avatar = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("dt-avatar");
|
|
19433
19549
|
|
|
19434
19550
|
const _component_dt_list_item = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("dt-list-item");
|
|
@@ -19439,7 +19555,7 @@ function contact_infovue_type_template_id_c1f377a8_render(_ctx, _cache, $props,
|
|
|
19439
19555
|
"element-type": "div",
|
|
19440
19556
|
"data-qa": "contact-info"
|
|
19441
19557
|
}, {
|
|
19442
|
-
left: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19558
|
+
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, {
|
|
19443
19559
|
key: 0,
|
|
19444
19560
|
size: "lg"
|
|
19445
19561
|
}, {
|
|
@@ -19447,29 +19563,27 @@ function contact_infovue_type_template_id_c1f377a8_render(_ctx, _cache, $props,
|
|
|
19447
19563
|
"data-qa": "dt-contact-avatar",
|
|
19448
19564
|
src: $props.avatarSrc,
|
|
19449
19565
|
alt: $props.avatarInitials
|
|
19450
|
-
}, null, 8,
|
|
19566
|
+
}, null, 8, contact_infovue_type_template_id_9fe40f88_hoisted_2)]),
|
|
19451
19567
|
_: 1
|
|
19452
19568
|
})) : $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, {
|
|
19453
19569
|
key: 1,
|
|
19454
|
-
|
|
19455
|
-
size: "lg",
|
|
19456
|
-
color: $props.avatarColor
|
|
19570
|
+
size: "lg"
|
|
19457
19571
|
}, {
|
|
19458
19572
|
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)]),
|
|
19459
19573
|
_: 1
|
|
19460
|
-
}
|
|
19574
|
+
})) : (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", {
|
|
19461
19575
|
key: 2,
|
|
19462
19576
|
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]]),
|
|
19463
19577
|
"data-qa": "contact-info-user-status"
|
|
19464
19578
|
}, " ", 2)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true)])]),
|
|
19465
|
-
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19466
|
-
subtitle: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19467
|
-
bottom: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19468
|
-
right: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div",
|
|
19579
|
+
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")])]),
|
|
19580
|
+
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")])]),
|
|
19581
|
+
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")])]),
|
|
19582
|
+
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")])]),
|
|
19469
19583
|
_: 3
|
|
19470
19584
|
}, 8, ["id", "role"]);
|
|
19471
19585
|
}
|
|
19472
|
-
;// CONCATENATED MODULE: ./recipes/list_items/contact_info/contact_info.vue?vue&type=template&id=
|
|
19586
|
+
;// CONCATENATED MODULE: ./recipes/list_items/contact_info/contact_info.vue?vue&type=template&id=9fe40f88
|
|
19473
19587
|
|
|
19474
19588
|
;// CONCATENATED MODULE: ./recipes/list_items/contact_info/contact_info_constants.js
|
|
19475
19589
|
const USER_STATUS_COLOR_MODIFIERS = {
|
|
@@ -19486,7 +19600,6 @@ const USER_STATUS_COLOR_MODIFIERS = {
|
|
|
19486
19600
|
|
|
19487
19601
|
|
|
19488
19602
|
|
|
19489
|
-
|
|
19490
19603
|
/* harmony default export */ const contact_infovue_type_script_lang_js = ({
|
|
19491
19604
|
name: 'DtRecipeContactInfo',
|
|
19492
19605
|
components: {
|
|
@@ -19538,15 +19651,6 @@ const USER_STATUS_COLOR_MODIFIERS = {
|
|
|
19538
19651
|
default: ''
|
|
19539
19652
|
},
|
|
19540
19653
|
|
|
19541
|
-
/**
|
|
19542
|
-
* Background color of initials letters in avatar.
|
|
19543
|
-
*/
|
|
19544
|
-
avatarColor: {
|
|
19545
|
-
type: String,
|
|
19546
|
-
default: 'base',
|
|
19547
|
-
validator: color => Object.keys(AVATAR_COLOR_MODIFIERS).includes(color)
|
|
19548
|
-
},
|
|
19549
|
-
|
|
19550
19654
|
/**
|
|
19551
19655
|
* Status color of user from contact.
|
|
19552
19656
|
*/
|
|
@@ -19578,7 +19682,7 @@ const USER_STATUS_COLOR_MODIFIERS = {
|
|
|
19578
19682
|
|
|
19579
19683
|
|
|
19580
19684
|
;
|
|
19581
|
-
const contact_info_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(contact_infovue_type_script_lang_js, [['render',
|
|
19685
|
+
const contact_info_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(contact_infovue_type_script_lang_js, [['render',contact_infovue_type_template_id_9fe40f88_render]])
|
|
19582
19686
|
|
|
19583
19687
|
/* harmony default export */ const contact_info = (contact_info_exports_);
|
|
19584
19688
|
;// CONCATENATED MODULE: ./recipes/list_items/contact_info/index.js
|