@mobilon-dev/chotto 0.3.51 → 0.3.53

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.
Files changed (31) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/LoadingIndicator/LoadingIndicator.vue.js +33 -12
  3. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +246 -315
  4. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +32 -61
  5. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js +18 -41
  6. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.js +21 -22
  7. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationPlaceholder.js +13 -22
  8. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationSubMenu.js +34 -46
  9. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelCheckIcon.vue.js +19 -0
  10. package/dist/components/3_compounds/Feed/Feed.vue.js +1 -1
  11. package/dist/components/3_compounds/Feed/Feed.vue2.js +128 -118
  12. package/dist/themes/dark.css +1 -1
  13. package/dist/themes/default.css +1 -1
  14. package/dist/themes/glass.css +1 -1
  15. package/dist/themes/green.css +1 -1
  16. package/dist/themes/mobilon1.css +1 -1
  17. package/dist/types/components/1_atoms/LoadingIndicator/LoadingIndicator.vue.d.ts +4 -0
  18. package/dist/types/components/1_atoms/LoadingIndicator/styles/types.d.ts +6 -0
  19. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +0 -2
  20. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +2 -12
  21. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.d.ts +2 -17
  22. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts +1 -3
  23. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationPlaceholder.d.ts +1 -7
  24. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationSubMenu.d.ts +1 -5
  25. package/dist/types/components/2_blocks/CommunicationPanel/icons/CommunicationPanelCheckIcon.vue.d.ts +2 -0
  26. package/dist/types/components/2_blocks/CommunicationPanel/icons/index.d.ts +1 -0
  27. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +0 -2
  28. package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +30 -0
  29. package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +2 -2
  30. package/dist/types/components/3_compounds/Feed/styles/types.d.ts +1 -0
  31. package/package.json +1 -1
