@m3ui-vue/m3ui-vue 1.3.4 → 1.3.5
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/API.md +3 -2
- package/dist/api.json +1 -1
- package/dist/components/MFloorPlan.vue.d.ts +21 -2
- package/dist/m3ui.js +185 -180
- package/dist/m3ui.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/MFloorPlan.test.ts +38 -0
- package/src/components/MFloorPlan.vue +29 -8
package/dist/m3ui.js
CHANGED
|
@@ -10073,6 +10073,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10073
10073
|
type: Boolean,
|
|
10074
10074
|
default: !0
|
|
10075
10075
|
},
|
|
10076
|
+
tableSnap: { default: "point" },
|
|
10076
10077
|
chairs: {
|
|
10077
10078
|
type: Boolean,
|
|
10078
10079
|
default: !0
|
|
@@ -10298,23 +10299,26 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10298
10299
|
clusters: o,
|
|
10299
10300
|
links: s
|
|
10300
10301
|
};
|
|
10301
|
-
}).filter((e) => !!e)), M = null, te = !1, N = (e) => r.grid ? Math.round(e / r.grid) * r.grid : e
|
|
10302
|
-
|
|
10302
|
+
}).filter((e) => !!e)), M = null, te = !1, N = (e) => r.grid ? Math.round(e / r.grid) * r.grid : e, P = (e) => {
|
|
10303
|
+
let t = r.grid;
|
|
10304
|
+
return !t || r.tableSnap !== "cell" ? N(e) : Math.round((e - t / 2) / t) * t + t / 2;
|
|
10305
|
+
};
|
|
10306
|
+
function ne(e, t, n) {
|
|
10303
10307
|
let i = E(e);
|
|
10304
10308
|
return {
|
|
10305
10309
|
x: Math.min(r.width - i.w / 2, Math.max(i.w / 2, t)),
|
|
10306
10310
|
y: Math.min(r.height - i.h / 2, Math.max(i.h / 2, n))
|
|
10307
10311
|
};
|
|
10308
10312
|
}
|
|
10309
|
-
let
|
|
10310
|
-
function
|
|
10313
|
+
let re = 0, ie = !1;
|
|
10314
|
+
function ae(e, t) {
|
|
10311
10315
|
if (!r.editable || e.button !== 0 || d.value !== "select") return;
|
|
10312
10316
|
e.stopPropagation(), f.value = null;
|
|
10313
10317
|
let n = e.pointerType === "touch";
|
|
10314
|
-
|
|
10315
|
-
M && !M.moved && (
|
|
10316
|
-
}, 450) : o.value.includes(t.id)
|
|
10317
|
-
let a = le(o.value.includes(t.id) ? o.value : [t.id]);
|
|
10318
|
+
ie = !1, clearTimeout(re), n ? re = window.setTimeout(() => {
|
|
10319
|
+
M && !M.moved && (ie = !0, o.value = o.value.includes(t.id) ? o.value.filter((e) => e !== t.id) : [...o.value, t.id], navigator.vibrate?.(10));
|
|
10320
|
+
}, 450) : !o.value.includes(t.id) && !le.value && (o.value = e.shiftKey || e.ctrlKey || e.metaKey ? [...o.value, t.id] : [t.id]);
|
|
10321
|
+
let a = le.value ? [t.id] : de(o.value.includes(t.id) ? o.value : [t.id]);
|
|
10318
10322
|
M = {
|
|
10319
10323
|
id: e.pointerId,
|
|
10320
10324
|
sx: e.clientX,
|
|
@@ -10324,25 +10328,25 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10324
10328
|
y: e.y
|
|
10325
10329
|
}])),
|
|
10326
10330
|
moved: !1,
|
|
10327
|
-
pick: n && !o.value.includes(t.id) ? t.id : void 0
|
|
10328
|
-
}, window.addEventListener("pointermove",
|
|
10331
|
+
pick: n && !le.value && !o.value.includes(t.id) ? t.id : void 0
|
|
10332
|
+
}, window.addEventListener("pointermove", oe), window.addEventListener("pointerup", se), window.addEventListener("pointercancel", se);
|
|
10329
10333
|
}
|
|
10330
|
-
function
|
|
10334
|
+
function oe(e) {
|
|
10331
10335
|
if (!M || e.pointerId !== M.id) return;
|
|
10332
10336
|
let t = (e.clientX - M.sx) / w.value, n = (e.clientY - M.sy) / w.value;
|
|
10333
10337
|
if (!M.moved && Math.hypot(e.clientX - M.sx, e.clientY - M.sy) < (e.pointerType === "touch" ? 8 : 4)) return;
|
|
10334
|
-
M.moved || (clearTimeout(
|
|
10338
|
+
M.moved || (clearTimeout(re), M.pick !== void 0 && (o.value = [M.pick])), M.moved = !0;
|
|
10335
10339
|
let r = /* @__PURE__ */ new Map();
|
|
10336
|
-
for (let [e, a] of M.start) r.set(e,
|
|
10340
|
+
for (let [e, a] of M.start) r.set(e, ne(i.value.find((t) => t.id === e), a.x + t, a.y + n));
|
|
10337
10341
|
O.value = r;
|
|
10338
10342
|
}
|
|
10339
|
-
function
|
|
10343
|
+
function se(e) {
|
|
10340
10344
|
if (!M || e.pointerId !== M.id) return;
|
|
10341
|
-
clearTimeout(
|
|
10345
|
+
clearTimeout(re), ie && (te = !0, setTimeout(() => te = !1)), window.removeEventListener("pointermove", oe), window.removeEventListener("pointerup", se), window.removeEventListener("pointercancel", se);
|
|
10342
10346
|
let t = O.value, n = M.moved && t && e.type !== "pointercancel";
|
|
10343
|
-
M = null, O.value = null, n && (te = !0, setTimeout(() => te = !1),
|
|
10347
|
+
M = null, O.value = null, n && (te = !0, setTimeout(() => te = !1), ce(new Map([...t].map(([e, t]) => [e, ne(i.value.find((t) => t.id === e), P(t.x), P(t.y))]))));
|
|
10344
10348
|
}
|
|
10345
|
-
function
|
|
10349
|
+
function ce(e) {
|
|
10346
10350
|
g(), i.value = i.value.map((t) => e.has(t.id) ? {
|
|
10347
10351
|
...t,
|
|
10348
10352
|
...e.get(t.id)
|
|
@@ -10351,16 +10355,17 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10351
10355
|
...t
|
|
10352
10356
|
})));
|
|
10353
10357
|
}
|
|
10354
|
-
|
|
10355
|
-
|
|
10358
|
+
let le = L(() => r.editable && r.selectable === "multiple");
|
|
10359
|
+
function ue(e, t) {
|
|
10360
|
+
te || (le.value ? o.value = o.value.includes(t.id) ? o.value.filter((e) => e !== t.id) : [...o.value, t.id] : r.editable && !(e.shiftKey || e.ctrlKey || e.metaKey) ? o.value = [t.id] : !r.editable && r.selectable === "single" ? o.value = o.value.length === 1 && o.value[0] === t.id ? [] : [t.id] : !r.editable && r.selectable === "multiple" && (o.value = o.value.includes(t.id) ? o.value.filter((e) => e !== t.id) : [...o.value, t.id]), b("table-click", t, e));
|
|
10356
10361
|
}
|
|
10357
|
-
function
|
|
10362
|
+
function de(e) {
|
|
10358
10363
|
if (!r.dragMerged) return e;
|
|
10359
10364
|
let t = new Set(e);
|
|
10360
10365
|
for (let n of e) for (let e of a.value) e.tables.includes(n) && e.tables.forEach((e) => t.add(e));
|
|
10361
10366
|
return [...t];
|
|
10362
10367
|
}
|
|
10363
|
-
function
|
|
10368
|
+
function fe(e, t) {
|
|
10364
10369
|
if (e.key === "Enter" || e.key === " ") {
|
|
10365
10370
|
e.preventDefault(), b("table-click", t, e);
|
|
10366
10371
|
return;
|
|
@@ -10373,13 +10378,13 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10373
10378
|
}[e.key];
|
|
10374
10379
|
if (!n || !r.editable) return;
|
|
10375
10380
|
e.preventDefault();
|
|
10376
|
-
let a = (r.grid || 1) * (e.shiftKey ? 5 : 1), s =
|
|
10377
|
-
|
|
10381
|
+
let a = (r.grid || 1) * (e.shiftKey ? 5 : 1), s = de(o.value.includes(t.id) ? o.value : [t.id]);
|
|
10382
|
+
ce(new Map(i.value.filter((e) => s.includes(e.id)).map((e) => [e.id, ne(e, e.x + n[0] * a, e.y + n[1] * a)])));
|
|
10378
10383
|
}
|
|
10379
10384
|
Ge(() => {
|
|
10380
|
-
window.removeEventListener("pointermove",
|
|
10385
|
+
window.removeEventListener("pointermove", oe), window.removeEventListener("pointerup", se), window.removeEventListener("pointercancel", se);
|
|
10381
10386
|
});
|
|
10382
|
-
let
|
|
10387
|
+
let pe = {
|
|
10383
10388
|
door: {
|
|
10384
10389
|
label: "Door",
|
|
10385
10390
|
icon: "door_front",
|
|
@@ -10437,21 +10442,21 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10437
10442
|
height: 30,
|
|
10438
10443
|
shape: "text"
|
|
10439
10444
|
}
|
|
10440
|
-
},
|
|
10441
|
-
let e = { ...
|
|
10445
|
+
}, me = L(() => {
|
|
10446
|
+
let e = { ...pe };
|
|
10442
10447
|
for (let [t, n] of Object.entries(r.decorKinds ?? {})) e[t] = {
|
|
10443
10448
|
...e[t],
|
|
10444
10449
|
...n
|
|
10445
10450
|
};
|
|
10446
10451
|
return e;
|
|
10447
|
-
}),
|
|
10452
|
+
}), he = (e) => me.value[e.kind] ?? {
|
|
10448
10453
|
width: 40,
|
|
10449
10454
|
height: 40
|
|
10450
|
-
},
|
|
10451
|
-
w: e.width ??
|
|
10452
|
-
h: e.height ??
|
|
10455
|
+
}, ge = (e) => ({
|
|
10456
|
+
w: e.width ?? he(e).width,
|
|
10457
|
+
h: e.height ?? he(e).height
|
|
10453
10458
|
});
|
|
10454
|
-
function
|
|
10459
|
+
function _e(e) {
|
|
10455
10460
|
let t = e.shape ?? "box";
|
|
10456
10461
|
if (t === "text") return {};
|
|
10457
10462
|
let n = e.color ?? (t === "bar" ? "surface-container-highest" : "surface-container-high");
|
|
@@ -10460,7 +10465,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10460
10465
|
borderRadius: t === "round" ? "9999px" : t === "bar" ? "2px" : "8px"
|
|
10461
10466
|
};
|
|
10462
10467
|
}
|
|
10463
|
-
function
|
|
10468
|
+
function ve(e) {
|
|
10464
10469
|
let t = e ?? "secondary";
|
|
10465
10470
|
return k.has(t) ? {
|
|
10466
10471
|
background: `color-mix(in srgb, var(--color-${t}-container) 45%, transparent)`,
|
|
@@ -10470,14 +10475,14 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10470
10475
|
borderColor: t
|
|
10471
10476
|
};
|
|
10472
10477
|
}
|
|
10473
|
-
let
|
|
10478
|
+
let ye = (e, t) => f.value?.kind === e && f.value.id === t, be = (e) => {
|
|
10474
10479
|
let t = S.value.getBoundingClientRect();
|
|
10475
10480
|
return {
|
|
10476
10481
|
x: (e.clientX - t.left) / w.value,
|
|
10477
10482
|
y: (e.clientY - t.top) / w.value
|
|
10478
10483
|
};
|
|
10479
10484
|
};
|
|
10480
|
-
function
|
|
10485
|
+
function xe(e, t, n) {
|
|
10481
10486
|
S.value?.focus({ preventScroll: !0 });
|
|
10482
10487
|
let r = e.clientX, i = e.clientY, a = !1, o = (n) => {
|
|
10483
10488
|
n.pointerId === e.pointerId && (!a && Math.hypot(n.clientX - r, n.clientY - i) < 4 || (a = !0, t((n.clientX - r) / w.value, (n.clientY - i) / w.value)));
|
|
@@ -10486,14 +10491,14 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10486
10491
|
};
|
|
10487
10492
|
window.addEventListener("pointermove", o), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", s);
|
|
10488
10493
|
}
|
|
10489
|
-
let
|
|
10490
|
-
function
|
|
10494
|
+
let Se = tt(null), Ce = L(() => s.value.map((e) => Se.value?.id === e.id ? Se.value : e).concat(Se.value && !s.value.some((e) => e.id === Se.value.id) ? [Se.value] : []));
|
|
10495
|
+
function we(e, t, n) {
|
|
10491
10496
|
r.editable && d.value === "select" && e.button === 0 && (e.stopPropagation(), f.value = {
|
|
10492
10497
|
kind: "area",
|
|
10493
10498
|
id: t.id
|
|
10494
|
-
}, o.value = [],
|
|
10499
|
+
}, o.value = [], xe(e, (e, i) => {
|
|
10495
10500
|
if (!n) {
|
|
10496
|
-
|
|
10501
|
+
Se.value = {
|
|
10497
10502
|
...t,
|
|
10498
10503
|
x: t.x + e,
|
|
10499
10504
|
y: t.y + i
|
|
@@ -10501,7 +10506,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10501
10506
|
return;
|
|
10502
10507
|
}
|
|
10503
10508
|
let a = r.grid || 20, o = n.includes("w"), s = n[0] === "n", c = Math.max(a, t.width + (o ? -e : e)), l = Math.max(a, t.height + (s ? -i : i));
|
|
10504
|
-
|
|
10509
|
+
Se.value = {
|
|
10505
10510
|
...t,
|
|
10506
10511
|
x: o ? t.x + t.width - c : t.x,
|
|
10507
10512
|
y: s ? t.y + t.height - l : t.y,
|
|
@@ -10509,8 +10514,8 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10509
10514
|
height: l
|
|
10510
10515
|
};
|
|
10511
10516
|
}, () => {
|
|
10512
|
-
let e =
|
|
10513
|
-
|
|
10517
|
+
let e = Se.value;
|
|
10518
|
+
Se.value = null, g(), s.value = s.value.map((n) => n.id === t.id ? {
|
|
10514
10519
|
...e,
|
|
10515
10520
|
x: N(e.x),
|
|
10516
10521
|
y: N(e.y),
|
|
@@ -10519,15 +10524,15 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10519
10524
|
} : n);
|
|
10520
10525
|
}));
|
|
10521
10526
|
}
|
|
10522
|
-
let
|
|
10523
|
-
function
|
|
10527
|
+
let Te = tt(null), Ee = L(() => u.value.map((e) => Te.value?.id === e.id ? Te.value : e));
|
|
10528
|
+
function De(e, t, n = !1) {
|
|
10524
10529
|
if (!r.editable || d.value !== "select" || e.button !== 0) return;
|
|
10525
10530
|
e.stopPropagation(), f.value = {
|
|
10526
10531
|
kind: "decor",
|
|
10527
10532
|
id: t.id
|
|
10528
10533
|
}, o.value = [];
|
|
10529
|
-
let i =
|
|
10530
|
-
|
|
10534
|
+
let i = ge(t);
|
|
10535
|
+
xe(e, (e, r) => Te.value = n ? {
|
|
10531
10536
|
...t,
|
|
10532
10537
|
width: Math.max(10, i.w + e * 2),
|
|
10533
10538
|
height: Math.max(6, i.h + r * 2)
|
|
@@ -10536,8 +10541,8 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10536
10541
|
x: t.x + e,
|
|
10537
10542
|
y: t.y + r
|
|
10538
10543
|
}, () => {
|
|
10539
|
-
let e =
|
|
10540
|
-
|
|
10544
|
+
let e = Te.value;
|
|
10545
|
+
Te.value = null, g(), u.value = u.value.map((r) => r.id === t.id ? n ? {
|
|
10541
10546
|
...e,
|
|
10542
10547
|
width: Math.round(e.width),
|
|
10543
10548
|
height: Math.round(e.height)
|
|
@@ -10548,53 +10553,53 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10548
10553
|
} : r);
|
|
10549
10554
|
});
|
|
10550
10555
|
}
|
|
10551
|
-
let
|
|
10552
|
-
function
|
|
10556
|
+
let Oe = tt(null), ke = L(() => l.value.map((e) => Oe.value?.id === e.id ? Oe.value : e)), Ae = (e) => e.points.map(([e, t], n) => `${n ? "L" : "M"}${e * w.value} ${t * w.value}`).join("");
|
|
10557
|
+
function je(e, t, n = -1) {
|
|
10553
10558
|
r.editable && d.value === "select" && e.button === 0 && (e.stopPropagation(), f.value = {
|
|
10554
10559
|
kind: "wall",
|
|
10555
10560
|
id: t.id,
|
|
10556
10561
|
...n >= 0 && { vertex: n }
|
|
10557
|
-
}, o.value = [],
|
|
10558
|
-
|
|
10562
|
+
}, o.value = [], xe(e, (e, r) => {
|
|
10563
|
+
Oe.value = {
|
|
10559
10564
|
...t,
|
|
10560
10565
|
points: t.points.map(([t, i], a) => n < 0 || a === n ? [t + e, i + r] : [t, i])
|
|
10561
10566
|
};
|
|
10562
10567
|
}, () => {
|
|
10563
|
-
let e =
|
|
10564
|
-
|
|
10568
|
+
let e = Oe.value;
|
|
10569
|
+
Oe.value = null, g(), l.value = l.value.map((n) => n.id === t.id ? {
|
|
10565
10570
|
...e,
|
|
10566
10571
|
points: e.points.map(([e, t]) => [N(e), N(t)])
|
|
10567
10572
|
} : n);
|
|
10568
10573
|
}));
|
|
10569
10574
|
}
|
|
10570
|
-
let
|
|
10571
|
-
function
|
|
10575
|
+
let Me = q(null), Ne = q(null), Pe = 0, Fe = (e) => `${e}${Date.now().toString(36)}${Pe++}`;
|
|
10576
|
+
function Ie(e) {
|
|
10572
10577
|
if (!r.editable) return;
|
|
10573
10578
|
if (d.value === "select") {
|
|
10574
|
-
(e.target === e.currentTarget || e.target.closest("svg") ===
|
|
10579
|
+
(e.target === e.currentTarget || e.target.closest("svg") === ze.value) && (o.value = [], f.value = null);
|
|
10575
10580
|
return;
|
|
10576
10581
|
}
|
|
10577
|
-
let t =
|
|
10582
|
+
let t = be(e), n = [N(t.x), N(t.y)];
|
|
10578
10583
|
if (d.value === "wall") {
|
|
10579
|
-
|
|
10584
|
+
Me.value = [...Me.value ?? [n], n];
|
|
10580
10585
|
return;
|
|
10581
10586
|
}
|
|
10582
|
-
let i =
|
|
10583
|
-
|
|
10587
|
+
let i = Fe("area");
|
|
10588
|
+
Se.value = {
|
|
10584
10589
|
id: i,
|
|
10585
10590
|
x: n[0],
|
|
10586
10591
|
y: n[1],
|
|
10587
10592
|
width: 0,
|
|
10588
10593
|
height: 0
|
|
10589
|
-
},
|
|
10594
|
+
}, xe(e, (e, t) => Se.value = {
|
|
10590
10595
|
id: i,
|
|
10591
10596
|
x: Math.min(n[0], n[0] + e),
|
|
10592
10597
|
y: Math.min(n[1], n[1] + t),
|
|
10593
10598
|
width: Math.abs(e),
|
|
10594
10599
|
height: Math.abs(t)
|
|
10595
10600
|
}, () => {
|
|
10596
|
-
let e =
|
|
10597
|
-
|
|
10601
|
+
let e = Se.value;
|
|
10602
|
+
Se.value = null, e.width > 10 && e.height > 10 && (g(), s.value = [...s.value, {
|
|
10598
10603
|
...e,
|
|
10599
10604
|
x: N(e.x),
|
|
10600
10605
|
y: N(e.y),
|
|
@@ -10606,22 +10611,22 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10606
10611
|
});
|
|
10607
10612
|
});
|
|
10608
10613
|
}
|
|
10609
|
-
function
|
|
10610
|
-
if (
|
|
10611
|
-
let t =
|
|
10612
|
-
|
|
10614
|
+
function H(e) {
|
|
10615
|
+
if (Me.value) {
|
|
10616
|
+
let t = be(e);
|
|
10617
|
+
Ne.value = [N(t.x), N(t.y)];
|
|
10613
10618
|
}
|
|
10614
10619
|
}
|
|
10615
|
-
function
|
|
10616
|
-
let e =
|
|
10617
|
-
|
|
10618
|
-
id:
|
|
10620
|
+
function U() {
|
|
10621
|
+
let e = Me.value?.filter((e, t, n) => !t || e[0] !== n[t - 1][0] || e[1] !== n[t - 1][1]);
|
|
10622
|
+
Me.value = null, Ne.value = null, e && e.length > 1 && g(), e && e.length > 1 && (l.value = [...l.value, {
|
|
10623
|
+
id: Fe("wall"),
|
|
10619
10624
|
points: e
|
|
10620
10625
|
}]);
|
|
10621
10626
|
}
|
|
10622
|
-
function
|
|
10623
|
-
if (
|
|
10624
|
-
e.preventDefault(), e.key === "Enter" ?
|
|
10627
|
+
function Le(e) {
|
|
10628
|
+
if (Me.value && (e.key === "Enter" || e.key === "Escape")) {
|
|
10629
|
+
e.preventDefault(), e.key === "Enter" ? U() : Me.value = null;
|
|
10625
10630
|
return;
|
|
10626
10631
|
}
|
|
10627
10632
|
if (!r.editable) return;
|
|
@@ -10635,14 +10640,14 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10635
10640
|
return;
|
|
10636
10641
|
}
|
|
10637
10642
|
if (t && n === "d") {
|
|
10638
|
-
e.preventDefault(),
|
|
10643
|
+
e.preventDefault(), Ve();
|
|
10639
10644
|
return;
|
|
10640
10645
|
}
|
|
10641
|
-
(e.key === "Delete" || e.key === "Backspace") && (f.value || o.value.length) && (e.preventDefault(),
|
|
10646
|
+
(e.key === "Delete" || e.key === "Backspace") && (f.value || o.value.length) && (e.preventDefault(), Re());
|
|
10642
10647
|
}
|
|
10643
|
-
function
|
|
10648
|
+
function Re() {
|
|
10644
10649
|
if (!f.value) {
|
|
10645
|
-
o.value.length &&
|
|
10650
|
+
o.value.length && Be(o.value);
|
|
10646
10651
|
return;
|
|
10647
10652
|
}
|
|
10648
10653
|
let { kind: e, id: t, vertex: n } = f.value;
|
|
@@ -10662,19 +10667,19 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10662
10667
|
}
|
|
10663
10668
|
e === "decor" && (u.value = u.value.filter((e) => e.id !== t)), f.value = null;
|
|
10664
10669
|
}
|
|
10665
|
-
let
|
|
10666
|
-
function
|
|
10670
|
+
let ze = q();
|
|
10671
|
+
function Be(e) {
|
|
10667
10672
|
g(), i.value = i.value.filter((t) => !e.includes(t.id)), a.value = a.value.map((t) => ({
|
|
10668
10673
|
...t,
|
|
10669
10674
|
tables: t.tables.filter((t) => !e.includes(t))
|
|
10670
10675
|
})).filter((e) => e.tables.length > 1), o.value = [];
|
|
10671
10676
|
}
|
|
10672
|
-
function
|
|
10677
|
+
function Ve() {
|
|
10673
10678
|
let e = Math.max(20, (r.grid || 10) * 2);
|
|
10674
10679
|
if (o.value.length) {
|
|
10675
10680
|
let t = i.value.filter((e) => o.value.includes(e.id)).map((t) => ({
|
|
10676
10681
|
...t,
|
|
10677
|
-
id:
|
|
10682
|
+
id: Fe("table"),
|
|
10678
10683
|
x: t.x + e,
|
|
10679
10684
|
y: t.y + e,
|
|
10680
10685
|
status: void 0,
|
|
@@ -10689,7 +10694,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10689
10694
|
if (!n) return;
|
|
10690
10695
|
let r = {
|
|
10691
10696
|
...n,
|
|
10692
|
-
id:
|
|
10697
|
+
id: Fe("area"),
|
|
10693
10698
|
x: n.x + e,
|
|
10694
10699
|
y: n.y + e
|
|
10695
10700
|
};
|
|
@@ -10702,7 +10707,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10702
10707
|
if (!n) return;
|
|
10703
10708
|
let r = {
|
|
10704
10709
|
...n,
|
|
10705
|
-
id:
|
|
10710
|
+
id: Fe("decor"),
|
|
10706
10711
|
x: n.x + e,
|
|
10707
10712
|
y: n.y + e
|
|
10708
10713
|
};
|
|
@@ -10712,14 +10717,14 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10712
10717
|
};
|
|
10713
10718
|
}
|
|
10714
10719
|
}
|
|
10715
|
-
let
|
|
10716
|
-
function
|
|
10720
|
+
let He = tt(null);
|
|
10721
|
+
function Ue(e, t, n, a, o) {
|
|
10717
10722
|
if (!r.editable || e.button !== 0) return;
|
|
10718
10723
|
e.stopPropagation(), e.preventDefault();
|
|
10719
10724
|
let s = S.value.getBoundingClientRect(), c = (e) => Math.atan2(e.clientY - (s.top + o * w.value), e.clientX - (s.left + a * w.value)) * 180 / Math.PI + 90, l = (r) => {
|
|
10720
10725
|
if (r.pointerId !== e.pointerId) return;
|
|
10721
10726
|
let i = (c(r) % 360 + 360) % 360;
|
|
10722
|
-
r.shiftKey || (i = Math.round(i / 15) * 15 % 360),
|
|
10727
|
+
r.shiftKey || (i = Math.round(i / 15) * 15 % 360), He.value = {
|
|
10723
10728
|
id: n,
|
|
10724
10729
|
kind: t,
|
|
10725
10730
|
deg: i
|
|
@@ -10727,8 +10732,8 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10727
10732
|
}, d = (r) => {
|
|
10728
10733
|
if (r.pointerId !== e.pointerId) return;
|
|
10729
10734
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", d);
|
|
10730
|
-
let a =
|
|
10731
|
-
|
|
10735
|
+
let a = He.value;
|
|
10736
|
+
He.value = null, a && (g(), t === "table" ? i.value = i.value.map((e) => e.id === n ? {
|
|
10732
10737
|
...e,
|
|
10733
10738
|
rotation: a.deg
|
|
10734
10739
|
} : e) : u.value = u.value.map((e) => e.id === n ? {
|
|
@@ -10738,30 +10743,30 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10738
10743
|
};
|
|
10739
10744
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", d), window.addEventListener("pointercancel", d);
|
|
10740
10745
|
}
|
|
10741
|
-
let
|
|
10742
|
-
function
|
|
10746
|
+
let We = (e, t, n) => He.value?.kind === e && He.value.id === t ? He.value.deg : n ?? 0;
|
|
10747
|
+
function Ke(e = o.value, t) {
|
|
10743
10748
|
let n = [...new Set(e.flatMap((e) => a.value.find((t) => t.tables.includes(e))?.tables ?? [e]))];
|
|
10744
10749
|
if (n.length < 2) return null;
|
|
10745
10750
|
let s = r.canMerge?.(n) ?? !0;
|
|
10746
10751
|
if (s !== !0) return b("merge-refused", n, typeof s == "string" ? s : ""), null;
|
|
10747
10752
|
let c = t ?? n.map((e) => i.value.find((t) => t.id === e)?.label ?? e).join(" + "), l = {
|
|
10748
|
-
id:
|
|
10753
|
+
id: Fe("merge"),
|
|
10749
10754
|
tables: n,
|
|
10750
10755
|
label: c
|
|
10751
10756
|
};
|
|
10752
10757
|
return g(), a.value = [...a.value.filter((e) => !e.tables.some((e) => n.includes(e))), l], o.value = [], b("merge", l), l;
|
|
10753
10758
|
}
|
|
10754
|
-
function
|
|
10759
|
+
function Je(e) {
|
|
10755
10760
|
let t = a.value.find((t) => t.id === e) ?? a.value.find((t) => t.tables.includes(e));
|
|
10756
10761
|
t && (g(), a.value = a.value.filter((e) => e !== t), b("split", t));
|
|
10757
10762
|
}
|
|
10758
|
-
let
|
|
10763
|
+
let Ye = {
|
|
10759
10764
|
key: "",
|
|
10760
10765
|
at: 0
|
|
10761
10766
|
};
|
|
10762
|
-
function
|
|
10767
|
+
function Ze(e, t, n) {
|
|
10763
10768
|
let r = `${e}:${t}:${Object.keys(n).sort().join()}`, a = performance.now();
|
|
10764
|
-
(r !==
|
|
10769
|
+
(r !== Ye.key || a - Ye.at > 1e3) && g(), Ye = {
|
|
10765
10770
|
key: r,
|
|
10766
10771
|
at: a
|
|
10767
10772
|
};
|
|
@@ -10771,25 +10776,25 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10771
10776
|
} : e);
|
|
10772
10777
|
e === "table" ? i.value = o(i.value) : e === "area" ? s.value = o(s.value) : e === "wall" ? l.value = o(l.value) : u.value = o(u.value);
|
|
10773
10778
|
}
|
|
10774
|
-
function
|
|
10779
|
+
function Qe(e = {}) {
|
|
10775
10780
|
let t = Math.max(0, ...i.value.map((e) => Number(e.label)).filter((e) => Number.isFinite(e))) + 1, n = {
|
|
10776
|
-
id:
|
|
10781
|
+
id: Fe("table"),
|
|
10777
10782
|
label: String(t),
|
|
10778
|
-
x:
|
|
10779
|
-
y:
|
|
10783
|
+
x: P(r.width / 2),
|
|
10784
|
+
y: P(r.height / 2),
|
|
10780
10785
|
shape: "square",
|
|
10781
10786
|
seats: 4,
|
|
10782
10787
|
...e
|
|
10783
10788
|
};
|
|
10784
10789
|
return g(), i.value = [...i.value, n], o.value = [n.id], f.value = null, n;
|
|
10785
10790
|
}
|
|
10786
|
-
function
|
|
10791
|
+
function $e(e, t = {}) {
|
|
10787
10792
|
let n = {
|
|
10788
|
-
id:
|
|
10793
|
+
id: Fe("decor"),
|
|
10789
10794
|
kind: e,
|
|
10790
10795
|
x: N(r.width / 2),
|
|
10791
10796
|
y: N(r.height / 2),
|
|
10792
|
-
...
|
|
10797
|
+
...me.value[e]?.shape === "text" && { label: me.value[e]?.label ?? e },
|
|
10793
10798
|
...t
|
|
10794
10799
|
};
|
|
10795
10800
|
return g(), u.value = [...u.value, n], f.value = {
|
|
@@ -10797,7 +10802,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10797
10802
|
id: n.id
|
|
10798
10803
|
}, o.value = [], n;
|
|
10799
10804
|
}
|
|
10800
|
-
let
|
|
10805
|
+
let et = {
|
|
10801
10806
|
tables: i,
|
|
10802
10807
|
areas: s,
|
|
10803
10808
|
walls: l,
|
|
@@ -10807,12 +10812,12 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10807
10812
|
picked: f,
|
|
10808
10813
|
tool: d,
|
|
10809
10814
|
editable: L(() => r.editable),
|
|
10810
|
-
drawingWall: L(() => !!
|
|
10811
|
-
finishWall:
|
|
10815
|
+
drawingWall: L(() => !!Me.value),
|
|
10816
|
+
finishWall: U,
|
|
10812
10817
|
cancelWall: () => {
|
|
10813
|
-
|
|
10818
|
+
Me.value = null, Ne.value = null;
|
|
10814
10819
|
},
|
|
10815
|
-
kinds:
|
|
10820
|
+
kinds: me,
|
|
10816
10821
|
statuses: L(() => r.statuses),
|
|
10817
10822
|
size: L(() => ({
|
|
10818
10823
|
width: r.width,
|
|
@@ -10822,34 +10827,34 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10822
10827
|
canRedo: L(() => m.value.length > 0),
|
|
10823
10828
|
undo: v,
|
|
10824
10829
|
redo: y,
|
|
10825
|
-
addTable:
|
|
10826
|
-
addDecor:
|
|
10827
|
-
update:
|
|
10828
|
-
removeSelected:
|
|
10829
|
-
removeTables:
|
|
10830
|
-
duplicate:
|
|
10831
|
-
merge:
|
|
10832
|
-
split:
|
|
10830
|
+
addTable: Qe,
|
|
10831
|
+
addDecor: $e,
|
|
10832
|
+
update: Ze,
|
|
10833
|
+
removeSelected: Re,
|
|
10834
|
+
removeTables: Be,
|
|
10835
|
+
duplicate: Ve,
|
|
10836
|
+
merge: Ke,
|
|
10837
|
+
split: Je
|
|
10833
10838
|
};
|
|
10834
|
-
Xe(ah,
|
|
10835
|
-
context:
|
|
10836
|
-
addTable:
|
|
10837
|
-
addDecor:
|
|
10838
|
-
update:
|
|
10839
|
-
removeSelected:
|
|
10840
|
-
merge:
|
|
10841
|
-
split:
|
|
10839
|
+
Xe(ah, et), t({
|
|
10840
|
+
context: et,
|
|
10841
|
+
addTable: Qe,
|
|
10842
|
+
addDecor: $e,
|
|
10843
|
+
update: Ze,
|
|
10844
|
+
removeSelected: Re,
|
|
10845
|
+
merge: Ke,
|
|
10846
|
+
split: Je,
|
|
10842
10847
|
undo: v,
|
|
10843
10848
|
redo: y,
|
|
10844
10849
|
canUndo: L(() => p.value.length > 0),
|
|
10845
10850
|
canRedo: L(() => m.value.length > 0),
|
|
10846
|
-
duplicate:
|
|
10847
|
-
removeTables:
|
|
10851
|
+
duplicate: Ve,
|
|
10852
|
+
removeTables: Be
|
|
10848
10853
|
});
|
|
10849
|
-
function
|
|
10854
|
+
function nt(e, t) {
|
|
10850
10855
|
if (!r.editable || d.value !== "select") return;
|
|
10851
10856
|
e.stopPropagation();
|
|
10852
|
-
let n =
|
|
10857
|
+
let n = be(e), i = 0, a = Infinity;
|
|
10853
10858
|
for (let e = 1; e < t.points.length; e++) {
|
|
10854
10859
|
let [r, o] = t.points[e - 1], [s, c] = t.points[e], l = (s - r) ** 2 + (c - o) ** 2, u = l ? Math.max(0, Math.min(1, ((n.x - r) * (s - r) + (n.y - o) * (c - o)) / l)) : 0, d = Math.hypot(r + u * (s - r) - n.x, o + u * (c - o) - n.y);
|
|
10855
10860
|
d < a && (a = d, i = e);
|
|
@@ -10868,12 +10873,12 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10868
10873
|
vertex: i
|
|
10869
10874
|
};
|
|
10870
10875
|
}
|
|
10871
|
-
let
|
|
10876
|
+
let rt = (e) => [
|
|
10872
10877
|
e.t.label,
|
|
10873
10878
|
e.status?.label,
|
|
10874
10879
|
e.t.seats ? x.floorSeats.replace("{n}", String(e.t.seats)) : "",
|
|
10875
10880
|
e.t.badge === void 0 ? "" : String(e.t.badge)
|
|
10876
|
-
].filter(Boolean).join(", "),
|
|
10881
|
+
].filter(Boolean).join(", "), it = L(() => {
|
|
10877
10882
|
let e = (r.grid >= 10 ? r.grid : r.grid * Math.ceil(10 / Math.max(1, r.grid))) * w.value;
|
|
10878
10883
|
return r.editable && r.showGrid && r.grid ? {
|
|
10879
10884
|
backgroundImage: "radial-gradient(circle, var(--color-outline-variant) 1px, transparent 1.2px)",
|
|
@@ -10886,32 +10891,32 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10886
10891
|
class: W(["m3-floor-plan select-none", e.editable && d.value !== "select" && "cursor-crosshair"]),
|
|
10887
10892
|
style: G({
|
|
10888
10893
|
aspectRatio: `${e.width} / ${e.height}`,
|
|
10889
|
-
...
|
|
10894
|
+
...it.value
|
|
10890
10895
|
}),
|
|
10891
10896
|
role: "group",
|
|
10892
10897
|
tabindex: "-1",
|
|
10893
10898
|
"aria-label": e.label ?? Z(x).floorPlan,
|
|
10894
|
-
onPointerdown:
|
|
10895
|
-
onPointermove:
|
|
10896
|
-
onDblclick: n[0] ||= (e) =>
|
|
10897
|
-
onKeydown:
|
|
10899
|
+
onPointerdown: Ie,
|
|
10900
|
+
onPointermove: H,
|
|
10901
|
+
onDblclick: n[0] ||= (e) => Me.value && U(),
|
|
10902
|
+
onKeydown: Le
|
|
10898
10903
|
}, [
|
|
10899
|
-
(K(!0), B(I, null, J(
|
|
10904
|
+
(K(!0), B(I, null, J(Ce.value, (n) => (K(), B("div", {
|
|
10900
10905
|
key: `a${n.id}`,
|
|
10901
|
-
class: W(["absolute rounded-lg border", [e.editable && d.value === "select" ? "cursor-move touch-none" : "pointer-events-none",
|
|
10906
|
+
class: W(["absolute rounded-lg border", [e.editable && d.value === "select" ? "cursor-move touch-none" : "pointer-events-none", ye("area", n.id) && "ring-2 ring-primary"]]),
|
|
10902
10907
|
style: G({
|
|
10903
10908
|
left: `${n.x * w.value}px`,
|
|
10904
10909
|
top: `${n.y * w.value}px`,
|
|
10905
10910
|
width: `${n.width * w.value}px`,
|
|
10906
10911
|
height: `${n.height * w.value}px`,
|
|
10907
|
-
...
|
|
10912
|
+
...ve(n.color)
|
|
10908
10913
|
}),
|
|
10909
|
-
onPointerdown: (e) =>
|
|
10914
|
+
onPointerdown: (e) => we(e, n, null)
|
|
10910
10915
|
}, [Y(t.$slots, "area", {
|
|
10911
10916
|
area: n,
|
|
10912
|
-
picked:
|
|
10917
|
+
picked: ye("area", n.id),
|
|
10913
10918
|
scale: w.value
|
|
10914
|
-
}, () => [n.label ? (K(), B("span", fh, X(n.label), 1)) : z("", !0)]), e.editable &&
|
|
10919
|
+
}, () => [n.label ? (K(), B("span", fh, X(n.label), 1)) : z("", !0)]), e.editable && ye("area", n.id) ? (K(), B(I, { key: 0 }, J([
|
|
10915
10920
|
"nw",
|
|
10916
10921
|
"ne",
|
|
10917
10922
|
"sw",
|
|
@@ -10924,34 +10929,34 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10924
10929
|
e === "nw" || e === "se" ? "cursor-nwse-resize" : "cursor-nesw-resize"
|
|
10925
10930
|
]]),
|
|
10926
10931
|
"data-corner": e,
|
|
10927
|
-
onPointerdown: (t) =>
|
|
10932
|
+
onPointerdown: (t) => we(t, n, e)
|
|
10928
10933
|
}, null, 42, ph)), 64)) : z("", !0)], 46, dh))), 128)),
|
|
10929
10934
|
(K(), B("svg", {
|
|
10930
10935
|
ref_key: "svgEl",
|
|
10931
|
-
ref:
|
|
10936
|
+
ref: ze,
|
|
10932
10937
|
class: "pointer-events-none absolute inset-0 size-full overflow-visible"
|
|
10933
|
-
}, [(K(!0), B(I, null, J(
|
|
10934
|
-
d:
|
|
10938
|
+
}, [(K(!0), B(I, null, J(ke.value, (t) => (K(), B("g", { key: `w${t.id}` }, [V("path", {
|
|
10939
|
+
d: Ae(t),
|
|
10935
10940
|
fill: "none",
|
|
10936
10941
|
"stroke-linecap": "round",
|
|
10937
10942
|
"stroke-linejoin": "round",
|
|
10938
|
-
class: W(["m3-floor-wall", [e.editable && d.value === "select" && "pointer-events-auto cursor-move touch-none",
|
|
10943
|
+
class: W(["m3-floor-wall", [e.editable && d.value === "select" && "pointer-events-auto cursor-move touch-none", ye("wall", t.id) && "m3-floor-wall-picked"]]),
|
|
10939
10944
|
"stroke-width": (t.thickness ?? 8) * w.value,
|
|
10940
|
-
onPointerdown: (e) =>
|
|
10941
|
-
onDblclick: (e) =>
|
|
10942
|
-
}, null, 42, mh), e.editable &&
|
|
10945
|
+
onPointerdown: (e) => je(e, t),
|
|
10946
|
+
onDblclick: (e) => nt(e, t)
|
|
10947
|
+
}, null, 42, mh), e.editable && ye("wall", t.id) ? (K(!0), B(I, { key: 0 }, J(t.points, (e, n) => (K(), B("circle", {
|
|
10943
10948
|
key: n,
|
|
10944
10949
|
cx: e[0] * w.value,
|
|
10945
10950
|
cy: e[1] * w.value,
|
|
10946
10951
|
r: (f.value?.vertex === n ? 8 : 6) * (C.value ? 1.6 : 1),
|
|
10947
10952
|
class: W(["pointer-events-auto cursor-move touch-none stroke-primary", f.value?.vertex === n ? "fill-primary" : "fill-surface"]),
|
|
10948
10953
|
"stroke-width": "2",
|
|
10949
|
-
onPointerdown: (e) =>
|
|
10950
|
-
}, null, 42, hh))), 128)) : z("", !0)]))), 128)),
|
|
10954
|
+
onPointerdown: (e) => je(e, t, n)
|
|
10955
|
+
}, null, 42, hh))), 128)) : z("", !0)]))), 128)), Me.value ? (K(), B("path", {
|
|
10951
10956
|
key: 0,
|
|
10952
|
-
d:
|
|
10957
|
+
d: Ae({
|
|
10953
10958
|
id: "new",
|
|
10954
|
-
points:
|
|
10959
|
+
points: Ne.value ? [...Me.value, Ne.value] : Me.value
|
|
10955
10960
|
}),
|
|
10956
10961
|
fill: "none",
|
|
10957
10962
|
class: "stroke-primary",
|
|
@@ -10959,47 +10964,47 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
10959
10964
|
"stroke-linecap": "round",
|
|
10960
10965
|
"stroke-width": 8 * w.value
|
|
10961
10966
|
}, null, 8, gh)) : z("", !0)], 512)),
|
|
10962
|
-
(K(!0), B(I, null, J(
|
|
10967
|
+
(K(!0), B(I, null, J(Ee.value, (n) => (K(), B("div", {
|
|
10963
10968
|
key: `d${n.id}`,
|
|
10964
|
-
class: W(["absolute flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-on-surface-variant", [e.editable && d.value === "select" ? "cursor-move touch-none" : "pointer-events-none",
|
|
10969
|
+
class: W(["absolute flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-on-surface-variant", [e.editable && d.value === "select" ? "cursor-move touch-none" : "pointer-events-none", ye("decor", n.id) && "ring-2 ring-primary"]]),
|
|
10965
10970
|
style: G({
|
|
10966
10971
|
left: `${n.x * w.value}px`,
|
|
10967
10972
|
top: `${n.y * w.value}px`,
|
|
10968
|
-
width: `${
|
|
10969
|
-
height: `${
|
|
10970
|
-
rotate: `${
|
|
10971
|
-
...he(
|
|
10973
|
+
width: `${ge(n).w * w.value}px`,
|
|
10974
|
+
height: `${ge(n).h * w.value}px`,
|
|
10975
|
+
rotate: `${We("decor", n.id, n.rotation)}deg`,
|
|
10976
|
+
..._e(he(n))
|
|
10972
10977
|
}),
|
|
10973
|
-
"aria-label": n.label ??
|
|
10978
|
+
"aria-label": n.label ?? he(n).label ?? n.kind,
|
|
10974
10979
|
role: "img",
|
|
10975
|
-
onPointerdown: (e) =>
|
|
10980
|
+
onPointerdown: (e) => De(e, n)
|
|
10976
10981
|
}, [
|
|
10977
10982
|
Y(t.$slots, "decor", {
|
|
10978
10983
|
item: n,
|
|
10979
|
-
kind:
|
|
10980
|
-
picked:
|
|
10984
|
+
kind: he(n),
|
|
10985
|
+
picked: ye("decor", n.id),
|
|
10981
10986
|
scale: w.value
|
|
10982
|
-
}, () => [
|
|
10987
|
+
}, () => [he(n).icon && he(n).shape !== "bar" ? (K(), R(F, {
|
|
10983
10988
|
key: 0,
|
|
10984
|
-
name:
|
|
10985
|
-
size: Math.max(12, Math.min(
|
|
10986
|
-
}, null, 8, ["name", "size"])) : z("", !0),
|
|
10989
|
+
name: he(n).icon,
|
|
10990
|
+
size: Math.max(12, Math.min(ge(n).w, ge(n).h) * .6 * w.value)
|
|
10991
|
+
}, null, 8, ["name", "size"])) : z("", !0), he(n).shape === "text" ? (K(), B("span", {
|
|
10987
10992
|
key: 1,
|
|
10988
10993
|
class: "truncate text-title-small text-on-surface-variant",
|
|
10989
10994
|
style: G({ fontSize: `${Math.max(10, 16 * w.value)}px` })
|
|
10990
10995
|
}, X(n.label), 5)) : z("", !0)]),
|
|
10991
|
-
e.editable &&
|
|
10996
|
+
e.editable && ye("decor", n.id) ? (K(), B("span", {
|
|
10992
10997
|
key: 0,
|
|
10993
10998
|
class: "m3-floor-handle absolute -right-1.5 -bottom-1.5 size-3 cursor-nwse-resize rounded-xs border-2 border-primary bg-surface",
|
|
10994
10999
|
"data-resize": "",
|
|
10995
|
-
onPointerdown: (e) =>
|
|
11000
|
+
onPointerdown: (e) => De(e, n, !0)
|
|
10996
11001
|
}, null, 40, vh)) : z("", !0),
|
|
10997
|
-
e.editable && e.rotatable &&
|
|
11002
|
+
e.editable && e.rotatable && ye("decor", n.id) ? (K(), B("span", {
|
|
10998
11003
|
key: 1,
|
|
10999
11004
|
class: "m3-floor-handle absolute -top-6 left-1/2 size-3.5 -translate-x-1/2 cursor-grab rounded-full border-2 border-primary bg-surface",
|
|
11000
11005
|
"aria-label": Z(x).floorRotate,
|
|
11001
11006
|
"data-rotate": "",
|
|
11002
|
-
onPointerdown: (e) =>
|
|
11007
|
+
onPointerdown: (e) => Ue(e, "decor", n.id, n.x, n.y)
|
|
11003
11008
|
}, null, 40, yh)) : z("", !0)
|
|
11004
11009
|
], 46, _h))), 128)),
|
|
11005
11010
|
j.value.some((e) => e.links.length) ? (K(), B("svg", bh, [(K(!0), B(I, null, J(j.value, (e) => (K(), B(I, { key: `ml${e.m.id}` }, [(K(!0), B(I, null, J(e.links, (e, t) => (K(), B("line", {
|
|
@@ -11032,7 +11037,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
11032
11037
|
style: G({
|
|
11033
11038
|
left: `${n.x * w.value}px`,
|
|
11034
11039
|
top: `${n.y * w.value}px`,
|
|
11035
|
-
transform: `rotate(${
|
|
11040
|
+
transform: `rotate(${We("table", n.t.id, n.t.rotation)}deg)`
|
|
11036
11041
|
})
|
|
11037
11042
|
}, [
|
|
11038
11043
|
e.editable && e.rotatable && o.value.length === 1 && o.value[0] === n.t.id && d.value === "select" ? (K(), B("span", {
|
|
@@ -11044,7 +11049,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
11044
11049
|
}),
|
|
11045
11050
|
"aria-label": Z(x).floorRotate,
|
|
11046
11051
|
"data-rotate": "",
|
|
11047
|
-
onPointerdown: (e) =>
|
|
11052
|
+
onPointerdown: (e) => Ue(e, "table", n.t.id, n.x, n.y)
|
|
11048
11053
|
}, null, 44, Ch)) : z("", !0),
|
|
11049
11054
|
(K(!0), B(I, null, J(n.chairs, (e, t) => (K(), B("span", {
|
|
11050
11055
|
key: t,
|
|
@@ -11072,14 +11077,14 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
11072
11077
|
...A(n.status),
|
|
11073
11078
|
fontSize: `${Math.max(9, 14 * w.value)}px`
|
|
11074
11079
|
}),
|
|
11075
|
-
"aria-label":
|
|
11080
|
+
"aria-label": rt(n),
|
|
11076
11081
|
"aria-pressed": e.editable ? o.value.includes(n.t.id) : void 0,
|
|
11077
|
-
onPointerdown: (e) =>
|
|
11078
|
-
onClick: (e) =>
|
|
11079
|
-
onKeydown: (e) =>
|
|
11082
|
+
onPointerdown: (e) => ae(e, n.t),
|
|
11083
|
+
onClick: (e) => ue(e, n.t),
|
|
11084
|
+
onKeydown: (e) => fe(e, n.t)
|
|
11080
11085
|
}, [V("span", {
|
|
11081
11086
|
class: "flex flex-col items-center justify-center gap-0.5",
|
|
11082
|
-
style: G({ transform: `rotate(${-
|
|
11087
|
+
style: G({ transform: `rotate(${-We("table", n.t.id, n.t.rotation)}deg)` })
|
|
11083
11088
|
}, [Y(t.$slots, "table", {
|
|
11084
11089
|
table: n.t,
|
|
11085
11090
|
status: n.status,
|
|
@@ -11092,7 +11097,7 @@ var uh = ["aria-label"], dh = ["onPointerdown"], fh = {
|
|
|
11092
11097
|
}, null, 8, ["name", "size"])) : z("", !0), V("span", Th, X(n.t.label), 1)])], 4), n.t.badge === void 0 ? z("", !0) : (K(), B("span", {
|
|
11093
11098
|
key: 0,
|
|
11094
11099
|
class: "absolute -top-2 -right-2 min-w-5 rounded-full bg-error px-1.5 text-center text-label-small leading-5 text-on-error",
|
|
11095
|
-
style: G({ transform: `rotate(${-
|
|
11100
|
+
style: G({ transform: `rotate(${-We("table", n.t.id, n.t.rotation)}deg)` })
|
|
11096
11101
|
}, X(n.t.badge), 5))], 46, wh)
|
|
11097
11102
|
], 6))), 128)),
|
|
11098
11103
|
Y(t.$slots, "overlay", {
|