@nexxtmove/ui 1.48.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { NexxtIconName } from '../../atoms/Icon/Icon.vue';
|
|
2
2
|
export interface NexxtTabItem {
|
|
3
|
+
/** Visible text, the `v-model` value and the key; in icon-only mode the tab's accessible name. */
|
|
3
4
|
label: string;
|
|
5
|
+
/** Icon shown before the label, or on its own in icon-only mode. */
|
|
4
6
|
icon?: NexxtIconName;
|
|
7
|
+
/** Show only the icon for this tab. Overrides the tabs-wide `iconOnly` either way. */
|
|
8
|
+
iconOnly?: boolean;
|
|
5
9
|
}
|
|
6
10
|
interface NexxtTabs {
|
|
11
|
+
/** The tabs, as plain labels or `{ label, icon, iconOnly }` objects. */
|
|
7
12
|
tabs: (string | NexxtTabItem)[];
|
|
13
|
+
/** Accessible name of the tablist. */
|
|
8
14
|
tablistLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Show only the icon of every tab, as a near-square button. The label stays the `v-model`
|
|
17
|
+
* value and the accessible name, in a visually hidden span. A tab without an `icon` keeps its
|
|
18
|
+
* visible label.
|
|
19
|
+
*/
|
|
20
|
+
iconOnly?: boolean;
|
|
9
21
|
}
|
|
10
22
|
type __VLS_Props = NexxtTabs;
|
|
11
23
|
declare const selected: import('vue').ModelRef<string, string, string, string>;
|
package/dist/index.js
CHANGED
|
@@ -9641,12 +9641,13 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9641
9641
|
"tabindex",
|
|
9642
9642
|
"onClick",
|
|
9643
9643
|
"onKeydown"
|
|
9644
|
-
], Hf = /* @__PURE__ */ p({
|
|
9644
|
+
], Hf = { class: "sr-only" }, Uf = /* @__PURE__ */ p({
|
|
9645
9645
|
name: "NexxtTabs",
|
|
9646
9646
|
__name: "Tabs",
|
|
9647
9647
|
props: /*@__PURE__*/ v({
|
|
9648
9648
|
tabs: {},
|
|
9649
|
-
tablistLabel: {}
|
|
9649
|
+
tablistLabel: {},
|
|
9650
|
+
iconOnly: { type: Boolean }
|
|
9650
9651
|
}, {
|
|
9651
9652
|
modelValue: {
|
|
9652
9653
|
type: String,
|
|
@@ -9656,29 +9657,43 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9656
9657
|
}),
|
|
9657
9658
|
emits: ["update:modelValue"],
|
|
9658
9659
|
setup(t) {
|
|
9659
|
-
let n = t, r = z(t, "modelValue"), l = B("containerRef"), u = A([]),
|
|
9660
|
+
let n = t, r = z(t, "modelValue"), l = B("containerRef"), u = A([]), p = A({
|
|
9660
9661
|
width: "0px",
|
|
9661
9662
|
transform: "translateX(0px)"
|
|
9662
|
-
}),
|
|
9663
|
+
}), m = A("inset(0 100% 0 0 round 9999px)"), h = A(!1), g = i(() => n.tabs.map((e) => typeof e == "string" ? { label: e } : e)), _ = (e) => e.iconOnly ?? n.iconOnly ?? !1, v = i(() => g.value.map((e) => {
|
|
9664
|
+
let t = !!e.icon && _(e);
|
|
9665
|
+
return {
|
|
9666
|
+
...e,
|
|
9667
|
+
compact: t,
|
|
9668
|
+
text: t ? "" : e.label,
|
|
9669
|
+
spacing: t ? "px-3" : "gap-2 px-4"
|
|
9670
|
+
};
|
|
9671
|
+
})), y = async () => {
|
|
9663
9672
|
await b();
|
|
9664
|
-
let e =
|
|
9673
|
+
let e = g.value.findIndex((e) => e.label === r.value), t = u.value[e];
|
|
9665
9674
|
if (!t || !l.value) return;
|
|
9666
|
-
let n =
|
|
9667
|
-
|
|
9668
|
-
width: `${
|
|
9669
|
-
transform: `translateX(${
|
|
9670
|
-
},
|
|
9671
|
-
},
|
|
9675
|
+
let n = l.value, i = n.getBoundingClientRect(), a = t.getBoundingClientRect(), o = parseFloat(getComputedStyle(n).width), s = o > 0 && i.width > 0 ? i.width / o : 1, c = (a.left - i.left) / s, d = a.width / s, f = i.width / s - c - d;
|
|
9676
|
+
p.value = {
|
|
9677
|
+
width: `${d}px`,
|
|
9678
|
+
transform: `translateX(${c}px)`
|
|
9679
|
+
}, m.value = `inset(0 ${f}px 0 ${c}px round 9999px)`;
|
|
9680
|
+
}, S = (e, t) => {
|
|
9672
9681
|
let n;
|
|
9673
|
-
if (e.key === "ArrowRight") n = (t + 1) %
|
|
9674
|
-
else if (e.key === "ArrowLeft") n = (t - 1 +
|
|
9682
|
+
if (e.key === "ArrowRight") n = (t + 1) % g.value.length;
|
|
9683
|
+
else if (e.key === "ArrowLeft") n = (t - 1 + g.value.length) % g.value.length;
|
|
9675
9684
|
else if (e.key === "Home") n = 0;
|
|
9676
|
-
else if (e.key === "End") n =
|
|
9685
|
+
else if (e.key === "End") n = g.value.length - 1;
|
|
9677
9686
|
else return;
|
|
9678
|
-
e.preventDefault(), r.value =
|
|
9687
|
+
e.preventDefault(), r.value = g.value[n].label, u.value[n]?.focus();
|
|
9679
9688
|
};
|
|
9680
|
-
return W(r, async () => await
|
|
9681
|
-
|
|
9689
|
+
return W(r, async () => await y()), W(v, async () => await y()), process.env.NODE_ENV !== "production" && G(() => {
|
|
9690
|
+
let e = g.value.filter((e) => !e.icon && _(e));
|
|
9691
|
+
if (e.length) {
|
|
9692
|
+
let t = e.map((e) => `"${e.label}"`).join(", ");
|
|
9693
|
+
console.warn(`[NexxtTabs] icon-only tab without an \`icon\` shows its label: ${t}.`);
|
|
9694
|
+
}
|
|
9695
|
+
}), T(async () => {
|
|
9696
|
+
await document.fonts.ready, await y(), await b(), l.value?.offsetWidth, h.value = !0;
|
|
9682
9697
|
}), (n, i) => (D(), s("div", {
|
|
9683
9698
|
ref_key: "containerRef",
|
|
9684
9699
|
ref: l,
|
|
@@ -9688,44 +9703,49 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9688
9703
|
}, [
|
|
9689
9704
|
c("div", {
|
|
9690
9705
|
"aria-hidden": "true",
|
|
9691
|
-
class: x(["absolute inset-y-1 left-0 rounded-full bg-cornflower-blue-500",
|
|
9692
|
-
style: C(
|
|
9706
|
+
class: x(["absolute inset-y-1 left-0 rounded-full bg-cornflower-blue-500", h.value ? "transition-all duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]" : ""]),
|
|
9707
|
+
style: C(p.value)
|
|
9693
9708
|
}, null, 6),
|
|
9694
|
-
(D(!0), s(e, null, j(
|
|
9695
|
-
key:
|
|
9709
|
+
(D(!0), s(e, null, j(v.value, (t, n) => (D(), s("button", {
|
|
9710
|
+
key: t.label,
|
|
9696
9711
|
ref_for: !0,
|
|
9697
|
-
ref: (e) => u.value[
|
|
9712
|
+
ref: (e) => u.value[n] = e,
|
|
9698
9713
|
role: "tab",
|
|
9699
|
-
"aria-selected": r.value ===
|
|
9700
|
-
tabindex: r.value ===
|
|
9701
|
-
class: x(["relative z-10 inline-flex h-9 cursor-pointer items-center
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9714
|
+
"aria-selected": r.value === t.label,
|
|
9715
|
+
tabindex: r.value === t.label ? 0 : -1,
|
|
9716
|
+
class: x(["relative z-10 inline-flex h-9 cursor-pointer items-center rounded-full small-normal", [
|
|
9717
|
+
t.spacing,
|
|
9718
|
+
r.value === t.label ? "text-transparent" : "text-gray-950",
|
|
9719
|
+
h.value ? "transition-colors duration-0" : "",
|
|
9720
|
+
r.value === t.label ? "delay-500" : "delay-0"
|
|
9705
9721
|
]]),
|
|
9706
|
-
onClick: (
|
|
9707
|
-
onKeydown: (e) =>
|
|
9708
|
-
}, [
|
|
9709
|
-
|
|
9710
|
-
name: e.icon,
|
|
9722
|
+
onClick: (e) => r.value = t.label,
|
|
9723
|
+
onKeydown: (e) => S(e, n)
|
|
9724
|
+
}, [t.compact && t.icon ? (D(), s(e, { key: 0 }, [f(Q, {
|
|
9725
|
+
name: t.icon,
|
|
9711
9726
|
"aria-hidden": "true",
|
|
9712
9727
|
class: "body-normal"
|
|
9713
|
-
}, null, 8, ["name"])
|
|
9728
|
+
}, null, 8, ["name"]), c("span", Hf, P(t.label), 1)], 64)) : t.icon ? (D(), a(Q, {
|
|
9729
|
+
key: 1,
|
|
9730
|
+
name: t.icon,
|
|
9731
|
+
"aria-hidden": "true",
|
|
9732
|
+
class: "body-normal"
|
|
9733
|
+
}, null, 8, ["name"])) : o("", !0), d(" " + P(t.text), 1)], 42, Vf))), 128)),
|
|
9714
9734
|
c("div", {
|
|
9715
9735
|
"aria-hidden": "true",
|
|
9716
|
-
class: x(["pointer-events-none absolute inset-0 z-20 flex p-1",
|
|
9717
|
-
style: C({ clipPath:
|
|
9718
|
-
}, [(D(!0), s(e, null, j(
|
|
9736
|
+
class: x(["pointer-events-none absolute inset-0 z-20 flex p-1", h.value ? "transition-[clip-path] duration-300 ease-[cubic-bezier(0.34,1.2,0.64,1)]" : ""]),
|
|
9737
|
+
style: C({ clipPath: m.value })
|
|
9738
|
+
}, [(D(!0), s(e, null, j(v.value, (e) => (D(), s("span", {
|
|
9719
9739
|
key: e.label,
|
|
9720
|
-
class: "flex h-9 items-center
|
|
9740
|
+
class: x(["flex h-9 items-center rounded-full small-normal text-white", e.spacing])
|
|
9721
9741
|
}, [e.icon ? (D(), a(Q, {
|
|
9722
9742
|
key: 0,
|
|
9723
9743
|
name: e.icon,
|
|
9724
9744
|
class: "body-normal"
|
|
9725
|
-
}, null, 8, ["name"])) : o("", !0), d(" " + P(e.
|
|
9745
|
+
}, null, 8, ["name"])) : o("", !0), d(" " + P(e.text), 1)], 2))), 128))], 6)
|
|
9726
9746
|
], 8, Bf));
|
|
9727
9747
|
}
|
|
9728
|
-
}),
|
|
9748
|
+
}), Wf = { class: "flex flex-col items-center" }, Gf = { class: "relative w-full overflow-hidden" }, Kf = ["aria-labelledby"], qf = /* @__PURE__ */ p({
|
|
9729
9749
|
name: "NexxtTabbedContent",
|
|
9730
9750
|
__name: "TabbedContent",
|
|
9731
9751
|
props: /*@__PURE__*/ v({
|
|
@@ -9750,7 +9770,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9750
9770
|
enterFromClass: a.value === "forward" ? "-translate-x-10 opacity-0" : "translate-x-10 opacity-0",
|
|
9751
9771
|
leaveToClass: a.value === "forward" ? "translate-x-10 opacity-0" : "-translate-x-10 opacity-0"
|
|
9752
9772
|
} : { mode: "out-in" });
|
|
9753
|
-
return (t, i) => (D(), s("div",
|
|
9773
|
+
return (t, i) => (D(), s("div", Wf, [f(Uf, {
|
|
9754
9774
|
tabs: e.tabs,
|
|
9755
9775
|
modelValue: r.value,
|
|
9756
9776
|
"onUpdate:modelValue": i[0] ||= (e) => r.value = e,
|
|
@@ -9760,49 +9780,49 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9760
9780
|
"tabs",
|
|
9761
9781
|
"modelValue",
|
|
9762
9782
|
"tablist-label"
|
|
9763
|
-
]), c("div",
|
|
9783
|
+
]), c("div", Gf, [f(n, S(h(d.value)), {
|
|
9764
9784
|
default: K(() => [(D(), s("div", {
|
|
9765
9785
|
key: r.value,
|
|
9766
9786
|
role: "tabpanel",
|
|
9767
9787
|
"aria-labelledby": u(r.value),
|
|
9768
9788
|
class: "w-full"
|
|
9769
|
-
}, [M(t.$slots, l(r.value))], 8,
|
|
9789
|
+
}, [M(t.$slots, l(r.value))], 8, Kf))]),
|
|
9770
9790
|
_: 3
|
|
9771
9791
|
}, 16)])]));
|
|
9772
9792
|
}
|
|
9773
|
-
}),
|
|
9793
|
+
}), Jf = { class: "flex flex-col gap-3" }, Yf = ["aria-colcount", "aria-rowcount"], Xf = { class: "sticky top-0 z-10 mb-0.5" }, Zf = { key: 0 }, Qf = {
|
|
9774
9794
|
key: 0,
|
|
9775
9795
|
class: "flex items-center justify-center px-2 py-3",
|
|
9776
9796
|
role: "columnheader",
|
|
9777
9797
|
"aria-colindex": "1"
|
|
9778
|
-
},
|
|
9798
|
+
}, $f = [
|
|
9779
9799
|
"aria-colindex",
|
|
9780
9800
|
"aria-sort",
|
|
9781
9801
|
"tabindex",
|
|
9782
9802
|
"onClick",
|
|
9783
9803
|
"onKeydown"
|
|
9784
|
-
],
|
|
9804
|
+
], ep = {
|
|
9785
9805
|
role: "rowgroup",
|
|
9786
9806
|
class: "relative"
|
|
9787
|
-
},
|
|
9807
|
+
}, tp = [
|
|
9788
9808
|
"aria-rowindex",
|
|
9789
9809
|
"aria-selected",
|
|
9790
9810
|
"onClick",
|
|
9791
9811
|
"onKeydown"
|
|
9792
|
-
],
|
|
9812
|
+
], np = {
|
|
9793
9813
|
key: 0,
|
|
9794
9814
|
class: "flex items-center justify-center px-2 py-4",
|
|
9795
9815
|
role: "gridcell",
|
|
9796
9816
|
"aria-colindex": 1
|
|
9797
|
-
},
|
|
9817
|
+
}, rp = ["aria-colindex"], ip = {
|
|
9798
9818
|
key: 0,
|
|
9799
9819
|
class: "px-4 py-8 text-center text-sm text-slate-400",
|
|
9800
9820
|
role: "row"
|
|
9801
|
-
},
|
|
9821
|
+
}, ap = {
|
|
9802
9822
|
key: 0,
|
|
9803
9823
|
"data-testid": "loading-overlay",
|
|
9804
9824
|
class: "absolute inset-0 flex items-center justify-center rounded-md bg-white/40 backdrop-blur-sm"
|
|
9805
|
-
},
|
|
9825
|
+
}, op = /* @__PURE__ */ p({
|
|
9806
9826
|
name: "NexxtTable",
|
|
9807
9827
|
__name: "Table",
|
|
9808
9828
|
props: /*@__PURE__*/ v({
|
|
@@ -9852,17 +9872,17 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9852
9872
|
}, N = (e, t) => e[t], ee = (e) => `cell-${e}`, F = (e, t) => {
|
|
9853
9873
|
e.key === "ArrowDown" ? (e.preventDefault(), _.value?.[Math.min(t + 1, u.rows.length - 1)]?.focus()) : e.key === "ArrowUp" && (e.preventDefault(), _.value?.[Math.max(t - 1, 0)]?.focus());
|
|
9854
9874
|
};
|
|
9855
|
-
return (r, i) => (D(), s("div",
|
|
9875
|
+
return (r, i) => (D(), s("div", Jf, [c("div", {
|
|
9856
9876
|
role: "grid",
|
|
9857
9877
|
"aria-colcount": t.columns.length + +!!t.selectable,
|
|
9858
9878
|
"aria-rowcount": t.rows.length + 1,
|
|
9859
9879
|
class: "min-w-full"
|
|
9860
|
-
}, [c("div",
|
|
9880
|
+
}, [c("div", Xf, [r.$slots.toolbar ? (D(), s("div", Zf, [M(r.$slots, "toolbar")])) : o("", !0), c("div", {
|
|
9861
9881
|
class: "grid rounded-md bg-gray-50",
|
|
9862
9882
|
style: C({ gridTemplateColumns: E.value }),
|
|
9863
9883
|
role: "row",
|
|
9864
9884
|
"aria-rowindex": "1"
|
|
9865
|
-
}, [t.selectable ? (D(), s("div",
|
|
9885
|
+
}, [t.selectable ? (D(), s("div", Qf, [t.selectionMode === "multiple" ? (D(), a(Xa, {
|
|
9866
9886
|
key: 0,
|
|
9867
9887
|
"model-value": v.value,
|
|
9868
9888
|
indeterminate: y.value,
|
|
@@ -9881,7 +9901,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9881
9901
|
key: 0,
|
|
9882
9902
|
name: h.value === e.key ? g.value === "asc" ? "angle-down" : "angle-up" : "angles-up-down",
|
|
9883
9903
|
class: x(["shrink-0 text-xs", h.value === e.key ? "text-cornflower-blue-600" : "text-slate-400"])
|
|
9884
|
-
}, null, 8, ["name", "class"])) : o("", !0)], 42,
|
|
9904
|
+
}, null, 8, ["name", "class"])) : o("", !0)], 42, $f))), 128))], 4)]), c("div", ep, [
|
|
9885
9905
|
(D(!0), s(e, null, j(t.rows, (n, i) => (D(), s("div", {
|
|
9886
9906
|
key: i,
|
|
9887
9907
|
ref_for: !0,
|
|
@@ -9900,7 +9920,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9900
9920
|
tabindex: "0",
|
|
9901
9921
|
onClick: (e) => k(e, i),
|
|
9902
9922
|
onKeydown: (e) => F(e, i)
|
|
9903
|
-
}, [t.selectable ? (D(), s("div",
|
|
9923
|
+
}, [t.selectable ? (D(), s("div", np, [f(Xa, {
|
|
9904
9924
|
"model-value": b(n),
|
|
9905
9925
|
"aria-label": `Select row ${i + 1}`,
|
|
9906
9926
|
"onUpdate:modelValue": (e) => w(n)
|
|
@@ -9916,45 +9936,45 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
9916
9936
|
}, [M(r.$slots, ee(e.key), {
|
|
9917
9937
|
row: n,
|
|
9918
9938
|
value: N(n, e.key)
|
|
9919
|
-
}, () => [d(P(N(n, e.key)), 1)])], 8,
|
|
9920
|
-
t.rows.length ? o("", !0) : (D(), s("div",
|
|
9939
|
+
}, () => [d(P(N(n, e.key)), 1)])], 8, rp))), 128))], 46, tp))), 128)),
|
|
9940
|
+
t.rows.length ? o("", !0) : (D(), s("div", ip, [M(r.$slots, "empty", {}, () => [i[0] ||= d("Geen data beschikbaar", -1)])])),
|
|
9921
9941
|
f(n, {
|
|
9922
9942
|
"enter-active-class": "transition-opacity duration-200",
|
|
9923
9943
|
"leave-active-class": "transition-opacity duration-200",
|
|
9924
9944
|
"enter-from-class": "opacity-0",
|
|
9925
9945
|
"leave-to-class": "opacity-0"
|
|
9926
9946
|
}, {
|
|
9927
|
-
default: K(() => [t.loading ? (D(), s("div",
|
|
9947
|
+
default: K(() => [t.loading ? (D(), s("div", ap, [M(r.$slots, "loading", {}, () => [f(Q, {
|
|
9928
9948
|
name: "spinner-third",
|
|
9929
9949
|
class: "fa-spin text-3xl text-purple-500"
|
|
9930
9950
|
})])])) : o("", !0)]),
|
|
9931
9951
|
_: 3
|
|
9932
9952
|
})
|
|
9933
|
-
])], 8,
|
|
9953
|
+
])], 8, Yf)]));
|
|
9934
9954
|
}
|
|
9935
|
-
}),
|
|
9955
|
+
}), sp = { class: "block h-38 w-full" }, cp = ["src"], lp = {
|
|
9936
9956
|
key: 1,
|
|
9937
9957
|
class: "flex h-38 w-full items-center justify-center rounded-t-xl bg-gray-100"
|
|
9938
|
-
},
|
|
9958
|
+
}, up = { class: "rounded-b-xl px-8 pt-3.5 pb-4" }, dp = { class: "truncate heading-4 text-gray-900" }, fp = {
|
|
9939
9959
|
key: 0,
|
|
9940
9960
|
class: "truncate body-normal text-gray-700"
|
|
9941
|
-
},
|
|
9961
|
+
}, pp = {
|
|
9942
9962
|
key: 1,
|
|
9943
9963
|
class: "mt-3 flex flex-wrap gap-2"
|
|
9944
|
-
},
|
|
9964
|
+
}, mp = { class: "sr-only" }, hp = { class: "small-normal text-gray-700" }, gp = [
|
|
9945
9965
|
"aria-label",
|
|
9946
9966
|
"aria-pressed",
|
|
9947
9967
|
"disabled"
|
|
9948
|
-
],
|
|
9968
|
+
], _p = {
|
|
9949
9969
|
key: 1,
|
|
9950
9970
|
class: "absolute top-4 right-4 z-20"
|
|
9951
|
-
},
|
|
9971
|
+
}, vp = {
|
|
9952
9972
|
key: 2,
|
|
9953
9973
|
class: "pointer-events-none absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 rounded-xl bg-white/60 opacity-0 backdrop-blur-xs transition-opacity duration-200 ease-out *:pointer-events-auto group-focus-within:opacity-100 group-hover:opacity-100 pointer-coarse:inset-x-0 pointer-coarse:top-0 pointer-coarse:bottom-auto pointer-coarse:h-38 pointer-coarse:justify-end pointer-coarse:bg-transparent pointer-coarse:p-4 pointer-coarse:opacity-100 pointer-coarse:backdrop-blur-none"
|
|
9954
|
-
},
|
|
9974
|
+
}, yp = {
|
|
9955
9975
|
key: 3,
|
|
9956
9976
|
class: "absolute -top-2 -right-2 z-30 flex size-6 items-center justify-center rounded-full bg-cornflower-blue-500 text-white shadow-sm"
|
|
9957
|
-
},
|
|
9977
|
+
}, bp = /* @__PURE__ */ p({
|
|
9958
9978
|
name: "NexxtTemplateCard",
|
|
9959
9979
|
__name: "TemplateCard",
|
|
9960
9980
|
props: {
|
|
@@ -10019,24 +10039,24 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10019
10039
|
t.selectable && "pointer-events-none",
|
|
10020
10040
|
t.selectable && t.disabled && "opacity-50",
|
|
10021
10041
|
n.$slots.overlay && !(t.selectable && t.disabled) && "group-focus-within:opacity-40 group-hover:opacity-40 pointer-coarse:opacity-100!"
|
|
10022
|
-
]]) }, [c("picture",
|
|
10042
|
+
]]) }, [c("picture", sp, [t.image ? (D(), s("img", {
|
|
10023
10043
|
key: 0,
|
|
10024
10044
|
src: t.image,
|
|
10025
10045
|
alt: "",
|
|
10026
10046
|
loading: "lazy",
|
|
10027
10047
|
class: "h-38 w-full rounded-t-xl object-cover"
|
|
10028
|
-
}, null, 8,
|
|
10048
|
+
}, null, 8, cp)) : (D(), s("div", lp, [f(Q, {
|
|
10029
10049
|
name: "image",
|
|
10030
10050
|
class: "text-4xl text-gray-400"
|
|
10031
|
-
})]))]), c("div",
|
|
10032
|
-
c("h3",
|
|
10033
|
-
t.subtitle ? (D(), s("p",
|
|
10034
|
-
t.contentFeatures.length ? (D(), s("ul",
|
|
10035
|
-
tooltip: K(() => [c("span",
|
|
10051
|
+
})]))]), c("div", up, [
|
|
10052
|
+
c("h3", dp, P(t.title), 1),
|
|
10053
|
+
t.subtitle ? (D(), s("p", fp, P(t.subtitle), 1)) : o("", !0),
|
|
10054
|
+
t.contentFeatures.length ? (D(), s("ul", pp, [(D(!0), s(e, null, j(t.contentFeatures, (e) => (D(), s("li", { key: e }, [f(Pt, null, {
|
|
10055
|
+
tooltip: K(() => [c("span", hp, P(d.value[e]), 1)]),
|
|
10036
10056
|
default: K(() => [c("div", {
|
|
10037
10057
|
class: x([[r[e].backgroundColor, r[e].textColor], "pointer-events-auto flex size-8 items-center justify-center rounded-full"]),
|
|
10038
10058
|
onClick: p
|
|
10039
|
-
}, [f(Q, { name: r[e].icon }, null, 8, ["name"]), c("span",
|
|
10059
|
+
}, [f(Q, { name: r[e].icon }, null, 8, ["name"]), c("span", mp, P(d.value[e]), 1)], 2)]),
|
|
10040
10060
|
_: 2
|
|
10041
10061
|
}, 1024)]))), 128))])) : o("", !0)
|
|
10042
10062
|
])], 2),
|
|
@@ -10048,23 +10068,23 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10048
10068
|
disabled: t.disabled || void 0,
|
|
10049
10069
|
class: "absolute inset-0 cursor-pointer rounded-xl focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-cornflower-blue-500 disabled:cursor-not-allowed",
|
|
10050
10070
|
onClick: p
|
|
10051
|
-
}, null, 8,
|
|
10052
|
-
n.$slots.actions ? (D(), s("div",
|
|
10053
|
-
n.$slots.overlay && !(t.selectable && t.disabled) ? (D(), s("div",
|
|
10054
|
-
t.selectable && t.selected && t.checkmark ? (D(), s("span",
|
|
10071
|
+
}, null, 8, gp)) : o("", !0),
|
|
10072
|
+
n.$slots.actions ? (D(), s("div", _p, [M(n.$slots, "actions", { selected: t.selected })])) : o("", !0),
|
|
10073
|
+
n.$slots.overlay && !(t.selectable && t.disabled) ? (D(), s("div", vp, [M(n.$slots, "overlay", { selected: t.selected })])) : o("", !0),
|
|
10074
|
+
t.selectable && t.selected && t.checkmark ? (D(), s("span", yp, [f(Q, {
|
|
10055
10075
|
name: "check",
|
|
10056
10076
|
type: "solid",
|
|
10057
10077
|
class: "text-xs"
|
|
10058
10078
|
})])) : o("", !0)
|
|
10059
10079
|
], 2));
|
|
10060
10080
|
}
|
|
10061
|
-
}),
|
|
10081
|
+
}), xp = {
|
|
10062
10082
|
key: 0,
|
|
10063
10083
|
class: "text-brick-500"
|
|
10064
|
-
},
|
|
10084
|
+
}, Sp = ["rows", "placeholder"], Cp = {
|
|
10065
10085
|
key: 1,
|
|
10066
10086
|
class: "small-normal text-brick-400"
|
|
10067
|
-
},
|
|
10087
|
+
}, wp = /* @__PURE__ */ p({
|
|
10068
10088
|
name: "NexxtTextarea",
|
|
10069
10089
|
inheritAttrs: !1,
|
|
10070
10090
|
__name: "Textarea",
|
|
@@ -10120,7 +10140,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10120
10140
|
key: 0,
|
|
10121
10141
|
class: "justify-start small-normal text-gray-700",
|
|
10122
10142
|
for: n
|
|
10123
|
-
}, [d(P(e.label) + " ", 1), e.required ? (D(), s("span",
|
|
10143
|
+
}, [d(P(e.label) + " ", 1), e.required ? (D(), s("span", xp, "*")) : o("", !0)])) : o("", !0),
|
|
10124
10144
|
re(c("textarea", y({
|
|
10125
10145
|
id: n,
|
|
10126
10146
|
ref_key: "textareaEl",
|
|
@@ -10131,21 +10151,21 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10131
10151
|
placeholder: e.placeholder,
|
|
10132
10152
|
class: ["min-h-10 w-full rounded-lg border px-3 py-2 small-normal text-gray-900 transition-colors outline-none placeholder:text-gray-400 focus:border-cornflower-blue-500", [e.error ? "border-brick-400" : "border-gray-200", e.autosize || e.resize === "none" ? "resize-none" : "resize-y"]],
|
|
10133
10153
|
onInput: p
|
|
10134
|
-
}), null, 16,
|
|
10135
|
-
e.error && e.errorMessage ? (D(), s("p",
|
|
10154
|
+
}), null, 16, Sp), [[U, r.value]]),
|
|
10155
|
+
e.error && e.errorMessage ? (D(), s("p", Cp, P(e.errorMessage), 1)) : o("", !0)
|
|
10136
10156
|
], 6));
|
|
10137
10157
|
}
|
|
10138
|
-
}),
|
|
10158
|
+
}), Tp = [
|
|
10139
10159
|
"data-event-source",
|
|
10140
10160
|
"data-event-date",
|
|
10141
10161
|
"date-event-type"
|
|
10142
|
-
],
|
|
10162
|
+
], Ep = { class: "heading-3" }, Dp = ["href"], Op = { class: "truncate group-hover:underline" }, kp = {
|
|
10143
10163
|
key: 1,
|
|
10144
10164
|
class: "mt-1 text-sm text-gray-500"
|
|
10145
|
-
},
|
|
10165
|
+
}, Ap = {
|
|
10146
10166
|
key: 2,
|
|
10147
10167
|
class: "mt-1 text-sm text-gray-500"
|
|
10148
|
-
},
|
|
10168
|
+
}, jp = /* @__PURE__ */ p({
|
|
10149
10169
|
name: "NexxtTimelineEvent",
|
|
10150
10170
|
__name: "TimelineEvent",
|
|
10151
10171
|
props: {
|
|
@@ -10187,20 +10207,20 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10187
10207
|
name: n.value.icon,
|
|
10188
10208
|
class: "flex size-6 text-xl text-white"
|
|
10189
10209
|
}, null, 8, ["name"])], 2), c("div", { class: x(["flex w-full flex-col gap-2 rounded-xl border border-gray-200 p-8", { "max-w-lg": e.splitView }]) }, [
|
|
10190
|
-
c("span",
|
|
10210
|
+
c("span", Ep, P(n.value.label), 1),
|
|
10191
10211
|
e.event.url ? (D(), s("a", {
|
|
10192
10212
|
key: 0,
|
|
10193
10213
|
href: e.event.url,
|
|
10194
10214
|
target: "_blank",
|
|
10195
10215
|
class: "group mt-1 flex justify-between gap-2 text-sm text-cornflower-blue-500 hover:text-cornflower-blue-600"
|
|
10196
|
-
}, [c("span",
|
|
10216
|
+
}, [c("span", Op, P(e.event.description || e.event.url), 1), f(Q, {
|
|
10197
10217
|
name: "external-link",
|
|
10198
10218
|
class: "ml-1 size-4 text-gray-950"
|
|
10199
|
-
})], 8,
|
|
10200
|
-
e.event.request_reason ? (D(), s("span",
|
|
10201
|
-
], 2)], 2)], 10,
|
|
10219
|
+
})], 8, Dp)) : e.event.description ? (D(), s("span", kp, P(e.event.description), 1)) : o("", !0),
|
|
10220
|
+
e.event.request_reason ? (D(), s("span", Ap, " Reden: " + P(e.event.request_reason), 1)) : o("", !0)
|
|
10221
|
+
], 2)], 2)], 10, Tp));
|
|
10202
10222
|
}
|
|
10203
|
-
}),
|
|
10223
|
+
}), Mp = { class: "relative z-10" }, Np = { class: "flex items-center justify-between px-4 py-2" }, Pp = { class: "flex gap-1" }, Fp = { class: "text-sm" }, Ip = { class: "flex gap-1" }, Lp = { class: "text-sm" }, Rp = /* @__PURE__ */ p({
|
|
10204
10224
|
name: "NexxtTimelineLanes",
|
|
10205
10225
|
__name: "TimelineLanes",
|
|
10206
10226
|
props: {
|
|
@@ -10210,15 +10230,15 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10210
10230
|
rightTooltip: { default: "Vanuit relatie" }
|
|
10211
10231
|
},
|
|
10212
10232
|
setup(e) {
|
|
10213
|
-
return (t, n) => (D(), s("div",
|
|
10214
|
-
tooltip: K(() => [c("span",
|
|
10233
|
+
return (t, n) => (D(), s("div", Mp, [c("div", Np, [c("span", Pp, [d(P(e.leftLabel) + " ", 1), e.leftTooltip ? (D(), a(Pt, { key: 0 }, {
|
|
10234
|
+
tooltip: K(() => [c("span", Fp, P(e.leftTooltip), 1)]),
|
|
10215
10235
|
default: K(() => [f(Q, {
|
|
10216
10236
|
name: "circle-info",
|
|
10217
10237
|
class: "size-4 text-xs text-gray-600"
|
|
10218
10238
|
})]),
|
|
10219
10239
|
_: 1
|
|
10220
|
-
})) : o("", !0)]), c("span",
|
|
10221
|
-
tooltip: K(() => [c("span",
|
|
10240
|
+
})) : o("", !0)]), c("span", Ip, [d(P(e.rightLabel) + " ", 1), e.rightTooltip ? (D(), a(Pt, { key: 0 }, {
|
|
10241
|
+
tooltip: K(() => [c("span", Lp, P(e.rightTooltip), 1)]),
|
|
10222
10242
|
default: K(() => [f(Q, {
|
|
10223
10243
|
name: "circle-info",
|
|
10224
10244
|
class: "size-4 text-xs text-gray-600"
|
|
@@ -10226,10 +10246,10 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10226
10246
|
_: 1
|
|
10227
10247
|
})) : o("", !0)])])]));
|
|
10228
10248
|
}
|
|
10229
|
-
}),
|
|
10249
|
+
}), zp = ["data-phase"], Bp = { class: "text-sm font-semibold tracking-wider uppercase" }, Vp = { class: "mt-2 font-medium text-xs text-gray-500" }, Hp = {
|
|
10230
10250
|
key: 1,
|
|
10231
10251
|
class: "h-1"
|
|
10232
|
-
},
|
|
10252
|
+
}, Up = /* @__PURE__ */ p({
|
|
10233
10253
|
name: "NexxtTimelinePhaseblock",
|
|
10234
10254
|
__name: "TimelinePhaseblock",
|
|
10235
10255
|
props: {
|
|
@@ -10265,13 +10285,13 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10265
10285
|
class: "relative z-10 flex flex-col gap-16",
|
|
10266
10286
|
"data-phase": t.phase.phase.value
|
|
10267
10287
|
}, [
|
|
10268
|
-
t.index === 0 && t.isSplitView ? (D(), a(
|
|
10288
|
+
t.index === 0 && t.isSplitView ? (D(), a(Rp, { key: 0 })) : o("", !0),
|
|
10269
10289
|
c("div", { class: x(["absolute bottom-0 left-5 w-0 border-l", [I(Ct)[t.phase.phase.value].color, t.index === 0 && t.isSplitView ? "top-10" : "top-0"]]) }, null, 2),
|
|
10270
10290
|
t.isSplitView ? (D(), s("div", {
|
|
10271
10291
|
key: 1,
|
|
10272
10292
|
class: x(["absolute right-5 bottom-0 w-0 border-l", [I(Ct)[t.phase.phase.value].color, t.index === 0 ? "top-10" : "top-0"]])
|
|
10273
10293
|
}, null, 2)) : o("", !0),
|
|
10274
|
-
(D(!0), s(e, null, j(t.phase.events, (e) => (D(), a(
|
|
10294
|
+
(D(!0), s(e, null, j(t.phase.events, (e) => (D(), a(jp, {
|
|
10275
10295
|
key: e.id,
|
|
10276
10296
|
event: e,
|
|
10277
10297
|
"split-view": t.isSplitView
|
|
@@ -10280,26 +10300,26 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10280
10300
|
key: 2,
|
|
10281
10301
|
class: x(["relative flex flex-col items-center pt-8 pb-24 text-center", { "pl-16": !t.isSplitView }])
|
|
10282
10302
|
}, [
|
|
10283
|
-
c("div", { class: x(["flex items-center gap-2 rounded-full px-12 py-4", [I(Ct)[t.phase.phase.value].bgColor, I(Ct)[t.phase.phase.value].textColor]]) }, [c("span",
|
|
10303
|
+
c("div", { class: x(["flex items-center gap-2 rounded-full px-12 py-4", [I(Ct)[t.phase.phase.value].bgColor, I(Ct)[t.phase.phase.value].textColor]]) }, [c("span", Bp, P(I(Ct)[t.phase.phase.value].label), 1), d() ? (D(), a(Q, {
|
|
10284
10304
|
key: 0,
|
|
10285
10305
|
name: d() === "up" ? "arrow-up" : "arrow-down",
|
|
10286
10306
|
class: "size-4 text-white"
|
|
10287
10307
|
}, null, 8, ["name"])) : o("", !0)], 2),
|
|
10288
|
-
c("span",
|
|
10308
|
+
c("span", Vp, P(u()), 1),
|
|
10289
10309
|
t.isSplitView ? (D(), s("div", {
|
|
10290
10310
|
key: 0,
|
|
10291
10311
|
class: x(["mt-4 h-px w-[75%]", I(Ct)[t.phase.phase.value].bgColor])
|
|
10292
10312
|
}, null, 2)) : o("", !0),
|
|
10293
|
-
t.isLast ? o("", !0) : (D(), s("div",
|
|
10313
|
+
t.isLast ? o("", !0) : (D(), s("div", Hp)),
|
|
10294
10314
|
c("div", { class: x(["absolute inset-y-0 left-5 w-px bg-linear-to-b", r.value]) }, null, 2),
|
|
10295
10315
|
t.isSplitView ? (D(), s("div", {
|
|
10296
10316
|
key: 2,
|
|
10297
10317
|
class: x(["absolute inset-y-0 right-5 w-px bg-linear-to-b", r.value])
|
|
10298
10318
|
}, null, 2)) : o("", !0)
|
|
10299
10319
|
], 2))
|
|
10300
|
-
], 8,
|
|
10320
|
+
], 8, zp));
|
|
10301
10321
|
}
|
|
10302
|
-
}),
|
|
10322
|
+
}), Wp = { class: "relative z-10 flex flex-col gap-16" }, Gp = /* @__PURE__ */ p({
|
|
10303
10323
|
name: "NexxtTimelineTrack",
|
|
10304
10324
|
__name: "TimelineTrack",
|
|
10305
10325
|
props: {
|
|
@@ -10320,8 +10340,8 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10320
10340
|
},
|
|
10321
10341
|
setup(t) {
|
|
10322
10342
|
let n = t, r = i(() => n.splitView && n.showLanes);
|
|
10323
|
-
return (n, i) => (D(), s("div",
|
|
10324
|
-
r.value ? (D(), a(
|
|
10343
|
+
return (n, i) => (D(), s("div", Wp, [
|
|
10344
|
+
r.value ? (D(), a(Rp, {
|
|
10325
10345
|
key: 0,
|
|
10326
10346
|
"left-label": t.leftLabel,
|
|
10327
10347
|
"right-label": t.rightLabel,
|
|
@@ -10338,24 +10358,24 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10338
10358
|
key: 1,
|
|
10339
10359
|
class: x(["absolute right-5 bottom-0 w-0 border-l", [t.color, r.value ? "top-10" : "top-0"]])
|
|
10340
10360
|
}, null, 2)) : o("", !0),
|
|
10341
|
-
M(n.$slots, "default", {}, () => [(D(!0), s(e, null, j(t.events, (e) => (D(), a(
|
|
10361
|
+
M(n.$slots, "default", {}, () => [(D(!0), s(e, null, j(t.events, (e) => (D(), a(jp, {
|
|
10342
10362
|
key: e.id,
|
|
10343
10363
|
event: e,
|
|
10344
10364
|
"split-view": t.splitView
|
|
10345
10365
|
}, null, 8, ["event", "split-view"]))), 128))])
|
|
10346
10366
|
]));
|
|
10347
10367
|
}
|
|
10348
|
-
}),
|
|
10368
|
+
}), Kp = ["role", "aria-live"], qp = { class: "flex min-w-0 flex-1 flex-col gap-0.5 pt-0.5" }, Jp = {
|
|
10349
10369
|
key: 1,
|
|
10350
10370
|
class: "body-normal"
|
|
10351
|
-
},
|
|
10371
|
+
}, Yp = ["aria-label"], Xp = {
|
|
10352
10372
|
key: 0,
|
|
10353
10373
|
class: "absolute inset-0 -rotate-90 text-gray-400",
|
|
10354
10374
|
viewBox: "0 0 24 24",
|
|
10355
10375
|
width: "32",
|
|
10356
10376
|
height: "32",
|
|
10357
10377
|
"aria-hidden": "true"
|
|
10358
|
-
},
|
|
10378
|
+
}, Zp = 56.55, Qp = /*#__PURE__*/ ii(/* @__PURE__ */ p({
|
|
10359
10379
|
name: "NexxtToast",
|
|
10360
10380
|
__name: "Toast",
|
|
10361
10381
|
props: {
|
|
@@ -10370,7 +10390,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10370
10390
|
},
|
|
10371
10391
|
emits: ["dismiss"],
|
|
10372
10392
|
setup(e, { emit: t }) {
|
|
10373
|
-
R((e) => ({ fa0d20de:
|
|
10393
|
+
R((e) => ({ fa0d20de: Zp }));
|
|
10374
10394
|
let n = {
|
|
10375
10395
|
info: {
|
|
10376
10396
|
icon: "info",
|
|
@@ -10423,12 +10443,12 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10423
10443
|
name: u.value.icon,
|
|
10424
10444
|
class: "text-xl"
|
|
10425
10445
|
}, null, 8, ["name"])], 2),
|
|
10426
|
-
c("div",
|
|
10446
|
+
c("div", qp, [
|
|
10427
10447
|
e.title ? (D(), s("p", {
|
|
10428
10448
|
key: 0,
|
|
10429
10449
|
class: x(["heading-4", u.value.titleColor])
|
|
10430
10450
|
}, P(e.title), 3)) : o("", !0),
|
|
10431
|
-
e.message ? (D(), s("p",
|
|
10451
|
+
e.message ? (D(), s("p", Jp, P(e.message), 1)) : o("", !0),
|
|
10432
10452
|
M(t.$slots, "default", {}, void 0, !0)
|
|
10433
10453
|
]),
|
|
10434
10454
|
e.dismissible ? (D(), s("button", {
|
|
@@ -10437,7 +10457,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10437
10457
|
class: "relative flex size-8 shrink-0 cursor-pointer items-center justify-center focus:outline-none",
|
|
10438
10458
|
"aria-label": e.autoClose ? `Sluiten (verdwijnt automatisch na ${e.autoClose / 1e3} seconden)` : "Sluiten",
|
|
10439
10459
|
onClick: n[0] ||= (e) => a("dismiss")
|
|
10440
|
-
}, [e.autoClose ? (D(), s("svg",
|
|
10460
|
+
}, [e.autoClose ? (D(), s("svg", Xp, [c("circle", {
|
|
10441
10461
|
cx: "12",
|
|
10442
10462
|
cy: "12",
|
|
10443
10463
|
r: "9",
|
|
@@ -10445,7 +10465,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10445
10465
|
stroke: "currentColor",
|
|
10446
10466
|
"stroke-width": "1.2",
|
|
10447
10467
|
"stroke-linecap": "round",
|
|
10448
|
-
"stroke-dasharray":
|
|
10468
|
+
"stroke-dasharray": Zp,
|
|
10449
10469
|
class: "timer-circle",
|
|
10450
10470
|
style: C({
|
|
10451
10471
|
animationDuration: `${e.autoClose}ms`,
|
|
@@ -10454,10 +10474,10 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10454
10474
|
}, null, 4)])) : o("", !0), f(Q, {
|
|
10455
10475
|
name: "xmark",
|
|
10456
10476
|
class: "text-sm"
|
|
10457
|
-
})], 8,
|
|
10458
|
-
], 42,
|
|
10477
|
+
})], 8, Yp)) : o("", !0)
|
|
10478
|
+
], 42, Kp));
|
|
10459
10479
|
}
|
|
10460
|
-
}), [["__scopeId", "data-v-7e3c5bda"]]),
|
|
10480
|
+
}), [["__scopeId", "data-v-7e3c5bda"]]), $p = /* @__PURE__ */ p({
|
|
10461
10481
|
name: "NexxtToaster",
|
|
10462
10482
|
__name: "Toaster",
|
|
10463
10483
|
props: {
|
|
@@ -10490,7 +10510,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10490
10510
|
default: K(() => [(D(!0), s(e, null, j(n.toasts, (e) => (D(), s("div", {
|
|
10491
10511
|
key: e.id,
|
|
10492
10512
|
class: "pointer-events-auto"
|
|
10493
|
-
}, [f(
|
|
10513
|
+
}, [f(Qp, y({ ref_for: !0 }, e, { onDismiss: (t) => o("dismiss", e.id) }), null, 16, ["onDismiss"])]))), 128))]),
|
|
10494
10514
|
_: 1
|
|
10495
10515
|
}, 8, [
|
|
10496
10516
|
"class",
|
|
@@ -10498,7 +10518,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10498
10518
|
"leave-to-class"
|
|
10499
10519
|
])], 2)]));
|
|
10500
10520
|
}
|
|
10501
|
-
}),
|
|
10521
|
+
}), em = (e, t) => e.id === t || !!e.children?.some((e) => em(e, t)), tm = ({ slots: e, ghost: t }, n) => {
|
|
10502
10522
|
if (t && n >= t.top && n < t.bottom) return { kind: "keep" };
|
|
10503
10523
|
let r = t && n >= t.bottom ? n - (t.bottom - t.top) : n, i = e.at(-1);
|
|
10504
10524
|
if (i && r >= i.bottom) return {
|
|
@@ -10514,8 +10534,8 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10514
10534
|
id: a.id,
|
|
10515
10535
|
ratio: Math.min(1, Math.max(0, o))
|
|
10516
10536
|
};
|
|
10517
|
-
},
|
|
10518
|
-
if (
|
|
10537
|
+
}, nm = (e, t, n) => {
|
|
10538
|
+
if (em(n, e.node.id)) return null;
|
|
10519
10539
|
if (e.canHaveChildren && t > .3 && t < .7) return {
|
|
10520
10540
|
rowId: e.node.id,
|
|
10521
10541
|
parentId: e.node.id,
|
|
@@ -10529,7 +10549,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10529
10549
|
index: e.position - 1 + +!!r,
|
|
10530
10550
|
marker: r ? "after" : "before"
|
|
10531
10551
|
};
|
|
10532
|
-
},
|
|
10552
|
+
}, rm = (e, t) => e.parentId === t.parentId && (e.index === t.position - 1 || e.index === t.position), im = (e, t) => e === t || !!e && !!t && e.parentId === t.parentId && e.index === t.index, am = (e, t, n) => {
|
|
10533
10553
|
if (!n) return null;
|
|
10534
10554
|
let r = n.parentId === null ? -1 : e.findIndex((e) => e.node.id === n.parentId), i = e[r];
|
|
10535
10555
|
if (n.parentId !== null && !i || i?.expandable && !i.expanded) return null;
|
|
@@ -10547,15 +10567,15 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10547
10567
|
at: s,
|
|
10548
10568
|
depth: a
|
|
10549
10569
|
};
|
|
10550
|
-
},
|
|
10570
|
+
}, om = ["aria-label"], sm = {
|
|
10551
10571
|
key: 0,
|
|
10552
10572
|
"aria-hidden": "true",
|
|
10553
10573
|
class: "mb-1.5",
|
|
10554
10574
|
"data-tree-ghost": ""
|
|
10555
|
-
},
|
|
10575
|
+
}, cm = {
|
|
10556
10576
|
"data-tree-ghost-content": "",
|
|
10557
10577
|
class: "flex min-w-0 items-center gap-1.5"
|
|
10558
|
-
},
|
|
10578
|
+
}, lm = { class: "truncate" }, um = [
|
|
10559
10579
|
"aria-level",
|
|
10560
10580
|
"aria-posinset",
|
|
10561
10581
|
"aria-setsize",
|
|
@@ -10570,10 +10590,10 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10570
10590
|
"onFocus",
|
|
10571
10591
|
"onPointerdown",
|
|
10572
10592
|
"onDragstart"
|
|
10573
|
-
],
|
|
10593
|
+
], dm = ["onClick"], fm = {
|
|
10574
10594
|
key: 1,
|
|
10575
10595
|
class: "size-5 shrink-0"
|
|
10576
|
-
},
|
|
10596
|
+
}, pm = ["id"], mm = ["inert"], hm = 8, gm = "bg-cornflower-blue-50 outline-1 -outline-offset-1 outline-cornflower-blue-600 outline-dashed", _m = "transform 200ms var(--ease-in-out-strong), opacity 80ms linear 120ms", vm = "opacity 80ms linear 120ms", ym = /* @__PURE__ */ p({
|
|
10577
10597
|
name: "NexxtTree",
|
|
10578
10598
|
__name: "Tree",
|
|
10579
10599
|
props: /*@__PURE__*/ v({
|
|
@@ -10608,7 +10628,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10608
10628
|
};
|
|
10609
10629
|
return t(u.nodes, 0, null), e;
|
|
10610
10630
|
}), y = A(null), S = A(null), E = A(null), O = A(null), k = !1, M = i(() => v.value.find((e) => e.node.id === y.value)), N = (e) => {
|
|
10611
|
-
|
|
10631
|
+
im(E.value, e) || (E.value = e);
|
|
10612
10632
|
}, ee = (e) => e.classList.contains("absolute"), F = () => {
|
|
10613
10633
|
let e = g.value?.querySelector("[data-tree-id]")?.parentElement, t = Array.from(e?.children ?? []).filter((e) => e instanceof HTMLElement && !ee(e)), n = [], r = null;
|
|
10614
10634
|
return t.forEach((e, i) => {
|
|
@@ -10640,16 +10660,16 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10640
10660
|
N(null);
|
|
10641
10661
|
return;
|
|
10642
10662
|
}
|
|
10643
|
-
let r =
|
|
10663
|
+
let r = tm(F(), t - g.value.getBoundingClientRect().top);
|
|
10644
10664
|
if (r.kind === "keep") return;
|
|
10645
|
-
let i = v.value.find((e) => e.node.id === r.id), a = i ?
|
|
10646
|
-
N(a && !
|
|
10665
|
+
let i = v.value.find((e) => e.node.id === r.id), a = i ? nm(i, r.ratio, n.node) : null;
|
|
10666
|
+
N(a && !rm(a, n) && R(n, a) ? a : null);
|
|
10647
10667
|
}, R = (e, t) => u.canDrop?.({
|
|
10648
10668
|
id: e.node.id,
|
|
10649
10669
|
parentId: t.parentId,
|
|
10650
10670
|
index: t.index
|
|
10651
10671
|
}) ?? !0, V = i(() => {
|
|
10652
|
-
let e = M.value, t = e ?
|
|
10672
|
+
let e = M.value, t = e ? am(v.value, u.nodes, E.value) : null;
|
|
10653
10673
|
return e && t ? {
|
|
10654
10674
|
...t,
|
|
10655
10675
|
node: e.node
|
|
@@ -10688,7 +10708,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10688
10708
|
n ? "text-cornflower-blue-600" : "text-gray-800",
|
|
10689
10709
|
!n && !S.value && "hover:bg-gray-100",
|
|
10690
10710
|
re.value.has(t) && "opacity-40",
|
|
10691
|
-
H.value === t &&
|
|
10711
|
+
H.value === t && gm
|
|
10692
10712
|
];
|
|
10693
10713
|
}, ie = null, Y = (e) => {
|
|
10694
10714
|
g.value?.contains(e.target) || N(null);
|
|
@@ -10817,12 +10837,12 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10817
10837
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
10818
10838
|
let n = Ne(t);
|
|
10819
10839
|
if (n) {
|
|
10820
|
-
n.style.transition = "none", n.style.opacity = "0", n.getBoundingClientRect(), n.style.transition =
|
|
10840
|
+
n.style.transition = "none", n.style.opacity = "0", n.getBoundingClientRect(), n.style.transition = vm, n.style.opacity = "";
|
|
10821
10841
|
return;
|
|
10822
10842
|
}
|
|
10823
10843
|
Me.add(t.dataset.treeId);
|
|
10824
10844
|
let r = Oe(v.value.find((e) => e.node.id === t.dataset.treeId)?.parentId), i = r ? t.offsetTop - (r.offsetTop + r.offsetHeight) : 0;
|
|
10825
|
-
t.style.transition = "none", t.style.transform = `translateY(${-i}px)`, t.style.opacity = "0", t.style.pointerEvents = "none", t.getBoundingClientRect(), t.style.transition =
|
|
10845
|
+
t.style.transition = "none", t.style.transform = `translateY(${-i}px)`, t.style.opacity = "0", t.style.pointerEvents = "none", t.getBoundingClientRect(), t.style.transition = _m, t.style.transform = "", t.style.opacity = "";
|
|
10826
10846
|
}, Fe = null, Ie = (e) => {
|
|
10827
10847
|
let t = e, n = Ne(t);
|
|
10828
10848
|
if (n) {
|
|
@@ -10922,17 +10942,17 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10922
10942
|
onAfterEnter: Ie,
|
|
10923
10943
|
onEnterCancelled: Ie
|
|
10924
10944
|
}, {
|
|
10925
|
-
default: K(() => [(D(!0), s(e, null, j(G.value, (t) => (D(), s(e, { key: t.key }, [t.ghost ? (D(), s("div",
|
|
10945
|
+
default: K(() => [(D(!0), s(e, null, j(G.value, (t) => (D(), s(e, { key: t.key }, [t.ghost ? (D(), s("div", sm, [c("div", {
|
|
10926
10946
|
class: "flex rounded-md bg-cornflower-blue-50 py-1 pr-2 pl-1 small-normal text-gray-700 outline-1 -outline-offset-1 outline-cornflower-blue-600 transition-[margin-left] duration-200 ease-in-out-strong outline-dashed motion-reduce:transition-none",
|
|
10927
|
-
style: C({ marginLeft: `${t.depth *
|
|
10928
|
-
}, [c("span",
|
|
10947
|
+
style: C({ marginLeft: `${t.depth * hm}px` })
|
|
10948
|
+
}, [c("span", cm, [
|
|
10929
10949
|
i[3] ||= c("span", { class: "size-5 shrink-0" }, null, -1),
|
|
10930
10950
|
t.node.icon ? (D(), a(Q, {
|
|
10931
10951
|
key: 0,
|
|
10932
10952
|
name: t.node.icon,
|
|
10933
10953
|
class: "shrink-0"
|
|
10934
10954
|
}, null, 8, ["name"])) : o("", !0),
|
|
10935
|
-
c("span",
|
|
10955
|
+
c("span", lm, P(t.node.label), 1)
|
|
10936
10956
|
])], 4)])) : (D(), s("div", {
|
|
10937
10957
|
key: 1,
|
|
10938
10958
|
role: "treeitem",
|
|
@@ -10947,7 +10967,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10947
10967
|
"data-tree-drop": H.value === t.row.node.id ? "inside" : void 0,
|
|
10948
10968
|
draggable: t.row.draggable,
|
|
10949
10969
|
class: x(["group mb-1.5 flex items-center gap-1.5 overflow-x-clip rounded-md py-1 pr-2 small-normal transition-[color,background-color,outline-color,opacity] duration-150 select-none focus-visible:outline-2 focus-visible:outline-cornflower-blue-500 motion-reduce:transition-none", q(t.row)]),
|
|
10950
|
-
style: C({ paddingLeft: `${t.row.depth *
|
|
10970
|
+
style: C({ paddingLeft: `${t.row.depth * hm + 4}px` }),
|
|
10951
10971
|
onClick: (e) => Se(t.row.node.id),
|
|
10952
10972
|
onFocus: (e) => _.value = t.row.node.id,
|
|
10953
10973
|
onPointerdown: (e) => fe(e, t.row),
|
|
@@ -10965,7 +10985,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10965
10985
|
}, [f(Q, {
|
|
10966
10986
|
name: "chevron-down",
|
|
10967
10987
|
class: x(["extra-small-normal transition-transform duration-150 ease-out motion-reduce:transition-none", !t.row.expanded && "-rotate-90"])
|
|
10968
|
-
}, null, 8, ["class"])], 42,
|
|
10988
|
+
}, null, 8, ["class"])], 42, dm)) : (D(), s("span", fm)),
|
|
10969
10989
|
t.row.node.icon ? (D(), a(Q, {
|
|
10970
10990
|
key: 2,
|
|
10971
10991
|
name: t.row.node.icon,
|
|
@@ -10975,7 +10995,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10975
10995
|
id: Be(t.row.node.id),
|
|
10976
10996
|
"data-tree-label": "",
|
|
10977
10997
|
class: "min-w-0 flex-1 truncate"
|
|
10978
|
-
}, P(t.row.node.label), 9,
|
|
10998
|
+
}, P(t.row.node.label), 9, pm),
|
|
10979
10999
|
d["node-actions"] ? (D(), s("div", {
|
|
10980
11000
|
key: 3,
|
|
10981
11001
|
"data-tree-actions": "",
|
|
@@ -10989,31 +11009,31 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
10989
11009
|
}, [f(Ve, {
|
|
10990
11010
|
node: t.row.node,
|
|
10991
11011
|
tabindex: Re(t.row.node.id)
|
|
10992
|
-
}, null, 8, ["node", "tabindex"])], 2)], 42,
|
|
10993
|
-
], 46,
|
|
11012
|
+
}, null, 8, ["node", "tabindex"])], 2)], 42, mm)) : o("", !0)
|
|
11013
|
+
], 46, um))], 64))), 128))]),
|
|
10994
11014
|
_: 1
|
|
10995
|
-
})], 40,
|
|
11015
|
+
})], 40, om));
|
|
10996
11016
|
}
|
|
10997
|
-
}),
|
|
11017
|
+
}), bm = [
|
|
10998
11018
|
"src",
|
|
10999
11019
|
"loop",
|
|
11000
11020
|
"aria-label"
|
|
11001
|
-
],
|
|
11021
|
+
], xm = {
|
|
11002
11022
|
key: 0,
|
|
11003
11023
|
role: "alert",
|
|
11004
11024
|
class: "absolute inset-0 flex flex-col items-center justify-center gap-3 rounded-lg bg-gray-900 text-white"
|
|
11005
|
-
},
|
|
11025
|
+
}, Sm = { class: "heading-4" }, Cm = { class: "max-w-xs truncate extra-small-normal text-white/50" }, wm = {
|
|
11006
11026
|
key: 0,
|
|
11007
11027
|
class: "pointer-events-none absolute inset-0 flex items-center justify-center"
|
|
11008
|
-
},
|
|
11028
|
+
}, Tm = {
|
|
11009
11029
|
class: "flex size-16 items-center justify-center rounded-full bg-black/50 text-white",
|
|
11010
11030
|
"aria-hidden": "true"
|
|
11011
|
-
},
|
|
11031
|
+
}, Em = [
|
|
11012
11032
|
"aria-label",
|
|
11013
11033
|
"aria-valuemax",
|
|
11014
11034
|
"aria-valuenow",
|
|
11015
11035
|
"aria-valuetext"
|
|
11016
|
-
],
|
|
11036
|
+
], Dm = { class: "flex items-center gap-2" }, Om = ["aria-label"], km = { class: "extra-small-normal text-white/70 tabular-nums" }, Am = ["aria-label"], jm = ["aria-label"], Mm = /* @__PURE__ */ p({
|
|
11017
11037
|
__name: "VideoPlayer",
|
|
11018
11038
|
props: {
|
|
11019
11039
|
src: {},
|
|
@@ -11094,15 +11114,15 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
11094
11114
|
"aria-label": a.value.video,
|
|
11095
11115
|
onError: r[0] ||= (e) => S.value = !0,
|
|
11096
11116
|
onClick: r[1] ||= (t) => e.showControls === !1 ? void 0 : N()
|
|
11097
|
-
}, null, 42,
|
|
11098
|
-
S.value ? (D(), s("div",
|
|
11117
|
+
}, null, 42, bm),
|
|
11118
|
+
S.value ? (D(), s("div", xm, [
|
|
11099
11119
|
f(Q, {
|
|
11100
11120
|
name: "circle-exclamation",
|
|
11101
11121
|
class: "text-3xl text-red-400",
|
|
11102
11122
|
"aria-hidden": "true"
|
|
11103
11123
|
}),
|
|
11104
|
-
c("p",
|
|
11105
|
-
c("p",
|
|
11124
|
+
c("p", Sm, P(a.value.error), 1),
|
|
11125
|
+
c("p", Cm, P(e.src), 1)
|
|
11106
11126
|
])) : o("", !0),
|
|
11107
11127
|
f(n, {
|
|
11108
11128
|
"enter-active-class": "transition-opacity duration-100 ease-out",
|
|
@@ -11110,7 +11130,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
11110
11130
|
"enter-from-class": "opacity-0",
|
|
11111
11131
|
"leave-to-class": "opacity-0"
|
|
11112
11132
|
}, {
|
|
11113
|
-
default: K(() => [e.showControls !== !1 && w.value && !S.value ? (D(), s("div",
|
|
11133
|
+
default: K(() => [e.showControls !== !1 && w.value && !S.value ? (D(), s("div", wm, [c("div", Tm, [f(Q, {
|
|
11114
11134
|
name: w.value,
|
|
11115
11135
|
class: "text-2xl"
|
|
11116
11136
|
}, null, 8, ["name"])])])) : o("", !0)]),
|
|
@@ -11153,7 +11173,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
11153
11173
|
class: "absolute top-1/2 size-3 -translate-1/2 rounded-full bg-sapphire-100 opacity-0 shadow-sm transition-opacity group-hover/player:opacity-100",
|
|
11154
11174
|
style: C({ left: `${te.value}%` })
|
|
11155
11175
|
}, null, 4)
|
|
11156
|
-
], 40,
|
|
11176
|
+
], 40, Em), c("div", Dm, [
|
|
11157
11177
|
c("button", {
|
|
11158
11178
|
type: "button",
|
|
11159
11179
|
"aria-label": I(u) ? a.value.pause : a.value.play,
|
|
@@ -11163,8 +11183,8 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
11163
11183
|
name: I(u) ? "pause" : "play",
|
|
11164
11184
|
class: "text-sm",
|
|
11165
11185
|
"aria-hidden": "true"
|
|
11166
|
-
}, null, 8, ["name"])], 8,
|
|
11167
|
-
c("span",
|
|
11186
|
+
}, null, 8, ["name"])], 8, Om),
|
|
11187
|
+
c("span", km, P(M(z.value)) + " / " + P(M(I(m))), 1),
|
|
11168
11188
|
r[7] ||= c("div", { class: "flex-1" }, null, -1),
|
|
11169
11189
|
c("button", {
|
|
11170
11190
|
type: "button",
|
|
@@ -11175,7 +11195,7 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
11175
11195
|
name: I(h) ? "volume-xmark" : "volume-high",
|
|
11176
11196
|
class: "text-sm",
|
|
11177
11197
|
"aria-hidden": "true"
|
|
11178
|
-
}, null, 8, ["name"])], 8,
|
|
11198
|
+
}, null, 8, ["name"])], 8, Am),
|
|
11179
11199
|
c("button", {
|
|
11180
11200
|
type: "button",
|
|
11181
11201
|
"aria-label": I(_) ? a.value.exitFullscreen : a.value.enterFullscreen,
|
|
@@ -11185,10 +11205,10 @@ var bf = { render: yf }, xf = { class: "flex items-center justify-end self-stret
|
|
|
11185
11205
|
name: I(_) ? "compress" : "expand",
|
|
11186
11206
|
class: "text-sm",
|
|
11187
11207
|
"aria-hidden": "true"
|
|
11188
|
-
}, null, 8, ["name"])], 8,
|
|
11208
|
+
}, null, 8, ["name"])], 8, jm)
|
|
11189
11209
|
])], 4)) : o("", !0)
|
|
11190
11210
|
], 32));
|
|
11191
11211
|
}
|
|
11192
11212
|
});
|
|
11193
11213
|
//#endregion
|
|
11194
|
-
export { Ut as EDITOR_ALIGN_ITEMS_OPTIONS, Kt as EDITOR_BACKGROUND_SIZE_OPTIONS, Pn as EDITOR_BORDER_STEPS, ea as EDITOR_DASH_PATTERN_LIMITS, ji as EDITOR_DIMENSION_LIMITS, Yt as EDITOR_FLEX_DIRECTION_OPTIONS, vr as EDITOR_FONT_SIZE_STEPS, an as EDITOR_GAP_STEPS, qn as EDITOR_HEADING_TYPE_OPTIONS, sr as EDITOR_JUSTIFY_CONTENT_OPTIONS, Nr as EDITOR_LETTER_SPACING_STEPS, Tr as EDITOR_LINE_HEIGHT_STEPS, Ji as EDITOR_LINE_MIN_THICKNESS, Ki as EDITOR_LINE_STYLE_OPTIONS, qi as EDITOR_LINE_THICKNESS_STEPS, fr as EDITOR_MAX_WIDTH_STEPS, di as EDITOR_PADDING_STEPS, Qn as EDITOR_RADIUS_STEPS, tr as EDITOR_SHADOW_OPTIONS, Ri as EDITOR_SIZE_OPTIONS, ir as EDITOR_TEXT_ALIGN_OPTIONS, Er as EDITOR_TEXT_LINE_HEIGHT_RATIOS, St as EVENT_CONFIG_MAP, ia as NexxtAnimatedNumber, oa as NexxtAnnouncement, da as NexxtAvatar, pa as NexxtButton, Ga as NexxtCalendar, Ja as NexxtCard, Xa as NexxtCheckbox, Za as NexxtChip, An as NexxtColorPicker, wo as NexxtCombobox, Co as NexxtComboboxPanel, Ao as NexxtContactInfoCard, Uo as NexxtCountrySelect, qo as NexxtCustomerJourneyTile, Jo as NexxtDatePicker, ns as NexxtDoughnutChart, ss as NexxtDropdownButton, Gt as NexxtEditorAlignItems, Jt as NexxtEditorBackgroundSize, Ln as NexxtEditorBorder, vs as NexxtEditorColor, ra as NexxtEditorDashPattern, Fi as NexxtEditorDimensionField, Zt as NexxtEditorFlexDirection, Sr as NexxtEditorFontSize, sn as NexxtEditorGap, Yn as NexxtEditorHeadingType, lr as NexxtEditorJustifyContent, Rr as NexxtEditorLetterSpacing, Ar as NexxtEditorLineHeight, Zi as NexxtEditorLineStyle, mr as NexxtEditorMaxWidth, wi as NexxtEditorPadding, er as NexxtEditorRadius, $ as NexxtEditorSettingsBlock, ws as NexxtEditorSettingsGroup, rr as NexxtEditorShadow, Bi as NexxtEditorSize, Ds as NexxtEditorSizeLimit, or as NexxtEditorTextAlign, As as NexxtEnergyLabel, pn as NexxtFloatingPanel, Fc as NexxtFontPicker, zc as NexxtHeader, Q as NexxtIcon, zl as NexxtIconPicker, Vl as NexxtInfoBlock, io as NexxtInputField, Yl as NexxtInputSelect, Zl as NexxtLoader, tu as NexxtModal, ru as NexxtModalFooter, Nu as NexxtPageCard, Ru as NexxtPageContainer, Ou as NexxtPageMockup, Bu as NexxtPageTypeTile, Vu as NexxtPagination, zs as NexxtPickerGroup, Zs as NexxtPickerItem, sc as NexxtPickerList, pc as NexxtPickerPanel, qs as NexxtPickerPreview, Ku as NexxtPlaceholderInput, Xu as NexxtPresenceIndicator, cd as NexxtProgressBar, yd as NexxtPropertyCard, md as NexxtPropertyListing, Fd as NexxtReferenceCard, Kn as NexxtSelect, Rd as NexxtSelectableOption, Wd as NexxtSidebarMenuItem, Ms as NexxtSkeleton, Jd as NexxtSkeletonPropertyCard, tn as NexxtSlider, Zd as NexxtSocialIcons, tf as NexxtSocialMediaCustomTemplate, df as NexxtSocialMediaTemplate, Tf as NexxtSocialMediaType, Rf as NexxtSource, ca as NexxtSquircle, zf as NexxtStepperHeader, kt as NexxtSwitch,
|
|
11214
|
+
export { Ut as EDITOR_ALIGN_ITEMS_OPTIONS, Kt as EDITOR_BACKGROUND_SIZE_OPTIONS, Pn as EDITOR_BORDER_STEPS, ea as EDITOR_DASH_PATTERN_LIMITS, ji as EDITOR_DIMENSION_LIMITS, Yt as EDITOR_FLEX_DIRECTION_OPTIONS, vr as EDITOR_FONT_SIZE_STEPS, an as EDITOR_GAP_STEPS, qn as EDITOR_HEADING_TYPE_OPTIONS, sr as EDITOR_JUSTIFY_CONTENT_OPTIONS, Nr as EDITOR_LETTER_SPACING_STEPS, Tr as EDITOR_LINE_HEIGHT_STEPS, Ji as EDITOR_LINE_MIN_THICKNESS, Ki as EDITOR_LINE_STYLE_OPTIONS, qi as EDITOR_LINE_THICKNESS_STEPS, fr as EDITOR_MAX_WIDTH_STEPS, di as EDITOR_PADDING_STEPS, Qn as EDITOR_RADIUS_STEPS, tr as EDITOR_SHADOW_OPTIONS, Ri as EDITOR_SIZE_OPTIONS, ir as EDITOR_TEXT_ALIGN_OPTIONS, Er as EDITOR_TEXT_LINE_HEIGHT_RATIOS, St as EVENT_CONFIG_MAP, ia as NexxtAnimatedNumber, oa as NexxtAnnouncement, da as NexxtAvatar, pa as NexxtButton, Ga as NexxtCalendar, Ja as NexxtCard, Xa as NexxtCheckbox, Za as NexxtChip, An as NexxtColorPicker, wo as NexxtCombobox, Co as NexxtComboboxPanel, Ao as NexxtContactInfoCard, Uo as NexxtCountrySelect, qo as NexxtCustomerJourneyTile, Jo as NexxtDatePicker, ns as NexxtDoughnutChart, ss as NexxtDropdownButton, Gt as NexxtEditorAlignItems, Jt as NexxtEditorBackgroundSize, Ln as NexxtEditorBorder, vs as NexxtEditorColor, ra as NexxtEditorDashPattern, Fi as NexxtEditorDimensionField, Zt as NexxtEditorFlexDirection, Sr as NexxtEditorFontSize, sn as NexxtEditorGap, Yn as NexxtEditorHeadingType, lr as NexxtEditorJustifyContent, Rr as NexxtEditorLetterSpacing, Ar as NexxtEditorLineHeight, Zi as NexxtEditorLineStyle, mr as NexxtEditorMaxWidth, wi as NexxtEditorPadding, er as NexxtEditorRadius, $ as NexxtEditorSettingsBlock, ws as NexxtEditorSettingsGroup, rr as NexxtEditorShadow, Bi as NexxtEditorSize, Ds as NexxtEditorSizeLimit, or as NexxtEditorTextAlign, As as NexxtEnergyLabel, pn as NexxtFloatingPanel, Fc as NexxtFontPicker, zc as NexxtHeader, Q as NexxtIcon, zl as NexxtIconPicker, Vl as NexxtInfoBlock, io as NexxtInputField, Yl as NexxtInputSelect, Zl as NexxtLoader, tu as NexxtModal, ru as NexxtModalFooter, Nu as NexxtPageCard, Ru as NexxtPageContainer, Ou as NexxtPageMockup, Bu as NexxtPageTypeTile, Vu as NexxtPagination, zs as NexxtPickerGroup, Zs as NexxtPickerItem, sc as NexxtPickerList, pc as NexxtPickerPanel, qs as NexxtPickerPreview, Ku as NexxtPlaceholderInput, Xu as NexxtPresenceIndicator, cd as NexxtProgressBar, yd as NexxtPropertyCard, md as NexxtPropertyListing, Fd as NexxtReferenceCard, Kn as NexxtSelect, Rd as NexxtSelectableOption, Wd as NexxtSidebarMenuItem, Ms as NexxtSkeleton, Jd as NexxtSkeletonPropertyCard, tn as NexxtSlider, Zd as NexxtSocialIcons, tf as NexxtSocialMediaCustomTemplate, df as NexxtSocialMediaTemplate, Tf as NexxtSocialMediaType, Rf as NexxtSource, ca as NexxtSquircle, zf as NexxtStepperHeader, kt as NexxtSwitch, qf as NexxtTabbedContent, op as NexxtTable, Uf as NexxtTabs, bp as NexxtTemplateCard, wp as NexxtTextarea, jp as NexxtTimelineEvent, Rp as NexxtTimelineLanes, Up as NexxtTimelinePhaseblock, Gp as NexxtTimelineTrack, Qp as NexxtToast, $p as NexxtToaster, Ht as NexxtToggleGroup, Pt as NexxtTooltip, ym as NexxtTree, Mm as NexxtVideoPlayer, Ct as PHASE_MAP, Ff as SOURCE_MAP, zr as iconLabelFromName, Hr as iconSearchIndex, Gr as iconStyleFor, Wr as searchIcons, Vr as sortIconsByLabel };
|
package/package.json
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref, useTemplateRef, watch, onMounted, nextTick } from 'vue'
|
|
2
|
+
import { computed, ref, useTemplateRef, watch, watchEffect, onMounted, nextTick } from 'vue'
|
|
3
3
|
import Icon, { type NexxtIconName } from '../../atoms/Icon/Icon.vue'
|
|
4
4
|
|
|
5
5
|
export interface NexxtTabItem {
|
|
6
|
+
/** Visible text, the `v-model` value and the key; in icon-only mode the tab's accessible name. */
|
|
6
7
|
label: string
|
|
8
|
+
/** Icon shown before the label, or on its own in icon-only mode. */
|
|
7
9
|
icon?: NexxtIconName
|
|
10
|
+
/** Show only the icon for this tab. Overrides the tabs-wide `iconOnly` either way. */
|
|
11
|
+
iconOnly?: boolean
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
interface NexxtTabs {
|
|
15
|
+
/** The tabs, as plain labels or `{ label, icon, iconOnly }` objects. */
|
|
11
16
|
tabs: (string | NexxtTabItem)[]
|
|
17
|
+
/** Accessible name of the tablist. */
|
|
12
18
|
tablistLabel?: string
|
|
19
|
+
/**
|
|
20
|
+
* Show only the icon of every tab, as a near-square button. The label stays the `v-model`
|
|
21
|
+
* value and the accessible name, in a visually hidden span. A tab without an `icon` keeps its
|
|
22
|
+
* visible label.
|
|
23
|
+
*/
|
|
24
|
+
iconOnly?: boolean
|
|
13
25
|
}
|
|
14
26
|
|
|
15
27
|
defineOptions({
|
|
@@ -31,15 +43,47 @@ const items = computed<NexxtTabItem[]>(() =>
|
|
|
31
43
|
props.tabs.map((tab) => (typeof tab === 'string' ? { label: tab } : tab)),
|
|
32
44
|
)
|
|
33
45
|
|
|
46
|
+
const wantsIconOnly = (item: NexxtTabItem) => item.iconOnly ?? props.iconOnly ?? false
|
|
47
|
+
|
|
48
|
+
interface TabView extends NexxtTabItem {
|
|
49
|
+
compact: boolean
|
|
50
|
+
/** The visible label; empty in icon-only mode, where it moves to a visually hidden span. */
|
|
51
|
+
text: string
|
|
52
|
+
spacing: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// icon-only needs an icon to show; without one the tab falls back to its visible label. The
|
|
56
|
+
// labelled tab keeps `text` as the same bare text node it always was, so its markup is unchanged
|
|
57
|
+
const views = computed<TabView[]>(() =>
|
|
58
|
+
items.value.map((item) => {
|
|
59
|
+
const compact = Boolean(item.icon) && wantsIconOnly(item)
|
|
60
|
+
return {
|
|
61
|
+
...item,
|
|
62
|
+
compact,
|
|
63
|
+
text: compact ? '' : item.label,
|
|
64
|
+
spacing: compact ? 'px-3' : 'gap-2 px-4',
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
)
|
|
68
|
+
|
|
34
69
|
const updateSlider = async () => {
|
|
35
70
|
await nextTick()
|
|
36
71
|
const index = items.value.findIndex((item) => item.label === selected.value)
|
|
37
72
|
const button = buttonRefs.value[index]
|
|
38
73
|
if (!button || !containerRef.value) return
|
|
39
74
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
75
|
+
// offsetLeft/offsetWidth round to whole pixels while label and icon widths are fractional, which
|
|
76
|
+
// left the pill up to half a pixel off its tab. The rects are exact but include any ancestor
|
|
77
|
+
// transform (a modal scaling in), so they are divided back to layout pixels
|
|
78
|
+
const container = containerRef.value
|
|
79
|
+
const box = container.getBoundingClientRect()
|
|
80
|
+
const target = button.getBoundingClientRect()
|
|
81
|
+
const layoutWidth = parseFloat(getComputedStyle(container).width)
|
|
82
|
+
const scale = layoutWidth > 0 && box.width > 0 ? box.width / layoutWidth : 1
|
|
83
|
+
|
|
84
|
+
const left = (target.left - box.left) / scale
|
|
85
|
+
const width = target.width / scale
|
|
86
|
+
const right = box.width / scale - left - width
|
|
43
87
|
|
|
44
88
|
sliderStyle.value = {
|
|
45
89
|
width: `${width}px`,
|
|
@@ -64,8 +108,21 @@ const onKeydown = (event: KeyboardEvent, index: number) => {
|
|
|
64
108
|
|
|
65
109
|
watch(selected, async () => await updateSlider())
|
|
66
110
|
|
|
67
|
-
// the overlay copy must stay the same width as the button, so re-measure
|
|
68
|
-
|
|
111
|
+
// the overlay copy must stay the same width as the button, so re-measure whenever a tab's width
|
|
112
|
+
// can change: new tabs, or a switch between icon-only and labelled
|
|
113
|
+
watch(views, async () => await updateSlider())
|
|
114
|
+
|
|
115
|
+
// `process.env.NODE_ENV` stays in the library build, so the consumer's bundler decides whether
|
|
116
|
+
// this runs (as in NexxtIconPicker)
|
|
117
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
118
|
+
watchEffect(() => {
|
|
119
|
+
const missing = items.value.filter((item) => !item.icon && wantsIconOnly(item))
|
|
120
|
+
if (missing.length) {
|
|
121
|
+
const labels = missing.map((item) => `"${item.label}"`).join(', ')
|
|
122
|
+
console.warn(`[NexxtTabs] icon-only tab without an \`icon\` shows its label: ${labels}.`)
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
}
|
|
69
126
|
|
|
70
127
|
onMounted(async () => {
|
|
71
128
|
await document.fonts.ready
|
|
@@ -94,14 +151,15 @@ onMounted(async () => {
|
|
|
94
151
|
|
|
95
152
|
<!-- dark text buttons -->
|
|
96
153
|
<button
|
|
97
|
-
v-for="(item, index) in
|
|
154
|
+
v-for="(item, index) in views"
|
|
98
155
|
:key="item.label"
|
|
99
156
|
:ref="(el) => (buttonRefs[index] = el as HTMLButtonElement)"
|
|
100
157
|
role="tab"
|
|
101
158
|
:aria-selected="selected === item.label"
|
|
102
159
|
:tabindex="selected === item.label ? 0 : -1"
|
|
103
|
-
class="relative z-10 inline-flex h-9 cursor-pointer items-center
|
|
160
|
+
class="relative z-10 inline-flex h-9 cursor-pointer items-center rounded-full small-normal"
|
|
104
161
|
:class="[
|
|
162
|
+
item.spacing,
|
|
105
163
|
// the dark label is what the pill wipe reveals, so it only drops out once the pill
|
|
106
164
|
// has arrived — otherwise its anti-aliased edges halo around the white copy
|
|
107
165
|
selected === item.label ? 'text-transparent' : 'text-gray-950',
|
|
@@ -111,8 +169,12 @@ onMounted(async () => {
|
|
|
111
169
|
@click="selected = item.label"
|
|
112
170
|
@keydown="onKeydown($event, index)"
|
|
113
171
|
>
|
|
114
|
-
<
|
|
115
|
-
|
|
172
|
+
<template v-if="item.compact && item.icon">
|
|
173
|
+
<Icon :name="item.icon" aria-hidden="true" class="body-normal" />
|
|
174
|
+
<span class="sr-only">{{ item.label }}</span>
|
|
175
|
+
</template>
|
|
176
|
+
<Icon v-else-if="item.icon" :name="item.icon" aria-hidden="true" class="body-normal" />
|
|
177
|
+
{{ item.text }}
|
|
116
178
|
</button>
|
|
117
179
|
|
|
118
180
|
<!-- white text overlay, clipped to slider bounds; must mirror the buttons exactly -->
|
|
@@ -125,12 +187,13 @@ onMounted(async () => {
|
|
|
125
187
|
:style="{ clipPath }"
|
|
126
188
|
>
|
|
127
189
|
<span
|
|
128
|
-
v-for="item in
|
|
190
|
+
v-for="item in views"
|
|
129
191
|
:key="item.label"
|
|
130
|
-
class="flex h-9 items-center
|
|
192
|
+
class="flex h-9 items-center rounded-full small-normal text-white"
|
|
193
|
+
:class="item.spacing"
|
|
131
194
|
>
|
|
132
195
|
<Icon v-if="item.icon" :name="item.icon" class="body-normal" />
|
|
133
|
-
{{ item.
|
|
196
|
+
{{ item.text }}
|
|
134
197
|
</span>
|
|
135
198
|
</div>
|
|
136
199
|
</div>
|