@mobilon-dev/chotto 0.3.83 → 0.3.84
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/chotto.css +1 -1
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +351 -282
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +38 -33
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +64 -39
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js +116 -61
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationChannels.js +1 -1
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.js +30 -16
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.js +47 -0
- package/dist/components/2_blocks/CommunicationPanel/icons/{CommunicationPanelConfirmSpinner.vue2.js → CommunicationPanelConfirmSpinner.vue.js} +1 -1
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.js +19 -0
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -0
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.d.ts +2 -2
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +10 -1
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.d.ts +23 -2
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts +1 -0
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.d.ts +20 -0
- package/dist/types/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.d.ts +2 -0
- package/dist/types/components/2_blocks/CommunicationPanel/icons/index.d.ts +1 -0
- package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -0
- package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +42 -10
- package/package.json +1 -1
package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { computed as o, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { computed as o, createElementBlock as a, openBlock as e, createCommentVNode as s, Fragment as I, createBlock as i, withCtx as A, createElementVNode as S, normalizeClass as b, unref as r } from "vue";
|
|
2
|
+
import _ from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
3
|
+
import k from "./icons/CommunicationPanelCheckIcon.vue.js";
|
|
4
|
+
import h from "./icons/CommunicationPanelUnconfirmedIcon.vue.js";
|
|
5
|
+
import v from "./icons/CommunicationPanelConfirmSpinner.vue.js";
|
|
6
|
+
import { isAttributeConfirming as g, shouldShowAttributeCheckmark as w, shouldShowAttributeUnconfirmedIndicator as x, shouldShowBlockedIndicatorSlot as q, getAttributeCheckIndicatorClass as B, getAttributeIndicatorTooltipText as T } from "./composables/useCommunicationAttributes.js";
|
|
7
|
+
const P = { class: "attribute-indicator-slot" }, N = {
|
|
8
|
+
key: 3,
|
|
8
9
|
class: "blocked-indicator-mark",
|
|
9
10
|
"aria-hidden": "true"
|
|
10
|
-
},
|
|
11
|
-
key:
|
|
11
|
+
}, U = {
|
|
12
|
+
key: 3,
|
|
12
13
|
class: "blocked-indicator-mark",
|
|
13
14
|
"aria-hidden": "true"
|
|
14
|
-
},
|
|
15
|
+
}, H = {
|
|
15
16
|
__name: "CommunicationPanelAttributeIndicator",
|
|
16
17
|
props: {
|
|
17
18
|
attribute: {
|
|
@@ -44,52 +45,56 @@ const q = { class: "attribute-indicator-slot" }, B = {
|
|
|
44
45
|
default: 600
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
|
-
setup(
|
|
48
|
-
const t =
|
|
48
|
+
setup(d) {
|
|
49
|
+
const t = d, m = o(() => ({
|
|
49
50
|
isSelected: t.isSelected,
|
|
50
51
|
confirmingAttributeId: t.confirmingAttributeId,
|
|
51
52
|
blockedAttributeIds: t.blockedAttributeIds ?? []
|
|
52
|
-
})),
|
|
53
|
-
() =>
|
|
53
|
+
})), n = o(
|
|
54
|
+
() => g(t.attribute, t.confirmingAttributeId)
|
|
54
55
|
), c = o(
|
|
55
|
-
() =>
|
|
56
|
+
() => w(t.attribute, t.isSelected)
|
|
57
|
+
), u = o(
|
|
58
|
+
() => x(t.attribute)
|
|
56
59
|
), l = o(
|
|
57
|
-
() =>
|
|
58
|
-
),
|
|
59
|
-
() =>
|
|
60
|
+
() => q(t.attribute, m.value)
|
|
61
|
+
), y = o(
|
|
62
|
+
() => n.value || c.value || u.value
|
|
63
|
+
), C = o(() => y.value || l.value), f = o(() => n.value ? "confirming-indicator" : l.value ? "blocked-indicator" : B(t.attribute, t.isSelected) ?? ""), p = o(
|
|
64
|
+
() => T(
|
|
60
65
|
t.attribute,
|
|
61
66
|
t.indicatorTooltips,
|
|
62
|
-
|
|
67
|
+
m.value
|
|
63
68
|
)
|
|
64
69
|
);
|
|
65
|
-
return (
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
return (j, D) => (e(), a("span", P, [
|
|
71
|
+
C.value ? (e(), a(I, { key: 0 }, [
|
|
72
|
+
p.value ? (e(), i(_, {
|
|
68
73
|
key: 0,
|
|
69
|
-
text:
|
|
74
|
+
text: p.value,
|
|
70
75
|
position: "bottom-left",
|
|
71
76
|
offset: 8,
|
|
72
|
-
delay:
|
|
77
|
+
delay: d.tooltipDelay,
|
|
73
78
|
"hide-on-click": ""
|
|
74
79
|
}, {
|
|
75
|
-
default:
|
|
76
|
-
|
|
77
|
-
class:
|
|
80
|
+
default: A(() => [
|
|
81
|
+
S("span", {
|
|
82
|
+
class: b(f.value)
|
|
78
83
|
}, [
|
|
79
|
-
|
|
84
|
+
n.value ? (e(), i(r(v), { key: 0 })) : c.value ? (e(), i(r(k), { key: 1 })) : u.value ? (e(), i(r(h), { key: 2 })) : l.value ? (e(), a("span", N)) : s("", !0)
|
|
80
85
|
], 2)
|
|
81
86
|
]),
|
|
82
87
|
_: 1
|
|
83
|
-
}, 8, ["text", "delay"])) : (e(),
|
|
88
|
+
}, 8, ["text", "delay"])) : (e(), a("span", {
|
|
84
89
|
key: 1,
|
|
85
|
-
class:
|
|
90
|
+
class: b(f.value)
|
|
86
91
|
}, [
|
|
87
|
-
|
|
92
|
+
n.value ? (e(), i(r(v), { key: 0 })) : c.value ? (e(), i(r(k), { key: 1 })) : u.value ? (e(), i(r(h), { key: 2 })) : l.value ? (e(), a("span", U)) : s("", !0)
|
|
88
93
|
], 2))
|
|
89
|
-
], 64)) :
|
|
94
|
+
], 64)) : s("", !0)
|
|
90
95
|
]));
|
|
91
96
|
}
|
|
92
97
|
};
|
|
93
98
|
export {
|
|
94
|
-
|
|
99
|
+
H as default
|
|
95
100
|
};
|
|
@@ -1,91 +1,116 @@
|
|
|
1
|
-
import { needsAttributeConfirmation as
|
|
2
|
-
|
|
1
|
+
import { needsAttributeConfirmation as m } from "./useCommunicationAttributes.js";
|
|
2
|
+
import { resolveRecentChannelSelection as J } from "./useCommunicationRecentSelection.js";
|
|
3
|
+
function Y({
|
|
3
4
|
activeChannelType: l,
|
|
4
|
-
channels:
|
|
5
|
-
selectedChannel:
|
|
6
|
-
selectedChannelType:
|
|
7
|
-
hoveredAttribute:
|
|
8
|
-
confirmingAttributeId:
|
|
5
|
+
channels: v,
|
|
6
|
+
selectedChannel: i,
|
|
7
|
+
selectedChannelType: s,
|
|
8
|
+
hoveredAttribute: z,
|
|
9
|
+
confirmingAttributeId: q,
|
|
9
10
|
isAttributeBlocked: u,
|
|
10
11
|
closeMenu: a,
|
|
11
|
-
hasMultipleChannels:
|
|
12
|
+
hasMultipleChannels: A,
|
|
12
13
|
getSingleChannelForType: x,
|
|
13
|
-
getAvailableChannels:
|
|
14
|
+
getAvailableChannels: C,
|
|
14
15
|
isChannelEmpty: d,
|
|
15
|
-
isNewDialog:
|
|
16
|
-
showDefaultChannelTooltipWithTimer:
|
|
17
|
-
clearDefaultChannelTooltip:
|
|
18
|
-
emit:
|
|
16
|
+
isNewDialog: I,
|
|
17
|
+
showDefaultChannelTooltipWithTimer: R,
|
|
18
|
+
clearDefaultChannelTooltip: S,
|
|
19
|
+
emit: t,
|
|
20
|
+
panelPendingSelection: f
|
|
19
21
|
}) {
|
|
20
|
-
const
|
|
21
|
-
u(n) || (
|
|
22
|
+
const b = (n, e, r) => {
|
|
23
|
+
u(n) || (q.value = n.id, t("confirm-attribute", {
|
|
22
24
|
attributeId: n.id,
|
|
23
25
|
channelId: e,
|
|
24
26
|
channelType: r,
|
|
25
27
|
attribute: n
|
|
26
28
|
}));
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
29
|
-
|
|
29
|
+
}, G = (n, e, r) => {
|
|
30
|
+
if (m(n)) {
|
|
31
|
+
b(n, e, r);
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
+
j(n, e);
|
|
35
|
+
}, h = (n) => {
|
|
34
36
|
if (!(!n || u(n))) {
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
+
if (m(n)) {
|
|
38
|
+
b(n, "", "phone");
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
|
-
|
|
41
|
+
t("phone-call", {
|
|
40
42
|
attributeId: n.id,
|
|
41
43
|
phoneNumber: n.data
|
|
42
44
|
}), a();
|
|
43
45
|
}
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
+
}, j = (n, e) => {
|
|
47
|
+
t("select-attribute-channel", {
|
|
46
48
|
attributeId: n.id,
|
|
47
49
|
channelId: e
|
|
48
|
-
}),
|
|
50
|
+
}), s.value = l.value, i.value = v.value.find((r) => r.channelId === e) ?? {}, d(e) && I.value ? R() : S(), a();
|
|
49
51
|
};
|
|
50
52
|
return {
|
|
51
|
-
handlePhoneCall:
|
|
53
|
+
handlePhoneCall: h,
|
|
52
54
|
handleAttributeClick: (n) => {
|
|
53
|
-
if (
|
|
55
|
+
if (q.value || u(n))
|
|
54
56
|
return;
|
|
55
57
|
const e = l.value;
|
|
56
58
|
if (e) {
|
|
57
59
|
if (e === "phone") {
|
|
58
|
-
|
|
60
|
+
h(n);
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
|
-
if (!
|
|
63
|
+
if (!A(e)) {
|
|
62
64
|
const r = x(e);
|
|
63
|
-
r &&
|
|
65
|
+
r && G(n, r.channelId, e);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
},
|
|
67
|
-
selectSingleChannel:
|
|
69
|
+
selectSingleChannel: j,
|
|
68
70
|
selectChannel: (n) => {
|
|
69
|
-
const e =
|
|
71
|
+
const e = z.value, r = l.value;
|
|
70
72
|
if (!e || !r || u(e)) {
|
|
71
73
|
a();
|
|
72
74
|
return;
|
|
73
75
|
}
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
+
if (m(e)) {
|
|
77
|
+
b(e, n, r);
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
|
-
|
|
80
|
+
t("select-attribute-channel", {
|
|
79
81
|
attributeId: e.id,
|
|
80
82
|
channelId: n
|
|
81
|
-
}),
|
|
83
|
+
}), s.value = r, i.value = v.value.find((c) => c.channelId === n) ?? {}, d(n) && I.value ? R() : S(), a();
|
|
82
84
|
},
|
|
83
85
|
availableChannels: () => {
|
|
84
86
|
const n = l.value;
|
|
85
|
-
return n ?
|
|
87
|
+
return n ? C(n) : [];
|
|
88
|
+
},
|
|
89
|
+
applyRecentChannelButtonSelection: (n, e, r) => {
|
|
90
|
+
const c = J(
|
|
91
|
+
n,
|
|
92
|
+
e,
|
|
93
|
+
r,
|
|
94
|
+
x,
|
|
95
|
+
C
|
|
96
|
+
);
|
|
97
|
+
if (!c)
|
|
98
|
+
return !1;
|
|
99
|
+
const { attribute: P, channelId: o } = c;
|
|
100
|
+
return u(P) ? !1 : (f && (f.value = {
|
|
101
|
+
channelType: n,
|
|
102
|
+
attributeId: P.id,
|
|
103
|
+
channelId: o
|
|
104
|
+
}), t("select-attribute-channel", {
|
|
105
|
+
attributeId: P.id,
|
|
106
|
+
channelId: o
|
|
107
|
+
}), s.value = n, i.value = v.value.find((H) => H.channelId === o) ?? {}, d(o) && I.value ? R() : S(), !0);
|
|
108
|
+
},
|
|
109
|
+
clearPanelPendingSelection: () => {
|
|
110
|
+
f && (f.value = null);
|
|
86
111
|
}
|
|
87
112
|
};
|
|
88
113
|
}
|
|
89
114
|
export {
|
|
90
|
-
|
|
115
|
+
Y as useCommunicationActions
|
|
91
116
|
};
|
package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js
CHANGED
|
@@ -1,98 +1,153 @@
|
|
|
1
|
-
import { computed as A, unref as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { computed as A, unref as C, ref as E, watch as T } from "vue";
|
|
2
|
+
const N = ["confirmed", "unconfirmed"], R = "not_found";
|
|
3
|
+
function k(n) {
|
|
4
|
+
return N.includes(n);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function L(n) {
|
|
7
7
|
const e = n == null ? void 0 : n.status;
|
|
8
|
-
return
|
|
8
|
+
return k(e) ? `status-${e}` : null;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function S(n) {
|
|
11
11
|
return (n == null ? void 0 : n.status) === "confirmed";
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function a(n) {
|
|
14
14
|
return (n == null ? void 0 : n.status) === "unconfirmed";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function y(n) {
|
|
17
|
+
return Array.isArray(n == null ? void 0 : n.canonResolveStates) ? n.canonResolveStates : [];
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
19
|
+
function I(n) {
|
|
20
|
+
return String(n ?? "").toLowerCase() === R;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
22
|
+
function m(n) {
|
|
23
|
+
return a(n) ? y(n).some(
|
|
24
|
+
(e) => I(e.substatus)
|
|
25
|
+
) : !1;
|
|
24
26
|
}
|
|
25
|
-
function
|
|
27
|
+
function O(n, e, c = []) {
|
|
28
|
+
const r = new Set(
|
|
29
|
+
[e, ...c].map((i) => String(i ?? "").trim()).filter(Boolean)
|
|
30
|
+
);
|
|
31
|
+
return !r.size || !a(n) ? !1 : y(n).some((i) => {
|
|
32
|
+
if (!I(i.substatus)) return !1;
|
|
33
|
+
const s = String(i.channelId ?? "").trim(), l = String(i.backendChannelId ?? "").trim();
|
|
34
|
+
if (!s && !l) return !1;
|
|
35
|
+
if (r.has(s) || r.has(l)) return !0;
|
|
36
|
+
for (const f of r) {
|
|
37
|
+
const p = f.includes(".") ? f.split(".").slice(1).join(".") : f, u = s.includes(".") ? s.split(".").slice(1).join(".") : s;
|
|
38
|
+
if (p && u && p === u) return !0;
|
|
39
|
+
}
|
|
40
|
+
return !1;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function U(n, e, c, r, i = []) {
|
|
44
|
+
return O(n, e, i) ? "unconfirmed" : c ? h(n, r) ? "spinner" : "check" : null;
|
|
45
|
+
}
|
|
46
|
+
function j(n) {
|
|
47
|
+
return a(n);
|
|
48
|
+
}
|
|
49
|
+
function v(n, e) {
|
|
50
|
+
return e || S(n) || m(n);
|
|
51
|
+
}
|
|
52
|
+
function _(n, e) {
|
|
53
|
+
return a(n) ? !1 : e || S(n);
|
|
54
|
+
}
|
|
55
|
+
function M(n) {
|
|
56
|
+
return m(n);
|
|
57
|
+
}
|
|
58
|
+
function x(n, e) {
|
|
59
|
+
return m(n) ? "unconfirmed-indicator" : _(n, e) ? e ? "selected-indicator" : "confirmed-indicator" : null;
|
|
60
|
+
}
|
|
61
|
+
function h(n, e) {
|
|
26
62
|
return !e || !(n != null && n.id) ? !1 : n.id === e;
|
|
27
63
|
}
|
|
28
|
-
function
|
|
64
|
+
function w(n, e) {
|
|
29
65
|
return !(n != null && n.id) || !(e != null && e.length) ? !1 : e.includes(n.id);
|
|
30
66
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
67
|
+
function z(n, e) {
|
|
68
|
+
return h(n, e.confirmingAttributeId) || v(n, e.isSelected);
|
|
69
|
+
}
|
|
70
|
+
function D(n, e) {
|
|
71
|
+
return w(n, e.blockedAttributeIds) ? !h(n, e.confirmingAttributeId) && !v(n, e.isSelected) : !1;
|
|
33
72
|
}
|
|
34
73
|
function F(n, e) {
|
|
35
|
-
return
|
|
74
|
+
return h(n, e.confirmingAttributeId) ? "confirming" : w(n, e.blockedAttributeIds) ? "blocked" : z(n, e) ? e.isSelected ? "selected" : S(n) ? "confirmed" : m(n) ? "unconfirmed" : null : null;
|
|
36
75
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
76
|
+
function K(n, e, c) {
|
|
77
|
+
const r = F(n, c);
|
|
78
|
+
return !r || !e ? "" : e[r] ?? "";
|
|
39
79
|
}
|
|
40
|
-
function
|
|
41
|
-
const s =
|
|
42
|
-
|
|
80
|
+
function V(n, e, c, r, i = []) {
|
|
81
|
+
const s = U(
|
|
82
|
+
n,
|
|
83
|
+
e,
|
|
84
|
+
c,
|
|
85
|
+
r,
|
|
86
|
+
i
|
|
87
|
+
);
|
|
88
|
+
return s ? s === "spinner" ? "confirming-indicator" : s === "unconfirmed" ? "unconfirmed-indicator" : "selected-indicator" : null;
|
|
43
89
|
}
|
|
44
|
-
function
|
|
90
|
+
function $({
|
|
45
91
|
contactAttributes: n,
|
|
46
92
|
panelChannelTypes: e,
|
|
47
93
|
frozenAttribute: c
|
|
48
94
|
}) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
),
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
if (!(!
|
|
55
|
-
if (
|
|
56
|
-
|
|
95
|
+
const r = A(() => C(n) ?? []), i = A(() => C(e) ?? []), s = (u) => Object.fromEntries(u.map((o) => [o, []])), l = E(
|
|
96
|
+
s(i.value)
|
|
97
|
+
), f = () => {
|
|
98
|
+
const u = i.value, o = s(u), d = new Set(u);
|
|
99
|
+
r.value.forEach((t) => {
|
|
100
|
+
if (!(!t || !t.type)) {
|
|
101
|
+
if (t.type === "telegram") {
|
|
102
|
+
d.has("telegram") && o.telegram.push(t);
|
|
57
103
|
return;
|
|
58
104
|
}
|
|
59
|
-
if (
|
|
60
|
-
|
|
105
|
+
if (t.type === "max") {
|
|
106
|
+
d.has("max") && o.max.push(t);
|
|
61
107
|
return;
|
|
62
108
|
}
|
|
63
|
-
if (
|
|
64
|
-
["whatsapp", "sms", "phone"].forEach((
|
|
65
|
-
|
|
109
|
+
if (t.type === "phone") {
|
|
110
|
+
["whatsapp", "sms", "phone"].forEach((g) => {
|
|
111
|
+
d.has(g) && o[g].push(t);
|
|
66
112
|
});
|
|
67
113
|
return;
|
|
68
114
|
}
|
|
69
|
-
|
|
115
|
+
d.has(t.type) && o[t.type] && o[t.type].push(t);
|
|
70
116
|
}
|
|
71
|
-
}),
|
|
117
|
+
}), l.value = o;
|
|
72
118
|
};
|
|
73
|
-
return
|
|
74
|
-
organizedContactAttributes:
|
|
75
|
-
organizeContactAttributes:
|
|
76
|
-
isAttributeFrozen: (
|
|
77
|
-
const
|
|
78
|
-
return !
|
|
119
|
+
return T(r, f, { deep: !0, immediate: !0 }), T(i, f), {
|
|
120
|
+
organizedContactAttributes: l,
|
|
121
|
+
organizeContactAttributes: f,
|
|
122
|
+
isAttributeFrozen: (u) => {
|
|
123
|
+
const o = c.value;
|
|
124
|
+
return !u || !(o != null && o.id) ? !1 : u.id === o.id;
|
|
79
125
|
}
|
|
80
126
|
};
|
|
81
127
|
}
|
|
82
128
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
129
|
+
R as CANON_RESOLVE_SUBSTATUS_NOT_FOUND,
|
|
130
|
+
N as CONTACT_ATTRIBUTE_STATUSES,
|
|
131
|
+
y as getAttributeCanonResolveStates,
|
|
132
|
+
x as getAttributeCheckIndicatorClass,
|
|
133
|
+
F as getAttributeIndicatorTooltipKey,
|
|
134
|
+
K as getAttributeIndicatorTooltipText,
|
|
135
|
+
L as getAttributeStatusClass,
|
|
136
|
+
V as getSubMenuChannelIndicatorClass,
|
|
137
|
+
U as getSubMenuChannelIndicatorType,
|
|
138
|
+
m as hasCanonResolveNotFound,
|
|
139
|
+
w as isAttributeBlocked,
|
|
140
|
+
S as isAttributeConfirmed,
|
|
141
|
+
h as isAttributeConfirming,
|
|
142
|
+
a as isAttributeUnconfirmed,
|
|
143
|
+
I as isCanonResolveSubstatusNotFound,
|
|
144
|
+
O as isChannelCanonResolveNotFound,
|
|
145
|
+
k as isContactAttributeStatus,
|
|
146
|
+
j as needsAttributeConfirmation,
|
|
147
|
+
_ as shouldShowAttributeCheckmark,
|
|
148
|
+
z as shouldShowAttributeIndicator,
|
|
149
|
+
v as shouldShowAttributeStatusIndicator,
|
|
150
|
+
M as shouldShowAttributeUnconfirmedIndicator,
|
|
151
|
+
D as shouldShowBlockedIndicatorSlot,
|
|
152
|
+
$ as useCommunicationAttributes
|
|
98
153
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed as c, unref as i } from "vue";
|
|
2
|
-
/* empty css
|
|
2
|
+
/* empty css */
|
|
3
3
|
import M from "../icons/CommunicationPanelPhoneIcon.vue.js";
|
|
4
4
|
import b from "../icons/CommunicationPanelWhatsAppIcon.vue.js";
|
|
5
5
|
import w from "../icons/CommunicationPanelTelegramIcon.vue.js";
|
|
@@ -1,31 +1,45 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
panelRef:
|
|
4
|
-
selectedChannelType:
|
|
5
|
-
frozenAttribute:
|
|
1
|
+
import { ref as l, nextTick as f } from "vue";
|
|
2
|
+
function M({
|
|
3
|
+
panelRef: v,
|
|
4
|
+
selectedChannelType: d,
|
|
5
|
+
frozenAttribute: c
|
|
6
6
|
}) {
|
|
7
|
-
const
|
|
8
|
-
u.value = !1,
|
|
7
|
+
const n = l(null), h = l(null), u = l(!1), a = l(!1), s = l(!1), t = () => {
|
|
8
|
+
u.value = !1, n.value = null, c.value = null, a.value = !1;
|
|
9
|
+
}, C = () => {
|
|
10
|
+
s.value = !0, f(() => {
|
|
11
|
+
f(() => {
|
|
12
|
+
s.value = !1;
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}, i = (e) => {
|
|
16
|
+
n.value = e, u.value = !0, a.value = !1, c.value = null, C();
|
|
9
17
|
};
|
|
10
18
|
return {
|
|
11
|
-
activeChannelType:
|
|
12
|
-
hoveredChannel:
|
|
19
|
+
activeChannelType: n,
|
|
20
|
+
hoveredChannel: h,
|
|
13
21
|
showMenu: u,
|
|
14
22
|
showSubMenu: a,
|
|
15
23
|
handleChannelClick: (e) => {
|
|
16
|
-
if (
|
|
17
|
-
|
|
24
|
+
if (d.value === e && n.value === e) {
|
|
25
|
+
t();
|
|
18
26
|
return;
|
|
19
27
|
}
|
|
20
|
-
|
|
28
|
+
i(e);
|
|
21
29
|
},
|
|
22
|
-
|
|
30
|
+
openMenu: i,
|
|
31
|
+
closeMenu: t,
|
|
23
32
|
handleClickOutside: (e) => {
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
if (s.value)
|
|
34
|
+
return;
|
|
35
|
+
const o = v.value;
|
|
36
|
+
if (!o)
|
|
37
|
+
return;
|
|
38
|
+
const r = typeof e.composedPath == "function" ? e.composedPath() : [];
|
|
39
|
+
Array.isArray(r) && r.includes(o) || o.contains(e.target) || t();
|
|
26
40
|
}
|
|
27
41
|
};
|
|
28
42
|
}
|
|
29
43
|
export {
|
|
30
|
-
|
|
44
|
+
M as useCommunicationMenu
|
|
31
45
|
};
|
package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isAttributeUnconfirmed as f, needsAttributeConfirmation as d } from "./useCommunicationAttributes.js";
|
|
2
|
+
const c = /* @__PURE__ */ new Set(["whatsapp", "telegram", "max", "sms"]);
|
|
3
|
+
function h(t) {
|
|
4
|
+
return c.has(t);
|
|
5
|
+
}
|
|
6
|
+
function a(t, n) {
|
|
7
|
+
if (!n || !t.length)
|
|
8
|
+
return;
|
|
9
|
+
const l = n.includes(".") ? n.split(".").pop() : n;
|
|
10
|
+
return t.find((r) => {
|
|
11
|
+
const i = r.id ?? r.attributeId;
|
|
12
|
+
return !i || typeof i != "string" ? !1 : i === n || i === l || i.endsWith(`.${l}`);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function m(t, n, l, r) {
|
|
16
|
+
const i = r(t);
|
|
17
|
+
if (n != null && n.channelId) {
|
|
18
|
+
const s = i.find((e) => e.channelId === n.channelId);
|
|
19
|
+
if (s)
|
|
20
|
+
return s.channelId;
|
|
21
|
+
}
|
|
22
|
+
if (i.length === 1)
|
|
23
|
+
return i[0].channelId;
|
|
24
|
+
const o = l(t);
|
|
25
|
+
return (o == null ? void 0 : o.channelId) ?? null;
|
|
26
|
+
}
|
|
27
|
+
function I(t, n, l, r, i) {
|
|
28
|
+
if (!h(t))
|
|
29
|
+
return null;
|
|
30
|
+
const o = n == null ? void 0 : n[t], s = m(
|
|
31
|
+
t,
|
|
32
|
+
o,
|
|
33
|
+
r,
|
|
34
|
+
i
|
|
35
|
+
);
|
|
36
|
+
if (!s)
|
|
37
|
+
return null;
|
|
38
|
+
const e = l[t] ?? [];
|
|
39
|
+
if (e.some(f))
|
|
40
|
+
return null;
|
|
41
|
+
const u = a(e, o == null ? void 0 : o.attributeId) ?? (e.length === 1 ? e[0] : void 0);
|
|
42
|
+
return !u || d(u) ? null : { attribute: u, channelId: s };
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
h as isOneClickChannelType,
|
|
46
|
+
I as resolveRecentChannelSelection
|
|
47
|
+
};
|
package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createElementBlock as t, openBlock as i, createStaticVNode as e } from "vue";
|
|
2
|
+
import n from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const o = {}, c = {
|
|
4
|
+
width: "16",
|
|
5
|
+
height: "16",
|
|
6
|
+
viewBox: "0 0 16 16",
|
|
7
|
+
fill: "none",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
};
|
|
11
|
+
function r(l, C) {
|
|
12
|
+
return i(), t("svg", c, [...C[0] || (C[0] = [
|
|
13
|
+
e('<g clip-path="url(#communication-panel-unconfirmed-icon-clip)"><path d="M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z" fill="#F84932"></path><path d="M7 10.9991C7 10.8678 7.02587 10.7378 7.07612 10.6165C7.12638 10.4951 7.20003 10.3849 7.29289 10.292C7.38575 10.1992 7.49599 10.1255 7.61732 10.0753C7.73864 10.025 7.86868 9.99914 8 9.99914C8.13132 9.99914 8.26136 10.025 8.38268 10.0753C8.50401 10.1255 8.61425 10.1992 8.70711 10.292C8.79997 10.3849 8.87362 10.4951 8.92388 10.6165C8.97413 10.7378 9 10.8678 9 10.9991C9 11.2644 8.89464 11.5187 8.70711 11.7062C8.51957 11.8938 8.26522 11.9991 8 11.9991C7.73478 11.9991 7.48043 11.8938 7.29289 11.7062C7.10536 11.5187 7 11.2644 7 10.9991ZM7.098 4.99414C7.08468 4.86798 7.09804 4.74043 7.1372 4.61977C7.17636 4.4991 7.24045 4.38802 7.32532 4.29373C7.41018 4.19943 7.51392 4.12403 7.62981 4.07242C7.7457 4.02081 7.87114 3.99414 7.998 3.99414C8.12486 3.99414 8.2503 4.02081 8.36619 4.07242C8.48208 4.12403 8.58582 4.19943 8.67068 4.29373C8.75555 4.38802 8.81964 4.4991 8.8588 4.61977C8.89796 4.74043 8.91132 4.86798 8.898 4.99414L8.548 8.50114C8.53624 8.63891 8.4732 8.76725 8.37136 8.86078C8.26951 8.9543 8.13627 9.00619 7.998 9.00619C7.85973 9.00619 7.72649 8.9543 7.62464 8.86078C7.5228 8.76725 7.45976 8.63891 7.448 8.50114L7.098 4.99414Z" fill="#F84932"></path></g><defs><clipPath id="communication-panel-unconfirmed-icon-clip"><rect width="16" height="16" fill="white"></rect></clipPath></defs>', 2)
|
|
14
|
+
])]);
|
|
15
|
+
}
|
|
16
|
+
const d = /* @__PURE__ */ n(o, [["render", r]]);
|
|
17
|
+
export {
|
|
18
|
+
d as default
|
|
19
|
+
};
|