@wisemen/wise-crm-web 2.0.0-alpha.9 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +244 -0
- package/dist/ActivityList.vue_vue_type_script_setup_true_lang-CropNbOA.js +163 -0
- package/dist/BusinessDetailView-D3rC_KVS.js +207 -0
- package/dist/CrmDetailHeaderBadge.vue_vue_type_script_setup_true_lang-kIUc1Vkb.js +1008 -0
- package/dist/DealCommunicationTabView-JzuvTskR.js +240 -0
- package/dist/DealDetailView-wkFJCZc5.js +561 -0
- package/dist/IndividualDetailView-BtYagyLA.js +205 -0
- package/dist/{index-CBZyudVC.js → index-BddOTAwb.js} +15733 -14903
- package/dist/index.d.ts +622 -164
- package/dist/index.js +23 -23
- package/dist/style.css +1 -1
- package/dist/testing.d.ts +685 -17
- package/dist/testing.js +6 -2
- package/dist/uuid.util-DUuuAgdg.js +3269 -0
- package/package.json +22 -19
- package/dist/BusinessDetailView-Bs85WLHf.js +0 -27
- package/dist/CrmDetailView.vue_vue_type_script_setup_true_lang-B6SoADEB.js +0 -90
- package/dist/DealCommunicationTabView-9W0abKQj.js +0 -199
- package/dist/DealDetailView-C70487f0.js +0 -1412
- package/dist/IndividualDetailView-1rDGg3QD.js +0 -27
- package/dist/uuid.util-CaePLXHv.js +0 -6216
|
@@ -0,0 +1,1008 @@
|
|
|
1
|
+
import { defineComponent as $, useModel as pe, openBlock as a, createElementBlock as g, createVNode as i, unref as t, withCtx as p, Fragment as B, renderList as F, createBlock as h, createElementVNode as s, renderSlot as U, mergeModels as fe, createStaticVNode as _e, resolveDynamicComponent as P, toDisplayString as k, computed as v, mergeProps as J, normalizeClass as ye, normalizeStyle as R, toValue as q, createCommentVNode as b, useSlots as he } from "vue";
|
|
2
|
+
import { UITabs as xe, UITabsList as ge, UITabsItem as ve, UITextareaField as ee, toFormField as te, UIIconButton as S, UIDropdownMenu as ne, UIDropdownMenuGroup as H, UIDropdownMenuItem as T, UILoader as be, useToast as we, UIFormDialog as ke, UIDialogHeader as $e, UIDialogBody as Ce, UIDialogFooter as Ue, UIDialogFooterCancel as Ie, UIDialogFooterSubmit as De, UIDashboardPage as Se, UITabsRouterLink as Te, UITabsRouterLinkItem as Ae, UITooltip as Ne, UITooltipContent as Pe, UIRowLayout as Be, UIText as Ee, UISeparator as Ve, UIDropdownMenuSeparator as ze, UIBadge as N, UISkeletonItem as He } from "@wisemen/vue-core-design-system";
|
|
3
|
+
import { ApiUtil as C, useMutation as oe, useQuery as Me } from "@wisemen/vue-core-api-utils";
|
|
4
|
+
import { K as Fe, Z as Le, L as Re, N as qe, O as je, P as We, Q as Ge, R as Ke, k as Oe, S as Qe, J as Xe, E as Ye, i as Ze, U as le, H as E, h as ae, u as Je, X as et, b as ie, Y as tt, $ as nt, a0 as j, a1 as M, g as re, a2 as se, a3 as ot, a4 as W, a5 as G, a6 as K, w as lt, a7 as at, a8 as it, a9 as rt } from "./index-BddOTAwb.js";
|
|
5
|
+
import { useI18n as I } from "vue-i18n";
|
|
6
|
+
import { useForm as ce } from "formango";
|
|
7
|
+
import { Temporal as st } from "temporal-polyfill";
|
|
8
|
+
import { z as O } from "zod";
|
|
9
|
+
import { onKeyStroke as ct, useClipboard as ue } from "@vueuse/core";
|
|
10
|
+
import { useRoute as ut, RouterView as dt } from "vue-router";
|
|
11
|
+
import { bs as mt } from "./uuid.util-DUuuAgdg.js";
|
|
12
|
+
import { Motion as pt } from "motion-v";
|
|
13
|
+
const ft = { class: "mt-lg flex h-full flex-1 flex-col overflow-hidden" }, _t = { class: "min-h-0 flex-1 overflow-y-auto px-lg py-lg" }, kn = /* @__PURE__ */ $({
|
|
14
|
+
__name: "CrmDetailSidebarTabs",
|
|
15
|
+
props: /* @__PURE__ */ fe({
|
|
16
|
+
tabs: {}
|
|
17
|
+
}, {
|
|
18
|
+
modelValue: {
|
|
19
|
+
required: !0
|
|
20
|
+
},
|
|
21
|
+
modelModifiers: {}
|
|
22
|
+
}),
|
|
23
|
+
emits: ["update:modelValue"],
|
|
24
|
+
setup(r) {
|
|
25
|
+
const e = r, n = pe(r, "modelValue");
|
|
26
|
+
return (l, o) => (a(), g("div", ft, [
|
|
27
|
+
i(t(xe), {
|
|
28
|
+
modelValue: n.value,
|
|
29
|
+
"onUpdate:modelValue": o[0] || (o[0] = (f) => n.value = f),
|
|
30
|
+
"is-full-width": !0,
|
|
31
|
+
"underline-tabs-horizontal-list-padding": "lg",
|
|
32
|
+
class: "flex h-full flex-1 flex-col"
|
|
33
|
+
}, {
|
|
34
|
+
default: p(() => [
|
|
35
|
+
i(t(ge), { class: "py-xxs" }, {
|
|
36
|
+
default: p(() => [
|
|
37
|
+
(a(!0), g(B, null, F(e.tabs, (f) => (a(), h(t(ve), {
|
|
38
|
+
key: f.value,
|
|
39
|
+
value: f.value,
|
|
40
|
+
icon: f.icon,
|
|
41
|
+
label: f.label
|
|
42
|
+
}, null, 8, ["value", "icon", "label"]))), 128))
|
|
43
|
+
]),
|
|
44
|
+
_: 1
|
|
45
|
+
}),
|
|
46
|
+
s("div", _t, [
|
|
47
|
+
U(l.$slots, "default")
|
|
48
|
+
])
|
|
49
|
+
]),
|
|
50
|
+
_: 3
|
|
51
|
+
}, 8, ["modelValue"])
|
|
52
|
+
]));
|
|
53
|
+
}
|
|
54
|
+
}), yt = {}, ht = {
|
|
55
|
+
fill: "none",
|
|
56
|
+
height: "100%",
|
|
57
|
+
viewBox: "0 0 756 560",
|
|
58
|
+
width: "100%",
|
|
59
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
60
|
+
};
|
|
61
|
+
function xt(r, e) {
|
|
62
|
+
return a(), g("svg", ht, [...e[0] || (e[0] = [
|
|
63
|
+
_e('<mask id="mask0_2103_18170" height="768" maskUnits="userSpaceOnUse" style="mask-type:alpha;" width="768" x="-6" y="-208"><rect fill="url(#paint0_radial_2103_18170)" height="768" transform="translate(-6 -208)" width="768"></rect></mask><g mask="url(#mask0_2103_18170)"><g clip-path="url(#clip0_2103_18170)"><g clip-path="url(#clip1_2103_18170)"><line stroke="currentColor" x1="42.5" x2="42.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="90.5" x2="90.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="138.5" x2="138.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="186.5" x2="186.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="234.5" x2="234.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="282.5" x2="282.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="330.5" x2="330.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="378.5" x2="378.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="426.5" x2="426.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="474.5" x2="474.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="522.5" x2="522.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="570.5" x2="570.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="618.5" x2="618.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="666.5" x2="666.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="714.5" x2="714.5" y1="-208" y2="560"></line></g><rect height="767" stroke="currentColor" width="767" x="-5.5" y="-207.5"></rect><g clip-path="url(#clip2_2103_18170)"><line stroke="currentColor" x1="-6" x2="762" y1="31.5" y2="31.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="79.5" y2="79.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="127.5" y2="127.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="175.5" y2="175.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="223.5" y2="223.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="271.5" y2="271.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="319.5" y2="319.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="367.5" y2="367.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="415.5" y2="415.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="463.5" y2="463.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="511.5" y2="511.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="559.5" y2="559.5"></line></g><rect height="767" stroke="currentColor" width="767" x="-5.5" y="-207.5"></rect></g></g><defs><radialGradient id="paint0_radial_2103_18170" cx="0" cy="0" gradientTransform="translate(384 384) rotate(90) scale(384 384)" gradientUnits="userSpaceOnUse" r="1"><stop></stop><stop offset="1" stop-opacity="0"></stop></radialGradient><clipPath id="clip0_2103_18170"><rect fill="white" height="768" transform="translate(-6 -208)" width="768"></rect></clipPath><clipPath id="clip1_2103_18170"><rect fill="white" height="768" width="768" x="-6" y="-208"></rect></clipPath><clipPath id="clip2_2103_18170"><rect fill="white" height="768" width="768" x="-6" y="-208"></rect></clipPath></defs>', 3)
|
|
64
|
+
])]);
|
|
65
|
+
}
|
|
66
|
+
const gt = /* @__PURE__ */ Fe(yt, [["render", xt]]), vt = { class: "relative flex h-full flex-col items-center justify-center text-center" }, bt = { class: "relative z-1 flex flex-col items-center gap-lg" }, wt = { class: "flex size-12 items-center justify-center rounded-full border-3 border-solid border-white bg-brand-200 p-md shadow-md" }, kt = { class: "flex flex-col gap-sm" }, $t = { class: "text-md font-semibold" }, Ct = { class: "text-sm text-tertiary" }, Ut = { class: "absolute inset-x-0 scale-140 opacity-10" }, It = /* @__PURE__ */ $({
|
|
67
|
+
__name: "AppEmptyState",
|
|
68
|
+
props: {
|
|
69
|
+
title: {},
|
|
70
|
+
description: {},
|
|
71
|
+
icon: {}
|
|
72
|
+
},
|
|
73
|
+
setup(r) {
|
|
74
|
+
const e = r;
|
|
75
|
+
return (n, l) => (a(), g("div", vt, [
|
|
76
|
+
s("div", bt, [
|
|
77
|
+
s("div", wt, [
|
|
78
|
+
(a(), h(P(e.icon), { class: "size-full text-brand-600" }))
|
|
79
|
+
]),
|
|
80
|
+
s("div", kt, [
|
|
81
|
+
s("h3", $t, k(e.title), 1),
|
|
82
|
+
s("p", Ct, k(e.description), 1)
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
s("div", Ut, [
|
|
86
|
+
i(gt)
|
|
87
|
+
])
|
|
88
|
+
]));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
class V {
|
|
92
|
+
static fromDto(e) {
|
|
93
|
+
return {
|
|
94
|
+
uuid: e.uuid,
|
|
95
|
+
lastUpdatedByUserUuid: e.lastUpdatedByUserUuid,
|
|
96
|
+
updatedAt: Le.fromDto(e.updatedAt),
|
|
97
|
+
content: e.content,
|
|
98
|
+
lastUpdatedByUser: e.lastUpdatedByUser
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
class Dt {
|
|
103
|
+
static toDto(e, n, l, o) {
|
|
104
|
+
return {
|
|
105
|
+
businessUuid: n ?? null,
|
|
106
|
+
dealUuid: o ?? null,
|
|
107
|
+
individualUuid: l ?? null,
|
|
108
|
+
content: e.note ?? ""
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
class de {
|
|
113
|
+
static async create(e, n) {
|
|
114
|
+
const l = await C.fromPromise(Re({
|
|
115
|
+
body: Dt.toDto(
|
|
116
|
+
e,
|
|
117
|
+
n.businessUuid,
|
|
118
|
+
n.individualUuid,
|
|
119
|
+
n.dealUuid
|
|
120
|
+
)
|
|
121
|
+
}));
|
|
122
|
+
return C.void(l);
|
|
123
|
+
}
|
|
124
|
+
static async delete(e) {
|
|
125
|
+
const n = await C.fromPromise(qe({
|
|
126
|
+
path: {
|
|
127
|
+
uuid: e
|
|
128
|
+
}
|
|
129
|
+
}));
|
|
130
|
+
return C.void(n);
|
|
131
|
+
}
|
|
132
|
+
static async getBusinessNotes(e, n) {
|
|
133
|
+
return (await C.fromPromise(je({
|
|
134
|
+
query: e,
|
|
135
|
+
path: {
|
|
136
|
+
businessUuid: n
|
|
137
|
+
}
|
|
138
|
+
}))).map((o) => ({
|
|
139
|
+
data: o.data.items.map(V.fromDto),
|
|
140
|
+
meta: {
|
|
141
|
+
next: o.data.meta.next
|
|
142
|
+
}
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
static async getDealNotes(e, n) {
|
|
146
|
+
return (await C.fromPromise(We({
|
|
147
|
+
query: e,
|
|
148
|
+
path: {
|
|
149
|
+
dealUuid: n
|
|
150
|
+
}
|
|
151
|
+
}))).map((o) => ({
|
|
152
|
+
data: o.data.items.map(V.fromDto),
|
|
153
|
+
meta: {
|
|
154
|
+
next: o.data.meta.next
|
|
155
|
+
}
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
static async getIndividualNotes(e, n) {
|
|
159
|
+
return (await C.fromPromise(Ge({
|
|
160
|
+
query: e,
|
|
161
|
+
path: {
|
|
162
|
+
individualUuid: n
|
|
163
|
+
}
|
|
164
|
+
}))).map((o) => ({
|
|
165
|
+
data: o.data.items.map(V.fromDto),
|
|
166
|
+
meta: {
|
|
167
|
+
next: o.data.meta.next
|
|
168
|
+
}
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
static async update(e, n) {
|
|
172
|
+
const l = await C.fromPromise(Ke({
|
|
173
|
+
body: {
|
|
174
|
+
content: n
|
|
175
|
+
},
|
|
176
|
+
path: {
|
|
177
|
+
uuid: e
|
|
178
|
+
}
|
|
179
|
+
}));
|
|
180
|
+
return C.void(l);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function $n() {
|
|
184
|
+
return oe({
|
|
185
|
+
queryFn: async ({
|
|
186
|
+
params: r
|
|
187
|
+
}) => await de.delete(r.noteUuid),
|
|
188
|
+
queryKeysToInvalidate: {
|
|
189
|
+
noteBusinessIndex: {},
|
|
190
|
+
noteDealIndex: {},
|
|
191
|
+
noteIndividualIndex: {}
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
const me = O.object({
|
|
196
|
+
note: O.string().trim().min(1)
|
|
197
|
+
}), St = { class: "flex justify-end p-md" }, Tt = /* @__PURE__ */ $({
|
|
198
|
+
__name: "NoteForm",
|
|
199
|
+
props: {
|
|
200
|
+
content: {},
|
|
201
|
+
onSubmit: { type: Function }
|
|
202
|
+
},
|
|
203
|
+
setup(r) {
|
|
204
|
+
const e = r, n = I(), l = ce({
|
|
205
|
+
initialState: {
|
|
206
|
+
note: e.content ?? null
|
|
207
|
+
},
|
|
208
|
+
schema: me,
|
|
209
|
+
onSubmit: async (u) => {
|
|
210
|
+
await e.onSubmit(u), l.reset();
|
|
211
|
+
}
|
|
212
|
+
}), o = l.register("note"), f = v(() => o.modelValue.value === null || o.modelValue.value.trim().length === 0);
|
|
213
|
+
async function m(u) {
|
|
214
|
+
!l.isValid.value || l.isSubmitting.value || u.key === "Enter" && !u.shiftKey && (u.preventDefault(), await l.submit(), o.setValue(null));
|
|
215
|
+
}
|
|
216
|
+
return (u, x) => (a(), g("div", null, [
|
|
217
|
+
i(Oe, {
|
|
218
|
+
"can-exit-when-dirty": !0,
|
|
219
|
+
form: t(l),
|
|
220
|
+
class: "w-full"
|
|
221
|
+
}, {
|
|
222
|
+
default: p(() => [
|
|
223
|
+
i(t(ee), J(t(te)(t(o)), {
|
|
224
|
+
errors: [],
|
|
225
|
+
"error-message": null,
|
|
226
|
+
placeholder: t(n).t("wise_crm.note.create_placeholder"),
|
|
227
|
+
"class-config": {
|
|
228
|
+
input: "h-20"
|
|
229
|
+
},
|
|
230
|
+
onKeydown: m
|
|
231
|
+
}), {
|
|
232
|
+
bottom: p(() => [
|
|
233
|
+
s("div", St, [
|
|
234
|
+
i(t(S), {
|
|
235
|
+
"is-loading": t(l).isSubmitting.value,
|
|
236
|
+
"is-disabled": f.value,
|
|
237
|
+
label: t(n).t("wise_crm.info_dialog.notes.submit_note_label"),
|
|
238
|
+
icon: t(Qe),
|
|
239
|
+
class: "rounded-full shadow-none",
|
|
240
|
+
type: "submit",
|
|
241
|
+
size: "sm"
|
|
242
|
+
}, null, 8, ["is-loading", "is-disabled", "label", "icon"])
|
|
243
|
+
])
|
|
244
|
+
]),
|
|
245
|
+
_: 1
|
|
246
|
+
}, 16, ["placeholder"])
|
|
247
|
+
]),
|
|
248
|
+
_: 1
|
|
249
|
+
}, 8, ["form"])
|
|
250
|
+
]));
|
|
251
|
+
}
|
|
252
|
+
}), At = { class: "flex flex-col gap-md" }, Nt = { class: "relative flex flex-1 flex-col gap-sm overflow-hidden rounded-lg border border-primary p-lg" }, Pt = { class: "mr-3xl max-w-full text-sm text-wrap wrap-break-word whitespace-pre-wrap" }, Bt = { class: "flex items-center gap-sm text-xs text-placeholder" }, Et = { class: "absolute top-1 right-1" }, Vt = /* @__PURE__ */ $({
|
|
253
|
+
__name: "NoteList",
|
|
254
|
+
props: {
|
|
255
|
+
notes: {}
|
|
256
|
+
},
|
|
257
|
+
emits: ["delete", "next", "update"],
|
|
258
|
+
setup(r, { emit: e }) {
|
|
259
|
+
const n = r, l = e, o = I();
|
|
260
|
+
function f(y) {
|
|
261
|
+
const _ = y.updatedAt, c = _.toInstant(), d = st.Now.instant(), w = E.diffInSeconds(c, d), D = E.diffInMinutes(c, d), L = E.diffInHours(c, d);
|
|
262
|
+
return w < 60 ? o.t("wise_crm.note.just_now") : D < 60 ? o.t("wise_crm.note.minutes_ago", {
|
|
263
|
+
count: Math.round(D)
|
|
264
|
+
}) : L < 24 ? o.t("wise_crm.note.hours_ago", {
|
|
265
|
+
count: Math.round(L)
|
|
266
|
+
}) : ae().toDateTime(_);
|
|
267
|
+
}
|
|
268
|
+
function m() {
|
|
269
|
+
l("next");
|
|
270
|
+
}
|
|
271
|
+
function u(y) {
|
|
272
|
+
l("delete", y);
|
|
273
|
+
}
|
|
274
|
+
function x(y) {
|
|
275
|
+
l("update", y);
|
|
276
|
+
}
|
|
277
|
+
return (y, _) => (a(), h(Xe, { "on-next": m }, {
|
|
278
|
+
default: p(() => [
|
|
279
|
+
s("div", At, [
|
|
280
|
+
(a(!0), g(B, null, F(n.notes, (c) => (a(), g("div", {
|
|
281
|
+
key: c.content,
|
|
282
|
+
class: "flex gap-sm"
|
|
283
|
+
}, [
|
|
284
|
+
s("div", Nt, [
|
|
285
|
+
s("p", Pt, k(c.content), 1),
|
|
286
|
+
s("div", Bt, [
|
|
287
|
+
s("span", null, k(f(c)), 1),
|
|
288
|
+
_[0] || (_[0] = s("div", { class: "size-1 rounded-full bg-gray-400" }, null, -1)),
|
|
289
|
+
s("span", null, k(c.lastUpdatedByUser), 1)
|
|
290
|
+
]),
|
|
291
|
+
s("div", Et, [
|
|
292
|
+
i(t(ne), { "popover-align": "end" }, {
|
|
293
|
+
trigger: p(() => [
|
|
294
|
+
i(t(S), {
|
|
295
|
+
label: t(o).t("wise_crm.info_dialog.notes.action_button_label"),
|
|
296
|
+
icon: t(le),
|
|
297
|
+
variant: "tertiary",
|
|
298
|
+
size: "sm"
|
|
299
|
+
}, null, 8, ["label", "icon"])
|
|
300
|
+
]),
|
|
301
|
+
content: p(() => [
|
|
302
|
+
i(t(H), null, {
|
|
303
|
+
default: p(() => [
|
|
304
|
+
i(t(T), {
|
|
305
|
+
label: t(o).t("wise_crm.info_dialog.notes.update_note"),
|
|
306
|
+
config: {
|
|
307
|
+
left: {
|
|
308
|
+
type: "icon",
|
|
309
|
+
icon: t(Ye)
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
onSelect: (d) => x(c)
|
|
313
|
+
}, null, 8, ["label", "config", "onSelect"]),
|
|
314
|
+
i(t(T), {
|
|
315
|
+
"is-destructive": !0,
|
|
316
|
+
label: t(o).t("wise_crm.shared.delete"),
|
|
317
|
+
config: {
|
|
318
|
+
left: {
|
|
319
|
+
type: "icon",
|
|
320
|
+
icon: t(Ze)
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
onSelect: (d) => u(c.uuid)
|
|
324
|
+
}, null, 8, ["label", "config", "onSelect"])
|
|
325
|
+
]),
|
|
326
|
+
_: 2
|
|
327
|
+
}, 1024)
|
|
328
|
+
]),
|
|
329
|
+
_: 2
|
|
330
|
+
}, 1024)
|
|
331
|
+
])
|
|
332
|
+
])
|
|
333
|
+
]))), 128))
|
|
334
|
+
])
|
|
335
|
+
]),
|
|
336
|
+
_: 1
|
|
337
|
+
}));
|
|
338
|
+
}
|
|
339
|
+
}), zt = { class: "flex h-full flex-col justify-between gap-lg" }, Ht = {
|
|
340
|
+
key: 0,
|
|
341
|
+
class: "flex h-70 flex-col items-center justify-center gap-md text-quaternary"
|
|
342
|
+
}, Mt = { class: "text-xs" }, Cn = /* @__PURE__ */ $({
|
|
343
|
+
__name: "CrmDetailSidebarNotesView",
|
|
344
|
+
props: {
|
|
345
|
+
hasNextPage: { type: Boolean },
|
|
346
|
+
isLoading: { type: Boolean },
|
|
347
|
+
notes: {},
|
|
348
|
+
onSubmit: { type: Function }
|
|
349
|
+
},
|
|
350
|
+
emits: ["delete", "next", "update"],
|
|
351
|
+
setup(r, { emit: e }) {
|
|
352
|
+
const n = r, l = e, o = I(), f = Je();
|
|
353
|
+
async function m(_) {
|
|
354
|
+
try {
|
|
355
|
+
await n.onSubmit(_);
|
|
356
|
+
} catch (c) {
|
|
357
|
+
f.show(c);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function u() {
|
|
361
|
+
l("next");
|
|
362
|
+
}
|
|
363
|
+
function x(_) {
|
|
364
|
+
l("delete", _);
|
|
365
|
+
}
|
|
366
|
+
function y(_) {
|
|
367
|
+
l("update", _);
|
|
368
|
+
}
|
|
369
|
+
return (_, c) => (a(), g("div", zt, [
|
|
370
|
+
n.isLoading ? (a(), g("div", Ht, [
|
|
371
|
+
i(t(be), { class: "size-4" }),
|
|
372
|
+
s("p", Mt, k(t(o).t("wise_crm.shared.loading")), 1)
|
|
373
|
+
])) : n.notes.length === 0 ? (a(), h(It, {
|
|
374
|
+
key: 1,
|
|
375
|
+
title: t(o).t("wise_crm.info_dialog.notes.empty_state.title"),
|
|
376
|
+
description: t(o).t("wise_crm.info_dialog.notes.empty_state.description"),
|
|
377
|
+
icon: t(et)
|
|
378
|
+
}, null, 8, ["title", "description", "icon"])) : (a(), h(Vt, {
|
|
379
|
+
key: 2,
|
|
380
|
+
notes: n.notes,
|
|
381
|
+
onDelete: x,
|
|
382
|
+
onUpdate: y,
|
|
383
|
+
onNext: u
|
|
384
|
+
}, null, 8, ["notes"])),
|
|
385
|
+
i(Tt, { "on-submit": m })
|
|
386
|
+
]));
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
function Ft() {
|
|
390
|
+
return oe({
|
|
391
|
+
queryFn: async ({
|
|
392
|
+
body: r,
|
|
393
|
+
params: e
|
|
394
|
+
}) => await de.update(e.noteUuid, r.note),
|
|
395
|
+
queryKeysToInvalidate: {
|
|
396
|
+
noteBusinessIndex: {},
|
|
397
|
+
noteDealIndex: {},
|
|
398
|
+
noteIndividualIndex: {}
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
const Un = /* @__PURE__ */ $({
|
|
403
|
+
__name: "NoteUpdateDialog",
|
|
404
|
+
props: {
|
|
405
|
+
businessUuid: {},
|
|
406
|
+
individualUuid: {},
|
|
407
|
+
note: {}
|
|
408
|
+
},
|
|
409
|
+
emits: ["close"],
|
|
410
|
+
setup(r, { emit: e }) {
|
|
411
|
+
const n = r, l = e, o = I(), f = we(), m = Ft(), u = ce({
|
|
412
|
+
initialState: {
|
|
413
|
+
note: n.note.content ?? null
|
|
414
|
+
},
|
|
415
|
+
schema: me,
|
|
416
|
+
onSubmit: async (_) => {
|
|
417
|
+
const c = await m.execute({
|
|
418
|
+
body: {
|
|
419
|
+
note: _.note
|
|
420
|
+
},
|
|
421
|
+
params: {
|
|
422
|
+
businessUuid: n.businessUuid,
|
|
423
|
+
individualUuid: n.individualUuid,
|
|
424
|
+
noteUuid: n.note.uuid
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
if (c.isErr()) {
|
|
428
|
+
f.apiError(c.error);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
l("close");
|
|
432
|
+
},
|
|
433
|
+
onSubmitError: () => {
|
|
434
|
+
f.unableToSave();
|
|
435
|
+
}
|
|
436
|
+
}), x = u.register("note");
|
|
437
|
+
function y() {
|
|
438
|
+
l("close");
|
|
439
|
+
}
|
|
440
|
+
return (_, c) => (a(), h(t(ke), {
|
|
441
|
+
form: t(u),
|
|
442
|
+
size: "sm",
|
|
443
|
+
onClose: y
|
|
444
|
+
}, {
|
|
445
|
+
default: p(() => [
|
|
446
|
+
i(t($e), {
|
|
447
|
+
title: t(o).t("wise_crm.note.update_dialog.title"),
|
|
448
|
+
description: t(o).t("wise_crm.note.update_dialog.description")
|
|
449
|
+
}, null, 8, ["title", "description"]),
|
|
450
|
+
i(t(Ce), null, {
|
|
451
|
+
default: p(() => [
|
|
452
|
+
i(t(ee), J(t(te)(t(x)), {
|
|
453
|
+
label: t(o).t("wise_crm.note.form.note.label"),
|
|
454
|
+
"class-config": { input: "h-32" }
|
|
455
|
+
}), null, 16, ["label"])
|
|
456
|
+
]),
|
|
457
|
+
_: 1
|
|
458
|
+
}),
|
|
459
|
+
i(t(Ue), null, {
|
|
460
|
+
default: p(() => [
|
|
461
|
+
i(t(Ie)),
|
|
462
|
+
i(t(De), {
|
|
463
|
+
label: t(o).t("shared.update")
|
|
464
|
+
}, null, 8, ["label"])
|
|
465
|
+
]),
|
|
466
|
+
_: 1
|
|
467
|
+
})
|
|
468
|
+
]),
|
|
469
|
+
_: 1
|
|
470
|
+
}, 8, ["form"]));
|
|
471
|
+
}
|
|
472
|
+
}), Lt = ["width", "height", "viewBox"], Rt = ["d"], Q = 0.5523, A = 24, qt = 26, jt = /* @__PURE__ */ $({
|
|
473
|
+
__name: "CrmDetailViewFolderNotchSvg",
|
|
474
|
+
props: {
|
|
475
|
+
bodyWidth: {},
|
|
476
|
+
curveHeight: {}
|
|
477
|
+
},
|
|
478
|
+
setup(r) {
|
|
479
|
+
const e = r, n = v(() => Math.max(e.bodyWidth, A)), l = v(() => n.value + e.curveHeight), o = v(() => e.curveHeight + qt), f = v(() => {
|
|
480
|
+
const m = n.value, u = e.curveHeight, x = u / 2, y = x * Q, _ = A * (1 - Q), c = m + x, d = m + u;
|
|
481
|
+
return [
|
|
482
|
+
`M0 ${A}`,
|
|
483
|
+
`C0 ${_} ${_} 0 ${A} 0`,
|
|
484
|
+
`H${m}`,
|
|
485
|
+
`C${m + y} 0 ${c} ${x - y} ${c} ${x}`,
|
|
486
|
+
`C${c} ${x + y} ${d - y} ${u} ${d} ${u}`,
|
|
487
|
+
`V${o.value}`,
|
|
488
|
+
"H0",
|
|
489
|
+
`V${A}`,
|
|
490
|
+
"Z"
|
|
491
|
+
].join(" ");
|
|
492
|
+
});
|
|
493
|
+
return (m, u) => (a(), g("svg", {
|
|
494
|
+
width: l.value,
|
|
495
|
+
height: o.value,
|
|
496
|
+
viewBox: `0 0 ${l.value} ${o.value}`,
|
|
497
|
+
fill: "none",
|
|
498
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
499
|
+
}, [
|
|
500
|
+
s("path", {
|
|
501
|
+
d: f.value,
|
|
502
|
+
fill: "white"
|
|
503
|
+
}, null, 8, Rt)
|
|
504
|
+
], 8, Lt));
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
class X {
|
|
508
|
+
/**
|
|
509
|
+
* Checks if the element accepts text input (input, textarea, select or contenteditable).
|
|
510
|
+
* @param element The element to check, usually `document.activeElement`.
|
|
511
|
+
* @returns True if the element is editable, false otherwise.
|
|
512
|
+
*/
|
|
513
|
+
static isEditable(e) {
|
|
514
|
+
return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement || e.isContentEditable;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Checks if any parent element has `aria-hidden="true"` set. use this to check if a dialog or a popover is open.
|
|
518
|
+
* @param element The element to start checking from.
|
|
519
|
+
* @returns True if any parent has `aria-hidden="true"`, false otherwise.
|
|
520
|
+
*/
|
|
521
|
+
static parentHasAriaHidden(e) {
|
|
522
|
+
let n = e.parentElement;
|
|
523
|
+
for (; n; ) {
|
|
524
|
+
if (n.hasAttribute("aria-hidden"))
|
|
525
|
+
return n.getAttribute("aria-hidden") === "true";
|
|
526
|
+
n = n.parentElement;
|
|
527
|
+
}
|
|
528
|
+
return !1;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
const Wt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md md:px-6xl md:pb-xl" }, Gt = { class: "relative isolate mx-auto flex min-h-0 w-full max-w-7xl flex-1 flex-col rounded-3xl rounded-tl-none bg-white shadow-lg" }, Kt = { class: "relative shrink-0 px-3xl pt-3xl pb-xl" }, Ot = { class: "shrink-0 px-3xl" }, Qt = { class: "min-h-0 flex-1 overflow-y-auto p-3xl" }, Xt = {
|
|
532
|
+
key: 0,
|
|
533
|
+
class: "shrink-0 px-3xl py-xl text-sm text-tertiary"
|
|
534
|
+
}, Y = 160, Z = 32, In = /* @__PURE__ */ $({
|
|
535
|
+
__name: "CrmDetailView",
|
|
536
|
+
props: {
|
|
537
|
+
title: {},
|
|
538
|
+
createdAt: {},
|
|
539
|
+
lastActivityAt: {},
|
|
540
|
+
backgroundColor: {},
|
|
541
|
+
entityType: {},
|
|
542
|
+
tabs: {}
|
|
543
|
+
},
|
|
544
|
+
setup(r) {
|
|
545
|
+
const e = r, n = I(), l = ie(), o = ut(), f = ae(), m = v(() => e.backgroundColor === void 0 ? l.getEntityConfig(e.entityType)?.color ?? null : e.backgroundColor), u = v(() => e.backgroundColor !== null), x = {
|
|
546
|
+
isResizable: !0,
|
|
547
|
+
defaultWidth: "25rem",
|
|
548
|
+
variant: "bordered-overlay"
|
|
549
|
+
}, y = {
|
|
550
|
+
icon: nt,
|
|
551
|
+
label: n.t("wise_crm.shared.back"),
|
|
552
|
+
onClick: l.goToReturnRoute
|
|
553
|
+
};
|
|
554
|
+
return ct("Escape", (_) => {
|
|
555
|
+
if (_.defaultPrevented)
|
|
556
|
+
return;
|
|
557
|
+
const c = document.activeElement;
|
|
558
|
+
c && X.parentHasAriaHidden(c) || c && X.isEditable(c) || l.goToReturnRoute();
|
|
559
|
+
}), (_, c) => (a(), h(tt, {
|
|
560
|
+
"primary-action": y,
|
|
561
|
+
class: "size-full"
|
|
562
|
+
}, {
|
|
563
|
+
default: p(() => [
|
|
564
|
+
i(t(Se), {
|
|
565
|
+
title: e.title ?? "",
|
|
566
|
+
"detail-pane": x,
|
|
567
|
+
"is-detail-pane-open": !0,
|
|
568
|
+
class: "size-full",
|
|
569
|
+
"is-title-hidden": ""
|
|
570
|
+
}, {
|
|
571
|
+
default: p(() => [
|
|
572
|
+
i(j, {
|
|
573
|
+
color: t(l).getEntityConfig(e.entityType)?.color ?? null,
|
|
574
|
+
class: "size-full"
|
|
575
|
+
}, {
|
|
576
|
+
default: p(() => [
|
|
577
|
+
s("div", Wt, [
|
|
578
|
+
i(j, {
|
|
579
|
+
color: m.value,
|
|
580
|
+
class: ye([u.value ? "opacity-100" : "opacity-0", "pointer-events-none absolute inset-0 -z-10 transition-opacity duration-300"]),
|
|
581
|
+
"aria-hidden": "true"
|
|
582
|
+
}, {
|
|
583
|
+
default: p(() => [...c[0] || (c[0] = [
|
|
584
|
+
s("div", { class: "size-full bg-linear-to-b from-brand-200 to-transparent to-40%" }, null, -1)
|
|
585
|
+
])]),
|
|
586
|
+
_: 1
|
|
587
|
+
}, 8, ["color", "class"]),
|
|
588
|
+
s("div", Gt, [
|
|
589
|
+
s("div", {
|
|
590
|
+
style: R({ left: `${Y}px` }),
|
|
591
|
+
"aria-hidden": "true",
|
|
592
|
+
class: "pointer-events-none absolute right-7 bottom-full h-4 rounded-t-2xl bg-white/50"
|
|
593
|
+
}, null, 4),
|
|
594
|
+
i(jt, {
|
|
595
|
+
"body-width": Y,
|
|
596
|
+
"curve-height": Z,
|
|
597
|
+
style: R({ transform: `translateY(-${Z}px)` }),
|
|
598
|
+
"aria-hidden": "true",
|
|
599
|
+
class: "pointer-events-none absolute top-0 left-0 block h-auto"
|
|
600
|
+
}, null, 8, ["style"]),
|
|
601
|
+
s("div", Kt, [
|
|
602
|
+
U(_.$slots, "header")
|
|
603
|
+
]),
|
|
604
|
+
s("div", Ot, [
|
|
605
|
+
i(t(Te), { variant: "underline" }, {
|
|
606
|
+
default: p(() => [
|
|
607
|
+
(a(!0), g(B, null, F(e.tabs, (d) => (a(), h(t(Ae), {
|
|
608
|
+
key: q(d.label),
|
|
609
|
+
label: q(d.label),
|
|
610
|
+
to: {
|
|
611
|
+
name: d.to,
|
|
612
|
+
params: t(o).params
|
|
613
|
+
}
|
|
614
|
+
}, null, 8, ["label", "to"]))), 128))
|
|
615
|
+
]),
|
|
616
|
+
_: 1
|
|
617
|
+
})
|
|
618
|
+
]),
|
|
619
|
+
s("div", Qt, [
|
|
620
|
+
i(t(dt))
|
|
621
|
+
]),
|
|
622
|
+
e.createdAt !== null && e.lastActivityAt !== null ? (a(), g("p", Xt, k(t(n).t("wise_crm.detail_view.footer", {
|
|
623
|
+
createdAt: t(f).toDate(e.createdAt.toPlainDate()),
|
|
624
|
+
lastActivityAt: t(f).toDate(e.lastActivityAt.toPlainDate())
|
|
625
|
+
})), 1)) : b("", !0)
|
|
626
|
+
])
|
|
627
|
+
])
|
|
628
|
+
]),
|
|
629
|
+
_: 3
|
|
630
|
+
}, 8, ["color"])
|
|
631
|
+
]),
|
|
632
|
+
"detail-pane": p(() => [
|
|
633
|
+
U(_.$slots, "sidebar")
|
|
634
|
+
]),
|
|
635
|
+
_: 3
|
|
636
|
+
}, 8, ["title"])
|
|
637
|
+
]),
|
|
638
|
+
_: 3
|
|
639
|
+
}));
|
|
640
|
+
}
|
|
641
|
+
}), Yt = ["href"], Zt = ["href"], Jt = { key: 2 }, z = /* @__PURE__ */ $({
|
|
642
|
+
__name: "CrmDetailHeaderContactTooltip",
|
|
643
|
+
props: {
|
|
644
|
+
type: {},
|
|
645
|
+
value: {}
|
|
646
|
+
},
|
|
647
|
+
setup(r) {
|
|
648
|
+
const e = r, n = I(), l = v(() => {
|
|
649
|
+
switch (e.type) {
|
|
650
|
+
case "address":
|
|
651
|
+
return se;
|
|
652
|
+
case "email":
|
|
653
|
+
return re;
|
|
654
|
+
case "phone":
|
|
655
|
+
return M;
|
|
656
|
+
default:
|
|
657
|
+
return M;
|
|
658
|
+
}
|
|
659
|
+
}), o = v(() => {
|
|
660
|
+
switch (e.type) {
|
|
661
|
+
case "email":
|
|
662
|
+
return `mailto:${e.value}`;
|
|
663
|
+
case "phone":
|
|
664
|
+
return `tel:${e.value}`;
|
|
665
|
+
case "address":
|
|
666
|
+
return `https://maps.google.com/?q=${encodeURIComponent(e.value)}`;
|
|
667
|
+
default:
|
|
668
|
+
return null;
|
|
669
|
+
}
|
|
670
|
+
}), f = v(() => {
|
|
671
|
+
switch (e.type) {
|
|
672
|
+
case "email":
|
|
673
|
+
return n.t("component.contact_tooltip.aria_label.email", {
|
|
674
|
+
value: e.value
|
|
675
|
+
});
|
|
676
|
+
case "phone":
|
|
677
|
+
return n.t("component.contact_tooltip.aria_label.phone", {
|
|
678
|
+
value: e.value
|
|
679
|
+
});
|
|
680
|
+
case "address":
|
|
681
|
+
return n.t("component.contact_tooltip.aria_label.address", {
|
|
682
|
+
value: e.value
|
|
683
|
+
});
|
|
684
|
+
default:
|
|
685
|
+
return e.value;
|
|
686
|
+
}
|
|
687
|
+
}), m = ue({
|
|
688
|
+
source: e.value
|
|
689
|
+
});
|
|
690
|
+
function u() {
|
|
691
|
+
m.copy(e.value);
|
|
692
|
+
}
|
|
693
|
+
return (x, y) => (a(), h(t(Ne), null, {
|
|
694
|
+
trigger: p(() => [
|
|
695
|
+
(a(), h(P(o.value ? "a" : "div"), {
|
|
696
|
+
href: o.value,
|
|
697
|
+
"aria-label": f.value,
|
|
698
|
+
target: r.type === "address" ? "_blank" : void 0,
|
|
699
|
+
rel: r.type === "address" ? "noopener noreferrer" : void 0,
|
|
700
|
+
class: "flex aspect-square size-8 items-center justify-center rounded-full border-none bg-gray-50/50 p-xs ring-brand-500 ring-offset-2 duration-300 outline-none focus-visible:ring-2 data-[loading=false]:not-disabled:hover:bg-gray-50/30 dark:bg-brand-950"
|
|
701
|
+
}, {
|
|
702
|
+
default: p(() => [
|
|
703
|
+
(a(), h(P(l.value), { class: "size-4 shrink-0 text-brand-700 dark:text-brand-200" }))
|
|
704
|
+
]),
|
|
705
|
+
_: 1
|
|
706
|
+
}, 8, ["href", "aria-label", "target", "rel"]))
|
|
707
|
+
]),
|
|
708
|
+
content: p(() => [
|
|
709
|
+
i(t(Pe), null, {
|
|
710
|
+
default: p(() => [
|
|
711
|
+
i(t(Be), {
|
|
712
|
+
gap: "xs",
|
|
713
|
+
class: "text-xs text-brand-500"
|
|
714
|
+
}, {
|
|
715
|
+
default: p(() => [
|
|
716
|
+
(a(), h(P(l.value), { class: "size-3.5 shrink-0" })),
|
|
717
|
+
r.type === "email" ? (a(), g("a", {
|
|
718
|
+
key: 0,
|
|
719
|
+
href: `mailto:${e.value}`,
|
|
720
|
+
class: "underline ring-brand-500 ring-offset-1 duration-200 outline-none focus-visible:ring-2"
|
|
721
|
+
}, k(e.value), 9, Yt)) : r.type === "phone" ? (a(), g("a", {
|
|
722
|
+
key: 1,
|
|
723
|
+
href: `tel:${e.value}`,
|
|
724
|
+
class: "underline ring-brand-500 ring-offset-1 duration-200 outline-none focus-visible:ring-2"
|
|
725
|
+
}, k(e.value), 9, Zt)) : (a(), g("p", Jt, k(e.value), 1)),
|
|
726
|
+
i(t(S), {
|
|
727
|
+
label: t(n).t("wise_crm.info_dialog.copy_to_clipboard"),
|
|
728
|
+
icon: t(ot),
|
|
729
|
+
variant: "tertiary",
|
|
730
|
+
size: "xs",
|
|
731
|
+
onClick: u
|
|
732
|
+
}, null, 8, ["label", "icon"])
|
|
733
|
+
]),
|
|
734
|
+
_: 1
|
|
735
|
+
})
|
|
736
|
+
]),
|
|
737
|
+
_: 1
|
|
738
|
+
})
|
|
739
|
+
]),
|
|
740
|
+
_: 1
|
|
741
|
+
}));
|
|
742
|
+
}
|
|
743
|
+
}), en = { class: "flex flex-col gap-lg" }, tn = { class: "group/header-row flex items-center justify-between gap-lg" }, nn = { class: "flex min-w-0 flex-1 items-center gap-lg" }, on = {
|
|
744
|
+
class: "flex size-14 shrink-0 items-center justify-center rounded-xl bg-brand-100 text-lg font-semibold text-brand-700 dark:bg-brand-900 dark:text-brand-200",
|
|
745
|
+
"aria-hidden": "true"
|
|
746
|
+
}, ln = { class: "flex min-w-0 flex-1 flex-col" }, an = {
|
|
747
|
+
key: 0,
|
|
748
|
+
class: "font-mono text-xs text-tertiary"
|
|
749
|
+
}, rn = { class: "flex shrink-0 items-center group-has-data-name-editing/header-row:hidden" }, sn = { class: "hidden items-center gap-sm md:flex" }, cn = { class: "flex items-center gap-xs md:hidden" }, un = { class: "flex flex-wrap items-center gap-sm" }, Dn = /* @__PURE__ */ $({
|
|
750
|
+
__name: "CrmDetailHeader",
|
|
751
|
+
props: {
|
|
752
|
+
createdAt: {},
|
|
753
|
+
name: {},
|
|
754
|
+
address: {},
|
|
755
|
+
email: {},
|
|
756
|
+
entityLabel: {},
|
|
757
|
+
entityType: {},
|
|
758
|
+
identifier: {},
|
|
759
|
+
mobilePhone: {},
|
|
760
|
+
owner: {},
|
|
761
|
+
phone: {},
|
|
762
|
+
status: {}
|
|
763
|
+
},
|
|
764
|
+
setup(r) {
|
|
765
|
+
const e = r, n = I(), l = ie(), o = ue(), f = he(), m = v(() => e.name.split(" ").filter((d) => d.length > 0).slice(0, 2).map((d) => d.charAt(0).toUpperCase()).join("")), u = v(() => new Intl.DateTimeFormat(n.locale.value, {
|
|
766
|
+
month: "short",
|
|
767
|
+
year: "numeric"
|
|
768
|
+
}).format(e.createdAt.epochMilliseconds));
|
|
769
|
+
function x() {
|
|
770
|
+
o.copy(window.location.href);
|
|
771
|
+
}
|
|
772
|
+
function y(d) {
|
|
773
|
+
return {
|
|
774
|
+
left: {
|
|
775
|
+
icon: d,
|
|
776
|
+
type: "icon"
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
function _(d) {
|
|
781
|
+
window.location.href = d;
|
|
782
|
+
}
|
|
783
|
+
function c(d) {
|
|
784
|
+
window.open(`https://maps.google.com/?q=${encodeURIComponent(W.format(d))}`, "_blank", "noopener,noreferrer");
|
|
785
|
+
}
|
|
786
|
+
return (d, w) => (a(), g("div", en, [
|
|
787
|
+
s("div", tn, [
|
|
788
|
+
s("div", nn, [
|
|
789
|
+
s("div", on, k(m.value), 1),
|
|
790
|
+
s("div", ln, [
|
|
791
|
+
U(d.$slots, "name", {}, () => [
|
|
792
|
+
i(t(Ee), {
|
|
793
|
+
text: e.name,
|
|
794
|
+
as: "h1",
|
|
795
|
+
class: "text-lg font-semibold text-primary"
|
|
796
|
+
}, null, 8, ["text"])
|
|
797
|
+
]),
|
|
798
|
+
e.identifier !== null ? (a(), g("span", an, k(t(n).t("wise_crm.detail_view.identifier", { value: e.identifier })), 1)) : b("", !0)
|
|
799
|
+
])
|
|
800
|
+
]),
|
|
801
|
+
s("div", rn, [
|
|
802
|
+
s("div", sn, [
|
|
803
|
+
e.email !== null ? (a(), h(z, {
|
|
804
|
+
key: 0,
|
|
805
|
+
value: e.email,
|
|
806
|
+
type: "email"
|
|
807
|
+
}, null, 8, ["value"])) : b("", !0),
|
|
808
|
+
e.mobilePhone !== null || e.phone !== null ? (a(), h(z, {
|
|
809
|
+
key: 1,
|
|
810
|
+
value: e.mobilePhone ?? e.phone ?? "",
|
|
811
|
+
type: "phone"
|
|
812
|
+
}, null, 8, ["value"])) : b("", !0),
|
|
813
|
+
e.address !== null ? (a(), h(z, {
|
|
814
|
+
key: 2,
|
|
815
|
+
value: t(W).format(e.address),
|
|
816
|
+
type: "address"
|
|
817
|
+
}, null, 8, ["value"])) : b("", !0),
|
|
818
|
+
U(d.$slots, "actions"),
|
|
819
|
+
i(t(S), {
|
|
820
|
+
icon: t(G),
|
|
821
|
+
label: t(n).t("wise_crm.detail_view.copy_link"),
|
|
822
|
+
variant: "tertiary",
|
|
823
|
+
size: "sm",
|
|
824
|
+
onClick: x
|
|
825
|
+
}, null, 8, ["icon", "label"]),
|
|
826
|
+
i(t(Ve), {
|
|
827
|
+
orientation: "vertical",
|
|
828
|
+
class: "mx-xs h-5"
|
|
829
|
+
}),
|
|
830
|
+
i(t(S), {
|
|
831
|
+
icon: t(K),
|
|
832
|
+
label: t(n).t("wise_crm.detail_view.close"),
|
|
833
|
+
variant: "tertiary",
|
|
834
|
+
size: "sm",
|
|
835
|
+
onClick: w[0] || (w[0] = (D) => t(l).goToReturnRoute())
|
|
836
|
+
}, null, 8, ["icon", "label"])
|
|
837
|
+
]),
|
|
838
|
+
s("div", cn, [
|
|
839
|
+
i(t(ne), { "popover-align": "end" }, {
|
|
840
|
+
trigger: p(() => [
|
|
841
|
+
i(t(S), {
|
|
842
|
+
icon: t(le),
|
|
843
|
+
label: t(n).t("wise_crm.detail_view.more_actions"),
|
|
844
|
+
variant: "tertiary",
|
|
845
|
+
size: "sm"
|
|
846
|
+
}, null, 8, ["icon", "label"])
|
|
847
|
+
]),
|
|
848
|
+
content: p(() => [
|
|
849
|
+
i(t(H), null, {
|
|
850
|
+
default: p(() => [
|
|
851
|
+
e.email !== null ? (a(), h(t(T), {
|
|
852
|
+
key: 0,
|
|
853
|
+
config: y(t(re)),
|
|
854
|
+
label: t(n).t("wise_crm.detail_view.send_email"),
|
|
855
|
+
onSelect: w[1] || (w[1] = (D) => _(`mailto:${e.email}`))
|
|
856
|
+
}, null, 8, ["config", "label"])) : b("", !0),
|
|
857
|
+
e.mobilePhone !== null || e.phone !== null ? (a(), h(t(T), {
|
|
858
|
+
key: 1,
|
|
859
|
+
config: y(t(M)),
|
|
860
|
+
label: t(n).t("wise_crm.detail_view.call"),
|
|
861
|
+
onSelect: w[2] || (w[2] = (D) => _(`tel:${e.mobilePhone ?? e.phone}`))
|
|
862
|
+
}, null, 8, ["config", "label"])) : b("", !0),
|
|
863
|
+
e.address !== null ? (a(), h(t(T), {
|
|
864
|
+
key: 2,
|
|
865
|
+
config: y(t(se)),
|
|
866
|
+
label: t(n).t("wise_crm.detail_view.open_address"),
|
|
867
|
+
onSelect: w[3] || (w[3] = (D) => c(e.address))
|
|
868
|
+
}, null, 8, ["config", "label"])) : b("", !0),
|
|
869
|
+
i(t(T), {
|
|
870
|
+
config: y(t(G)),
|
|
871
|
+
label: t(n).t("wise_crm.detail_view.copy_link"),
|
|
872
|
+
onSelect: x
|
|
873
|
+
}, null, 8, ["config", "label"])
|
|
874
|
+
]),
|
|
875
|
+
_: 1
|
|
876
|
+
}),
|
|
877
|
+
t(f)["menu-actions"] !== void 0 ? (a(), g(B, { key: 0 }, [
|
|
878
|
+
i(t(ze)),
|
|
879
|
+
i(t(H), null, {
|
|
880
|
+
default: p(() => [
|
|
881
|
+
U(d.$slots, "menu-actions")
|
|
882
|
+
]),
|
|
883
|
+
_: 3
|
|
884
|
+
})
|
|
885
|
+
], 64)) : b("", !0)
|
|
886
|
+
]),
|
|
887
|
+
_: 3
|
|
888
|
+
}),
|
|
889
|
+
i(t(S), {
|
|
890
|
+
icon: t(K),
|
|
891
|
+
label: t(n).t("wise_crm.detail_view.close"),
|
|
892
|
+
variant: "tertiary",
|
|
893
|
+
size: "sm",
|
|
894
|
+
onClick: w[4] || (w[4] = (D) => t(l).goToReturnRoute())
|
|
895
|
+
}, null, 8, ["icon", "label"])
|
|
896
|
+
])
|
|
897
|
+
])
|
|
898
|
+
]),
|
|
899
|
+
s("div", un, [
|
|
900
|
+
e.entityLabel !== null ? (a(), h(t(N), {
|
|
901
|
+
key: 0,
|
|
902
|
+
icon: e.entityType === t(mt).BUSINESS ? t(lt) : t(at),
|
|
903
|
+
label: e.entityLabel,
|
|
904
|
+
variant: "translucent",
|
|
905
|
+
color: "brand"
|
|
906
|
+
}, null, 8, ["icon", "label"])) : b("", !0),
|
|
907
|
+
e.status !== null ? (a(), h(t(N), {
|
|
908
|
+
key: 1,
|
|
909
|
+
label: e.status.label,
|
|
910
|
+
color: e.status.color,
|
|
911
|
+
variant: "translucent"
|
|
912
|
+
}, null, 8, ["label", "color"])) : b("", !0),
|
|
913
|
+
U(d.$slots, "badges"),
|
|
914
|
+
i(t(N), {
|
|
915
|
+
label: t(n).t("wise_crm.detail_view.since", { date: u.value }),
|
|
916
|
+
variant: "outline",
|
|
917
|
+
color: "gray"
|
|
918
|
+
}, null, 8, ["label"]),
|
|
919
|
+
U(d.$slots, "owner", {}, () => [
|
|
920
|
+
e.owner !== null ? (a(), h(t(N), {
|
|
921
|
+
key: 0,
|
|
922
|
+
icon: t(it),
|
|
923
|
+
label: e.owner,
|
|
924
|
+
variant: "outline",
|
|
925
|
+
color: "gray"
|
|
926
|
+
}, null, 8, ["icon", "label"])) : b("", !0)
|
|
927
|
+
])
|
|
928
|
+
])
|
|
929
|
+
]));
|
|
930
|
+
}
|
|
931
|
+
}), Sn = /* @__PURE__ */ $({
|
|
932
|
+
__name: "CrmDetailHeaderBadge",
|
|
933
|
+
props: {
|
|
934
|
+
uuid: {},
|
|
935
|
+
badge: {},
|
|
936
|
+
entity: {}
|
|
937
|
+
},
|
|
938
|
+
setup(r) {
|
|
939
|
+
const e = r, n = I(), l = Me("wiseCrmHeaderBadge", {
|
|
940
|
+
params: {
|
|
941
|
+
uuid: v(() => e.uuid),
|
|
942
|
+
badgeKey: v(() => e.badge.key),
|
|
943
|
+
entity: v(() => e.entity),
|
|
944
|
+
// Labels are translated by the host app, so refetch them in the new locale
|
|
945
|
+
locale: v(() => n.locale.value)
|
|
946
|
+
},
|
|
947
|
+
queryFn: () => C.fromPromise(f())
|
|
948
|
+
}), o = v(() => {
|
|
949
|
+
if (!l.result.value.isOk())
|
|
950
|
+
return null;
|
|
951
|
+
const m = l.result.value.getValue();
|
|
952
|
+
if (m === null)
|
|
953
|
+
return null;
|
|
954
|
+
const u = typeof m == "string" ? {
|
|
955
|
+
label: m
|
|
956
|
+
} : m, x = u.label.trim();
|
|
957
|
+
return x === "" ? null : {
|
|
958
|
+
...u,
|
|
959
|
+
label: x
|
|
960
|
+
};
|
|
961
|
+
});
|
|
962
|
+
async function f() {
|
|
963
|
+
try {
|
|
964
|
+
return await e.badge.getData({
|
|
965
|
+
uuid: e.uuid
|
|
966
|
+
});
|
|
967
|
+
} catch (m) {
|
|
968
|
+
return rt.error(new Error(`[wise-crm] Header badge "${e.badge.key}" failed to load`, {
|
|
969
|
+
cause: m
|
|
970
|
+
})), null;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
return (m, u) => t(l).isLoading.value ? (a(), h(t(He), {
|
|
974
|
+
key: 0,
|
|
975
|
+
"is-animated": !0,
|
|
976
|
+
class: "h-6 w-16"
|
|
977
|
+
})) : o.value !== null ? (a(), h(t(pt), {
|
|
978
|
+
key: 1,
|
|
979
|
+
initial: { opacity: 0 },
|
|
980
|
+
animate: { opacity: 1 },
|
|
981
|
+
transition: { duration: 0.15 },
|
|
982
|
+
class: "flex max-w-full min-w-0"
|
|
983
|
+
}, {
|
|
984
|
+
default: p(() => [
|
|
985
|
+
i(t(N), {
|
|
986
|
+
label: o.value.label,
|
|
987
|
+
icon: o.value.icon ?? e.badge.icon,
|
|
988
|
+
color: o.value.color ?? e.badge.color,
|
|
989
|
+
dot: o.value.dot ?? e.badge.dot,
|
|
990
|
+
variant: o.value.variant ?? e.badge.variant,
|
|
991
|
+
class: "max-w-full"
|
|
992
|
+
}, null, 8, ["label", "icon", "color", "dot", "variant"])
|
|
993
|
+
]),
|
|
994
|
+
_: 1
|
|
995
|
+
})) : b("", !0);
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
export {
|
|
999
|
+
de as N,
|
|
1000
|
+
Un as _,
|
|
1001
|
+
Cn as a,
|
|
1002
|
+
kn as b,
|
|
1003
|
+
In as c,
|
|
1004
|
+
Dn as d,
|
|
1005
|
+
Sn as e,
|
|
1006
|
+
It as f,
|
|
1007
|
+
$n as u
|
|
1008
|
+
};
|