@nexxtmove/ui 0.1.39 → 0.1.40
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/index.js
CHANGED
|
@@ -1219,7 +1219,7 @@ function D(A, e) {
|
|
|
1219
1219
|
const t = A < 0 ? "-" : "", a = Math.abs(A).toString().padStart(e, "0");
|
|
1220
1220
|
return t + a;
|
|
1221
1221
|
}
|
|
1222
|
-
const
|
|
1222
|
+
const L = {
|
|
1223
1223
|
// Year
|
|
1224
1224
|
y(A, e) {
|
|
1225
1225
|
const t = A.getFullYear(), a = t > 0 ? t : 1 - t;
|
|
@@ -1302,7 +1302,7 @@ const q = {
|
|
|
1302
1302
|
const a = A.getFullYear(), i = a > 0 ? a : 1 - a;
|
|
1303
1303
|
return t.ordinalNumber(i, { unit: "year" });
|
|
1304
1304
|
}
|
|
1305
|
-
return
|
|
1305
|
+
return L.y(A, e);
|
|
1306
1306
|
},
|
|
1307
1307
|
// Local week-numbering year
|
|
1308
1308
|
Y: function(A, e, t, a) {
|
|
@@ -1401,7 +1401,7 @@ const q = {
|
|
|
1401
1401
|
switch (e) {
|
|
1402
1402
|
case "M":
|
|
1403
1403
|
case "MM":
|
|
1404
|
-
return
|
|
1404
|
+
return L.M(A, e);
|
|
1405
1405
|
// 1st, 2nd, ..., 12th
|
|
1406
1406
|
case "Mo":
|
|
1407
1407
|
return t.ordinalNumber(a + 1, { unit: "month" });
|
|
@@ -1462,7 +1462,7 @@ const q = {
|
|
|
1462
1462
|
},
|
|
1463
1463
|
// Day of the month
|
|
1464
1464
|
d: function(A, e, t) {
|
|
1465
|
-
return e === "do" ? t.ordinalNumber(A.getDate(), { unit: "date" }) :
|
|
1465
|
+
return e === "do" ? t.ordinalNumber(A.getDate(), { unit: "date" }) : L.d(A, e);
|
|
1466
1466
|
},
|
|
1467
1467
|
// Day of year
|
|
1468
1468
|
D: function(A, e, t) {
|
|
@@ -1697,11 +1697,11 @@ const q = {
|
|
|
1697
1697
|
let a = A.getHours() % 12;
|
|
1698
1698
|
return a === 0 && (a = 12), t.ordinalNumber(a, { unit: "hour" });
|
|
1699
1699
|
}
|
|
1700
|
-
return
|
|
1700
|
+
return L.h(A, e);
|
|
1701
1701
|
},
|
|
1702
1702
|
// Hour [0-23]
|
|
1703
1703
|
H: function(A, e, t) {
|
|
1704
|
-
return e === "Ho" ? t.ordinalNumber(A.getHours(), { unit: "hour" }) :
|
|
1704
|
+
return e === "Ho" ? t.ordinalNumber(A.getHours(), { unit: "hour" }) : L.H(A, e);
|
|
1705
1705
|
},
|
|
1706
1706
|
// Hour [0-11]
|
|
1707
1707
|
K: function(A, e, t) {
|
|
@@ -1715,15 +1715,15 @@ const q = {
|
|
|
1715
1715
|
},
|
|
1716
1716
|
// Minute
|
|
1717
1717
|
m: function(A, e, t) {
|
|
1718
|
-
return e === "mo" ? t.ordinalNumber(A.getMinutes(), { unit: "minute" }) :
|
|
1718
|
+
return e === "mo" ? t.ordinalNumber(A.getMinutes(), { unit: "minute" }) : L.m(A, e);
|
|
1719
1719
|
},
|
|
1720
1720
|
// Second
|
|
1721
1721
|
s: function(A, e, t) {
|
|
1722
|
-
return e === "so" ? t.ordinalNumber(A.getSeconds(), { unit: "second" }) :
|
|
1722
|
+
return e === "so" ? t.ordinalNumber(A.getSeconds(), { unit: "second" }) : L.s(A, e);
|
|
1723
1723
|
},
|
|
1724
1724
|
// Fraction of second
|
|
1725
1725
|
S: function(A, e) {
|
|
1726
|
-
return
|
|
1726
|
+
return L.S(A, e);
|
|
1727
1727
|
},
|
|
1728
1728
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1729
1729
|
X: function(A, e, t) {
|
|
@@ -3242,10 +3242,11 @@ const Ka = {
|
|
|
3242
3242
|
icon: "user-slash",
|
|
3243
3243
|
color: "bg-red-500"
|
|
3244
3244
|
}
|
|
3245
|
-
},
|
|
3245
|
+
}, q = {
|
|
3246
3246
|
0: {
|
|
3247
3247
|
label: "Inactief",
|
|
3248
3248
|
color: "border-slate-300",
|
|
3249
|
+
icon: "eye-closed",
|
|
3249
3250
|
bgColor: "bg-slate-300",
|
|
3250
3251
|
fromColor: "from-slate-300",
|
|
3251
3252
|
toColor: "to-slate-300",
|
|
@@ -3254,6 +3255,7 @@ const Ka = {
|
|
|
3254
3255
|
1: {
|
|
3255
3256
|
label: "Latent",
|
|
3256
3257
|
color: "border-amber-500",
|
|
3258
|
+
icon: "eye-closed",
|
|
3257
3259
|
bgColor: "bg-amber-500",
|
|
3258
3260
|
fromColor: "from-amber-500",
|
|
3259
3261
|
toColor: "to-amber-500",
|
|
@@ -3262,6 +3264,7 @@ const Ka = {
|
|
|
3262
3264
|
2: {
|
|
3263
3265
|
label: "Oriëntatie",
|
|
3264
3266
|
color: "border-purple-500",
|
|
3267
|
+
icon: "building-magnifying-glass",
|
|
3265
3268
|
bgColor: "bg-purple-500",
|
|
3266
3269
|
fromColor: "from-purple-500",
|
|
3267
3270
|
toColor: "to-purple-500",
|
|
@@ -3270,6 +3273,7 @@ const Ka = {
|
|
|
3270
3273
|
3: {
|
|
3271
3274
|
label: "Actief zoeken",
|
|
3272
3275
|
color: "border-yellow-500",
|
|
3276
|
+
icon: "house-person-return",
|
|
3273
3277
|
bgColor: "bg-yellow-500",
|
|
3274
3278
|
fromColor: "from-yellow-500",
|
|
3275
3279
|
toColor: "to-yellow-500",
|
|
@@ -3278,6 +3282,7 @@ const Ka = {
|
|
|
3278
3282
|
4: {
|
|
3279
3283
|
label: "Selectie",
|
|
3280
3284
|
color: "border-blue-500",
|
|
3285
|
+
icon: "handshake",
|
|
3281
3286
|
bgColor: "bg-blue-500",
|
|
3282
3287
|
fromColor: "from-blue-500",
|
|
3283
3288
|
toColor: "to-blue-500",
|
|
@@ -3286,6 +3291,7 @@ const Ka = {
|
|
|
3286
3291
|
5: {
|
|
3287
3292
|
label: "Transactie",
|
|
3288
3293
|
color: "border-emerald-500",
|
|
3294
|
+
icon: "pencil-mechanical",
|
|
3289
3295
|
bgColor: "bg-emerald-500",
|
|
3290
3296
|
fromColor: "from-emerald-500",
|
|
3291
3297
|
toColor: "to-emerald-500",
|
|
@@ -3294,6 +3300,7 @@ const Ka = {
|
|
|
3294
3300
|
6: {
|
|
3295
3301
|
label: "Wonen",
|
|
3296
3302
|
color: "border-green-500",
|
|
3303
|
+
icon: "house-heart",
|
|
3297
3304
|
bgColor: "bg-green-500",
|
|
3298
3305
|
fromColor: "from-green-500",
|
|
3299
3306
|
toColor: "to-green-500",
|
|
@@ -3321,47 +3328,40 @@ const Ka = {
|
|
|
3321
3328
|
percentageExplanaition: {}
|
|
3322
3329
|
},
|
|
3323
3330
|
setup(A) {
|
|
3324
|
-
const e =
|
|
3325
|
-
Latent: "eye-closed",
|
|
3326
|
-
Oriëntatie: "building-magnifying-glass",
|
|
3327
|
-
"Actief zoeken": "house-person-return",
|
|
3328
|
-
Selectie: "handshake",
|
|
3329
|
-
Transactie: "pencil-mechanical",
|
|
3330
|
-
Wonen: "house-heart"
|
|
3331
|
-
}, t = b(A.animated ? 0 : A.amount ?? 0);
|
|
3331
|
+
const e = b(A.animated ? 0 : A.amount ?? 0);
|
|
3332
3332
|
gA(() => {
|
|
3333
|
-
A.animated && A.amount !== void 0 && (
|
|
3333
|
+
A.animated && A.amount !== void 0 && (e.value = A.amount);
|
|
3334
3334
|
});
|
|
3335
|
-
const
|
|
3336
|
-
const
|
|
3337
|
-
if (A.title &&
|
|
3338
|
-
const
|
|
3339
|
-
|
|
3335
|
+
const t = x(() => A.title && Object.values(q).find((n) => n.label === A.title)?.icon || null), a = x(() => {
|
|
3336
|
+
const i = [];
|
|
3337
|
+
if (A.title && i.push(A.title), A.amount !== void 0 && i.push(`${A.amount} contacten`), A.percentage !== void 0) {
|
|
3338
|
+
const n = A.percentage > 0 ? "+" : "", r = A.percentageExplanaition ? ` ${A.percentageExplanaition}` : "";
|
|
3339
|
+
i.push(`${n}${A.percentage}%${r}`);
|
|
3340
3340
|
}
|
|
3341
|
-
return
|
|
3341
|
+
return i.join(", ");
|
|
3342
3342
|
});
|
|
3343
|
-
return (
|
|
3344
|
-
"aria-label":
|
|
3345
|
-
class: c(["flex rounded-xl bg-white outline outline-gray-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cornflower-blue-500",
|
|
3343
|
+
return (i, n) => (m(), w(fe(A.as), {
|
|
3344
|
+
"aria-label": a.value,
|
|
3345
|
+
class: c(["flex rounded-xl bg-white outline outline-gray-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cornflower-blue-500", t.value ? "gap-6 p-1.5" : "p-4"])
|
|
3346
3346
|
}, {
|
|
3347
3347
|
default: X(() => [
|
|
3348
|
-
|
|
3348
|
+
t.value ? (m(), d("div", Li, [
|
|
3349
3349
|
f(N, {
|
|
3350
|
-
name:
|
|
3350
|
+
name: t.value,
|
|
3351
3351
|
class: "text-2xl text-purple-500",
|
|
3352
3352
|
"aria-hidden": "true"
|
|
3353
3353
|
}, null, 8, ["name"])
|
|
3354
3354
|
])) : Q("", !0),
|
|
3355
3355
|
I("div", {
|
|
3356
|
-
class: c(["flex flex-col items-start gap-1",
|
|
3356
|
+
class: c(["flex flex-col items-start gap-1", t.value ? "py-6 pr-4" : ""])
|
|
3357
3357
|
}, [
|
|
3358
3358
|
A.title ? (m(), d("span", ji, F(A.title), 1)) : Q("", !0),
|
|
3359
3359
|
A.amount !== void 0 ? (m(), d("span", {
|
|
3360
3360
|
key: 1,
|
|
3361
|
-
class: c(["heading-1",
|
|
3361
|
+
class: c(["heading-1", t.value ? "text-purple-500" : "text-sapphire-900"])
|
|
3362
3362
|
}, [
|
|
3363
3363
|
f(xe, {
|
|
3364
|
-
value:
|
|
3364
|
+
value: e.value,
|
|
3365
3365
|
delay: A.delay
|
|
3366
3366
|
}, null, 8, ["value", "delay"])
|
|
3367
3367
|
], 2)) : Q("", !0),
|
|
@@ -4595,7 +4595,7 @@ const Zn = { render: Rn }, Gn = { class: "flex items-center justify-end self-str
|
|
|
4595
4595
|
const e = A, t = x(() => {
|
|
4596
4596
|
const r = e.phase.phase.value, o = e.phases[e.index + 1];
|
|
4597
4597
|
if (!o) return "";
|
|
4598
|
-
const s =
|
|
4598
|
+
const s = q[r].fromColor, E = q[o.phase.value].toColor;
|
|
4599
4599
|
return `${s} ${E}`;
|
|
4600
4600
|
}), a = (r) => {
|
|
4601
4601
|
if (!r) return "";
|
|
@@ -4654,11 +4654,11 @@ const Zn = { render: Rn }, Gn = { class: "flex items-center justify-end self-str
|
|
|
4654
4654
|
])
|
|
4655
4655
|
])) : Q("", !0),
|
|
4656
4656
|
I("div", {
|
|
4657
|
-
class: c(["absolute top-0 bottom-0 left-5 w-0 border-l", P(
|
|
4657
|
+
class: c(["absolute top-0 bottom-0 left-5 w-0 border-l", P(q)[A.phase.phase.value].color])
|
|
4658
4658
|
}, null, 2),
|
|
4659
4659
|
A.isSplitView ? (m(), d("div", {
|
|
4660
4660
|
key: 1,
|
|
4661
|
-
class: c(["absolute top-0 right-5 bottom-0 w-0 border-l", P(
|
|
4661
|
+
class: c(["absolute top-0 right-5 bottom-0 w-0 border-l", P(q)[A.phase.phase.value].color])
|
|
4662
4662
|
}, null, 2)) : Q("", !0),
|
|
4663
4663
|
(m(!0), d(V, null, Z(A.phase.events, (s) => (m(), w(Ir, {
|
|
4664
4664
|
key: s.id,
|
|
@@ -4670,9 +4670,9 @@ const Zn = { render: Rn }, Gn = { class: "flex items-center justify-end self-str
|
|
|
4670
4670
|
class: c(["relative flex flex-col items-center bg-white pt-8 pb-24 text-center", { "pl-16": !A.isSplitView }])
|
|
4671
4671
|
}, [
|
|
4672
4672
|
I("div", {
|
|
4673
|
-
class: c(["flex items-center gap-2 rounded-full px-12 py-4", [P(
|
|
4673
|
+
class: c(["flex items-center gap-2 rounded-full px-12 py-4", [P(q)[A.phase.phase.value].bgColor, P(q)[A.phase.phase.value].textColor]])
|
|
4674
4674
|
}, [
|
|
4675
|
-
I("span", fr, F(P(
|
|
4675
|
+
I("span", fr, F(P(q)[A.phase.phase.value].label), 1),
|
|
4676
4676
|
n() ? (m(), w(N, {
|
|
4677
4677
|
key: 0,
|
|
4678
4678
|
name: n() === "up" ? "arrow-up" : "arrow-down",
|
|
@@ -4682,7 +4682,7 @@ const Zn = { render: Rn }, Gn = { class: "flex items-center justify-end self-str
|
|
|
4682
4682
|
I("span", zr, F(i()), 1),
|
|
4683
4683
|
A.isSplitView ? (m(), d("div", {
|
|
4684
4684
|
key: 0,
|
|
4685
|
-
class: c(["mt-4 h-px w-[75%]", P(
|
|
4685
|
+
class: c(["mt-4 h-px w-[75%]", P(q)[A.phase.phase.value].bgColor])
|
|
4686
4686
|
}, null, 2)) : Q("", !0),
|
|
4687
4687
|
A.isLast ? Q("", !0) : (m(), d("div", Qr)),
|
|
4688
4688
|
I("div", {
|
package/package.json
CHANGED
|
@@ -4,8 +4,6 @@ import NexxtAnimatedNumber from '../AnimatedNumber/AnimatedNumber.vue'
|
|
|
4
4
|
import { computed, onMounted, ref } from 'vue'
|
|
5
5
|
import { PHASE_MAP } from '../TimelineEvent/TimelineTypes'
|
|
6
6
|
|
|
7
|
-
type Phase = (typeof PHASE_MAP)[keyof typeof PHASE_MAP]['label']
|
|
8
|
-
|
|
9
7
|
interface NexxtCustomerJourneyTileProps {
|
|
10
8
|
as?: keyof HTMLElementTagNameMap
|
|
11
9
|
title?: string
|
|
@@ -16,15 +14,6 @@ interface NexxtCustomerJourneyTileProps {
|
|
|
16
14
|
percentageExplanaition?: string
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
const PHASE_ICON_MAP: Partial<Record<Phase, string>> = {
|
|
20
|
-
Latent: 'eye-closed',
|
|
21
|
-
Oriëntatie: 'building-magnifying-glass',
|
|
22
|
-
'Actief zoeken': 'house-person-return',
|
|
23
|
-
Selectie: 'handshake',
|
|
24
|
-
Transactie: 'pencil-mechanical',
|
|
25
|
-
Wonen: 'house-heart',
|
|
26
|
-
}
|
|
27
|
-
|
|
28
17
|
defineOptions({
|
|
29
18
|
name: 'NexxtCustomerJourneyTile',
|
|
30
19
|
})
|
|
@@ -47,7 +36,8 @@ onMounted(() => {
|
|
|
47
36
|
|
|
48
37
|
const icon = computed(() => {
|
|
49
38
|
if (!title) return null
|
|
50
|
-
|
|
39
|
+
const phase = Object.values(PHASE_MAP).find((p) => p.label === title)
|
|
40
|
+
return (phase?.icon as InstanceType<typeof NexxtIcon>['name']) || null
|
|
51
41
|
})
|
|
52
42
|
|
|
53
43
|
const ariaLabel = computed(() => {
|
|
@@ -34,6 +34,7 @@ export interface TimelineResponse {
|
|
|
34
34
|
export interface PhaseConfig {
|
|
35
35
|
label: string
|
|
36
36
|
color: string
|
|
37
|
+
icon: string
|
|
37
38
|
bgColor: string
|
|
38
39
|
fromColor: string
|
|
39
40
|
toColor: string
|
|
@@ -180,6 +181,7 @@ export const PHASE_MAP: Record<number, PhaseConfig> = {
|
|
|
180
181
|
0: {
|
|
181
182
|
label: 'Inactief',
|
|
182
183
|
color: 'border-slate-300',
|
|
184
|
+
icon: 'eye-closed',
|
|
183
185
|
bgColor: 'bg-slate-300',
|
|
184
186
|
fromColor: 'from-slate-300',
|
|
185
187
|
toColor: 'to-slate-300',
|
|
@@ -188,6 +190,7 @@ export const PHASE_MAP: Record<number, PhaseConfig> = {
|
|
|
188
190
|
1: {
|
|
189
191
|
label: 'Latent',
|
|
190
192
|
color: 'border-amber-500',
|
|
193
|
+
icon: 'eye-closed',
|
|
191
194
|
bgColor: 'bg-amber-500',
|
|
192
195
|
fromColor: 'from-amber-500',
|
|
193
196
|
toColor: 'to-amber-500',
|
|
@@ -196,6 +199,7 @@ export const PHASE_MAP: Record<number, PhaseConfig> = {
|
|
|
196
199
|
2: {
|
|
197
200
|
label: 'Oriëntatie',
|
|
198
201
|
color: 'border-purple-500',
|
|
202
|
+
icon: 'building-magnifying-glass',
|
|
199
203
|
bgColor: 'bg-purple-500',
|
|
200
204
|
fromColor: 'from-purple-500',
|
|
201
205
|
toColor: 'to-purple-500',
|
|
@@ -204,6 +208,7 @@ export const PHASE_MAP: Record<number, PhaseConfig> = {
|
|
|
204
208
|
3: {
|
|
205
209
|
label: 'Actief zoeken',
|
|
206
210
|
color: 'border-yellow-500',
|
|
211
|
+
icon: 'house-person-return',
|
|
207
212
|
bgColor: 'bg-yellow-500',
|
|
208
213
|
fromColor: 'from-yellow-500',
|
|
209
214
|
toColor: 'to-yellow-500',
|
|
@@ -212,6 +217,7 @@ export const PHASE_MAP: Record<number, PhaseConfig> = {
|
|
|
212
217
|
4: {
|
|
213
218
|
label: 'Selectie',
|
|
214
219
|
color: 'border-blue-500',
|
|
220
|
+
icon: 'handshake',
|
|
215
221
|
bgColor: 'bg-blue-500',
|
|
216
222
|
fromColor: 'from-blue-500',
|
|
217
223
|
toColor: 'to-blue-500',
|
|
@@ -220,6 +226,7 @@ export const PHASE_MAP: Record<number, PhaseConfig> = {
|
|
|
220
226
|
5: {
|
|
221
227
|
label: 'Transactie',
|
|
222
228
|
color: 'border-emerald-500',
|
|
229
|
+
icon: 'pencil-mechanical',
|
|
223
230
|
bgColor: 'bg-emerald-500',
|
|
224
231
|
fromColor: 'from-emerald-500',
|
|
225
232
|
toColor: 'to-emerald-500',
|
|
@@ -228,6 +235,7 @@ export const PHASE_MAP: Record<number, PhaseConfig> = {
|
|
|
228
235
|
6: {
|
|
229
236
|
label: 'Wonen',
|
|
230
237
|
color: 'border-green-500',
|
|
238
|
+
icon: 'house-heart',
|
|
231
239
|
bgColor: 'bg-green-500',
|
|
232
240
|
fromColor: 'from-green-500',
|
|
233
241
|
toColor: 'to-green-500',
|