@mobilon-dev/chotto 0.3.49 → 0.3.50
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 +223 -200
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationPlaceholder.js +31 -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/composables/useCommunicationChannels.d.ts +1 -1
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationPlaceholder.d.ts +37 -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 +18 -0
- package/package.json +1 -1
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
3
|
-
import { useCommunicationChannels as
|
|
4
|
-
import { useCommunicationMenu as
|
|
5
|
-
import { useCommunicationAttributes as
|
|
6
|
-
import { useCommunicationActions as
|
|
7
|
-
import { useCommunicationSubMenu as
|
|
8
|
-
import { useCommunicationDialogSync as
|
|
1
|
+
import { ref as h, computed as d, watch as Oe, onMounted as $e, onUnmounted as je, createElementBlock as l, openBlock as o, createElementVNode as u, createCommentVNode as m, Fragment as H, renderList as G, unref as e, normalizeClass as f, createBlock as v, createVNode as Be, withCtx as J, resolveDynamicComponent as A, normalizeStyle as he, toDisplayString as R, nextTick as Fe } from "vue";
|
|
2
|
+
import K from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
3
|
+
import { useCommunicationChannels as We } from "./composables/useCommunicationChannels.js";
|
|
4
|
+
import { useCommunicationMenu as Ve } from "./composables/useCommunicationMenu.js";
|
|
5
|
+
import { useCommunicationAttributes as Ue } from "./composables/useCommunicationAttributes.js";
|
|
6
|
+
import { useCommunicationActions as Ge } from "./composables/useCommunicationActions.js";
|
|
7
|
+
import { useCommunicationSubMenu as Je } from "./composables/useCommunicationSubMenu.js";
|
|
8
|
+
import { useCommunicationDialogSync as Ke } from "./composables/useCommunicationDialogSync.js";
|
|
9
|
+
import { useCommunicationPlaceholder as Qe } from "./composables/useCommunicationPlaceholder.js";
|
|
9
10
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
const
|
|
11
|
+
import Xe from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
12
|
+
const Ye = ["onClick", "onMouseenter"], Ze = { class: "channel-icon" }, et = { class: "channel-icon" }, tt = {
|
|
12
13
|
key: 0,
|
|
13
14
|
class: "menu-header"
|
|
14
|
-
},
|
|
15
|
+
}, nt = { class: "attribute-info" }, ot = { class: "attribute-value" }, st = { class: "attribute-info" }, lt = { class: "attribute-value" }, at = {
|
|
15
16
|
key: 3,
|
|
16
17
|
class: "menu-divider"
|
|
17
|
-
},
|
|
18
|
+
}, it = {
|
|
19
|
+
key: 4,
|
|
20
|
+
class: "empty-channels-placeholder"
|
|
21
|
+
}, ut = ["onMouseenter", "onClick"], rt = { class: "attribute-info" }, ct = { class: "attribute-value" }, dt = { class: "menu-icon" }, mt = {
|
|
18
22
|
key: 0,
|
|
19
23
|
class: "menu-icon-arrow"
|
|
20
|
-
},
|
|
24
|
+
}, ht = ["onClick"], pt = { class: "sub-menu-title" }, ft = {
|
|
21
25
|
__name: "CommunicationPanel",
|
|
22
26
|
props: {
|
|
23
27
|
contactAttributes: {
|
|
@@ -64,46 +68,51 @@ const Ke = ["onClick", "onMouseenter"], Qe = { class: "channel-icon" }, Xe = { c
|
|
|
64
68
|
type: Boolean,
|
|
65
69
|
required: !1,
|
|
66
70
|
default: !1
|
|
71
|
+
},
|
|
72
|
+
emptyChannelsPlaceholder: {
|
|
73
|
+
type: Object,
|
|
74
|
+
required: !1,
|
|
75
|
+
default: () => ({})
|
|
67
76
|
}
|
|
68
77
|
},
|
|
69
78
|
emits: ["select-attribute-channel", "phone-call"],
|
|
70
|
-
setup(g, { emit:
|
|
71
|
-
const r = g,
|
|
72
|
-
channelsTypes:
|
|
73
|
-
getTooltipText:
|
|
74
|
-
getChannelTypeFromId:
|
|
75
|
-
hasMultipleChannels:
|
|
76
|
-
isChannelActive:
|
|
77
|
-
getSingleChannelForType:
|
|
78
|
-
getMenuChannelIconComponent:
|
|
79
|
-
getMenuChannelIconComponentForChannelId:
|
|
80
|
-
getSingleMenuChannelIconComponent:
|
|
81
|
-
getAvailableChannels:
|
|
82
|
-
} =
|
|
83
|
-
channels:
|
|
84
|
-
channelTooltips:
|
|
85
|
-
selectedChannelType:
|
|
79
|
+
setup(g, { emit: pe }) {
|
|
80
|
+
const r = g, fe = pe, I = h(null), Q = h(null), O = h(null), $ = h(null), M = h(!1), S = h(null), j = h({}), y = h(!1), D = h(null), p = h(null), E = d(() => r.channels ?? []), ve = d(() => r.channelTooltips ?? {}), X = d(() => r.messages ?? []), ye = d(() => r.selectedChat ?? null), Y = d(() => r.isNewDialog ?? !1), {
|
|
81
|
+
channelsTypes: Ce,
|
|
82
|
+
getTooltipText: be,
|
|
83
|
+
getChannelTypeFromId: Z,
|
|
84
|
+
hasMultipleChannels: _,
|
|
85
|
+
isChannelActive: x,
|
|
86
|
+
getSingleChannelForType: Ae,
|
|
87
|
+
getMenuChannelIconComponent: ee,
|
|
88
|
+
getMenuChannelIconComponentForChannelId: ge,
|
|
89
|
+
getSingleMenuChannelIconComponent: Me,
|
|
90
|
+
getAvailableChannels: te
|
|
91
|
+
} = We({
|
|
92
|
+
channels: E,
|
|
93
|
+
channelTooltips: ve,
|
|
94
|
+
selectedChannelType: S
|
|
86
95
|
}), {
|
|
87
96
|
activeChannelType: s,
|
|
88
|
-
hoveredChannel:
|
|
89
|
-
showMenu:
|
|
90
|
-
showSubMenu:
|
|
91
|
-
menuWidth:
|
|
92
|
-
updateMenuWidth:
|
|
93
|
-
handleChannelClick:
|
|
94
|
-
closeMenu:
|
|
95
|
-
handleClickOutside:
|
|
96
|
-
} =
|
|
97
|
-
panelRef:
|
|
98
|
-
channelsPanelRef:
|
|
99
|
-
selectedChannelType:
|
|
97
|
+
hoveredChannel: z,
|
|
98
|
+
showMenu: ne,
|
|
99
|
+
showSubMenu: B,
|
|
100
|
+
menuWidth: ke,
|
|
101
|
+
updateMenuWidth: F,
|
|
102
|
+
handleChannelClick: Te,
|
|
103
|
+
closeMenu: we,
|
|
104
|
+
handleClickOutside: oe
|
|
105
|
+
} = Ve({
|
|
106
|
+
panelRef: I,
|
|
107
|
+
channelsPanelRef: Q,
|
|
108
|
+
selectedChannelType: S,
|
|
100
109
|
frozenAttribute: $,
|
|
101
|
-
isRecentAttributeHovered:
|
|
102
|
-
}),
|
|
103
|
-
var
|
|
104
|
-
if (!i || !
|
|
105
|
-
const n = (
|
|
106
|
-
return n ? !
|
|
110
|
+
isRecentAttributeHovered: M
|
|
111
|
+
}), Re = d(() => r.contactAttributes ?? []), W = d(() => r.recentAttributeChannels ?? {}), se = (i) => {
|
|
112
|
+
var T;
|
|
113
|
+
if (!i || !X.value) return !0;
|
|
114
|
+
const n = (T = ye.value) == null ? void 0 : T.chatId;
|
|
115
|
+
return n ? !X.value.filter(
|
|
107
116
|
(c) => {
|
|
108
117
|
var t;
|
|
109
118
|
return c.chatId === n && c.dialogId === ((t = r.selectedDialog) == null ? void 0 : t.dialogId);
|
|
@@ -111,264 +120,278 @@ const Ke = ["onClick", "onMouseenter"], Qe = { class: "channel-icon" }, Xe = { c
|
|
|
111
120
|
).some(
|
|
112
121
|
(c) => c.type !== "message.system" && c.type !== "message.delimiter" && c.type !== "system" && c.type !== "system_message" && c.type !== "notification"
|
|
113
122
|
) : !0;
|
|
114
|
-
},
|
|
115
|
-
|
|
123
|
+
}, le = () => {
|
|
124
|
+
q(), y.value = !0, Fe(() => {
|
|
116
125
|
const i = Array.isArray(p.value) ? p.value[0] : p.value;
|
|
117
126
|
i && typeof i.startAutoShow == "function" ? i.startAutoShow() : console.log("startAutoShow method not found on tooltipRef");
|
|
118
|
-
}),
|
|
127
|
+
}), D.value = setTimeout(() => {
|
|
119
128
|
y.value = !1;
|
|
120
129
|
}, 5e3);
|
|
121
|
-
},
|
|
122
|
-
if (
|
|
130
|
+
}, q = () => {
|
|
131
|
+
if (D.value && (clearTimeout(D.value), D.value = null), p.value) {
|
|
123
132
|
const i = Array.isArray(p.value) ? p.value[0] : p.value;
|
|
124
133
|
i && typeof i.clearAutoTimer == "function" && i.clearAutoTimer();
|
|
125
134
|
}
|
|
126
135
|
y.value = !1;
|
|
127
136
|
}, {
|
|
128
|
-
organizedContactAttributes:
|
|
129
|
-
organizeContactAttributes:
|
|
130
|
-
recentAttribute:
|
|
131
|
-
showRecentAttribute:
|
|
132
|
-
isAttributeFrozen:
|
|
133
|
-
} =
|
|
134
|
-
contactAttributes:
|
|
135
|
-
recentAttributeChannels:
|
|
137
|
+
organizedContactAttributes: V,
|
|
138
|
+
organizeContactAttributes: Ie,
|
|
139
|
+
recentAttribute: N,
|
|
140
|
+
showRecentAttribute: k,
|
|
141
|
+
isAttributeFrozen: Se
|
|
142
|
+
} = Ue({
|
|
143
|
+
contactAttributes: Re,
|
|
144
|
+
recentAttributeChannels: W,
|
|
136
145
|
activeChannelType: s,
|
|
137
146
|
frozenAttribute: $
|
|
138
147
|
}), {
|
|
139
|
-
handleRecentAttributeClick:
|
|
140
|
-
handleAttributeClick:
|
|
141
|
-
selectChannel:
|
|
148
|
+
handleRecentAttributeClick: De,
|
|
149
|
+
handleAttributeClick: Ee,
|
|
150
|
+
selectChannel: _e,
|
|
142
151
|
availableChannels: xe
|
|
143
|
-
} =
|
|
152
|
+
} = Ge({
|
|
144
153
|
activeChannelType: s,
|
|
145
|
-
channels:
|
|
146
|
-
recentAttributeChannels:
|
|
147
|
-
selectedChannel:
|
|
148
|
-
selectedChannelType:
|
|
149
|
-
isRecentAttributeHovered:
|
|
150
|
-
hoveredAttribute:
|
|
151
|
-
closeMenu:
|
|
152
|
-
hasMultipleChannels:
|
|
153
|
-
getSingleChannelForType:
|
|
154
|
-
getAvailableChannels:
|
|
155
|
-
isChannelEmpty:
|
|
156
|
-
isNewDialog:
|
|
157
|
-
showDefaultChannelTooltipWithTimer:
|
|
158
|
-
clearDefaultChannelTooltip:
|
|
159
|
-
emit:
|
|
160
|
-
}),
|
|
161
|
-
|
|
154
|
+
channels: E,
|
|
155
|
+
recentAttributeChannels: W,
|
|
156
|
+
selectedChannel: j,
|
|
157
|
+
selectedChannelType: S,
|
|
158
|
+
isRecentAttributeHovered: M,
|
|
159
|
+
hoveredAttribute: O,
|
|
160
|
+
closeMenu: we,
|
|
161
|
+
hasMultipleChannels: _,
|
|
162
|
+
getSingleChannelForType: Ae,
|
|
163
|
+
getAvailableChannels: te,
|
|
164
|
+
isChannelEmpty: se,
|
|
165
|
+
isNewDialog: Y,
|
|
166
|
+
showDefaultChannelTooltipWithTimer: le,
|
|
167
|
+
clearDefaultChannelTooltip: q,
|
|
168
|
+
emit: fe
|
|
169
|
+
}), ae = () => {
|
|
170
|
+
De(N.value);
|
|
162
171
|
}, {
|
|
163
|
-
subMenuTop:
|
|
164
|
-
resetRegularAttributeHover:
|
|
165
|
-
handleRecentAttributeMouseEnter:
|
|
166
|
-
handleRecentAttributeMouseLeave:
|
|
172
|
+
subMenuTop: ze,
|
|
173
|
+
resetRegularAttributeHover: P,
|
|
174
|
+
handleRecentAttributeMouseEnter: qe,
|
|
175
|
+
handleRecentAttributeMouseLeave: L,
|
|
167
176
|
handleAttributeMouseEnter: Ne,
|
|
168
|
-
handleAttributeMouseLeave:
|
|
169
|
-
keepSubMenuOpen:
|
|
170
|
-
closeSubMenu:
|
|
171
|
-
alignSubMenuWithTarget:
|
|
172
|
-
} =
|
|
177
|
+
handleAttributeMouseLeave: ie,
|
|
178
|
+
keepSubMenuOpen: ue,
|
|
179
|
+
closeSubMenu: re,
|
|
180
|
+
alignSubMenuWithTarget: ce
|
|
181
|
+
} = Je({
|
|
173
182
|
activeChannelType: s,
|
|
174
|
-
showSubMenu:
|
|
183
|
+
showSubMenu: B,
|
|
175
184
|
frozenAttribute: $,
|
|
176
|
-
hoveredAttribute:
|
|
177
|
-
isRecentAttributeHovered:
|
|
178
|
-
hasMultipleChannels:
|
|
185
|
+
hoveredAttribute: O,
|
|
186
|
+
isRecentAttributeHovered: M,
|
|
187
|
+
hasMultipleChannels: _
|
|
179
188
|
});
|
|
180
|
-
|
|
181
|
-
selectedChannelType:
|
|
182
|
-
selectedChannel:
|
|
183
|
-
channels:
|
|
184
|
-
selectedDialog:
|
|
185
|
-
isChannelEmpty:
|
|
186
|
-
isNewDialog:
|
|
187
|
-
showDefaultChannelTooltipWithTimer:
|
|
188
|
-
clearDefaultChannelTooltip:
|
|
189
|
+
Ke({
|
|
190
|
+
selectedChannelType: S,
|
|
191
|
+
selectedChannel: j,
|
|
192
|
+
channels: E,
|
|
193
|
+
selectedDialog: d(() => r.selectedDialog ?? null),
|
|
194
|
+
isChannelEmpty: se,
|
|
195
|
+
isNewDialog: Y,
|
|
196
|
+
showDefaultChannelTooltipWithTimer: le,
|
|
197
|
+
clearDefaultChannelTooltip: q
|
|
189
198
|
});
|
|
190
|
-
const
|
|
199
|
+
const {
|
|
200
|
+
emptyChannelsPlaceholderText: Pe,
|
|
201
|
+
shouldShowEmptyChannelsPlaceholder: C
|
|
202
|
+
} = Qe({
|
|
203
|
+
showMenu: ne,
|
|
204
|
+
activeChannelType: s,
|
|
205
|
+
emptyChannelsPlaceholder: d(() => r.emptyChannelsPlaceholder ?? {}),
|
|
206
|
+
getAvailableChannels: te,
|
|
207
|
+
getChannelTypeFromId: Z,
|
|
208
|
+
channels: E,
|
|
209
|
+
recentAttributeChannels: W,
|
|
210
|
+
organizedContactAttributes: V,
|
|
211
|
+
showRecentAttribute: k
|
|
212
|
+
}), de = d(
|
|
191
213
|
() => xe()
|
|
192
|
-
),
|
|
193
|
-
() =>
|
|
194
|
-
),
|
|
195
|
-
const n =
|
|
196
|
-
n instanceof HTMLElement &&
|
|
197
|
-
},
|
|
214
|
+
), Le = d(
|
|
215
|
+
() => B.value && O.value && de.value.length > 0 && s.value !== "phone" && _(s.value)
|
|
216
|
+
), me = (i) => {
|
|
217
|
+
const n = qe(i.currentTarget);
|
|
218
|
+
n instanceof HTMLElement && ce(I, n);
|
|
219
|
+
}, He = (i, n) => {
|
|
198
220
|
const b = Ne(i, n.currentTarget);
|
|
199
|
-
b instanceof HTMLElement &&
|
|
221
|
+
b instanceof HTMLElement && ce(I, b);
|
|
200
222
|
};
|
|
201
|
-
return
|
|
223
|
+
return Oe(() => r.selectedDialog, () => {
|
|
202
224
|
}, { deep: !0 }), $e(() => {
|
|
203
|
-
|
|
204
|
-
}),
|
|
205
|
-
window.removeEventListener("resize",
|
|
225
|
+
F(), window.addEventListener("resize", F), document.addEventListener("click", oe), Ie();
|
|
226
|
+
}), je(() => {
|
|
227
|
+
window.removeEventListener("resize", F), document.removeEventListener("click", oe), q();
|
|
206
228
|
}), (i, n) => {
|
|
207
|
-
var b,
|
|
229
|
+
var b, U, T, c;
|
|
208
230
|
return o(), l("div", {
|
|
209
231
|
ref_key: "panelRef",
|
|
210
|
-
ref:
|
|
232
|
+
ref: I,
|
|
211
233
|
class: "communication-panel"
|
|
212
234
|
}, [
|
|
213
235
|
u("div", {
|
|
214
236
|
ref_key: "channelsPanelRef",
|
|
215
|
-
ref:
|
|
237
|
+
ref: Q,
|
|
216
238
|
class: "channels-panel"
|
|
217
239
|
}, [
|
|
218
|
-
(o(!0), l(
|
|
240
|
+
(o(!0), l(H, null, G(e(Ce), (t) => {
|
|
219
241
|
var a;
|
|
220
242
|
return o(), l("button", {
|
|
221
243
|
key: t.type,
|
|
222
|
-
class:
|
|
223
|
-
active: e(
|
|
224
|
-
hover: e(
|
|
244
|
+
class: f(["channel-btn", {
|
|
245
|
+
active: e(x)(t.type),
|
|
246
|
+
hover: e(z) === t.type && !e(x)(t.type) || e(z) === t.type && e(x)(t.type)
|
|
225
247
|
}]),
|
|
226
|
-
onClick: (
|
|
227
|
-
onMouseenter: (
|
|
228
|
-
onMouseleave: n[0] || (n[0] = (
|
|
248
|
+
onClick: (w) => e(Te)(t.type),
|
|
249
|
+
onMouseenter: (w) => z.value = t.type,
|
|
250
|
+
onMouseleave: n[0] || (n[0] = (w) => z.value = null)
|
|
229
251
|
}, [
|
|
230
|
-
e(
|
|
231
|
-
Be(
|
|
252
|
+
e(x)(t.type) ? (o(), l(H, { key: 0 }, [
|
|
253
|
+
Be(K, {
|
|
232
254
|
ref_for: !0,
|
|
233
|
-
ref: (
|
|
234
|
-
|
|
255
|
+
ref: (w) => {
|
|
256
|
+
w && (p.value = w);
|
|
235
257
|
},
|
|
236
|
-
text: y.value ? "Выбран канал по умолчанию, можно изменить в настройках профиля" : (a =
|
|
258
|
+
text: y.value ? "Выбран канал по умолчанию, можно изменить в настройках профиля" : (a = j.value) == null ? void 0 : a.title,
|
|
237
259
|
position: "bottom-left",
|
|
238
260
|
offset: 8,
|
|
239
261
|
trigger: y.value ? "auto" : "hover",
|
|
240
262
|
"auto-show-duration": y.value ? 5e3 : 0
|
|
241
263
|
}, {
|
|
242
|
-
default:
|
|
243
|
-
u("span",
|
|
244
|
-
(o(),
|
|
264
|
+
default: J(() => [
|
|
265
|
+
u("span", Ze, [
|
|
266
|
+
(o(), v(A(t.component)))
|
|
245
267
|
])
|
|
246
268
|
]),
|
|
247
269
|
_: 2
|
|
248
270
|
}, 1032, ["text", "trigger", "auto-show-duration"]),
|
|
249
271
|
n[12] || (n[12] = u("span", { class: "active-indicator" }, null, -1))
|
|
250
|
-
], 64)) : (o(),
|
|
272
|
+
], 64)) : (o(), v(K, {
|
|
251
273
|
key: 1,
|
|
252
|
-
text: e(
|
|
274
|
+
text: e(be)(t.type),
|
|
253
275
|
position: "bottom-left",
|
|
254
276
|
offset: 8
|
|
255
277
|
}, {
|
|
256
|
-
default:
|
|
257
|
-
u("span",
|
|
258
|
-
(o(),
|
|
278
|
+
default: J(() => [
|
|
279
|
+
u("span", et, [
|
|
280
|
+
(o(), v(A(t.component)))
|
|
259
281
|
])
|
|
260
282
|
]),
|
|
261
283
|
_: 2
|
|
262
284
|
}, 1032, ["text"]))
|
|
263
|
-
], 42,
|
|
285
|
+
], 42, Ye);
|
|
264
286
|
}), 128))
|
|
265
287
|
], 512),
|
|
266
|
-
e(
|
|
288
|
+
e(ne) && e(s) ? (o(), l("div", {
|
|
267
289
|
key: 0,
|
|
268
290
|
class: "attributes-menu",
|
|
269
|
-
style:
|
|
291
|
+
style: he({ width: e(ke) })
|
|
270
292
|
}, [
|
|
271
|
-
e(
|
|
272
|
-
e(
|
|
293
|
+
e(k) && !e(C) ? (o(), l("div", tt, " Недавний ")) : m("", !0),
|
|
294
|
+
e(k) && !e(C) && ((b = r.recentAttributeChannels[e(s)]) != null && b.tooltip) ? (o(), v(K, {
|
|
273
295
|
key: 1,
|
|
274
|
-
text: (
|
|
296
|
+
text: (U = r.recentAttributeChannels[e(s)]) == null ? void 0 : U.tooltip,
|
|
275
297
|
position: "bottom",
|
|
276
298
|
offset: 8
|
|
277
299
|
}, {
|
|
278
|
-
default:
|
|
300
|
+
default: J(() => {
|
|
279
301
|
var t;
|
|
280
302
|
return [
|
|
281
303
|
u("div", {
|
|
282
|
-
class:
|
|
283
|
-
"frozen-hover":
|
|
304
|
+
class: f(["recent-attribute", {
|
|
305
|
+
"frozen-hover": M.value
|
|
284
306
|
}]),
|
|
285
|
-
onMouseenter: n[1] || (n[1] = (a) =>
|
|
286
|
-
onMouseleave: n[2] || (n[2] = (...a) => e(
|
|
287
|
-
onMouseover: n[3] || (n[3] = (...a) => e(
|
|
288
|
-
onClick: n[4] || (n[4] = (a) =>
|
|
307
|
+
onMouseenter: n[1] || (n[1] = (a) => me(a)),
|
|
308
|
+
onMouseleave: n[2] || (n[2] = (...a) => e(L) && e(L)(...a)),
|
|
309
|
+
onMouseover: n[3] || (n[3] = (...a) => e(P) && e(P)(...a)),
|
|
310
|
+
onClick: n[4] || (n[4] = (a) => ae())
|
|
289
311
|
}, [
|
|
290
|
-
u("div",
|
|
291
|
-
u("span",
|
|
312
|
+
u("div", nt, [
|
|
313
|
+
u("span", ot, R((t = e(N)) == null ? void 0 : t.value), 1)
|
|
292
314
|
]),
|
|
293
315
|
g.showChannelIcons ? (o(), l("span", {
|
|
294
316
|
key: 0,
|
|
295
|
-
class:
|
|
317
|
+
class: f(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
|
|
296
318
|
}, [
|
|
297
|
-
(o(),
|
|
298
|
-
], 2)) :
|
|
319
|
+
(o(), v(A(e(ee)(e(s)))))
|
|
320
|
+
], 2)) : m("", !0)
|
|
299
321
|
], 34)
|
|
300
322
|
];
|
|
301
323
|
}),
|
|
302
324
|
_: 1
|
|
303
|
-
}, 8, ["text"])) : e(
|
|
325
|
+
}, 8, ["text"])) : e(k) && !e(C) ? (o(), l("div", {
|
|
304
326
|
key: 2,
|
|
305
|
-
class:
|
|
306
|
-
"frozen-hover":
|
|
327
|
+
class: f(["recent-attribute", {
|
|
328
|
+
"frozen-hover": M.value
|
|
307
329
|
}]),
|
|
308
|
-
onMouseenter: n[5] || (n[5] = (t) =>
|
|
309
|
-
onMouseleave: n[6] || (n[6] = (...t) => e(
|
|
310
|
-
onMouseover: n[7] || (n[7] = (...t) => e(
|
|
311
|
-
onClick: n[8] || (n[8] = (t) =>
|
|
330
|
+
onMouseenter: n[5] || (n[5] = (t) => me(t)),
|
|
331
|
+
onMouseleave: n[6] || (n[6] = (...t) => e(L) && e(L)(...t)),
|
|
332
|
+
onMouseover: n[7] || (n[7] = (...t) => e(P) && e(P)(...t)),
|
|
333
|
+
onClick: n[8] || (n[8] = (t) => ae(e(N)))
|
|
312
334
|
}, [
|
|
313
|
-
u("div",
|
|
314
|
-
u("span",
|
|
335
|
+
u("div", st, [
|
|
336
|
+
u("span", lt, R((T = e(N)) == null ? void 0 : T.value), 1)
|
|
315
337
|
]),
|
|
316
338
|
g.showChannelIcons ? (o(), l("span", {
|
|
317
339
|
key: 0,
|
|
318
|
-
class:
|
|
340
|
+
class: f(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
|
|
319
341
|
}, [
|
|
320
|
-
(o(),
|
|
321
|
-
], 2)) :
|
|
322
|
-
], 34)) :
|
|
323
|
-
e(
|
|
324
|
-
(o(
|
|
342
|
+
(o(), v(A(e(ee)(e(s)))))
|
|
343
|
+
], 2)) : m("", !0)
|
|
344
|
+
], 34)) : m("", !0),
|
|
345
|
+
e(k) && !e(C) && ((c = e(V)[e(s)]) != null && c.length) && e(s) !== "phone" ? (o(), l("div", at)) : m("", !0),
|
|
346
|
+
e(C) ? (o(), l("div", it, R(e(Pe)), 1)) : m("", !0),
|
|
347
|
+
e(C) ? m("", !0) : (o(!0), l(H, { key: 5 }, G(e(V)[e(s)], (t) => (o(), l("div", {
|
|
325
348
|
key: t.attributeId,
|
|
326
|
-
class:
|
|
327
|
-
"frozen-hover": e(
|
|
349
|
+
class: f(["attribute-item", {
|
|
350
|
+
"frozen-hover": e(Se)(t)
|
|
328
351
|
}]),
|
|
329
|
-
onMouseenter: (a) =>
|
|
330
|
-
onMouseleave: n[9] || (n[9] = (...a) => e(
|
|
331
|
-
onClick: (a) => e(
|
|
352
|
+
onMouseenter: (a) => He(t, a),
|
|
353
|
+
onMouseleave: n[9] || (n[9] = (...a) => e(ie) && e(ie)(...a)),
|
|
354
|
+
onClick: (a) => e(Ee)(t)
|
|
332
355
|
}, [
|
|
333
|
-
u("div",
|
|
334
|
-
u("span",
|
|
356
|
+
u("div", rt, [
|
|
357
|
+
u("span", ct, R(t.value), 1)
|
|
335
358
|
]),
|
|
336
|
-
u("span",
|
|
337
|
-
e(
|
|
359
|
+
u("span", dt, [
|
|
360
|
+
e(_)(e(s)) ? (o(), l("span", mt)) : g.showChannelIcons ? (o(), l("span", {
|
|
338
361
|
key: 1,
|
|
339
|
-
class:
|
|
362
|
+
class: f(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
|
|
340
363
|
}, [
|
|
341
|
-
(o(),
|
|
342
|
-
], 2)) :
|
|
364
|
+
(o(), v(A(e(Me)(e(s)))))
|
|
365
|
+
], 2)) : m("", !0)
|
|
343
366
|
])
|
|
344
|
-
], 42,
|
|
345
|
-
e(
|
|
346
|
-
key:
|
|
367
|
+
], 42, ut))), 128)),
|
|
368
|
+
e(B) && Le.value ? (o(), l("div", {
|
|
369
|
+
key: 6,
|
|
347
370
|
class: "sub-menu left",
|
|
348
|
-
style:
|
|
349
|
-
onMouseenter: n[10] || (n[10] = (...t) => e(
|
|
350
|
-
onMouseleave: n[11] || (n[11] = (...t) => e(
|
|
371
|
+
style: he({ top: e(ze) + "px" }),
|
|
372
|
+
onMouseenter: n[10] || (n[10] = (...t) => e(ue) && e(ue)(...t)),
|
|
373
|
+
onMouseleave: n[11] || (n[11] = (...t) => e(re) && e(re)(...t))
|
|
351
374
|
}, [
|
|
352
375
|
n[13] || (n[13] = u("div", { class: "sub-menu-header" }, " Канал связи ", -1)),
|
|
353
|
-
(o(!0), l(
|
|
376
|
+
(o(!0), l(H, null, G(de.value, (t) => (o(), l("div", {
|
|
354
377
|
key: t.channelId,
|
|
355
378
|
class: "sub-menu-item",
|
|
356
|
-
onClick: (a) => e(
|
|
379
|
+
onClick: (a) => e(_e)(t.channelId)
|
|
357
380
|
}, [
|
|
358
|
-
u("span",
|
|
381
|
+
u("span", pt, R(t.title || t.channelId), 1),
|
|
359
382
|
g.showChannelIcons ? (o(), l("span", {
|
|
360
383
|
key: 0,
|
|
361
|
-
class:
|
|
384
|
+
class: f(["sub-menu-icon", { "menu-icon-grey": e(Z)(t.channelId) !== "sms" }])
|
|
362
385
|
}, [
|
|
363
|
-
(o(),
|
|
364
|
-
], 2)) :
|
|
365
|
-
], 8,
|
|
366
|
-
], 36)) :
|
|
367
|
-
], 4)) :
|
|
386
|
+
(o(), v(A(e(ge)(t.channelId))))
|
|
387
|
+
], 2)) : m("", !0)
|
|
388
|
+
], 8, ht))), 128))
|
|
389
|
+
], 36)) : m("", !0)
|
|
390
|
+
], 4)) : m("", !0)
|
|
368
391
|
], 512);
|
|
369
392
|
};
|
|
370
393
|
}
|
|
371
|
-
},
|
|
394
|
+
}, It = /* @__PURE__ */ Xe(ft, [["__scopeId", "data-v-8aa7a6b7"]]);
|
|
372
395
|
export {
|
|
373
|
-
|
|
396
|
+
It as default
|
|
374
397
|
};
|
package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationPlaceholder.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { computed as n, unref as l } from "vue";
|
|
2
|
+
function x({
|
|
3
|
+
showMenu: c,
|
|
4
|
+
activeChannelType: e,
|
|
5
|
+
emptyChannelsPlaceholder: h,
|
|
6
|
+
getAvailableChannels: f,
|
|
7
|
+
getChannelTypeFromId: i,
|
|
8
|
+
channels: d,
|
|
9
|
+
recentAttributeChannels: v,
|
|
10
|
+
organizedContactAttributes: m,
|
|
11
|
+
showRecentAttribute: p
|
|
12
|
+
}) {
|
|
13
|
+
const r = n(() => l(h) ?? {}), C = n(() => l(d) ?? []), b = n(() => l(v) ?? {}), a = n(() => !e.value || !r.value ? null : r.value[e.value] || null), I = n(() => {
|
|
14
|
+
var o;
|
|
15
|
+
if (!c.value || !e.value || !a.value)
|
|
16
|
+
return !1;
|
|
17
|
+
const y = f(e.value).length === 0, u = m.value[e.value], A = !u || u.length === 0, F = !p.value;
|
|
18
|
+
if (y) {
|
|
19
|
+
const t = (o = b.value[e.value]) == null ? void 0 : o.channelId;
|
|
20
|
+
return !(t && C.value.find((s) => s.channelId === t) && i(t) === e.value);
|
|
21
|
+
}
|
|
22
|
+
return !!(A && F);
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
emptyChannelsPlaceholderText: a,
|
|
26
|
+
shouldShowEmptyChannelsPlaceholder: I
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
x as useCommunicationPlaceholder
|
|
31
|
+
};
|