@smallwebco/tinypivot-vue 1.0.72 → 1.0.73
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/README.md +1 -0
- package/dist/components/ChartBuilder.vue.d.ts +2 -0
- package/dist/components/ChartBuilder.vue.d.ts.map +1 -1
- package/dist/components/DataGrid.vue.d.ts +4 -0
- package/dist/components/DataGrid.vue.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tinypivot-vue.js +938 -933
- package/dist/tinypivot-vue.js.map +1 -1
- package/dist/tinypivot-vue.umd.cjs +3 -3
- package/dist/tinypivot-vue.umd.cjs.map +1 -1
- package/package.json +2 -2
package/dist/tinypivot-vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as _, computed as
|
|
1
|
+
import { ref as _, computed as E, onMounted as ht, defineComponent as tt, watch as _e, nextTick as mt, createElementBlock as u, openBlock as i, normalizeClass as ue, unref as A, createElementVNode as e, createStaticVNode as Mt, Fragment as Z, createCommentVNode as P, withDirectives as Oe, vModelText as Ye, renderList as ve, toDisplayString as k, withModifiers as He, createTextVNode as ce, createBlock as Dt, Teleport as Cn, vModelSelect as Ca, defineAsyncComponent as ka, Suspense as xa, withCtx as At, withKeys as zt, normalizeStyle as Ve, onUnmounted as Bt, createVNode as je, Transition as kn, vShow as Sa } from "vue";
|
|
2
2
|
import { useVueTable as Fa, getFilteredRowModel as Ma, getSortedRowModel as $a, getCoreRowModel as Ra } from "@tanstack/vue-table";
|
|
3
3
|
const Da = /* @__PURE__ */ new Map([
|
|
4
4
|
["sales", {
|
|
@@ -491,7 +491,7 @@ function rn(t) {
|
|
|
491
491
|
return o == null ? void 0 : o.initialData;
|
|
492
492
|
}
|
|
493
493
|
function Ea(t, o, n, l) {
|
|
494
|
-
const s = n ? o.get(n) : void 0, a = n ? t.find((
|
|
494
|
+
const s = n ? o.get(n) : void 0, a = n ? t.find((v) => v.id === n) : void 0, d = (l == null ? void 0 : l.filter((v) => v.table !== (s == null ? void 0 : s.table))) || [];
|
|
495
495
|
return `You are a data analyst assistant. Your job is to translate user questions into SQL queries and return data results.
|
|
496
496
|
|
|
497
497
|
## CRITICAL: ALWAYS GENERATE A SQL QUERY
|
|
@@ -576,11 +576,11 @@ function Na(t) {
|
|
|
576
576
|
function La(t, o) {
|
|
577
577
|
const l = o.columns.filter((s) => {
|
|
578
578
|
var d;
|
|
579
|
-
const a = (d = t.columns) == null ? void 0 : d.find((
|
|
579
|
+
const a = (d = t.columns) == null ? void 0 : d.find((v) => v.name === s.name);
|
|
580
580
|
return !(a != null && a.hidden);
|
|
581
581
|
}).map((s) => {
|
|
582
582
|
var d;
|
|
583
|
-
const a = (d = t.columns) == null ? void 0 : d.find((
|
|
583
|
+
const a = (d = t.columns) == null ? void 0 : d.find((v) => v.name === s.name);
|
|
584
584
|
return {
|
|
585
585
|
...s,
|
|
586
586
|
description: (a == null ? void 0 : a.description) || s.description
|
|
@@ -605,7 +605,7 @@ You can JOIN with these tables when the user needs additional data.
|
|
|
605
605
|
Look for foreign key relationships (columns ending in \`_id\`).
|
|
606
606
|
|
|
607
607
|
${t.map((n) => {
|
|
608
|
-
const l = n.columns.filter((
|
|
608
|
+
const l = n.columns.filter((v) => v.name === "id" || v.name.endsWith("_id") || v.name.startsWith("id_") || v.name === "uuid").map((v) => `\`${v.name}\``).join(", "), s = n.columns.filter((v) => v.name !== "id" && !v.name.endsWith("_id") && !v.name.startsWith("id_") && v.name !== "uuid").slice(0, 5).map((v) => `\`${v.name}\` (${v.type})`).join(", "), a = n.columns.length - (l ? l.split(",").length : 0) - 5, d = a > 0 ? `, +${a} more` : "";
|
|
609
609
|
return `- **\`${n.table}\`**
|
|
610
610
|
- Keys: ${l || "none"}
|
|
611
611
|
- Columns: ${s}${d}`;
|
|
@@ -840,42 +840,44 @@ const Pt = [
|
|
|
840
840
|
"#3b82f6"
|
|
841
841
|
// blue
|
|
842
842
|
];
|
|
843
|
-
function ja(t, o) {
|
|
843
|
+
function ja(t, o, n) {
|
|
844
|
+
if (n != null && n[o])
|
|
845
|
+
return n[o];
|
|
844
846
|
if (t.length === 0)
|
|
845
847
|
return "dimension";
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
+
const s = t.slice(0, 100).map((c) => c[o]).filter((c) => c != null);
|
|
849
|
+
if (s.length === 0)
|
|
848
850
|
return "dimension";
|
|
849
|
-
let
|
|
850
|
-
for (const c of
|
|
851
|
-
(typeof c == "number" || !Number.isNaN(Number(c)) && c !== "" && typeof c != "boolean") &&
|
|
852
|
-
const
|
|
853
|
-
return
|
|
851
|
+
let a = 0, d = 0, v = 0;
|
|
852
|
+
for (const c of s)
|
|
853
|
+
(typeof c == "number" || !Number.isNaN(Number(c)) && c !== "" && typeof c != "boolean") && (a++, typeof c == "number" && d++), (c instanceof Date || typeof c == "string" && !Number.isNaN(Date.parse(c)) && c.includes("-")) && v++;
|
|
854
|
+
const y = s.length * 0.8;
|
|
855
|
+
return v >= y ? "temporal" : a >= y && (d >= a || new Set(s.map(String)).size > Math.min(s.length * 0.3, 20)) ? "measure" : "dimension";
|
|
854
856
|
}
|
|
855
|
-
function Wa(t) {
|
|
857
|
+
function Wa(t, o) {
|
|
856
858
|
if (t.length === 0)
|
|
857
859
|
return [];
|
|
858
|
-
const
|
|
859
|
-
for (const
|
|
860
|
-
const
|
|
861
|
-
let
|
|
862
|
-
if (
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
} else
|
|
867
|
-
|
|
868
|
-
field:
|
|
869
|
-
label: It(
|
|
870
|
-
role:
|
|
871
|
-
dataType:
|
|
872
|
-
uniqueCount:
|
|
873
|
-
sampleValues: Array.from(
|
|
874
|
-
min:
|
|
875
|
-
max:
|
|
860
|
+
const n = Object.keys(t[0]), l = [];
|
|
861
|
+
for (const s of n) {
|
|
862
|
+
const a = t.map((F) => F[s]).filter((F) => F != null), d = ja(t, s, o), v = new Set(a.map(String));
|
|
863
|
+
let y = "string", c, L;
|
|
864
|
+
if (d === "measure") {
|
|
865
|
+
y = "number";
|
|
866
|
+
const F = a.map((C) => Number(C)).filter((C) => !Number.isNaN(C));
|
|
867
|
+
F.length > 0 && (c = Math.min(...F), L = Math.max(...F));
|
|
868
|
+
} else d === "temporal" ? y = "date" : a.filter((C) => typeof C == "boolean" || C === "true" || C === "false").length >= a.length * 0.8 && (y = "boolean");
|
|
869
|
+
l.push({
|
|
870
|
+
field: s,
|
|
871
|
+
label: It(s),
|
|
872
|
+
role: d,
|
|
873
|
+
dataType: y,
|
|
874
|
+
uniqueCount: v.size,
|
|
875
|
+
sampleValues: Array.from(v).slice(0, 5),
|
|
876
|
+
min: c,
|
|
877
|
+
max: L
|
|
876
878
|
});
|
|
877
879
|
}
|
|
878
|
-
return
|
|
880
|
+
return l;
|
|
879
881
|
}
|
|
880
882
|
function It(t) {
|
|
881
883
|
return t.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/\s+/g, " ").trim().split(" ").map((o) => o.charAt(0).toUpperCase() + o.slice(1).toLowerCase()).join(" ");
|
|
@@ -954,110 +956,110 @@ function Ut(t, o) {
|
|
|
954
956
|
}
|
|
955
957
|
}
|
|
956
958
|
function cn(t, o) {
|
|
957
|
-
var
|
|
959
|
+
var L;
|
|
958
960
|
if (!o.xAxis || !o.yAxis || t.length === 0)
|
|
959
961
|
return { categories: [], series: [] };
|
|
960
|
-
const n = o.xAxis.field, l = o.yAxis.field, s = o.yAxis.aggregation || "sum", a = (
|
|
961
|
-
for (const
|
|
962
|
-
const
|
|
962
|
+
const n = o.xAxis.field, l = o.yAxis.field, s = o.yAxis.aggregation || "sum", a = (L = o.seriesField) == null ? void 0 : L.field, d = /* @__PURE__ */ new Map();
|
|
963
|
+
for (const F of t) {
|
|
964
|
+
const C = String(F[n] ?? "(blank)"), b = Number(F[l]), h = a ? String(F[a] ?? "(blank)") : "_default";
|
|
963
965
|
if (Number.isNaN(b))
|
|
964
966
|
continue;
|
|
965
|
-
d.has(
|
|
966
|
-
const $ = d.get(
|
|
967
|
+
d.has(C) || d.set(C, /* @__PURE__ */ new Map());
|
|
968
|
+
const $ = d.get(C);
|
|
967
969
|
$.has(h) || $.set(h, []), $.get(h).push(b);
|
|
968
970
|
}
|
|
969
|
-
const
|
|
970
|
-
const b = Number.parseFloat(
|
|
971
|
-
return !Number.isNaN(b) && !Number.isNaN(h) ? b - h :
|
|
971
|
+
const v = Array.from(d.keys()).sort((F, C) => {
|
|
972
|
+
const b = Number.parseFloat(F), h = Number.parseFloat(C);
|
|
973
|
+
return !Number.isNaN(b) && !Number.isNaN(h) ? b - h : F.localeCompare(C);
|
|
972
974
|
}), y = /* @__PURE__ */ new Set();
|
|
973
|
-
for (const
|
|
974
|
-
for (const
|
|
975
|
-
y.add(
|
|
976
|
-
const
|
|
977
|
-
for (const
|
|
978
|
-
const
|
|
979
|
-
for (const b of
|
|
980
|
-
const h = d.get(b), $ = (h == null ? void 0 : h.get(
|
|
981
|
-
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
name:
|
|
985
|
-
data:
|
|
975
|
+
for (const F of d.values())
|
|
976
|
+
for (const C of F.keys())
|
|
977
|
+
y.add(C);
|
|
978
|
+
const c = [];
|
|
979
|
+
for (const F of y) {
|
|
980
|
+
const C = [];
|
|
981
|
+
for (const b of v) {
|
|
982
|
+
const h = d.get(b), $ = (h == null ? void 0 : h.get(F)) || [];
|
|
983
|
+
C.push(Ut($, s));
|
|
984
|
+
}
|
|
985
|
+
c.push({
|
|
986
|
+
name: F === "_default" ? It(l) : F,
|
|
987
|
+
data: C
|
|
986
988
|
});
|
|
987
989
|
}
|
|
988
|
-
return { categories:
|
|
990
|
+
return { categories: v, series: c };
|
|
989
991
|
}
|
|
990
992
|
function dn(t, o) {
|
|
991
993
|
if (!o.xAxis || !o.yAxis || t.length === 0)
|
|
992
994
|
return { categories: [], series: [] };
|
|
993
995
|
const n = o.xAxis.field, l = o.yAxis.field, s = o.yAxis.aggregation || "sum", a = /* @__PURE__ */ new Map();
|
|
994
|
-
for (const
|
|
995
|
-
const y = String(
|
|
996
|
-
Number.isNaN(
|
|
996
|
+
for (const v of t) {
|
|
997
|
+
const y = String(v[n] ?? "(blank)"), c = Number(v[l]);
|
|
998
|
+
Number.isNaN(c) || (a.has(y) || a.set(y, []), a.get(y).push(c));
|
|
997
999
|
}
|
|
998
|
-
const d = Array.from(a.entries()).map(([
|
|
999
|
-
category:
|
|
1000
|
+
const d = Array.from(a.entries()).map(([v, y]) => ({
|
|
1001
|
+
category: v,
|
|
1000
1002
|
value: Ut(y, s)
|
|
1001
|
-
})).sort((
|
|
1003
|
+
})).sort((v, y) => y.value - v.value);
|
|
1002
1004
|
return {
|
|
1003
|
-
categories: d.map((
|
|
1005
|
+
categories: d.map((v) => v.category),
|
|
1004
1006
|
series: [{
|
|
1005
1007
|
name: It(l),
|
|
1006
|
-
data: d.map((
|
|
1008
|
+
data: d.map((v) => v.value)
|
|
1007
1009
|
}]
|
|
1008
1010
|
};
|
|
1009
1011
|
}
|
|
1010
1012
|
function Ka(t, o) {
|
|
1011
|
-
var y,
|
|
1013
|
+
var y, c;
|
|
1012
1014
|
if (!o.xAxis || !o.yAxis || t.length === 0)
|
|
1013
1015
|
return { series: [] };
|
|
1014
|
-
const n = o.xAxis.field, l = o.yAxis.field, s = (y = o.sizeField) == null ? void 0 : y.field, a = (
|
|
1015
|
-
for (const
|
|
1016
|
-
const
|
|
1017
|
-
if (Number.isNaN(
|
|
1016
|
+
const n = o.xAxis.field, l = o.yAxis.field, s = (y = o.sizeField) == null ? void 0 : y.field, a = (c = o.seriesField) == null ? void 0 : c.field, d = /* @__PURE__ */ new Map();
|
|
1017
|
+
for (const L of t) {
|
|
1018
|
+
const F = Number(L[n]), C = Number(L[l]);
|
|
1019
|
+
if (Number.isNaN(F) || Number.isNaN(C))
|
|
1018
1020
|
continue;
|
|
1019
|
-
const b = { x:
|
|
1021
|
+
const b = { x: F, y: C };
|
|
1020
1022
|
if (s) {
|
|
1021
|
-
const $ = Number(
|
|
1023
|
+
const $ = Number(L[s]);
|
|
1022
1024
|
Number.isNaN($) || (b.z = $);
|
|
1023
1025
|
}
|
|
1024
|
-
const h = a ? String(
|
|
1026
|
+
const h = a ? String(L[a] ?? "(blank)") : "_default";
|
|
1025
1027
|
d.has(h) || d.set(h, []), d.get(h).push(b);
|
|
1026
1028
|
}
|
|
1027
|
-
return { series: Array.from(d.entries()).map(([
|
|
1028
|
-
var
|
|
1029
|
+
return { series: Array.from(d.entries()).map(([L, F]) => {
|
|
1030
|
+
var C;
|
|
1029
1031
|
return {
|
|
1030
|
-
name:
|
|
1031
|
-
data:
|
|
1032
|
+
name: L === "_default" ? ((C = o.yAxis) == null ? void 0 : C.label) || "Data" : L,
|
|
1033
|
+
data: F
|
|
1032
1034
|
};
|
|
1033
1035
|
}) };
|
|
1034
1036
|
}
|
|
1035
1037
|
function Ja(t, o) {
|
|
1036
1038
|
if (!o.xAxis || !o.yAxis || !o.colorField || t.length === 0)
|
|
1037
1039
|
return { series: [] };
|
|
1038
|
-
const n = o.xAxis.field, l = o.yAxis.field, s = o.colorField.field, a = o.colorField.aggregation || "sum", d = /* @__PURE__ */ new Map(),
|
|
1039
|
-
for (const
|
|
1040
|
-
const
|
|
1040
|
+
const n = o.xAxis.field, l = o.yAxis.field, s = o.colorField.field, a = o.colorField.aggregation || "sum", d = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set();
|
|
1041
|
+
for (const F of t) {
|
|
1042
|
+
const C = String(F[n] ?? "(blank)"), b = String(F[l] ?? "(blank)"), h = Number(F[s]);
|
|
1041
1043
|
if (Number.isNaN(h))
|
|
1042
1044
|
continue;
|
|
1043
|
-
|
|
1045
|
+
v.add(C), d.has(b) || d.set(b, /* @__PURE__ */ new Map());
|
|
1044
1046
|
const $ = d.get(b);
|
|
1045
|
-
$.has(
|
|
1047
|
+
$.has(C) || $.set(C, []), $.get(C).push(h);
|
|
1046
1048
|
}
|
|
1047
|
-
const y = Array.from(
|
|
1048
|
-
const b = Number.parseFloat(
|
|
1049
|
-
return !Number.isNaN(b) && !Number.isNaN(h) ? b - h :
|
|
1049
|
+
const y = Array.from(v).sort((F, C) => {
|
|
1050
|
+
const b = Number.parseFloat(F), h = Number.parseFloat(C);
|
|
1051
|
+
return !Number.isNaN(b) && !Number.isNaN(h) ? b - h : F.localeCompare(C);
|
|
1050
1052
|
});
|
|
1051
|
-
return { series: Array.from(d.keys()).sort((
|
|
1052
|
-
const b = Number.parseFloat(
|
|
1053
|
-
return !Number.isNaN(b) && !Number.isNaN(h) ? b - h :
|
|
1054
|
-
}).map((
|
|
1055
|
-
const
|
|
1056
|
-
const $ =
|
|
1053
|
+
return { series: Array.from(d.keys()).sort((F, C) => {
|
|
1054
|
+
const b = Number.parseFloat(F), h = Number.parseFloat(C);
|
|
1055
|
+
return !Number.isNaN(b) && !Number.isNaN(h) ? b - h : F.localeCompare(C);
|
|
1056
|
+
}).map((F) => {
|
|
1057
|
+
const C = d.get(F), b = y.map((h) => {
|
|
1058
|
+
const $ = C.get(h) || [], re = $.length > 0 ? Ut($, a) : 0;
|
|
1057
1059
|
return { x: h, y: re };
|
|
1058
1060
|
});
|
|
1059
1061
|
return {
|
|
1060
|
-
name:
|
|
1062
|
+
name: F,
|
|
1061
1063
|
data: b
|
|
1062
1064
|
};
|
|
1063
1065
|
}) };
|
|
@@ -1088,15 +1090,15 @@ function Xa(t, o, n = {}) {
|
|
|
1088
1090
|
const { filename: l = "export.csv", includeHeaders: s = !0, delimiter: a = "," } = n, d = [];
|
|
1089
1091
|
s && d.push(o.map((y) => $e(y, a)).join(a));
|
|
1090
1092
|
for (const y of t) {
|
|
1091
|
-
const
|
|
1092
|
-
d.push(
|
|
1093
|
+
const c = o.map((L) => $e(y[L], a));
|
|
1094
|
+
d.push(c.join(a));
|
|
1093
1095
|
}
|
|
1094
|
-
const
|
|
1096
|
+
const v = d.join(`
|
|
1095
1097
|
`);
|
|
1096
|
-
Mn(
|
|
1098
|
+
Mn(v, l, "text/csv;charset=utf-8;");
|
|
1097
1099
|
}
|
|
1098
1100
|
function Za(t, o, n, l, s = {}) {
|
|
1099
|
-
const { filename: a = "pivot-export.csv", delimiter: d = "," } = s,
|
|
1101
|
+
const { filename: a = "pivot-export.csv", delimiter: d = "," } = s, v = [], { headers: y, rowHeaders: c, data: L, rowTotals: F, columnTotals: C, grandTotal: b, showRowTotals: h, showColumnTotals: $ } = t, re = o.length || 1;
|
|
1100
1102
|
if (y.length > 0)
|
|
1101
1103
|
for (let U = 0; U < y.length; U++) {
|
|
1102
1104
|
const O = [];
|
|
@@ -1104,14 +1106,14 @@ function Za(t, o, n, l, s = {}) {
|
|
|
1104
1106
|
O.push(U === y.length - 1 ? $e(o[W] || "", d) : "");
|
|
1105
1107
|
for (const W of y[U])
|
|
1106
1108
|
O.push($e(W, d));
|
|
1107
|
-
if (h &&
|
|
1109
|
+
if (h && F && F.length > 0)
|
|
1108
1110
|
if (U === y.length - 1)
|
|
1109
1111
|
for (const W of l)
|
|
1110
1112
|
O.push($e(`Total (${W.aggregation})`, d));
|
|
1111
1113
|
else
|
|
1112
1114
|
for (let W = 0; W < l.length; W++)
|
|
1113
1115
|
O.push("");
|
|
1114
|
-
|
|
1116
|
+
v.push(O.join(d));
|
|
1115
1117
|
}
|
|
1116
1118
|
else {
|
|
1117
1119
|
const U = [];
|
|
@@ -1119,27 +1121,27 @@ function Za(t, o, n, l, s = {}) {
|
|
|
1119
1121
|
U.push($e(o[O] || "", d));
|
|
1120
1122
|
for (const O of l)
|
|
1121
1123
|
U.push($e(`${O.field} (${O.aggregation})`, d));
|
|
1122
|
-
h &&
|
|
1124
|
+
h && F && F.length > 0 && U.push($e("Total", d)), v.push(U.join(d));
|
|
1123
1125
|
}
|
|
1124
|
-
for (let U = 0; U <
|
|
1125
|
-
const O = [], W =
|
|
1126
|
+
for (let U = 0; U < c.length; U++) {
|
|
1127
|
+
const O = [], W = c[U] || [];
|
|
1126
1128
|
for (let X = 0; X < re; X++)
|
|
1127
1129
|
O.push($e(W[X] || "", d));
|
|
1128
|
-
const G =
|
|
1130
|
+
const G = L[U] || [];
|
|
1129
1131
|
for (const X of G)
|
|
1130
1132
|
O.push($e((X == null ? void 0 : X.formattedValue) || "", d));
|
|
1131
|
-
h &&
|
|
1133
|
+
h && F && F[U] && O.push($e(F[U].formattedValue || "", d)), v.push(O.join(d));
|
|
1132
1134
|
}
|
|
1133
|
-
if ($ &&
|
|
1135
|
+
if ($ && C && C.length > 0) {
|
|
1134
1136
|
const U = [];
|
|
1135
1137
|
U.push($e("Total", d));
|
|
1136
1138
|
for (let O = 1; O < re; O++)
|
|
1137
1139
|
U.push("");
|
|
1138
|
-
for (const O of
|
|
1140
|
+
for (const O of C)
|
|
1139
1141
|
U.push($e((O == null ? void 0 : O.formattedValue) || "", d));
|
|
1140
|
-
h && b && U.push($e(b.formattedValue || "", d)),
|
|
1142
|
+
h && b && U.push($e(b.formattedValue || "", d)), v.push(U.join(d));
|
|
1141
1143
|
}
|
|
1142
|
-
const ee =
|
|
1144
|
+
const ee = v.join(`
|
|
1143
1145
|
`);
|
|
1144
1146
|
Mn(ee, a, "text/csv;charset=utf-8;");
|
|
1145
1147
|
}
|
|
@@ -1151,22 +1153,22 @@ function eo(t, o, n) {
|
|
|
1151
1153
|
navigator.clipboard.writeText(t).then(o).catch(n);
|
|
1152
1154
|
}
|
|
1153
1155
|
function to(t, o, n) {
|
|
1154
|
-
const { minRow: l, maxRow: s, minCol: a, maxCol: d } = n,
|
|
1156
|
+
const { minRow: l, maxRow: s, minCol: a, maxCol: d } = n, v = [];
|
|
1155
1157
|
for (let y = l; y <= s; y++) {
|
|
1156
|
-
const
|
|
1157
|
-
if (!
|
|
1158
|
+
const c = t[y];
|
|
1159
|
+
if (!c)
|
|
1158
1160
|
continue;
|
|
1159
|
-
const
|
|
1160
|
-
for (let
|
|
1161
|
-
const
|
|
1162
|
-
if (!
|
|
1161
|
+
const L = [];
|
|
1162
|
+
for (let F = a; F <= d; F++) {
|
|
1163
|
+
const C = o[F];
|
|
1164
|
+
if (!C)
|
|
1163
1165
|
continue;
|
|
1164
|
-
const b =
|
|
1165
|
-
|
|
1166
|
+
const b = c[C];
|
|
1167
|
+
L.push(b == null ? "" : String(b));
|
|
1166
1168
|
}
|
|
1167
|
-
|
|
1169
|
+
v.push(L.join(" "));
|
|
1168
1170
|
}
|
|
1169
|
-
return
|
|
1171
|
+
return v.join(`
|
|
1170
1172
|
`);
|
|
1171
1173
|
}
|
|
1172
1174
|
const $n = {
|
|
@@ -1243,10 +1245,10 @@ function vn(t) {
|
|
|
1243
1245
|
o++;
|
|
1244
1246
|
let a = t.slice(o, o + s);
|
|
1245
1247
|
l.length === 33 && l[0] === 0 && (l = l.slice(1)), a.length === 33 && a[0] === 0 && (a = a.slice(1));
|
|
1246
|
-
const d = new Uint8Array(32),
|
|
1247
|
-
d.set(l, 32 - l.length),
|
|
1248
|
+
const d = new Uint8Array(32), v = new Uint8Array(32);
|
|
1249
|
+
d.set(l, 32 - l.length), v.set(a, 32 - a.length);
|
|
1248
1250
|
const y = new Uint8Array(64);
|
|
1249
|
-
return y.set(d, 0), y.set(
|
|
1251
|
+
return y.set(d, 0), y.set(v, 32), y;
|
|
1250
1252
|
}
|
|
1251
1253
|
async function ao(t, o, n) {
|
|
1252
1254
|
const { p256: l } = await import("./p256-D44eOAG2.js"), s = n.slice(26);
|
|
@@ -1295,19 +1297,19 @@ function lo() {
|
|
|
1295
1297
|
return Ht(t);
|
|
1296
1298
|
}
|
|
1297
1299
|
async function ro(t, o, n) {
|
|
1298
|
-
const l = `TP-${t}-${n}`, a = new TextEncoder().encode(l), d = Ht(o),
|
|
1299
|
-
if (!
|
|
1300
|
+
const l = `TP-${t}-${n}`, a = new TextEncoder().encode(l), d = Ht(o), v = await jt();
|
|
1301
|
+
if (!v) {
|
|
1300
1302
|
Dn();
|
|
1301
1303
|
try {
|
|
1302
|
-
const y = vn(d),
|
|
1303
|
-
return await ao(y, a,
|
|
1304
|
+
const y = vn(d), c = lo();
|
|
1305
|
+
return await ao(y, a, c);
|
|
1304
1306
|
} catch {
|
|
1305
1307
|
return !1;
|
|
1306
1308
|
}
|
|
1307
1309
|
}
|
|
1308
1310
|
try {
|
|
1309
|
-
const y = vn(d),
|
|
1310
|
-
return
|
|
1311
|
+
const y = vn(d), c = await so();
|
|
1312
|
+
return c ? await v.verify({ name: "ECDSA", hash: "SHA-256" }, c, new Uint8Array(y).buffer, a) : !1;
|
|
1311
1313
|
} catch {
|
|
1312
1314
|
return !1;
|
|
1313
1315
|
}
|
|
@@ -1326,20 +1328,20 @@ async function io(t) {
|
|
|
1326
1328
|
const a = l.slice(0, s), d = l.slice(s + 1, l.lastIndexOf("-"));
|
|
1327
1329
|
if (!await ro(a, d, n))
|
|
1328
1330
|
return kt;
|
|
1329
|
-
const y = Number.parseInt(n.slice(0, 4)),
|
|
1330
|
-
let
|
|
1331
|
-
return a === "PRO1" ?
|
|
1332
|
-
type:
|
|
1331
|
+
const y = Number.parseInt(n.slice(0, 4)), c = Number.parseInt(n.slice(4, 6)) - 1, L = Number.parseInt(n.slice(6, 8)), F = new Date(y, c, L);
|
|
1332
|
+
let C = "free";
|
|
1333
|
+
return a === "PRO1" ? C = "pro-single" : a === "PROU" ? C = "pro-unlimited" : a === "PROT" && (C = "pro-team"), {
|
|
1334
|
+
type: C,
|
|
1333
1335
|
isValid: !0,
|
|
1334
|
-
expiresAt:
|
|
1336
|
+
expiresAt: F,
|
|
1335
1337
|
features: {
|
|
1336
|
-
pivot:
|
|
1337
|
-
advancedAggregations:
|
|
1338
|
-
percentageMode:
|
|
1339
|
-
sessionPersistence:
|
|
1340
|
-
noWatermark:
|
|
1341
|
-
charts:
|
|
1342
|
-
aiAnalyst:
|
|
1338
|
+
pivot: C !== "free",
|
|
1339
|
+
advancedAggregations: C !== "free",
|
|
1340
|
+
percentageMode: C !== "free",
|
|
1341
|
+
sessionPersistence: C !== "free",
|
|
1342
|
+
noWatermark: C !== "free",
|
|
1343
|
+
charts: C !== "free",
|
|
1344
|
+
aiAnalyst: C !== "free"
|
|
1343
1345
|
}
|
|
1344
1346
|
};
|
|
1345
1347
|
}
|
|
@@ -1383,22 +1385,22 @@ function wo(t) {
|
|
|
1383
1385
|
console.warn(`[TinyPivot] "${t}" requires a Pro license. Visit https://tiny-pivot.com/#pricing to upgrade.`);
|
|
1384
1386
|
}
|
|
1385
1387
|
function Co(t) {
|
|
1386
|
-
const o = t.filter((
|
|
1388
|
+
const o = t.filter((v) => v != null && v !== "");
|
|
1387
1389
|
if (o.length === 0)
|
|
1388
1390
|
return "string";
|
|
1389
1391
|
const n = o.slice(0, 100);
|
|
1390
1392
|
let l = 0, s = 0, a = 0;
|
|
1391
|
-
for (const
|
|
1392
|
-
typeof
|
|
1393
|
+
for (const v of n)
|
|
1394
|
+
typeof v == "boolean" ? a++ : typeof v == "number" || !Number.isNaN(Number(v)) && v !== "" ? l++ : (v instanceof Date || !Number.isNaN(Date.parse(String(v)))) && s++;
|
|
1393
1395
|
const d = n.length * 0.8;
|
|
1394
1396
|
return a >= d ? "boolean" : l >= d ? "number" : s >= d ? "date" : "string";
|
|
1395
1397
|
}
|
|
1396
1398
|
function ko(t, o) {
|
|
1397
|
-
const l = t.map((
|
|
1399
|
+
const l = t.map((v) => v[o]).filter((v) => v != null && v !== "").slice(0, 100);
|
|
1398
1400
|
let s = 0;
|
|
1399
1401
|
const a = /* @__PURE__ */ new Set();
|
|
1400
|
-
for (const
|
|
1401
|
-
a.add(String(
|
|
1402
|
+
for (const v of l)
|
|
1403
|
+
a.add(String(v)), (typeof v == "number" || !Number.isNaN(Number(v)) && v !== "") && s++;
|
|
1402
1404
|
const d = s >= l.length * 0.8;
|
|
1403
1405
|
return {
|
|
1404
1406
|
field: o,
|
|
@@ -1409,9 +1411,9 @@ function ko(t, o) {
|
|
|
1409
1411
|
}
|
|
1410
1412
|
function xo(t, o, n = 500) {
|
|
1411
1413
|
const l = [];
|
|
1412
|
-
let s = 0, a, d,
|
|
1413
|
-
for (const
|
|
1414
|
-
const b =
|
|
1414
|
+
let s = 0, a, d, v, y;
|
|
1415
|
+
for (const C of t) {
|
|
1416
|
+
const b = C[o];
|
|
1415
1417
|
if (b == null || b === "")
|
|
1416
1418
|
s++;
|
|
1417
1419
|
else {
|
|
@@ -1421,27 +1423,27 @@ function xo(t, o, n = 500) {
|
|
|
1421
1423
|
const $ = b instanceof Date ? b : new Date(String(b));
|
|
1422
1424
|
if (!Number.isNaN($.getTime())) {
|
|
1423
1425
|
const re = $.toISOString().split("T")[0];
|
|
1424
|
-
(
|
|
1426
|
+
(v === void 0 || re < v) && (v = re), (y === void 0 || re > y) && (y = re);
|
|
1425
1427
|
}
|
|
1426
1428
|
}
|
|
1427
1429
|
}
|
|
1428
1430
|
}
|
|
1429
|
-
const
|
|
1430
|
-
for (const
|
|
1431
|
-
if (
|
|
1431
|
+
const c = /* @__PURE__ */ new Set();
|
|
1432
|
+
for (const C of l)
|
|
1433
|
+
if (c.add(String(C)), c.size >= n)
|
|
1432
1434
|
break;
|
|
1433
|
-
const
|
|
1434
|
-
const h = Number.parseFloat(
|
|
1435
|
-
return !Number.isNaN(h) && !Number.isNaN($) ? h - $ :
|
|
1436
|
-
}),
|
|
1435
|
+
const L = Array.from(c).sort((C, b) => {
|
|
1436
|
+
const h = Number.parseFloat(C), $ = Number.parseFloat(b);
|
|
1437
|
+
return !Number.isNaN(h) && !Number.isNaN($) ? h - $ : C.localeCompare(b);
|
|
1438
|
+
}), F = Co(l);
|
|
1437
1439
|
return {
|
|
1438
|
-
uniqueValues:
|
|
1440
|
+
uniqueValues: L,
|
|
1439
1441
|
totalCount: t.length,
|
|
1440
1442
|
nullCount: s,
|
|
1441
|
-
type:
|
|
1443
|
+
type: F,
|
|
1442
1444
|
// Only include min/max for numeric columns
|
|
1443
|
-
...
|
|
1444
|
-
...
|
|
1445
|
+
...F === "number" && a !== void 0 && d !== void 0 ? { numericMin: a, numericMax: d } : {},
|
|
1446
|
+
...F === "date" && v !== void 0 && y !== void 0 ? { dateMin: v, dateMax: y } : {}
|
|
1445
1447
|
};
|
|
1446
1448
|
}
|
|
1447
1449
|
function So(t, o, n = "us", l = "iso") {
|
|
@@ -1496,25 +1498,25 @@ function xt(t, o = "iso") {
|
|
|
1496
1498
|
let l, s, a;
|
|
1497
1499
|
switch (o) {
|
|
1498
1500
|
case "us": {
|
|
1499
|
-
const
|
|
1500
|
-
if (
|
|
1501
|
+
const c = n.split("/");
|
|
1502
|
+
if (c.length !== 3)
|
|
1501
1503
|
return null;
|
|
1502
|
-
s = Number.parseInt(
|
|
1504
|
+
s = Number.parseInt(c[0], 10), a = Number.parseInt(c[1], 10), l = Number.parseInt(c[2], 10);
|
|
1503
1505
|
break;
|
|
1504
1506
|
}
|
|
1505
1507
|
case "eu": {
|
|
1506
|
-
const
|
|
1507
|
-
if (
|
|
1508
|
+
const c = n.split("/");
|
|
1509
|
+
if (c.length !== 3)
|
|
1508
1510
|
return null;
|
|
1509
|
-
a = Number.parseInt(
|
|
1511
|
+
a = Number.parseInt(c[0], 10), s = Number.parseInt(c[1], 10), l = Number.parseInt(c[2], 10);
|
|
1510
1512
|
break;
|
|
1511
1513
|
}
|
|
1512
1514
|
case "iso":
|
|
1513
1515
|
default: {
|
|
1514
|
-
const
|
|
1515
|
-
if (
|
|
1516
|
+
const c = n.split("-");
|
|
1517
|
+
if (c.length !== 3)
|
|
1516
1518
|
return null;
|
|
1517
|
-
l = Number.parseInt(
|
|
1519
|
+
l = Number.parseInt(c[0], 10), s = Number.parseInt(c[1], 10), a = Number.parseInt(c[2], 10);
|
|
1518
1520
|
break;
|
|
1519
1521
|
}
|
|
1520
1522
|
}
|
|
@@ -1523,8 +1525,8 @@ function xt(t, o = "iso") {
|
|
|
1523
1525
|
const d = new Date(l, s - 1, a);
|
|
1524
1526
|
if (d.getFullYear() !== l || d.getMonth() !== s - 1 || d.getDate() !== a)
|
|
1525
1527
|
return null;
|
|
1526
|
-
const
|
|
1527
|
-
return `${l}-${
|
|
1528
|
+
const v = String(s).padStart(2, "0"), y = String(a).padStart(2, "0");
|
|
1529
|
+
return `${l}-${v}-${y}`;
|
|
1528
1530
|
}
|
|
1529
1531
|
function gn(t = "iso") {
|
|
1530
1532
|
switch (t) {
|
|
@@ -1572,7 +1574,7 @@ function St(t, o, n, l, s) {
|
|
|
1572
1574
|
case "stdDev":
|
|
1573
1575
|
return Mo(t);
|
|
1574
1576
|
case "percentOfTotal": {
|
|
1575
|
-
const a = t.reduce((d,
|
|
1577
|
+
const a = t.reduce((d, v) => d + v, 0);
|
|
1576
1578
|
return n === void 0 || n === 0 ? null : a / n * 100;
|
|
1577
1579
|
}
|
|
1578
1580
|
case "custom":
|
|
@@ -1666,14 +1668,14 @@ function yn(t, o, n) {
|
|
|
1666
1668
|
const l = _n(t);
|
|
1667
1669
|
let s = t;
|
|
1668
1670
|
for (const d of l) {
|
|
1669
|
-
const
|
|
1671
|
+
const v = n.find((F) => F.toLowerCase() === d.toLowerCase()) || d, y = o[v];
|
|
1670
1672
|
if (y == null || y === "")
|
|
1671
1673
|
return null;
|
|
1672
|
-
const
|
|
1673
|
-
if (Number.isNaN(
|
|
1674
|
+
const c = typeof y == "number" ? y : Number.parseFloat(String(y));
|
|
1675
|
+
if (Number.isNaN(c))
|
|
1674
1676
|
return null;
|
|
1675
|
-
const
|
|
1676
|
-
s = s.replace(new RegExp(`\\b${
|
|
1677
|
+
const L = d.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1678
|
+
s = s.replace(new RegExp(`\\b${L}\\b`, "gi"), String(c));
|
|
1677
1679
|
}
|
|
1678
1680
|
if (!/^[\d\s+\-*/().]+$/.test(s))
|
|
1679
1681
|
return null;
|
|
@@ -1698,45 +1700,45 @@ function Tn(t) {
|
|
|
1698
1700
|
return (t.rowFields.length > 0 || t.columnFields.length > 0) && t.valueFields.length > 0;
|
|
1699
1701
|
}
|
|
1700
1702
|
function _o(t, o) {
|
|
1701
|
-
const { rowFields: n, columnFields: l, valueFields: s, showRowTotals: a, showColumnTotals: d, calculatedFields:
|
|
1703
|
+
const { rowFields: n, columnFields: l, valueFields: s, showRowTotals: a, showColumnTotals: d, calculatedFields: v } = o;
|
|
1702
1704
|
if (!Tn(o) || t.length === 0)
|
|
1703
1705
|
return null;
|
|
1704
1706
|
const y = /* @__PURE__ */ new Map();
|
|
1705
|
-
if (
|
|
1706
|
-
for (const J of
|
|
1707
|
+
if (v)
|
|
1708
|
+
for (const J of v)
|
|
1707
1709
|
y.set(J.id, J);
|
|
1708
|
-
const
|
|
1710
|
+
const c = t.length > 0 ? Object.keys(t[0]) : [], L = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Map();
|
|
1709
1711
|
for (const J of t) {
|
|
1710
1712
|
const ne = n.length > 0 ? mn(J, n) : "__all__", z = l.length > 0 ? mn(J, l) : "__all__";
|
|
1711
|
-
|
|
1712
|
-
const S =
|
|
1713
|
+
L.add(ne), F.add(z), C.has(ne) || C.set(ne, /* @__PURE__ */ new Map());
|
|
1714
|
+
const S = C.get(ne);
|
|
1713
1715
|
S.has(z) || S.set(z, s.map(() => []));
|
|
1714
|
-
const
|
|
1716
|
+
const p = S.get(z);
|
|
1715
1717
|
for (let m = 0; m < s.length; m++) {
|
|
1716
|
-
const
|
|
1718
|
+
const N = s[m];
|
|
1717
1719
|
let H = null;
|
|
1718
|
-
if (
|
|
1719
|
-
const se =
|
|
1720
|
-
D && (H = yn(D.formula, J,
|
|
1720
|
+
if (N.field.startsWith("calc:")) {
|
|
1721
|
+
const se = N.field.replace("calc:", ""), D = y.get(se);
|
|
1722
|
+
D && (H = yn(D.formula, J, c));
|
|
1721
1723
|
} else {
|
|
1722
|
-
const se = J[
|
|
1723
|
-
se != null && se !== "" && (H = typeof se == "number" ? se : Number.parseFloat(String(se)), Number.isNaN(H) && (H =
|
|
1724
|
+
const se = J[N.field];
|
|
1725
|
+
se != null && se !== "" && (H = typeof se == "number" ? se : Number.parseFloat(String(se)), Number.isNaN(H) && (H = N.aggregation === "count" || N.aggregation === "countDistinct" ? 1 : null));
|
|
1724
1726
|
}
|
|
1725
|
-
H !== null &&
|
|
1727
|
+
H !== null && p[m].push(H);
|
|
1726
1728
|
}
|
|
1727
1729
|
}
|
|
1728
|
-
const b = Array.from(
|
|
1730
|
+
const b = Array.from(L).sort(), h = Array.from(F).sort(), $ = s.map((J, ne) => {
|
|
1729
1731
|
let z = 0;
|
|
1730
1732
|
for (const S of t) {
|
|
1731
|
-
let
|
|
1733
|
+
let p = null;
|
|
1732
1734
|
if (J.field.startsWith("calc:")) {
|
|
1733
|
-
const m = J.field.replace("calc:", ""),
|
|
1734
|
-
|
|
1735
|
+
const m = J.field.replace("calc:", ""), N = y.get(m);
|
|
1736
|
+
N && (p = yn(N.formula, S, c));
|
|
1735
1737
|
} else {
|
|
1736
1738
|
const m = S[J.field];
|
|
1737
|
-
m != null && m !== "" && (
|
|
1739
|
+
m != null && m !== "" && (p = typeof m == "number" ? m : Number.parseFloat(String(m)), Number.isNaN(p) && (p = null));
|
|
1738
1740
|
}
|
|
1739
|
-
|
|
1741
|
+
p !== null && (z += p);
|
|
1740
1742
|
}
|
|
1741
1743
|
return z;
|
|
1742
1744
|
});
|
|
@@ -1753,9 +1755,9 @@ function _o(t, o) {
|
|
|
1753
1755
|
for (let ne = 0; ne < l.length; ne++) {
|
|
1754
1756
|
const z = [];
|
|
1755
1757
|
for (const S of h) {
|
|
1756
|
-
const
|
|
1758
|
+
const p = fn(S);
|
|
1757
1759
|
for (let m = 0; m < J; m++)
|
|
1758
|
-
z.push(
|
|
1760
|
+
z.push(p[ne] || "");
|
|
1759
1761
|
}
|
|
1760
1762
|
ee.push(z);
|
|
1761
1763
|
}
|
|
@@ -1771,19 +1773,19 @@ function _o(t, o) {
|
|
|
1771
1773
|
for (const J of b) {
|
|
1772
1774
|
const ne = [], z = s.map(() => []);
|
|
1773
1775
|
for (const S of h) {
|
|
1774
|
-
const
|
|
1776
|
+
const p = C.get(J), m = (p == null ? void 0 : p.get(S)) || s.map(() => []);
|
|
1775
1777
|
for (let H = 0; H < m.length; H++)
|
|
1776
1778
|
z[H].push(...m[H]);
|
|
1777
1779
|
G.has(S) || G.set(S, s.map(() => []));
|
|
1778
|
-
const
|
|
1780
|
+
const N = G.get(S);
|
|
1779
1781
|
for (let H = 0; H < m.length; H++)
|
|
1780
|
-
|
|
1782
|
+
N[H].push(...m[H]);
|
|
1781
1783
|
for (let H = 0; H < s.length; H++) {
|
|
1782
1784
|
const se = s[H], D = m[H] || [], R = $[H], I = St(D, se.aggregation, R);
|
|
1783
1785
|
let f;
|
|
1784
1786
|
if (se.field.startsWith("calc:")) {
|
|
1785
|
-
const V = se.field.replace("calc:", ""),
|
|
1786
|
-
f = Ro(I, (
|
|
1787
|
+
const V = se.field.replace("calc:", ""), M = y.get(V);
|
|
1788
|
+
f = Ro(I, (M == null ? void 0 : M.formatAs) || "number", (M == null ? void 0 : M.decimals) ?? 2);
|
|
1787
1789
|
} else
|
|
1788
1790
|
f = Ft(I, se.aggregation);
|
|
1789
1791
|
ne.push({
|
|
@@ -1795,10 +1797,10 @@ function _o(t, o) {
|
|
|
1795
1797
|
}
|
|
1796
1798
|
if (O.push(ne), a && h.length > 1)
|
|
1797
1799
|
if (s.length > 0) {
|
|
1798
|
-
const S = s[0],
|
|
1800
|
+
const S = s[0], p = z[0] || [], m = St(p, S.aggregation, $[0]);
|
|
1799
1801
|
W.push({
|
|
1800
1802
|
value: m,
|
|
1801
|
-
count:
|
|
1803
|
+
count: p.length,
|
|
1802
1804
|
formattedValue: Ft(m, S.aggregation)
|
|
1803
1805
|
});
|
|
1804
1806
|
} else
|
|
@@ -1809,10 +1811,10 @@ function _o(t, o) {
|
|
|
1809
1811
|
for (const J of h) {
|
|
1810
1812
|
const ne = G.get(J) || s.map(() => []);
|
|
1811
1813
|
for (let z = 0; z < s.length; z++) {
|
|
1812
|
-
const S = s[z],
|
|
1814
|
+
const S = s[z], p = ne[z] || [], m = St(p, S.aggregation, $[z]);
|
|
1813
1815
|
X.push({
|
|
1814
1816
|
value: m,
|
|
1815
|
-
count:
|
|
1817
|
+
count: p.length,
|
|
1816
1818
|
formattedValue: Ft(m, S.aggregation)
|
|
1817
1819
|
});
|
|
1818
1820
|
}
|
|
@@ -1820,11 +1822,11 @@ function _o(t, o) {
|
|
|
1820
1822
|
const de = { value: null, count: 0, formattedValue: "-" };
|
|
1821
1823
|
if (a && d && s.length > 0) {
|
|
1822
1824
|
const J = s.map(() => []);
|
|
1823
|
-
for (const
|
|
1824
|
-
const m =
|
|
1825
|
+
for (const p of b) {
|
|
1826
|
+
const m = C.get(p);
|
|
1825
1827
|
if (m)
|
|
1826
|
-
for (const
|
|
1827
|
-
const H = m.get(
|
|
1828
|
+
for (const N of h) {
|
|
1829
|
+
const H = m.get(N);
|
|
1828
1830
|
if (H)
|
|
1829
1831
|
for (let se = 0; se < H.length; se++)
|
|
1830
1832
|
J[se].push(...H[se]);
|
|
@@ -1900,7 +1902,7 @@ function Rt(t) {
|
|
|
1900
1902
|
}
|
|
1901
1903
|
function Vo(t) {
|
|
1902
1904
|
const { config: o, onDataLoaded: n, onConversationUpdate: l, onQueryExecuted: s, onError: a } = t, d = o.persistToLocalStorage ? `tinypivot-ai-conversation-${o.sessionId || "default"}` : null;
|
|
1903
|
-
function
|
|
1905
|
+
function v() {
|
|
1904
1906
|
if (d && typeof window < "u")
|
|
1905
1907
|
try {
|
|
1906
1908
|
const f = localStorage.getItem(d);
|
|
@@ -1917,15 +1919,15 @@ function Vo(t) {
|
|
|
1917
1919
|
function y(f) {
|
|
1918
1920
|
if (d && typeof window < "u")
|
|
1919
1921
|
try {
|
|
1920
|
-
const V = (
|
|
1922
|
+
const V = (M, Q) => typeof Q == "bigint" ? Number(Q) : Q;
|
|
1921
1923
|
localStorage.setItem(d, JSON.stringify(f, V));
|
|
1922
1924
|
} catch (V) {
|
|
1923
1925
|
console.warn("[TinyPivot] Failed to save conversation to localStorage:", V);
|
|
1924
1926
|
}
|
|
1925
1927
|
}
|
|
1926
|
-
const
|
|
1927
|
-
() => ee.value.find((f) => f.id ===
|
|
1928
|
-
), W =
|
|
1928
|
+
const c = _(v()), L = _(/* @__PURE__ */ new Map()), F = _([]), C = _(!1), b = _(null), h = _(null), $ = _([]), re = _(!1), ee = E(() => o.dataSources && o.dataSources.length > 0 ? o.dataSources : $.value), U = E(() => c.value.dataSourceId), O = E(
|
|
1929
|
+
() => ee.value.find((f) => f.id === c.value.dataSourceId)
|
|
1930
|
+
), W = E(() => c.value.messages), G = E(() => c.value.messages.length > 0);
|
|
1929
1931
|
async function X() {
|
|
1930
1932
|
if (o.endpoint) {
|
|
1931
1933
|
re.value = !0;
|
|
@@ -1940,12 +1942,12 @@ function Vo(t) {
|
|
|
1940
1942
|
const V = await f.json();
|
|
1941
1943
|
if (V.error)
|
|
1942
1944
|
throw new Error(V.error);
|
|
1943
|
-
$.value = V.tables.map((
|
|
1944
|
-
id:
|
|
1945
|
-
table:
|
|
1946
|
-
name:
|
|
1945
|
+
$.value = V.tables.map((M) => ({
|
|
1946
|
+
id: M.name,
|
|
1947
|
+
table: M.name,
|
|
1948
|
+
name: M.name.charAt(0).toUpperCase() + M.name.slice(1),
|
|
1947
1949
|
// Capitalize
|
|
1948
|
-
description:
|
|
1950
|
+
description: M.description
|
|
1949
1951
|
})), await de();
|
|
1950
1952
|
} catch (f) {
|
|
1951
1953
|
console.warn("[TinyPivot] Failed to fetch tables:", f), a == null || a({
|
|
@@ -1970,9 +1972,9 @@ function Vo(t) {
|
|
|
1970
1972
|
const V = await f.json();
|
|
1971
1973
|
if (V.error)
|
|
1972
1974
|
throw new Error(V.error);
|
|
1973
|
-
|
|
1974
|
-
for (const
|
|
1975
|
-
|
|
1975
|
+
F.value = V.schemas;
|
|
1976
|
+
for (const M of V.schemas)
|
|
1977
|
+
L.value.set(M.table, M);
|
|
1976
1978
|
} catch (f) {
|
|
1977
1979
|
console.warn("[TinyPivot] Failed to fetch all schemas:", f);
|
|
1978
1980
|
}
|
|
@@ -1986,16 +1988,16 @@ function Vo(t) {
|
|
|
1986
1988
|
b.value = `Data source "${f}" not found`;
|
|
1987
1989
|
return;
|
|
1988
1990
|
}
|
|
1989
|
-
|
|
1990
|
-
const
|
|
1991
|
+
c.value = Ua(c.value, f);
|
|
1992
|
+
const M = Le(
|
|
1991
1993
|
`I'm now connected to **${V.name}**. ${V.description || ""}
|
|
1992
1994
|
|
|
1993
1995
|
What would you like to know about this data?`
|
|
1994
1996
|
);
|
|
1995
|
-
if (
|
|
1997
|
+
if (c.value = De(c.value, M), o.dataSourceLoader)
|
|
1996
1998
|
try {
|
|
1997
1999
|
const { data: Q, schema: le } = await o.dataSourceLoader(f);
|
|
1998
|
-
le &&
|
|
2000
|
+
le && L.value.set(f, le), Q && Q.length > 0 && (h.value = Q, n == null || n({
|
|
1999
2001
|
data: Q,
|
|
2000
2002
|
query: `SELECT * FROM ${V.table} LIMIT 100`,
|
|
2001
2003
|
dataSourceId: f,
|
|
@@ -2006,7 +2008,7 @@ What would you like to know about this data?`
|
|
|
2006
2008
|
}
|
|
2007
2009
|
else if (o.demoMode) {
|
|
2008
2010
|
const Q = Ta(f);
|
|
2009
|
-
Q &&
|
|
2011
|
+
Q && L.value.set(f, Q);
|
|
2010
2012
|
const le = rn(f);
|
|
2011
2013
|
le && (h.value = le, n == null || n({
|
|
2012
2014
|
data: le,
|
|
@@ -2030,10 +2032,10 @@ What would you like to know about this data?`
|
|
|
2030
2032
|
});
|
|
2031
2033
|
if (!V.ok)
|
|
2032
2034
|
throw new Error(`Failed to fetch schema: ${V.statusText}`);
|
|
2033
|
-
const
|
|
2034
|
-
if (
|
|
2035
|
-
throw new Error(
|
|
2036
|
-
|
|
2035
|
+
const M = await V.json();
|
|
2036
|
+
if (M.error)
|
|
2037
|
+
throw new Error(M.error);
|
|
2038
|
+
M.schemas.length > 0 && L.value.set(f.id, M.schemas[0]);
|
|
2037
2039
|
} catch (V) {
|
|
2038
2040
|
console.warn("Failed to fetch schema:", V);
|
|
2039
2041
|
}
|
|
@@ -2041,7 +2043,7 @@ What would you like to know about this data?`
|
|
|
2041
2043
|
async function z(f) {
|
|
2042
2044
|
if (o.endpoint)
|
|
2043
2045
|
try {
|
|
2044
|
-
const V = `SELECT * FROM ${f.table} LIMIT 100`,
|
|
2046
|
+
const V = `SELECT * FROM ${f.table} LIMIT 100`, M = await fetch(o.endpoint, {
|
|
2045
2047
|
method: "POST",
|
|
2046
2048
|
headers: { "Content-Type": "application/json" },
|
|
2047
2049
|
body: JSON.stringify({
|
|
@@ -2050,9 +2052,9 @@ What would you like to know about this data?`
|
|
|
2050
2052
|
table: f.table
|
|
2051
2053
|
})
|
|
2052
2054
|
});
|
|
2053
|
-
if (!
|
|
2054
|
-
throw new Error(`Failed to fetch sample data: ${
|
|
2055
|
-
const Q = await
|
|
2055
|
+
if (!M.ok)
|
|
2056
|
+
throw new Error(`Failed to fetch sample data: ${M.statusText}`);
|
|
2057
|
+
const Q = await M.json();
|
|
2056
2058
|
if (Q.error)
|
|
2057
2059
|
throw new Error(Q.error);
|
|
2058
2060
|
Q.data && Q.data.length > 0 && (h.value = Q.data, n == null || n({
|
|
@@ -2066,24 +2068,24 @@ What would you like to know about this data?`
|
|
|
2066
2068
|
}
|
|
2067
2069
|
}
|
|
2068
2070
|
async function S(f) {
|
|
2069
|
-
if (!f.trim() ||
|
|
2071
|
+
if (!f.trim() || C.value)
|
|
2070
2072
|
return;
|
|
2071
|
-
b.value = null,
|
|
2073
|
+
b.value = null, C.value = !0;
|
|
2072
2074
|
const V = Ia(f);
|
|
2073
|
-
|
|
2075
|
+
c.value = De(c.value, V), I();
|
|
2074
2076
|
try {
|
|
2075
2077
|
if (o.demoMode) {
|
|
2076
|
-
await
|
|
2078
|
+
await p(f);
|
|
2077
2079
|
return;
|
|
2078
2080
|
}
|
|
2079
|
-
if (!
|
|
2081
|
+
if (!c.value.dataSourceId) {
|
|
2080
2082
|
const le = Le(
|
|
2081
2083
|
"Please select a data source first by clicking one of the options above."
|
|
2082
2084
|
);
|
|
2083
|
-
|
|
2085
|
+
c.value = De(c.value, le), I();
|
|
2084
2086
|
return;
|
|
2085
2087
|
}
|
|
2086
|
-
const
|
|
2088
|
+
const M = await m(f), Q = za(M);
|
|
2087
2089
|
if (Q) {
|
|
2088
2090
|
const le = Pa(Q);
|
|
2089
2091
|
if (!le.valid) {
|
|
@@ -2091,55 +2093,55 @@ What would you like to know about this data?`
|
|
|
2091
2093
|
`I generated an invalid query: ${le.error}. Let me try again with a corrected approach.`,
|
|
2092
2094
|
{ error: le.error }
|
|
2093
2095
|
);
|
|
2094
|
-
|
|
2096
|
+
c.value = De(c.value, Y), I();
|
|
2095
2097
|
return;
|
|
2096
2098
|
}
|
|
2097
|
-
const T = Le(
|
|
2098
|
-
|
|
2099
|
+
const T = Le(M, { query: Q });
|
|
2100
|
+
c.value = De(c.value, T), I(), await N(Q, T.id);
|
|
2099
2101
|
} else {
|
|
2100
|
-
const le = Le(
|
|
2101
|
-
|
|
2102
|
+
const le = Le(M);
|
|
2103
|
+
c.value = De(c.value, le), I();
|
|
2102
2104
|
}
|
|
2103
|
-
} catch (
|
|
2104
|
-
const Q =
|
|
2105
|
+
} catch (M) {
|
|
2106
|
+
const Q = M instanceof Error ? M.message : "An error occurred";
|
|
2105
2107
|
b.value = Q;
|
|
2106
2108
|
const le = Le(
|
|
2107
2109
|
`Sorry, I encountered an error: ${Q}. Please try again.`,
|
|
2108
2110
|
{ error: Q }
|
|
2109
2111
|
);
|
|
2110
|
-
|
|
2112
|
+
c.value = De(c.value, le), I(), a == null || a({
|
|
2111
2113
|
message: Q,
|
|
2112
2114
|
type: "ai"
|
|
2113
2115
|
});
|
|
2114
2116
|
} finally {
|
|
2115
|
-
|
|
2117
|
+
C.value = !1;
|
|
2116
2118
|
}
|
|
2117
2119
|
}
|
|
2118
|
-
async function
|
|
2120
|
+
async function p(f) {
|
|
2119
2121
|
var Q;
|
|
2120
2122
|
await new Promise((le) => setTimeout(le, 800));
|
|
2121
|
-
const V =
|
|
2123
|
+
const V = c.value.dataSourceId;
|
|
2122
2124
|
if (!V) {
|
|
2123
2125
|
const le = Le(
|
|
2124
2126
|
"Please select a data source first by clicking one of the options above."
|
|
2125
2127
|
);
|
|
2126
|
-
|
|
2128
|
+
c.value = De(c.value, le), I(), C.value = !1;
|
|
2127
2129
|
return;
|
|
2128
2130
|
}
|
|
2129
|
-
const
|
|
2130
|
-
if (
|
|
2131
|
-
const le = Le(
|
|
2132
|
-
query:
|
|
2133
|
-
rowCount: (Q =
|
|
2131
|
+
const M = Aa(V, f);
|
|
2132
|
+
if (M) {
|
|
2133
|
+
const le = Le(M.response, {
|
|
2134
|
+
query: M.query,
|
|
2135
|
+
rowCount: (Q = M.mockData) == null ? void 0 : Q.length
|
|
2134
2136
|
});
|
|
2135
|
-
|
|
2136
|
-
data:
|
|
2137
|
-
query:
|
|
2137
|
+
c.value = De(c.value, le), I(), M.mockData && (h.value = M.mockData, n == null || n({
|
|
2138
|
+
data: M.mockData,
|
|
2139
|
+
query: M.query || "",
|
|
2138
2140
|
dataSourceId: V,
|
|
2139
|
-
rowCount:
|
|
2141
|
+
rowCount: M.mockData.length
|
|
2140
2142
|
}), s == null || s({
|
|
2141
|
-
query:
|
|
2142
|
-
rowCount:
|
|
2143
|
+
query: M.query || "",
|
|
2144
|
+
rowCount: M.mockData.length,
|
|
2143
2145
|
duration: 150,
|
|
2144
2146
|
// Fake duration
|
|
2145
2147
|
dataSourceId: V,
|
|
@@ -2147,20 +2149,20 @@ What would you like to know about this data?`
|
|
|
2147
2149
|
}));
|
|
2148
2150
|
} else {
|
|
2149
2151
|
const le = _a(V), T = Le(le);
|
|
2150
|
-
|
|
2152
|
+
c.value = De(c.value, T), I();
|
|
2151
2153
|
}
|
|
2152
|
-
|
|
2154
|
+
C.value = !1;
|
|
2153
2155
|
}
|
|
2154
2156
|
async function m(f) {
|
|
2155
2157
|
if (!o.endpoint)
|
|
2156
2158
|
throw new Error("No endpoint configured. Set `endpoint` in AI analyst config.");
|
|
2157
|
-
const V =
|
|
2159
|
+
const V = c.value.dataSourceId, M = Ea(
|
|
2158
2160
|
ee.value,
|
|
2159
|
-
|
|
2161
|
+
L.value,
|
|
2160
2162
|
V,
|
|
2161
|
-
|
|
2162
|
-
), Q = Ha(
|
|
2163
|
-
{ role: "user", content:
|
|
2163
|
+
F.value.length > 0 ? F.value : void 0
|
|
2164
|
+
), Q = Ha(c.value), le = [
|
|
2165
|
+
{ role: "user", content: M },
|
|
2164
2166
|
{ role: "assistant", content: "I understand. I'm ready to help you analyze the data." },
|
|
2165
2167
|
...Q.slice(0, -1),
|
|
2166
2168
|
// Exclude the just-added user message
|
|
@@ -2177,24 +2179,24 @@ What would you like to know about this data?`
|
|
|
2177
2179
|
throw new Error(Y.error);
|
|
2178
2180
|
return Y.content;
|
|
2179
2181
|
}
|
|
2180
|
-
async function
|
|
2181
|
-
const
|
|
2182
|
-
if (!
|
|
2182
|
+
async function N(f, V) {
|
|
2183
|
+
const M = c.value.dataSourceId;
|
|
2184
|
+
if (!M)
|
|
2183
2185
|
return;
|
|
2184
|
-
const Q = ee.value.find((T) => T.id ===
|
|
2186
|
+
const Q = ee.value.find((T) => T.id === M);
|
|
2185
2187
|
if (!Q)
|
|
2186
2188
|
return;
|
|
2187
2189
|
const le = Date.now();
|
|
2188
2190
|
try {
|
|
2189
2191
|
let T;
|
|
2190
2192
|
if (o.queryExecutor) {
|
|
2191
|
-
const
|
|
2193
|
+
const x = await o.queryExecutor(f, Q.table);
|
|
2192
2194
|
T = {
|
|
2193
|
-
data:
|
|
2194
|
-
rowCount:
|
|
2195
|
-
truncated:
|
|
2196
|
-
error:
|
|
2197
|
-
success: !
|
|
2195
|
+
data: x.data,
|
|
2196
|
+
rowCount: x.rowCount,
|
|
2197
|
+
truncated: x.truncated,
|
|
2198
|
+
error: x.error,
|
|
2199
|
+
success: !x.error
|
|
2198
2200
|
};
|
|
2199
2201
|
} else if (o.endpoint)
|
|
2200
2202
|
T = await (await fetch(o.endpoint, {
|
|
@@ -2210,15 +2212,15 @@ What would you like to know about this data?`
|
|
|
2210
2212
|
throw new Error("No query executor or endpoint configured");
|
|
2211
2213
|
const Y = Date.now() - le;
|
|
2212
2214
|
if (!T.success || T.error) {
|
|
2213
|
-
const
|
|
2215
|
+
const x = Le(
|
|
2214
2216
|
`The query failed: ${T.error || "Unknown error"}. Would you like me to try a different approach?`,
|
|
2215
2217
|
{ error: T.error, query: f }
|
|
2216
2218
|
);
|
|
2217
|
-
|
|
2219
|
+
c.value = De(c.value, x), I(), s == null || s({
|
|
2218
2220
|
query: f,
|
|
2219
2221
|
rowCount: 0,
|
|
2220
2222
|
duration: Y,
|
|
2221
|
-
dataSourceId:
|
|
2223
|
+
dataSourceId: M,
|
|
2222
2224
|
success: !1,
|
|
2223
2225
|
error: T.error
|
|
2224
2226
|
}), a == null || a({
|
|
@@ -2230,7 +2232,7 @@ What would you like to know about this data?`
|
|
|
2230
2232
|
}
|
|
2231
2233
|
if (T.data) {
|
|
2232
2234
|
if (h.value = T.data, V) {
|
|
2233
|
-
const
|
|
2235
|
+
const x = c.value.messages.map((pe) => pe.id === V ? {
|
|
2234
2236
|
...pe,
|
|
2235
2237
|
metadata: {
|
|
2236
2238
|
...pe.metadata,
|
|
@@ -2239,65 +2241,65 @@ What would you like to know about this data?`
|
|
|
2239
2241
|
truncated: T.truncated
|
|
2240
2242
|
}
|
|
2241
2243
|
} : pe);
|
|
2242
|
-
|
|
2243
|
-
...
|
|
2244
|
-
messages:
|
|
2244
|
+
c.value = {
|
|
2245
|
+
...c.value,
|
|
2246
|
+
messages: x,
|
|
2245
2247
|
updatedAt: Date.now()
|
|
2246
2248
|
};
|
|
2247
2249
|
} else {
|
|
2248
|
-
const
|
|
2249
|
-
`Retrieved **${T.rowCount} rows**${
|
|
2250
|
+
const x = T.truncated ? ` (limited to ${o.maxRows || 1e4} rows)` : "", pe = Le(
|
|
2251
|
+
`Retrieved **${T.rowCount} rows**${x}.`,
|
|
2250
2252
|
{ query: f, rowCount: T.rowCount, data: T.data }
|
|
2251
2253
|
);
|
|
2252
|
-
|
|
2254
|
+
c.value = De(c.value, pe);
|
|
2253
2255
|
}
|
|
2254
2256
|
I(), n == null || n({
|
|
2255
2257
|
data: T.data,
|
|
2256
2258
|
query: f,
|
|
2257
|
-
dataSourceId:
|
|
2259
|
+
dataSourceId: M,
|
|
2258
2260
|
rowCount: T.rowCount || T.data.length
|
|
2259
2261
|
}), s == null || s({
|
|
2260
2262
|
query: f,
|
|
2261
2263
|
rowCount: T.rowCount || T.data.length,
|
|
2262
2264
|
duration: Y,
|
|
2263
|
-
dataSourceId:
|
|
2265
|
+
dataSourceId: M,
|
|
2264
2266
|
success: !0
|
|
2265
2267
|
});
|
|
2266
2268
|
}
|
|
2267
2269
|
} catch (T) {
|
|
2268
|
-
const Y = Date.now() - le,
|
|
2269
|
-
`Failed to execute query: ${
|
|
2270
|
-
{ error:
|
|
2270
|
+
const Y = Date.now() - le, x = T instanceof Error ? T.message : "Query execution failed", pe = Le(
|
|
2271
|
+
`Failed to execute query: ${x}`,
|
|
2272
|
+
{ error: x, query: f }
|
|
2271
2273
|
);
|
|
2272
|
-
|
|
2274
|
+
c.value = De(c.value, pe), I(), s == null || s({
|
|
2273
2275
|
query: f,
|
|
2274
2276
|
rowCount: 0,
|
|
2275
2277
|
duration: Y,
|
|
2276
|
-
dataSourceId:
|
|
2278
|
+
dataSourceId: M,
|
|
2277
2279
|
success: !1,
|
|
2278
|
-
error:
|
|
2280
|
+
error: x
|
|
2279
2281
|
}), a == null || a({
|
|
2280
|
-
message:
|
|
2282
|
+
message: x,
|
|
2281
2283
|
query: f,
|
|
2282
2284
|
type: "network"
|
|
2283
2285
|
});
|
|
2284
2286
|
}
|
|
2285
2287
|
}
|
|
2286
2288
|
async function H() {
|
|
2287
|
-
const f =
|
|
2289
|
+
const f = c.value.dataSourceId;
|
|
2288
2290
|
if (!f)
|
|
2289
2291
|
return null;
|
|
2290
|
-
const V = ee.value.find((
|
|
2292
|
+
const V = ee.value.find((M) => M.id === f);
|
|
2291
2293
|
if (!V)
|
|
2292
2294
|
return null;
|
|
2293
2295
|
if (o.dataSourceLoader) {
|
|
2294
2296
|
try {
|
|
2295
|
-
const { data:
|
|
2296
|
-
if (
|
|
2297
|
-
return
|
|
2298
|
-
} catch (
|
|
2299
|
-
console.warn("Failed to load full data:",
|
|
2300
|
-
message:
|
|
2297
|
+
const { data: M } = await o.dataSourceLoader(f);
|
|
2298
|
+
if (M && M.length > 0)
|
|
2299
|
+
return M;
|
|
2300
|
+
} catch (M) {
|
|
2301
|
+
console.warn("Failed to load full data:", M), a == null || a({
|
|
2302
|
+
message: M instanceof Error ? M.message : "Failed to load full data",
|
|
2301
2303
|
type: "network"
|
|
2302
2304
|
});
|
|
2303
2305
|
}
|
|
@@ -2305,15 +2307,15 @@ What would you like to know about this data?`
|
|
|
2305
2307
|
}
|
|
2306
2308
|
if (o.queryExecutor) {
|
|
2307
2309
|
try {
|
|
2308
|
-
const
|
|
2310
|
+
const M = await o.queryExecutor(
|
|
2309
2311
|
`SELECT * FROM ${V.table}`,
|
|
2310
2312
|
V.table
|
|
2311
2313
|
);
|
|
2312
|
-
if (
|
|
2313
|
-
return
|
|
2314
|
-
} catch (
|
|
2315
|
-
console.warn("Failed to load full data via query:",
|
|
2316
|
-
message:
|
|
2314
|
+
if (M.data && M.data.length > 0)
|
|
2315
|
+
return M.data;
|
|
2316
|
+
} catch (M) {
|
|
2317
|
+
console.warn("Failed to load full data via query:", M), a == null || a({
|
|
2318
|
+
message: M instanceof Error ? M.message : "Failed to load full data",
|
|
2317
2319
|
type: "network"
|
|
2318
2320
|
});
|
|
2319
2321
|
}
|
|
@@ -2321,7 +2323,7 @@ What would you like to know about this data?`
|
|
|
2321
2323
|
}
|
|
2322
2324
|
if (o.endpoint) {
|
|
2323
2325
|
try {
|
|
2324
|
-
const
|
|
2326
|
+
const M = await fetch(o.endpoint, {
|
|
2325
2327
|
method: "POST",
|
|
2326
2328
|
headers: { "Content-Type": "application/json" },
|
|
2327
2329
|
body: JSON.stringify({
|
|
@@ -2330,14 +2332,14 @@ What would you like to know about this data?`
|
|
|
2330
2332
|
table: V.table
|
|
2331
2333
|
})
|
|
2332
2334
|
});
|
|
2333
|
-
if (!
|
|
2334
|
-
throw new Error(`Failed to load data: ${
|
|
2335
|
-
const Q = await
|
|
2335
|
+
if (!M.ok)
|
|
2336
|
+
throw new Error(`Failed to load data: ${M.statusText}`);
|
|
2337
|
+
const Q = await M.json();
|
|
2336
2338
|
if (Q.data && Q.data.length > 0)
|
|
2337
2339
|
return Q.data;
|
|
2338
|
-
} catch (
|
|
2339
|
-
console.warn("Failed to load full data from endpoint:",
|
|
2340
|
-
message:
|
|
2340
|
+
} catch (M) {
|
|
2341
|
+
console.warn("Failed to load full data from endpoint:", M), a == null || a({
|
|
2342
|
+
message: M instanceof Error ? M.message : "Failed to load full data",
|
|
2341
2343
|
type: "network"
|
|
2342
2344
|
});
|
|
2343
2345
|
}
|
|
@@ -2346,24 +2348,24 @@ What would you like to know about this data?`
|
|
|
2346
2348
|
return o.demoMode && rn(f) || null;
|
|
2347
2349
|
}
|
|
2348
2350
|
function se() {
|
|
2349
|
-
|
|
2351
|
+
c.value = un(o.sessionId), b.value = null, h.value = null, I();
|
|
2350
2352
|
}
|
|
2351
2353
|
function D() {
|
|
2352
|
-
return { ...
|
|
2354
|
+
return { ...c.value };
|
|
2353
2355
|
}
|
|
2354
2356
|
function R(f) {
|
|
2355
|
-
|
|
2357
|
+
c.value = f, I();
|
|
2356
2358
|
}
|
|
2357
2359
|
function I() {
|
|
2358
|
-
y(
|
|
2360
|
+
y(c.value), l == null || l({ conversation: c.value });
|
|
2359
2361
|
}
|
|
2360
2362
|
return {
|
|
2361
2363
|
// State
|
|
2362
|
-
conversation:
|
|
2364
|
+
conversation: c,
|
|
2363
2365
|
messages: W,
|
|
2364
2366
|
hasMessages: G,
|
|
2365
|
-
schemas:
|
|
2366
|
-
isLoading:
|
|
2367
|
+
schemas: L,
|
|
2368
|
+
isLoading: C,
|
|
2367
2369
|
isLoadingTables: re,
|
|
2368
2370
|
error: b,
|
|
2369
2371
|
lastLoadedData: h,
|
|
@@ -2451,12 +2453,12 @@ const Oo = {
|
|
|
2451
2453
|
const l = t, s = n, {
|
|
2452
2454
|
messages: a,
|
|
2453
2455
|
hasMessages: d,
|
|
2454
|
-
isLoading:
|
|
2456
|
+
isLoading: v,
|
|
2455
2457
|
isLoadingTables: y,
|
|
2456
|
-
schemas:
|
|
2457
|
-
selectedDataSource:
|
|
2458
|
-
selectedDataSourceInfo:
|
|
2459
|
-
lastLoadedData:
|
|
2458
|
+
schemas: c,
|
|
2459
|
+
selectedDataSource: L,
|
|
2460
|
+
selectedDataSourceInfo: F,
|
|
2461
|
+
lastLoadedData: C,
|
|
2460
2462
|
dataSources: b,
|
|
2461
2463
|
selectDataSource: h,
|
|
2462
2464
|
sendMessage: $,
|
|
@@ -2471,45 +2473,45 @@ const Oo = {
|
|
|
2471
2473
|
});
|
|
2472
2474
|
o({
|
|
2473
2475
|
loadFullData: ee,
|
|
2474
|
-
selectedDataSource:
|
|
2476
|
+
selectedDataSource: L
|
|
2475
2477
|
});
|
|
2476
|
-
const U = _(""), O = _(""), W = _(), G = _(null), X = _(!1), de =
|
|
2478
|
+
const U = _(""), O = _(""), W = _(), G = _(null), X = _(!1), de = E(() => {
|
|
2477
2479
|
if (!O.value.trim())
|
|
2478
2480
|
return b.value;
|
|
2479
2481
|
const Y = O.value.toLowerCase();
|
|
2480
2482
|
return b.value.filter(
|
|
2481
|
-
(
|
|
2483
|
+
(x) => {
|
|
2482
2484
|
var pe;
|
|
2483
|
-
return
|
|
2485
|
+
return x.name.toLowerCase().includes(Y) || ((pe = x.description) == null ? void 0 : pe.toLowerCase().includes(Y)) || x.table.toLowerCase().includes(Y);
|
|
2484
2486
|
}
|
|
2485
2487
|
);
|
|
2486
|
-
}), J =
|
|
2487
|
-
if (
|
|
2488
|
-
return
|
|
2489
|
-
}), ne =
|
|
2488
|
+
}), J = E(() => {
|
|
2489
|
+
if (L.value)
|
|
2490
|
+
return c.value.get(L.value);
|
|
2491
|
+
}), ne = E(() => {
|
|
2490
2492
|
var Y;
|
|
2491
2493
|
if (G.value) {
|
|
2492
|
-
const
|
|
2493
|
-
if ((Y =
|
|
2494
|
-
return
|
|
2494
|
+
const x = a.value.find((pe) => pe.id === G.value);
|
|
2495
|
+
if ((Y = x == null ? void 0 : x.metadata) != null && Y.data)
|
|
2496
|
+
return x.metadata.data.slice(0, 100);
|
|
2495
2497
|
}
|
|
2496
|
-
return
|
|
2497
|
-
}), z =
|
|
2498
|
+
return C.value ? C.value.slice(0, 100) : [];
|
|
2499
|
+
}), z = E(() => {
|
|
2498
2500
|
var Y;
|
|
2499
2501
|
if (G.value) {
|
|
2500
|
-
const
|
|
2501
|
-
if ((Y =
|
|
2502
|
-
return
|
|
2502
|
+
const x = a.value.find((pe) => pe.id === G.value);
|
|
2503
|
+
if ((Y = x == null ? void 0 : x.metadata) != null && Y.data)
|
|
2504
|
+
return x.metadata.data;
|
|
2503
2505
|
}
|
|
2504
|
-
return
|
|
2505
|
-
}), S =
|
|
2506
|
-
var Y,
|
|
2506
|
+
return C.value || [];
|
|
2507
|
+
}), S = E(() => ne.value.length > 0 ? Object.keys(ne.value[0]) : J.value ? J.value.columns.map((Y) => Y.name) : []), p = E(() => {
|
|
2508
|
+
var Y, x, pe;
|
|
2507
2509
|
if (G.value) {
|
|
2508
2510
|
const ke = a.value.find((ie) => ie.id === G.value);
|
|
2509
2511
|
return ((Y = ke == null ? void 0 : ke.metadata) == null ? void 0 : Y.query) || "";
|
|
2510
2512
|
}
|
|
2511
2513
|
for (let ke = a.value.length - 1; ke >= 0; ke--)
|
|
2512
|
-
if ((
|
|
2514
|
+
if ((x = a.value[ke].metadata) != null && x.data)
|
|
2513
2515
|
return ((pe = a.value[ke].metadata) == null ? void 0 : pe.query) || "";
|
|
2514
2516
|
return "";
|
|
2515
2517
|
});
|
|
@@ -2517,32 +2519,32 @@ const Oo = {
|
|
|
2517
2519
|
mt(() => {
|
|
2518
2520
|
W.value && (W.value.scrollTop = W.value.scrollHeight);
|
|
2519
2521
|
});
|
|
2520
|
-
const Y = [...a.value].reverse().find((
|
|
2522
|
+
const Y = [...a.value].reverse().find((x) => {
|
|
2521
2523
|
var pe;
|
|
2522
|
-
return (pe =
|
|
2524
|
+
return (pe = x.metadata) == null ? void 0 : pe.data;
|
|
2523
2525
|
});
|
|
2524
2526
|
Y && (G.value = Y.id);
|
|
2525
2527
|
}, { deep: !0 });
|
|
2526
2528
|
function m() {
|
|
2527
|
-
!U.value.trim() ||
|
|
2529
|
+
!U.value.trim() || v.value || ($(U.value), U.value = "");
|
|
2528
2530
|
}
|
|
2529
|
-
function
|
|
2531
|
+
function N(Y) {
|
|
2530
2532
|
Y.key === "Enter" && !Y.shiftKey && (Y.preventDefault(), m());
|
|
2531
2533
|
}
|
|
2532
2534
|
function H() {
|
|
2533
|
-
z.value.length > 0 && s("viewResults", { data: z.value, query:
|
|
2535
|
+
z.value.length > 0 && s("viewResults", { data: z.value, query: p.value });
|
|
2534
2536
|
}
|
|
2535
2537
|
function se(Y) {
|
|
2536
2538
|
var pe;
|
|
2537
|
-
const
|
|
2538
|
-
(pe =
|
|
2539
|
+
const x = a.value.find((ke) => ke.id === Y);
|
|
2540
|
+
(pe = x == null ? void 0 : x.metadata) != null && pe.data && (G.value = Y);
|
|
2539
2541
|
}
|
|
2540
2542
|
function D() {
|
|
2541
2543
|
X.value = !X.value;
|
|
2542
2544
|
}
|
|
2543
2545
|
function R(Y) {
|
|
2544
|
-
var
|
|
2545
|
-
typeof window < "u" && ((
|
|
2546
|
+
var x;
|
|
2547
|
+
typeof window < "u" && ((x = window.navigator) != null && x.clipboard) && window.navigator.clipboard.writeText(Y);
|
|
2546
2548
|
}
|
|
2547
2549
|
function I() {
|
|
2548
2550
|
re(), O.value = "", G.value = null, X.value = !1;
|
|
@@ -2551,36 +2553,36 @@ const Oo = {
|
|
|
2551
2553
|
re(), O.value = "", G.value = null, X.value = !1;
|
|
2552
2554
|
}
|
|
2553
2555
|
function V(Y) {
|
|
2554
|
-
const
|
|
2555
|
-
return
|
|
2556
|
+
const x = Y.toLowerCase();
|
|
2557
|
+
return x.includes("int") || x.includes("float") || x.includes("decimal") || x.includes("number") ? "#" : x.includes("date") || x.includes("time") ? "D" : x.includes("bool") ? "?" : "T";
|
|
2556
2558
|
}
|
|
2557
|
-
function
|
|
2559
|
+
function M(Y) {
|
|
2558
2560
|
return Y == null ? "" : typeof Y == "number" && Math.abs(Y) >= 1e3 ? Y.toLocaleString("en-US", { maximumFractionDigits: 2 }) : String(Y);
|
|
2559
2561
|
}
|
|
2560
2562
|
function Q(Y) {
|
|
2561
2563
|
return Ba(Y.content).replace(/\*\*/g, "").replace(/`([^`]+)`/g, "$1").trim();
|
|
2562
2564
|
}
|
|
2563
2565
|
function le(Y) {
|
|
2564
|
-
const
|
|
2565
|
-
|
|
2566
|
+
const x = Y.target;
|
|
2567
|
+
x.style.height = "auto", x.style.height = `${Math.min(x.scrollHeight, 120)}px`;
|
|
2566
2568
|
}
|
|
2567
2569
|
function T(Y) {
|
|
2568
|
-
var
|
|
2569
|
-
return !!((
|
|
2570
|
+
var x;
|
|
2571
|
+
return !!((x = Y.metadata) != null && x.data) && Y.metadata.data.length > 0;
|
|
2570
2572
|
}
|
|
2571
|
-
return (Y,
|
|
2573
|
+
return (Y, x) => {
|
|
2572
2574
|
var pe, ke;
|
|
2573
2575
|
return i(), u("div", {
|
|
2574
2576
|
class: ue(["vpg-ai-analyst", { "vpg-theme-dark": t.theme === "dark" }])
|
|
2575
2577
|
}, [
|
|
2576
|
-
A(
|
|
2578
|
+
A(L) ? (i(), u("div", Yo, [
|
|
2577
2579
|
e("div", Go, [
|
|
2578
2580
|
e("div", Ko, [
|
|
2579
2581
|
e("button", {
|
|
2580
2582
|
class: "vpg-ai-back-btn",
|
|
2581
2583
|
title: "Change data source",
|
|
2582
2584
|
onClick: f
|
|
2583
|
-
}, [...
|
|
2585
|
+
}, [...x[13] || (x[13] = [
|
|
2584
2586
|
e("svg", {
|
|
2585
2587
|
viewBox: "0 0 24 24",
|
|
2586
2588
|
fill: "none",
|
|
@@ -2591,14 +2593,14 @@ const Oo = {
|
|
|
2591
2593
|
], -1)
|
|
2592
2594
|
])]),
|
|
2593
2595
|
e("div", Jo, [
|
|
2594
|
-
e("span", Qo,
|
|
2596
|
+
e("span", Qo, k((pe = A(F)) == null ? void 0 : pe.name), 1)
|
|
2595
2597
|
]),
|
|
2596
2598
|
A(d) ? (i(), u("button", {
|
|
2597
2599
|
key: 0,
|
|
2598
2600
|
class: "vpg-ai-clear-btn",
|
|
2599
2601
|
title: "Clear conversation",
|
|
2600
2602
|
onClick: I
|
|
2601
|
-
}, [...
|
|
2603
|
+
}, [...x[14] || (x[14] = [
|
|
2602
2604
|
e("svg", {
|
|
2603
2605
|
viewBox: "0 0 24 24",
|
|
2604
2606
|
fill: "none",
|
|
@@ -2616,16 +2618,16 @@ const Oo = {
|
|
|
2616
2618
|
class: "vpg-ai-messages"
|
|
2617
2619
|
}, [
|
|
2618
2620
|
A(d) ? P("", !0) : (i(), u("div", Xo, [
|
|
2619
|
-
|
|
2621
|
+
x[15] || (x[15] = e("p", null, "Ask questions about your data", -1)),
|
|
2620
2622
|
e("div", Zo, [
|
|
2621
2623
|
e("button", {
|
|
2622
|
-
onClick:
|
|
2624
|
+
onClick: x[1] || (x[1] = (ie) => A($)("Show me a summary of the data"))
|
|
2623
2625
|
}, " Summary "),
|
|
2624
2626
|
e("button", {
|
|
2625
|
-
onClick:
|
|
2627
|
+
onClick: x[2] || (x[2] = (ie) => A($)("Show me the top 10 records"))
|
|
2626
2628
|
}, " Top 10 "),
|
|
2627
2629
|
e("button", {
|
|
2628
|
-
onClick:
|
|
2630
|
+
onClick: x[3] || (x[3] = (ie) => A($)("What are the trends?"))
|
|
2629
2631
|
}, " Trends ")
|
|
2630
2632
|
])
|
|
2631
2633
|
])),
|
|
@@ -2635,7 +2637,7 @@ const Oo = {
|
|
|
2635
2637
|
key: ie.id
|
|
2636
2638
|
}, [
|
|
2637
2639
|
ie.role === "user" ? (i(), u("div", es, [
|
|
2638
|
-
e("span", null,
|
|
2640
|
+
e("span", null, k(ie.content), 1)
|
|
2639
2641
|
])) : T(ie) ? (i(), u("div", {
|
|
2640
2642
|
key: 1,
|
|
2641
2643
|
class: ue(["vpg-ai-msg vpg-ai-msg-result", { "vpg-ai-msg-selected": G.value === ie.id }]),
|
|
@@ -2643,7 +2645,7 @@ const Oo = {
|
|
|
2643
2645
|
}, [
|
|
2644
2646
|
e("div", ns, [
|
|
2645
2647
|
e("div", as, [
|
|
2646
|
-
|
|
2648
|
+
x[16] || (x[16] = e("svg", {
|
|
2647
2649
|
viewBox: "0 0 24 24",
|
|
2648
2650
|
fill: "none",
|
|
2649
2651
|
stroke: "currentColor",
|
|
@@ -2652,14 +2654,14 @@ const Oo = {
|
|
|
2652
2654
|
e("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
2653
2655
|
e("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
2654
2656
|
], -1)),
|
|
2655
|
-
e("span", null,
|
|
2657
|
+
e("span", null, k((Te = (ze = ie.metadata) == null ? void 0 : ze.rowCount) == null ? void 0 : Te.toLocaleString()) + " rows", 1)
|
|
2656
2658
|
]),
|
|
2657
2659
|
(Pe = ie.metadata) != null && Pe.query ? (i(), u("button", {
|
|
2658
2660
|
key: 0,
|
|
2659
2661
|
class: ue(["vpg-ai-sql-toggle", { "vpg-ai-sql-expanded": X.value && G.value === ie.id }]),
|
|
2660
2662
|
title: "View SQL query",
|
|
2661
|
-
onClick:
|
|
2662
|
-
}, [...
|
|
2663
|
+
onClick: x[4] || (x[4] = He((Ge) => D(), ["stop"]))
|
|
2664
|
+
}, [...x[17] || (x[17] = [
|
|
2663
2665
|
e("svg", {
|
|
2664
2666
|
viewBox: "0 0 24 24",
|
|
2665
2667
|
fill: "none",
|
|
@@ -2672,10 +2674,10 @@ const Oo = {
|
|
|
2672
2674
|
e("span", null, "SQL", -1)
|
|
2673
2675
|
])], 2)) : P("", !0)
|
|
2674
2676
|
]),
|
|
2675
|
-
e("div", os,
|
|
2677
|
+
e("div", os, k(Q(ie)), 1)
|
|
2676
2678
|
], 10, ts)) : ie.role === "assistant" ? (i(), u("div", ss, [
|
|
2677
|
-
e("div", ls,
|
|
2678
|
-
(Be = ie.metadata) != null && Be.error ? (i(), u("div", rs, [...
|
|
2679
|
+
e("div", ls, k(Q(ie)), 1),
|
|
2680
|
+
(Be = ie.metadata) != null && Be.error ? (i(), u("div", rs, [...x[18] || (x[18] = [
|
|
2679
2681
|
e("svg", {
|
|
2680
2682
|
viewBox: "0 0 24 24",
|
|
2681
2683
|
fill: "none",
|
|
@@ -2705,7 +2707,7 @@ const Oo = {
|
|
|
2705
2707
|
])) : P("", !0)
|
|
2706
2708
|
], 64);
|
|
2707
2709
|
}), 128)),
|
|
2708
|
-
A(
|
|
2710
|
+
A(v) ? (i(), u("div", is, [...x[19] || (x[19] = [
|
|
2709
2711
|
e("div", { class: "vpg-ai-typing" }, [
|
|
2710
2712
|
e("span"),
|
|
2711
2713
|
e("span"),
|
|
@@ -2719,12 +2721,12 @@ const Oo = {
|
|
|
2719
2721
|
onSubmit: He(m, ["prevent"])
|
|
2720
2722
|
}, [
|
|
2721
2723
|
Oe(e("textarea", {
|
|
2722
|
-
"onUpdate:modelValue":
|
|
2724
|
+
"onUpdate:modelValue": x[5] || (x[5] = (ie) => U.value = ie),
|
|
2723
2725
|
class: "vpg-ai-input",
|
|
2724
2726
|
placeholder: "Ask about your data...",
|
|
2725
|
-
disabled: A(
|
|
2727
|
+
disabled: A(v),
|
|
2726
2728
|
rows: "1",
|
|
2727
|
-
onKeydown:
|
|
2729
|
+
onKeydown: N,
|
|
2728
2730
|
onInput: le
|
|
2729
2731
|
}, null, 40, cs), [
|
|
2730
2732
|
[Ye, U.value]
|
|
@@ -2732,9 +2734,9 @@ const Oo = {
|
|
|
2732
2734
|
e("button", {
|
|
2733
2735
|
type: "submit",
|
|
2734
2736
|
class: "vpg-ai-send-btn",
|
|
2735
|
-
disabled: !U.value.trim() || A(
|
|
2737
|
+
disabled: !U.value.trim() || A(v),
|
|
2736
2738
|
title: "Send"
|
|
2737
|
-
}, [...
|
|
2739
|
+
}, [...x[20] || (x[20] = [
|
|
2738
2740
|
e("svg", {
|
|
2739
2741
|
viewBox: "0 0 24 24",
|
|
2740
2742
|
fill: "none",
|
|
@@ -2752,14 +2754,14 @@ const Oo = {
|
|
|
2752
2754
|
])], 8, ds)
|
|
2753
2755
|
], 32),
|
|
2754
2756
|
e("div", vs, [
|
|
2755
|
-
t.config.aiModelName ? (i(), u("span", ps,
|
|
2757
|
+
t.config.aiModelName ? (i(), u("span", ps, k(t.config.aiModelName), 1)) : P("", !0),
|
|
2756
2758
|
e("div", gs, [
|
|
2757
2759
|
z.value.length > 0 ? (i(), u("button", {
|
|
2758
2760
|
key: 0,
|
|
2759
2761
|
class: "vpg-ai-action-btn vpg-ai-action-primary",
|
|
2760
2762
|
title: "View in Grid tab",
|
|
2761
2763
|
onClick: H
|
|
2762
|
-
}, [...
|
|
2764
|
+
}, [...x[21] || (x[21] = [
|
|
2763
2765
|
e("svg", {
|
|
2764
2766
|
viewBox: "0 0 24 24",
|
|
2765
2767
|
fill: "none",
|
|
@@ -2777,15 +2779,15 @@ const Oo = {
|
|
|
2777
2779
|
e("div", ms, [
|
|
2778
2780
|
e("div", fs, [
|
|
2779
2781
|
e("div", hs, [
|
|
2780
|
-
e("h3", null,
|
|
2782
|
+
e("h3", null, k((ke = A(F)) == null ? void 0 : ke.name), 1),
|
|
2781
2783
|
e("div", ys, [
|
|
2782
|
-
z.value.length > 0 ? (i(), u("span", bs,
|
|
2783
|
-
|
|
2784
|
+
z.value.length > 0 ? (i(), u("span", bs, k(z.value.length.toLocaleString()) + " rows ", 1)) : P("", !0),
|
|
2785
|
+
p.value ? (i(), u("button", {
|
|
2784
2786
|
key: 1,
|
|
2785
2787
|
class: ue(["vpg-ai-preview-sql-btn", { "vpg-ai-sql-active": X.value }]),
|
|
2786
2788
|
title: "Toggle SQL query",
|
|
2787
|
-
onClick:
|
|
2788
|
-
}, [...
|
|
2789
|
+
onClick: x[6] || (x[6] = (ie) => D())
|
|
2790
|
+
}, [...x[22] || (x[22] = [
|
|
2789
2791
|
e("svg", {
|
|
2790
2792
|
viewBox: "0 0 24 24",
|
|
2791
2793
|
fill: "none",
|
|
@@ -2802,7 +2804,7 @@ const Oo = {
|
|
|
2802
2804
|
class: "vpg-ai-preview-view-btn",
|
|
2803
2805
|
title: "View in Grid",
|
|
2804
2806
|
onClick: H
|
|
2805
|
-
}, [...
|
|
2807
|
+
}, [...x[23] || (x[23] = [
|
|
2806
2808
|
e("svg", {
|
|
2807
2809
|
viewBox: "0 0 24 24",
|
|
2808
2810
|
fill: "none",
|
|
@@ -2840,20 +2842,20 @@ const Oo = {
|
|
|
2840
2842
|
class: "vpg-ai-schema-chip",
|
|
2841
2843
|
title: `${ie.name} (${ie.type})`
|
|
2842
2844
|
}, [
|
|
2843
|
-
e("span", ks,
|
|
2844
|
-
e("span", xs,
|
|
2845
|
+
e("span", ks, k(V(ie.type)), 1),
|
|
2846
|
+
e("span", xs, k(ie.name), 1)
|
|
2845
2847
|
], 8, Cs))), 128))
|
|
2846
2848
|
])) : P("", !0)
|
|
2847
2849
|
]),
|
|
2848
|
-
X.value &&
|
|
2850
|
+
X.value && p.value ? (i(), u("div", Ss, [
|
|
2849
2851
|
e("div", Fs, [
|
|
2850
|
-
|
|
2852
|
+
x[26] || (x[26] = e("span", { class: "vpg-ai-sql-panel-title" }, "SQL Query", -1)),
|
|
2851
2853
|
e("div", Ms, [
|
|
2852
2854
|
e("button", {
|
|
2853
2855
|
class: "vpg-ai-copy-btn",
|
|
2854
2856
|
title: "Copy SQL",
|
|
2855
|
-
onClick:
|
|
2856
|
-
}, [...
|
|
2857
|
+
onClick: x[7] || (x[7] = (ie) => R(p.value))
|
|
2858
|
+
}, [...x[24] || (x[24] = [
|
|
2857
2859
|
e("svg", {
|
|
2858
2860
|
viewBox: "0 0 24 24",
|
|
2859
2861
|
fill: "none",
|
|
@@ -2874,8 +2876,8 @@ const Oo = {
|
|
|
2874
2876
|
e("button", {
|
|
2875
2877
|
class: "vpg-ai-sql-panel-close",
|
|
2876
2878
|
title: "Close",
|
|
2877
|
-
onClick:
|
|
2878
|
-
}, [...
|
|
2879
|
+
onClick: x[8] || (x[8] = (ie) => X.value = !1)
|
|
2880
|
+
}, [...x[25] || (x[25] = [
|
|
2879
2881
|
e("svg", {
|
|
2880
2882
|
viewBox: "0 0 24 24",
|
|
2881
2883
|
fill: "none",
|
|
@@ -2899,17 +2901,17 @@ const Oo = {
|
|
|
2899
2901
|
])
|
|
2900
2902
|
]),
|
|
2901
2903
|
e("pre", $s, [
|
|
2902
|
-
e("code", null,
|
|
2904
|
+
e("code", null, k(p.value), 1)
|
|
2903
2905
|
])
|
|
2904
2906
|
])) : P("", !0),
|
|
2905
|
-
A(
|
|
2907
|
+
A(v) ? (i(), u("div", Rs, [...x[27] || (x[27] = [
|
|
2906
2908
|
e("div", { class: "vpg-ai-preview-spinner" }, null, -1),
|
|
2907
2909
|
e("span", null, "Running query...", -1)
|
|
2908
2910
|
])])) : ne.value.length === 0 && J.value ? (i(), u("div", Ds, [
|
|
2909
|
-
|
|
2910
|
-
e("span", null,
|
|
2911
|
-
|
|
2912
|
-
])) : ne.value.length === 0 ? (i(), u("div", As, [...
|
|
2911
|
+
x[28] || (x[28] = Mt('<div class="vpg-ai-preview-ready-icon" data-v-e1647db4><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" data-v-e1647db4><ellipse cx="12" cy="5" rx="9" ry="3" data-v-e1647db4></ellipse><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5" data-v-e1647db4></path><path d="M3 12c0 1.66 4 3 9 3s9-1.34 9-3" data-v-e1647db4></path></svg></div><p data-v-e1647db4>Data source connected</p>', 2)),
|
|
2912
|
+
e("span", null, k(J.value.columns.length) + " columns available", 1),
|
|
2913
|
+
x[29] || (x[29] = e("div", { class: "vpg-ai-preview-hint" }, " Ask a question to explore the data ", -1))
|
|
2914
|
+
])) : ne.value.length === 0 ? (i(), u("div", As, [...x[30] || (x[30] = [
|
|
2913
2915
|
e("div", { class: "vpg-ai-preview-empty-icon" }, [
|
|
2914
2916
|
e("svg", {
|
|
2915
2917
|
viewBox: "0 0 24 24",
|
|
@@ -2925,29 +2927,29 @@ const Oo = {
|
|
|
2925
2927
|
e("table", Ts, [
|
|
2926
2928
|
e("thead", null, [
|
|
2927
2929
|
e("tr", null, [
|
|
2928
|
-
(i(!0), u(Z, null, ve(S.value, (ie) => (i(), u("th", { key: ie },
|
|
2930
|
+
(i(!0), u(Z, null, ve(S.value, (ie) => (i(), u("th", { key: ie }, k(ie), 1))), 128))
|
|
2929
2931
|
])
|
|
2930
2932
|
]),
|
|
2931
2933
|
e("tbody", null, [
|
|
2932
2934
|
(i(!0), u(Z, null, ve(ne.value, (ie, ze) => (i(), u("tr", { key: ze }, [
|
|
2933
|
-
(i(!0), u(Z, null, ve(S.value, (Te) => (i(), u("td", { key: Te },
|
|
2935
|
+
(i(!0), u(Z, null, ve(S.value, (Te) => (i(), u("td", { key: Te }, k(M(ie[Te])), 1))), 128))
|
|
2934
2936
|
]))), 128))
|
|
2935
2937
|
])
|
|
2936
2938
|
]),
|
|
2937
2939
|
z.value.length > 100 ? (i(), u("div", Es, [
|
|
2938
|
-
ce(" Showing 100 of " +
|
|
2940
|
+
ce(" Showing 100 of " + k(z.value.length.toLocaleString()) + " rows. ", 1),
|
|
2939
2941
|
e("button", { onClick: H }, " View all in Grid ")
|
|
2940
2942
|
])) : P("", !0)
|
|
2941
2943
|
]))
|
|
2942
2944
|
])
|
|
2943
2945
|
])) : (i(), u("div", Oo, [
|
|
2944
2946
|
e("div", zo, [
|
|
2945
|
-
|
|
2946
|
-
A(b).length === 0 && !A(y) ? (i(), u("div", Po, [...
|
|
2947
|
+
x[12] || (x[12] = Mt('<div class="vpg-ai-picker-header" data-v-e1647db4><div class="vpg-ai-icon-lg" data-v-e1647db4><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-e1647db4><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z" data-v-e1647db4></path><circle cx="7.5" cy="14.5" r="1.5" fill="currentColor" data-v-e1647db4></circle><circle cx="16.5" cy="14.5" r="1.5" fill="currentColor" data-v-e1647db4></circle></svg></div><h2 data-v-e1647db4>AI Data Analyst</h2><p data-v-e1647db4>Select a data source to start exploring with AI</p></div>', 1)),
|
|
2948
|
+
A(b).length === 0 && !A(y) ? (i(), u("div", Po, [...x[9] || (x[9] = [
|
|
2947
2949
|
Mt('<p data-v-e1647db4>No data sources configured.</p><a href="https://tinypivot.com/docs/ai-analyst" target="_blank" rel="noopener" class="vpg-ai-docs-link" data-v-e1647db4><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-e1647db4><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" data-v-e1647db4></path><polyline points="15 3 21 3 21 9" data-v-e1647db4></polyline><line x1="10" y1="14" x2="21" y2="3" data-v-e1647db4></line></svg> View Documentation </a>', 2)
|
|
2948
2950
|
])])) : (i(), u(Z, { key: 1 }, [
|
|
2949
2951
|
e("div", Bo, [
|
|
2950
|
-
|
|
2952
|
+
x[10] || (x[10] = e("svg", {
|
|
2951
2953
|
viewBox: "0 0 24 24",
|
|
2952
2954
|
fill: "none",
|
|
2953
2955
|
stroke: "currentColor",
|
|
@@ -2966,7 +2968,7 @@ const Oo = {
|
|
|
2966
2968
|
})
|
|
2967
2969
|
], -1)),
|
|
2968
2970
|
Oe(e("input", {
|
|
2969
|
-
"onUpdate:modelValue":
|
|
2971
|
+
"onUpdate:modelValue": x[0] || (x[0] = (ie) => O.value = ie),
|
|
2970
2972
|
type: "text",
|
|
2971
2973
|
placeholder: "Search data sources...",
|
|
2972
2974
|
class: "vpg-ai-search-input"
|
|
@@ -2980,7 +2982,7 @@ const Oo = {
|
|
|
2980
2982
|
class: "vpg-ai-datasource-card",
|
|
2981
2983
|
onClick: (ze) => A(h)(ie.id)
|
|
2982
2984
|
}, [
|
|
2983
|
-
|
|
2985
|
+
x[11] || (x[11] = e("div", { class: "vpg-ai-datasource-icon" }, [
|
|
2984
2986
|
e("svg", {
|
|
2985
2987
|
viewBox: "0 0 24 24",
|
|
2986
2988
|
fill: "none",
|
|
@@ -2997,12 +2999,12 @@ const Oo = {
|
|
|
2997
2999
|
])
|
|
2998
3000
|
], -1)),
|
|
2999
3001
|
e("div", Uo, [
|
|
3000
|
-
e("span", Ho,
|
|
3001
|
-
ie.description ? (i(), u("span", jo,
|
|
3002
|
+
e("span", Ho, k(ie.name), 1),
|
|
3003
|
+
ie.description ? (i(), u("span", jo, k(ie.description), 1)) : P("", !0)
|
|
3002
3004
|
])
|
|
3003
3005
|
], 8, Io))), 128))
|
|
3004
3006
|
]),
|
|
3005
|
-
de.value.length === 0 ? (i(), u("div", Wo, ' No data sources match "' +
|
|
3007
|
+
de.value.length === 0 ? (i(), u("div", Wo, ' No data sources match "' + k(O.value) + '" ', 1)) : P("", !0)
|
|
3006
3008
|
], 64))
|
|
3007
3009
|
])
|
|
3008
3010
|
]))
|
|
@@ -3035,18 +3037,18 @@ const Oo = {
|
|
|
3035
3037
|
},
|
|
3036
3038
|
emits: ["close", "save"],
|
|
3037
3039
|
setup(t, { emit: o }) {
|
|
3038
|
-
const n = t, l = o, s = _(""), a = _(""), d = _("number"),
|
|
3040
|
+
const n = t, l = o, s = _(""), a = _(""), d = _("number"), v = _(2), y = _(null);
|
|
3039
3041
|
_e(() => n.show, (b) => {
|
|
3040
|
-
b && (n.existingField ? (s.value = n.existingField.name, a.value = n.existingField.formula, d.value = n.existingField.formatAs || "number",
|
|
3042
|
+
b && (n.existingField ? (s.value = n.existingField.name, a.value = n.existingField.formula, d.value = n.existingField.formatAs || "number", v.value = n.existingField.decimals ?? 2) : (s.value = "", a.value = "", d.value = "number", v.value = 2), y.value = null);
|
|
3041
3043
|
});
|
|
3042
|
-
const
|
|
3043
|
-
function
|
|
3044
|
+
const c = E(() => a.value.trim() ? hn(a.value, n.availableFields) : null);
|
|
3045
|
+
function L(b) {
|
|
3044
3046
|
a.value.trim() && !a.value.endsWith(" ") && (a.value += " "), a.value += b;
|
|
3045
3047
|
}
|
|
3046
|
-
function
|
|
3048
|
+
function F(b) {
|
|
3047
3049
|
a.value.trim() && !a.value.endsWith(" ") && (a.value += " "), a.value += `${b} `;
|
|
3048
3050
|
}
|
|
3049
|
-
function
|
|
3051
|
+
function C() {
|
|
3050
3052
|
var $;
|
|
3051
3053
|
if (!s.value.trim()) {
|
|
3052
3054
|
y.value = "Name is required";
|
|
@@ -3062,7 +3064,7 @@ const Oo = {
|
|
|
3062
3064
|
name: s.value.trim(),
|
|
3063
3065
|
formula: a.value.trim(),
|
|
3064
3066
|
formatAs: d.value,
|
|
3065
|
-
decimals:
|
|
3067
|
+
decimals: v.value
|
|
3066
3068
|
};
|
|
3067
3069
|
l("save", h), l("close");
|
|
3068
3070
|
}
|
|
@@ -3074,7 +3076,7 @@ const Oo = {
|
|
|
3074
3076
|
}, [
|
|
3075
3077
|
e("div", Vs, [
|
|
3076
3078
|
e("div", Os, [
|
|
3077
|
-
e("h3", null,
|
|
3079
|
+
e("h3", null, k(t.existingField ? "Edit" : "Create") + " Calculated Field", 1),
|
|
3078
3080
|
e("button", {
|
|
3079
3081
|
class: "vpg-modal-close",
|
|
3080
3082
|
onClick: h[0] || (h[0] = ($) => l("close"))
|
|
@@ -3103,34 +3105,34 @@ const Oo = {
|
|
|
3103
3105
|
[Ye, a.value]
|
|
3104
3106
|
]),
|
|
3105
3107
|
h[15] || (h[15] = e("div", { class: "vpg-formula-hint" }, " Use field names with math operators: + - * / ( ) ", -1)),
|
|
3106
|
-
|
|
3108
|
+
c.value ? (i(), u("div", qs, k(c.value), 1)) : P("", !0)
|
|
3107
3109
|
]),
|
|
3108
3110
|
e("div", Is, [
|
|
3109
3111
|
h[16] || (h[16] = e("label", { class: "vpg-label-small" }, "Operators", -1)),
|
|
3110
3112
|
e("div", Us, [
|
|
3111
3113
|
e("button", {
|
|
3112
3114
|
class: "vpg-insert-btn vpg-op-btn",
|
|
3113
|
-
onClick: h[3] || (h[3] = ($) =>
|
|
3115
|
+
onClick: h[3] || (h[3] = ($) => F("+"))
|
|
3114
3116
|
}, " + "),
|
|
3115
3117
|
e("button", {
|
|
3116
3118
|
class: "vpg-insert-btn vpg-op-btn",
|
|
3117
|
-
onClick: h[4] || (h[4] = ($) =>
|
|
3119
|
+
onClick: h[4] || (h[4] = ($) => F("-"))
|
|
3118
3120
|
}, " − "),
|
|
3119
3121
|
e("button", {
|
|
3120
3122
|
class: "vpg-insert-btn vpg-op-btn",
|
|
3121
|
-
onClick: h[5] || (h[5] = ($) =>
|
|
3123
|
+
onClick: h[5] || (h[5] = ($) => F("*"))
|
|
3122
3124
|
}, " × "),
|
|
3123
3125
|
e("button", {
|
|
3124
3126
|
class: "vpg-insert-btn vpg-op-btn",
|
|
3125
|
-
onClick: h[6] || (h[6] = ($) =>
|
|
3127
|
+
onClick: h[6] || (h[6] = ($) => F("/"))
|
|
3126
3128
|
}, " ÷ "),
|
|
3127
3129
|
e("button", {
|
|
3128
3130
|
class: "vpg-insert-btn vpg-op-btn",
|
|
3129
|
-
onClick: h[7] || (h[7] = ($) =>
|
|
3131
|
+
onClick: h[7] || (h[7] = ($) => F("("))
|
|
3130
3132
|
}, " ( "),
|
|
3131
3133
|
e("button", {
|
|
3132
3134
|
class: "vpg-insert-btn vpg-op-btn",
|
|
3133
|
-
onClick: h[8] || (h[8] = ($) =>
|
|
3135
|
+
onClick: h[8] || (h[8] = ($) => F(")"))
|
|
3134
3136
|
}, " ) ")
|
|
3135
3137
|
])
|
|
3136
3138
|
]),
|
|
@@ -3140,8 +3142,8 @@ const Oo = {
|
|
|
3140
3142
|
(i(!0), u(Z, null, ve(t.availableFields, ($) => (i(), u("button", {
|
|
3141
3143
|
key: $,
|
|
3142
3144
|
class: "vpg-insert-btn vpg-field-btn",
|
|
3143
|
-
onClick: (re) =>
|
|
3144
|
-
},
|
|
3145
|
+
onClick: (re) => L($)
|
|
3146
|
+
}, k($), 9, Ws))), 128))
|
|
3145
3147
|
])) : (i(), u("div", Ys, " No numeric fields available "))
|
|
3146
3148
|
]),
|
|
3147
3149
|
e("div", Gs, [
|
|
@@ -3161,7 +3163,7 @@ const Oo = {
|
|
|
3161
3163
|
e("div", Js, [
|
|
3162
3164
|
h[20] || (h[20] = e("label", { class: "vpg-label" }, "Decimals", -1)),
|
|
3163
3165
|
Oe(e("input", {
|
|
3164
|
-
"onUpdate:modelValue": h[10] || (h[10] = ($) =>
|
|
3166
|
+
"onUpdate:modelValue": h[10] || (h[10] = ($) => v.value = $),
|
|
3165
3167
|
type: "number",
|
|
3166
3168
|
class: "vpg-input",
|
|
3167
3169
|
min: "0",
|
|
@@ -3169,14 +3171,14 @@ const Oo = {
|
|
|
3169
3171
|
}, null, 512), [
|
|
3170
3172
|
[
|
|
3171
3173
|
Ye,
|
|
3172
|
-
|
|
3174
|
+
v.value,
|
|
3173
3175
|
void 0,
|
|
3174
3176
|
{ number: !0 }
|
|
3175
3177
|
]
|
|
3176
3178
|
])
|
|
3177
3179
|
])
|
|
3178
3180
|
]),
|
|
3179
|
-
y.value ? (i(), u("div", Qs,
|
|
3181
|
+
y.value ? (i(), u("div", Qs, k(y.value), 1)) : P("", !0)
|
|
3180
3182
|
]),
|
|
3181
3183
|
e("div", Xs, [
|
|
3182
3184
|
e("button", {
|
|
@@ -3185,8 +3187,8 @@ const Oo = {
|
|
|
3185
3187
|
}, " Cancel "),
|
|
3186
3188
|
e("button", {
|
|
3187
3189
|
class: "vpg-btn vpg-btn-primary",
|
|
3188
|
-
onClick:
|
|
3189
|
-
},
|
|
3190
|
+
onClick: C
|
|
3191
|
+
}, k(t.existingField ? "Update" : "Add") + " Field ", 1)
|
|
3190
3192
|
])
|
|
3191
3193
|
])
|
|
3192
3194
|
])) : P("", !0)
|
|
@@ -3236,15 +3238,16 @@ const Oo = {
|
|
|
3236
3238
|
__name: "ChartBuilder",
|
|
3237
3239
|
props: {
|
|
3238
3240
|
data: {},
|
|
3239
|
-
theme: {}
|
|
3241
|
+
theme: {},
|
|
3242
|
+
fieldRoleOverrides: {}
|
|
3240
3243
|
},
|
|
3241
3244
|
emits: ["configChange"],
|
|
3242
3245
|
setup(t, { emit: o }) {
|
|
3243
3246
|
const n = t, l = o, s = ka(
|
|
3244
3247
|
() => import("./vue3-apexcharts-CAskEAyG.js").then((D) => D.default)
|
|
3245
|
-
), a = _(Qa()), d =
|
|
3248
|
+
), a = _(Qa()), d = E(() => Wa(n.data, n.fieldRoleOverrides)), v = E(() => d.value.filter((D) => D.role === "dimension" || D.role === "temporal")), y = E(() => d.value.filter((D) => D.role === "measure")), c = _(null), L = _(null), F = _(!1), C = E(() => Ga(a.value)), b = E(() => Ya(a.value)), h = E(
|
|
3246
3249
|
() => Pt.find((D) => D.type === a.value.type)
|
|
3247
|
-
), $ =
|
|
3250
|
+
), $ = E(() => {
|
|
3248
3251
|
const D = a.value.type;
|
|
3249
3252
|
switch (D) {
|
|
3250
3253
|
case "scatter":
|
|
@@ -3316,24 +3319,24 @@ const Oo = {
|
|
|
3316
3319
|
showSeries: !0
|
|
3317
3320
|
};
|
|
3318
3321
|
}
|
|
3319
|
-
}), re =
|
|
3322
|
+
}), re = E(() => ["scatter", "bubble"].includes(a.value.type)), ee = E(() => a.value.type === "heatmap");
|
|
3320
3323
|
function U(D, R) {
|
|
3321
3324
|
var I;
|
|
3322
|
-
|
|
3325
|
+
c.value = D, (I = R.dataTransfer) == null || I.setData("text/plain", D.field);
|
|
3323
3326
|
}
|
|
3324
3327
|
function O() {
|
|
3325
|
-
|
|
3328
|
+
c.value = null, L.value = null;
|
|
3326
3329
|
}
|
|
3327
3330
|
function W(D, R) {
|
|
3328
|
-
R.preventDefault(),
|
|
3331
|
+
R.preventDefault(), L.value = D;
|
|
3329
3332
|
}
|
|
3330
3333
|
function G() {
|
|
3331
|
-
|
|
3334
|
+
L.value = null;
|
|
3332
3335
|
}
|
|
3333
3336
|
function X(D, R) {
|
|
3334
|
-
if (R.preventDefault(),
|
|
3337
|
+
if (R.preventDefault(), L.value = null, !c.value)
|
|
3335
3338
|
return;
|
|
3336
|
-
const I =
|
|
3339
|
+
const I = c.value, f = {
|
|
3337
3340
|
field: I.field,
|
|
3338
3341
|
label: I.label,
|
|
3339
3342
|
role: I.role,
|
|
@@ -3379,7 +3382,7 @@ const Oo = {
|
|
|
3379
3382
|
l("configChange", a.value);
|
|
3380
3383
|
}
|
|
3381
3384
|
function J(D) {
|
|
3382
|
-
a.value = { ...a.value, type: D },
|
|
3385
|
+
a.value = { ...a.value, type: D }, F.value = !1, l("configChange", a.value);
|
|
3383
3386
|
}
|
|
3384
3387
|
function ne(D, R) {
|
|
3385
3388
|
const I = D === "yAxis" ? a.value.yAxis : a.value.sizeField;
|
|
@@ -3388,10 +3391,10 @@ const Oo = {
|
|
|
3388
3391
|
const f = { ...I, aggregation: R };
|
|
3389
3392
|
D === "yAxis" ? a.value = { ...a.value, yAxis: f } : D === "size" && (a.value = { ...a.value, sizeField: f }), l("configChange", a.value);
|
|
3390
3393
|
}
|
|
3391
|
-
const z =
|
|
3394
|
+
const z = E(() => {
|
|
3392
3395
|
const D = n.theme === "dark", R = a.value, I = R.options || {}, f = {
|
|
3393
3396
|
chart: {
|
|
3394
|
-
type:
|
|
3397
|
+
type: N(R.type),
|
|
3395
3398
|
background: "transparent",
|
|
3396
3399
|
foreColor: D ? "#e2e8f0" : "#334155",
|
|
3397
3400
|
toolbar: {
|
|
@@ -3478,8 +3481,8 @@ const Oo = {
|
|
|
3478
3481
|
show: !0,
|
|
3479
3482
|
label: "Total",
|
|
3480
3483
|
formatter: (V) => {
|
|
3481
|
-
const
|
|
3482
|
-
return H(
|
|
3484
|
+
const M = V.globals.seriesTotals.reduce((Q, le) => Q + le, 0);
|
|
3485
|
+
return H(M, I.valueFormat, I.decimals);
|
|
3483
3486
|
}
|
|
3484
3487
|
}
|
|
3485
3488
|
}
|
|
@@ -3493,19 +3496,19 @@ const Oo = {
|
|
|
3493
3496
|
}
|
|
3494
3497
|
}
|
|
3495
3498
|
}), f;
|
|
3496
|
-
}), S =
|
|
3499
|
+
}), S = E(() => {
|
|
3497
3500
|
var I;
|
|
3498
3501
|
const D = a.value;
|
|
3499
3502
|
return b.value ? D.type === "pie" || D.type === "donut" ? ((I = dn(n.data, D).series[0]) == null ? void 0 : I.data) || [] : D.type === "scatter" || D.type === "bubble" ? Ka(n.data, D).series : D.type === "heatmap" ? Ja(n.data, D).series : cn(n.data, D).series : [];
|
|
3500
|
-
}),
|
|
3503
|
+
}), p = E(() => {
|
|
3501
3504
|
const D = a.value;
|
|
3502
3505
|
return b.value ? D.type === "pie" || D.type === "donut" ? dn(n.data, D).categories : cn(n.data, D).categories : [];
|
|
3503
|
-
}), m =
|
|
3506
|
+
}), m = E(() => {
|
|
3504
3507
|
const D = { ...z.value }, R = a.value;
|
|
3505
3508
|
return ["pie", "donut", "scatter", "bubble", "heatmap"].includes(R.type) || (D.xaxis = {
|
|
3506
3509
|
...D.xaxis,
|
|
3507
|
-
categories:
|
|
3508
|
-
}), (R.type === "pie" || R.type === "donut") && (D.labels =
|
|
3510
|
+
categories: p.value
|
|
3511
|
+
}), (R.type === "pie" || R.type === "donut") && (D.labels = p.value), R.type === "heatmap" && (D.chart = {
|
|
3509
3512
|
...D.chart,
|
|
3510
3513
|
type: "heatmap"
|
|
3511
3514
|
}, D.xaxis = {
|
|
@@ -3529,7 +3532,7 @@ const Oo = {
|
|
|
3529
3532
|
}
|
|
3530
3533
|
}, D.colors = ["#6366f1"], D.legend = { show: !1 }), D;
|
|
3531
3534
|
});
|
|
3532
|
-
function
|
|
3535
|
+
function N(D) {
|
|
3533
3536
|
return {
|
|
3534
3537
|
bar: "bar",
|
|
3535
3538
|
stackedBar: "bar",
|
|
@@ -3572,7 +3575,7 @@ const Oo = {
|
|
|
3572
3575
|
}, { deep: !0 }), ht(() => {
|
|
3573
3576
|
l("configChange", a.value);
|
|
3574
3577
|
}), (D, R) => {
|
|
3575
|
-
var I, f, V,
|
|
3578
|
+
var I, f, V, M, Q, le;
|
|
3576
3579
|
return i(), u("div", tl, [
|
|
3577
3580
|
e("div", nl, [
|
|
3578
3581
|
(i(!0), u(Z, null, ve(A(Pt), (T) => (i(), u("button", {
|
|
@@ -3586,7 +3589,7 @@ const Oo = {
|
|
|
3586
3589
|
d: se(T.type)
|
|
3587
3590
|
}, null, 8, sl)
|
|
3588
3591
|
])),
|
|
3589
|
-
e("span", ll,
|
|
3592
|
+
e("span", ll, k(T.label.replace(" Chart", "")), 1)
|
|
3590
3593
|
], 10, al))), 128))
|
|
3591
3594
|
]),
|
|
3592
3595
|
e("div", rl, [
|
|
@@ -3606,17 +3609,17 @@ const Oo = {
|
|
|
3606
3609
|
e("span", { class: "vpg-chart-fields-hint" }, "(text/date)")
|
|
3607
3610
|
], -1)),
|
|
3608
3611
|
e("div", cl, [
|
|
3609
|
-
(i(!0), u(Z, null, ve(
|
|
3612
|
+
(i(!0), u(Z, null, ve(v.value, (T) => (i(), u("div", {
|
|
3610
3613
|
key: T.field,
|
|
3611
3614
|
class: "vpg-chart-field-chip vpg-field-dimension",
|
|
3612
3615
|
draggable: "true",
|
|
3613
3616
|
onDragstart: (Y) => U(T, Y),
|
|
3614
3617
|
onDragend: O
|
|
3615
3618
|
}, [
|
|
3616
|
-
e("span", vl,
|
|
3617
|
-
e("span", pl,
|
|
3619
|
+
e("span", vl, k(T.label), 1),
|
|
3620
|
+
e("span", pl, k(T.role === "temporal" ? "date" : "text"), 1)
|
|
3618
3621
|
], 40, dl))), 128)),
|
|
3619
|
-
|
|
3622
|
+
v.value.length === 0 ? (i(), u("div", gl, " No dimension fields detected ")) : P("", !0)
|
|
3620
3623
|
])
|
|
3621
3624
|
]),
|
|
3622
3625
|
e("div", ml, [
|
|
@@ -3641,7 +3644,7 @@ const Oo = {
|
|
|
3641
3644
|
onDragstart: (Y) => U(T, Y),
|
|
3642
3645
|
onDragend: O
|
|
3643
3646
|
}, [
|
|
3644
|
-
e("span", yl,
|
|
3647
|
+
e("span", yl, k(T.label), 1),
|
|
3645
3648
|
R[17] || (R[17] = e("span", { class: "vpg-field-type" }, "#", -1))
|
|
3646
3649
|
], 40, hl))), 128)),
|
|
3647
3650
|
y.value.length === 0 ? (i(), u("div", bl, " No numeric fields detected ")) : P("", !0)
|
|
@@ -3650,15 +3653,15 @@ const Oo = {
|
|
|
3650
3653
|
]),
|
|
3651
3654
|
e("div", wl, [
|
|
3652
3655
|
e("div", Cl, [
|
|
3653
|
-
e("label", kl,
|
|
3656
|
+
e("label", kl, k($.value.xAxis), 1),
|
|
3654
3657
|
e("div", {
|
|
3655
|
-
class: ue(["vpg-chart-drop-zone", { "drag-over":
|
|
3658
|
+
class: ue(["vpg-chart-drop-zone", { "drag-over": L.value === "xAxis", "has-field": a.value.xAxis }]),
|
|
3656
3659
|
onDragover: R[2] || (R[2] = (T) => W("xAxis", T)),
|
|
3657
3660
|
onDragleave: G,
|
|
3658
3661
|
onDrop: R[3] || (R[3] = (T) => X("xAxis", T))
|
|
3659
3662
|
}, [
|
|
3660
3663
|
a.value.xAxis ? (i(), u(Z, { key: 0 }, [
|
|
3661
|
-
e("span", xl,
|
|
3664
|
+
e("span", xl, k(a.value.xAxis.label), 1),
|
|
3662
3665
|
re.value && a.value.xAxis.role === "measure" ? (i(), u("select", {
|
|
3663
3666
|
key: 0,
|
|
3664
3667
|
class: "vpg-zone-aggregation",
|
|
@@ -3668,7 +3671,7 @@ const Oo = {
|
|
|
3668
3671
|
(i(!0), u(Z, null, ve(A(Ct), (T) => (i(), u("option", {
|
|
3669
3672
|
key: T.value,
|
|
3670
3673
|
value: T.value
|
|
3671
|
-
},
|
|
3674
|
+
}, k(T.symbol), 9, Fl))), 128))
|
|
3672
3675
|
], 40, Sl)) : P("", !0),
|
|
3673
3676
|
e("button", {
|
|
3674
3677
|
class: "vpg-zone-remove-btn",
|
|
@@ -3684,19 +3687,19 @@ const Oo = {
|
|
|
3684
3687
|
e("path", { d: "M6 18L18 6M6 6l12 12" })
|
|
3685
3688
|
], -1)
|
|
3686
3689
|
])])
|
|
3687
|
-
], 64)) : (i(), u("span", Ml,
|
|
3690
|
+
], 64)) : (i(), u("span", Ml, k($.value.xAxisPlaceholder), 1))
|
|
3688
3691
|
], 34)
|
|
3689
3692
|
]),
|
|
3690
3693
|
e("div", $l, [
|
|
3691
|
-
e("label", Rl,
|
|
3694
|
+
e("label", Rl, k($.value.yAxis), 1),
|
|
3692
3695
|
e("div", {
|
|
3693
|
-
class: ue(["vpg-chart-drop-zone", { "drag-over":
|
|
3696
|
+
class: ue(["vpg-chart-drop-zone", { "drag-over": L.value === "yAxis", "has-field": a.value.yAxis }]),
|
|
3694
3697
|
onDragover: R[6] || (R[6] = (T) => W("yAxis", T)),
|
|
3695
3698
|
onDragleave: G,
|
|
3696
3699
|
onDrop: R[7] || (R[7] = (T) => X("yAxis", T))
|
|
3697
3700
|
}, [
|
|
3698
3701
|
a.value.yAxis ? (i(), u(Z, { key: 0 }, [
|
|
3699
|
-
e("span", Dl,
|
|
3702
|
+
e("span", Dl, k(a.value.yAxis.label), 1),
|
|
3700
3703
|
a.value.yAxis.role === "measure" && !ee.value ? (i(), u("select", {
|
|
3701
3704
|
key: 0,
|
|
3702
3705
|
class: "vpg-zone-aggregation",
|
|
@@ -3706,7 +3709,7 @@ const Oo = {
|
|
|
3706
3709
|
(i(!0), u(Z, null, ve(A(Ct), (T) => (i(), u("option", {
|
|
3707
3710
|
key: T.value,
|
|
3708
3711
|
value: T.value
|
|
3709
|
-
},
|
|
3712
|
+
}, k(T.symbol), 9, _l))), 128))
|
|
3710
3713
|
], 40, Al)) : P("", !0),
|
|
3711
3714
|
e("button", {
|
|
3712
3715
|
class: "vpg-zone-remove-btn",
|
|
@@ -3722,29 +3725,29 @@ const Oo = {
|
|
|
3722
3725
|
e("path", { d: "M6 18L18 6M6 6l12 12" })
|
|
3723
3726
|
], -1)
|
|
3724
3727
|
])])
|
|
3725
|
-
], 64)) : (i(), u("span", Tl,
|
|
3728
|
+
], 64)) : (i(), u("span", Tl, k($.value.yAxisPlaceholder), 1))
|
|
3726
3729
|
], 34)
|
|
3727
3730
|
]),
|
|
3728
3731
|
$.value.showSeries ? (i(), u("div", El, [
|
|
3729
|
-
e("label", Nl,
|
|
3732
|
+
e("label", Nl, k($.value.series), 1),
|
|
3730
3733
|
e("div", {
|
|
3731
|
-
class: ue(["vpg-chart-drop-zone vpg-zone-optional", { "drag-over":
|
|
3734
|
+
class: ue(["vpg-chart-drop-zone vpg-zone-optional", { "drag-over": L.value === "series", "has-field": a.value.seriesField || ee.value && a.value.colorField }]),
|
|
3732
3735
|
onDragover: R[10] || (R[10] = (T) => W(ee.value ? "color" : "series", T)),
|
|
3733
3736
|
onDragleave: G,
|
|
3734
3737
|
onDrop: R[11] || (R[11] = (T) => X(ee.value ? "color" : "series", T))
|
|
3735
3738
|
}, [
|
|
3736
3739
|
(ee.value ? a.value.colorField : a.value.seriesField) ? (i(), u(Z, { key: 0 }, [
|
|
3737
|
-
e("span", Ll,
|
|
3740
|
+
e("span", Ll, k(ee.value ? (I = a.value.colorField) == null ? void 0 : I.label : (f = a.value.seriesField) == null ? void 0 : f.label), 1),
|
|
3738
3741
|
ee.value && ((V = a.value.colorField) == null ? void 0 : V.role) === "measure" ? (i(), u("select", {
|
|
3739
3742
|
key: 0,
|
|
3740
3743
|
class: "vpg-zone-aggregation",
|
|
3741
|
-
value: ((
|
|
3744
|
+
value: ((M = a.value.colorField) == null ? void 0 : M.aggregation) || "sum",
|
|
3742
3745
|
onChange: R[8] || (R[8] = (T) => ne("color", T.target.value))
|
|
3743
3746
|
}, [
|
|
3744
3747
|
(i(!0), u(Z, null, ve(A(Ct), (T) => (i(), u("option", {
|
|
3745
3748
|
key: T.value,
|
|
3746
3749
|
value: T.value
|
|
3747
|
-
},
|
|
3750
|
+
}, k(T.symbol), 9, Ol))), 128))
|
|
3748
3751
|
], 40, Vl)) : P("", !0),
|
|
3749
3752
|
e("button", {
|
|
3750
3753
|
class: "vpg-zone-remove-btn",
|
|
@@ -3760,19 +3763,19 @@ const Oo = {
|
|
|
3760
3763
|
e("path", { d: "M6 18L18 6M6 6l12 12" })
|
|
3761
3764
|
], -1)
|
|
3762
3765
|
])])
|
|
3763
|
-
], 64)) : (i(), u("span", zl,
|
|
3766
|
+
], 64)) : (i(), u("span", zl, k($.value.seriesPlaceholder), 1))
|
|
3764
3767
|
], 34)
|
|
3765
3768
|
])) : P("", !0),
|
|
3766
3769
|
$.value.showSize ? (i(), u("div", Pl, [
|
|
3767
3770
|
R[23] || (R[23] = e("label", { class: "vpg-chart-zone-label" }, "Size (number)", -1)),
|
|
3768
3771
|
e("div", {
|
|
3769
|
-
class: ue(["vpg-chart-drop-zone vpg-zone-optional", { "drag-over":
|
|
3772
|
+
class: ue(["vpg-chart-drop-zone vpg-zone-optional", { "drag-over": L.value === "size", "has-field": a.value.sizeField }]),
|
|
3770
3773
|
onDragover: R[14] || (R[14] = (T) => W("size", T)),
|
|
3771
3774
|
onDragleave: G,
|
|
3772
3775
|
onDrop: R[15] || (R[15] = (T) => X("size", T))
|
|
3773
3776
|
}, [
|
|
3774
3777
|
a.value.sizeField ? (i(), u(Z, { key: 0 }, [
|
|
3775
|
-
e("span", Bl,
|
|
3778
|
+
e("span", Bl, k(a.value.sizeField.label), 1),
|
|
3776
3779
|
a.value.sizeField.role === "measure" ? (i(), u("select", {
|
|
3777
3780
|
key: 0,
|
|
3778
3781
|
class: "vpg-zone-aggregation",
|
|
@@ -3782,7 +3785,7 @@ const Oo = {
|
|
|
3782
3785
|
(i(!0), u(Z, null, ve(A(Ct), (T) => (i(), u("option", {
|
|
3783
3786
|
key: T.value,
|
|
3784
3787
|
value: T.value
|
|
3785
|
-
},
|
|
3788
|
+
}, k(T.symbol), 9, Il))), 128))
|
|
3786
3789
|
], 40, ql)) : P("", !0),
|
|
3787
3790
|
e("button", {
|
|
3788
3791
|
class: "vpg-zone-remove-btn",
|
|
@@ -3816,7 +3819,7 @@ const Oo = {
|
|
|
3816
3819
|
}),
|
|
3817
3820
|
e("path", { d: "M12 16v-4M12 8h.01" })
|
|
3818
3821
|
], -1)),
|
|
3819
|
-
e("span", null, C
|
|
3822
|
+
e("span", null, k(C.value), 1)
|
|
3820
3823
|
])
|
|
3821
3824
|
]),
|
|
3822
3825
|
e("div", jl, [
|
|
@@ -3831,7 +3834,7 @@ const Oo = {
|
|
|
3831
3834
|
default: At(() => [
|
|
3832
3835
|
(i(), Dt(A(s), {
|
|
3833
3836
|
key: `${a.value.type}-${JSON.stringify(a.value.xAxis)}-${JSON.stringify(a.value.yAxis)}`,
|
|
3834
|
-
type:
|
|
3837
|
+
type: N(a.value.type),
|
|
3835
3838
|
options: m.value,
|
|
3836
3839
|
series: S.value,
|
|
3837
3840
|
height: "100%"
|
|
@@ -3848,8 +3851,8 @@ const Oo = {
|
|
|
3848
3851
|
R[26] || (R[26] = e("h3", null, "Build your chart", -1)),
|
|
3849
3852
|
R[27] || (R[27] = e("p", null, "Drag fields from the left panel to configure your visualization", -1)),
|
|
3850
3853
|
e("div", Jl, [
|
|
3851
|
-
e("strong", null,
|
|
3852
|
-
ce(": " +
|
|
3854
|
+
e("strong", null, k((Q = h.value) == null ? void 0 : Q.label), 1),
|
|
3855
|
+
ce(": " + k((le = h.value) == null ? void 0 : le.description), 1)
|
|
3853
3856
|
])
|
|
3854
3857
|
]))
|
|
3855
3858
|
])
|
|
@@ -3870,18 +3873,18 @@ const Oo = {
|
|
|
3870
3873
|
},
|
|
3871
3874
|
emits: ["change"],
|
|
3872
3875
|
setup(t, { emit: o }) {
|
|
3873
|
-
const n = t, l = o, s =
|
|
3874
|
-
function
|
|
3875
|
-
U != null && U.min ? a.value = We(U.min, s.value) : a.value = "", U != null && U.max ? d.value = We(U.max, s.value) : d.value = "",
|
|
3876
|
+
const n = t, l = o, s = E(() => n.dateFormat ?? "iso"), a = _(""), d = _(""), v = _(!1), y = _(!1);
|
|
3877
|
+
function c(U) {
|
|
3878
|
+
U != null && U.min ? a.value = We(U.min, s.value) : a.value = "", U != null && U.max ? d.value = We(U.max, s.value) : d.value = "", v.value = !1, y.value = !1;
|
|
3876
3879
|
}
|
|
3877
|
-
const
|
|
3880
|
+
const L = E(() => We(n.dataMin, s.value)), F = E(() => We(n.dataMax, s.value)), C = E(() => a.value !== "" || d.value !== "");
|
|
3878
3881
|
function b() {
|
|
3879
3882
|
if (a.value === "") {
|
|
3880
|
-
|
|
3883
|
+
v.value = !1, $();
|
|
3881
3884
|
return;
|
|
3882
3885
|
}
|
|
3883
3886
|
const U = xt(a.value, s.value);
|
|
3884
|
-
|
|
3887
|
+
v.value = U === null, v.value || $();
|
|
3885
3888
|
}
|
|
3886
3889
|
function h() {
|
|
3887
3890
|
if (d.value === "") {
|
|
@@ -3896,17 +3899,17 @@ const Oo = {
|
|
|
3896
3899
|
U === null && O === null ? l("change", null) : l("change", { min: U, max: O });
|
|
3897
3900
|
}
|
|
3898
3901
|
function re() {
|
|
3899
|
-
a.value = "", d.value = "",
|
|
3902
|
+
a.value = "", d.value = "", v.value = !1, y.value = !1, l("change", null);
|
|
3900
3903
|
}
|
|
3901
3904
|
function ee() {
|
|
3902
|
-
a.value = We(n.dataMin, s.value), d.value = We(n.dataMax, s.value),
|
|
3905
|
+
a.value = We(n.dataMin, s.value), d.value = We(n.dataMax, s.value), v.value = !1, y.value = !1, l("change", { min: n.dataMin, max: n.dataMax });
|
|
3903
3906
|
}
|
|
3904
3907
|
return _e(() => n.currentRange, (U) => {
|
|
3905
|
-
|
|
3908
|
+
c(U);
|
|
3906
3909
|
}, { immediate: !0 }), (U, O) => (i(), u("div", Xl, [
|
|
3907
3910
|
e("div", Zl, [
|
|
3908
3911
|
O[2] || (O[2] = e("span", { class: "vpg-range-label" }, "Data range:", -1)),
|
|
3909
|
-
e("span", er,
|
|
3912
|
+
e("span", er, k(L.value) + " – " + k(F.value), 1)
|
|
3910
3913
|
]),
|
|
3911
3914
|
e("div", tr, [
|
|
3912
3915
|
e("div", nr, [
|
|
@@ -3914,7 +3917,7 @@ const Oo = {
|
|
|
3914
3917
|
Oe(e("input", {
|
|
3915
3918
|
"onUpdate:modelValue": O[0] || (O[0] = (W) => a.value = W),
|
|
3916
3919
|
type: "text",
|
|
3917
|
-
class: ue(["vpg-range-input", { "vpg-input-error":
|
|
3920
|
+
class: ue(["vpg-range-input", { "vpg-input-error": v.value }]),
|
|
3918
3921
|
placeholder: A(gn)(s.value),
|
|
3919
3922
|
onBlur: b,
|
|
3920
3923
|
onKeyup: zt(b, ["enter"])
|
|
@@ -3940,7 +3943,7 @@ const Oo = {
|
|
|
3940
3943
|
e("div", lr, [
|
|
3941
3944
|
e("button", {
|
|
3942
3945
|
class: "vpg-range-btn",
|
|
3943
|
-
disabled: !
|
|
3946
|
+
disabled: !C.value,
|
|
3944
3947
|
onClick: re
|
|
3945
3948
|
}, [...O[6] || (O[6] = [
|
|
3946
3949
|
e("svg", {
|
|
@@ -3978,7 +3981,7 @@ const Oo = {
|
|
|
3978
3981
|
ce(" Full Range ", -1)
|
|
3979
3982
|
])])
|
|
3980
3983
|
]),
|
|
3981
|
-
|
|
3984
|
+
C.value && !v.value && !y.value ? (i(), u("div", ir, [
|
|
3982
3985
|
O[9] || (O[9] = e("svg", {
|
|
3983
3986
|
class: "vpg-icon-xs",
|
|
3984
3987
|
fill: "none",
|
|
@@ -3994,9 +3997,9 @@ const Oo = {
|
|
|
3994
3997
|
], -1)),
|
|
3995
3998
|
e("span", null, [
|
|
3996
3999
|
O[8] || (O[8] = ce(" Showing dates ", -1)),
|
|
3997
|
-
a.value ? (i(), u("strong", ur, "from " +
|
|
3998
|
-
ce(" " +
|
|
3999
|
-
d.value ? (i(), u("strong", cr, "to " +
|
|
4000
|
+
a.value ? (i(), u("strong", ur, "from " + k(a.value), 1)) : P("", !0),
|
|
4001
|
+
ce(" " + k(a.value && d.value ? " " : "") + " ", 1),
|
|
4002
|
+
d.value ? (i(), u("strong", cr, "to " + k(d.value), 1)) : P("", !0)
|
|
4000
4003
|
])
|
|
4001
4004
|
])) : P("", !0)
|
|
4002
4005
|
]));
|
|
@@ -4015,19 +4018,19 @@ const Oo = {
|
|
|
4015
4018
|
emits: ["change"],
|
|
4016
4019
|
setup(t, { emit: o }) {
|
|
4017
4020
|
var U, O;
|
|
4018
|
-
const n = t, l = o, s = _(((U = n.currentRange) == null ? void 0 : U.min) ?? null), a = _(((O = n.currentRange) == null ? void 0 : O.max) ?? null), d =
|
|
4021
|
+
const n = t, l = o, s = _(((U = n.currentRange) == null ? void 0 : U.min) ?? null), a = _(((O = n.currentRange) == null ? void 0 : O.max) ?? null), d = E(() => {
|
|
4019
4022
|
const W = n.dataMax - n.dataMin;
|
|
4020
4023
|
return W === 0 ? 1 : W <= 1 ? 0.01 : W <= 10 ? 0.1 : W <= 100 ? 1 : W <= 1e3 ? 10 : 10 ** (Math.floor(Math.log10(W)) - 2);
|
|
4021
4024
|
});
|
|
4022
|
-
function
|
|
4025
|
+
function v(W) {
|
|
4023
4026
|
return W === null ? "" : et(W, n.numberFormat ?? "us");
|
|
4024
4027
|
}
|
|
4025
|
-
const y =
|
|
4026
|
-
function
|
|
4028
|
+
const y = E(() => s.value !== null || a.value !== null), c = E(() => s.value === null || n.dataMax === n.dataMin ? 0 : (s.value - n.dataMin) / (n.dataMax - n.dataMin) * 100), L = E(() => a.value === null || n.dataMax === n.dataMin ? 100 : (a.value - n.dataMin) / (n.dataMax - n.dataMin) * 100);
|
|
4029
|
+
function F(W) {
|
|
4027
4030
|
const G = W.target, X = Number.parseFloat(G.value);
|
|
4028
4031
|
a.value !== null && X > a.value ? s.value = a.value : s.value = X;
|
|
4029
4032
|
}
|
|
4030
|
-
function
|
|
4033
|
+
function C(W) {
|
|
4031
4034
|
const G = W.target, X = Number.parseFloat(G.value);
|
|
4032
4035
|
s.value !== null && X < s.value ? a.value = s.value : a.value = X;
|
|
4033
4036
|
}
|
|
@@ -4053,15 +4056,15 @@ const Oo = {
|
|
|
4053
4056
|
}, { immediate: !0 }), (W, G) => (i(), u("div", pr, [
|
|
4054
4057
|
e("div", gr, [
|
|
4055
4058
|
G[0] || (G[0] = e("span", { class: "vpg-range-label" }, "Data range:", -1)),
|
|
4056
|
-
e("span", mr,
|
|
4059
|
+
e("span", mr, k(v(t.dataMin)) + " – " + k(v(t.dataMax)), 1)
|
|
4057
4060
|
]),
|
|
4058
4061
|
e("div", fr, [
|
|
4059
4062
|
e("div", hr, [
|
|
4060
4063
|
e("div", {
|
|
4061
4064
|
class: "vpg-slider-fill",
|
|
4062
4065
|
style: Ve({
|
|
4063
|
-
left: `${
|
|
4064
|
-
right: `${100 -
|
|
4066
|
+
left: `${c.value}%`,
|
|
4067
|
+
right: `${100 - L.value}%`
|
|
4065
4068
|
})
|
|
4066
4069
|
}, null, 4)
|
|
4067
4070
|
]),
|
|
@@ -4072,7 +4075,7 @@ const Oo = {
|
|
|
4072
4075
|
max: t.dataMax,
|
|
4073
4076
|
step: d.value,
|
|
4074
4077
|
value: s.value ?? t.dataMin,
|
|
4075
|
-
onInput:
|
|
4078
|
+
onInput: F,
|
|
4076
4079
|
onChange: ee
|
|
4077
4080
|
}, null, 40, yr),
|
|
4078
4081
|
e("input", {
|
|
@@ -4082,7 +4085,7 @@ const Oo = {
|
|
|
4082
4085
|
max: t.dataMax,
|
|
4083
4086
|
step: d.value,
|
|
4084
4087
|
value: a.value ?? t.dataMax,
|
|
4085
|
-
onInput:
|
|
4088
|
+
onInput: C,
|
|
4086
4089
|
onChange: ee
|
|
4087
4090
|
}, null, 40, br)
|
|
4088
4091
|
]),
|
|
@@ -4092,7 +4095,7 @@ const Oo = {
|
|
|
4092
4095
|
e("input", {
|
|
4093
4096
|
type: "number",
|
|
4094
4097
|
class: "vpg-range-input",
|
|
4095
|
-
placeholder:
|
|
4098
|
+
placeholder: v(t.dataMin),
|
|
4096
4099
|
value: s.value ?? "",
|
|
4097
4100
|
step: d.value,
|
|
4098
4101
|
onInput: b,
|
|
@@ -4105,7 +4108,7 @@ const Oo = {
|
|
|
4105
4108
|
e("input", {
|
|
4106
4109
|
type: "number",
|
|
4107
4110
|
class: "vpg-range-input",
|
|
4108
|
-
placeholder:
|
|
4111
|
+
placeholder: v(t.dataMax),
|
|
4109
4112
|
value: a.value ?? "",
|
|
4110
4113
|
step: d.value,
|
|
4111
4114
|
onInput: h,
|
|
@@ -4170,9 +4173,9 @@ const Oo = {
|
|
|
4170
4173
|
], -1)),
|
|
4171
4174
|
e("span", null, [
|
|
4172
4175
|
G[6] || (G[6] = ce(" Showing values ", -1)),
|
|
4173
|
-
e("strong", null,
|
|
4174
|
-
ce(" " +
|
|
4175
|
-
e("strong", null,
|
|
4176
|
+
e("strong", null, k(s.value !== null ? `≥ ${v(s.value)}` : ""), 1),
|
|
4177
|
+
ce(" " + k(s.value !== null && a.value !== null ? " and " : "") + " ", 1),
|
|
4178
|
+
e("strong", null, k(a.value !== null ? `≤ ${v(a.value)}` : ""), 1)
|
|
4176
4179
|
])
|
|
4177
4180
|
])) : P("", !0)
|
|
4178
4181
|
]));
|
|
@@ -4198,29 +4201,29 @@ const Oo = {
|
|
|
4198
4201
|
},
|
|
4199
4202
|
emits: ["filter", "sort", "close", "rangeFilter", "dateRangeFilter"],
|
|
4200
4203
|
setup(t, { emit: o }) {
|
|
4201
|
-
const n = t, l = o, s = _(""), a = _(), d = _(),
|
|
4204
|
+
const n = t, l = o, s = _(""), a = _(), d = _(), v = E(() => n.stats.type === "number" && n.stats.numericMin !== void 0 && n.stats.numericMax !== void 0), y = E(() => n.stats.type === "date" && n.stats.dateMin !== void 0 && n.stats.dateMax !== void 0), c = _(n.numericRange || n.dateRange ? "range" : "values"), L = _(n.numericRange ?? null), F = _(n.dateRange ?? null), C = _(new Set(n.selectedValues)), b = E(() => n.stats.nullCount > 0), h = E(() => {
|
|
4202
4205
|
const f = n.stats.uniqueValues;
|
|
4203
4206
|
if (!s.value)
|
|
4204
4207
|
return f;
|
|
4205
4208
|
const V = s.value.toLowerCase();
|
|
4206
|
-
return f.filter((
|
|
4207
|
-
}), $ =
|
|
4209
|
+
return f.filter((M) => M.toLowerCase().includes(V));
|
|
4210
|
+
}), $ = E(() => {
|
|
4208
4211
|
const f = [...h.value];
|
|
4209
4212
|
return b.value && (!s.value || "(blank)".includes(s.value.toLowerCase())) && f.unshift("(blank)"), f;
|
|
4210
|
-
}), re =
|
|
4213
|
+
}), re = E(() => y.value ? "Old→New" : v.value ? "1→9" : "A→Z"), ee = E(() => y.value ? "New→Old" : v.value ? "9→1" : "Z→A"), U = E(() => y.value ? "Sort Old to New" : v.value ? "Sort Low to High" : "Sort A to Z"), O = E(() => y.value ? "Sort New to Old" : v.value ? "Sort High to Low" : "Sort Z to A");
|
|
4211
4214
|
function W(f) {
|
|
4212
|
-
|
|
4215
|
+
C.value.has(f) ? C.value.delete(f) : C.value.add(f), C.value = new Set(C.value);
|
|
4213
4216
|
}
|
|
4214
4217
|
function G() {
|
|
4215
4218
|
for (const f of $.value)
|
|
4216
|
-
|
|
4217
|
-
|
|
4219
|
+
C.value.add(f);
|
|
4220
|
+
C.value = new Set(C.value);
|
|
4218
4221
|
}
|
|
4219
4222
|
function X() {
|
|
4220
|
-
|
|
4223
|
+
C.value.clear(), C.value = new Set(C.value);
|
|
4221
4224
|
}
|
|
4222
4225
|
function de() {
|
|
4223
|
-
|
|
4226
|
+
C.value.size === 0 ? l("filter", []) : l("filter", Array.from(C.value)), l("close");
|
|
4224
4227
|
}
|
|
4225
4228
|
function J() {
|
|
4226
4229
|
l("sort", n.sortDirection === "asc" ? null : "asc");
|
|
@@ -4229,28 +4232,28 @@ const Oo = {
|
|
|
4229
4232
|
l("sort", n.sortDirection === "desc" ? null : "desc");
|
|
4230
4233
|
}
|
|
4231
4234
|
function z() {
|
|
4232
|
-
|
|
4235
|
+
C.value.clear(), C.value = new Set(C.value), l("filter", []), l("close");
|
|
4233
4236
|
}
|
|
4234
4237
|
function S(f) {
|
|
4235
|
-
|
|
4238
|
+
L.value = f;
|
|
4236
4239
|
}
|
|
4237
|
-
function
|
|
4238
|
-
l("rangeFilter",
|
|
4240
|
+
function p() {
|
|
4241
|
+
l("rangeFilter", L.value), l("close");
|
|
4239
4242
|
}
|
|
4240
4243
|
function m() {
|
|
4241
|
-
|
|
4244
|
+
L.value = null, l("rangeFilter", null), l("close");
|
|
4242
4245
|
}
|
|
4243
|
-
function
|
|
4244
|
-
|
|
4246
|
+
function N(f) {
|
|
4247
|
+
F.value = f;
|
|
4245
4248
|
}
|
|
4246
4249
|
function H() {
|
|
4247
|
-
l("dateRangeFilter",
|
|
4250
|
+
l("dateRangeFilter", F.value), l("close");
|
|
4248
4251
|
}
|
|
4249
4252
|
function se() {
|
|
4250
|
-
|
|
4253
|
+
F.value = null, l("dateRangeFilter", null), l("close");
|
|
4251
4254
|
}
|
|
4252
4255
|
function D(f) {
|
|
4253
|
-
|
|
4256
|
+
c.value = f;
|
|
4254
4257
|
}
|
|
4255
4258
|
function R(f) {
|
|
4256
4259
|
a.value && !a.value.contains(f.target) && l("close");
|
|
@@ -4266,19 +4269,19 @@ const Oo = {
|
|
|
4266
4269
|
}), Bt(() => {
|
|
4267
4270
|
document.removeEventListener("mousedown", R), document.removeEventListener("keydown", I);
|
|
4268
4271
|
}), _e(() => n.selectedValues, (f) => {
|
|
4269
|
-
|
|
4272
|
+
C.value = new Set(f);
|
|
4270
4273
|
}, { immediate: !0 }), _e(() => n.numericRange, (f) => {
|
|
4271
|
-
|
|
4274
|
+
L.value = f ?? null, f && (c.value = "range");
|
|
4272
4275
|
}, { immediate: !0 }), _e(() => n.dateRange, (f) => {
|
|
4273
|
-
|
|
4276
|
+
F.value = f ?? null, f && (c.value = "range");
|
|
4274
4277
|
}, { immediate: !0 }), (f, V) => (i(), u("div", {
|
|
4275
4278
|
ref_key: "dropdownRef",
|
|
4276
4279
|
ref: a,
|
|
4277
4280
|
class: "vpg-filter-dropdown"
|
|
4278
4281
|
}, [
|
|
4279
4282
|
e("div", Ar, [
|
|
4280
|
-
e("span", _r,
|
|
4281
|
-
e("span", Tr,
|
|
4283
|
+
e("span", _r, k(t.columnName), 1),
|
|
4284
|
+
e("span", Tr, k(t.stats.uniqueValues.length.toLocaleString()) + " unique ", 1)
|
|
4282
4285
|
]),
|
|
4283
4286
|
e("div", Er, [
|
|
4284
4287
|
e("button", {
|
|
@@ -4299,7 +4302,7 @@ const Oo = {
|
|
|
4299
4302
|
d: "M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"
|
|
4300
4303
|
})
|
|
4301
4304
|
], -1)),
|
|
4302
|
-
e("span", null,
|
|
4305
|
+
e("span", null, k(re.value), 1)
|
|
4303
4306
|
], 10, Nr),
|
|
4304
4307
|
e("button", {
|
|
4305
4308
|
class: ue(["vpg-sort-btn", { active: t.sortDirection === "desc" }]),
|
|
@@ -4319,14 +4322,14 @@ const Oo = {
|
|
|
4319
4322
|
d: "M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4"
|
|
4320
4323
|
})
|
|
4321
4324
|
], -1)),
|
|
4322
|
-
e("span", null,
|
|
4325
|
+
e("span", null, k(ee.value), 1)
|
|
4323
4326
|
], 10, Lr)
|
|
4324
4327
|
]),
|
|
4325
4328
|
V[11] || (V[11] = e("div", { class: "vpg-divider" }, null, -1)),
|
|
4326
|
-
|
|
4329
|
+
v.value || y.value ? (i(), u("div", Vr, [
|
|
4327
4330
|
e("button", {
|
|
4328
|
-
class: ue(["vpg-tab-btn", { active:
|
|
4329
|
-
onClick: V[0] || (V[0] = (
|
|
4331
|
+
class: ue(["vpg-tab-btn", { active: c.value === "values" }]),
|
|
4332
|
+
onClick: V[0] || (V[0] = (M) => D("values"))
|
|
4330
4333
|
}, [...V[6] || (V[6] = [
|
|
4331
4334
|
e("svg", {
|
|
4332
4335
|
class: "vpg-icon-sm",
|
|
@@ -4344,8 +4347,8 @@ const Oo = {
|
|
|
4344
4347
|
ce(" Values ", -1)
|
|
4345
4348
|
])], 2),
|
|
4346
4349
|
e("button", {
|
|
4347
|
-
class: ue(["vpg-tab-btn", { active:
|
|
4348
|
-
onClick: V[1] || (V[1] = (
|
|
4350
|
+
class: ue(["vpg-tab-btn", { active: c.value === "range" }]),
|
|
4351
|
+
onClick: V[1] || (V[1] = (M) => D("range"))
|
|
4349
4352
|
}, [...V[7] || (V[7] = [
|
|
4350
4353
|
e("svg", {
|
|
4351
4354
|
class: "vpg-icon-sm",
|
|
@@ -4363,7 +4366,7 @@ const Oo = {
|
|
|
4363
4366
|
ce(" Range ", -1)
|
|
4364
4367
|
])], 2)
|
|
4365
4368
|
])) : P("", !0),
|
|
4366
|
-
!
|
|
4369
|
+
!v.value && !y.value || c.value === "values" ? (i(), u(Z, { key: 1 }, [
|
|
4367
4370
|
e("div", Or, [
|
|
4368
4371
|
V[8] || (V[8] = e("svg", {
|
|
4369
4372
|
class: "vpg-search-icon",
|
|
@@ -4381,7 +4384,7 @@ const Oo = {
|
|
|
4381
4384
|
Oe(e("input", {
|
|
4382
4385
|
ref_key: "searchInputRef",
|
|
4383
4386
|
ref: d,
|
|
4384
|
-
"onUpdate:modelValue": V[2] || (V[2] = (
|
|
4387
|
+
"onUpdate:modelValue": V[2] || (V[2] = (M) => s.value = M),
|
|
4385
4388
|
type: "text",
|
|
4386
4389
|
placeholder: "Search values...",
|
|
4387
4390
|
class: "vpg-search-input"
|
|
@@ -4391,7 +4394,7 @@ const Oo = {
|
|
|
4391
4394
|
s.value ? (i(), u("button", {
|
|
4392
4395
|
key: 0,
|
|
4393
4396
|
class: "vpg-clear-search",
|
|
4394
|
-
onClick: V[3] || (V[3] = (
|
|
4397
|
+
onClick: V[3] || (V[3] = (M) => s.value = "")
|
|
4395
4398
|
}, " × ")) : P("", !0)
|
|
4396
4399
|
]),
|
|
4397
4400
|
e("div", { class: "vpg-bulk-actions" }, [
|
|
@@ -4435,19 +4438,19 @@ const Oo = {
|
|
|
4435
4438
|
])])
|
|
4436
4439
|
]),
|
|
4437
4440
|
e("div", zr, [
|
|
4438
|
-
(i(!0), u(Z, null, ve($.value, (
|
|
4439
|
-
key:
|
|
4440
|
-
class: ue(["vpg-value-item", { selected:
|
|
4441
|
+
(i(!0), u(Z, null, ve($.value, (M) => (i(), u("label", {
|
|
4442
|
+
key: M,
|
|
4443
|
+
class: ue(["vpg-value-item", { selected: C.value.has(M) }])
|
|
4441
4444
|
}, [
|
|
4442
4445
|
e("input", {
|
|
4443
4446
|
type: "checkbox",
|
|
4444
|
-
checked:
|
|
4447
|
+
checked: C.value.has(M),
|
|
4445
4448
|
class: "vpg-value-checkbox",
|
|
4446
|
-
onChange: (Q) => W(
|
|
4449
|
+
onChange: (Q) => W(M)
|
|
4447
4450
|
}, null, 40, Pr),
|
|
4448
4451
|
e("span", {
|
|
4449
|
-
class: ue(["vpg-value-text", { "vpg-blank":
|
|
4450
|
-
},
|
|
4452
|
+
class: ue(["vpg-value-text", { "vpg-blank": M === "(blank)" }])
|
|
4453
|
+
}, k(M), 3)
|
|
4451
4454
|
], 2))), 128)),
|
|
4452
4455
|
$.value.length === 0 ? (i(), u("div", Br, " No matching values ")) : P("", !0)
|
|
4453
4456
|
]),
|
|
@@ -4461,11 +4464,11 @@ const Oo = {
|
|
|
4461
4464
|
onClick: de
|
|
4462
4465
|
}, " Apply ")
|
|
4463
4466
|
])
|
|
4464
|
-
], 64)) :
|
|
4467
|
+
], 64)) : v.value && c.value === "range" ? (i(), u(Z, { key: 2 }, [
|
|
4465
4468
|
je(Dr, {
|
|
4466
4469
|
"data-min": t.stats.numericMin,
|
|
4467
4470
|
"data-max": t.stats.numericMax,
|
|
4468
|
-
"current-range":
|
|
4471
|
+
"current-range": L.value,
|
|
4469
4472
|
"number-format": t.numberFormat,
|
|
4470
4473
|
onChange: S
|
|
4471
4474
|
}, null, 8, ["data-min", "data-max", "current-range", "number-format"]),
|
|
@@ -4476,16 +4479,16 @@ const Oo = {
|
|
|
4476
4479
|
}, " Clear Filter "),
|
|
4477
4480
|
e("button", {
|
|
4478
4481
|
class: "vpg-btn-apply",
|
|
4479
|
-
onClick:
|
|
4482
|
+
onClick: p
|
|
4480
4483
|
}, " Apply ")
|
|
4481
4484
|
])
|
|
4482
|
-
], 64)) : y.value &&
|
|
4485
|
+
], 64)) : y.value && c.value === "range" ? (i(), u(Z, { key: 3 }, [
|
|
4483
4486
|
je(vr, {
|
|
4484
4487
|
"data-min": t.stats.dateMin,
|
|
4485
4488
|
"data-max": t.stats.dateMax,
|
|
4486
|
-
"current-range":
|
|
4489
|
+
"current-range": F.value,
|
|
4487
4490
|
"date-format": t.dateFormat,
|
|
4488
|
-
onChange:
|
|
4491
|
+
onChange: N
|
|
4489
4492
|
}, null, 8, ["data-min", "data-max", "current-range", "date-format"]),
|
|
4490
4493
|
e("div", { class: "vpg-filter-footer" }, [
|
|
4491
4494
|
e("button", {
|
|
@@ -4520,8 +4523,8 @@ const Oo = {
|
|
|
4520
4523
|
const s = l instanceof Date ? l : new Date(String(l));
|
|
4521
4524
|
if (Number.isNaN(s.getTime()))
|
|
4522
4525
|
return !1;
|
|
4523
|
-
const a = s.toISOString().split("T")[0], { min: d, max:
|
|
4524
|
-
return !(d !== null && a < d ||
|
|
4526
|
+
const a = s.toISOString().split("T")[0], { min: d, max: v } = n;
|
|
4527
|
+
return !(d !== null && a < d || v !== null && a > v);
|
|
4525
4528
|
}
|
|
4526
4529
|
if (Array.isArray(n) && n.length > 0) {
|
|
4527
4530
|
const l = t.getValue(o), s = l == null || l === "" ? "(blank)" : String(l);
|
|
@@ -4530,25 +4533,25 @@ const Oo = {
|
|
|
4530
4533
|
return !0;
|
|
4531
4534
|
};
|
|
4532
4535
|
function Ur(t) {
|
|
4533
|
-
const { data: o, enableSorting: n = !0, enableFiltering: l = !0 } = t, s = _([]), a = _([]), d = _({}),
|
|
4534
|
-
function
|
|
4535
|
-
const
|
|
4536
|
-
return y.value[
|
|
4536
|
+
const { data: o, enableSorting: n = !0, enableFiltering: l = !0 } = t, s = _([]), a = _([]), d = _({}), v = _(""), y = _({}), c = E(() => o.value.length === 0 ? [] : Object.keys(o.value[0]));
|
|
4537
|
+
function L(S) {
|
|
4538
|
+
const p = `${S}-${o.value.length}`;
|
|
4539
|
+
return y.value[p] || (y.value[p] = xo(o.value, S)), y.value[p];
|
|
4537
4540
|
}
|
|
4538
|
-
function
|
|
4541
|
+
function F() {
|
|
4539
4542
|
y.value = {};
|
|
4540
4543
|
}
|
|
4541
|
-
const
|
|
4542
|
-
const
|
|
4544
|
+
const C = E(() => c.value.map((S) => {
|
|
4545
|
+
const p = L(S);
|
|
4543
4546
|
return {
|
|
4544
4547
|
id: S,
|
|
4545
4548
|
accessorKey: S,
|
|
4546
4549
|
header: S,
|
|
4547
|
-
cell: (m) => So(m.getValue(),
|
|
4550
|
+
cell: (m) => So(m.getValue(), p.type),
|
|
4548
4551
|
filterFn: bn,
|
|
4549
4552
|
meta: {
|
|
4550
|
-
type:
|
|
4551
|
-
uniqueCount:
|
|
4553
|
+
type: p.type,
|
|
4554
|
+
uniqueCount: p.uniqueValues.length
|
|
4552
4555
|
}
|
|
4553
4556
|
};
|
|
4554
4557
|
})), b = Fa({
|
|
@@ -4556,7 +4559,7 @@ function Ur(t) {
|
|
|
4556
4559
|
return o.value;
|
|
4557
4560
|
},
|
|
4558
4561
|
get columns() {
|
|
4559
|
-
return
|
|
4562
|
+
return C.value;
|
|
4560
4563
|
},
|
|
4561
4564
|
state: {
|
|
4562
4565
|
get sorting() {
|
|
@@ -4569,7 +4572,7 @@ function Ur(t) {
|
|
|
4569
4572
|
return d.value;
|
|
4570
4573
|
},
|
|
4571
4574
|
get globalFilter() {
|
|
4572
|
-
return
|
|
4575
|
+
return v.value;
|
|
4573
4576
|
}
|
|
4574
4577
|
},
|
|
4575
4578
|
onSortingChange: (S) => {
|
|
@@ -4586,81 +4589,81 @@ function Ur(t) {
|
|
|
4586
4589
|
},
|
|
4587
4590
|
enableSorting: n,
|
|
4588
4591
|
enableFilters: l
|
|
4589
|
-
}), h =
|
|
4590
|
-
const
|
|
4591
|
-
return
|
|
4592
|
+
}), h = E(() => b.getFilteredRowModel().rows.length), $ = E(() => o.value.length), re = E(() => a.value.map((S) => {
|
|
4593
|
+
const p = S.value;
|
|
4594
|
+
return p && $t(p) ? {
|
|
4592
4595
|
column: S.id,
|
|
4593
4596
|
type: "range",
|
|
4594
|
-
range:
|
|
4597
|
+
range: p,
|
|
4595
4598
|
dateRange: null,
|
|
4596
4599
|
values: []
|
|
4597
|
-
} :
|
|
4600
|
+
} : p && Rt(p) ? {
|
|
4598
4601
|
column: S.id,
|
|
4599
4602
|
type: "dateRange",
|
|
4600
4603
|
range: null,
|
|
4601
|
-
dateRange:
|
|
4604
|
+
dateRange: p,
|
|
4602
4605
|
values: []
|
|
4603
4606
|
} : {
|
|
4604
4607
|
column: S.id,
|
|
4605
4608
|
type: "values",
|
|
4606
|
-
values: Array.isArray(
|
|
4609
|
+
values: Array.isArray(p) ? p : [],
|
|
4607
4610
|
range: null,
|
|
4608
4611
|
dateRange: null
|
|
4609
4612
|
};
|
|
4610
4613
|
}));
|
|
4611
4614
|
function ee(S) {
|
|
4612
|
-
const
|
|
4613
|
-
if (!
|
|
4615
|
+
const p = b.getColumn(S);
|
|
4616
|
+
if (!p)
|
|
4614
4617
|
return !1;
|
|
4615
|
-
const m =
|
|
4618
|
+
const m = p.getFilterValue();
|
|
4616
4619
|
return m ? $t(m) || Rt(m) ? m.min !== null || m.max !== null : Array.isArray(m) && m.length > 0 : !1;
|
|
4617
4620
|
}
|
|
4618
|
-
function U(S,
|
|
4621
|
+
function U(S, p) {
|
|
4619
4622
|
const m = b.getColumn(S);
|
|
4620
|
-
m && (m.setFilterValue(
|
|
4623
|
+
m && (m.setFilterValue(p.length === 0 ? void 0 : p), a.value = b.getState().columnFilters);
|
|
4621
4624
|
}
|
|
4622
|
-
function O(S,
|
|
4625
|
+
function O(S, p) {
|
|
4623
4626
|
const m = b.getColumn(S);
|
|
4624
|
-
m && (!
|
|
4627
|
+
m && (!p || p.min === null && p.max === null ? m.setFilterValue(void 0) : m.setFilterValue(p), a.value = b.getState().columnFilters);
|
|
4625
4628
|
}
|
|
4626
4629
|
function W(S) {
|
|
4627
|
-
const
|
|
4628
|
-
if (!
|
|
4630
|
+
const p = b.getColumn(S);
|
|
4631
|
+
if (!p)
|
|
4629
4632
|
return null;
|
|
4630
|
-
const m =
|
|
4633
|
+
const m = p.getFilterValue();
|
|
4631
4634
|
return m && $t(m) ? m : null;
|
|
4632
4635
|
}
|
|
4633
|
-
function G(S,
|
|
4636
|
+
function G(S, p) {
|
|
4634
4637
|
const m = b.getColumn(S);
|
|
4635
|
-
m && (!
|
|
4638
|
+
m && (!p || p.min === null && p.max === null ? m.setFilterValue(void 0) : m.setFilterValue(p), a.value = b.getState().columnFilters);
|
|
4636
4639
|
}
|
|
4637
4640
|
function X(S) {
|
|
4638
|
-
const
|
|
4639
|
-
if (!
|
|
4641
|
+
const p = b.getColumn(S);
|
|
4642
|
+
if (!p)
|
|
4640
4643
|
return null;
|
|
4641
|
-
const m =
|
|
4644
|
+
const m = p.getFilterValue();
|
|
4642
4645
|
return m && Rt(m) ? m : null;
|
|
4643
4646
|
}
|
|
4644
4647
|
function de() {
|
|
4645
|
-
b.resetColumnFilters(),
|
|
4648
|
+
b.resetColumnFilters(), v.value = "", a.value = [];
|
|
4646
4649
|
}
|
|
4647
4650
|
function J(S) {
|
|
4648
|
-
const
|
|
4649
|
-
if (!
|
|
4651
|
+
const p = b.getColumn(S);
|
|
4652
|
+
if (!p)
|
|
4650
4653
|
return [];
|
|
4651
|
-
const m =
|
|
4654
|
+
const m = p.getFilterValue();
|
|
4652
4655
|
return Array.isArray(m) ? m : [];
|
|
4653
4656
|
}
|
|
4654
4657
|
function ne(S) {
|
|
4655
|
-
const
|
|
4656
|
-
|
|
4658
|
+
const p = s.value.find((m) => m.id === S);
|
|
4659
|
+
p ? p.desc ? s.value = [] : s.value = [{ id: S, desc: !0 }] : s.value = [{ id: S, desc: !1 }];
|
|
4657
4660
|
}
|
|
4658
4661
|
function z(S) {
|
|
4659
|
-
const
|
|
4660
|
-
return
|
|
4662
|
+
const p = s.value.find((m) => m.id === S);
|
|
4663
|
+
return p ? p.desc ? "desc" : "asc" : null;
|
|
4661
4664
|
}
|
|
4662
4665
|
return _e(o, () => {
|
|
4663
|
-
|
|
4666
|
+
F();
|
|
4664
4667
|
}), {
|
|
4665
4668
|
// Table instance
|
|
4666
4669
|
table: b,
|
|
@@ -4668,15 +4671,15 @@ function Ur(t) {
|
|
|
4668
4671
|
sorting: s,
|
|
4669
4672
|
columnFilters: a,
|
|
4670
4673
|
columnVisibility: d,
|
|
4671
|
-
globalFilter:
|
|
4672
|
-
columnKeys:
|
|
4674
|
+
globalFilter: v,
|
|
4675
|
+
columnKeys: c,
|
|
4673
4676
|
// Computed
|
|
4674
4677
|
filteredRowCount: h,
|
|
4675
4678
|
totalRowCount: $,
|
|
4676
4679
|
activeFilters: re,
|
|
4677
4680
|
// Methods
|
|
4678
|
-
getColumnStats:
|
|
4679
|
-
clearStatsCache:
|
|
4681
|
+
getColumnStats: L,
|
|
4682
|
+
clearStatsCache: F,
|
|
4680
4683
|
hasActiveFilter: ee,
|
|
4681
4684
|
setColumnFilter: U,
|
|
4682
4685
|
getColumnFilterValues: J,
|
|
@@ -4704,27 +4707,27 @@ function Yr(t, o, n) {
|
|
|
4704
4707
|
return to(t, o, n);
|
|
4705
4708
|
}
|
|
4706
4709
|
function Ic(t, o = {}) {
|
|
4707
|
-
const n = _(o.pageSize ?? 50), l = _(o.currentPage ?? 1), s =
|
|
4710
|
+
const n = _(o.pageSize ?? 50), l = _(o.currentPage ?? 1), s = E(
|
|
4708
4711
|
() => Math.max(1, Math.ceil(t.value.length / n.value))
|
|
4709
|
-
), a =
|
|
4712
|
+
), a = E(() => {
|
|
4710
4713
|
const h = (l.value - 1) * n.value, $ = h + n.value;
|
|
4711
4714
|
return t.value.slice(h, $);
|
|
4712
|
-
}), d =
|
|
4715
|
+
}), d = E(() => (l.value - 1) * n.value + 1), v = E(
|
|
4713
4716
|
() => Math.min(l.value * n.value, t.value.length)
|
|
4714
4717
|
);
|
|
4715
4718
|
function y(h) {
|
|
4716
4719
|
l.value = Math.max(1, Math.min(h, s.value));
|
|
4717
4720
|
}
|
|
4718
|
-
function
|
|
4721
|
+
function c() {
|
|
4719
4722
|
l.value < s.value && l.value++;
|
|
4720
4723
|
}
|
|
4721
|
-
function
|
|
4724
|
+
function L() {
|
|
4722
4725
|
l.value > 1 && l.value--;
|
|
4723
4726
|
}
|
|
4724
|
-
function
|
|
4727
|
+
function F() {
|
|
4725
4728
|
l.value = 1;
|
|
4726
4729
|
}
|
|
4727
|
-
function
|
|
4730
|
+
function C() {
|
|
4728
4731
|
l.value = s.value;
|
|
4729
4732
|
}
|
|
4730
4733
|
function b(h) {
|
|
@@ -4736,26 +4739,26 @@ function Ic(t, o = {}) {
|
|
|
4736
4739
|
totalPages: s,
|
|
4737
4740
|
paginatedData: a,
|
|
4738
4741
|
startIndex: d,
|
|
4739
|
-
endIndex:
|
|
4742
|
+
endIndex: v,
|
|
4740
4743
|
goToPage: y,
|
|
4741
|
-
nextPage:
|
|
4742
|
-
prevPage:
|
|
4743
|
-
firstPage:
|
|
4744
|
-
lastPage:
|
|
4744
|
+
nextPage: c,
|
|
4745
|
+
prevPage: L,
|
|
4746
|
+
firstPage: F,
|
|
4747
|
+
lastPage: C,
|
|
4745
4748
|
setPageSize: b
|
|
4746
4749
|
};
|
|
4747
4750
|
}
|
|
4748
4751
|
function Uc(t, o) {
|
|
4749
|
-
const n = _(""), l = _(!1), s =
|
|
4752
|
+
const n = _(""), l = _(!1), s = E(() => {
|
|
4750
4753
|
if (!n.value.trim())
|
|
4751
4754
|
return t.value;
|
|
4752
4755
|
const d = l.value ? n.value.trim() : n.value.trim().toLowerCase();
|
|
4753
|
-
return t.value.filter((
|
|
4756
|
+
return t.value.filter((v) => {
|
|
4754
4757
|
for (const y of o.value) {
|
|
4755
|
-
const
|
|
4756
|
-
if (
|
|
4758
|
+
const c = v[y];
|
|
4759
|
+
if (c == null)
|
|
4757
4760
|
continue;
|
|
4758
|
-
if ((l.value ? String(
|
|
4761
|
+
if ((l.value ? String(c) : String(c).toLowerCase()).includes(d))
|
|
4759
4762
|
return !0;
|
|
4760
4763
|
}
|
|
4761
4764
|
return !1;
|
|
@@ -4772,29 +4775,29 @@ function Uc(t, o) {
|
|
|
4772
4775
|
};
|
|
4773
4776
|
}
|
|
4774
4777
|
function Hc(t) {
|
|
4775
|
-
const o = _(/* @__PURE__ */ new Set()), n =
|
|
4778
|
+
const o = _(/* @__PURE__ */ new Set()), n = E(() => Array.from(o.value).sort((b, h) => b - h).map((b) => t.value[b]).filter(Boolean)), l = E(() => t.value.length > 0 && o.value.size === t.value.length), s = E(() => o.value.size > 0 && o.value.size < t.value.length);
|
|
4776
4779
|
function a(b) {
|
|
4777
4780
|
o.value.has(b) ? o.value.delete(b) : o.value.add(b), o.value = new Set(o.value);
|
|
4778
4781
|
}
|
|
4779
4782
|
function d(b) {
|
|
4780
4783
|
o.value.add(b), o.value = new Set(o.value);
|
|
4781
4784
|
}
|
|
4782
|
-
function
|
|
4785
|
+
function v(b) {
|
|
4783
4786
|
o.value.delete(b), o.value = new Set(o.value);
|
|
4784
4787
|
}
|
|
4785
4788
|
function y() {
|
|
4786
4789
|
o.value = new Set(t.value.map((b, h) => h));
|
|
4787
4790
|
}
|
|
4788
|
-
function
|
|
4791
|
+
function c() {
|
|
4789
4792
|
o.value = /* @__PURE__ */ new Set();
|
|
4790
4793
|
}
|
|
4791
|
-
function
|
|
4792
|
-
l.value ?
|
|
4794
|
+
function L() {
|
|
4795
|
+
l.value ? c() : y();
|
|
4793
4796
|
}
|
|
4794
|
-
function
|
|
4797
|
+
function F(b) {
|
|
4795
4798
|
return o.value.has(b);
|
|
4796
4799
|
}
|
|
4797
|
-
function
|
|
4800
|
+
function C(b, h) {
|
|
4798
4801
|
const $ = Math.min(b, h), re = Math.max(b, h);
|
|
4799
4802
|
for (let ee = $; ee <= re; ee++)
|
|
4800
4803
|
o.value.add(ee);
|
|
@@ -4807,33 +4810,33 @@ function Hc(t) {
|
|
|
4807
4810
|
someSelected: s,
|
|
4808
4811
|
toggleRow: a,
|
|
4809
4812
|
selectRow: d,
|
|
4810
|
-
deselectRow:
|
|
4813
|
+
deselectRow: v,
|
|
4811
4814
|
selectAll: y,
|
|
4812
|
-
deselectAll:
|
|
4813
|
-
toggleAll:
|
|
4814
|
-
isSelected:
|
|
4815
|
-
selectRange:
|
|
4815
|
+
deselectAll: c,
|
|
4816
|
+
toggleAll: L,
|
|
4817
|
+
isSelected: F,
|
|
4818
|
+
selectRange: C
|
|
4816
4819
|
};
|
|
4817
4820
|
}
|
|
4818
4821
|
function jc(t, o = 60, n = 600) {
|
|
4819
4822
|
const l = _({ ...t.value }), s = _(!1), a = _(null);
|
|
4820
|
-
function d(
|
|
4821
|
-
s.value = !0, a.value =
|
|
4822
|
-
const
|
|
4823
|
-
const re = $.clientX -
|
|
4823
|
+
function d(c, L) {
|
|
4824
|
+
s.value = !0, a.value = c;
|
|
4825
|
+
const F = L.clientX, C = l.value[c] || 150, b = ($) => {
|
|
4826
|
+
const re = $.clientX - F, ee = Math.max(o, Math.min(n, C + re));
|
|
4824
4827
|
l.value = {
|
|
4825
4828
|
...l.value,
|
|
4826
|
-
[
|
|
4829
|
+
[c]: ee
|
|
4827
4830
|
};
|
|
4828
4831
|
}, h = () => {
|
|
4829
4832
|
s.value = !1, a.value = null, document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", h);
|
|
4830
4833
|
};
|
|
4831
4834
|
document.addEventListener("mousemove", b), document.addEventListener("mouseup", h);
|
|
4832
4835
|
}
|
|
4833
|
-
function c
|
|
4834
|
-
t.value[
|
|
4836
|
+
function v(c) {
|
|
4837
|
+
t.value[c] && (l.value = {
|
|
4835
4838
|
...l.value,
|
|
4836
|
-
[
|
|
4839
|
+
[c]: t.value[c]
|
|
4837
4840
|
});
|
|
4838
4841
|
}
|
|
4839
4842
|
function y() {
|
|
@@ -4844,7 +4847,7 @@ function jc(t, o = 60, n = 600) {
|
|
|
4844
4847
|
isResizing: s,
|
|
4845
4848
|
resizingColumn: a,
|
|
4846
4849
|
startResize: d,
|
|
4847
|
-
resetColumnWidth:
|
|
4850
|
+
resetColumnWidth: v,
|
|
4848
4851
|
resetAllWidths: y
|
|
4849
4852
|
};
|
|
4850
4853
|
}
|
|
@@ -4861,16 +4864,16 @@ function Gc(t) {
|
|
|
4861
4864
|
uo();
|
|
4862
4865
|
}
|
|
4863
4866
|
function Tt() {
|
|
4864
|
-
const t =
|
|
4867
|
+
const t = E(() => Ze.value), o = E(() => Ze.value || yo(Ae.value)), n = E(() => Ze.value || mo(Ae.value)), l = E(
|
|
4865
4868
|
() => Ze.value || Ae.value.features.advancedAggregations
|
|
4866
|
-
), s =
|
|
4869
|
+
), s = E(
|
|
4867
4870
|
() => Ze.value || Ae.value.features.percentageMode
|
|
4868
|
-
), a =
|
|
4869
|
-
function y(
|
|
4870
|
-
return o.value ? !0 : (wo(
|
|
4871
|
+
), a = E(() => Ze.value || fo(Ae.value)), d = E(() => Ze.value || ho(Ae.value)), v = E(() => bo(Ae.value, Ze.value));
|
|
4872
|
+
function y(c) {
|
|
4873
|
+
return o.value ? !0 : (wo(c), !1);
|
|
4871
4874
|
}
|
|
4872
4875
|
return {
|
|
4873
|
-
licenseInfo:
|
|
4876
|
+
licenseInfo: E(() => Ae.value),
|
|
4874
4877
|
isDemo: t,
|
|
4875
4878
|
isPro: o,
|
|
4876
4879
|
canUsePivot: n,
|
|
@@ -4878,28 +4881,28 @@ function Tt() {
|
|
|
4878
4881
|
canUsePercentageMode: s,
|
|
4879
4882
|
canUseCharts: a,
|
|
4880
4883
|
canUseAIAnalyst: d,
|
|
4881
|
-
showWatermark:
|
|
4884
|
+
showWatermark: v,
|
|
4882
4885
|
requirePro: y
|
|
4883
4886
|
};
|
|
4884
4887
|
}
|
|
4885
4888
|
function Kr(t) {
|
|
4886
|
-
const { canUsePivot: o, requirePro: n } = Tt(), l = _([]), s = _([]), a = _([]), d = _(!0),
|
|
4887
|
-
|
|
4889
|
+
const { canUsePivot: o, requirePro: n } = Tt(), l = _([]), s = _([]), a = _([]), d = _(!0), v = _(!0), y = _(Nn()), c = _(null), L = E(() => Do(t.value)), F = E(() => Ao(
|
|
4890
|
+
L.value,
|
|
4888
4891
|
l.value,
|
|
4889
4892
|
s.value,
|
|
4890
4893
|
a.value
|
|
4891
|
-
)),
|
|
4894
|
+
)), C = E(() => Tn({
|
|
4892
4895
|
rowFields: l.value,
|
|
4893
4896
|
columnFields: s.value,
|
|
4894
4897
|
valueFields: a.value,
|
|
4895
4898
|
showRowTotals: d.value,
|
|
4896
|
-
showColumnTotals:
|
|
4897
|
-
})), b =
|
|
4899
|
+
showColumnTotals: v.value
|
|
4900
|
+
})), b = E(() => !C.value || !o.value ? null : _o(t.value, {
|
|
4898
4901
|
rowFields: l.value,
|
|
4899
4902
|
columnFields: s.value,
|
|
4900
4903
|
valueFields: a.value,
|
|
4901
4904
|
showRowTotals: d.value,
|
|
4902
|
-
showColumnTotals:
|
|
4905
|
+
showColumnTotals: v.value,
|
|
4903
4906
|
calculatedFields: y.value
|
|
4904
4907
|
}));
|
|
4905
4908
|
function h(z) {
|
|
@@ -4915,15 +4918,15 @@ function Kr(t) {
|
|
|
4915
4918
|
s.value = s.value.filter((S) => S !== z);
|
|
4916
4919
|
}
|
|
4917
4920
|
function U(z, S = "sum") {
|
|
4918
|
-
S !== "sum" && !n(`${S} aggregation`) || a.value.some((
|
|
4921
|
+
S !== "sum" && !n(`${S} aggregation`) || a.value.some((p) => p.field === z && p.aggregation === S) || (a.value = [...a.value, { field: z, aggregation: S }]);
|
|
4919
4922
|
}
|
|
4920
4923
|
function O(z, S) {
|
|
4921
4924
|
S ? a.value = a.value.filter(
|
|
4922
|
-
(
|
|
4923
|
-
) : a.value = a.value.filter((
|
|
4925
|
+
(p) => !(p.field === z && p.aggregation === S)
|
|
4926
|
+
) : a.value = a.value.filter((p) => p.field !== z);
|
|
4924
4927
|
}
|
|
4925
|
-
function W(z, S,
|
|
4926
|
-
a.value = a.value.map((m) => m.field === z && m.aggregation === S ? { ...m, aggregation:
|
|
4928
|
+
function W(z, S, p) {
|
|
4929
|
+
a.value = a.value.map((m) => m.field === z && m.aggregation === S ? { ...m, aggregation: p } : m);
|
|
4927
4930
|
}
|
|
4928
4931
|
function G() {
|
|
4929
4932
|
l.value = [], s.value = [], a.value = [];
|
|
@@ -4931,22 +4934,22 @@ function Kr(t) {
|
|
|
4931
4934
|
function X(z, S) {
|
|
4932
4935
|
if (z.area === S.area) {
|
|
4933
4936
|
if (z.area === "row") {
|
|
4934
|
-
const
|
|
4935
|
-
|
|
4937
|
+
const p = [...l.value], [m] = p.splice(z.index, 1);
|
|
4938
|
+
p.splice(S.index, 0, m), l.value = p;
|
|
4936
4939
|
} else if (z.area === "column") {
|
|
4937
|
-
const
|
|
4938
|
-
|
|
4940
|
+
const p = [...s.value], [m] = p.splice(z.index, 1);
|
|
4941
|
+
p.splice(S.index, 0, m), s.value = p;
|
|
4939
4942
|
}
|
|
4940
4943
|
}
|
|
4941
4944
|
}
|
|
4942
4945
|
function de() {
|
|
4943
|
-
if (!n("Pivot Table - Auto Suggest") ||
|
|
4946
|
+
if (!n("Pivot Table - Auto Suggest") || L.value.length === 0)
|
|
4944
4947
|
return;
|
|
4945
|
-
const z =
|
|
4948
|
+
const z = L.value.filter((p) => !p.isNumeric && p.uniqueCount < 50), S = L.value.filter((p) => p.isNumeric);
|
|
4946
4949
|
z.length > 0 && S.length > 0 && (l.value = [z[0].field], a.value = [{ field: S[0].field, aggregation: "sum" }]);
|
|
4947
4950
|
}
|
|
4948
4951
|
function J(z) {
|
|
4949
|
-
const S = y.value.findIndex((
|
|
4952
|
+
const S = y.value.findIndex((p) => p.id === z.id);
|
|
4950
4953
|
S >= 0 ? y.value = [
|
|
4951
4954
|
...y.value.slice(0, S),
|
|
4952
4955
|
z,
|
|
@@ -4961,21 +4964,21 @@ function Kr(t) {
|
|
|
4961
4964
|
(z) => {
|
|
4962
4965
|
if (z.length === 0)
|
|
4963
4966
|
return;
|
|
4964
|
-
const S = Object.keys(z[0]),
|
|
4965
|
-
if (
|
|
4966
|
-
|
|
4967
|
-
const m = Lo(
|
|
4967
|
+
const S = Object.keys(z[0]), p = Eo(S);
|
|
4968
|
+
if (p !== c.value) {
|
|
4969
|
+
c.value = p;
|
|
4970
|
+
const m = Lo(p);
|
|
4968
4971
|
if (m && Vt(m, S))
|
|
4969
|
-
l.value = m.rowFields, s.value = m.columnFields, a.value = m.valueFields, d.value = m.showRowTotals,
|
|
4972
|
+
l.value = m.rowFields, s.value = m.columnFields, a.value = m.valueFields, d.value = m.showRowTotals, v.value = m.showColumnTotals, m.calculatedFields && (y.value = m.calculatedFields);
|
|
4970
4973
|
else {
|
|
4971
|
-
const
|
|
4974
|
+
const N = {
|
|
4972
4975
|
rowFields: l.value,
|
|
4973
4976
|
columnFields: s.value,
|
|
4974
4977
|
valueFields: a.value,
|
|
4975
4978
|
showRowTotals: d.value,
|
|
4976
|
-
showColumnTotals:
|
|
4979
|
+
showColumnTotals: v.value
|
|
4977
4980
|
};
|
|
4978
|
-
Vt(
|
|
4981
|
+
Vt(N, S) || G();
|
|
4979
4982
|
}
|
|
4980
4983
|
} else {
|
|
4981
4984
|
const m = {
|
|
@@ -4983,26 +4986,26 @@ function Kr(t) {
|
|
|
4983
4986
|
columnFields: s.value,
|
|
4984
4987
|
valueFields: a.value,
|
|
4985
4988
|
showRowTotals: d.value,
|
|
4986
|
-
showColumnTotals:
|
|
4989
|
+
showColumnTotals: v.value
|
|
4987
4990
|
};
|
|
4988
4991
|
Vt(m, S) || G();
|
|
4989
4992
|
}
|
|
4990
4993
|
},
|
|
4991
4994
|
{ immediate: !0 }
|
|
4992
4995
|
), _e(
|
|
4993
|
-
[l, s, a, d,
|
|
4996
|
+
[l, s, a, d, v, y],
|
|
4994
4997
|
() => {
|
|
4995
|
-
if (!
|
|
4998
|
+
if (!c.value)
|
|
4996
4999
|
return;
|
|
4997
5000
|
const z = {
|
|
4998
5001
|
rowFields: l.value,
|
|
4999
5002
|
columnFields: s.value,
|
|
5000
5003
|
valueFields: a.value,
|
|
5001
5004
|
showRowTotals: d.value,
|
|
5002
|
-
showColumnTotals:
|
|
5005
|
+
showColumnTotals: v.value,
|
|
5003
5006
|
calculatedFields: y.value
|
|
5004
5007
|
};
|
|
5005
|
-
No(
|
|
5008
|
+
No(c.value, z);
|
|
5006
5009
|
},
|
|
5007
5010
|
{ deep: !0 }
|
|
5008
5011
|
), {
|
|
@@ -5011,12 +5014,12 @@ function Kr(t) {
|
|
|
5011
5014
|
columnFields: s,
|
|
5012
5015
|
valueFields: a,
|
|
5013
5016
|
showRowTotals: d,
|
|
5014
|
-
showColumnTotals:
|
|
5017
|
+
showColumnTotals: v,
|
|
5015
5018
|
calculatedFields: y,
|
|
5016
5019
|
// Computed
|
|
5017
|
-
availableFields:
|
|
5018
|
-
unassignedFields:
|
|
5019
|
-
isConfigured:
|
|
5020
|
+
availableFields: L,
|
|
5021
|
+
unassignedFields: F,
|
|
5022
|
+
isConfigured: C,
|
|
5020
5023
|
pivotResult: b,
|
|
5021
5024
|
// Actions
|
|
5022
5025
|
addRowField: h,
|
|
@@ -5059,61 +5062,61 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5059
5062
|
emits: ["update:showRowTotals", "update:showColumnTotals", "clearConfig", "dragStart", "dragEnd", "updateAggregation", "addRowField", "removeRowField", "addColumnField", "removeColumnField", "addValueField", "removeValueField", "addCalculatedField", "removeCalculatedField", "updateCalculatedField"],
|
|
5060
5063
|
setup(t, { emit: o }) {
|
|
5061
5064
|
const n = t, l = o, { canUseAdvancedAggregations: s } = Tt(), a = $o;
|
|
5062
|
-
function d(
|
|
5063
|
-
return
|
|
5065
|
+
function d(p) {
|
|
5066
|
+
return p !== "sum";
|
|
5064
5067
|
}
|
|
5065
|
-
function
|
|
5066
|
-
return !d(
|
|
5068
|
+
function v(p) {
|
|
5069
|
+
return !d(p) || s.value;
|
|
5067
5070
|
}
|
|
5068
|
-
const y = _(!1),
|
|
5069
|
-
() => n.availableFields.filter((
|
|
5071
|
+
const y = _(!1), c = _(null), L = E(
|
|
5072
|
+
() => n.availableFields.filter((p) => p.isNumeric).map((p) => p.field)
|
|
5070
5073
|
);
|
|
5071
|
-
function
|
|
5072
|
-
|
|
5074
|
+
function F(p) {
|
|
5075
|
+
c.value = p || null, y.value = !0;
|
|
5073
5076
|
}
|
|
5074
|
-
function
|
|
5075
|
-
|
|
5077
|
+
function C(p) {
|
|
5078
|
+
c.value ? l("updateCalculatedField", p) : l("addCalculatedField", p), y.value = !1, c.value = null;
|
|
5076
5079
|
}
|
|
5077
|
-
function b(
|
|
5078
|
-
l("update:showRowTotals",
|
|
5080
|
+
function b(p) {
|
|
5081
|
+
l("update:showRowTotals", p), l("update:showColumnTotals", p);
|
|
5079
5082
|
}
|
|
5080
|
-
const h =
|
|
5081
|
-
field: `calc:${
|
|
5083
|
+
const h = E(() => n.calculatedFields ? n.calculatedFields.map((p) => ({
|
|
5084
|
+
field: `calc:${p.id}`,
|
|
5082
5085
|
type: "number",
|
|
5083
5086
|
uniqueCount: 0,
|
|
5084
5087
|
isNumeric: !0,
|
|
5085
5088
|
isCalculated: !0,
|
|
5086
|
-
calcId:
|
|
5087
|
-
calcName:
|
|
5088
|
-
calcFormula:
|
|
5089
|
-
})) : []), $ =
|
|
5090
|
-
...n.availableFields.map((
|
|
5089
|
+
calcId: p.id,
|
|
5090
|
+
calcName: p.name,
|
|
5091
|
+
calcFormula: p.formula
|
|
5092
|
+
})) : []), $ = E(() => [
|
|
5093
|
+
...n.availableFields.map((p) => ({ ...p, isCalculated: !1 })),
|
|
5091
5094
|
...h.value
|
|
5092
|
-
]), re =
|
|
5093
|
-
const
|
|
5094
|
-
return $.value.filter((H) =>
|
|
5095
|
+
]), re = E(() => {
|
|
5096
|
+
const p = new Set(n.rowFields), m = new Set(n.columnFields), N = new Map(n.valueFields.map((H) => [H.field, H]));
|
|
5097
|
+
return $.value.filter((H) => p.has(H.field) || m.has(H.field) || N.has(H.field)).map((H) => ({
|
|
5095
5098
|
...H,
|
|
5096
|
-
assignedTo:
|
|
5097
|
-
valueConfig:
|
|
5099
|
+
assignedTo: p.has(H.field) ? "row" : m.has(H.field) ? "column" : "value",
|
|
5100
|
+
valueConfig: N.get(H.field)
|
|
5098
5101
|
}));
|
|
5099
|
-
}), ee =
|
|
5100
|
-
const
|
|
5102
|
+
}), ee = E(() => {
|
|
5103
|
+
const p = new Set(n.rowFields), m = new Set(n.columnFields), N = new Set(n.valueFields.map((H) => H.field));
|
|
5101
5104
|
return $.value.filter(
|
|
5102
|
-
(H) => !
|
|
5105
|
+
(H) => !p.has(H.field) && !m.has(H.field) && !N.has(H.field)
|
|
5103
5106
|
);
|
|
5104
|
-
}), U =
|
|
5107
|
+
}), U = E(() => re.value.length), O = _(""), W = E(() => {
|
|
5105
5108
|
if (!O.value.trim())
|
|
5106
5109
|
return ee.value;
|
|
5107
|
-
const
|
|
5110
|
+
const p = O.value.toLowerCase().trim();
|
|
5108
5111
|
return ee.value.filter((m) => {
|
|
5109
|
-
const
|
|
5110
|
-
return
|
|
5112
|
+
const N = m.field.toLowerCase(), H = m.isCalculated && m.calcName ? m.calcName.toLowerCase() : "";
|
|
5113
|
+
return N.includes(p) || H.includes(p);
|
|
5111
5114
|
});
|
|
5112
5115
|
});
|
|
5113
|
-
function G(
|
|
5116
|
+
function G(p, m) {
|
|
5114
5117
|
if (m)
|
|
5115
5118
|
return "ƒ";
|
|
5116
|
-
switch (
|
|
5119
|
+
switch (p) {
|
|
5117
5120
|
case "number":
|
|
5118
5121
|
return "#";
|
|
5119
5122
|
case "date":
|
|
@@ -5124,30 +5127,30 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5124
5127
|
return "Aa";
|
|
5125
5128
|
}
|
|
5126
5129
|
}
|
|
5127
|
-
function X(
|
|
5128
|
-
return
|
|
5130
|
+
function X(p) {
|
|
5131
|
+
return p.isCalculated && p.calcName ? p.calcName : p.field;
|
|
5129
5132
|
}
|
|
5130
|
-
function de(
|
|
5131
|
-
var
|
|
5132
|
-
(
|
|
5133
|
+
function de(p, m) {
|
|
5134
|
+
var N;
|
|
5135
|
+
(N = m.dataTransfer) == null || N.setData("text/plain", p), m.dataTransfer.effectAllowed = "move", l("dragStart", p, m);
|
|
5133
5136
|
}
|
|
5134
5137
|
function J() {
|
|
5135
5138
|
l("dragEnd");
|
|
5136
5139
|
}
|
|
5137
|
-
function ne(
|
|
5138
|
-
if (!
|
|
5139
|
-
console.warn(`[TinyPivot] "${
|
|
5140
|
+
function ne(p, m, N) {
|
|
5141
|
+
if (!v(N)) {
|
|
5142
|
+
console.warn(`[TinyPivot] "${N}" aggregation requires a Pro license. Visit https://tiny-pivot.com/#pricing to upgrade.`);
|
|
5140
5143
|
return;
|
|
5141
5144
|
}
|
|
5142
|
-
l("updateAggregation",
|
|
5145
|
+
l("updateAggregation", p, m, N);
|
|
5143
5146
|
}
|
|
5144
|
-
function z(
|
|
5145
|
-
m === "row" ? (l("removeRowField",
|
|
5147
|
+
function z(p, m) {
|
|
5148
|
+
m === "row" ? (l("removeRowField", p), l("addColumnField", p)) : (l("removeColumnField", p), l("addRowField", p));
|
|
5146
5149
|
}
|
|
5147
|
-
function S(
|
|
5148
|
-
m === "row" ? l("removeRowField",
|
|
5150
|
+
function S(p, m, N) {
|
|
5151
|
+
m === "row" ? l("removeRowField", p) : m === "column" ? l("removeColumnField", p) : N && l("removeValueField", p, N.aggregation);
|
|
5149
5152
|
}
|
|
5150
|
-
return (
|
|
5153
|
+
return (p, m) => (i(), u("div", Jr, [
|
|
5151
5154
|
e("div", Qr, [
|
|
5152
5155
|
m[8] || (m[8] = e("h3", { class: "vpg-config-title" }, [
|
|
5153
5156
|
e("svg", {
|
|
@@ -5170,7 +5173,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5170
5173
|
key: 0,
|
|
5171
5174
|
class: "vpg-action-btn vpg-clear-btn",
|
|
5172
5175
|
title: "Clear all",
|
|
5173
|
-
onClick: m[0] || (m[0] = (
|
|
5176
|
+
onClick: m[0] || (m[0] = (N) => l("clearConfig"))
|
|
5174
5177
|
}, [...m[7] || (m[7] = [
|
|
5175
5178
|
e("svg", {
|
|
5176
5179
|
class: "vpg-icon-sm",
|
|
@@ -5191,28 +5194,28 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5191
5194
|
U.value > 0 ? (i(), u("div", Zr, [
|
|
5192
5195
|
m[10] || (m[10] = e("div", { class: "vpg-section-label" }, " Active ", -1)),
|
|
5193
5196
|
e("div", ei, [
|
|
5194
|
-
(i(!0), u(Z, null, ve(re.value, (
|
|
5197
|
+
(i(!0), u(Z, null, ve(re.value, (N) => {
|
|
5195
5198
|
var H;
|
|
5196
5199
|
return i(), u("div", {
|
|
5197
|
-
key:
|
|
5198
|
-
class: ue(["vpg-assigned-item", [`vpg-type-${
|
|
5199
|
-
title:
|
|
5200
|
+
key: N.field,
|
|
5201
|
+
class: ue(["vpg-assigned-item", [`vpg-type-${N.assignedTo}`, { "vpg-type-calc": N.isCalculated }]]),
|
|
5202
|
+
title: N.isCalculated ? N.calcFormula : N.field,
|
|
5200
5203
|
draggable: "true",
|
|
5201
|
-
onDragstart: (se) => de(
|
|
5204
|
+
onDragstart: (se) => de(N.field, se),
|
|
5202
5205
|
onDragend: J
|
|
5203
5206
|
}, [
|
|
5204
5207
|
e("div", ni, [
|
|
5205
5208
|
e("span", {
|
|
5206
|
-
class: ue(["vpg-item-badge", [
|
|
5207
|
-
},
|
|
5208
|
-
e("span", ai,
|
|
5209
|
+
class: ue(["vpg-item-badge", [N.assignedTo, { calc: N.isCalculated }]])
|
|
5210
|
+
}, k(N.isCalculated ? "ƒ" : N.assignedTo === "row" ? "R" : N.assignedTo === "column" ? "C" : A(An)(((H = N.valueConfig) == null ? void 0 : H.aggregation) || "sum")), 3),
|
|
5211
|
+
e("span", ai, k(X(N)), 1)
|
|
5209
5212
|
]),
|
|
5210
5213
|
e("div", oi, [
|
|
5211
|
-
|
|
5214
|
+
N.assignedTo === "row" || N.assignedTo === "column" ? (i(), u("button", {
|
|
5212
5215
|
key: 0,
|
|
5213
5216
|
class: "vpg-toggle-btn",
|
|
5214
|
-
title:
|
|
5215
|
-
onClick: He((se) => z(
|
|
5217
|
+
title: N.assignedTo === "row" ? "Move to Columns" : "Move to Rows",
|
|
5218
|
+
onClick: He((se) => z(N.field, N.assignedTo), ["stop"])
|
|
5216
5219
|
}, [...m[9] || (m[9] = [
|
|
5217
5220
|
e("svg", {
|
|
5218
5221
|
class: "vpg-icon-xs",
|
|
@@ -5228,11 +5231,11 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5228
5231
|
})
|
|
5229
5232
|
], -1)
|
|
5230
5233
|
])], 8, si)) : P("", !0),
|
|
5231
|
-
|
|
5234
|
+
N.assignedTo === "value" && N.valueConfig ? (i(), u("select", {
|
|
5232
5235
|
key: 1,
|
|
5233
5236
|
class: "vpg-agg-select",
|
|
5234
|
-
value:
|
|
5235
|
-
onChange: (se) => ne(
|
|
5237
|
+
value: N.valueConfig.aggregation,
|
|
5238
|
+
onChange: (se) => ne(N.field, N.valueConfig.aggregation, se.target.value),
|
|
5236
5239
|
onClick: m[1] || (m[1] = He(() => {
|
|
5237
5240
|
}, ["stop"]))
|
|
5238
5241
|
}, [
|
|
@@ -5240,12 +5243,12 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5240
5243
|
key: se.value,
|
|
5241
5244
|
value: se.value,
|
|
5242
5245
|
disabled: d(se.value) && !A(s)
|
|
5243
|
-
},
|
|
5246
|
+
}, k(se.symbol) + " " + k(se.label) + k(d(se.value) && !A(s) ? " (Pro)" : ""), 9, ri))), 128))
|
|
5244
5247
|
], 40, li)) : P("", !0),
|
|
5245
5248
|
e("button", {
|
|
5246
5249
|
class: "vpg-remove-btn",
|
|
5247
5250
|
title: "Remove",
|
|
5248
|
-
onClick: He((se) => S(
|
|
5251
|
+
onClick: He((se) => S(N.field, N.assignedTo, N.valueConfig), ["stop"])
|
|
5249
5252
|
}, " × ", 8, ii)
|
|
5250
5253
|
])
|
|
5251
5254
|
], 42, ti);
|
|
@@ -5256,7 +5259,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5256
5259
|
e("div", ci, [
|
|
5257
5260
|
e("div", di, [
|
|
5258
5261
|
m[11] || (m[11] = ce(" Available ", -1)),
|
|
5259
|
-
e("span", vi,
|
|
5262
|
+
e("span", vi, k(ee.value.length), 1)
|
|
5260
5263
|
])
|
|
5261
5264
|
]),
|
|
5262
5265
|
e("div", pi, [
|
|
@@ -5274,7 +5277,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5274
5277
|
})
|
|
5275
5278
|
], -1)),
|
|
5276
5279
|
Oe(e("input", {
|
|
5277
|
-
"onUpdate:modelValue": m[2] || (m[2] = (
|
|
5280
|
+
"onUpdate:modelValue": m[2] || (m[2] = (N) => O.value = N),
|
|
5278
5281
|
type: "text",
|
|
5279
5282
|
placeholder: "Search fields...",
|
|
5280
5283
|
class: "vpg-search-input"
|
|
@@ -5284,7 +5287,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5284
5287
|
O.value ? (i(), u("button", {
|
|
5285
5288
|
key: 0,
|
|
5286
5289
|
class: "vpg-clear-search",
|
|
5287
|
-
onClick: m[3] || (m[3] = (
|
|
5290
|
+
onClick: m[3] || (m[3] = (N) => O.value = "")
|
|
5288
5291
|
}, [...m[12] || (m[12] = [
|
|
5289
5292
|
e("svg", {
|
|
5290
5293
|
class: "vpg-icon-xs",
|
|
@@ -5302,38 +5305,38 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5302
5305
|
])])) : P("", !0)
|
|
5303
5306
|
]),
|
|
5304
5307
|
e("div", gi, [
|
|
5305
|
-
(i(!0), u(Z, null, ve(W.value, (
|
|
5306
|
-
key:
|
|
5308
|
+
(i(!0), u(Z, null, ve(W.value, (N) => (i(), u("div", {
|
|
5309
|
+
key: N.field,
|
|
5307
5310
|
class: ue(["vpg-field-item", {
|
|
5308
|
-
"vpg-is-numeric":
|
|
5309
|
-
"vpg-is-calculated":
|
|
5311
|
+
"vpg-is-numeric": N.isNumeric && !N.isCalculated,
|
|
5312
|
+
"vpg-is-calculated": N.isCalculated
|
|
5310
5313
|
}]),
|
|
5311
|
-
title:
|
|
5314
|
+
title: N.isCalculated ? N.calcFormula : N.field,
|
|
5312
5315
|
draggable: "true",
|
|
5313
|
-
onDragstart: (H) => de(
|
|
5316
|
+
onDragstart: (H) => de(N.field, H),
|
|
5314
5317
|
onDragend: J
|
|
5315
5318
|
}, [
|
|
5316
5319
|
e("span", {
|
|
5317
|
-
class: ue(["vpg-field-type-icon", { "vpg-calc-type":
|
|
5318
|
-
},
|
|
5319
|
-
e("span", fi,
|
|
5320
|
-
|
|
5320
|
+
class: ue(["vpg-field-type-icon", { "vpg-calc-type": N.isCalculated }])
|
|
5321
|
+
}, k(G(N.type, N.isCalculated)), 3),
|
|
5322
|
+
e("span", fi, k(X(N)), 1),
|
|
5323
|
+
N.isCalculated ? (i(), u(Z, { key: 0 }, [
|
|
5321
5324
|
e("button", {
|
|
5322
5325
|
class: "vpg-field-edit",
|
|
5323
5326
|
title: "Edit calculated field",
|
|
5324
5327
|
onClick: He((H) => {
|
|
5325
5328
|
var se;
|
|
5326
|
-
return
|
|
5329
|
+
return F((se = t.calculatedFields) == null ? void 0 : se.find((D) => D.id === N.calcId));
|
|
5327
5330
|
}, ["stop"])
|
|
5328
5331
|
}, " ✎ ", 8, hi),
|
|
5329
5332
|
e("button", {
|
|
5330
5333
|
class: "vpg-field-delete",
|
|
5331
5334
|
title: "Delete calculated field",
|
|
5332
|
-
onClick: He((H) =>
|
|
5335
|
+
onClick: He((H) => N.calcId && l("removeCalculatedField", N.calcId), ["stop"])
|
|
5333
5336
|
}, " × ", 8, yi)
|
|
5334
|
-
], 64)) : (i(), u("span", bi,
|
|
5337
|
+
], 64)) : (i(), u("span", bi, k(N.uniqueCount), 1))
|
|
5335
5338
|
], 42, mi))), 128)),
|
|
5336
|
-
W.value.length === 0 && O.value ? (i(), u("div", wi, ' No fields match "' +
|
|
5339
|
+
W.value.length === 0 && O.value ? (i(), u("div", wi, ' No fields match "' + k(O.value) + '" ', 1)) : ee.value.length === 0 ? (i(), u("div", Ci, " All fields assigned ")) : P("", !0)
|
|
5337
5340
|
])
|
|
5338
5341
|
]),
|
|
5339
5342
|
e("div", ki, [
|
|
@@ -5341,14 +5344,14 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5341
5344
|
e("input", {
|
|
5342
5345
|
type: "checkbox",
|
|
5343
5346
|
checked: t.showRowTotals,
|
|
5344
|
-
onChange: m[4] || (m[4] = (
|
|
5347
|
+
onChange: m[4] || (m[4] = (N) => b(N.target.checked))
|
|
5345
5348
|
}, null, 40, Si),
|
|
5346
5349
|
m[14] || (m[14] = e("span", null, "Totals", -1))
|
|
5347
5350
|
]),
|
|
5348
5351
|
e("button", {
|
|
5349
5352
|
class: "vpg-calc-btn",
|
|
5350
5353
|
title: "Add calculated field (e.g. Profit Margin %)",
|
|
5351
|
-
onClick: m[5] || (m[5] = (
|
|
5354
|
+
onClick: m[5] || (m[5] = (N) => F())
|
|
5352
5355
|
}, [...m[15] || (m[15] = [
|
|
5353
5356
|
e("span", { class: "vpg-calc-icon" }, "ƒ", -1),
|
|
5354
5357
|
e("span", null, "+ Calc", -1)
|
|
@@ -5356,12 +5359,12 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5356
5359
|
]),
|
|
5357
5360
|
je(el, {
|
|
5358
5361
|
show: y.value,
|
|
5359
|
-
"available-fields":
|
|
5360
|
-
"existing-field":
|
|
5361
|
-
onClose: m[6] || (m[6] = (
|
|
5362
|
-
y.value = !1,
|
|
5362
|
+
"available-fields": L.value,
|
|
5363
|
+
"existing-field": c.value,
|
|
5364
|
+
onClose: m[6] || (m[6] = (N) => {
|
|
5365
|
+
y.value = !1, c.value = null;
|
|
5363
5366
|
}),
|
|
5364
|
-
onSave:
|
|
5367
|
+
onSave: C
|
|
5365
5368
|
}, null, 8, ["show", "available-fields", "existing-field"])
|
|
5366
5369
|
]));
|
|
5367
5370
|
}
|
|
@@ -5456,11 +5459,11 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5456
5459
|
function a(j) {
|
|
5457
5460
|
return j.startsWith("calc:");
|
|
5458
5461
|
}
|
|
5459
|
-
const { showWatermark: d, canUsePivot:
|
|
5462
|
+
const { showWatermark: d, canUsePivot: v, isDemo: y } = Tt(), c = _(null), L = _(null), F = _(null), C = _(n.fontSize || "xs"), b = [
|
|
5460
5463
|
{ value: "xs", label: "S" },
|
|
5461
5464
|
{ value: "sm", label: "M" },
|
|
5462
5465
|
{ value: "base", label: "L" }
|
|
5463
|
-
], h =
|
|
5466
|
+
], h = E(() => n.activeFilters && n.activeFilters.length > 0), $ = E(() => !n.activeFilters || n.activeFilters.length === 0 ? "" : n.activeFilters.map((w) => w.column).join(", ")), re = E(() => !n.activeFilters || n.activeFilters.length === 0 ? [] : n.activeFilters.map((j) => {
|
|
5464
5467
|
if (j.isRange && j.displayText)
|
|
5465
5468
|
return {
|
|
5466
5469
|
column: j.column,
|
|
@@ -5480,7 +5483,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5480
5483
|
function W(j = "row") {
|
|
5481
5484
|
O.value === j ? U.value = U.value === "asc" ? "desc" : "asc" : (O.value = j, U.value = "asc");
|
|
5482
5485
|
}
|
|
5483
|
-
const G =
|
|
5486
|
+
const G = E(() => {
|
|
5484
5487
|
if (!n.pivotResult)
|
|
5485
5488
|
return [];
|
|
5486
5489
|
const j = n.pivotResult.rowHeaders.map((B, K) => K), w = n.pivotResult.rowHeaders, oe = n.pivotResult.data;
|
|
@@ -5496,7 +5499,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5496
5499
|
}
|
|
5497
5500
|
return U.value === "asc" ? ae : -ae;
|
|
5498
5501
|
}), j;
|
|
5499
|
-
}), X =
|
|
5502
|
+
}), X = E(() => {
|
|
5500
5503
|
if (!n.pivotResult || n.pivotResult.headers.length === 0)
|
|
5501
5504
|
return [n.valueFields.map((w) => ({
|
|
5502
5505
|
label: a(w.field) ? `${s(w.field)} (${_t(w.aggregation)})` : `${w.field} (${_t(w.aggregation)})`,
|
|
@@ -5516,13 +5519,13 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5516
5519
|
j.push(B);
|
|
5517
5520
|
}
|
|
5518
5521
|
return j;
|
|
5519
|
-
}), de = _(null), J = _(null), ne = _(null), z = _(!1), S = _(!1),
|
|
5522
|
+
}), de = _(null), J = _(null), ne = _(null), z = _(!1), S = _(!1), p = _(""), m = E(() => !J.value || !ne.value ? null : {
|
|
5520
5523
|
minRow: Math.min(J.value.row, ne.value.row),
|
|
5521
5524
|
maxRow: Math.max(J.value.row, ne.value.row),
|
|
5522
5525
|
minCol: Math.min(J.value.col, ne.value.col),
|
|
5523
5526
|
maxCol: Math.max(J.value.col, ne.value.col)
|
|
5524
5527
|
});
|
|
5525
|
-
function
|
|
5528
|
+
function N(j, w, oe) {
|
|
5526
5529
|
oe.preventDefault(), oe.shiftKey && de.value ? ne.value = { row: j, col: w } : (de.value = { row: j, col: w }, J.value = { row: j, col: w }, ne.value = { row: j, col: w }, z.value = !0);
|
|
5527
5530
|
}
|
|
5528
5531
|
function H(j, w) {
|
|
@@ -5558,7 +5561,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5558
5561
|
`);
|
|
5559
5562
|
navigator.clipboard.writeText(ae).then(() => {
|
|
5560
5563
|
const we = (w - j + 1) * (B - oe + 1);
|
|
5561
|
-
|
|
5564
|
+
p.value = `Copied ${we} cell${we > 1 ? "s" : ""}`, S.value = !0, setTimeout(() => {
|
|
5562
5565
|
S.value = !1;
|
|
5563
5566
|
}, 2e3);
|
|
5564
5567
|
}).catch((we) => {
|
|
@@ -5574,7 +5577,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5574
5577
|
j.key === "Escape" && (de.value = null, J.value = null, ne.value = null);
|
|
5575
5578
|
}
|
|
5576
5579
|
}
|
|
5577
|
-
const f =
|
|
5580
|
+
const f = E(() => {
|
|
5578
5581
|
var qe;
|
|
5579
5582
|
if (!m.value || !n.pivotResult)
|
|
5580
5583
|
return null;
|
|
@@ -5606,18 +5609,18 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5606
5609
|
}), Bt(() => {
|
|
5607
5610
|
document.removeEventListener("mouseup", se), document.removeEventListener("keydown", I);
|
|
5608
5611
|
});
|
|
5609
|
-
function
|
|
5610
|
-
w.preventDefault(), w.dataTransfer.dropEffect = "move",
|
|
5612
|
+
function M(j, w) {
|
|
5613
|
+
w.preventDefault(), w.dataTransfer.dropEffect = "move", c.value = j;
|
|
5611
5614
|
}
|
|
5612
5615
|
function Q() {
|
|
5613
|
-
|
|
5616
|
+
c.value = null;
|
|
5614
5617
|
}
|
|
5615
5618
|
function le(j, w) {
|
|
5616
5619
|
var K;
|
|
5617
5620
|
w.preventDefault();
|
|
5618
5621
|
const oe = (K = w.dataTransfer) == null ? void 0 : K.getData("text/plain");
|
|
5619
5622
|
if (!oe || oe.startsWith("reorder:")) {
|
|
5620
|
-
|
|
5623
|
+
c.value = null;
|
|
5621
5624
|
return;
|
|
5622
5625
|
}
|
|
5623
5626
|
n.rowFields.includes(oe) && l("removeRowField", oe), n.columnFields.includes(oe) && l("removeColumnField", oe);
|
|
@@ -5633,42 +5636,42 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5633
5636
|
l("addValueField", oe, "sum");
|
|
5634
5637
|
break;
|
|
5635
5638
|
}
|
|
5636
|
-
|
|
5639
|
+
c.value = null;
|
|
5637
5640
|
}
|
|
5638
5641
|
function T(j, w, oe) {
|
|
5639
|
-
|
|
5640
|
-
|
|
5642
|
+
L.value = { zone: j, index: w }, oe.dataTransfer.effectAllowed = "move", oe.dataTransfer.setData("text/plain", `reorder:${j}:${w}`), requestAnimationFrame(() => {
|
|
5643
|
+
c.value = null;
|
|
5641
5644
|
});
|
|
5642
5645
|
}
|
|
5643
5646
|
function Y() {
|
|
5644
|
-
|
|
5647
|
+
L.value = null, F.value = null;
|
|
5645
5648
|
}
|
|
5646
|
-
function
|
|
5647
|
-
oe.preventDefault(),
|
|
5649
|
+
function x(j, w, oe) {
|
|
5650
|
+
oe.preventDefault(), L.value && L.value.zone === j && (oe.dataTransfer.dropEffect = "move", F.value = { zone: j, index: w });
|
|
5648
5651
|
}
|
|
5649
5652
|
function pe() {
|
|
5650
|
-
|
|
5653
|
+
F.value = null;
|
|
5651
5654
|
}
|
|
5652
5655
|
function ke(j, w, oe) {
|
|
5653
|
-
if (oe.preventDefault(), oe.stopPropagation(), !
|
|
5656
|
+
if (oe.preventDefault(), oe.stopPropagation(), !L.value || L.value.zone !== j)
|
|
5654
5657
|
return;
|
|
5655
|
-
const B =
|
|
5658
|
+
const B = L.value.index;
|
|
5656
5659
|
if (B === w) {
|
|
5657
|
-
|
|
5660
|
+
L.value = null, F.value = null;
|
|
5658
5661
|
return;
|
|
5659
5662
|
}
|
|
5660
5663
|
const K = j === "row" ? [...n.rowFields] : [...n.columnFields], [ae] = K.splice(B, 1);
|
|
5661
|
-
K.splice(w, 0, ae), l(j === "row" ? "reorderRowFields" : "reorderColumnFields", K),
|
|
5664
|
+
K.splice(w, 0, ae), l(j === "row" ? "reorderRowFields" : "reorderColumnFields", K), L.value = null, F.value = null;
|
|
5662
5665
|
}
|
|
5663
5666
|
function ie(j, w) {
|
|
5664
5667
|
var oe, B;
|
|
5665
|
-
return ((oe =
|
|
5668
|
+
return ((oe = L.value) == null ? void 0 : oe.zone) === j && ((B = L.value) == null ? void 0 : B.index) === w;
|
|
5666
5669
|
}
|
|
5667
5670
|
function ze(j, w) {
|
|
5668
5671
|
var oe, B;
|
|
5669
|
-
return ((oe =
|
|
5672
|
+
return ((oe = F.value) == null ? void 0 : oe.zone) === j && ((B = F.value) == null ? void 0 : B.index) === w;
|
|
5670
5673
|
}
|
|
5671
|
-
const Te = _(180), Pe = _(80), Be =
|
|
5674
|
+
const Te = _(180), Pe = _(80), Be = E(() => {
|
|
5672
5675
|
const j = Math.max(n.rowFields.length, 1);
|
|
5673
5676
|
return Math.max(Te.value / j, 80);
|
|
5674
5677
|
});
|
|
@@ -5679,7 +5682,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5679
5682
|
var oe;
|
|
5680
5683
|
return i(), u("div", {
|
|
5681
5684
|
class: ue(["vpg-pivot-skeleton", [
|
|
5682
|
-
`vpg-font-${
|
|
5685
|
+
`vpg-font-${C.value}`,
|
|
5683
5686
|
{ "vpg-is-dragging": t.draggingField }
|
|
5684
5687
|
]])
|
|
5685
5688
|
}, [
|
|
@@ -5699,7 +5702,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5699
5702
|
d: "M5 13l4 4L19 7"
|
|
5700
5703
|
})
|
|
5701
5704
|
], -1)),
|
|
5702
|
-
ce(" " +
|
|
5705
|
+
ce(" " + k(p.value), 1)
|
|
5703
5706
|
])) : P("", !0)
|
|
5704
5707
|
]),
|
|
5705
5708
|
_: 1
|
|
@@ -5743,8 +5746,8 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5743
5746
|
], -1)),
|
|
5744
5747
|
e("span", Ai, [
|
|
5745
5748
|
w[10] || (w[10] = ce(" Filtered: ", -1)),
|
|
5746
|
-
e("strong", null,
|
|
5747
|
-
t.filteredRowCount !== void 0 && t.totalRowCount !== void 0 ? (i(), u("span", _i, " (" +
|
|
5749
|
+
e("strong", null, k($.value), 1),
|
|
5750
|
+
t.filteredRowCount !== void 0 && t.totalRowCount !== void 0 ? (i(), u("span", _i, " (" + k(t.filteredRowCount.toLocaleString()) + " of " + k(t.totalRowCount.toLocaleString()) + " rows) ", 1)) : P("", !0)
|
|
5748
5751
|
]),
|
|
5749
5752
|
ee.value ? (i(), u("div", Ti, [
|
|
5750
5753
|
w[11] || (w[11] = e("div", { class: "vpg-tooltip-header" }, " Active Filters ", -1)),
|
|
@@ -5752,39 +5755,39 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5752
5755
|
key: B.column,
|
|
5753
5756
|
class: "vpg-tooltip-filter"
|
|
5754
5757
|
}, [
|
|
5755
|
-
e("div", Ei,
|
|
5758
|
+
e("div", Ei, k(B.column), 1),
|
|
5756
5759
|
e("div", Ni, [
|
|
5757
|
-
B.isRange ? (i(), u("span", Li,
|
|
5760
|
+
B.isRange ? (i(), u("span", Li, k(B.displayText), 1)) : (i(), u(Z, { key: 1 }, [
|
|
5758
5761
|
(i(!0), u(Z, null, ve(B.values, (K, ae) => (i(), u("span", {
|
|
5759
5762
|
key: ae,
|
|
5760
5763
|
class: "vpg-tooltip-value"
|
|
5761
|
-
},
|
|
5762
|
-
B.remaining > 0 ? (i(), u("span", Vi, " +" +
|
|
5764
|
+
}, k(K), 1))), 128)),
|
|
5765
|
+
B.remaining > 0 ? (i(), u("span", Vi, " +" + k(B.remaining) + " more ", 1)) : P("", !0)
|
|
5763
5766
|
], 64))
|
|
5764
5767
|
])
|
|
5765
5768
|
]))), 128)),
|
|
5766
|
-
t.filteredRowCount !== void 0 && t.totalRowCount !== void 0 ? (i(), u("div", Oi, " Showing " +
|
|
5769
|
+
t.filteredRowCount !== void 0 && t.totalRowCount !== void 0 ? (i(), u("div", Oi, " Showing " + k(t.filteredRowCount.toLocaleString()) + " of " + k(t.totalRowCount.toLocaleString()) + " rows ", 1)) : P("", !0)
|
|
5767
5770
|
])) : P("", !0)
|
|
5768
5771
|
], 32)) : P("", !0),
|
|
5769
5772
|
t.isConfigured ? (i(), u("div", zi, [
|
|
5770
|
-
e("span", Pi,
|
|
5771
|
-
e("span", Bi,
|
|
5772
|
-
e("span", qi,
|
|
5773
|
+
e("span", Pi, k(t.rowFields.length) + " row" + k(t.rowFields.length !== 1 ? "s" : ""), 1),
|
|
5774
|
+
e("span", Bi, k(t.columnFields.length) + " col" + k(t.columnFields.length !== 1 ? "s" : ""), 1),
|
|
5775
|
+
e("span", qi, k(t.valueFields.length) + " val" + k(t.valueFields.length !== 1 ? "s" : ""), 1)
|
|
5773
5776
|
])) : P("", !0),
|
|
5774
5777
|
t.isConfigured && t.pivotResult ? (i(), u("div", Ii, [
|
|
5775
5778
|
(i(), u(Z, null, ve(b, (B) => e("button", {
|
|
5776
5779
|
key: B.value,
|
|
5777
|
-
class: ue(["vpg-font-size-btn", { active:
|
|
5778
|
-
onClick: (K) =>
|
|
5779
|
-
},
|
|
5780
|
+
class: ue(["vpg-font-size-btn", { active: C.value === B.value }]),
|
|
5781
|
+
onClick: (K) => C.value = B.value
|
|
5782
|
+
}, k(B.label), 11, Ui)), 64))
|
|
5780
5783
|
])) : P("", !0)
|
|
5781
5784
|
])
|
|
5782
5785
|
]),
|
|
5783
|
-
A(
|
|
5786
|
+
A(v) ? (i(), u(Z, { key: 1 }, [
|
|
5784
5787
|
e("div", ji, [
|
|
5785
5788
|
e("div", {
|
|
5786
|
-
class: ue(["vpg-drop-zone vpg-row-zone", { "vpg-drag-over":
|
|
5787
|
-
onDragover: w[2] || (w[2] = (B) =>
|
|
5789
|
+
class: ue(["vpg-drop-zone vpg-row-zone", { "vpg-drag-over": c.value === "row" }]),
|
|
5790
|
+
onDragover: w[2] || (w[2] = (B) => M("row", B)),
|
|
5788
5791
|
onDragleave: Q,
|
|
5789
5792
|
onDrop: w[3] || (w[3] = (B) => le("row", B))
|
|
5790
5793
|
}, [
|
|
@@ -5802,12 +5805,12 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5802
5805
|
draggable: "true",
|
|
5803
5806
|
onDragstart: (ae) => T("row", K, ae),
|
|
5804
5807
|
onDragend: Y,
|
|
5805
|
-
onDragover: (ae) =>
|
|
5808
|
+
onDragover: (ae) => x("row", K, ae),
|
|
5806
5809
|
onDragleave: pe,
|
|
5807
5810
|
onDrop: (ae) => ke("row", K, ae)
|
|
5808
5811
|
}, [
|
|
5809
5812
|
w[15] || (w[15] = e("span", { class: "vpg-drag-handle" }, "⋮⋮", -1)),
|
|
5810
|
-
e("span", Gi,
|
|
5813
|
+
e("span", Gi, k(B), 1),
|
|
5811
5814
|
e("button", {
|
|
5812
5815
|
class: "vpg-mini-remove",
|
|
5813
5816
|
onClick: He((ae) => l("removeRowField", B), ["stop"])
|
|
@@ -5817,8 +5820,8 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5817
5820
|
])
|
|
5818
5821
|
], 34),
|
|
5819
5822
|
e("div", {
|
|
5820
|
-
class: ue(["vpg-drop-zone vpg-column-zone", { "vpg-drag-over":
|
|
5821
|
-
onDragover: w[4] || (w[4] = (B) =>
|
|
5823
|
+
class: ue(["vpg-drop-zone vpg-column-zone", { "vpg-drag-over": c.value === "column" }]),
|
|
5824
|
+
onDragover: w[4] || (w[4] = (B) => M("column", B)),
|
|
5822
5825
|
onDragleave: Q,
|
|
5823
5826
|
onDrop: w[5] || (w[5] = (B) => le("column", B))
|
|
5824
5827
|
}, [
|
|
@@ -5836,12 +5839,12 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5836
5839
|
draggable: "true",
|
|
5837
5840
|
onDragstart: (ae) => T("column", K, ae),
|
|
5838
5841
|
onDragend: Y,
|
|
5839
|
-
onDragover: (ae) =>
|
|
5842
|
+
onDragover: (ae) => x("column", K, ae),
|
|
5840
5843
|
onDragleave: pe,
|
|
5841
5844
|
onDrop: (ae) => ke("column", K, ae)
|
|
5842
5845
|
}, [
|
|
5843
5846
|
w[17] || (w[17] = e("span", { class: "vpg-drag-handle" }, "⋮⋮", -1)),
|
|
5844
|
-
e("span", Zi,
|
|
5847
|
+
e("span", Zi, k(B), 1),
|
|
5845
5848
|
e("button", {
|
|
5846
5849
|
class: "vpg-mini-remove",
|
|
5847
5850
|
onClick: He((ae) => l("removeColumnField", B), ["stop"])
|
|
@@ -5851,8 +5854,8 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5851
5854
|
])
|
|
5852
5855
|
], 34),
|
|
5853
5856
|
e("div", {
|
|
5854
|
-
class: ue(["vpg-drop-zone vpg-value-zone", { "vpg-drag-over":
|
|
5855
|
-
onDragover: w[6] || (w[6] = (B) =>
|
|
5857
|
+
class: ue(["vpg-drop-zone vpg-value-zone", { "vpg-drag-over": c.value === "value" }]),
|
|
5858
|
+
onDragover: w[6] || (w[6] = (B) => M("value", B)),
|
|
5856
5859
|
onDragleave: Q,
|
|
5857
5860
|
onDrop: w[7] || (w[7] = (B) => le("value", B))
|
|
5858
5861
|
}, [
|
|
@@ -5865,8 +5868,8 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5865
5868
|
key: `${B.field}-${B.aggregation}`,
|
|
5866
5869
|
class: ue(["vpg-mini-chip vpg-value-chip", { "vpg-calc-chip": a(B.field) }])
|
|
5867
5870
|
}, [
|
|
5868
|
-
e("span", au,
|
|
5869
|
-
e("span", ou,
|
|
5871
|
+
e("span", au, k(a(B.field) ? "ƒ" : A(An)(B.aggregation)), 1),
|
|
5872
|
+
e("span", ou, k(s(B.field)), 1),
|
|
5870
5873
|
e("button", {
|
|
5871
5874
|
class: "vpg-mini-remove",
|
|
5872
5875
|
onClick: (K) => l("removeValueField", B.field, B.aggregation)
|
|
@@ -5922,11 +5925,11 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5922
5925
|
onClick: w[8] || (w[8] = (we) => W("row"))
|
|
5923
5926
|
}, [
|
|
5924
5927
|
e("div", pu, [
|
|
5925
|
-
e("span", null,
|
|
5928
|
+
e("span", null, k(ae), 1),
|
|
5926
5929
|
ge === t.rowFields.length - 1 || t.rowFields.length === 0 ? (i(), u("span", {
|
|
5927
5930
|
key: 0,
|
|
5928
5931
|
class: ue(["vpg-sort-indicator", { active: O.value === "row" }])
|
|
5929
|
-
},
|
|
5932
|
+
}, k(O.value === "row" ? U.value === "asc" ? "↑" : "↓" : "⇅"), 3)) : P("", !0)
|
|
5930
5933
|
])
|
|
5931
5934
|
], 12, vu))), 128)) : P("", !0),
|
|
5932
5935
|
(i(!0), u(Z, null, ve(B, (ae, ge) => (i(), u("th", {
|
|
@@ -5937,11 +5940,11 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5937
5940
|
onClick: (we) => K === X.value.length - 1 && W(ge)
|
|
5938
5941
|
}, [
|
|
5939
5942
|
e("div", mu, [
|
|
5940
|
-
e("span", null,
|
|
5943
|
+
e("span", null, k(ae.label), 1),
|
|
5941
5944
|
K === X.value.length - 1 ? (i(), u("span", {
|
|
5942
5945
|
key: 0,
|
|
5943
5946
|
class: ue(["vpg-sort-indicator", { active: O.value === ge }])
|
|
5944
|
-
},
|
|
5947
|
+
}, k(O.value === ge ? U.value === "asc" ? "↑" : "↓" : "⇅"), 3)) : P("", !0)
|
|
5945
5948
|
])
|
|
5946
5949
|
], 12, gu))), 128)),
|
|
5947
5950
|
t.pivotResult.rowTotals.length > 0 && K === 0 ? (i(), u("th", {
|
|
@@ -5960,7 +5963,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5960
5963
|
key: `row-${B}-${ae}`,
|
|
5961
5964
|
class: "vpg-row-header-cell",
|
|
5962
5965
|
style: Ve({ width: `${Be.value}px`, minWidth: "80px", left: `${Ge(ae)}px` })
|
|
5963
|
-
},
|
|
5966
|
+
}, k(K), 5))), 128)),
|
|
5964
5967
|
(i(!0), u(Z, null, ve(t.pivotResult.data[B], (K, ae) => (i(), u("td", {
|
|
5965
5968
|
key: ae,
|
|
5966
5969
|
class: ue(["vpg-data-cell", [
|
|
@@ -5968,10 +5971,10 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5968
5971
|
K.value === null && "vpg-is-null"
|
|
5969
5972
|
]]),
|
|
5970
5973
|
style: Ve({ width: `${Pe.value}px` }),
|
|
5971
|
-
onMousedown: (ge) =>
|
|
5974
|
+
onMousedown: (ge) => N(G.value.indexOf(B), ae, ge),
|
|
5972
5975
|
onMouseenter: (ge) => H(G.value.indexOf(B), ae)
|
|
5973
|
-
},
|
|
5974
|
-
t.pivotResult.rowTotals[B] ? (i(), u("td", yu,
|
|
5976
|
+
}, k(K.formattedValue), 47, hu))), 128)),
|
|
5977
|
+
t.pivotResult.rowTotals[B] ? (i(), u("td", yu, k(t.pivotResult.rowTotals[B].formattedValue), 1)) : P("", !0)
|
|
5975
5978
|
]))), 128)),
|
|
5976
5979
|
t.pivotResult.columnTotals.length > 0 ? (i(), u("tr", bu, [
|
|
5977
5980
|
e("th", {
|
|
@@ -5983,29 +5986,29 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
5983
5986
|
key: K,
|
|
5984
5987
|
class: "vpg-data-cell vpg-total-cell",
|
|
5985
5988
|
style: Ve({ width: `${Pe.value}px` })
|
|
5986
|
-
},
|
|
5987
|
-
t.pivotResult.rowTotals.length > 0 ? (i(), u("td", Cu,
|
|
5989
|
+
}, k(B.formattedValue), 5))), 128)),
|
|
5990
|
+
t.pivotResult.rowTotals.length > 0 ? (i(), u("td", Cu, k(t.pivotResult.grandTotal.formattedValue), 1)) : P("", !0)
|
|
5988
5991
|
])) : P("", !0)
|
|
5989
5992
|
])
|
|
5990
5993
|
])
|
|
5991
5994
|
])),
|
|
5992
5995
|
t.isConfigured && t.pivotResult ? (i(), u("div", ku, [
|
|
5993
|
-
e("span", xu,
|
|
5996
|
+
e("span", xu, k(t.pivotResult.rowHeaders.length) + " rows × " + k(((oe = t.pivotResult.data[0]) == null ? void 0 : oe.length) || 0) + " columns", 1),
|
|
5994
5997
|
f.value && f.value.count > 1 ? (i(), u("div", Su, [
|
|
5995
5998
|
e("span", Fu, [
|
|
5996
5999
|
w[29] || (w[29] = e("span", { class: "vpg-stat-label" }, "Count:", -1)),
|
|
5997
|
-
e("span", Mu,
|
|
6000
|
+
e("span", Mu, k(f.value.count), 1)
|
|
5998
6001
|
]),
|
|
5999
6002
|
f.value.numericCount > 0 ? (i(), u(Z, { key: 0 }, [
|
|
6000
6003
|
w[32] || (w[32] = e("span", { class: "vpg-stat-divider" }, "|", -1)),
|
|
6001
6004
|
e("span", $u, [
|
|
6002
6005
|
w[30] || (w[30] = e("span", { class: "vpg-stat-label" }, "Sum:", -1)),
|
|
6003
|
-
e("span", Ru,
|
|
6006
|
+
e("span", Ru, k(V(f.value.sum)), 1)
|
|
6004
6007
|
]),
|
|
6005
6008
|
w[33] || (w[33] = e("span", { class: "vpg-stat-divider" }, "|", -1)),
|
|
6006
6009
|
e("span", Du, [
|
|
6007
6010
|
w[31] || (w[31] = e("span", { class: "vpg-stat-label" }, "Avg:", -1)),
|
|
6008
|
-
e("span", Au,
|
|
6011
|
+
e("span", Au, k(V(f.value.avg)), 1)
|
|
6009
6012
|
])
|
|
6010
6013
|
], 64)) : P("", !0)
|
|
6011
6014
|
])) : P("", !0)
|
|
@@ -6034,7 +6037,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6034
6037
|
}, " Get Pro License → ")
|
|
6035
6038
|
], -1)
|
|
6036
6039
|
])])),
|
|
6037
|
-
A(d) && A(
|
|
6040
|
+
A(d) && A(v) ? (i(), u("div", {
|
|
6038
6041
|
key: 2,
|
|
6039
6042
|
class: ue(["vpg-watermark", { "vpg-demo-mode": A(y) }])
|
|
6040
6043
|
}, [
|
|
@@ -6170,24 +6173,25 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6170
6173
|
maxHeight: { default: 1200 },
|
|
6171
6174
|
aiAnalyst: { default: void 0 },
|
|
6172
6175
|
numberFormat: { default: "us" },
|
|
6173
|
-
dateFormat: { default: "iso" }
|
|
6176
|
+
dateFormat: { default: "iso" },
|
|
6177
|
+
fieldRoleOverrides: {}
|
|
6174
6178
|
},
|
|
6175
6179
|
emits: ["cellClick", "selectionChange", "export", "copy", "aiDataLoaded", "aiConversationUpdate", "aiQueryExecuted", "aiError"],
|
|
6176
6180
|
setup(t, { emit: o }) {
|
|
6177
|
-
const n = t, l = o, { showWatermark: s, canUsePivot: a, canUseCharts: d, canUseAIAnalyst:
|
|
6181
|
+
const n = t, l = o, { showWatermark: s, canUsePivot: a, canUseCharts: d, canUseAIAnalyst: v, isDemo: y, isPro: c } = Tt(), L = E(
|
|
6178
6182
|
() => {
|
|
6179
6183
|
var g;
|
|
6180
|
-
return ((g = n.aiAnalyst) == null ? void 0 : g.enabled) &&
|
|
6184
|
+
return ((g = n.aiAnalyst) == null ? void 0 : g.enabled) && v.value;
|
|
6181
6185
|
}
|
|
6182
|
-
),
|
|
6186
|
+
), F = E(() => {
|
|
6183
6187
|
var g;
|
|
6184
6188
|
return n.theme === "auto" ? (g = window.matchMedia) != null && g.call(window, "(prefers-color-scheme: dark)").matches ? "dark" : "light" : n.theme;
|
|
6185
|
-
}),
|
|
6189
|
+
}), C = _(n.fontSize), b = _(""), h = _(!1), $ = _(1), re = _(null), ee = _(0), U = _(0), O = _(n.initialHeight), W = _(!1), G = _(0), X = _(0), de = _(!1), J = _(""), ne = [
|
|
6186
6190
|
{ value: "xs", label: "S" },
|
|
6187
6191
|
{ value: "sm", label: "M" },
|
|
6188
6192
|
{ value: "base", label: "L" }
|
|
6189
|
-
], z = _(null), S = _(null),
|
|
6190
|
-
table:
|
|
6193
|
+
], z = _(null), S = _(null), p = E(() => S.value || n.data), m = E(() => p.value), {
|
|
6194
|
+
table: N,
|
|
6191
6195
|
columnKeys: H,
|
|
6192
6196
|
filteredRowCount: se,
|
|
6193
6197
|
totalRowCount: D,
|
|
@@ -6195,18 +6199,18 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6195
6199
|
hasActiveFilter: I,
|
|
6196
6200
|
setColumnFilter: f,
|
|
6197
6201
|
getColumnFilterValues: V,
|
|
6198
|
-
clearAllFilters:
|
|
6202
|
+
clearAllFilters: M,
|
|
6199
6203
|
toggleSort: Q,
|
|
6200
6204
|
getSortDirection: le,
|
|
6201
6205
|
columnFilters: T,
|
|
6202
6206
|
activeFilters: Y,
|
|
6203
6207
|
// Numeric range filters
|
|
6204
|
-
setNumericRangeFilter:
|
|
6208
|
+
setNumericRangeFilter: x,
|
|
6205
6209
|
getNumericRangeFilter: pe,
|
|
6206
6210
|
// Date range filters
|
|
6207
6211
|
setDateRangeFilter: ke,
|
|
6208
6212
|
getDateRangeFilter: ie
|
|
6209
|
-
} = Ur({ data: m }), ze =
|
|
6213
|
+
} = Ur({ data: m }), ze = E(() => N.getFilteredRowModel().rows.map((r) => r.original)), Te = E(() => Y.value.length === 0 ? null : Y.value.map((g) => {
|
|
6210
6214
|
var r;
|
|
6211
6215
|
if (g.type === "range" && g.range) {
|
|
6212
6216
|
const te = [];
|
|
@@ -6250,7 +6254,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6250
6254
|
updateValueFieldAggregation: Re,
|
|
6251
6255
|
clearConfig: Fe,
|
|
6252
6256
|
autoSuggestConfig: ut
|
|
6253
|
-
} = Kr(ze), nt =
|
|
6257
|
+
} = Kr(ze), nt = E(() => {
|
|
6254
6258
|
if (!b.value.trim() || !n.enableSearch)
|
|
6255
6259
|
return st.value;
|
|
6256
6260
|
const g = b.value.toLowerCase().trim();
|
|
@@ -6262,12 +6266,12 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6262
6266
|
}
|
|
6263
6267
|
return !1;
|
|
6264
6268
|
});
|
|
6265
|
-
}), Ke =
|
|
6269
|
+
}), Ke = E(() => nt.value.length), ct = E(() => n.enablePagination ? Math.max(1, Math.ceil(Ke.value / n.pageSize)) : 1), Wt = E(() => {
|
|
6266
6270
|
if (!n.enablePagination)
|
|
6267
6271
|
return nt.value;
|
|
6268
6272
|
const g = ($.value - 1) * n.pageSize, r = g + n.pageSize;
|
|
6269
6273
|
return nt.value.slice(g, r);
|
|
6270
|
-
}), Ln =
|
|
6274
|
+
}), Ln = E(() => Ke.value === 0 ? 0 : ($.value - 1) * n.pageSize + 1), Vn = E(
|
|
6271
6275
|
() => Math.min($.value * n.pageSize, Ke.value)
|
|
6272
6276
|
);
|
|
6273
6277
|
function On() {
|
|
@@ -6370,7 +6374,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6370
6374
|
function In(g) {
|
|
6371
6375
|
S.value = g.data, l("aiDataLoaded", g);
|
|
6372
6376
|
}
|
|
6373
|
-
const Un =
|
|
6377
|
+
const Un = E(() => S.value !== null), dt = _(!1);
|
|
6374
6378
|
async function Hn() {
|
|
6375
6379
|
var g;
|
|
6376
6380
|
if ((g = z.value) != null && g.selectedDataSource) {
|
|
@@ -6385,7 +6389,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6385
6389
|
}
|
|
6386
6390
|
} else
|
|
6387
6391
|
S.value = null;
|
|
6388
|
-
|
|
6392
|
+
M();
|
|
6389
6393
|
}
|
|
6390
6394
|
function jn(g) {
|
|
6391
6395
|
l("aiConversationUpdate", g);
|
|
@@ -6427,17 +6431,17 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6427
6431
|
function aa(g) {
|
|
6428
6432
|
Be.value = g;
|
|
6429
6433
|
}
|
|
6430
|
-
const Nt = _(), Zt = _(), st =
|
|
6434
|
+
const Nt = _(), Zt = _(), st = E(() => N.getRowModel().rows), Ce = _(null), yt = _({ top: 0, left: 0, maxHeight: 400 }), Je = _({});
|
|
6431
6435
|
function en() {
|
|
6432
|
-
if (typeof document > "u" ||
|
|
6436
|
+
if (typeof document > "u" || p.value.length === 0)
|
|
6433
6437
|
return;
|
|
6434
|
-
const g = {}, r = Math.min(100,
|
|
6438
|
+
const g = {}, r = Math.min(100, p.value.length), q = document.createElement("canvas").getContext("2d");
|
|
6435
6439
|
if (q) {
|
|
6436
6440
|
q.font = "13px system-ui, -apple-system, sans-serif";
|
|
6437
6441
|
for (const me of H.value) {
|
|
6438
6442
|
let he = q.measureText(me).width + 56;
|
|
6439
6443
|
for (let be = 0; be < r; be++) {
|
|
6440
|
-
const ye =
|
|
6444
|
+
const ye = p.value[be][me], xe = ye == null ? "" : String(ye), Xe = q.measureText(xe).width + 28;
|
|
6441
6445
|
he = Math.max(he, Xe);
|
|
6442
6446
|
}
|
|
6443
6447
|
g[me] = Math.min(Math.max(he, at), wn);
|
|
@@ -6461,7 +6465,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6461
6465
|
f(g, r);
|
|
6462
6466
|
}
|
|
6463
6467
|
function la(g, r) {
|
|
6464
|
-
|
|
6468
|
+
x(g, r);
|
|
6465
6469
|
}
|
|
6466
6470
|
function ra(g, r) {
|
|
6467
6471
|
ke(g, r);
|
|
@@ -6474,7 +6478,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6474
6478
|
te === null ? (Q(g), r === "desc" && le(g) === "asc" && Q(g)) : te !== r && Q(g);
|
|
6475
6479
|
}
|
|
6476
6480
|
}
|
|
6477
|
-
const wt =
|
|
6481
|
+
const wt = E(() => T.value.length), Qe = _(null), Ue = _(null), Ee = _(null), Lt = _(!1);
|
|
6478
6482
|
function ua(g) {
|
|
6479
6483
|
const r = st.value.length - 1;
|
|
6480
6484
|
r < 0 || (Ue.value = { row: 0, col: g }, Ee.value = { row: r, col: g }, Qe.value = { row: 0, col: g });
|
|
@@ -6486,7 +6490,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6486
6490
|
} else
|
|
6487
6491
|
ua(g);
|
|
6488
6492
|
}
|
|
6489
|
-
const Ne =
|
|
6493
|
+
const Ne = E(() => !Ue.value || !Ee.value ? null : {
|
|
6490
6494
|
minRow: Math.min(Ue.value.row, Ee.value.row),
|
|
6491
6495
|
maxRow: Math.max(Ue.value.row, Ee.value.row),
|
|
6492
6496
|
minCol: Math.min(Ue.value.col, Ee.value.col),
|
|
@@ -6498,7 +6502,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6498
6502
|
const { minRow: te, maxRow: q, minCol: me, maxCol: he } = Ne.value;
|
|
6499
6503
|
return g >= te && g <= q && r >= me && r <= he;
|
|
6500
6504
|
}
|
|
6501
|
-
const pt =
|
|
6505
|
+
const pt = E(() => {
|
|
6502
6506
|
if (!Ne.value)
|
|
6503
6507
|
return null;
|
|
6504
6508
|
const { minRow: g, maxRow: r, minCol: te, maxCol: q } = Ne.value, me = [];
|
|
@@ -6632,7 +6636,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6632
6636
|
}), _e([() => n.data, S], () => {
|
|
6633
6637
|
mt(en);
|
|
6634
6638
|
}, { immediate: !0 });
|
|
6635
|
-
const ba =
|
|
6639
|
+
const ba = E(() => H.value.reduce((g, r) => g + (Je.value[r] || at), 0));
|
|
6636
6640
|
function wa(g) {
|
|
6637
6641
|
Ce.value && (g.target.closest(".vpg-filter-portal") || bt());
|
|
6638
6642
|
}
|
|
@@ -6640,8 +6644,8 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6640
6644
|
var te;
|
|
6641
6645
|
return i(), u("div", {
|
|
6642
6646
|
class: ue(["vpg-data-grid", [
|
|
6643
|
-
`vpg-font-${
|
|
6644
|
-
`vpg-theme-${
|
|
6647
|
+
`vpg-font-${C.value}`,
|
|
6648
|
+
`vpg-theme-${F.value}`,
|
|
6645
6649
|
{ "vpg-striped": t.stripedRows },
|
|
6646
6650
|
{ "vpg-resizing": re.value },
|
|
6647
6651
|
{ "vpg-resizing-vertical": W.value }
|
|
@@ -6665,7 +6669,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6665
6669
|
d: "M5 13l4 4L19 7"
|
|
6666
6670
|
})
|
|
6667
6671
|
], -1)),
|
|
6668
|
-
ce(" " +
|
|
6672
|
+
ce(" " + k(J.value), 1)
|
|
6669
6673
|
])) : P("", !0)
|
|
6670
6674
|
]),
|
|
6671
6675
|
_: 1
|
|
@@ -6673,7 +6677,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6673
6677
|
e("div", Lu, [
|
|
6674
6678
|
e("div", Vu, [
|
|
6675
6679
|
t.showPivot ? (i(), u("div", Ou, [
|
|
6676
|
-
|
|
6680
|
+
L.value ? (i(), u("button", {
|
|
6677
6681
|
key: 0,
|
|
6678
6682
|
class: ue(["vpg-view-btn vpg-ai-btn", { active: fe.value === "ai" }]),
|
|
6679
6683
|
onClick: r[0] || (r[0] = (q) => fe.value = "ai")
|
|
@@ -6692,7 +6696,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6692
6696
|
})
|
|
6693
6697
|
], -1),
|
|
6694
6698
|
ce(" AI Analyst ", -1)
|
|
6695
|
-
])], 2)) : (te = t.aiAnalyst) != null && te.enabled && !A(
|
|
6699
|
+
])], 2)) : (te = t.aiAnalyst) != null && te.enabled && !A(v) ? (i(), u("button", {
|
|
6696
6700
|
key: 1,
|
|
6697
6701
|
class: "vpg-view-btn vpg-ai-btn vpg-pro-feature",
|
|
6698
6702
|
title: "AI Analyst (Pro feature)",
|
|
@@ -6847,9 +6851,9 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6847
6851
|
e("div", Uu, [
|
|
6848
6852
|
(i(), u(Z, null, ve(ne, (q) => e("button", {
|
|
6849
6853
|
key: q.value,
|
|
6850
|
-
class: ue(["vpg-font-size-btn", { active:
|
|
6851
|
-
onClick: (me) =>
|
|
6852
|
-
},
|
|
6854
|
+
class: ue(["vpg-font-size-btn", { active: C.value === q.value }]),
|
|
6855
|
+
onClick: (me) => C.value = q.value
|
|
6856
|
+
}, k(q.label), 11, Hu)), 64))
|
|
6853
6857
|
])
|
|
6854
6858
|
]),
|
|
6855
6859
|
wt.value > 0 ? (i(), u("div", ju, [
|
|
@@ -6864,7 +6868,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6864
6868
|
"clip-rule": "evenodd"
|
|
6865
6869
|
})
|
|
6866
6870
|
], -1)),
|
|
6867
|
-
e("span", null,
|
|
6871
|
+
e("span", null, k(wt.value) + " filter" + k(wt.value > 1 ? "s" : ""), 1)
|
|
6868
6872
|
])) : P("", !0),
|
|
6869
6873
|
Un.value ? (i(), u("button", {
|
|
6870
6874
|
key: 2,
|
|
@@ -6888,10 +6892,10 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6888
6892
|
d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
|
|
6889
6893
|
}, null, -1)
|
|
6890
6894
|
])])),
|
|
6891
|
-
e("span", null,
|
|
6895
|
+
e("span", null, k(dt.value ? "Loading..." : "Full Data"), 1)
|
|
6892
6896
|
], 10, Wu)) : P("", !0),
|
|
6893
6897
|
b.value ? (i(), u("div", Ku, [
|
|
6894
|
-
e("span", null,
|
|
6898
|
+
e("span", null, k(Ke.value) + " match" + k(Ke.value !== 1 ? "es" : ""), 1)
|
|
6895
6899
|
])) : P("", !0)
|
|
6896
6900
|
], 64)) : P("", !0),
|
|
6897
6901
|
fe.value === "pivot" && A(a) ? (i(), u(Z, { key: 2 }, [
|
|
@@ -6912,7 +6916,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6912
6916
|
d: "M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"
|
|
6913
6917
|
})
|
|
6914
6918
|
], -1)),
|
|
6915
|
-
ce(" " +
|
|
6919
|
+
ce(" " + k(vt.value ? "Hide" : "Show") + " Config ", 1)
|
|
6916
6920
|
], 2),
|
|
6917
6921
|
A(B) ? (i(), u("div", Ju, [...r[37] || (r[37] = [
|
|
6918
6922
|
e("svg", {
|
|
@@ -6935,7 +6939,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6935
6939
|
key: 0,
|
|
6936
6940
|
class: "vpg-clear-filters",
|
|
6937
6941
|
onClick: r[10] || (r[10] = //@ts-ignore
|
|
6938
|
-
(...q) => A(
|
|
6942
|
+
(...q) => A(M) && A(M)(...q))
|
|
6939
6943
|
}, [...r[38] || (r[38] = [
|
|
6940
6944
|
e("svg", {
|
|
6941
6945
|
class: "vpg-icon",
|
|
@@ -6995,10 +6999,10 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
6995
6999
|
])])) : P("", !0),
|
|
6996
7000
|
t.enableExport && fe.value === "pivot" && A(B) ? (i(), u("button", {
|
|
6997
7001
|
key: 3,
|
|
6998
|
-
class: ue(["vpg-export-btn", { "vpg-export-btn-disabled": !A(
|
|
6999
|
-
disabled: !A(
|
|
7000
|
-
title: A(
|
|
7001
|
-
onClick: r[11] || (r[11] = (q) => A(
|
|
7002
|
+
class: ue(["vpg-export-btn", { "vpg-export-btn-disabled": !A(c) }]),
|
|
7003
|
+
disabled: !A(c),
|
|
7004
|
+
title: A(c) ? "Export Pivot to CSV" : "Export Pivot to CSV (Pro feature)",
|
|
7005
|
+
onClick: r[11] || (r[11] = (q) => A(c) && Yt())
|
|
7002
7006
|
}, [
|
|
7003
7007
|
r[41] || (r[41] = e("svg", {
|
|
7004
7008
|
class: "vpg-icon",
|
|
@@ -7013,16 +7017,16 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7013
7017
|
d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
|
|
7014
7018
|
})
|
|
7015
7019
|
], -1)),
|
|
7016
|
-
ce(" Export Pivot" +
|
|
7020
|
+
ce(" Export Pivot" + k(A(c) ? "" : " (Pro)"), 1)
|
|
7017
7021
|
], 10, Xu)) : P("", !0)
|
|
7018
7022
|
])
|
|
7019
7023
|
]),
|
|
7020
|
-
|
|
7024
|
+
L.value && t.aiAnalyst ? Oe((i(), u("div", Zu, [
|
|
7021
7025
|
je(Ls, {
|
|
7022
7026
|
ref_key: "aiAnalystRef",
|
|
7023
7027
|
ref: z,
|
|
7024
7028
|
config: t.aiAnalyst,
|
|
7025
|
-
theme:
|
|
7029
|
+
theme: F.value,
|
|
7026
7030
|
onDataLoaded: In,
|
|
7027
7031
|
onConversationUpdate: jn,
|
|
7028
7032
|
onQueryExecuted: Wn,
|
|
@@ -7042,7 +7046,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7042
7046
|
t.loading ? (i(), u("div", ec, [...r[42] || (r[42] = [
|
|
7043
7047
|
e("div", { class: "vpg-spinner" }, null, -1),
|
|
7044
7048
|
e("span", null, "Loading data...", -1)
|
|
7045
|
-
])])) :
|
|
7049
|
+
])])) : p.value.length === 0 ? (i(), u("div", tc, [...r[43] || (r[43] = [
|
|
7046
7050
|
e("div", { class: "vpg-empty-icon" }, [
|
|
7047
7051
|
e("svg", {
|
|
7048
7052
|
class: "vpg-icon-lg",
|
|
@@ -7079,7 +7083,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7079
7083
|
e("button", {
|
|
7080
7084
|
class: "vpg-clear-link",
|
|
7081
7085
|
onClick: r[12] || (r[12] = //@ts-ignore
|
|
7082
|
-
(...q) => A(
|
|
7086
|
+
(...q) => A(M) && A(M)(...q))
|
|
7083
7087
|
}, " Clear all filters ")
|
|
7084
7088
|
])) : (i(), u("div", ac, [
|
|
7085
7089
|
e("table", {
|
|
@@ -7099,7 +7103,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7099
7103
|
onClick: (he) => ca(me, he)
|
|
7100
7104
|
}, [
|
|
7101
7105
|
e("div", sc, [
|
|
7102
|
-
e("span", lc,
|
|
7106
|
+
e("span", lc, k(q), 1),
|
|
7103
7107
|
e("div", rc, [
|
|
7104
7108
|
A(le)(q) ? (i(), u("span", ic, [
|
|
7105
7109
|
A(le)(q) === "asc" ? (i(), u("svg", uc, [...r[46] || (r[46] = [
|
|
@@ -7176,7 +7180,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7176
7180
|
style: Ve({ width: `${Je.value[he] || at}px`, minWidth: `${Je.value[he] || at}px` }),
|
|
7177
7181
|
onMousedown: (ye) => pa(me, be, ye),
|
|
7178
7182
|
onMouseenter: (ye) => ga(me, be)
|
|
7179
|
-
},
|
|
7183
|
+
}, k(ya(q.original[he], he)), 47, pc))), 128))
|
|
7180
7184
|
]))), 128))
|
|
7181
7185
|
], 512)
|
|
7182
7186
|
], 4)
|
|
@@ -7219,7 +7223,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7219
7223
|
"is-configured": A(B),
|
|
7220
7224
|
"dragging-field": Et.value,
|
|
7221
7225
|
"pivot-result": A(K),
|
|
7222
|
-
"font-size":
|
|
7226
|
+
"font-size": C.value,
|
|
7223
7227
|
"active-filters": Te.value,
|
|
7224
7228
|
"total-row-count": A(D),
|
|
7225
7229
|
"filtered-row-count": A(se),
|
|
@@ -7247,41 +7251,42 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7247
7251
|
"clip-rule": "evenodd"
|
|
7248
7252
|
})
|
|
7249
7253
|
], -1)),
|
|
7250
|
-
e("span", null, "Chart showing " +
|
|
7254
|
+
e("span", null, "Chart showing " + k(A(se).toLocaleString()) + " of " + k(A(D).toLocaleString()) + " records", 1),
|
|
7251
7255
|
e("button", {
|
|
7252
7256
|
class: "vpg-chart-clear-filters",
|
|
7253
7257
|
onClick: r[15] || (r[15] = //@ts-ignore
|
|
7254
|
-
(...q) => A(
|
|
7258
|
+
(...q) => A(M) && A(M)(...q))
|
|
7255
7259
|
}, " Clear filters ")
|
|
7256
7260
|
])) : P("", !0),
|
|
7257
7261
|
je(Ql, {
|
|
7258
7262
|
data: ze.value,
|
|
7259
|
-
theme:
|
|
7263
|
+
theme: F.value,
|
|
7264
|
+
"field-role-overrides": n.fieldRoleOverrides,
|
|
7260
7265
|
onConfigChange: Jn
|
|
7261
|
-
}, null, 8, ["data", "theme"])
|
|
7266
|
+
}, null, 8, ["data", "theme", "field-role-overrides"])
|
|
7262
7267
|
])) : P("", !0),
|
|
7263
7268
|
e("div", yc, [
|
|
7264
7269
|
e("div", bc, [
|
|
7265
7270
|
fe.value === "grid" ? (i(), u(Z, { key: 0 }, [
|
|
7266
7271
|
t.enablePagination ? (i(), u(Z, { key: 0 }, [
|
|
7267
|
-
e("span", null,
|
|
7272
|
+
e("span", null, k(Ln.value.toLocaleString()) + "-" + k(Vn.value.toLocaleString()), 1),
|
|
7268
7273
|
r[51] || (r[51] = e("span", { class: "vpg-separator" }, "of", -1)),
|
|
7269
|
-
e("span", null,
|
|
7270
|
-
Ke.value !== A(D) ? (i(), u("span", wc, " (" +
|
|
7271
|
-
], 64)) : A(se) === A(D) && Ke.value === A(D) ? (i(), u("span", Cc,
|
|
7272
|
-
e("span", kc,
|
|
7274
|
+
e("span", null, k(Ke.value.toLocaleString()), 1),
|
|
7275
|
+
Ke.value !== A(D) ? (i(), u("span", wc, " (" + k(A(D).toLocaleString()) + " total) ", 1)) : P("", !0)
|
|
7276
|
+
], 64)) : A(se) === A(D) && Ke.value === A(D) ? (i(), u("span", Cc, k(A(D).toLocaleString()) + " records", 1)) : (i(), u(Z, { key: 2 }, [
|
|
7277
|
+
e("span", kc, k(Ke.value.toLocaleString()), 1),
|
|
7273
7278
|
r[52] || (r[52] = e("span", { class: "vpg-separator" }, "of", -1)),
|
|
7274
|
-
e("span", null,
|
|
7279
|
+
e("span", null, k(A(D).toLocaleString()), 1),
|
|
7275
7280
|
r[53] || (r[53] = e("span", { class: "vpg-separator" }, "records", -1))
|
|
7276
7281
|
], 64))
|
|
7277
7282
|
], 64)) : fe.value === "pivot" ? (i(), u(Z, { key: 1 }, [
|
|
7278
7283
|
r[54] || (r[54] = e("span", { class: "vpg-pivot-label" }, "Pivot Table", -1)),
|
|
7279
7284
|
r[55] || (r[55] = e("span", { class: "vpg-separator" }, "•", -1)),
|
|
7280
|
-
e("span", null,
|
|
7285
|
+
e("span", null, k(A(D).toLocaleString()) + " source records", 1)
|
|
7281
7286
|
], 64)) : fe.value === "chart" ? (i(), u(Z, { key: 2 }, [
|
|
7282
7287
|
r[56] || (r[56] = e("span", { class: "vpg-chart-label" }, "Chart Builder", -1)),
|
|
7283
7288
|
r[57] || (r[57] = e("span", { class: "vpg-separator" }, "•", -1)),
|
|
7284
|
-
e("span", null,
|
|
7289
|
+
e("span", null, k(A(D).toLocaleString()) + " records", 1)
|
|
7285
7290
|
], 64)) : P("", !0)
|
|
7286
7291
|
]),
|
|
7287
7292
|
t.enablePagination && fe.value === "grid" && ct.value > 1 ? (i(), u("div", xc, [
|
|
@@ -7323,7 +7328,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7323
7328
|
})
|
|
7324
7329
|
], -1)
|
|
7325
7330
|
])], 8, Fc),
|
|
7326
|
-
e("span", Mc, " Page " +
|
|
7331
|
+
e("span", Mc, " Page " + k($.value) + " of " + k(ct.value), 1),
|
|
7327
7332
|
e("button", {
|
|
7328
7333
|
class: "vpg-page-btn",
|
|
7329
7334
|
disabled: $.value === ct.value,
|
|
@@ -7366,18 +7371,18 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7366
7371
|
fe.value === "grid" && pt.value && pt.value.count > 1 ? (i(), u("div", Dc, [
|
|
7367
7372
|
e("span", Ac, [
|
|
7368
7373
|
r[62] || (r[62] = e("span", { class: "vpg-stat-label" }, "Count:", -1)),
|
|
7369
|
-
e("span", _c,
|
|
7374
|
+
e("span", _c, k(pt.value.count), 1)
|
|
7370
7375
|
]),
|
|
7371
7376
|
pt.value.numericCount > 0 ? (i(), u(Z, { key: 0 }, [
|
|
7372
7377
|
r[65] || (r[65] = e("span", { class: "vpg-stat-divider" }, "|", -1)),
|
|
7373
7378
|
e("span", Tc, [
|
|
7374
7379
|
r[63] || (r[63] = e("span", { class: "vpg-stat-label" }, "Sum:", -1)),
|
|
7375
|
-
e("span", Ec,
|
|
7380
|
+
e("span", Ec, k(tn(pt.value.sum)), 1)
|
|
7376
7381
|
]),
|
|
7377
7382
|
r[66] || (r[66] = e("span", { class: "vpg-stat-divider" }, "|", -1)),
|
|
7378
7383
|
e("span", Nc, [
|
|
7379
7384
|
r[64] || (r[64] = e("span", { class: "vpg-stat-label" }, "Avg:", -1)),
|
|
7380
|
-
e("span", Lc,
|
|
7385
|
+
e("span", Lc, k(tn(pt.value.avg)), 1)
|
|
7381
7386
|
])
|
|
7382
7387
|
], 64)) : P("", !0)
|
|
7383
7388
|
])) : P("", !0),
|
|
@@ -7391,7 +7396,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7391
7396
|
rel: "noopener"
|
|
7392
7397
|
}, "Get License →", -1)
|
|
7393
7398
|
])])) : A(s) ? (i(), u("span", zc, [...r[68] || (r[68] = [
|
|
7394
|
-
Mt('<a href="https://tiny-pivot.com" target="_blank" rel="noopener" data-v-
|
|
7399
|
+
Mt('<a href="https://tiny-pivot.com" target="_blank" rel="noopener" data-v-4e43d32f><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-4e43d32f><rect x="3" y="3" width="7" height="7" data-v-4e43d32f></rect><rect x="14" y="3" width="7" height="7" data-v-4e43d32f></rect><rect x="14" y="14" width="7" height="7" data-v-4e43d32f></rect><rect x="3" y="14" width="7" height="7" data-v-4e43d32f></rect></svg> Powered by TinyPivot </a>', 1)
|
|
7395
7400
|
])])) : P("", !0)
|
|
7396
7401
|
])
|
|
7397
7402
|
]),
|
|
@@ -7439,7 +7444,7 @@ const Jr = { class: "vpg-pivot-config" }, Qr = { class: "vpg-config-header" }, X
|
|
|
7439
7444
|
], 6);
|
|
7440
7445
|
};
|
|
7441
7446
|
}
|
|
7442
|
-
}), Kc = /* @__PURE__ */ ot(Pc, [["__scopeId", "data-v-
|
|
7447
|
+
}), Kc = /* @__PURE__ */ ot(Pc, [["__scopeId", "data-v-4e43d32f"]]);
|
|
7443
7448
|
export {
|
|
7444
7449
|
Ir as ColumnFilter,
|
|
7445
7450
|
Kc as DataGrid,
|