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