@johnhalazonetis/data-table 1.24.3 → 1.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-table.css +1 -1
- package/dist/data-table.js +276 -272
- package/package.json +1 -2
package/dist/data-table.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createStaticVNode as c, createTextVNode as l, createVNode as u, inject as d, isRef as f, mergeProps as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onMounted as _, onUnmounted as v, openBlock as y, provide as b, ref as x, renderList as S, toDisplayString as C, toValue as w, unref as T, useTemplateRef as E, vModelSelect as D, vModelText as O, watch as k, watchEffect as A, withCtx as j, withDirectives as
|
|
2
|
-
import { FlexRender as
|
|
3
|
-
import { onClickOutside as
|
|
4
|
-
import { useVirtualizer as
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createStaticVNode as c, createTextVNode as l, createVNode as u, inject as d, isRef as f, mergeProps as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onMounted as _, onUnmounted as v, openBlock as y, provide as b, ref as x, renderList as S, toDisplayString as C, toValue as w, unref as T, useTemplateRef as E, vModelSelect as D, vModelText as O, watch as k, watchEffect as A, withCtx as j, withDirectives as M, withModifiers as N } from "vue";
|
|
2
|
+
import { FlexRender as P, getCoreRowModel as F, getFilteredRowModel as ee, getPaginationRowModel as I, getSortedRowModel as L, useVueTable as R } from "@tanstack/vue-table";
|
|
3
|
+
import { onClickOutside as z } from "@vueuse/core";
|
|
4
|
+
import { useVirtualizer as B } from "@tanstack/vue-virtual";
|
|
5
5
|
//#region \0plugin-vue:export-helper
|
|
6
|
-
var
|
|
6
|
+
var V = (e, t) => {
|
|
7
7
|
let n = e.__vccOpts || e;
|
|
8
8
|
for (let [e, r] of t) n[e] = r;
|
|
9
9
|
return n;
|
|
10
|
-
},
|
|
10
|
+
}, H = { class: "p-3" }, te = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "text-center py-4",
|
|
13
13
|
style: { color: "var(--st-text-tertiary)" }
|
|
@@ -48,7 +48,7 @@ var B = (e, t) => {
|
|
|
48
48
|
}, pe = ["onClick"], me = {
|
|
49
49
|
class: "px-3 py-2 flex items-center justify-end gap-2",
|
|
50
50
|
style: { borderTop: "1px solid var(--st-border-secondary)" }
|
|
51
|
-
}, he = /* @__PURE__ */
|
|
51
|
+
}, he = /* @__PURE__ */ V({
|
|
52
52
|
__name: "SortPanel",
|
|
53
53
|
props: {
|
|
54
54
|
table: {
|
|
@@ -127,19 +127,19 @@ var B = (e, t) => {
|
|
|
127
127
|
}
|
|
128
128
|
return -1;
|
|
129
129
|
}
|
|
130
|
-
let
|
|
131
|
-
function
|
|
132
|
-
|
|
130
|
+
let P = x(null), F = x(null);
|
|
131
|
+
function ee(e) {
|
|
132
|
+
P.value = e;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
e.preventDefault(),
|
|
134
|
+
function I(e, t) {
|
|
135
|
+
e.preventDefault(), F.value = t;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
if (
|
|
139
|
-
let e = [...h.value], [t] = e.splice(
|
|
140
|
-
e.splice(
|
|
137
|
+
function L() {
|
|
138
|
+
if (P.value !== null && F.value !== null && P.value !== F.value) {
|
|
139
|
+
let e = [...h.value], [t] = e.splice(P.value, 1);
|
|
140
|
+
e.splice(F.value, 0, t), h.value = e;
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
P.value = null, F.value = null;
|
|
143
143
|
}
|
|
144
144
|
return (n, r) => (y(), o("div", {
|
|
145
145
|
class: "absolute top-full right-0 mt-1 w-96 rounded shadow-xl z-50 text-[13px]",
|
|
@@ -147,22 +147,22 @@ var B = (e, t) => {
|
|
|
147
147
|
backgroundColor: "var(--st-bg-surface)",
|
|
148
148
|
border: "1px solid var(--st-border-secondary)"
|
|
149
149
|
},
|
|
150
|
-
onClick: r[2] ||=
|
|
151
|
-
}, [s("div",
|
|
152
|
-
h.value.length === 0 ? (y(), o("div",
|
|
150
|
+
onClick: r[2] ||= N(() => {}, ["stop"])
|
|
151
|
+
}, [s("div", H, [
|
|
152
|
+
h.value.length === 0 ? (y(), o("div", te, [...r[3] ||= [s("p", { class: "mb-1" }, "No sorts applied to this view", -1), s("p", { class: "text-xs" }, "Add a column below to sort the view", -1)]])) : a("", !0),
|
|
153
153
|
p.value ? (y(), o("div", ne, C(t.tableName), 1)) : a("", !0),
|
|
154
154
|
(y(!0), o(e, null, S(O.value, (n, i) => (y(), o("div", {
|
|
155
155
|
key: "p-" + i,
|
|
156
156
|
class: "flex items-center gap-2 mb-2 rounded px-1 -mx-1 transition-colors",
|
|
157
|
-
style: g(
|
|
157
|
+
style: g(F.value === j("parent", i) && P.value !== j("parent", i) ? { backgroundColor: "var(--st-bg-menu-hover)" } : {}),
|
|
158
158
|
draggable: "true",
|
|
159
|
-
onDragstart: (e) =>
|
|
160
|
-
onDragover: (e) =>
|
|
161
|
-
onDragend:
|
|
159
|
+
onDragstart: (e) => ee(j("parent", i)),
|
|
160
|
+
onDragover: (e) => I(e, j("parent", i)),
|
|
161
|
+
onDragend: L
|
|
162
162
|
}, [
|
|
163
163
|
r[5] ||= c("<span class=\"cursor-grab active:cursor-grabbing shrink-0 flex items-center\" style=\"color:var(--st-text-placeholder);\" data-v-f1143526><svg class=\"w-3.5 h-3.5\" viewBox=\"0 0 16 16\" fill=\"currentColor\" data-v-f1143526><circle cx=\"5.5\" cy=\"4\" r=\"1\" data-v-f1143526></circle><circle cx=\"10.5\" cy=\"4\" r=\"1\" data-v-f1143526></circle><circle cx=\"5.5\" cy=\"8\" r=\"1\" data-v-f1143526></circle><circle cx=\"10.5\" cy=\"8\" r=\"1\" data-v-f1143526></circle><circle cx=\"5.5\" cy=\"12\" r=\"1\" data-v-f1143526></circle><circle cx=\"10.5\" cy=\"12\" r=\"1\" data-v-f1143526></circle></svg></span>", 1),
|
|
164
164
|
s("span", W, C(i === 0 ? "sort by" : "then by"), 1),
|
|
165
|
-
|
|
165
|
+
M(s("select", {
|
|
166
166
|
"onUpdate:modelValue": (e) => n.id = e,
|
|
167
167
|
class: "sort-select flex-1 rounded py-1 text-[13px] outline-none min-w-0",
|
|
168
168
|
style: {
|
|
@@ -216,15 +216,15 @@ var B = (e, t) => {
|
|
|
216
216
|
(y(!0), o(e, null, S(A.value, (n, i) => (y(), o("div", {
|
|
217
217
|
key: "s-" + i,
|
|
218
218
|
class: "flex items-center gap-2 mb-2 rounded px-1 -mx-1 transition-colors",
|
|
219
|
-
style: g(
|
|
219
|
+
style: g(F.value === j("sub", i) && P.value !== j("sub", i) ? { backgroundColor: "var(--st-bg-menu-hover)" } : {}),
|
|
220
220
|
draggable: "true",
|
|
221
|
-
onDragstart: (e) =>
|
|
222
|
-
onDragover: (e) =>
|
|
223
|
-
onDragend:
|
|
221
|
+
onDragstart: (e) => ee(j("sub", i)),
|
|
222
|
+
onDragover: (e) => I(e, j("sub", i)),
|
|
223
|
+
onDragend: L
|
|
224
224
|
}, [
|
|
225
225
|
r[7] ||= c("<span class=\"cursor-grab active:cursor-grabbing shrink-0 flex items-center\" style=\"color:var(--st-text-placeholder);\" data-v-f1143526><svg class=\"w-3.5 h-3.5\" viewBox=\"0 0 16 16\" fill=\"currentColor\" data-v-f1143526><circle cx=\"5.5\" cy=\"4\" r=\"1\" data-v-f1143526></circle><circle cx=\"10.5\" cy=\"4\" r=\"1\" data-v-f1143526></circle><circle cx=\"5.5\" cy=\"8\" r=\"1\" data-v-f1143526></circle><circle cx=\"10.5\" cy=\"8\" r=\"1\" data-v-f1143526></circle><circle cx=\"5.5\" cy=\"12\" r=\"1\" data-v-f1143526></circle><circle cx=\"10.5\" cy=\"12\" r=\"1\" data-v-f1143526></circle></svg></span>", 1),
|
|
226
226
|
s("span", se, C(i === 0 ? "sort by" : "then by"), 1),
|
|
227
|
-
|
|
227
|
+
M(s("select", {
|
|
228
228
|
"onUpdate:modelValue": (e) => n.id = e,
|
|
229
229
|
class: "sort-select flex-1 rounded py-1 text-[13px] outline-none min-w-0",
|
|
230
230
|
style: {
|
|
@@ -400,7 +400,7 @@ var B = (e, t) => {
|
|
|
400
400
|
class: "flex items-center justify-center w-4 h-4 rounded transition-colors shrink-0",
|
|
401
401
|
style: g({ color: p.value ? "var(--st-accent)" : "var(--st-text-placeholder)" }),
|
|
402
402
|
title: "Pick date/time",
|
|
403
|
-
onClick:
|
|
403
|
+
onClick: N(C, ["stop"])
|
|
404
404
|
}, [_.value === "time" ? (y(), o("svg", ye, [...n[1] ||= [s("path", { d: "M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zm7-3.25a.75.75 0 00-1.5 0v3.5c0 .27.144.518.378.651l2.5 1.5a.75.75 0 10.744-1.302L8.5 7.742V4.75z" }, null, -1)]])) : (y(), o("svg", be, [...n[2] ||= [s("path", { d: "M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zm0 3.5h-2a.25.25 0 00-.25.25V6h10.5V3.75a.25.25 0 00-.25-.25h-2V5a.75.75 0 01-1.5 0V3.5h-5V5a.75.75 0 01-1.5 0V3.5zM2.5 7.5v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5H2.5z" }, null, -1)]]))], 4), (y(), i(t, { to: "body" }, [p.value ? (y(), o("div", {
|
|
405
405
|
key: 0,
|
|
406
406
|
class: "fixed inset-0 z-40",
|
|
@@ -415,7 +415,7 @@ var B = (e, t) => {
|
|
|
415
415
|
top: h.value ? h.value.getBoundingClientRect().bottom + 6 + "px" : "0",
|
|
416
416
|
left: h.value ? h.value.getBoundingClientRect().left + "px" : "0"
|
|
417
417
|
}),
|
|
418
|
-
onClick: n[0] ||=
|
|
418
|
+
onClick: n[0] ||= N(() => {}, ["stop"])
|
|
419
419
|
}, [s("div", xe, [s("input", {
|
|
420
420
|
type: _.value,
|
|
421
421
|
value: v.value,
|
|
@@ -469,7 +469,7 @@ var B = (e, t) => {
|
|
|
469
469
|
], Re = { style: { color: "var(--st-text)" } }, ze = {
|
|
470
470
|
class: "font-mono text-xs",
|
|
471
471
|
style: { color: "var(--st-text-placeholder)" }
|
|
472
|
-
}, Be = /* @__PURE__ */
|
|
472
|
+
}, Be = /* @__PURE__ */ V({
|
|
473
473
|
__name: "FilterBar",
|
|
474
474
|
props: {
|
|
475
475
|
table: {
|
|
@@ -510,14 +510,14 @@ var B = (e, t) => {
|
|
|
510
510
|
sourceIndex: t
|
|
511
511
|
}));
|
|
512
512
|
return [...e, ...t];
|
|
513
|
-
}), _ = r(() => h.value.some((e) => e.table === "sub")), v = x("closed"), b = x(null), w = x(""), E = x(0), D = x(null), j = x(null),
|
|
513
|
+
}), _ = r(() => h.value.some((e) => e.table === "sub")), v = x("closed"), b = x(null), w = x(""), E = x(0), D = x(null), j = x(null), N = x(null), P = x({
|
|
514
514
|
top: 0,
|
|
515
515
|
left: 0
|
|
516
|
-
}),
|
|
517
|
-
function
|
|
518
|
-
if (v.value === "operators" &&
|
|
519
|
-
let e =
|
|
520
|
-
|
|
516
|
+
}), F = x({});
|
|
517
|
+
function ee() {
|
|
518
|
+
if (v.value === "operators" && N.value) {
|
|
519
|
+
let e = N.value.getBoundingClientRect();
|
|
520
|
+
P.value = {
|
|
521
521
|
top: e.bottom + 4,
|
|
522
522
|
left: e.right
|
|
523
523
|
};
|
|
@@ -526,12 +526,12 @@ var B = (e, t) => {
|
|
|
526
526
|
let e = j.value;
|
|
527
527
|
if (!e) return;
|
|
528
528
|
let t = e.getBoundingClientRect();
|
|
529
|
-
|
|
529
|
+
P.value = {
|
|
530
530
|
top: t.bottom + 4,
|
|
531
531
|
left: t.left
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
let
|
|
534
|
+
let I = r(() => {
|
|
535
535
|
let e = [];
|
|
536
536
|
for (let t of _e) {
|
|
537
537
|
e.push({
|
|
@@ -544,21 +544,21 @@ var B = (e, t) => {
|
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
return e;
|
|
547
|
-
}),
|
|
547
|
+
}), L = r(() => I.value.filter((e) => e.type === "operator")), R = r(() => {
|
|
548
548
|
let e = w.value.toLowerCase();
|
|
549
549
|
return e ? l.allColumns.filter((t) => t.id.toLowerCase().includes(e)) : l.allColumns;
|
|
550
|
-
}),
|
|
550
|
+
}), z = r(() => R.value.map((e) => ({
|
|
551
551
|
...e,
|
|
552
552
|
table: "parent"
|
|
553
|
-
}))),
|
|
553
|
+
}))), B = r(() => `Filter by ${l.allColumns.map((e) => e.id).slice(0, 3).join(", ")}...`), V = r(() => {
|
|
554
554
|
let e = l.subTableColumns || [];
|
|
555
555
|
return [...l.allColumns, ...e];
|
|
556
556
|
});
|
|
557
|
-
function V(e) {
|
|
558
|
-
return B.value.find((t) => t.id === e)?.type || "varchar";
|
|
559
|
-
}
|
|
560
557
|
function H(e) {
|
|
561
|
-
return
|
|
558
|
+
return V.value.find((t) => t.id === e)?.type || "varchar";
|
|
559
|
+
}
|
|
560
|
+
function te(e) {
|
|
561
|
+
return ge.includes(H(e));
|
|
562
562
|
}
|
|
563
563
|
function ne(e) {
|
|
564
564
|
return e.value?.operator || "=";
|
|
@@ -586,7 +586,7 @@ var B = (e, t) => {
|
|
|
586
586
|
};
|
|
587
587
|
n === "sub" ? u("update:sub-table-column-filters", [...l.subTableColumnFilters, r]) : u("update:column-filters", [...l.columnFilters, r]), v.value = "closed", b.value = null, w.value = "", D.value?.blur();
|
|
588
588
|
let i = () => {
|
|
589
|
-
let e = h.value.length - 1, t =
|
|
589
|
+
let e = h.value.length - 1, t = F.value[e];
|
|
590
590
|
t ? t.focus() : m(i);
|
|
591
591
|
};
|
|
592
592
|
m(() => m(i));
|
|
@@ -621,7 +621,7 @@ var B = (e, t) => {
|
|
|
621
621
|
v.value === "columns" ? J(e) : v.value === "operators" ? ae(e) : e.key !== "Escape" && W(), e.key === "Escape" && (se(), D.value?.blur());
|
|
622
622
|
}
|
|
623
623
|
function J(e) {
|
|
624
|
-
let t =
|
|
624
|
+
let t = z.value;
|
|
625
625
|
if (t.length !== 0) {
|
|
626
626
|
if (e.key === "ArrowDown") e.preventDefault(), E.value = Math.min(E.value + 1, t.length - 1), oe("column-picker");
|
|
627
627
|
else if (e.key === "ArrowUp") e.preventDefault(), E.value = Math.max(E.value - 1, 0), oe("column-picker");
|
|
@@ -633,7 +633,7 @@ var B = (e, t) => {
|
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
function ae(e) {
|
|
636
|
-
let t =
|
|
636
|
+
let t = L.value;
|
|
637
637
|
t.length !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), E.value = Math.min(E.value + 1, t.length - 1), oe("operator-picker")) : e.key === "ArrowUp" ? (e.preventDefault(), E.value = Math.max(E.value - 1, 0), oe("operator-picker")) : (e.key === "Enter" || e.key === "Tab") && (e.preventDefault(), t[E.value] && K(t[E.value].value)));
|
|
638
638
|
}
|
|
639
639
|
function oe(e) {
|
|
@@ -653,9 +653,9 @@ var B = (e, t) => {
|
|
|
653
653
|
}), A((e) => {
|
|
654
654
|
if (v.value === "closed") return;
|
|
655
655
|
function t() {
|
|
656
|
-
m(
|
|
656
|
+
m(ee);
|
|
657
657
|
}
|
|
658
|
-
|
|
658
|
+
ee(), window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), e(() => {
|
|
659
659
|
window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
|
|
660
660
|
});
|
|
661
661
|
}), (r, c) => (y(), o("div", we, [
|
|
@@ -673,7 +673,7 @@ var B = (e, t) => {
|
|
|
673
673
|
s("input", {
|
|
674
674
|
ref_for: !0,
|
|
675
675
|
ref: (e) => {
|
|
676
|
-
e && (
|
|
676
|
+
e && (F.value[t] = e);
|
|
677
677
|
},
|
|
678
678
|
value: U(e),
|
|
679
679
|
class: "bg-transparent outline-none text-[13px]",
|
|
@@ -684,10 +684,10 @@ var B = (e, t) => {
|
|
|
684
684
|
placeholder: "value",
|
|
685
685
|
onInput: (e) => q(t, e.target.value)
|
|
686
686
|
}, null, 44, Oe),
|
|
687
|
-
|
|
687
|
+
te(e.id) ? (y(), i(Ce, {
|
|
688
688
|
key: 1,
|
|
689
689
|
value: U(e),
|
|
690
|
-
"column-type":
|
|
690
|
+
"column-type": H(e.id),
|
|
691
691
|
onUpdate: (e) => q(t, e)
|
|
692
692
|
}, null, 8, [
|
|
693
693
|
"value",
|
|
@@ -707,7 +707,7 @@ var B = (e, t) => {
|
|
|
707
707
|
b.value ? (y(), o("div", {
|
|
708
708
|
key: 0,
|
|
709
709
|
ref_key: "pendingChipRef",
|
|
710
|
-
ref:
|
|
710
|
+
ref: N,
|
|
711
711
|
class: "flex items-center gap-1 rounded px-2 py-0.5 text-[13px]",
|
|
712
712
|
style: {
|
|
713
713
|
backgroundColor: "var(--st-bg-surface)",
|
|
@@ -719,7 +719,7 @@ var B = (e, t) => {
|
|
|
719
719
|
ref: j,
|
|
720
720
|
class: "relative flex-1 min-w-[200px]"
|
|
721
721
|
}, [
|
|
722
|
-
|
|
722
|
+
M(s("input", {
|
|
723
723
|
ref_key: "searchInputRef",
|
|
724
724
|
ref: D,
|
|
725
725
|
"onUpdate:modelValue": c[0] ||= (e) => w.value = e,
|
|
@@ -728,7 +728,7 @@ var B = (e, t) => {
|
|
|
728
728
|
color: "var(--st-text)",
|
|
729
729
|
caretColor: v.value === "operators" ? "transparent" : void 0
|
|
730
730
|
}),
|
|
731
|
-
placeholder: v.value === "operators" ? "Pick a filter method..." : h.value.length > 0 ? "+ Add more filters..." :
|
|
731
|
+
placeholder: v.value === "operators" ? "Pick a filter method..." : h.value.length > 0 ? "+ Add more filters..." : B.value,
|
|
732
732
|
onFocus: ce,
|
|
733
733
|
onKeydown: ie
|
|
734
734
|
}, null, 44, Me), [[O, w.value]]),
|
|
@@ -738,41 +738,41 @@ var B = (e, t) => {
|
|
|
738
738
|
class: "fixed w-60 rounded shadow-xl z-50 py-1 max-h-60 overflow-auto",
|
|
739
739
|
style: g({
|
|
740
740
|
...T(p),
|
|
741
|
-
top:
|
|
742
|
-
left:
|
|
741
|
+
top: P.value.top + "px",
|
|
742
|
+
left: P.value.left + "px",
|
|
743
743
|
fontFamily: "var(--dt-font-family)",
|
|
744
744
|
backgroundColor: "var(--st-bg-surface)",
|
|
745
745
|
border: "1px solid var(--st-border-secondary)",
|
|
746
746
|
color: "var(--st-text)"
|
|
747
747
|
})
|
|
748
|
-
}, [(y(!0), o(e, null, S(
|
|
748
|
+
}, [(y(!0), o(e, null, S(R.value, (e, t) => (y(), o("div", {
|
|
749
749
|
key: "p-" + e.id,
|
|
750
750
|
class: "flex items-center justify-between px-3 py-1.5 cursor-pointer text-[13px]",
|
|
751
751
|
"data-highlighted": t === E.value,
|
|
752
752
|
style: g(t === E.value ? { backgroundColor: "var(--st-bg-menu-hover)" } : {}),
|
|
753
753
|
onClick: (t) => G(e.id, "parent"),
|
|
754
754
|
onMouseenter: (e) => E.value = t
|
|
755
|
-
}, [s("span", Pe, C(e.id), 1), T(f) ? (y(), o("span", Fe, C(e.type), 1)) : a("", !0)], 44, Ne))), 128)),
|
|
755
|
+
}, [s("span", Pe, C(e.id), 1), T(f) ? (y(), o("span", Fe, C(e.type), 1)) : a("", !0)], 44, Ne))), 128)), R.value.length === 0 ? (y(), o("div", Ie, " No columns found ")) : a("", !0)], 4)) : a("", !0)])),
|
|
756
756
|
(y(), i(t, { to: "body" }, [v.value === "operators" ? (y(), o("div", {
|
|
757
757
|
key: 0,
|
|
758
758
|
id: "operator-picker",
|
|
759
759
|
class: "fixed w-52 rounded shadow-xl z-50 py-1 max-h-60 overflow-auto",
|
|
760
760
|
style: g({
|
|
761
761
|
...T(p),
|
|
762
|
-
top:
|
|
763
|
-
left:
|
|
762
|
+
top: P.value.top + "px",
|
|
763
|
+
left: P.value.left + "px",
|
|
764
764
|
fontFamily: "var(--dt-font-family)",
|
|
765
765
|
backgroundColor: "var(--st-bg-surface)",
|
|
766
766
|
border: "1px solid var(--st-border-secondary)",
|
|
767
767
|
color: "var(--st-text)"
|
|
768
768
|
})
|
|
769
|
-
}, [(y(!0), o(e, null, S(
|
|
769
|
+
}, [(y(!0), o(e, null, S(I.value, (t, n) => (y(), o(e, { key: n }, [t.type === "header" ? (y(), o("div", Q, C(t.label), 1)) : (y(), o("div", {
|
|
770
770
|
key: 1,
|
|
771
771
|
class: "flex items-center justify-between px-3 py-1.5 cursor-pointer text-[13px]",
|
|
772
|
-
"data-highlighted":
|
|
773
|
-
style: g(
|
|
772
|
+
"data-highlighted": L.value.indexOf(t) === E.value,
|
|
773
|
+
style: g(L.value.indexOf(t) === E.value ? { backgroundColor: "var(--st-bg-menu-hover)" } : {}),
|
|
774
774
|
onClick: (e) => K(t.value),
|
|
775
|
-
onMouseenter: (e) => E.value =
|
|
775
|
+
onMouseenter: (e) => E.value = L.value.indexOf(t)
|
|
776
776
|
}, [s("span", Re, C(t.label), 1), s("span", ze, C(t.value), 1)], 44, Le))], 64))), 128))], 4)) : a("", !0)])),
|
|
777
777
|
(y(), i(t, { to: "body" }, [v.value === "closed" ? a("", !0) : (y(), o("div", {
|
|
778
778
|
key: 0,
|
|
@@ -812,7 +812,7 @@ var B = (e, t) => {
|
|
|
812
812
|
key: 0,
|
|
813
813
|
class: "text-xs ml-auto shrink-0",
|
|
814
814
|
style: { color: "var(--st-text-placeholder)" }
|
|
815
|
-
}, Ze = /* @__PURE__ */
|
|
815
|
+
}, Ze = /* @__PURE__ */ V({
|
|
816
816
|
__name: "ColumnVisibilityPanel",
|
|
817
817
|
props: {
|
|
818
818
|
table: {
|
|
@@ -883,7 +883,7 @@ var B = (e, t) => {
|
|
|
883
883
|
backgroundColor: "var(--st-bg-surface)",
|
|
884
884
|
border: "1px solid var(--st-border-secondary)"
|
|
885
885
|
},
|
|
886
|
-
onClick: r[0] ||=
|
|
886
|
+
onClick: r[0] ||= N(() => {}, ["stop"])
|
|
887
887
|
}, [s("div", Ve, [s("span", He, C(_.value) + " of " + C(v.value) + " columns", 1), s("div", { class: "flex items-center gap-2" }, [
|
|
888
888
|
s("button", {
|
|
889
889
|
class: "text-xs",
|
|
@@ -973,7 +973,7 @@ var B = (e, t) => {
|
|
|
973
973
|
backgroundColor: "var(--st-bg-surface)",
|
|
974
974
|
border: "1px solid var(--st-border-secondary)"
|
|
975
975
|
}
|
|
976
|
-
}, lt = ["onClick"], ut = ["innerHTML"], dt = { class: "shrink-0 whitespace-nowrap" }, ft = /* @__PURE__ */
|
|
976
|
+
}, lt = ["onClick"], ut = ["innerHTML"], dt = { class: "shrink-0 whitespace-nowrap" }, ft = /* @__PURE__ */ V({
|
|
977
977
|
__name: "TableToolbar",
|
|
978
978
|
props: {
|
|
979
979
|
table: {
|
|
@@ -1063,13 +1063,13 @@ var B = (e, t) => {
|
|
|
1063
1063
|
],
|
|
1064
1064
|
setup(t, { emit: n }) {
|
|
1065
1065
|
let c = t, d = n, f = x(!1), p = x(!1), m = x(!1), _ = x(!1), v = x(null), b = x(null), w = x(null), T = x(null);
|
|
1066
|
-
|
|
1066
|
+
z(v, () => {
|
|
1067
1067
|
f.value = !1;
|
|
1068
|
-
}),
|
|
1068
|
+
}), z(b, () => {
|
|
1069
1069
|
_.value = !1;
|
|
1070
|
-
}),
|
|
1070
|
+
}), z(w, () => {
|
|
1071
1071
|
m.value = !1;
|
|
1072
|
-
}),
|
|
1072
|
+
}), z(T, () => {
|
|
1073
1073
|
p.value = !1;
|
|
1074
1074
|
});
|
|
1075
1075
|
function E(e) {
|
|
@@ -1358,7 +1358,7 @@ var mt = {
|
|
|
1358
1358
|
key: 0,
|
|
1359
1359
|
class: "my-1",
|
|
1360
1360
|
style: { borderTop: "1px solid var(--st-border-secondary)" }
|
|
1361
|
-
}, vt = ["disabled", "onClick"], yt = ["innerHTML"], bt = ["onClick"], xt = /* @__PURE__ */
|
|
1361
|
+
}, vt = ["disabled", "onClick"], yt = ["innerHTML"], bt = ["onClick"], xt = /* @__PURE__ */ V({
|
|
1362
1362
|
__name: "SelectionToolbar",
|
|
1363
1363
|
props: {
|
|
1364
1364
|
selectedCount: {
|
|
@@ -1414,7 +1414,7 @@ var mt = {
|
|
|
1414
1414
|
],
|
|
1415
1415
|
setup(t, { emit: n }) {
|
|
1416
1416
|
let i = d("tableSourceRows", null), c = t, u = r(() => c.totalFilteredCount == null ? (i != null && w(i), c.table.getFilteredRowModel().rows.length) : c.totalFilteredCount), f = r(() => c.selectedCount >= u.value && u.value > 0), p = n, m = x(!1), _ = x(null);
|
|
1417
|
-
|
|
1417
|
+
z(_, () => {
|
|
1418
1418
|
m.value = !1;
|
|
1419
1419
|
});
|
|
1420
1420
|
function v() {
|
|
@@ -1599,7 +1599,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1599
1599
|
class: "shrink-0 text-xs",
|
|
1600
1600
|
style: { color: "var(--st-text-tertiary)" },
|
|
1601
1601
|
title: "Column is frozen"
|
|
1602
|
-
}, At = /* @__PURE__ */
|
|
1602
|
+
}, At = /* @__PURE__ */ V({
|
|
1603
1603
|
__name: "TableColumnHeader",
|
|
1604
1604
|
props: {
|
|
1605
1605
|
header: {
|
|
@@ -1685,7 +1685,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1685
1685
|
})
|
|
1686
1686
|
}, [
|
|
1687
1687
|
s("div", Tt, [
|
|
1688
|
-
s("span", Et, [e.header.isPlaceholder ? a("", !0) : (y(), i(T(
|
|
1688
|
+
s("span", Et, [e.header.isPlaceholder ? a("", !0) : (y(), i(T(P), {
|
|
1689
1689
|
key: 0,
|
|
1690
1690
|
render: e.header.column.columnDef.header,
|
|
1691
1691
|
props: e.header.getContext()
|
|
@@ -1698,7 +1698,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1698
1698
|
ref: v,
|
|
1699
1699
|
class: h(["ml-auto shrink-0 w-4 h-4 flex items-center justify-center opacity-0 group-hover/header:opacity-100 transition-opacity", { "!opacity-100": p.value }]),
|
|
1700
1700
|
style: { color: "var(--st-text-tertiary)" },
|
|
1701
|
-
onClick:
|
|
1701
|
+
onClick: N(S, ["stop"])
|
|
1702
1702
|
}, [...d[1] ||= [s("svg", {
|
|
1703
1703
|
class: "w-3 h-3",
|
|
1704
1704
|
viewBox: "0 0 16 16",
|
|
@@ -1721,7 +1721,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1721
1721
|
border: "1px solid var(--st-border-secondary)",
|
|
1722
1722
|
color: "var(--st-text)"
|
|
1723
1723
|
}),
|
|
1724
|
-
onClick: d[0] ||=
|
|
1724
|
+
onClick: d[0] ||= N(() => {}, ["stop"])
|
|
1725
1725
|
}, [
|
|
1726
1726
|
s("button", {
|
|
1727
1727
|
class: "w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item",
|
|
@@ -1768,7 +1768,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1768
1768
|
class: h(["absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-blue-500/50 active:bg-blue-500", { "bg-blue-500": e.header.column.getIsResizing() }]),
|
|
1769
1769
|
onMousedown: A,
|
|
1770
1770
|
onTouchstart: A,
|
|
1771
|
-
onDblclick:
|
|
1771
|
+
onDblclick: N(j, ["stop"])
|
|
1772
1772
|
}, null, 34)
|
|
1773
1773
|
], 4));
|
|
1774
1774
|
}
|
|
@@ -1854,20 +1854,20 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1854
1854
|
"secondaryText",
|
|
1855
1855
|
"overflow",
|
|
1856
1856
|
"multiline"
|
|
1857
|
-
], c = t, u = d("editable", !0), p = d("showRowBorders", !0), _ = d("showColumnBorders", !0), v = d("cellButtonVisibility", "hover"), b = d("cellOverflow", "truncate"), w = d("getCellPendingState", () => null), E = d("getCellPreviousValue", () => void 0), D = d("getRowPendingState", () => null), k = r(() => w(c.cell.row.id, c.cell.column.id)), A = r(() => D(c.cell.row.id)), j = r(() => E(c.cell.row.id, c.cell.column.id)),
|
|
1857
|
+
], c = t, u = d("editable", !0), p = d("showRowBorders", !0), _ = d("showColumnBorders", !0), v = d("cellButtonVisibility", "hover"), b = d("cellOverflow", "truncate"), w = d("getCellPendingState", () => null), E = d("getCellPreviousValue", () => void 0), D = d("getRowPendingState", () => null), k = r(() => w(c.cell.row.id, c.cell.column.id)), A = r(() => D(c.cell.row.id)), j = r(() => E(c.cell.row.id, c.cell.column.id)), P = r(() => k.value === "modified"), F = r(() => A.value === "delete"), ee = r(() => {
|
|
1858
1858
|
let e = f(v) ? v.value : v;
|
|
1859
1859
|
return e === "always" ? "opacity-100" : e === "select" ? c.isSelected ? "opacity-100" : "opacity-0" : "opacity-0 group-hover/row:opacity-100";
|
|
1860
|
-
}),
|
|
1861
|
-
let e = String(c.cell.column.id), t =
|
|
1862
|
-
if (!t) return Object.keys(n).length ? n :
|
|
1860
|
+
}), I = n, L = x(!1), R = x(""), z = x(null), B = {}, V = d("originalColumnMetaById", null), H = r(() => {
|
|
1861
|
+
let e = String(c.cell.column.id), t = V?.value?.[e], n = c.cell.column.columnDef.meta || {};
|
|
1862
|
+
if (!t) return Object.keys(n).length ? n : B;
|
|
1863
1863
|
let r = {
|
|
1864
1864
|
...t,
|
|
1865
1865
|
...n
|
|
1866
1866
|
};
|
|
1867
1867
|
for (let e of i) (r[e] === void 0 || r[e] === null) && t[e] != null && (r[e] = t[e]);
|
|
1868
1868
|
return typeof r.badge != "function" && r.badge !== !0 && typeof t.badge == "function" && (r.badge = t.badge), r.suffixIcon == null && t.suffixIcon != null && (r.suffixIcon = t.suffixIcon), r.secondaryText == null && t.secondaryText != null && (r.secondaryText = t.secondaryText), typeof r.secondaryText != "function" && typeof r.secondaryText != "string" && typeof t.secondaryText == "function" && (r.secondaryText = t.secondaryText), typeof r.segmentedBar != "function" && typeof t.segmentedBar == "function" && (r.segmentedBar = t.segmentedBar), r;
|
|
1869
|
-
}),
|
|
1870
|
-
let e =
|
|
1869
|
+
}), te = r(() => H.value.type === "boolean"), ne = r(() => {
|
|
1870
|
+
let e = H.value;
|
|
1871
1871
|
if (!e.progressBar) return null;
|
|
1872
1872
|
let t = c.cell.getValue();
|
|
1873
1873
|
if (t == null) return null;
|
|
@@ -1878,7 +1878,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1878
1878
|
}
|
|
1879
1879
|
return Math.min(100, Math.max(0, Number(t)));
|
|
1880
1880
|
}), U = r(() => {
|
|
1881
|
-
let e =
|
|
1881
|
+
let e = H.value;
|
|
1882
1882
|
if (!e.segmentedBar || typeof e.segmentedBar != "function") return null;
|
|
1883
1883
|
let t = c.cell.getValue(), n = c.cell.row.original;
|
|
1884
1884
|
return e.segmentedBar(t, n) ?? null;
|
|
@@ -1889,9 +1889,9 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1889
1889
|
return `${Math.min(100, Math.max(0, n))}%`;
|
|
1890
1890
|
}
|
|
1891
1891
|
let G = r(() => {
|
|
1892
|
-
let e =
|
|
1892
|
+
let e = H.value;
|
|
1893
1893
|
return e.overflow ? e.overflow : e.multiline ? "wrap" : (f(b) ? b.value : b) || "truncate";
|
|
1894
|
-
}), K = r(() =>
|
|
1894
|
+
}), K = r(() => H.value.cellButtons ?? []);
|
|
1895
1895
|
function re(e) {
|
|
1896
1896
|
let t = e && e.color !== void 0 ? e.color : null;
|
|
1897
1897
|
return t ? {
|
|
@@ -1905,7 +1905,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1905
1905
|
};
|
|
1906
1906
|
}
|
|
1907
1907
|
let q = r(() => {
|
|
1908
|
-
let e =
|
|
1908
|
+
let e = H.value;
|
|
1909
1909
|
if (!e.badge) return null;
|
|
1910
1910
|
let t = c.cell.getValue(), n = c.cell.row.original, r = e.badge;
|
|
1911
1911
|
if (typeof r == "function") {
|
|
@@ -1917,13 +1917,13 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1917
1917
|
style: i,
|
|
1918
1918
|
text: a
|
|
1919
1919
|
};
|
|
1920
|
-
}), ie = r(() =>
|
|
1921
|
-
let e =
|
|
1920
|
+
}), ie = r(() => te.value && !H.value.badge), J = r(() => {
|
|
1921
|
+
let e = H.value;
|
|
1922
1922
|
if (!e.suffixIcon) return null;
|
|
1923
1923
|
let t = c.cell.getValue();
|
|
1924
1924
|
return typeof e.suffixIcon == "function" ? e.suffixIcon(t, c.cell.row.original) || null : e.suffixIcon;
|
|
1925
1925
|
}), ae = r(() => {
|
|
1926
|
-
let e =
|
|
1926
|
+
let e = H.value;
|
|
1927
1927
|
if (e.secondaryText == null || e.secondaryText === "") return null;
|
|
1928
1928
|
let t = c.cell.getValue(), n = c.cell.row.original, r;
|
|
1929
1929
|
if (r = typeof e.secondaryText == "function" ? e.secondaryText(t, n) : e.secondaryText, r == null) return null;
|
|
@@ -1931,28 +1931,28 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1931
1931
|
return i === "" ? null : i;
|
|
1932
1932
|
}), oe = r(() => c.cell.getValue() == null), se = r(() => ae.value ? oe.value ? !0 : !q.value : !1), ce = r(() => se.value ? "flex items-start gap-1 min-w-0" : "flex items-center gap-1 min-w-0");
|
|
1933
1933
|
function le() {
|
|
1934
|
-
|
|
1934
|
+
L.value || I("select");
|
|
1935
1935
|
}
|
|
1936
1936
|
function ue() {
|
|
1937
|
-
!u.value?.update || ie.value ||
|
|
1938
|
-
|
|
1937
|
+
!u.value?.update || ie.value || H.value.progressBar || H.value.segmentedBar || K.value.length > 0 || (L.value = !0, I("editing-change", !0), R.value = c.cell.getValue() ?? "", m(() => {
|
|
1938
|
+
z.value && (z.value.focus(), z.value.select(), de());
|
|
1939
1939
|
}));
|
|
1940
1940
|
}
|
|
1941
1941
|
function de() {
|
|
1942
|
-
|
|
1942
|
+
z.value && (z.value.style.height = "auto", z.value.style.height = z.value.scrollHeight + "px");
|
|
1943
1943
|
}
|
|
1944
1944
|
function fe() {
|
|
1945
|
-
let e =
|
|
1946
|
-
|
|
1945
|
+
let e = H.value.type;
|
|
1946
|
+
I("update", e === "int8" || e === "int4" || e === "float8" ? Number(R.value) : R.value), L.value = !1, I("editing-change", !1);
|
|
1947
1947
|
}
|
|
1948
1948
|
function Y() {
|
|
1949
|
-
|
|
1949
|
+
L.value = !1, I("editing-change", !1);
|
|
1950
1950
|
}
|
|
1951
1951
|
function pe(e) {
|
|
1952
1952
|
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), fe()) : e.key === "Escape" && Y();
|
|
1953
1953
|
}
|
|
1954
1954
|
function me() {
|
|
1955
|
-
u.value?.update &&
|
|
1955
|
+
u.value?.update && I("update", !c.cell.getValue());
|
|
1956
1956
|
}
|
|
1957
1957
|
return (n, r) => (y(), o("div", {
|
|
1958
1958
|
class: "px-2 py-1.5 relative cursor-default align-middle",
|
|
@@ -1964,23 +1964,23 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1964
1964
|
overflow: "hidden",
|
|
1965
1965
|
borderBottom: T(p) ? "1px solid var(--st-border)" : "none",
|
|
1966
1966
|
borderRight: T(_) ? "1px solid var(--st-border)" : "none",
|
|
1967
|
-
boxShadow: t.isSelected && !
|
|
1968
|
-
zIndex:
|
|
1967
|
+
boxShadow: t.isSelected && !L.value ? "inset 0 0 0 2px var(--st-accent)" : P.value ? "inset 3px 0 0 var(--st-accent)" : "none",
|
|
1968
|
+
zIndex: L.value ? 20 : t.isSelected ? 10 : "auto"
|
|
1969
1969
|
}),
|
|
1970
|
-
title:
|
|
1970
|
+
title: P.value && j.value !== void 0 ? `Was: ${j.value === null || j.value === "" ? "(empty)" : j.value}` : void 0,
|
|
1971
1971
|
onClick: le,
|
|
1972
1972
|
onDblclick: ue
|
|
1973
1973
|
}, [ie.value ? (y(), o(e, { key: 0 }, [T(u).update ? (y(), o("button", {
|
|
1974
1974
|
key: 0,
|
|
1975
1975
|
class: "flex items-center gap-1.5",
|
|
1976
|
-
onClick:
|
|
1976
|
+
onClick: N(me, ["stop"])
|
|
1977
1977
|
}, [s("span", {
|
|
1978
1978
|
class: "inline-block w-7 h-4 rounded-full relative transition-colors",
|
|
1979
1979
|
style: g({ backgroundColor: t.cell.getValue() ? "var(--st-accent)" : "var(--st-toggle-off)" })
|
|
1980
|
-
}, [s("span", { class: h(["absolute top-0.5 w-3 h-3 rounded-full bg-white transition-transform", t.cell.getValue() ? "left-3.5" : "left-0.5"]) }, null, 2)], 4), s("span", Mt, C(t.cell.getValue() ? "true" : "false"), 1)])) : (y(), o("span", Nt, [t.cell.getValue() === null || t.cell.getValue() === void 0 ? (y(), o("span", Pt, "NULL")) : (y(), o(e, { key: 1 }, [l(C(t.cell.getValue() ? "true" : "false"), 1)], 64))]))], 64)) :
|
|
1980
|
+
}, [s("span", { class: h(["absolute top-0.5 w-3 h-3 rounded-full bg-white transition-transform", t.cell.getValue() ? "left-3.5" : "left-0.5"]) }, null, 2)], 4), s("span", Mt, C(t.cell.getValue() ? "true" : "false"), 1)])) : (y(), o("span", Nt, [t.cell.getValue() === null || t.cell.getValue() === void 0 ? (y(), o("span", Pt, "NULL")) : (y(), o(e, { key: 1 }, [l(C(t.cell.getValue() ? "true" : "false"), 1)], 64))]))], 64)) : L.value ? (y(), o(e, { key: 1 }, [M(s("textarea", {
|
|
1981
1981
|
ref_key: "textareaRef",
|
|
1982
|
-
ref:
|
|
1983
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
1982
|
+
ref: z,
|
|
1983
|
+
"onUpdate:modelValue": r[0] ||= (e) => R.value = e,
|
|
1984
1984
|
class: "w-full rounded px-1.5 py-1 text-[13px] resize-none outline-none",
|
|
1985
1985
|
style: {
|
|
1986
1986
|
backgroundColor: "var(--st-bg-input)",
|
|
@@ -1990,17 +1990,17 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
1990
1990
|
rows: "1",
|
|
1991
1991
|
onKeydown: pe,
|
|
1992
1992
|
onInput: de
|
|
1993
|
-
}, null, 544), [[O,
|
|
1993
|
+
}, null, 544), [[O, R.value]]), s("div", Ft, [
|
|
1994
1994
|
s("button", {
|
|
1995
1995
|
class: "flex items-center gap-0.5",
|
|
1996
1996
|
style: { color: "var(--st-accent)" },
|
|
1997
|
-
onClick:
|
|
1997
|
+
onClick: N(fe, ["stop"])
|
|
1998
1998
|
}, " ↵ Save "),
|
|
1999
1999
|
r[1] ||= s("span", { style: { color: "var(--st-text-placeholder)" } }, "|", -1),
|
|
2000
2000
|
s("button", {
|
|
2001
2001
|
class: "flex items-center gap-0.5",
|
|
2002
2002
|
style: { color: "var(--st-text-secondary)" },
|
|
2003
|
-
onClick:
|
|
2003
|
+
onClick: N(Y, ["stop"])
|
|
2004
2004
|
}, " Esc Cancel ")
|
|
2005
2005
|
])], 64)) : U.value ? (y(), o(e, { key: 2 }, [U.value.total === 0 ? (y(), o("div", It, [...r[2] ||= [s("span", {
|
|
2006
2006
|
class: "italic text-[13px]",
|
|
@@ -2019,7 +2019,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2019
2019
|
}, C(e.count) + " " + C(e.label), 1))), 128))])]))], 64)) : ne.value === null ? (y(), o("div", {
|
|
2020
2020
|
key: 4,
|
|
2021
2021
|
class: h(ce.value),
|
|
2022
|
-
style: g(
|
|
2022
|
+
style: g(F.value ? {
|
|
2023
2023
|
textDecoration: "line-through",
|
|
2024
2024
|
opacity: .5
|
|
2025
2025
|
} : {})
|
|
@@ -2046,14 +2046,14 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2046
2046
|
}, null, 12, Jt)) : a("", !0),
|
|
2047
2047
|
K.value.length > 0 ? (y(), o("div", {
|
|
2048
2048
|
key: 1,
|
|
2049
|
-
class: h(["flex items-center gap-0.5 shrink-0",
|
|
2049
|
+
class: h(["flex items-center gap-0.5 shrink-0", ee.value])
|
|
2050
2050
|
}, [(y(!0), o(e, null, S(K.value, (e, n) => (y(), o("button", {
|
|
2051
2051
|
key: n,
|
|
2052
2052
|
type: "button",
|
|
2053
2053
|
class: h(["flex items-center justify-center rounded transition-colors", e.icon ? "w-5 h-5 shrink-0" : "h-5 px-1.5 shrink-0 text-[11px] font-medium whitespace-nowrap"]),
|
|
2054
2054
|
style: { color: "var(--st-text-secondary)" },
|
|
2055
2055
|
title: e.label,
|
|
2056
|
-
onClick:
|
|
2056
|
+
onClick: N((n) => e.onClick(t.cell.row.original), ["stop"])
|
|
2057
2057
|
}, [e.icon ? (y(), o("span", {
|
|
2058
2058
|
key: 0,
|
|
2059
2059
|
class: "w-3.5 h-3.5 flex items-center justify-center",
|
|
@@ -2077,7 +2077,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2077
2077
|
}, tn = { class: "flex h-full gap-1 pr-1.5 pl-1 items-center justify-end pl-0.5" }, nn = { class: "flex min-w-0 flex-1 items-center justify-end gap-0.5" }, rn = {
|
|
2078
2078
|
class: "text-xs text-right whitespace-nowrap",
|
|
2079
2079
|
style: { color: "var(--st-text-tertiary)" }
|
|
2080
|
-
}, an = ["checked"], on = /* @__PURE__ */
|
|
2080
|
+
}, an = ["checked"], on = /* @__PURE__ */ V({
|
|
2081
2081
|
__name: "TableGridDataRow",
|
|
2082
2082
|
props: {
|
|
2083
2083
|
row: {
|
|
@@ -2138,19 +2138,19 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2138
2138
|
delete: !0,
|
|
2139
2139
|
...e
|
|
2140
2140
|
};
|
|
2141
|
-
}), f = d("showRowBorders", !0), m = d("showColumnBorders", !0), _ = d("getSubTable", null), v = d("expanded", {}), b = d("toggleRowExpanded", () => {}), x = d("nestingDepth", 0), E = d("parentTheme", "dark"), D = d("parentAccentColor", "#3ecf8e"), O = d("subTableSorting", {}), k = d("subTableColumnFilters", {}), A = d("subTableColumnVisibility", {}), j = d("getRowPendingState", () => null),
|
|
2142
|
-
let e = T(
|
|
2141
|
+
}), f = d("showRowBorders", !0), m = d("showColumnBorders", !0), _ = d("getSubTable", null), v = d("expanded", {}), b = d("toggleRowExpanded", () => {}), x = d("nestingDepth", 0), E = d("parentTheme", "dark"), D = d("parentAccentColor", "#3ecf8e"), O = d("subTableSorting", {}), k = d("subTableColumnFilters", {}), A = d("subTableColumnVisibility", {}), j = d("getRowPendingState", () => null), M = d("isRowDisplayedSelected", null), P = d("highlightedRowId", null), F = r(() => {
|
|
2142
|
+
let e = T(P);
|
|
2143
2143
|
return e == null || e === "" ? !1 : n.row.id === e;
|
|
2144
2144
|
});
|
|
2145
|
-
function
|
|
2146
|
-
let t = T(
|
|
2145
|
+
function ee(e) {
|
|
2146
|
+
let t = T(M);
|
|
2147
2147
|
return typeof t == "function" ? t(e) : e.getIsSelected();
|
|
2148
2148
|
}
|
|
2149
|
-
let
|
|
2149
|
+
let I = r(() => {
|
|
2150
2150
|
let e = m ? "inset -1px 0 0 var(--st-border)" : "", t = "2px 0 4px var(--st-shadow-sticky)";
|
|
2151
2151
|
return e ? `${e}, ${t}` : t;
|
|
2152
|
-
}),
|
|
2153
|
-
let e =
|
|
2152
|
+
}), L = r(() => _ ? _(n.row.original) : null), R = r(() => {
|
|
2153
|
+
let e = L.value;
|
|
2154
2154
|
if (!e) return {
|
|
2155
2155
|
tableProps: null,
|
|
2156
2156
|
onRowAction: null
|
|
@@ -2160,14 +2160,14 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2160
2160
|
tableProps: n,
|
|
2161
2161
|
onRowAction: typeof t == "function" ? t : null
|
|
2162
2162
|
};
|
|
2163
|
-
}),
|
|
2164
|
-
function z() {
|
|
2165
|
-
return !!I.value;
|
|
2166
|
-
}
|
|
2163
|
+
}), z = r(() => T(v) ?? {});
|
|
2167
2164
|
function B() {
|
|
2168
|
-
return !!
|
|
2165
|
+
return !!L.value;
|
|
2169
2166
|
}
|
|
2170
|
-
|
|
2167
|
+
function V() {
|
|
2168
|
+
return !!z.value?.[n.row.id];
|
|
2169
|
+
}
|
|
2170
|
+
let H = r(() => n.virtualOffsetY == null ? { width: "100%" } : {
|
|
2171
2171
|
position: "absolute",
|
|
2172
2172
|
top: "0px",
|
|
2173
2173
|
left: "0px",
|
|
@@ -2177,12 +2177,12 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2177
2177
|
});
|
|
2178
2178
|
return (n, r) => (y(), o("div", {
|
|
2179
2179
|
class: h(["st-row", {
|
|
2180
|
-
"st-row--selected":
|
|
2181
|
-
"st-row--active":
|
|
2180
|
+
"st-row--selected": ee(t.row),
|
|
2181
|
+
"st-row--active": F.value,
|
|
2182
2182
|
"st-row--pending-insert": T(j)(t.row.id) === "insert",
|
|
2183
2183
|
"st-row--pending-delete": T(j)(t.row.id) === "delete"
|
|
2184
2184
|
}]),
|
|
2185
|
-
style: g(
|
|
2185
|
+
style: g(H.value),
|
|
2186
2186
|
"data-index": t.virtualOffsetY == null ? void 0 : t.rowIndex
|
|
2187
2187
|
}, [s("div", en, [
|
|
2188
2188
|
s("div", {
|
|
@@ -2193,15 +2193,15 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2193
2193
|
minWidth: "44px",
|
|
2194
2194
|
borderBottom: T(f) ? "1px solid var(--st-border)" : "none"
|
|
2195
2195
|
})
|
|
2196
|
-
}, [s("div", tn, [s("div", nn, [
|
|
2196
|
+
}, [s("div", tn, [s("div", nn, [B() ? (y(), o("button", {
|
|
2197
2197
|
key: 0,
|
|
2198
2198
|
class: "flex items-center justify-center w-4 h-4 shrink-0 transition-transform duration-150",
|
|
2199
2199
|
style: g({
|
|
2200
|
-
color:
|
|
2201
|
-
transform:
|
|
2200
|
+
color: V() ? "var(--st-accent)" : "var(--st-text-secondary)",
|
|
2201
|
+
transform: V() ? "rotate(90deg)" : "rotate(0deg)"
|
|
2202
2202
|
}),
|
|
2203
2203
|
title: "Toggle sub-table",
|
|
2204
|
-
onClick: r[0] ||=
|
|
2204
|
+
onClick: r[0] ||= N((e) => T(b)(t.row.id), ["stop"])
|
|
2205
2205
|
}, [...r[5] ||= [s("svg", {
|
|
2206
2206
|
class: "w-3 h-3",
|
|
2207
2207
|
viewBox: "0 0 16 16",
|
|
@@ -2211,7 +2211,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2211
2211
|
class: "invisible group-hover/row:visible flex items-center justify-center w-4 h-4 shrink-0",
|
|
2212
2212
|
style: { color: "var(--st-text-secondary)" },
|
|
2213
2213
|
title: "Expand row",
|
|
2214
|
-
onClick: r[1] ||=
|
|
2214
|
+
onClick: r[1] ||= N((e) => n.$emit("edit-row", t.row.original), ["stop"])
|
|
2215
2215
|
}, [...r[6] ||= [s("svg", {
|
|
2216
2216
|
class: "w-3 h-3",
|
|
2217
2217
|
viewBox: "0 0 16 16",
|
|
@@ -2227,13 +2227,13 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2227
2227
|
minWidth: "40px",
|
|
2228
2228
|
left: "44px",
|
|
2229
2229
|
borderBottom: T(f) ? "1px solid var(--st-border)" : "none",
|
|
2230
|
-
boxShadow:
|
|
2230
|
+
boxShadow: I.value
|
|
2231
2231
|
})
|
|
2232
2232
|
}, [s("input", {
|
|
2233
2233
|
type: "checkbox",
|
|
2234
2234
|
class: "cursor-pointer align-middle",
|
|
2235
2235
|
style: { accentColor: "var(--st-accent)" },
|
|
2236
|
-
checked:
|
|
2236
|
+
checked: ee(t.row),
|
|
2237
2237
|
onClick: r[2] ||= (e) => n.$emit("toggle-row-select", t.row, e, t.rowIndex)
|
|
2238
2238
|
}, null, 8, an)], 4),
|
|
2239
2239
|
(y(!0), o(e, null, S(t.row.getVisibleCells(), (e) => (y(), i(Qt, {
|
|
@@ -2243,7 +2243,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2243
2243
|
onSelect: (r) => n.$emit("select-cell", t.row.id, e.column.id),
|
|
2244
2244
|
onUpdate: (r) => n.$emit("update-cell", t.row.id, e.column.id, r),
|
|
2245
2245
|
onEditingChange: r[3] ||= (e) => n.$emit("editing-change", e, t.row.id),
|
|
2246
|
-
onContextmenu:
|
|
2246
|
+
onContextmenu: N((r) => n.$emit("context-menu", r, t.row, e), ["prevent", "stop"])
|
|
2247
2247
|
}, null, 8, [
|
|
2248
2248
|
"cell",
|
|
2249
2249
|
"is-selected",
|
|
@@ -2251,7 +2251,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2251
2251
|
"onUpdate",
|
|
2252
2252
|
"onContextmenu"
|
|
2253
2253
|
]))), 128))
|
|
2254
|
-
]),
|
|
2254
|
+
]), V() && L.value ? (y(), o("div", {
|
|
2255
2255
|
key: 0,
|
|
2256
2256
|
style: g({
|
|
2257
2257
|
display: "block",
|
|
@@ -2262,19 +2262,19 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2262
2262
|
borderLeft: "3px solid var(--st-accent)",
|
|
2263
2263
|
marginLeft: 10 + Number(w(T(x)) || 0) * 16 + "px",
|
|
2264
2264
|
backgroundColor: "var(--st-bg)"
|
|
2265
|
-
}) }, [u(Vr, p(
|
|
2266
|
-
editable:
|
|
2265
|
+
}) }, [u(Vr, p(R.value.tableProps, {
|
|
2266
|
+
editable: L.value.editable ?? {
|
|
2267
2267
|
insert: !1,
|
|
2268
2268
|
update: !1,
|
|
2269
2269
|
delete: !1
|
|
2270
2270
|
},
|
|
2271
|
-
theme:
|
|
2272
|
-
"accent-color":
|
|
2271
|
+
theme: L.value.theme ?? T(T(E)),
|
|
2272
|
+
"accent-color": L.value.accentColor ?? T(T(D)),
|
|
2273
2273
|
"nesting-depth": T(x) + 1,
|
|
2274
2274
|
"controlled-sorting": T(O),
|
|
2275
2275
|
"controlled-column-filters": T(k),
|
|
2276
2276
|
"controlled-column-visibility": T(A),
|
|
2277
|
-
onRowAction: r[4] ||= (e, t) =>
|
|
2277
|
+
onRowAction: r[4] ||= (e, t) => R.value.onRowAction?.(e, t)
|
|
2278
2278
|
}), null, 16, [
|
|
2279
2279
|
"editable",
|
|
2280
2280
|
"theme",
|
|
@@ -2326,7 +2326,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2326
2326
|
"editing-change"
|
|
2327
2327
|
],
|
|
2328
2328
|
setup(t, { emit: n }) {
|
|
2329
|
-
let a = t, s = n, c = d("cellOverflow", "truncate"), l = d("getSubTable", null), u = d("expanded"), f = typeof window < "u" && "onscrollend" in window, p = r(() => T(u) ?? {}), m =
|
|
2329
|
+
let a = t, s = n, c = d("cellOverflow", "truncate"), l = d("getSubTable", null), u = d("expanded"), f = typeof window < "u" && "onscrollend" in window, p = r(() => T(u) ?? {}), m = B(r(() => {
|
|
2330
2330
|
let e = a.rows, t = p.value, n = T(c) === "wrap", r = {}, i = l;
|
|
2331
2331
|
if (i) for (let t of e) {
|
|
2332
2332
|
let e = i(t.original);
|
|
@@ -2491,7 +2491,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2491
2491
|
backgroundColor: "var(--st-bg-surface)",
|
|
2492
2492
|
border: "1px solid var(--st-border-secondary)"
|
|
2493
2493
|
}
|
|
2494
|
-
}, wn = 500, Tn = 8, En = /* @__PURE__ */
|
|
2494
|
+
}, wn = 500, Tn = 8, En = /* @__PURE__ */ V({
|
|
2495
2495
|
__name: "TableGrid",
|
|
2496
2496
|
props: { table: {
|
|
2497
2497
|
type: Object,
|
|
@@ -2532,10 +2532,10 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2532
2532
|
delete: !0,
|
|
2533
2533
|
...e
|
|
2534
2534
|
};
|
|
2535
|
-
}), b = d("showRowBorders", !0), D = d("showColumnBorders", !0), O = d("loading", !1), k = r(() => !!T(O)), A = d("emptyTitle", "No rows found"), j = d("emptyMessage", "Get started by inserting a new row."),
|
|
2536
|
-
let e =
|
|
2535
|
+
}), b = d("showRowBorders", !0), D = d("showColumnBorders", !0), O = d("loading", !1), k = r(() => !!T(O)), A = d("emptyTitle", "No rows found"), j = d("emptyMessage", "Get started by inserting a new row."), M = d("openInsertPanel", null), P = d("defaultInsertLabel", null), F = d("insertActions", null), ee = r(() => {
|
|
2536
|
+
let e = F == null ? [] : T(F);
|
|
2537
2537
|
return Array.isArray(e) ? e : [];
|
|
2538
|
-
}),
|
|
2538
|
+
}), I = r(() => !v.value.insert || !(P != null && String(T(P)).trim()) ? !1 : ee.value.length === 0), L = d("insertRow", () => {}), R = x(!1), z = d("nestingDepth", 0), B = u, V = x(null), H = x(null), te = d("tableSourceRows", null), ne = r(() => (te != null && w(te), m.table.getHeaderGroups())), U = r(() => 84 + m.table.getVisibleLeafColumns().reduce((e, t) => e + t.getSize(), 0)), W = r(() => (te != null && w(te), m.table.getRowModel().rows)), G = r(() => (te != null && w(te), m.table.getVisibleLeafColumns())), K = r(() => m.table.getState().pagination), re = d("isRowDisplayedSelected", null);
|
|
2539
2539
|
function q(e) {
|
|
2540
2540
|
let t = T(re);
|
|
2541
2541
|
return typeof t == "function" ? t(e) : e.getIsSelected();
|
|
@@ -2546,13 +2546,13 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2546
2546
|
return e && !t;
|
|
2547
2547
|
});
|
|
2548
2548
|
function ae(e, t) {
|
|
2549
|
-
|
|
2549
|
+
V.value = `${e}:${t}`;
|
|
2550
2550
|
}
|
|
2551
2551
|
function oe() {
|
|
2552
|
-
|
|
2552
|
+
V.value = null;
|
|
2553
2553
|
}
|
|
2554
2554
|
function se(e, t, n) {
|
|
2555
|
-
|
|
2555
|
+
B("context-menu", e, t, n);
|
|
2556
2556
|
}
|
|
2557
2557
|
function ce() {
|
|
2558
2558
|
m.table.toggleAllPageRowsSelected(!ie.value);
|
|
@@ -2570,12 +2570,12 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2570
2570
|
return e ? `${e}, ${t}` : t;
|
|
2571
2571
|
}), fe = r(() => W.value.length > wn), Y = E("scroller");
|
|
2572
2572
|
function pe(e, t) {
|
|
2573
|
-
|
|
2573
|
+
H.value = e ? t : null;
|
|
2574
2574
|
}
|
|
2575
2575
|
function me() {
|
|
2576
2576
|
let e = Y.value;
|
|
2577
2577
|
if (!e) return null;
|
|
2578
|
-
let t = w(
|
|
2578
|
+
let t = w(z);
|
|
2579
2579
|
return t && t > 0 ? e.parentElement : e;
|
|
2580
2580
|
}
|
|
2581
2581
|
function he() {
|
|
@@ -2584,11 +2584,11 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2584
2584
|
return c({
|
|
2585
2585
|
getScrollViewportInnerWidth: he,
|
|
2586
2586
|
getViewportResizeObserveTarget: me
|
|
2587
|
-
}), (r, c) => (y(), o("div", { class: h(T(
|
|
2587
|
+
}), (r, c) => (y(), o("div", { class: h(T(z) === 0 ? "flex-1 min-h-0 relative" : "overflow-auto") }, [s("div", {
|
|
2588
2588
|
ref: "scroller",
|
|
2589
|
-
class: h(T(
|
|
2589
|
+
class: h(T(z) === 0 ? "absolute inset-0 overflow-auto flex flex-col items-start min-h-0" : "flex flex-col items-start"),
|
|
2590
2590
|
style: { "scrollbar-gutter": "stable" },
|
|
2591
|
-
onClick:
|
|
2591
|
+
onClick: N(oe, ["self"])
|
|
2592
2592
|
}, [s("div", {
|
|
2593
2593
|
class: "sticky top-0 z-[26] shrink-0 isolate",
|
|
2594
2594
|
style: g({
|
|
@@ -2638,14 +2638,14 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2638
2638
|
rows: W.value,
|
|
2639
2639
|
"scroll-element-ref": Y.value,
|
|
2640
2640
|
"total-table-width": U.value,
|
|
2641
|
-
"selected-cell":
|
|
2642
|
-
"editing-row-id":
|
|
2641
|
+
"selected-cell": V.value,
|
|
2642
|
+
"editing-row-id": H.value,
|
|
2643
2643
|
"pagination-state": K.value,
|
|
2644
2644
|
onToggleRowSelect: ue,
|
|
2645
|
-
onEditRow: c[0] ||= (e) =>
|
|
2645
|
+
onEditRow: c[0] ||= (e) => B("edit-row", e),
|
|
2646
2646
|
onContextMenu: se,
|
|
2647
2647
|
onSelectCell: ae,
|
|
2648
|
-
onUpdateCell: c[1] ||= (e, t, n) =>
|
|
2648
|
+
onUpdateCell: c[1] ||= (e, t, n) => B("update-cell", e, t, n),
|
|
2649
2649
|
onEditingChange: pe
|
|
2650
2650
|
}, null, 8, [
|
|
2651
2651
|
"rows",
|
|
@@ -2658,14 +2658,14 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2658
2658
|
key: 1,
|
|
2659
2659
|
rows: W.value,
|
|
2660
2660
|
"total-table-width": U.value,
|
|
2661
|
-
"selected-cell":
|
|
2662
|
-
"editing-row-id":
|
|
2661
|
+
"selected-cell": V.value,
|
|
2662
|
+
"editing-row-id": H.value,
|
|
2663
2663
|
"pagination-state": K.value,
|
|
2664
2664
|
onToggleRowSelect: ue,
|
|
2665
|
-
onEditRow: c[2] ||= (e) =>
|
|
2665
|
+
onEditRow: c[2] ||= (e) => B("edit-row", e),
|
|
2666
2666
|
onContextMenu: se,
|
|
2667
2667
|
onSelectCell: ae,
|
|
2668
|
-
onUpdateCell: c[3] ||= (e, t, n) =>
|
|
2668
|
+
onUpdateCell: c[3] ||= (e, t, n) => B("update-cell", e, t, n),
|
|
2669
2669
|
onEditingChange: pe
|
|
2670
2670
|
}, null, 8, [
|
|
2671
2671
|
"rows",
|
|
@@ -2727,29 +2727,29 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2727
2727
|
}, null, -1), s("path", { d: "M3 9h18M3 15h18M9 9v9M15 9v9" }, null, -1)]]))]),
|
|
2728
2728
|
s("div", vn, [s("p", yn, C(T(A)), 1), s("p", bn, C(T(j)), 1)]),
|
|
2729
2729
|
v.value.insert ? (y(), o("div", xn, [
|
|
2730
|
-
|
|
2730
|
+
I.value ? (y(), o("button", {
|
|
2731
2731
|
key: 0,
|
|
2732
2732
|
class: "flex items-center gap-1.5 px-3 py-1 rounded text-[13px] font-medium transition-colors",
|
|
2733
2733
|
style: {
|
|
2734
2734
|
backgroundColor: "var(--st-accent)",
|
|
2735
2735
|
color: "var(--st-text-on-accent)"
|
|
2736
2736
|
},
|
|
2737
|
-
onClick: c[4] ||= (e) => T(
|
|
2738
|
-
}, C(T(
|
|
2737
|
+
onClick: c[4] ||= (e) => T(L)()
|
|
2738
|
+
}, C(T(P)), 1)) : T(P) ? (y(), o("div", Sn, [s("button", {
|
|
2739
2739
|
class: "flex items-center gap-1.5 px-3 py-1 rounded-l text-[13px] font-medium transition-colors",
|
|
2740
2740
|
style: {
|
|
2741
2741
|
backgroundColor: "var(--st-accent)",
|
|
2742
2742
|
color: "var(--st-text-on-accent)"
|
|
2743
2743
|
},
|
|
2744
|
-
onClick: c[5] ||= (e) => T(
|
|
2745
|
-
}, C(T(
|
|
2744
|
+
onClick: c[5] ||= (e) => T(L)()
|
|
2745
|
+
}, C(T(P)), 1), s("button", {
|
|
2746
2746
|
class: "flex items-center self-stretch px-1.5 rounded-r transition-colors",
|
|
2747
2747
|
style: {
|
|
2748
2748
|
backgroundColor: "var(--st-accent)",
|
|
2749
2749
|
color: "var(--st-text-on-accent)",
|
|
2750
2750
|
borderLeft: "1px solid var(--st-accent-hover)"
|
|
2751
2751
|
},
|
|
2752
|
-
onClick: c[6] ||= (e) =>
|
|
2752
|
+
onClick: c[6] ||= (e) => R.value = !R.value
|
|
2753
2753
|
}, [...c[14] ||= [s("svg", {
|
|
2754
2754
|
class: "w-3 h-3",
|
|
2755
2755
|
viewBox: "0 0 16 16",
|
|
@@ -2761,24 +2761,24 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2761
2761
|
backgroundColor: "var(--st-accent)",
|
|
2762
2762
|
color: "var(--st-text-on-accent)"
|
|
2763
2763
|
},
|
|
2764
|
-
onClick: c[7] ||= (e) =>
|
|
2764
|
+
onClick: c[7] ||= (e) => R.value = !R.value
|
|
2765
2765
|
}, [...c[15] ||= [l(" Insert ", -1), s("svg", {
|
|
2766
2766
|
class: "w-3 h-3",
|
|
2767
2767
|
viewBox: "0 0 16 16",
|
|
2768
2768
|
fill: "currentColor"
|
|
2769
2769
|
}, [s("path", { d: "M4.427 6.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 6H4.604a.25.25 0 00-.177.427z" })], -1)]])),
|
|
2770
|
-
|
|
2770
|
+
R.value ? (y(), o("div", Cn, [
|
|
2771
2771
|
s("button", {
|
|
2772
2772
|
class: "w-full text-left px-3 py-1.5 hover-menu-item",
|
|
2773
2773
|
style: { color: "var(--st-text)" },
|
|
2774
2774
|
onClick: c[8] ||= (e) => {
|
|
2775
|
-
T(
|
|
2775
|
+
T(M)(), R.value = !1;
|
|
2776
2776
|
}
|
|
2777
2777
|
}, " Insert row "),
|
|
2778
2778
|
s("button", {
|
|
2779
2779
|
class: "w-full text-left px-3 py-1.5 hover-menu-item",
|
|
2780
2780
|
style: { color: "var(--st-text)" },
|
|
2781
|
-
onClick: c[9] ||= (e) =>
|
|
2781
|
+
onClick: c[9] ||= (e) => R.value = !1
|
|
2782
2782
|
}, " Insert column "),
|
|
2783
2783
|
c[16] ||= s("div", {
|
|
2784
2784
|
class: "my-1",
|
|
@@ -2787,13 +2787,13 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2787
2787
|
s("button", {
|
|
2788
2788
|
class: "w-full text-left px-3 py-1.5 hover-menu-item",
|
|
2789
2789
|
style: { color: "var(--st-text)" },
|
|
2790
|
-
onClick: c[10] ||= (e) =>
|
|
2790
|
+
onClick: c[10] ||= (e) => R.value = !1
|
|
2791
2791
|
}, " Import data from CSV ")
|
|
2792
2792
|
])) : a("", !0),
|
|
2793
|
-
(y(), i(t, { to: "body" }, [
|
|
2793
|
+
(y(), i(t, { to: "body" }, [R.value ? (y(), o("div", {
|
|
2794
2794
|
key: 0,
|
|
2795
2795
|
class: "fixed inset-0 z-40",
|
|
2796
|
-
onClick: c[11] ||= (e) =>
|
|
2796
|
+
onClick: c[11] ||= (e) => R.value = !1
|
|
2797
2797
|
})) : a("", !0)]))
|
|
2798
2798
|
])) : a("", !0)
|
|
2799
2799
|
])])) : a("", !0)], 2));
|
|
@@ -2883,7 +2883,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2883
2883
|
function j() {
|
|
2884
2884
|
p.pendingEditCount !== 0 && (A.value = !0);
|
|
2885
2885
|
}
|
|
2886
|
-
function
|
|
2886
|
+
function M() {
|
|
2887
2887
|
m("discard"), A.value = !1;
|
|
2888
2888
|
}
|
|
2889
2889
|
return (r, c) => (y(), o("div", Dn, [
|
|
@@ -2979,7 +2979,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
2979
2979
|
...T(u),
|
|
2980
2980
|
backgroundColor: "var(--st-bg-overlay)"
|
|
2981
2981
|
}),
|
|
2982
|
-
onClick: c[5] ||=
|
|
2982
|
+
onClick: c[5] ||= N((e) => A.value = !1, ["self"])
|
|
2983
2983
|
}, [s("div", {
|
|
2984
2984
|
class: "rounded-lg shadow-xl p-5 w-80",
|
|
2985
2985
|
style: g({
|
|
@@ -3004,7 +3004,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3004
3004
|
"background-color": "#ef4444",
|
|
3005
3005
|
color: "white"
|
|
3006
3006
|
},
|
|
3007
|
-
onClick:
|
|
3007
|
+
onClick: M
|
|
3008
3008
|
}, " Clear edits ")])
|
|
3009
3009
|
], 4)], 4)) : a("", !0)]))
|
|
3010
3010
|
]));
|
|
@@ -3134,7 +3134,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3134
3134
|
color: "var(--st-text-secondary)"
|
|
3135
3135
|
},
|
|
3136
3136
|
disabled: ""
|
|
3137
|
-
}, null, 8, nr)) :
|
|
3137
|
+
}, null, 8, nr)) : M((y(), o("textarea", {
|
|
3138
3138
|
key: 1,
|
|
3139
3139
|
"onUpdate:modelValue": (e) => w.value[n.id] = e,
|
|
3140
3140
|
class: "w-full rounded px-3 py-2 text-[13px] outline-none resize-y min-h-[36px]",
|
|
@@ -3172,7 +3172,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3172
3172
|
color: "var(--st-text-secondary)"
|
|
3173
3173
|
},
|
|
3174
3174
|
disabled: ""
|
|
3175
|
-
}, null, 8, fr)) :
|
|
3175
|
+
}, null, 8, fr)) : M((y(), o("textarea", {
|
|
3176
3176
|
key: 1,
|
|
3177
3177
|
"onUpdate:modelValue": (e) => w.value[n.id] = e,
|
|
3178
3178
|
class: "w-full rounded px-3 py-2 text-[13px] outline-none resize-y min-h-[36px]",
|
|
@@ -3231,7 +3231,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3231
3231
|
style: { color: "var(--st-text-secondary)" },
|
|
3232
3232
|
viewBox: "0 0 16 16",
|
|
3233
3233
|
fill: "currentColor"
|
|
3234
|
-
}, wr = /* @__PURE__ */
|
|
3234
|
+
}, wr = /* @__PURE__ */ V({
|
|
3235
3235
|
__name: "ContextMenu",
|
|
3236
3236
|
props: {
|
|
3237
3237
|
x: {
|
|
@@ -3281,52 +3281,52 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3281
3281
|
t.value = e, t.style.cssText = "position:fixed;opacity:0;pointer-events:none", document.body.appendChild(t), t.focus(), t.select(), document.execCommand("copy"), document.body.removeChild(t);
|
|
3282
3282
|
}
|
|
3283
3283
|
}
|
|
3284
|
-
function
|
|
3284
|
+
function M() {
|
|
3285
3285
|
k.value !== null && k.value !== void 0 && j(String(k.value)), b("close");
|
|
3286
3286
|
}
|
|
3287
|
-
function
|
|
3287
|
+
function N() {
|
|
3288
3288
|
m.row && j(JSON.stringify(m.row.original, null, 2)), b("close");
|
|
3289
3289
|
}
|
|
3290
|
-
function
|
|
3290
|
+
function P() {
|
|
3291
3291
|
A.value && k.value !== null && k.value !== void 0 && b("filter-by-value", A.value, String(k.value)), b("close");
|
|
3292
3292
|
}
|
|
3293
|
-
function
|
|
3293
|
+
function F() {
|
|
3294
3294
|
b("edit-row"), b("close");
|
|
3295
3295
|
}
|
|
3296
|
-
function
|
|
3296
|
+
function ee() {
|
|
3297
3297
|
b("delete-row"), b("close");
|
|
3298
3298
|
}
|
|
3299
|
-
function
|
|
3299
|
+
function I() {
|
|
3300
3300
|
b("undo-row"), b("close");
|
|
3301
3301
|
}
|
|
3302
|
-
function
|
|
3302
|
+
function L() {
|
|
3303
3303
|
A.value && b("undo-cell", A.value), b("close");
|
|
3304
3304
|
}
|
|
3305
|
-
function
|
|
3305
|
+
function R() {
|
|
3306
3306
|
return m.row?.original ?? null;
|
|
3307
3307
|
}
|
|
3308
|
-
function
|
|
3308
|
+
function B(e, t) {
|
|
3309
3309
|
if (e == null || e.divider) return !1;
|
|
3310
3310
|
let n = e.disabled;
|
|
3311
3311
|
if (n == null) return !1;
|
|
3312
3312
|
let r = t?.original ?? t ?? null;
|
|
3313
3313
|
return typeof n == "function" ? !!n(r) : !!n;
|
|
3314
3314
|
}
|
|
3315
|
-
function
|
|
3316
|
-
|
|
3315
|
+
function V(e) {
|
|
3316
|
+
B(e, m.row) || (b("row-action", e.key, R()), b("close"));
|
|
3317
3317
|
}
|
|
3318
|
-
|
|
3318
|
+
z(O, () => {
|
|
3319
3319
|
b("close");
|
|
3320
3320
|
});
|
|
3321
|
-
function
|
|
3321
|
+
function H(e) {
|
|
3322
3322
|
e.key === "Escape" && b("close");
|
|
3323
3323
|
}
|
|
3324
3324
|
_(() => {
|
|
3325
|
-
document.addEventListener("keydown",
|
|
3325
|
+
document.addEventListener("keydown", H);
|
|
3326
3326
|
}), v(() => {
|
|
3327
|
-
document.removeEventListener("keydown",
|
|
3327
|
+
document.removeEventListener("keydown", H);
|
|
3328
3328
|
});
|
|
3329
|
-
let
|
|
3329
|
+
let te = r(() => {
|
|
3330
3330
|
let e = window.innerWidth, t = window.innerHeight, n = {
|
|
3331
3331
|
position: "fixed",
|
|
3332
3332
|
zIndex: 9999
|
|
@@ -3338,18 +3338,18 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3338
3338
|
ref: O,
|
|
3339
3339
|
style: g({
|
|
3340
3340
|
...T(u),
|
|
3341
|
-
...
|
|
3341
|
+
...te.value
|
|
3342
3342
|
})
|
|
3343
3343
|
}, [s("div", gr, [
|
|
3344
3344
|
s("button", {
|
|
3345
3345
|
class: "w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item",
|
|
3346
3346
|
style: { color: "var(--st-text)" },
|
|
3347
|
-
onClick:
|
|
3347
|
+
onClick: M
|
|
3348
3348
|
}, [(y(), o("svg", _r, [...c[0] ||= [s("path", { d: "M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25z" }, null, -1)]])), c[1] ||= l(" Copy cell ", -1)]),
|
|
3349
3349
|
s("button", {
|
|
3350
3350
|
class: "w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item",
|
|
3351
3351
|
style: { color: "var(--st-text)" },
|
|
3352
|
-
onClick:
|
|
3352
|
+
onClick: N
|
|
3353
3353
|
}, [(y(), o("svg", vr, [...c[2] ||= [s("path", { d: "M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25z" }, null, -1)]])), c[3] ||= l(" Copy row ", -1)]),
|
|
3354
3354
|
c[14] ||= s("div", {
|
|
3355
3355
|
class: "my-1",
|
|
@@ -3358,7 +3358,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3358
3358
|
s("button", {
|
|
3359
3359
|
class: "w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item",
|
|
3360
3360
|
style: { color: "var(--st-text)" },
|
|
3361
|
-
onClick:
|
|
3361
|
+
onClick: P
|
|
3362
3362
|
}, [(y(), o("svg", yr, [...c[4] ||= [s("path", { d: "M.75 3a.75.75 0 000 1.5h14.5a.75.75 0 000-1.5H.75zM3 7.75A.75.75 0 013.75 7h8.5a.75.75 0 010 1.5h-8.5A.75.75 0 013 7.75zm3 4a.75.75 0 01.75-.75h2.5a.75.75 0 010 1.5h-2.5a.75.75 0 01-.75-.75z" }, null, -1)]])), c[5] ||= l(" Filter by value ", -1)]),
|
|
3363
3363
|
E.value === "modified" || D.value ? (y(), o(e, { key: 0 }, [
|
|
3364
3364
|
c[8] ||= s("div", {
|
|
@@ -3369,7 +3369,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3369
3369
|
key: 0,
|
|
3370
3370
|
class: "w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item",
|
|
3371
3371
|
style: { color: "var(--st-accent)" },
|
|
3372
|
-
onClick:
|
|
3372
|
+
onClick: L
|
|
3373
3373
|
}, [...c[6] ||= [s("svg", {
|
|
3374
3374
|
class: "w-3.5 h-3.5",
|
|
3375
3375
|
viewBox: "0 0 16 16",
|
|
@@ -3383,7 +3383,7 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3383
3383
|
key: 1,
|
|
3384
3384
|
class: "w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item",
|
|
3385
3385
|
style: { color: "var(--st-accent)" },
|
|
3386
|
-
onClick:
|
|
3386
|
+
onClick: I
|
|
3387
3387
|
}, [c[7] ||= s("svg", {
|
|
3388
3388
|
class: "w-3.5 h-3.5",
|
|
3389
3389
|
viewBox: "0 0 16 16",
|
|
@@ -3400,10 +3400,10 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3400
3400
|
}, null, -1), (y(!0), o(e, null, S(n.customActions, (t, n) => (y(), o(e, { key: t.divider ? `divider-${n}` : t.key }, [t.divider ? (y(), o("div", br)) : (y(), o("button", {
|
|
3401
3401
|
key: 1,
|
|
3402
3402
|
type: "button",
|
|
3403
|
-
class: h(["w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item disabled:pointer-events-none", { "opacity-40 cursor-not-allowed":
|
|
3404
|
-
disabled:
|
|
3403
|
+
class: h(["w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item disabled:pointer-events-none", { "opacity-40 cursor-not-allowed": B(t, m.row) }]),
|
|
3404
|
+
disabled: B(t, m.row),
|
|
3405
3405
|
style: g({ color: T(pt)(t) ? "var(--st-danger)" : "var(--st-text)" }),
|
|
3406
|
-
onClick: (e) =>
|
|
3406
|
+
onClick: (e) => V(t)
|
|
3407
3407
|
}, [t.icon ? (y(), o("span", {
|
|
3408
3408
|
key: 0,
|
|
3409
3409
|
class: "shrink-0 w-3.5 h-3.5 inline-flex items-center justify-center [&_svg]:max-w-full [&_svg]:max-h-full",
|
|
@@ -3418,13 +3418,13 @@ var Tt = { class: "flex items-center gap-1.5 px-2 py-1.5 cursor-default overflow
|
|
|
3418
3418
|
key: 0,
|
|
3419
3419
|
class: "w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item",
|
|
3420
3420
|
style: { color: "var(--st-text)" },
|
|
3421
|
-
onClick:
|
|
3421
|
+
onClick: F
|
|
3422
3422
|
}, [(y(), o("svg", Cr, [...c[10] ||= [s("path", { d: "M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61z" }, null, -1)]])), c[11] ||= l(" Edit row ", -1)])) : a("", !0),
|
|
3423
3423
|
n.allowRowDelete && w.value !== "delete" ? (y(), o("button", {
|
|
3424
3424
|
key: 1,
|
|
3425
3425
|
class: "w-full text-left px-3 py-1.5 flex items-center gap-2 hover-menu-item",
|
|
3426
3426
|
style: { color: "#ef4444" },
|
|
3427
|
-
onClick:
|
|
3427
|
+
onClick: ee
|
|
3428
3428
|
}, [...c[12] ||= [s("svg", {
|
|
3429
3429
|
class: "w-3.5 h-3.5",
|
|
3430
3430
|
viewBox: "0 0 16 16",
|
|
@@ -3535,7 +3535,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
3535
3535
|
borderBottom: "1px solid rgba(239,68,68,0.3)",
|
|
3536
3536
|
color: "#ef4444"
|
|
3537
3537
|
}
|
|
3538
|
-
}, Lr = { class: "flex-1" }, Rr = { class: "flex flex-1 min-h-0 min-w-0" }, zr = { class: "flex flex-col flex-1 min-w-0 min-h-0" }, Br = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif", Vr = /* @__PURE__ */
|
|
3538
|
+
}, Lr = { class: "flex-1" }, Rr = { class: "flex flex-1 min-h-0 min-w-0" }, zr = { class: "flex flex-col flex-1 min-w-0 min-h-0" }, Br = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif", Vr = /* @__PURE__ */ V({
|
|
3539
3539
|
__name: "DataTable",
|
|
3540
3540
|
props: {
|
|
3541
3541
|
columns: {
|
|
@@ -3787,12 +3787,12 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
3787
3787
|
return e != null && String(e).trim() !== "" ? String(e).trim() : null;
|
|
3788
3788
|
});
|
|
3789
3789
|
b(f, O);
|
|
3790
|
-
let A = r(() => ({ "--dt-font-family": O.value || Br })),
|
|
3790
|
+
let A = r(() => ({ "--dt-font-family": O.value || Br })), M = r(() => ({
|
|
3791
3791
|
...E.value,
|
|
3792
3792
|
...A.value,
|
|
3793
3793
|
backgroundColor: "var(--st-bg)",
|
|
3794
3794
|
color: "var(--st-text)"
|
|
3795
|
-
})),
|
|
3795
|
+
})), N = x(null), P = x(null), z = x(!1), B = x([]), V = l, H = r(() => p.editable === !0 ? {
|
|
3796
3796
|
insert: !0,
|
|
3797
3797
|
update: !0,
|
|
3798
3798
|
delete: !0
|
|
@@ -3805,7 +3805,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
3805
3805
|
update: !0,
|
|
3806
3806
|
delete: !0,
|
|
3807
3807
|
...p.editable
|
|
3808
|
-
}),
|
|
3808
|
+
}), te = r(() => H.value.update), ne = r(() => H.value.delete), U = x(!1);
|
|
3809
3809
|
k(() => p.error, () => {
|
|
3810
3810
|
U.value = !1;
|
|
3811
3811
|
});
|
|
@@ -3834,7 +3834,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
3834
3834
|
p.expandedRows === null ? ce.value = {
|
|
3835
3835
|
...ce.value,
|
|
3836
3836
|
[e]: !ce.value[e]
|
|
3837
|
-
} :
|
|
3837
|
+
} : V("update:expanded-rows", {
|
|
3838
3838
|
...p.expandedRows,
|
|
3839
3839
|
[e]: !p.expandedRows[e]
|
|
3840
3840
|
});
|
|
@@ -4000,14 +4000,14 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4000
4000
|
function Fe() {
|
|
4001
4001
|
if (ye.value || !Ce.value) return;
|
|
4002
4002
|
let e = Pe();
|
|
4003
|
-
ye.value = !0,
|
|
4003
|
+
ye.value = !0, V("commit-edits", e, (e) => {
|
|
4004
4004
|
ye.value = !1, e && (Z.value = /* @__PURE__ */ new Map());
|
|
4005
4005
|
});
|
|
4006
4006
|
}
|
|
4007
4007
|
function Ie() {
|
|
4008
|
-
Z.value = /* @__PURE__ */ new Map(),
|
|
4008
|
+
Z.value = /* @__PURE__ */ new Map(), V("discard-edits");
|
|
4009
4009
|
}
|
|
4010
|
-
let Q =
|
|
4010
|
+
let Q = R({
|
|
4011
4011
|
data: Te,
|
|
4012
4012
|
get columns() {
|
|
4013
4013
|
return p.columns;
|
|
@@ -4044,10 +4044,10 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4044
4044
|
return Y.value;
|
|
4045
4045
|
},
|
|
4046
4046
|
onSortingChange: (e) => {
|
|
4047
|
-
W.value = typeof e == "function" ? e(W.value) : e, Y.value &&
|
|
4047
|
+
W.value = typeof e == "function" ? e(W.value) : e, Y.value && V("sort-change", W.value);
|
|
4048
4048
|
},
|
|
4049
4049
|
onColumnFiltersChange: (e) => {
|
|
4050
|
-
G.value = typeof e == "function" ? e(G.value) : e,
|
|
4050
|
+
G.value = typeof e == "function" ? e(G.value) : e, V("update:column-filters", G.value);
|
|
4051
4051
|
},
|
|
4052
4052
|
onRowSelectionChange: (e) => {
|
|
4053
4053
|
let t = K.value, n = typeof e == "function" ? e(t) : e;
|
|
@@ -4057,7 +4057,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4057
4057
|
let e = p.additionalSelectedRowIds || [], t = new Set(e.map(String)), n = i.filter((e) => t.has(String(e)));
|
|
4058
4058
|
if (n.length > 0) {
|
|
4059
4059
|
let t = new Set(n.map(String));
|
|
4060
|
-
|
|
4060
|
+
V("update:additionalSelectedRowIds", e.filter((e) => !t.has(String(e))));
|
|
4061
4061
|
}
|
|
4062
4062
|
}
|
|
4063
4063
|
}
|
|
@@ -4065,7 +4065,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4065
4065
|
},
|
|
4066
4066
|
onPaginationChange: (e) => {
|
|
4067
4067
|
let t = typeof e == "function" ? e(re.value) : e;
|
|
4068
|
-
re.value = t, Y.value &&
|
|
4068
|
+
re.value = t, Y.value && V("page-change", {
|
|
4069
4069
|
pageIndex: t.pageIndex,
|
|
4070
4070
|
pageSize: t.pageSize
|
|
4071
4071
|
});
|
|
@@ -4075,15 +4075,15 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4075
4075
|
},
|
|
4076
4076
|
onColumnSizingInfoChange: (e) => {
|
|
4077
4077
|
let t = ie.value, n = typeof e == "function" ? e(t) : e;
|
|
4078
|
-
ie.value = n, t.isResizingColumn && !n.isResizingColumn &&
|
|
4078
|
+
ie.value = n, t.isResizingColumn && !n.isResizingColumn && V("column-resize", q.value);
|
|
4079
4079
|
},
|
|
4080
4080
|
onColumnVisibilityChange: (e) => {
|
|
4081
4081
|
J.value = typeof e == "function" ? e(J.value) : e;
|
|
4082
4082
|
},
|
|
4083
|
-
getCoreRowModel:
|
|
4084
|
-
getSortedRowModel:
|
|
4085
|
-
getFilteredRowModel:
|
|
4086
|
-
getPaginationRowModel:
|
|
4083
|
+
getCoreRowModel: F(),
|
|
4084
|
+
getSortedRowModel: L(),
|
|
4085
|
+
getFilteredRowModel: ee(),
|
|
4086
|
+
getPaginationRowModel: I(),
|
|
4087
4087
|
get manualPagination() {
|
|
4088
4088
|
return Y.value;
|
|
4089
4089
|
},
|
|
@@ -4121,7 +4121,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4121
4121
|
r && (K.value = n);
|
|
4122
4122
|
}, { deep: !0 });
|
|
4123
4123
|
function Re() {
|
|
4124
|
-
Q.resetRowSelection(),
|
|
4124
|
+
Q.resetRowSelection(), V("update:additionalSelectedRowIds", []);
|
|
4125
4125
|
}
|
|
4126
4126
|
let ze = he, Be = r(() => he.value > 0), Ve = x({
|
|
4127
4127
|
open: !1,
|
|
@@ -4138,7 +4138,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4138
4138
|
function Ue() {
|
|
4139
4139
|
let e = p.defaultInsertLabel;
|
|
4140
4140
|
if (typeof e == "string" && e.trim() !== "") {
|
|
4141
|
-
|
|
4141
|
+
V("insert-row");
|
|
4142
4142
|
return;
|
|
4143
4143
|
}
|
|
4144
4144
|
He();
|
|
@@ -4158,36 +4158,36 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4158
4158
|
};
|
|
4159
4159
|
}
|
|
4160
4160
|
function Ke(e) {
|
|
4161
|
-
if (Ve.value.mode === "insert") p.stagedEdits ? Ee(e) :
|
|
4161
|
+
if (Ve.value.mode === "insert") p.stagedEdits ? Ee(e) : V("insert-row", e);
|
|
4162
4162
|
else if (p.stagedEdits) {
|
|
4163
4163
|
let t = fe.value, n = String(e[t] ?? e.id), r = Se(n) ?? {}, i = {};
|
|
4164
4164
|
for (let n of Object.keys(e)) n !== t && e[n] !== r[n] && (i[n] = e[n]);
|
|
4165
4165
|
Object.keys(i).length > 0 && De(n, i);
|
|
4166
|
-
} else
|
|
4166
|
+
} else V("update-row", {
|
|
4167
4167
|
id: e.id,
|
|
4168
4168
|
changes: e
|
|
4169
4169
|
});
|
|
4170
4170
|
Ge();
|
|
4171
4171
|
}
|
|
4172
4172
|
function qe(e) {
|
|
4173
|
-
p.stagedEdits ? Oe(e) :
|
|
4173
|
+
p.stagedEdits ? Oe(e) : V("delete-rows", e), Q.resetRowSelection(), V("update:additionalSelectedRowIds", []);
|
|
4174
4174
|
}
|
|
4175
4175
|
function Je(e) {
|
|
4176
4176
|
let t = (e ?? []).map(String).filter(Boolean);
|
|
4177
|
-
t.length !== 0 && (
|
|
4177
|
+
t.length !== 0 && (B.value = t, z.value = !0);
|
|
4178
4178
|
}
|
|
4179
4179
|
function Ye() {
|
|
4180
4180
|
Je(ge());
|
|
4181
4181
|
}
|
|
4182
4182
|
function Xe() {
|
|
4183
|
-
let e = [...
|
|
4184
|
-
|
|
4183
|
+
let e = [...B.value];
|
|
4184
|
+
z.value = !1, qe(e);
|
|
4185
4185
|
}
|
|
4186
|
-
k(
|
|
4187
|
-
e || (
|
|
4186
|
+
k(z, (e) => {
|
|
4187
|
+
e || (B.value = []);
|
|
4188
4188
|
});
|
|
4189
4189
|
function Ze(e, t, n) {
|
|
4190
|
-
p.stagedEdits ? De(e, { [t]: n }) :
|
|
4190
|
+
p.stagedEdits ? De(e, { [t]: n }) : V("update-row", {
|
|
4191
4191
|
id: e,
|
|
4192
4192
|
changes: { [t]: n }
|
|
4193
4193
|
});
|
|
@@ -4235,7 +4235,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4235
4235
|
b("themeVars", r(() => ({
|
|
4236
4236
|
...E.value,
|
|
4237
4237
|
...A.value
|
|
4238
|
-
}))), b("originalColumnMetaById", Le), b("table", Q), b("tableSourceRows", Te), b("tableName", p.tableName), b("showDataTypes", p.showDataTypes), b("editable",
|
|
4238
|
+
}))), b("originalColumnMetaById", Le), b("table", Q), b("tableSourceRows", Te), b("tableName", p.tableName), b("showDataTypes", p.showDataTypes), b("editable", H), b("showRowBorders", p.showRowBorders), b("showColumnBorders", p.showColumnBorders), b("cellButtonVisibility", r(() => p.cellButtonVisibility)), b("cellOverflow", r(() => p.cellOverflow)), b("insertRow", () => V("insert-row")), b("openInsertPanel", He), b("emptyTitle", r(() => p.emptyTitle)), b("emptyMessage", r(() => p.emptyMessage)), b("defaultInsertLabel", r(() => p.defaultInsertLabel)), b("insertActions", r(() => p.insertActions)), b("loading", r(() => p.loading)), b("expanded", le), b("toggleRowExpanded", ue), b("getSubTable", p.getSubTable), b("nestingDepth", p.nestingDepth), b("parentTheme", r(() => p.theme)), b("parentAccentColor", r(() => p.accentColor)), b("subTableSorting", ae), b("subTableColumnFilters", oe), b("subTableColumnVisibility", se), b("stagedEditsEnabled", r(() => p.stagedEdits)), b("getRowPendingState", je), b("getCellPendingState", Me), b("getCellPreviousValue", Ne), b("undoRowEdit", ke), b("undoCellEdit", Ae), k(() => p.rows, () => {
|
|
4239
4239
|
Q.resetRowSelection();
|
|
4240
4240
|
});
|
|
4241
4241
|
function tt() {
|
|
@@ -4244,8 +4244,8 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4244
4244
|
let t = document.createElement("canvas").getContext("2d");
|
|
4245
4245
|
if (!t) return e;
|
|
4246
4246
|
let n = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif";
|
|
4247
|
-
if (
|
|
4248
|
-
let e = getComputedStyle(
|
|
4247
|
+
if (N.value) {
|
|
4248
|
+
let e = getComputedStyle(N.value).fontFamily;
|
|
4249
4249
|
e && e.trim() !== "" && (n = e);
|
|
4250
4250
|
}
|
|
4251
4251
|
t.font = `13px ${n}`;
|
|
@@ -4289,8 +4289,8 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4289
4289
|
}
|
|
4290
4290
|
q.value = t;
|
|
4291
4291
|
}
|
|
4292
|
-
let rt = null;
|
|
4293
|
-
function
|
|
4292
|
+
let rt = null, it = !1;
|
|
4293
|
+
function at() {
|
|
4294
4294
|
rt?.disconnect(), rt = null;
|
|
4295
4295
|
}
|
|
4296
4296
|
return _(() => {
|
|
@@ -4298,28 +4298,32 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4298
4298
|
await m(), await new Promise((e) => {
|
|
4299
4299
|
requestAnimationFrame(() => e());
|
|
4300
4300
|
});
|
|
4301
|
-
let e =
|
|
4302
|
-
if (nt(e), e > 0) return;
|
|
4303
|
-
let t = typeof
|
|
4304
|
-
t && typeof ResizeObserver < "u" && (
|
|
4305
|
-
let e =
|
|
4306
|
-
e <= 0 || (nt(e),
|
|
4301
|
+
let e = P.value?.getScrollViewportInnerWidth?.() ?? 0;
|
|
4302
|
+
if (nt(e), it = Te.value.length > 0, e > 0) return;
|
|
4303
|
+
let t = typeof P.value?.getViewportResizeObserveTarget == "function" ? P.value.getViewportResizeObserveTarget() : null;
|
|
4304
|
+
t && typeof ResizeObserver < "u" && (at(), rt = new ResizeObserver(() => {
|
|
4305
|
+
let e = P.value?.getScrollViewportInnerWidth?.() ?? 0;
|
|
4306
|
+
e <= 0 || (nt(e), at());
|
|
4307
4307
|
}), rt.observe(t));
|
|
4308
4308
|
})();
|
|
4309
|
+
}), k(() => p.rows, async (e) => {
|
|
4310
|
+
it || e.length === 0 || (it = !0, await m(), await new Promise((e) => {
|
|
4311
|
+
requestAnimationFrame(() => e());
|
|
4312
|
+
}), nt(P.value?.getScrollViewportInnerWidth?.() ?? 0));
|
|
4309
4313
|
}), v(() => {
|
|
4310
|
-
|
|
4314
|
+
at(), Pr($e);
|
|
4311
4315
|
}), c({ openDeleteConfirmation: Je }), (r, c) => (y(), o("div", {
|
|
4312
4316
|
ref_key: "rootElRef",
|
|
4313
|
-
ref:
|
|
4317
|
+
ref: N,
|
|
4314
4318
|
class: h(["data-table-root flex flex-col text-[13px]", t.nestingDepth === 0 ? "flex-1 min-h-0 min-w-0" : ""]),
|
|
4315
4319
|
"data-st-theme": t.theme,
|
|
4316
|
-
style: g(
|
|
4320
|
+
style: g(M.value)
|
|
4317
4321
|
}, [
|
|
4318
4322
|
t.showToolbar ? (y(), o(e, { key: 0 }, [Be.value ? (y(), i(xt, {
|
|
4319
4323
|
key: 0,
|
|
4320
4324
|
"selected-count": T(ze),
|
|
4321
4325
|
table: T(Q),
|
|
4322
|
-
editable:
|
|
4326
|
+
editable: H.value,
|
|
4323
4327
|
"selection-actions": t.selectionActions,
|
|
4324
4328
|
"context-menu-actions": t.contextMenuActions,
|
|
4325
4329
|
"enable-select-all": t.enableSelectAll,
|
|
@@ -4328,8 +4332,8 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4328
4332
|
"count-label-singular": t.countLabelSingular,
|
|
4329
4333
|
"count-label-plural": t.countLabelPlural,
|
|
4330
4334
|
onDeleteConfirmRequest: Ye,
|
|
4331
|
-
onSelectionAction: c[0] ||= (e, t) =>
|
|
4332
|
-
onSelectAllMatching: c[1] ||= (e) =>
|
|
4335
|
+
onSelectionAction: c[0] ||= (e, t) => V("selection-action", e, t, ge()),
|
|
4336
|
+
onSelectAllMatching: c[1] ||= (e) => V("select-all-matching"),
|
|
4333
4337
|
onClearFullSelection: Re
|
|
4334
4338
|
}, null, 8, [
|
|
4335
4339
|
"selected-count",
|
|
@@ -4349,7 +4353,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4349
4353
|
"column-filters": G.value,
|
|
4350
4354
|
"column-visibility": J.value,
|
|
4351
4355
|
"default-column-visibility": t.defaultColumnVisibility,
|
|
4352
|
-
editable:
|
|
4356
|
+
editable: H.value,
|
|
4353
4357
|
loading: t.loading,
|
|
4354
4358
|
"is-empty": Te.value.length === 0,
|
|
4355
4359
|
"default-insert-label": t.defaultInsertLabel,
|
|
@@ -4368,9 +4372,9 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4368
4372
|
"onUpdate:subTableColumnFilters": c[6] ||= (e) => oe.value = e,
|
|
4369
4373
|
"onUpdate:subTableColumnVisibility": c[7] ||= (e) => se.value = e,
|
|
4370
4374
|
onInsertRow: Ue,
|
|
4371
|
-
onInsertAction: c[8] ||= (e) =>
|
|
4372
|
-
onRefresh: c[9] ||= (e) =>
|
|
4373
|
-
onToolbarAction: c[10] ||= (e) =>
|
|
4375
|
+
onInsertAction: c[8] ||= (e) => V("insert-action", e),
|
|
4376
|
+
onRefresh: c[9] ||= (e) => V("refresh"),
|
|
4377
|
+
onToolbarAction: c[10] ||= (e) => V("toolbar-action", e)
|
|
4374
4378
|
}, null, 8, [
|
|
4375
4379
|
"table",
|
|
4376
4380
|
"sorting",
|
|
@@ -4408,7 +4412,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4408
4412
|
])) : a("", !0),
|
|
4409
4413
|
s("div", Rr, [s("div", zr, [u(En, {
|
|
4410
4414
|
ref_key: "tableGridRef",
|
|
4411
|
-
ref:
|
|
4415
|
+
ref: P,
|
|
4412
4416
|
table: T(Q),
|
|
4413
4417
|
onUpdateCell: Ze,
|
|
4414
4418
|
onContextMenu: Qe,
|
|
@@ -4435,7 +4439,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4435
4439
|
"count-label-singular",
|
|
4436
4440
|
"count-label-plural"
|
|
4437
4441
|
])) : a("", !0)]), u(n, { name: "slide-panel" }, {
|
|
4438
|
-
default: j(() => [(
|
|
4442
|
+
default: j(() => [(H.value.insert || H.value.update) && Ve.value.open ? (y(), i(hr, {
|
|
4439
4443
|
key: 0,
|
|
4440
4444
|
mode: Ve.value.mode,
|
|
4441
4445
|
"row-data": Ve.value.rowData,
|
|
@@ -4452,9 +4456,9 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4452
4456
|
_: 1
|
|
4453
4457
|
})]),
|
|
4454
4458
|
u(Or, {
|
|
4455
|
-
modelValue:
|
|
4456
|
-
"onUpdate:modelValue": c[12] ||= (e) =>
|
|
4457
|
-
"row-count":
|
|
4459
|
+
modelValue: z.value,
|
|
4460
|
+
"onUpdate:modelValue": c[12] ||= (e) => z.value = e,
|
|
4461
|
+
"row-count": B.value.length,
|
|
4458
4462
|
onConfirm: Xe
|
|
4459
4463
|
}, null, 8, ["modelValue", "row-count"]),
|
|
4460
4464
|
$.value.show ? (y(), i(wr, {
|
|
@@ -4464,7 +4468,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4464
4468
|
row: $.value.row,
|
|
4465
4469
|
cell: $.value.cell,
|
|
4466
4470
|
"custom-actions": t.contextMenuActions,
|
|
4467
|
-
"allow-row-edit":
|
|
4471
|
+
"allow-row-edit": te.value,
|
|
4468
4472
|
"allow-row-delete": ne.value,
|
|
4469
4473
|
onClose: $e,
|
|
4470
4474
|
onEditRow: c[13] ||= (e) => We($.value.row.original),
|
|
@@ -4472,7 +4476,7 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4472
4476
|
onFilterByValue: et,
|
|
4473
4477
|
onUndoRow: c[15] ||= (e) => ke($.value.row.id),
|
|
4474
4478
|
onUndoCell: c[16] ||= (e) => Ae($.value.row.id, e),
|
|
4475
|
-
onRowAction: c[17] ||= (e, t) =>
|
|
4479
|
+
onRowAction: c[17] ||= (e, t) => V("row-action", e, t)
|
|
4476
4480
|
}, null, 8, [
|
|
4477
4481
|
"x",
|
|
4478
4482
|
"y",
|
|
@@ -4484,6 +4488,6 @@ var Fr = ["data-st-theme"], Ir = {
|
|
|
4484
4488
|
])) : a("", !0)
|
|
4485
4489
|
], 14, Fr));
|
|
4486
4490
|
}
|
|
4487
|
-
}, [["__scopeId", "data-v-
|
|
4491
|
+
}, [["__scopeId", "data-v-fc413c70"]]);
|
|
4488
4492
|
//#endregion
|
|
4489
4493
|
export { Vr as DataTable };
|