@@ -1,87 +1,58 @@
1
- function K({
2
- activeChannelType: a,
3
- channels: c,
4
- recentAttributeChannels: q,
5
- selectedChannel: i,
6
- selectedChannelType: e,
7
- isRecentAttributeHovered: z,
8
- hoveredAttribute: r,
9
- closeMenu: v,
10
- hasMultipleChannels: R,
11
- getSingleChannelForType: x,
12
- getAvailableChannels: B,
13
- isChannelEmpty: t,
14
- isNewDialog: s,
1
+ function P({
2
+ activeChannelType: l,
3
+ channels: i,
4
+ selectedChannel: r,
5
+ selectedChannelType: c,
6
+ hoveredAttribute: s,
7
+ closeMenu: u,
8
+ hasMultipleChannels: k,
9
+ getSingleChannelForType: A,
10
+ getAvailableChannels: C,
11
+ isChannelEmpty: v,
12
+ isNewDialog: f,
15
13
  showDefaultChannelTooltipWithTimer: d,
16
14
  clearDefaultChannelTooltip: o,
17
- emit: f
15
+ emit: t
18
16
  }) {
19
17
  const b = (n) => {
20
- n && (f("phone-call", {
18
+ n && (t("phone-call", {
21
19
  attributeId: n.id,
22
20
  phoneNumber: n.data
23
- }), v());
24
- }, k = (n, u) => {
25
- f("select-attribute-channel", {
21
+ }), u());
22
+ }, h = (n, e) => {
23
+ t("select-attribute-channel", {
26
24
  attributeId: n.id,
27
- channelId: u
28
- }), e.value = a.value, i.value = c.value.find((l) => l.channelId === u) ?? {}, t(u) && s.value ? d() : o(), v();
29
- }, I = (n, u) => {
30
- u && f("select-attribute-channel", {
31
- attributeId: u.id,
32
- channelId: n
33
- }), e.value = a.value, i.value = c.value.find((l) => l.channelId === n) ?? {}, t(n) && s.value ? d() : o(), v();
25
+ channelId: e
26
+ }), c.value = l.value, r.value = i.value.find((a) => a.channelId === e) ?? {}, v(e) && f.value ? d() : o(), u();
34
27
  };
35
28
  return {
36
29
  handlePhoneCall: b,
37
- handleRecentAttributeClick: (n) => {
38
- var P;
39
- const u = a.value;
40
- if (!u)
41
- return;
42
- if (u === "phone") {
43
- b(n);
44
- return;
45
- }
46
- if (!R(u)) {
47
- const j = x(u);
48
- n && j && k(n, j.channelId);
49
- return;
50
- }
51
- const l = (P = q.value[u]) == null ? void 0 : P.channelId;
52
- n && l && I(l, n);
53
- },
54
30
  handleAttributeClick: (n) => {
55
- const u = a.value;
56
- if (u) {
57
- if (u === "phone") {
31
+ const e = l.value;
32
+ if (e) {
33
+ if (e === "phone") {
58
34
  b(n);
59
35
  return;
60
36
  }
61
- if (!R(u)) {
62
- const l = x(u);
63
- l && k(n, l.channelId);
37
+ if (!k(e)) {
38
+ const a = A(e);
39
+ a && h(n, a.channelId);
64
40
  }
65
41
  }
66
42
  },
67
- selectSingleChannel: k,
68
- selectChannelForRecentAttribute: I,
43
+ selectSingleChannel: h,
69
44
  selectChannel: (n) => {
70
- if (z.value) {
71
- I(n, r.value ?? null);
72
- return;
73
- }
74
- r.value && (f("select-attribute-channel", {
75
- attributeId: r.value.id,
45
+ s.value && (t("select-attribute-channel", {
46
+ attributeId: s.value.id,
76
47
  channelId: n
77
- }), e.value = a.value, i.value = c.value.find((u) => u.channelId === n) ?? {}, t(n) && s.value ? d() : o()), v();
48
+ }), c.value = l.value, r.value = i.value.find((e) => e.channelId === n) ?? {}, v(n) && f.value ? d() : o()), u();
78
49
  },
79
50
  availableChannels: () => {
80
- const n = a.value;
81
- return n ? B(n) : [];
51
+ const n = l.value;
52
+ return n ? C(n) : [];
82
53
  }
83
54
  };
84
55
  }
85
56
  export {
86
- K as useCommunicationActions
57
+ P as useCommunicationActions
87
58
  };
@@ -1,18 +1,16 @@
1
- import { computed as r, unref as f, ref as v, watch as g } from "vue";
2
- import { CHANNEL_TYPES as m } from "./useCommunicationChannels.js";
3
- function w({
4
- contactAttributes: d,
5
- recentAttributeChannels: h,
6
- activeChannelType: i,
7
- frozenAttribute: b
1
+ import { computed as c, unref as m, ref as f, watch as a } from "vue";
2
+ import { CHANNEL_TYPES as o } from "./useCommunicationChannels.js";
3
+ function A({
4
+ contactAttributes: u,
5
+ frozenAttribute: s
8
6
  }) {
9
- const u = r(() => f(d) ?? []), o = r(() => f(h) ?? {}), s = v(
10
- Object.fromEntries(m.map((t) => [t, []]))
11
- ), c = () => {
7
+ const r = c(() => m(u) ?? []), i = f(
8
+ Object.fromEntries(o.map((t) => [t, []]))
9
+ ), n = () => {
12
10
  const t = Object.fromEntries(
13
- m.map((e) => [e, []])
11
+ o.map((e) => [e, []])
14
12
  );
15
- u.value.forEach((e) => {
13
+ r.value.forEach((e) => {
16
14
  if (!(!e || !e.type)) {
17
15
  if (e.type === "telegram") {
18
16
  t.telegram.push(e);
@@ -23,45 +21,24 @@ function w({
23
21
  return;
24
22
  }
25
23
  if (e.type === "phone") {
26
- ["whatsapp", "sms", "phone"].forEach((n) => {
27
- t[n].push(e);
24
+ ["whatsapp", "sms", "phone"].forEach((p) => {
25
+ t[p].push(e);
28
26
  });
29
27
  return;
30
28
  }
31
29
  t[e.type] && t[e.type].push(e);
32
30
  }
33
- }), s.value = t;
31
+ }), i.value = t;
34
32
  };
35
- g(u, c, { deep: !0, immediate: !0 });
36
- const p = (t) => {
37
- var n;
38
- const e = (n = o.value[t]) == null ? void 0 : n.attributeId;
39
- return e ? u.value.find((y) => {
40
- var l;
41
- return (l = y.id) == null ? void 0 : l.includes(e);
42
- }) ?? null : null;
43
- }, a = r(() => {
44
- const t = i.value;
45
- return t ? p(t) : null;
46
- }), A = r(() => {
47
- const t = i.value;
48
- if (!t || t === "phone")
49
- return !1;
50
- const e = a.value, n = o.value[t];
51
- return !!(e && (n != null && n.channelId));
52
- });
53
- return {
54
- organizedContactAttributes: s,
55
- organizeContactAttributes: c,
56
- recentAttribute: a,
57
- getRecentAttributeByType: p,
58
- showRecentAttribute: A,
33
+ return a(r, n, { deep: !0, immediate: !0 }), {
34
+ organizedContactAttributes: i,
35
+ organizeContactAttributes: n,
59
36
  isAttributeFrozen: (t) => {
60
- const e = b.value;
37
+ const e = s.value;
61
38
  return !t || !(e != null && e.id) ? !1 : t.id === e.id;
62
39
  }
63
40
  };
64
41
  }
65
42
  export {
66
- w as useCommunicationAttributes
43
+ A as useCommunicationAttributes
67
44
  };
@@ -1,37 +1,36 @@
1
- import { ref as e } from "vue";
2
- function k({
3
- panelRef: h,
4
- channelsPanelRef: t,
1
+ import { ref as l } from "vue";
2
+ function M({
3
+ panelRef: f,
4
+ channelsPanelRef: s,
5
5
  selectedChannelType: d,
6
- frozenAttribute: o,
7
- isRecentAttributeHovered: v
6
+ frozenAttribute: o
8
7
  }) {
9
- const u = e(null), C = e(null), n = e(!1), a = e(!1), i = e("0px"), c = () => {
10
- t.value && (i.value = `${t.value.offsetWidth}px`);
11
- }, s = () => {
12
- n.value = !1, u.value = null, o.value = null, v.value = !1, a.value = !1;
8
+ const n = l(null), h = l(null), u = l(!1), a = l(!1), i = l("0px"), c = () => {
9
+ s.value && (i.value = `${s.value.offsetWidth}px`);
10
+ }, t = () => {
11
+ u.value = !1, n.value = null, o.value = null, a.value = !1;
13
12
  };
14
13
  return {
15
- activeChannelType: u,
16
- hoveredChannel: C,
17
- showMenu: n,
14
+ activeChannelType: n,
15
+ hoveredChannel: h,
16
+ showMenu: u,
18
17
  showSubMenu: a,
19
18
  menuWidth: i,
20
19
  updateMenuWidth: c,
21
- handleChannelClick: (l) => {
22
- if (d.value === l && u.value === l) {
23
- s();
20
+ handleChannelClick: (e) => {
21
+ if (d.value === e && n.value === e) {
22
+ t();
24
23
  return;
25
24
  }
26
- u.value = l, n.value = !0, a.value = !1, o.value = null, v.value = !1, c();
25
+ n.value = e, u.value = !0, a.value = !1, o.value = null, c();
27
26
  },
28
- closeMenu: s,
29
- handleClickOutside: (l) => {
30
- const f = h.value;
31
- f && !f.contains(l.target) && s();
27
+ closeMenu: t,
28
+ handleClickOutside: (e) => {
29
+ const v = f.value;
30
+ v && !v.contains(e.target) && t();
32
31
  }
33
32
  };
34
33
  }
35
34
  export {
36
- k as useCommunicationMenu
35
+ M as useCommunicationMenu
37
36
  };
@@ -1,31 +1,22 @@
1
- import { computed as n, unref as l } from "vue";
2
- function x({
3
- showMenu: c,
1
+ import { computed as l, unref as m } from "vue";
2
+ function p({
3
+ showMenu: u,
4
4
  activeChannelType: e,
5
- emptyChannelsPlaceholder: h,
6
- getAvailableChannels: f,
7
- getChannelTypeFromId: i,
8
- channels: d,
9
- recentAttributeChannels: v,
10
- organizedContactAttributes: m,
11
- showRecentAttribute: p
5
+ emptyChannelsPlaceholder: a,
6
+ getAvailableChannels: o,
7
+ organizedContactAttributes: s
12
8
  }) {
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)
9
+ const r = l(() => m(a) ?? {}), t = l(() => !e.value || !r.value ? null : r.value[e.value] || null), h = l(() => {
10
+ if (!u.value || !e.value || !t.value)
16
11
  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);
12
+ const f = o(e.value).length === 0, n = s.value[e.value], i = !n || n.length === 0;
13
+ return !!(f || i);
23
14
  });
24
15
  return {
25
- emptyChannelsPlaceholderText: a,
26
- shouldShowEmptyChannelsPlaceholder: I
16
+ emptyChannelsPlaceholderText: t,
17
+ shouldShowEmptyChannelsPlaceholder: h
27
18
  };
28
19
  }
29
20
  export {
30
- x as useCommunicationPlaceholder
21
+ p as useCommunicationPlaceholder
31
22
  };
@@ -1,69 +1,57 @@
1
- import { ref as S } from "vue";
2
- function F({
3
- activeChannelType: s,
4
- showSubMenu: t,
5
- frozenAttribute: a,
6
- hoveredAttribute: v,
7
- isRecentAttributeHovered: o,
8
- hasMultipleChannels: i
1
+ import { ref as f } from "vue";
2
+ function q({
3
+ activeChannelType: g,
4
+ showSubMenu: n,
5
+ frozenAttribute: o,
6
+ hoveredAttribute: b,
7
+ hasMultipleChannels: h
9
8
  }) {
10
- const n = S(0), m = () => {
11
- t.value = !1, a.value = null, v.value = null;
12
- };
9
+ const t = f(0);
13
10
  return {
14
- subMenuTop: n,
15
- resetRegularAttributeHover: m,
16
- handleRecentAttributeMouseEnter: (e) => {
17
- const u = s.value;
18
- if (!(!u || !i(u)))
19
- return m(), o.value = !0, t.value = !0, e;
20
- },
21
- handleRecentAttributeMouseLeave: () => {
22
- t.value || (o.value = !1);
23
- },
24
- handleAttributeMouseEnter: (e, u) => {
25
- const l = s.value;
26
- return !l || !i(l) ? null : (o.value = !1, v.value = e, t.value = !0, a.value = e, u);
11
+ subMenuTop: t,
12
+ handleAttributeMouseEnter: (e, l) => {
13
+ const u = g.value;
14
+ return !u || !h(u) ? null : (b.value = e, n.value = !0, o.value = e, l);
27
15
  },
28
16
  handleAttributeMouseLeave: () => {
29
- t.value || (a.value = null);
17
+ n.value || (o.value = null);
30
18
  },
31
19
  keepSubMenuOpen: () => {
32
- t.value = !0;
20
+ n.value = !0;
33
21
  },
34
22
  closeSubMenu: () => {
35
- t.value = !1, a.value = null, o.value = !1;
23
+ n.value = !1, o.value = null;
36
24
  },
37
- alignSubMenuWithTarget: (e, u) => {
38
- var l, d, g;
39
- if (!u) {
40
- n.value = 0;
25
+ alignSubMenuWithTarget: (e, l) => {
26
+ var u, r, s;
27
+ if (!l) {
28
+ t.value = 0;
41
29
  return;
42
30
  }
43
31
  try {
44
- const p = (l = e.value) == null ? void 0 : l.querySelector(".attributes-menu"), c = (d = e.value) == null ? void 0 : d.querySelector(".sub-menu-header"), f = (g = e.value) == null ? void 0 : g.querySelector(".sub-menu");
45
- if (!p) {
46
- n.value = 0;
32
+ const i = (u = e.value) == null ? void 0 : u.querySelector(".attributes-menu"), a = (r = e.value) == null ? void 0 : r.querySelector(".sub-menu-header"), v = (s = e.value) == null ? void 0 : s.querySelector(".sub-menu");
33
+ if (!i) {
34
+ t.value = 0;
47
35
  return;
48
36
  }
49
- const y = p.getBoundingClientRect(), E = u.getBoundingClientRect();
50
- let M = 0;
51
- if (c) {
52
- const r = c.getBoundingClientRect(), R = getComputedStyle(c), h = parseFloat(R.marginBottom || "0");
53
- M = r.height + (Number.isNaN(h) ? 0 : h);
37
+ const M = i.getBoundingClientRect(), S = l.getBoundingClientRect();
38
+ let m = 0;
39
+ if (a) {
40
+ const c = a.getBoundingClientRect(), y = getComputedStyle(a), p = parseFloat(y.marginBottom || "0");
41
+ m = c.height + (Number.isNaN(p) ? 0 : p);
54
42
  }
55
- let b = 0;
56
- if (f) {
57
- const r = getComputedStyle(f);
58
- b = parseFloat(r.paddingTop || "0") || 0;
43
+ let d = 0;
44
+ if (v) {
45
+ const c = getComputedStyle(v);
46
+ d = parseFloat(c.paddingTop || "0") || 0;
59
47
  }
60
- n.value = E.top - y.top - M - b - 2;
48
+ t.value = S.top - M.top - m - d - 2;
61
49
  } catch {
62
- n.value = 0;
50
+ t.value = 0;
63
51
  }
64
52
  }
65
53
  };
66
54
  }
67
55
  export {
68
- F as useCommunicationSubMenu
56
+ q as useCommunicationSubMenu
69
57
  };
@@ -0,0 +1,19 @@
1
+ import { createElementBlock as t, openBlock as o, createElementVNode as n } from "vue";
2
+ import c from "../../../../_virtual/_plugin-vue_export-helper.js";
3
+ const r = {}, l = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: "16",
6
+ height: "16",
7
+ fill: "#007CFF",
8
+ class: "bi bi-check-lg",
9
+ viewBox: "0 0 16 16"
10
+ };
11
+ function i(s, e) {
12
+ return o(), t("svg", l, [...e[0] || (e[0] = [
13
+ n("path", { d: "M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z" }, null, -1)
14
+ ])]);
15
+ }
16
+ const f = /* @__PURE__ */ c(r, [["render", i]]);
17
+ export {
18
+ f as default
19
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./Feed.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9686a172"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-595f91e2"]]);
5
5
  export {
6
6
  m as default
7
7
  };