@jielga/tmdatagrid 2.0.0-beta.13 → 2.0.0-beta.14
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 +4 -4
- package/dist/index.d.ts +24 -6
- package/dist/index.js +645 -636
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/appearance/SKILL.md +1 -1
- package/skills/cell-selection/SKILL.md +1 -1
- package/skills/columns/SKILL.md +12 -11
- package/skills/data/SKILL.md +1 -1
- package/skills/editing/SKILL.md +1 -1
- package/skills/filtering/SKILL.md +27 -5
- package/skills/getting-started/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +1 -1
- package/skills/options/SKILL.md +1 -1
- package/skills/rows/SKILL.md +1 -1
- package/skills/server-side/SKILL.md +129 -5
- package/skills/testing/SKILL.md +1 -1
- package/src/tmdatagrid/components/TMDataGrid.tsx +21 -20
- package/src/tmdatagrid/components/TMDataGridFilterPanel.tsx +5 -1
- package/src/tmdatagrid/components/TMDataGridHeaderFilterRow.tsx +2 -4
- package/src/tmdatagrid/components/TMDataGridMenu.tsx +11 -10
- package/src/tmdatagrid/core/columnUtils.ts +25 -5
- package/src/tmdatagrid/core/filterControls.ts +10 -1
- package/src/tmdatagrid/index.ts +1 -0
- package/src/tmdatagrid/useTMDataGrid.tsx +2 -2
package/dist/index.js
CHANGED
|
@@ -432,13 +432,13 @@ async function Jt(e, t) {
|
|
|
432
432
|
}
|
|
433
433
|
function Yt(e) {
|
|
434
434
|
let t = new he(Lt), n = /* @__PURE__ */ new Map(), r = 0, i = "__new__", a = !1, o = null, s = null, c = (t) => {
|
|
435
|
-
if (
|
|
435
|
+
if (Mn(t.id) || Bt(t) === null) return !1;
|
|
436
436
|
let n = e().editableColumnIds;
|
|
437
|
-
return n !== void 0 && !n.includes(t.id) ? !1 : !
|
|
437
|
+
return n !== void 0 && !n.includes(t.id) ? !1 : !kn(t);
|
|
438
438
|
}, l = () => e().table.getAllLeafColumns().filter(c), u = async (e, t, n) => {
|
|
439
439
|
let r = n ? void 0 : D(t), i = {};
|
|
440
440
|
for (let t of l()) {
|
|
441
|
-
if (r !== void 0 && !
|
|
441
|
+
if (r !== void 0 && !An(t, r)) continue;
|
|
442
442
|
let n = Bt(t);
|
|
443
443
|
if (n === null) continue;
|
|
444
444
|
let a = Xt(t.columnDef.meta?.edit?.validate);
|
|
@@ -694,7 +694,7 @@ function Yt(e) {
|
|
|
694
694
|
return a.unsubscribe = () => c.unsubscribe(), n.set(t, a), _(t), a;
|
|
695
695
|
}, T = (t) => !t.getIsGrouped() && e().isRowEditable?.(t) !== !1, E = (t, n) => {
|
|
696
696
|
let r = e();
|
|
697
|
-
return !(t.getIsGrouped() || !c(n) || !
|
|
697
|
+
return !(t.getIsGrouped() || !c(n) || !An(n, t) || r.isRowEditable !== void 0 && !r.isRowEditable(t));
|
|
698
698
|
}, D = (t) => {
|
|
699
699
|
try {
|
|
700
700
|
return e().table.getRow(t);
|
|
@@ -1708,36 +1708,45 @@ function Tn(e) {
|
|
|
1708
1708
|
return e.columnDef.meta?.type ?? "string";
|
|
1709
1709
|
}
|
|
1710
1710
|
function En(e) {
|
|
1711
|
-
|
|
1711
|
+
let t = ft(Tn(e)), n = e.columnDef.meta?.filter?.operators;
|
|
1712
|
+
if (!n) return t;
|
|
1713
|
+
let r = t.filter((e) => n.includes(e));
|
|
1714
|
+
return r.length > 0 ? r : t;
|
|
1712
1715
|
}
|
|
1713
1716
|
function Dn(e) {
|
|
1714
|
-
|
|
1717
|
+
let t = e.columnDef.meta?.filter?.defaultOperator;
|
|
1718
|
+
if (t) return t;
|
|
1719
|
+
let n = En(e), r = pt(Tn(e));
|
|
1720
|
+
return n.includes(r) ? r : n[0];
|
|
1715
1721
|
}
|
|
1716
1722
|
function On(e) {
|
|
1723
|
+
return e.columnDef.meta?.filter?.control;
|
|
1724
|
+
}
|
|
1725
|
+
function kn(e) {
|
|
1717
1726
|
return e.columnDef.meta?.edit?.enabled === !1;
|
|
1718
1727
|
}
|
|
1719
|
-
function
|
|
1728
|
+
function An(e, t) {
|
|
1720
1729
|
let n = e.columnDef.meta?.edit?.enabled;
|
|
1721
1730
|
return n === !1 ? !1 : typeof n != "function" || n(t);
|
|
1722
1731
|
}
|
|
1723
|
-
function An(e) {
|
|
1724
|
-
return e.columnDef.meta?.align ?? "left";
|
|
1725
|
-
}
|
|
1726
1732
|
function jn(e) {
|
|
1727
|
-
return e
|
|
1733
|
+
return e.columnDef.meta?.align ?? "left";
|
|
1728
1734
|
}
|
|
1729
1735
|
function Mn(e) {
|
|
1730
|
-
return
|
|
1736
|
+
return e === "__select__" || e === "__details__" || e === "__edit__" || e === "__rowNumber__";
|
|
1731
1737
|
}
|
|
1732
1738
|
function Nn(e) {
|
|
1739
|
+
return Mn(e) || e === "__group__";
|
|
1740
|
+
}
|
|
1741
|
+
function Pn(e) {
|
|
1733
1742
|
return e.columnDef.meta?.enableOrdering !== !1 && e.parent === void 0;
|
|
1734
1743
|
}
|
|
1735
1744
|
//#endregion
|
|
1736
1745
|
//#region src/tmdatagrid/components/useHideableColumns.ts
|
|
1737
|
-
function
|
|
1738
|
-
let t = e(14), { table: n } = Q(), r = A(n.store,
|
|
1746
|
+
function Fn() {
|
|
1747
|
+
let t = e(14), { table: n } = Q(), r = A(n.store, Ln), i, a;
|
|
1739
1748
|
if (t[0] !== r || t[1] !== n) {
|
|
1740
|
-
i = n.getAllLeafColumns().filter(
|
|
1749
|
+
i = n.getAllLeafColumns().filter(In);
|
|
1741
1750
|
let e;
|
|
1742
1751
|
t[4] === r ? e = t[5] : (e = (e) => r[e.id] !== !1, t[4] = r, t[5] = e), a = i.filter(e), t[0] = r, t[1] = n, t[2] = i, t[3] = a;
|
|
1743
1752
|
} else i = t[2], a = t[3];
|
|
@@ -1757,16 +1766,16 @@ function Pn() {
|
|
|
1757
1766
|
setAllVisible: c
|
|
1758
1767
|
}, t[9] = r, t[10] = i, t[11] = c, t[12] = o, t[13] = l) : l = t[13], l;
|
|
1759
1768
|
}
|
|
1760
|
-
function
|
|
1769
|
+
function In(e) {
|
|
1761
1770
|
return e.getCanHide();
|
|
1762
1771
|
}
|
|
1763
|
-
function
|
|
1772
|
+
function Ln(e) {
|
|
1764
1773
|
return e.columnVisibility;
|
|
1765
1774
|
}
|
|
1766
1775
|
//#endregion
|
|
1767
1776
|
//#region src/tmdatagrid/components/TMDataGridColumnsPanel.tsx
|
|
1768
|
-
function
|
|
1769
|
-
let t = e(47), { labels: n, controlSize: r, resetSettings: i } = Q(), [a, o] = c(""), { columns: s, columnVisibility: l, shownCount: u, setAllVisible: p } =
|
|
1777
|
+
function Rn() {
|
|
1778
|
+
let t = e(47), { labels: n, controlSize: r, resetSettings: i } = Q(), [a, o] = c(""), { columns: s, columnVisibility: l, shownCount: u, setAllVisible: p } = Fn(), m;
|
|
1770
1779
|
if (t[0] !== s || t[1] !== a) {
|
|
1771
1780
|
let e = a.trim().toLowerCase();
|
|
1772
1781
|
m = e ? s.filter((t) => wn(t).toLowerCase().includes(e)) : s, t[0] = s, t[1] = a, t[2] = m;
|
|
@@ -1864,29 +1873,29 @@ function Ln() {
|
|
|
1864
1873
|
}
|
|
1865
1874
|
//#endregion
|
|
1866
1875
|
//#region src/tmdatagrid/components/TMDataGridDraftActions.tsx
|
|
1867
|
-
function
|
|
1876
|
+
function zn() {
|
|
1868
1877
|
let { edit: e } = Q();
|
|
1869
|
-
return A(e.store,
|
|
1870
|
-
}
|
|
1871
|
-
function zn(e) {
|
|
1872
|
-
return e.committedRowIds.length + e.newRows.filter(Bn).length + e.deletedRowIds.length;
|
|
1878
|
+
return A(e.store, Bn);
|
|
1873
1879
|
}
|
|
1874
1880
|
function Bn(e) {
|
|
1881
|
+
return e.committedRowIds.length + e.newRows.filter(Vn).length + e.deletedRowIds.length;
|
|
1882
|
+
}
|
|
1883
|
+
function Vn(e) {
|
|
1875
1884
|
return e.committed;
|
|
1876
1885
|
}
|
|
1877
|
-
function
|
|
1886
|
+
function Hn() {
|
|
1878
1887
|
let { edit: e } = Q();
|
|
1879
|
-
return A(e.store,
|
|
1888
|
+
return A(e.store, Un);
|
|
1880
1889
|
}
|
|
1881
|
-
function
|
|
1890
|
+
function Un(e) {
|
|
1882
1891
|
return Rt(e).length;
|
|
1883
1892
|
}
|
|
1884
|
-
function
|
|
1893
|
+
function Wn() {
|
|
1885
1894
|
let t = e(1), { edit: n } = Q(), r;
|
|
1886
1895
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = { compare: _e }, t[0] = r) : r = t[0], A(n.store, Rt, r);
|
|
1887
1896
|
}
|
|
1888
|
-
function
|
|
1889
|
-
let t = e(11), { edit: n, labels: r } = Q(), i =
|
|
1897
|
+
function Gn() {
|
|
1898
|
+
let t = e(11), { edit: n, labels: r } = Q(), i = zn(), a = A(n.store, Kn), o = i === 0, s;
|
|
1890
1899
|
t[0] === n ? s = t[1] : (s = () => void n.saveDrafts(), t[0] = n, t[1] = s);
|
|
1891
1900
|
let c;
|
|
1892
1901
|
t[2] !== i || t[3] !== r ? (c = r.saveAllEdits(i), t[2] = i, t[3] = r, t[4] = c) : c = t[4];
|
|
@@ -1901,11 +1910,11 @@ function Wn() {
|
|
|
1901
1910
|
children: c
|
|
1902
1911
|
}), t[5] = i, t[6] = a, t[7] = o, t[8] = s, t[9] = c, t[10] = l) : l = t[10], l;
|
|
1903
1912
|
}
|
|
1904
|
-
function
|
|
1913
|
+
function Kn(e) {
|
|
1905
1914
|
return e.openRowIds.some((t) => e.rows[t]?.isSubmitting === !0);
|
|
1906
1915
|
}
|
|
1907
|
-
function
|
|
1908
|
-
let t = e(6), { labels: n } = Q(), r =
|
|
1916
|
+
function qn() {
|
|
1917
|
+
let t = e(6), { labels: n } = Q(), r = Hn();
|
|
1909
1918
|
if (r === 0) return null;
|
|
1910
1919
|
let i;
|
|
1911
1920
|
t[0] !== n || t[1] !== r ? (i = n.editRowsStillOpen(r), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
@@ -1918,8 +1927,8 @@ function Kn() {
|
|
|
1918
1927
|
children: i
|
|
1919
1928
|
}), t[3] = r, t[4] = i, t[5] = a) : a = t[5], a;
|
|
1920
1929
|
}
|
|
1921
|
-
function
|
|
1922
|
-
let t = e(6), { edit: n, labels: r } = Q(), i =
|
|
1930
|
+
function Jn() {
|
|
1931
|
+
let t = e(6), { edit: n, labels: r } = Q(), i = zn() + Hn() === 0, a;
|
|
1923
1932
|
t[0] === n ? a = t[1] : (a = () => n.cancelAll(), t[0] = n, t[1] = a);
|
|
1924
1933
|
let o;
|
|
1925
1934
|
return t[2] !== r.discardAllEdits || t[3] !== i || t[4] !== a ? (o = /* @__PURE__ */ q(d, {
|
|
@@ -1932,13 +1941,13 @@ function qn() {
|
|
|
1932
1941
|
children: r.discardAllEdits
|
|
1933
1942
|
}), t[2] = r.discardAllEdits, t[3] = i, t[4] = a, t[5] = o) : o = t[5], o;
|
|
1934
1943
|
}
|
|
1935
|
-
var
|
|
1936
|
-
Save:
|
|
1937
|
-
Discard:
|
|
1938
|
-
OpenRowsNote:
|
|
1944
|
+
var Yn = {
|
|
1945
|
+
Save: Gn,
|
|
1946
|
+
Discard: Jn,
|
|
1947
|
+
OpenRowsNote: qn
|
|
1939
1948
|
};
|
|
1940
|
-
function
|
|
1941
|
-
let n = e(10), { renderActions: r } = t === void 0 ? {} : t, { edit: i, features: a, table: o, scrollToRow: s } = Q(), c =
|
|
1949
|
+
function Xn(t) {
|
|
1950
|
+
let n = e(10), { renderActions: r } = t === void 0 ? {} : t, { edit: i, features: a, table: o, scrollToRow: s } = Q(), c = zn(), l = Wn(), u = A(i.store, Zn);
|
|
1942
1951
|
if (!a.editing) return null;
|
|
1943
1952
|
if (r) {
|
|
1944
1953
|
let e, t, d;
|
|
@@ -1970,7 +1979,7 @@ function Yn(t) {
|
|
|
1970
1979
|
scrollToRow: s,
|
|
1971
1980
|
scrollToFirstOpenRow: f
|
|
1972
1981
|
},
|
|
1973
|
-
Controls:
|
|
1982
|
+
Controls: Yn
|
|
1974
1983
|
});
|
|
1975
1984
|
}
|
|
1976
1985
|
let d;
|
|
@@ -1978,16 +1987,16 @@ function Yn(t) {
|
|
|
1978
1987
|
gap: "xs",
|
|
1979
1988
|
wrap: "nowrap",
|
|
1980
1989
|
children: [
|
|
1981
|
-
/* @__PURE__ */ q(
|
|
1982
|
-
/* @__PURE__ */ q(
|
|
1983
|
-
/* @__PURE__ */ q(
|
|
1990
|
+
/* @__PURE__ */ q(qn, {}),
|
|
1991
|
+
/* @__PURE__ */ q(Gn, {}),
|
|
1992
|
+
/* @__PURE__ */ q(Jn, {})
|
|
1984
1993
|
]
|
|
1985
1994
|
}), n[9] = d) : d = n[9], d;
|
|
1986
1995
|
}
|
|
1987
|
-
function
|
|
1996
|
+
function Zn(e) {
|
|
1988
1997
|
return e.openRowIds.some((t) => e.rows[t]?.isSubmitting === !0);
|
|
1989
1998
|
}
|
|
1990
|
-
var
|
|
1999
|
+
var Qn = {
|
|
1991
2000
|
filterPanel: "_filterPanel_wm77f_4",
|
|
1992
2001
|
filterRow: "_filterRow_wm77f_12",
|
|
1993
2002
|
filterRemove: "_filterRemove_wm77f_32",
|
|
@@ -1995,23 +2004,23 @@ var Zn = {
|
|
|
1995
2004
|
filterOperatorSlot: "_filterOperatorSlot_wm77f_43",
|
|
1996
2005
|
filterValueSlot: "_filterValueSlot_wm77f_44",
|
|
1997
2006
|
filterPanelFooter: "_filterPanelFooter_wm77f_49"
|
|
1998
|
-
},
|
|
1999
|
-
function
|
|
2007
|
+
}, $n = /* @__PURE__ */ new WeakMap();
|
|
2008
|
+
function er(e, t) {
|
|
2000
2009
|
if (e.options.manualFiltering !== !0 && e.options.manualPagination !== !0) return;
|
|
2001
|
-
let n = e.store, r =
|
|
2002
|
-
r === void 0 && (r = /* @__PURE__ */ new Set(),
|
|
2010
|
+
let n = e.store, r = $n.get(n);
|
|
2011
|
+
r === void 0 && (r = /* @__PURE__ */ new Set(), $n.set(n, r)), !r.has(t) && (r.add(t), console.warn(`TMDataGrid: column "${t}" resolves faceted options while the server owns the rows - the distinct values of one page are not the distinct values of the result set. Pass meta.options as a list or a function instead.`));
|
|
2003
2012
|
}
|
|
2004
|
-
function
|
|
2013
|
+
function tr(e, t) {
|
|
2005
2014
|
t == null || t === "" || e.add(String(t));
|
|
2006
2015
|
}
|
|
2007
|
-
function
|
|
2016
|
+
function nr({ table: e, column: t, row: n, fallback: r }) {
|
|
2008
2017
|
let i = t.columnDef.meta?.options ?? r;
|
|
2009
2018
|
if (!i) return [];
|
|
2010
2019
|
if (i === "faceted") {
|
|
2011
|
-
|
|
2020
|
+
er(e, t.id);
|
|
2012
2021
|
let n = /* @__PURE__ */ new Set();
|
|
2013
|
-
for (let e of t.getFacetedUniqueValues().keys()) if (Array.isArray(e)) for (let t of e)
|
|
2014
|
-
else
|
|
2022
|
+
for (let e of t.getFacetedUniqueValues().keys()) if (Array.isArray(e)) for (let t of e) tr(n, t);
|
|
2023
|
+
else tr(n, e);
|
|
2015
2024
|
return [...n].sort((e, t) => e.localeCompare(t, void 0, { numeric: !0 })).map((e) => ({ value: e }));
|
|
2016
2025
|
}
|
|
2017
2026
|
return (typeof i == "function" ? i({
|
|
@@ -2020,7 +2029,7 @@ function tr({ table: e, column: t, row: n, fallback: r }) {
|
|
|
2020
2029
|
row: n
|
|
2021
2030
|
}) : i).map((e) => typeof e == "string" ? { value: e } : e);
|
|
2022
2031
|
}
|
|
2023
|
-
function
|
|
2032
|
+
function rr(e) {
|
|
2024
2033
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
2025
2034
|
for (let r of e) {
|
|
2026
2035
|
let e = {
|
|
@@ -2041,7 +2050,7 @@ function nr(e) {
|
|
|
2041
2050
|
}
|
|
2042
2051
|
//#endregion
|
|
2043
2052
|
//#region src/tmdatagrid/components/filters/controlLayout.ts
|
|
2044
|
-
function
|
|
2053
|
+
function ir(e, t, n) {
|
|
2045
2054
|
if (e.layout === "row") return {
|
|
2046
2055
|
label: t.label,
|
|
2047
2056
|
w: t.width
|
|
@@ -2058,7 +2067,7 @@ function rr(e, t, n) {
|
|
|
2058
2067
|
}
|
|
2059
2068
|
//#endregion
|
|
2060
2069
|
//#region src/tmdatagrid/components/filters/TMDataGridFilterValueInput.tsx
|
|
2061
|
-
function
|
|
2070
|
+
function ar(t) {
|
|
2062
2071
|
let n = e(81), { column: r, operator: i, value: a, onChange: o, options: s, size: c, labels: l, layout: u } = t, d = Tn(r), f;
|
|
2063
2072
|
n[0] === i ? f = n[1] : (f = mt(i), n[0] = i, n[1] = f);
|
|
2064
2073
|
let m = f, h = typeof a == "string" ? a : "", g = d === "number" ? "number" : d === "date" ? "date" : "text", v = u === "header", y = u !== "row", b;
|
|
@@ -2068,7 +2077,7 @@ function ir(t) {
|
|
|
2068
2077
|
let e;
|
|
2069
2078
|
n[3] === a ? e = n[4] : (e = Array.isArray(a) ? [String(a[0] ?? ""), String(a[1] ?? "")] : ["", ""], n[3] = a, n[4] = e);
|
|
2070
2079
|
let r = e, i = y ? "100%" : void 0, s;
|
|
2071
|
-
n[5] !== t || n[6] !== l.filterFrom ? (s =
|
|
2080
|
+
n[5] !== t || n[6] !== l.filterFrom ? (s = ir(t, {
|
|
2072
2081
|
label: l.filterFrom,
|
|
2073
2082
|
width: 88
|
|
2074
2083
|
}, l.filterFrom), n[5] = t, n[6] = l.filterFrom, n[7] = s) : s = n[7];
|
|
@@ -2086,7 +2095,7 @@ function ir(t) {
|
|
|
2086
2095
|
onChange: d
|
|
2087
2096
|
}), n[11] = g, n[12] = r[0], n[13] = c, n[14] = s, n[15] = u, n[16] = d, n[17] = f) : f = n[17];
|
|
2088
2097
|
let m;
|
|
2089
|
-
n[18] !== t || n[19] !== l.filterTo ? (m =
|
|
2098
|
+
n[18] !== t || n[19] !== l.filterTo ? (m = ir(t, {
|
|
2090
2099
|
label: l.filterTo,
|
|
2091
2100
|
width: 88
|
|
2092
2101
|
}, l.filterTo), n[18] = t, n[19] = l.filterTo, n[20] = m) : m = n[20];
|
|
@@ -2114,12 +2123,12 @@ function ir(t) {
|
|
|
2114
2123
|
}
|
|
2115
2124
|
if (ht(i)) {
|
|
2116
2125
|
let e;
|
|
2117
|
-
n[35] !== t || n[36] !== l.filterValue ? (e =
|
|
2126
|
+
n[35] !== t || n[36] !== l.filterValue ? (e = ir(t, {
|
|
2118
2127
|
label: l.filterValue,
|
|
2119
2128
|
width: 180
|
|
2120
2129
|
}), n[35] = t, n[36] = l.filterValue, n[37] = e) : e = n[37];
|
|
2121
2130
|
let r;
|
|
2122
|
-
n[38] === s ? r = n[39] : (r =
|
|
2131
|
+
n[38] === s ? r = n[39] : (r = rr(s), n[38] = s, n[39] = r);
|
|
2123
2132
|
let i;
|
|
2124
2133
|
n[40] === a ? i = n[41] : (i = Array.isArray(a) ? [...a] : [], n[40] = a, n[41] = i);
|
|
2125
2134
|
let u;
|
|
@@ -2136,7 +2145,7 @@ function ir(t) {
|
|
|
2136
2145
|
}
|
|
2137
2146
|
if (d === "boolean") {
|
|
2138
2147
|
let e;
|
|
2139
|
-
n[48] !== t || n[49] !== l.filterValue ? (e =
|
|
2148
|
+
n[48] !== t || n[49] !== l.filterValue ? (e = ir(t, {
|
|
2140
2149
|
label: l.filterValue,
|
|
2141
2150
|
width: 180
|
|
2142
2151
|
}), n[48] = t, n[49] = l.filterValue, n[50] = e) : e = n[50];
|
|
@@ -2169,7 +2178,7 @@ function ir(t) {
|
|
|
2169
2178
|
}), n[60] = S, n[61] = c, n[62] = e, n[63] = r, n[64] = s, n[65] = u, n[66] = d, n[67] = f) : f = n[67], f;
|
|
2170
2179
|
}
|
|
2171
2180
|
let w;
|
|
2172
|
-
n[68] !== t || n[69] !== l.filterValue ? (w =
|
|
2181
|
+
n[68] !== t || n[69] !== l.filterValue ? (w = ir(t, {
|
|
2173
2182
|
label: l.filterValue,
|
|
2174
2183
|
width: 180
|
|
2175
2184
|
}), n[68] = t, n[69] = l.filterValue, n[70] = w) : w = n[70];
|
|
@@ -2189,50 +2198,50 @@ function ir(t) {
|
|
|
2189
2198
|
}
|
|
2190
2199
|
//#endregion
|
|
2191
2200
|
//#region src/tmdatagrid/components/filters/filterControlFor.ts
|
|
2192
|
-
var
|
|
2193
|
-
function
|
|
2201
|
+
var or = [];
|
|
2202
|
+
function sr(e) {
|
|
2194
2203
|
let t = e.columnDef.meta?.options;
|
|
2195
|
-
return
|
|
2204
|
+
return cr(e) && (t === void 0 || t === "faceted");
|
|
2196
2205
|
}
|
|
2197
|
-
function
|
|
2206
|
+
function cr(e) {
|
|
2198
2207
|
let t = Tn(e);
|
|
2199
2208
|
return e.columnDef.meta?.options !== void 0 || t === "select" || t === "multiSelect";
|
|
2200
2209
|
}
|
|
2201
|
-
function
|
|
2210
|
+
function lr(e, t) {
|
|
2202
2211
|
return {
|
|
2203
|
-
options:
|
|
2212
|
+
options: cr(t) ? nr({
|
|
2204
2213
|
table: e,
|
|
2205
2214
|
column: t,
|
|
2206
2215
|
fallback: "faceted"
|
|
2207
|
-
}) :
|
|
2208
|
-
ValueControl:
|
|
2216
|
+
}) : or,
|
|
2217
|
+
ValueControl: On(t) ?? ar
|
|
2209
2218
|
};
|
|
2210
2219
|
}
|
|
2211
2220
|
//#endregion
|
|
2212
2221
|
//#region src/tmdatagrid/components/TMDataGridFilterPanel.tsx
|
|
2213
|
-
var
|
|
2222
|
+
var ur = {
|
|
2214
2223
|
operator: "contains",
|
|
2215
2224
|
value: ""
|
|
2216
2225
|
};
|
|
2217
|
-
function
|
|
2218
|
-
return vt(e) ? e :
|
|
2226
|
+
function dr(e) {
|
|
2227
|
+
return vt(e) ? e : ur;
|
|
2219
2228
|
}
|
|
2220
|
-
function
|
|
2229
|
+
function fr(t) {
|
|
2221
2230
|
let n = e(70), r;
|
|
2222
2231
|
n[0] === t ? r = n[1] : (r = t === void 0 ? {} : t, n[0] = t, n[1] = r);
|
|
2223
|
-
let { layout: a } = r, o = a === void 0 ? "row" : a, { table: c, ui: u, labels: f, controlSize: p } = Q(), m = A(c.store,
|
|
2232
|
+
let { layout: a } = r, o = a === void 0 ? "row" : a, { table: c, ui: u, labels: f, controlSize: p } = Q(), m = A(c.store, gr), h = A(u, hr), g = s(null), _ = o === "stacked", v, y;
|
|
2224
2233
|
n[2] !== h || n[3] !== u ? (v = () => {
|
|
2225
2234
|
h !== null && (((g.current?.querySelector(`[data-dg-part="filter-row"][data-column-id="${CSS.escape(h)}"]`))?.querySelector("[data-dg-filter-value-slot]"))?.querySelector("input:not([type='hidden']), textarea, select, [tabindex]:not([tabindex='-1'])")?.focus(), u.actions.focusPanelFilter(null));
|
|
2226
2235
|
}, y = [h, u], n[2] = h, n[3] = u, n[4] = v, n[5] = y) : (v = n[4], y = n[5]), i(v, y);
|
|
2227
2236
|
let b, x, S, T, D, O, k;
|
|
2228
2237
|
if (n[6] !== m || n[7] !== c || n[8] !== u) {
|
|
2229
|
-
let e = c.getAllLeafColumns().filter(
|
|
2230
|
-
T = e.map(
|
|
2238
|
+
let e = c.getAllLeafColumns().filter(mr);
|
|
2239
|
+
T = e.map(pr);
|
|
2231
2240
|
let t;
|
|
2232
2241
|
n[16] !== m || n[17] !== c ? (t = function(e) {
|
|
2233
2242
|
c.setColumnFilters(m.filter((t) => t.id !== e));
|
|
2234
2243
|
}, n[16] = m, n[17] = c, n[18] = t) : t = n[18], O = t, x = function(e, t) {
|
|
2235
|
-
let n =
|
|
2244
|
+
let n = dr(m.find((t) => t.id === e)?.value), r = c.getColumn(t), i = r ? Dn(r) : pt("string"), a = yt(i) === yt(n.operator) ? n.value : _t(i);
|
|
2236
2245
|
c.setColumnFilters(m.filter((e) => e.id !== t).map((n) => n.id === e ? {
|
|
2237
2246
|
id: t,
|
|
2238
2247
|
value: {
|
|
@@ -2246,14 +2255,14 @@ function dr(t) {
|
|
|
2246
2255
|
c.setColumnFilters(m.map((n) => n.id === e ? {
|
|
2247
2256
|
...n,
|
|
2248
2257
|
value: {
|
|
2249
|
-
...
|
|
2258
|
+
...dr(n.value),
|
|
2250
2259
|
...t
|
|
2251
2260
|
}
|
|
2252
2261
|
} : n));
|
|
2253
2262
|
}, n[19] = m, n[20] = c, n[21] = r) : r = n[21], D = r;
|
|
2254
2263
|
let i;
|
|
2255
2264
|
n[22] !== m || n[23] !== D ? (i = function(e, t) {
|
|
2256
|
-
let n =
|
|
2265
|
+
let n = dr(m.find((t) => t.id === e)?.value), r = yt(t) === yt(n.operator) ? n.value : _t(t);
|
|
2257
2266
|
D(e, {
|
|
2258
2267
|
operator: t,
|
|
2259
2268
|
value: r
|
|
@@ -2261,7 +2270,7 @@ function dr(t) {
|
|
|
2261
2270
|
}, n[22] = m, n[23] = D, n[24] = i) : i = n[24], S = i, b = function() {
|
|
2262
2271
|
let t = e.find((e) => !m.some((t) => t.id === e.id));
|
|
2263
2272
|
if (!t) return;
|
|
2264
|
-
let n =
|
|
2273
|
+
let n = Dn(t);
|
|
2265
2274
|
c.setColumnFilters([...m, {
|
|
2266
2275
|
id: t.id,
|
|
2267
2276
|
value: {
|
|
@@ -2277,21 +2286,21 @@ function dr(t) {
|
|
|
2277
2286
|
if (n[27] !== x || n[28] !== S || n[29] !== m || n[30] !== T || n[31] !== p || n[32] !== f || n[33] !== o || n[34] !== D || n[35] !== O || n[36] !== _ || n[37] !== c) {
|
|
2278
2287
|
let e;
|
|
2279
2288
|
n[39] !== x || n[40] !== S || n[41] !== T || n[42] !== p || n[43] !== f || n[44] !== o || n[45] !== D || n[46] !== O || n[47] !== _ || n[48] !== c ? (e = (e) => {
|
|
2280
|
-
let t = c.getColumn(e.id), n =
|
|
2289
|
+
let t = c.getColumn(e.id), n = dr(e.value), r = t ? Tn(t) : "string", i = mt(n.operator), a = typeof n.value == "string" ? n.value : "", { options: s, ValueControl: u } = t === void 0 ? {
|
|
2281
2290
|
options: [],
|
|
2282
|
-
ValueControl:
|
|
2283
|
-
} :
|
|
2291
|
+
ValueControl: ar
|
|
2292
|
+
} : lr(c, t);
|
|
2284
2293
|
return /* @__PURE__ */ J("div", {
|
|
2285
2294
|
"data-dg-part": "filter-row",
|
|
2286
2295
|
"data-column-id": e.id,
|
|
2287
2296
|
"data-layout": o,
|
|
2288
|
-
className:
|
|
2297
|
+
className: Qn.filterRow,
|
|
2289
2298
|
children: [
|
|
2290
2299
|
/* @__PURE__ */ q(l, {
|
|
2291
2300
|
variant: "subtle",
|
|
2292
2301
|
color: "gray",
|
|
2293
2302
|
size: "lg",
|
|
2294
|
-
className:
|
|
2303
|
+
className: Qn.filterRemove,
|
|
2295
2304
|
"aria-label": f.removeFilter,
|
|
2296
2305
|
"data-dg-part": "filter-remove",
|
|
2297
2306
|
onClick: () => O(e.id),
|
|
@@ -2301,7 +2310,7 @@ function dr(t) {
|
|
|
2301
2310
|
})
|
|
2302
2311
|
}),
|
|
2303
2312
|
/* @__PURE__ */ q("div", {
|
|
2304
|
-
className:
|
|
2313
|
+
className: Qn.filterColumnSlot,
|
|
2305
2314
|
children: /* @__PURE__ */ q(C, {
|
|
2306
2315
|
label: f.filterColumn,
|
|
2307
2316
|
size: p,
|
|
@@ -2314,14 +2323,14 @@ function dr(t) {
|
|
|
2314
2323
|
})
|
|
2315
2324
|
}),
|
|
2316
2325
|
/* @__PURE__ */ q("div", {
|
|
2317
|
-
className:
|
|
2326
|
+
className: Qn.filterOperatorSlot,
|
|
2318
2327
|
children: /* @__PURE__ */ q(C, {
|
|
2319
2328
|
label: f.filterOperator,
|
|
2320
2329
|
size: p,
|
|
2321
2330
|
w: _ ? "100%" : 170,
|
|
2322
2331
|
allowDeselect: !1,
|
|
2323
2332
|
"data-dg-part": "filter-operator",
|
|
2324
|
-
data: ft(r).map((e) => ({
|
|
2333
|
+
data: (t ? En(t) : ft(r)).map((e) => ({
|
|
2325
2334
|
value: e,
|
|
2326
2335
|
label: f.operators[e]
|
|
2327
2336
|
})),
|
|
@@ -2330,7 +2339,7 @@ function dr(t) {
|
|
|
2330
2339
|
})
|
|
2331
2340
|
}),
|
|
2332
2341
|
/* @__PURE__ */ q("div", {
|
|
2333
|
-
className:
|
|
2342
|
+
className: Qn.filterValueSlot,
|
|
2334
2343
|
"data-dg-filter-value-slot": !0,
|
|
2335
2344
|
children: t ? /* @__PURE__ */ q(u, {
|
|
2336
2345
|
column: t,
|
|
@@ -2380,7 +2389,7 @@ function dr(t) {
|
|
|
2380
2389
|
}), n[56] = f.clearAllFilters, n[57] = I, n[58] = L, n[59] = R) : R = n[59];
|
|
2381
2390
|
let z;
|
|
2382
2391
|
n[60] !== R || n[61] !== F ? (z = /* @__PURE__ */ J("div", {
|
|
2383
|
-
className:
|
|
2392
|
+
className: Qn.filterPanelFooter,
|
|
2384
2393
|
children: [F, R]
|
|
2385
2394
|
}), n[60] = R, n[61] = F, n[62] = z) : z = n[62];
|
|
2386
2395
|
let B;
|
|
@@ -2395,33 +2404,33 @@ function dr(t) {
|
|
|
2395
2404
|
"aria-label": M,
|
|
2396
2405
|
"data-dg-part": "filter-panel",
|
|
2397
2406
|
"data-layout": o,
|
|
2398
|
-
className:
|
|
2407
|
+
className: Qn.filterPanel,
|
|
2399
2408
|
children: B
|
|
2400
2409
|
}), n[66] = f.filters, n[67] = o, n[68] = B, n[69] = V) : V = n[69], V;
|
|
2401
2410
|
}
|
|
2402
|
-
function
|
|
2411
|
+
function pr(e) {
|
|
2403
2412
|
return {
|
|
2404
2413
|
value: e.id,
|
|
2405
2414
|
label: wn(e)
|
|
2406
2415
|
};
|
|
2407
2416
|
}
|
|
2408
|
-
function
|
|
2417
|
+
function mr(e) {
|
|
2409
2418
|
return e.getCanFilter();
|
|
2410
2419
|
}
|
|
2411
|
-
function
|
|
2420
|
+
function hr(e) {
|
|
2412
2421
|
return e.filterPanelColumnId;
|
|
2413
2422
|
}
|
|
2414
|
-
function
|
|
2423
|
+
function gr(e) {
|
|
2415
2424
|
return e.columnFilters;
|
|
2416
2425
|
}
|
|
2417
|
-
var
|
|
2426
|
+
var _r = {
|
|
2418
2427
|
filterPills: "_filterPills_14wl0_3",
|
|
2419
2428
|
pill: "_pill_14wl0_15",
|
|
2420
2429
|
pillLabel: "_pillLabel_14wl0_27"
|
|
2421
2430
|
};
|
|
2422
2431
|
//#endregion
|
|
2423
2432
|
//#region src/tmdatagrid/core/filterSurface.ts
|
|
2424
|
-
function
|
|
2433
|
+
function vr(e = {}) {
|
|
2425
2434
|
let t = e.surface ?? "popup";
|
|
2426
2435
|
return {
|
|
2427
2436
|
surface: t,
|
|
@@ -2431,35 +2440,35 @@ function _r(e = {}) {
|
|
|
2431
2440
|
inHeader: e.inHeader ?? !1
|
|
2432
2441
|
};
|
|
2433
2442
|
}
|
|
2434
|
-
function
|
|
2443
|
+
function yr(e) {
|
|
2435
2444
|
if (typeof e != "object" || !e) return !1;
|
|
2436
2445
|
let t = e.fuzzyRank;
|
|
2437
2446
|
return typeof t == "object" && !!t && typeof t.rank == "number";
|
|
2438
2447
|
}
|
|
2439
|
-
function
|
|
2448
|
+
function br(e, t, n, r) {
|
|
2440
2449
|
let i = Je(String(e.getValue(t) ?? ""), String(n));
|
|
2441
2450
|
return r?.({ fuzzyRank: i }), i.passed;
|
|
2442
2451
|
}
|
|
2443
|
-
function
|
|
2452
|
+
function xr(e) {
|
|
2444
2453
|
let t = null, { columnFiltersMeta: n } = e;
|
|
2445
|
-
for (let e of Object.values(n ?? {}))
|
|
2454
|
+
for (let e of Object.values(n ?? {})) yr(e) && (t === null || e.fuzzyRank.rank > t.rank) && (t = e.fuzzyRank);
|
|
2446
2455
|
return t;
|
|
2447
2456
|
}
|
|
2448
|
-
function
|
|
2457
|
+
function Sr(e) {
|
|
2449
2458
|
let { globalFilterFn: t } = e.options;
|
|
2450
2459
|
if (t !== "tmDataGridFuzzy") return !1;
|
|
2451
2460
|
let n = e.store.state;
|
|
2452
2461
|
return (n.sorting?.length ?? 0) === 0 && (n.grouping?.length ?? 0) === 0 && typeof n.globalFilter == "string" && n.globalFilter.trim() !== "";
|
|
2453
2462
|
}
|
|
2454
|
-
function
|
|
2463
|
+
function Cr() {
|
|
2455
2464
|
let e = X();
|
|
2456
2465
|
return (t) => {
|
|
2457
2466
|
let n = e(t), r = null, i = null;
|
|
2458
2467
|
return () => {
|
|
2459
2468
|
let e = n();
|
|
2460
|
-
return
|
|
2469
|
+
return Sr(t) ? e === r && i !== null ? i : (i = {
|
|
2461
2470
|
rows: [...e.rows].sort((e, t) => {
|
|
2462
|
-
let n =
|
|
2471
|
+
let n = xr(e), r = xr(t);
|
|
2463
2472
|
return n !== null && r !== null ? qe(n, r) : n === null ? r === null ? 0 : 1 : -1;
|
|
2464
2473
|
}),
|
|
2465
2474
|
flatRows: e.flatRows,
|
|
@@ -2470,7 +2479,7 @@ function Sr() {
|
|
|
2470
2479
|
}
|
|
2471
2480
|
//#endregion
|
|
2472
2481
|
//#region src/tmdatagrid/core/labels.ts
|
|
2473
|
-
var
|
|
2482
|
+
var wr = {
|
|
2474
2483
|
operators: tt,
|
|
2475
2484
|
filters: "Filters",
|
|
2476
2485
|
searchPlaceholder: "Search",
|
|
@@ -2564,32 +2573,32 @@ var Cr = {
|
|
|
2564
2573
|
expandGroup: (e) => `Expand ${e}`,
|
|
2565
2574
|
collapseGroup: (e) => `Collapse ${e}`
|
|
2566
2575
|
};
|
|
2567
|
-
function
|
|
2576
|
+
function Tr(e) {
|
|
2568
2577
|
return e ? {
|
|
2569
|
-
...
|
|
2578
|
+
...wr,
|
|
2570
2579
|
...e,
|
|
2571
2580
|
operators: {
|
|
2572
|
-
...
|
|
2581
|
+
...wr.operators,
|
|
2573
2582
|
...e.operators
|
|
2574
2583
|
}
|
|
2575
|
-
} :
|
|
2584
|
+
} : wr;
|
|
2576
2585
|
}
|
|
2577
2586
|
//#endregion
|
|
2578
2587
|
//#region src/tmdatagrid/core/persistence.ts
|
|
2579
|
-
var
|
|
2588
|
+
var Er = [
|
|
2580
2589
|
"columnFilters",
|
|
2581
2590
|
"globalFilter",
|
|
2582
2591
|
"sorting",
|
|
2583
2592
|
"pagination",
|
|
2584
2593
|
"expanded"
|
|
2585
|
-
],
|
|
2594
|
+
], Dr = [
|
|
2586
2595
|
"columnVisibility",
|
|
2587
2596
|
"columnSizing",
|
|
2588
2597
|
"columnOrder",
|
|
2589
2598
|
"columnPinning",
|
|
2590
2599
|
"grouping"
|
|
2591
|
-
],
|
|
2592
|
-
function
|
|
2600
|
+
], Or = 1, kr = "__v";
|
|
2601
|
+
function Ar(e, t) {
|
|
2593
2602
|
if (!e) return null;
|
|
2594
2603
|
if (typeof e == "string") return {
|
|
2595
2604
|
key: e,
|
|
@@ -2601,7 +2610,7 @@ function kr(e, t) {
|
|
|
2601
2610
|
slices: r
|
|
2602
2611
|
} : null;
|
|
2603
2612
|
}
|
|
2604
|
-
function
|
|
2613
|
+
function jr(e) {
|
|
2605
2614
|
if (!e) return null;
|
|
2606
2615
|
try {
|
|
2607
2616
|
return typeof window > "u" ? null : e.storageMode === "sessionStorage" ? window.sessionStorage : window.localStorage;
|
|
@@ -2609,36 +2618,36 @@ function Ar(e) {
|
|
|
2609
2618
|
return null;
|
|
2610
2619
|
}
|
|
2611
2620
|
}
|
|
2612
|
-
function
|
|
2621
|
+
function Mr(e, t) {
|
|
2613
2622
|
return typeof e == "object" && e ? e[t] : void 0;
|
|
2614
2623
|
}
|
|
2615
|
-
var
|
|
2616
|
-
function
|
|
2624
|
+
var Nr = (e) => typeof e == "string", Pr = (e) => typeof e == "number" && Number.isFinite(e);
|
|
2625
|
+
function Fr(e, t) {
|
|
2617
2626
|
return Array.isArray(e) && e.every(t);
|
|
2618
2627
|
}
|
|
2619
|
-
function
|
|
2628
|
+
function Ir(e, t) {
|
|
2620
2629
|
return typeof e != "object" || !e || Array.isArray(e) ? !1 : Object.values(e).every(t);
|
|
2621
2630
|
}
|
|
2622
|
-
var
|
|
2623
|
-
columnFilters: (e) =>
|
|
2631
|
+
var Lr = (e) => Nr(Mr(e, "id")), Rr = {
|
|
2632
|
+
columnFilters: (e) => Fr(e, Lr),
|
|
2624
2633
|
globalFilter: () => !0,
|
|
2625
|
-
sorting: (e) =>
|
|
2634
|
+
sorting: (e) => Fr(e, (e) => Lr(e) && typeof Mr(e, "desc") == "boolean"),
|
|
2626
2635
|
pagination: (e) => {
|
|
2627
|
-
let t =
|
|
2628
|
-
return
|
|
2636
|
+
let t = Mr(e, "pageIndex"), n = Mr(e, "pageSize");
|
|
2637
|
+
return Pr(t) && t >= 0 && Pr(n) && n > 0;
|
|
2629
2638
|
},
|
|
2630
|
-
expanded: (e) => e === !0 ||
|
|
2631
|
-
columnVisibility: (e) =>
|
|
2632
|
-
columnSizing: (e) =>
|
|
2633
|
-
columnOrder: (e) =>
|
|
2634
|
-
columnPinning: (e) =>
|
|
2635
|
-
grouping: (e) =>
|
|
2639
|
+
expanded: (e) => e === !0 || Ir(e, (e) => typeof e == "boolean"),
|
|
2640
|
+
columnVisibility: (e) => Ir(e, (e) => typeof e == "boolean"),
|
|
2641
|
+
columnSizing: (e) => Ir(e, Pr),
|
|
2642
|
+
columnOrder: (e) => Fr(e, Nr),
|
|
2643
|
+
columnPinning: (e) => Fr(Mr(e, "left"), Nr) && Fr(Mr(e, "right"), Nr),
|
|
2644
|
+
grouping: (e) => Fr(e, Nr)
|
|
2636
2645
|
};
|
|
2637
|
-
function
|
|
2638
|
-
let n =
|
|
2646
|
+
function zr(e, t) {
|
|
2647
|
+
let n = Rr[e];
|
|
2639
2648
|
return n === void 0 || n(t);
|
|
2640
2649
|
}
|
|
2641
|
-
function
|
|
2650
|
+
function Br(e, t, n) {
|
|
2642
2651
|
if (!e || !t) return {};
|
|
2643
2652
|
try {
|
|
2644
2653
|
let r = e.getItem(t.key);
|
|
@@ -2646,39 +2655,39 @@ function zr(e, t, n) {
|
|
|
2646
2655
|
let i = n(r);
|
|
2647
2656
|
if (typeof i != "object" || !i) return {};
|
|
2648
2657
|
let a = i;
|
|
2649
|
-
if (a[
|
|
2658
|
+
if (a[kr] !== 1) return {};
|
|
2650
2659
|
let o = {};
|
|
2651
|
-
for (let e of t.slices) e in a &&
|
|
2660
|
+
for (let e of t.slices) e in a && zr(e, a[e]) && (o[e] = a[e]);
|
|
2652
2661
|
return o;
|
|
2653
2662
|
} catch {
|
|
2654
2663
|
return {};
|
|
2655
2664
|
}
|
|
2656
2665
|
}
|
|
2657
|
-
function
|
|
2666
|
+
function Vr(e, t, n, r) {
|
|
2658
2667
|
if (!e || !t) return;
|
|
2659
|
-
let i = { [
|
|
2668
|
+
let i = { [kr]: 1 };
|
|
2660
2669
|
for (let e of t.slices) i[e] = n[e];
|
|
2661
2670
|
try {
|
|
2662
2671
|
e.setItem(t.key, r(i));
|
|
2663
2672
|
} catch {}
|
|
2664
2673
|
}
|
|
2665
|
-
function
|
|
2674
|
+
function Hr(e) {
|
|
2666
2675
|
return {
|
|
2667
|
-
data:
|
|
2668
|
-
settings:
|
|
2676
|
+
data: Ar(e?.dataKey, Er),
|
|
2677
|
+
settings: Ar(e?.settingsKey, Dr)
|
|
2669
2678
|
};
|
|
2670
2679
|
}
|
|
2671
|
-
function
|
|
2672
|
-
let { data: t, settings: n } =
|
|
2680
|
+
function Ur(e) {
|
|
2681
|
+
let { data: t, settings: n } = Hr(e);
|
|
2673
2682
|
return t !== null || n !== null;
|
|
2674
2683
|
}
|
|
2675
|
-
var
|
|
2676
|
-
function
|
|
2684
|
+
var Wr = (e) => JSON.parse(e), Gr = (e) => JSON.stringify(e);
|
|
2685
|
+
function Kr(e, t = []) {
|
|
2677
2686
|
for (let n of e) {
|
|
2678
2687
|
if (typeof n != "object" || !n) continue;
|
|
2679
2688
|
let e = n;
|
|
2680
2689
|
if (Array.isArray(e.columns) && e.columns.length > 0) {
|
|
2681
|
-
|
|
2690
|
+
Kr(e.columns, t);
|
|
2682
2691
|
continue;
|
|
2683
2692
|
}
|
|
2684
2693
|
let r = typeof e.accessorKey == "string" ? e.accessorKey : void 0, i = (typeof e.id == "string" ? e.id : void 0) ?? r?.replaceAll(".", "_") ?? (typeof e.header == "string" ? e.header : void 0);
|
|
@@ -2686,29 +2695,29 @@ function Gr(e, t = []) {
|
|
|
2686
2695
|
}
|
|
2687
2696
|
return t;
|
|
2688
2697
|
}
|
|
2689
|
-
function
|
|
2698
|
+
function qr(e, t) {
|
|
2690
2699
|
let n = (e) => typeof e == "string" && t.has(e), r = (e) => e.filter(n), i = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => n(e))), a = (e) => e.filter((e) => n(e.id)), o = { ...e };
|
|
2691
2700
|
return e.columnOrder && (o.columnOrder = r(e.columnOrder)), e.grouping && (o.grouping = r(e.grouping)), e.columnVisibility && (o.columnVisibility = i(e.columnVisibility)), e.columnSizing && (o.columnSizing = i(e.columnSizing)), e.columnPinning && (o.columnPinning = {
|
|
2692
2701
|
left: r(e.columnPinning.left ?? []),
|
|
2693
2702
|
right: r(e.columnPinning.right ?? [])
|
|
2694
2703
|
}), e.sorting && (o.sorting = a(e.sorting)), e.columnFilters && (o.columnFilters = a(e.columnFilters)), o;
|
|
2695
2704
|
}
|
|
2696
|
-
function
|
|
2697
|
-
let n =
|
|
2698
|
-
...
|
|
2699
|
-
...
|
|
2705
|
+
function Jr(e, t) {
|
|
2706
|
+
let n = jr(e), { data: r, settings: i } = Hr(e), a = e?.deserialize ?? Wr, o = {
|
|
2707
|
+
...Br(n, i, a),
|
|
2708
|
+
...Br(n, r, a)
|
|
2700
2709
|
};
|
|
2701
|
-
return t === void 0 ? o :
|
|
2710
|
+
return t === void 0 ? o : qr(o, new Set(t));
|
|
2702
2711
|
}
|
|
2703
|
-
function
|
|
2704
|
-
let n =
|
|
2712
|
+
function Yr(e, t) {
|
|
2713
|
+
let n = jr(t);
|
|
2705
2714
|
if (!n) return;
|
|
2706
|
-
let { data: r, settings: i } =
|
|
2707
|
-
|
|
2715
|
+
let { data: r, settings: i } = Hr(t), a = t?.serialize ?? Gr;
|
|
2716
|
+
Vr(n, r, e, a), Vr(n, i, e, a);
|
|
2708
2717
|
}
|
|
2709
2718
|
//#endregion
|
|
2710
2719
|
//#region src/tmdatagrid/core/capabilities.ts
|
|
2711
|
-
function
|
|
2720
|
+
function Xr(e) {
|
|
2712
2721
|
let t = e.selectionMode ?? "checkbox", n = e.cellSelection ?? (e.editing === void 0 ? "none" : "single"), r = t !== "highlight" && e.enableRowSelection !== !1;
|
|
2713
2722
|
return {
|
|
2714
2723
|
sorting: e.enableSorting !== !1,
|
|
@@ -2739,19 +2748,19 @@ function Yr(e) {
|
|
|
2739
2748
|
matchHighlighting: e.enableMatchHighlighting === !0
|
|
2740
2749
|
};
|
|
2741
2750
|
}
|
|
2742
|
-
function
|
|
2751
|
+
function Zr(e, t) {
|
|
2743
2752
|
return {
|
|
2744
2753
|
canSort: t.sorting && e.getCanSort(),
|
|
2745
2754
|
canFilter: t.filtering && e.getCanFilter(),
|
|
2746
2755
|
canHide: t.hiding && e.getCanHide(),
|
|
2747
2756
|
canPin: t.pinning && e.getCanPin(),
|
|
2748
2757
|
canResize: t.resizing && e.getCanResize(),
|
|
2749
|
-
canReorder: t.ordering &&
|
|
2758
|
+
canReorder: t.ordering && Pn(e),
|
|
2750
2759
|
canGroup: t.grouping && e.getCanGroup()
|
|
2751
2760
|
};
|
|
2752
2761
|
}
|
|
2753
|
-
function
|
|
2754
|
-
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(
|
|
2762
|
+
function Qr(e, t) {
|
|
2763
|
+
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(Zr(n, t)));
|
|
2755
2764
|
return {
|
|
2756
2765
|
canSortAny: r((e) => e.canSort),
|
|
2757
2766
|
canFilterAny: r((e) => e.canFilter),
|
|
@@ -2766,12 +2775,12 @@ function Zr(e, t) {
|
|
|
2766
2775
|
}
|
|
2767
2776
|
//#endregion
|
|
2768
2777
|
//#region src/tmdatagrid/core/cellNavigation.ts
|
|
2769
|
-
var
|
|
2770
|
-
function
|
|
2778
|
+
var $r = (e, t) => Math.min(Math.max(e, 0), Math.max(t, 0));
|
|
2779
|
+
function ei({ key: e, ctrlKey: t, from: n, rowCount: r, columnCount: i, pageRows: a }) {
|
|
2771
2780
|
if (r === 0 || i === 0) return null;
|
|
2772
2781
|
let o = r - 1, s = i - 1, c = (e, t) => ({
|
|
2773
|
-
rowIndex:
|
|
2774
|
-
columnIndex:
|
|
2782
|
+
rowIndex: $r(e, o),
|
|
2783
|
+
columnIndex: $r(t, s)
|
|
2775
2784
|
});
|
|
2776
2785
|
switch (e) {
|
|
2777
2786
|
case "ArrowDown": return c(n.rowIndex + 1, n.columnIndex);
|
|
@@ -2785,7 +2794,7 @@ function $r({ key: e, ctrlKey: t, from: n, rowCount: r, columnCount: i, pageRows
|
|
|
2785
2794
|
default: return null;
|
|
2786
2795
|
}
|
|
2787
2796
|
}
|
|
2788
|
-
function
|
|
2797
|
+
function ti({ from: e, direction: t, rowCount: n, columnCount: r, isEditable: i }) {
|
|
2789
2798
|
let a = n * r;
|
|
2790
2799
|
if (a === 0) return null;
|
|
2791
2800
|
let o = e.rowIndex * r + e.columnIndex;
|
|
@@ -2798,12 +2807,12 @@ function ei({ from: e, direction: t, rowCount: n, columnCount: r, isEditable: i
|
|
|
2798
2807
|
}
|
|
2799
2808
|
return null;
|
|
2800
2809
|
}
|
|
2801
|
-
function
|
|
2810
|
+
function ni(e, t) {
|
|
2802
2811
|
return e === null || t === null ? e === t : e.rowId === t.rowId && e.columnId === t.columnId;
|
|
2803
2812
|
}
|
|
2804
2813
|
//#endregion
|
|
2805
2814
|
//#region src/tmdatagrid/core/controlledState.ts
|
|
2806
|
-
var
|
|
2815
|
+
var ri = {
|
|
2807
2816
|
columnFilters: "onColumnFiltersChange",
|
|
2808
2817
|
columnOrder: "onColumnOrderChange",
|
|
2809
2818
|
columnPinning: "onColumnPinningChange",
|
|
@@ -2817,63 +2826,63 @@ var ni = {
|
|
|
2817
2826
|
rowPinning: "onRowPinningChange",
|
|
2818
2827
|
rowSelection: "onRowSelectionChange",
|
|
2819
2828
|
sorting: "onSortingChange"
|
|
2820
|
-
},
|
|
2821
|
-
function
|
|
2829
|
+
}, ii = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
2830
|
+
function ai(e) {
|
|
2822
2831
|
if (typeof e != "object" || !e) return !1;
|
|
2823
2832
|
let t = Object.getPrototypeOf(e);
|
|
2824
2833
|
return t === Object.prototype || t === null;
|
|
2825
2834
|
}
|
|
2826
|
-
function
|
|
2835
|
+
function oi(e, t) {
|
|
2827
2836
|
if (Object.is(e, t)) return !0;
|
|
2828
2837
|
if (e instanceof Date || t instanceof Date) return e instanceof Date && t instanceof Date && e.getTime() === t.getTime();
|
|
2829
|
-
if (Array.isArray(e) || Array.isArray(t)) return !Array.isArray(e) || !Array.isArray(t) ? !1 : e.length === t.length && e.every((e, n) =>
|
|
2830
|
-
if (!
|
|
2838
|
+
if (Array.isArray(e) || Array.isArray(t)) return !Array.isArray(e) || !Array.isArray(t) ? !1 : e.length === t.length && e.every((e, n) => oi(e, t[n]));
|
|
2839
|
+
if (!ai(e) || !ai(t)) return !1;
|
|
2831
2840
|
let n = Object.keys(e);
|
|
2832
|
-
return n.length === Object.keys(t).length && n.every((n) =>
|
|
2841
|
+
return n.length === Object.keys(t).length && n.every((n) => ii(t, n) && oi(e[n], t[n]));
|
|
2833
2842
|
}
|
|
2834
|
-
function
|
|
2843
|
+
function si(e) {
|
|
2835
2844
|
if (e === void 0 || !Object.values(e).includes(void 0)) return e;
|
|
2836
2845
|
let t = {};
|
|
2837
2846
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
2838
2847
|
return t;
|
|
2839
2848
|
}
|
|
2840
|
-
function
|
|
2849
|
+
function ci(e, t) {
|
|
2841
2850
|
if (e === void 0 || t === void 0 || e === t) return e;
|
|
2842
2851
|
let n = Object.keys(e), r = {}, i = n.length !== Object.keys(t).length;
|
|
2843
2852
|
for (let a of n) {
|
|
2844
2853
|
let n = e[a], o = t[a];
|
|
2845
|
-
|
|
2854
|
+
ii(t, a) && oi(n, o) ? r[a] = o : (r[a] = n, i = !0);
|
|
2846
2855
|
}
|
|
2847
2856
|
return i ? r : t;
|
|
2848
2857
|
}
|
|
2849
|
-
function
|
|
2858
|
+
function li(e) {
|
|
2850
2859
|
let t = e.state;
|
|
2851
|
-
return t === void 0 ? [] : Object.entries(
|
|
2860
|
+
return t === void 0 ? [] : Object.entries(ri).filter(([n, r]) => t[n] !== void 0 && e[r] === void 0 && e.atoms?.[n] === void 0).map(([e, t]) => ({
|
|
2852
2861
|
slice: e,
|
|
2853
2862
|
handler: t
|
|
2854
2863
|
}));
|
|
2855
2864
|
}
|
|
2856
2865
|
//#endregion
|
|
2857
2866
|
//#region src/tmdatagrid/core/controlledStateSync.ts
|
|
2858
|
-
var
|
|
2859
|
-
function
|
|
2860
|
-
|
|
2861
|
-
|
|
2867
|
+
var ui = !1;
|
|
2868
|
+
function di() {
|
|
2869
|
+
ui = !0, queueMicrotask(() => {
|
|
2870
|
+
ui = !1;
|
|
2862
2871
|
});
|
|
2863
2872
|
}
|
|
2864
|
-
function
|
|
2865
|
-
|
|
2873
|
+
function fi() {
|
|
2874
|
+
ui = !1;
|
|
2866
2875
|
}
|
|
2867
|
-
var
|
|
2868
|
-
function
|
|
2869
|
-
if (
|
|
2870
|
-
|
|
2876
|
+
var pi = /* @__PURE__ */ new WeakSet();
|
|
2877
|
+
function mi(e) {
|
|
2878
|
+
if (pi.has(e)) return;
|
|
2879
|
+
pi.add(e);
|
|
2871
2880
|
let t = e.subscribe.bind(e);
|
|
2872
2881
|
e.subscribe = (e) => {
|
|
2873
2882
|
let n = typeof e == "function" ? e : e.next?.bind(e);
|
|
2874
2883
|
if (n === void 0) return t(e);
|
|
2875
2884
|
let r = !0, i = t((e) => {
|
|
2876
|
-
if (!
|
|
2885
|
+
if (!ui) {
|
|
2877
2886
|
n(e);
|
|
2878
2887
|
return;
|
|
2879
2888
|
}
|
|
@@ -2888,21 +2897,21 @@ function pi(e) {
|
|
|
2888
2897
|
}
|
|
2889
2898
|
//#endregion
|
|
2890
2899
|
//#region src/tmdatagrid/core/pageReset.ts
|
|
2891
|
-
function
|
|
2900
|
+
function hi(e) {
|
|
2892
2901
|
return e.filter((e) => !vt(e.value) || bt(e.value));
|
|
2893
2902
|
}
|
|
2894
|
-
function hi(e, t, n) {
|
|
2895
|
-
return e === "columnFilters" ? !ai(mi(t), mi(n)) : !ai(t, n);
|
|
2896
|
-
}
|
|
2897
2903
|
function gi(e, t, n) {
|
|
2904
|
+
return e === "columnFilters" ? !oi(hi(t), hi(n)) : !oi(t, n);
|
|
2905
|
+
}
|
|
2906
|
+
function _i(e, t, n) {
|
|
2898
2907
|
return (r) => {
|
|
2899
2908
|
let i = n(), a = i.store.state[e], o = Ie(r, a);
|
|
2900
|
-
(t ?? Z(e, i))(r),
|
|
2909
|
+
(t ?? Z(e, i))(r), gi(e, a, o) && i.store.state.pagination.pageIndex !== 0 && i.setPageIndex(0);
|
|
2901
2910
|
};
|
|
2902
2911
|
}
|
|
2903
2912
|
//#endregion
|
|
2904
2913
|
//#region src/tmdatagrid/useTMDataGrid.tsx
|
|
2905
|
-
var
|
|
2914
|
+
var vi = 200, yi = Ge({
|
|
2906
2915
|
columnFilteringFeature: be,
|
|
2907
2916
|
globalFilteringFeature: Le,
|
|
2908
2917
|
rowSortingFeature: Ue,
|
|
@@ -2919,7 +2928,7 @@ var _i = 200, vi = Ge({
|
|
|
2919
2928
|
rowPinningFeature: Ve,
|
|
2920
2929
|
filteredRowModel: je(),
|
|
2921
2930
|
groupedRowModel: Me(),
|
|
2922
|
-
sortedRowModel:
|
|
2931
|
+
sortedRowModel: Cr(),
|
|
2923
2932
|
expandedRowModel: De(),
|
|
2924
2933
|
paginatedRowModel: Ne(),
|
|
2925
2934
|
facetedRowModel: ke(),
|
|
@@ -2928,26 +2937,26 @@ var _i = 200, vi = Ge({
|
|
|
2928
2937
|
filterFns: {
|
|
2929
2938
|
...Pe,
|
|
2930
2939
|
tmDataGrid: Dt,
|
|
2931
|
-
tmDataGridFuzzy:
|
|
2940
|
+
tmDataGridFuzzy: br
|
|
2932
2941
|
},
|
|
2933
2942
|
sortFns: We,
|
|
2934
2943
|
aggregationFns: ve,
|
|
2935
2944
|
tableMeta: Re(),
|
|
2936
2945
|
columnMeta: Re()
|
|
2937
2946
|
});
|
|
2938
|
-
function
|
|
2947
|
+
function bi() {
|
|
2939
2948
|
return Ee();
|
|
2940
2949
|
}
|
|
2941
|
-
var
|
|
2942
|
-
function
|
|
2950
|
+
var xi = 160, Si = 6, Ci = [];
|
|
2951
|
+
function wi(e) {
|
|
2943
2952
|
let t = { ...e };
|
|
2944
|
-
for (let e of Object.keys(t))
|
|
2953
|
+
for (let e of Object.keys(t)) Mn(e) && delete t[e];
|
|
2945
2954
|
return t;
|
|
2946
2955
|
}
|
|
2947
|
-
function
|
|
2956
|
+
function Ti(e) {
|
|
2948
2957
|
return e.map((e) => "columns" in e && Array.isArray(e.columns) ? {
|
|
2949
2958
|
...e,
|
|
2950
|
-
columns:
|
|
2959
|
+
columns: Ti(e.columns)
|
|
2951
2960
|
} : {
|
|
2952
2961
|
filterFn: "tmDataGrid",
|
|
2953
2962
|
aggregationFn: void 0,
|
|
@@ -2955,8 +2964,8 @@ function wi(e) {
|
|
|
2955
2964
|
...e
|
|
2956
2965
|
});
|
|
2957
2966
|
}
|
|
2958
|
-
function
|
|
2959
|
-
let C = v?.mode, w = v?.draft === !0, T =
|
|
2967
|
+
function Ei({ persist: e, labels: t, enableColumnOrdering: r, enablePagination: a, resetPageOnQueryChange: l, enableRowNumbers: u, selectionMode: d, showSelectedBackground: f, defaultHighlightedRowId: p, onHighlightedRowChange: m, cellSelection: h, onFocusedCellChange: g, filters: _, editing: v, renderDetails: y, renderDetailsEstHeight: b = xi, overscan: x = Si, ...S }) {
|
|
2968
|
+
let C = v?.mode, w = v?.draft === !0, T = Xr({
|
|
2960
2969
|
...S,
|
|
2961
2970
|
enableColumnOrdering: r,
|
|
2962
2971
|
enablePagination: a,
|
|
@@ -2965,7 +2974,7 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2965
2974
|
showSelectedBackground: f,
|
|
2966
2975
|
cellSelection: h,
|
|
2967
2976
|
editing: v
|
|
2968
|
-
}), E = o(() =>
|
|
2977
|
+
}), E = o(() => Tr(t), [t]), { surface: D, sidebarSide: O, sidebarWidth: j, defaultOpen: M, inHeader: N } = _ ?? {}, P = o(() => vr({
|
|
2969
2978
|
surface: D,
|
|
2970
2979
|
sidebarSide: O,
|
|
2971
2980
|
sidebarWidth: j,
|
|
@@ -2978,7 +2987,7 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2978
2987
|
M,
|
|
2979
2988
|
N
|
|
2980
2989
|
]), F = S.enableColumnPinning !== !1, I = T.selectColumn, L = T.grouping, R = y !== void 0, z = v !== void 0 && (v.mode === "row" || w || v.onRowDelete !== void 0), B = E.selectColumnLabel, V = E.groupColumnLabel, ee = E.detailsColumnLabel, H = E.editColumnLabel, te = E.rowNumberColumnLabel, U = T.rowNumbers, ne = w, re = o(() => {
|
|
2981
|
-
let e =
|
|
2990
|
+
let e = Ti(S.columns);
|
|
2982
2991
|
return [
|
|
2983
2992
|
...U ? [pn(te)] : [],
|
|
2984
2993
|
...I ? [Cn(B)] : [],
|
|
@@ -3000,13 +3009,13 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3000
3009
|
V,
|
|
3001
3010
|
ee,
|
|
3002
3011
|
H
|
|
3003
|
-
]), [ie] = c(() =>
|
|
3012
|
+
]), [ie] = c(() => Jr(e, Kr(re))), ae = ie.grouping ?? S.initialState?.grouping ?? [], oe = s((S.state?.grouping ?? ae).length > 0), W = si(S.state), se = W?.columnVisibility, ce = W !== void 0 && se !== void 0 ? {
|
|
3004
3013
|
...W,
|
|
3005
3014
|
columnVisibility: {
|
|
3006
|
-
...
|
|
3015
|
+
...wi(se),
|
|
3007
3016
|
...L ? { [rn]: oe.current } : {}
|
|
3008
3017
|
}
|
|
3009
|
-
} : W, le = s(void 0), G = s(!1), K = G.current ? ce :
|
|
3018
|
+
} : W, le = s(void 0), G = s(!1), K = G.current ? ce : ci(ce, le.current);
|
|
3010
3019
|
G.current = !1, le.current = K;
|
|
3011
3020
|
let ue = s(null), q = n((e) => {
|
|
3012
3021
|
let t = e.columnResizing, n = ue.current;
|
|
@@ -3014,7 +3023,7 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3014
3023
|
...e,
|
|
3015
3024
|
columnResizing: n
|
|
3016
3025
|
};
|
|
3017
|
-
}, []), J = s(null), [de] = c(() => Yt(() => J.current)), fe = A(de.store, (e) => e.committedValues), pe = T.editNewRowsSticky, me = A(de.store, (e) => pe ?
|
|
3026
|
+
}, []), J = s(null), [de] = c(() => Yt(() => J.current)), fe = A(de.store, (e) => e.committedValues), pe = T.editNewRowsSticky, me = A(de.store, (e) => pe ? Ci : e.newRows.filter((e) => e.committed).map((e) => e.tempId), { compare: _e }), he = s(S.getRowId);
|
|
3018
3027
|
he.current = S.getRowId;
|
|
3019
3028
|
let ge = o(() => {
|
|
3020
3029
|
let e = he.current, t = /* @__PURE__ */ new Map(), n = [];
|
|
@@ -3042,7 +3051,7 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3042
3051
|
]), ve = s(ge.idOf);
|
|
3043
3052
|
ve.current = ge.idOf;
|
|
3044
3053
|
let ye = n((e, t, n) => ve.current.get(e) ?? he.current?.(e, t, n) ?? (n === void 0 ? String(t) : `${n.id}.${t}`), []), be = s(null), xe = l ?? S.manualPagination === !0, Se = n(() => be.current, []);
|
|
3045
|
-
|
|
3054
|
+
di();
|
|
3046
3055
|
let Y = Ke({
|
|
3047
3056
|
columnResizeMode: "onEnd",
|
|
3048
3057
|
enableSorting: !0,
|
|
@@ -3051,22 +3060,22 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3051
3060
|
groupedColumnMode: "remove",
|
|
3052
3061
|
...S,
|
|
3053
3062
|
...xe ? {
|
|
3054
|
-
onColumnFiltersChange:
|
|
3055
|
-
onGlobalFilterChange:
|
|
3056
|
-
onSortingChange:
|
|
3063
|
+
onColumnFiltersChange: _i("columnFilters", S.onColumnFiltersChange, Se),
|
|
3064
|
+
onGlobalFilterChange: _i("globalFilter", S.onGlobalFilterChange, Se),
|
|
3065
|
+
onSortingChange: _i("sorting", S.onSortingChange, Se)
|
|
3057
3066
|
} : {},
|
|
3058
3067
|
data: ge.rows,
|
|
3059
3068
|
getRowId: ye,
|
|
3060
3069
|
...y === void 0 ? {} : { getRowCanExpand: S.getRowCanExpand ?? (() => !0) },
|
|
3061
3070
|
enableRowPinning: (e) => !e.getIsGrouped() && (typeof S.enableRowPinning == "function" ? S.enableRowPinning(e) : S.enableRowPinning === !0),
|
|
3062
|
-
features:
|
|
3071
|
+
features: yi,
|
|
3063
3072
|
columns: re,
|
|
3064
3073
|
state: K,
|
|
3065
3074
|
initialState: {
|
|
3066
3075
|
...S.initialState,
|
|
3067
3076
|
...ie,
|
|
3068
3077
|
columnVisibility: {
|
|
3069
|
-
...
|
|
3078
|
+
...wi({
|
|
3070
3079
|
...S.initialState?.columnVisibility,
|
|
3071
3080
|
...ie.columnVisibility
|
|
3072
3081
|
}),
|
|
@@ -3090,7 +3099,7 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3090
3099
|
}
|
|
3091
3100
|
}
|
|
3092
3101
|
}, q);
|
|
3093
|
-
|
|
3102
|
+
fi(), be.current = Y, mi(Y.store), J.current = {
|
|
3094
3103
|
table: Y,
|
|
3095
3104
|
editMode: C ?? "cell",
|
|
3096
3105
|
draft: w,
|
|
@@ -3121,7 +3130,7 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3121
3130
|
]), i(() => {
|
|
3122
3131
|
v !== void 0 && S.getRowId === void 0 && console.error("TMDataGrid: editing requires getRowId - drafts are keyed by row id, and the index fallback names a different record after any sort or filter.");
|
|
3123
3132
|
}, []), i(() => {
|
|
3124
|
-
for (let { slice: e, handler: t } of
|
|
3133
|
+
for (let { slice: e, handler: t } of li(S)) console.warn(`TMDataGrid: state.${e} is controlled but no ${t} was passed - the slice cannot change. Add ${t}, or use initialState.${e} for a starting value.`);
|
|
3125
3134
|
}, []), i(() => {
|
|
3126
3135
|
if (!L) return;
|
|
3127
3136
|
let e = Y.store.state.grouping;
|
|
@@ -3137,12 +3146,12 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3137
3146
|
});
|
|
3138
3147
|
return () => t.unsubscribe();
|
|
3139
3148
|
}, [L, Y]), i(() => {
|
|
3140
|
-
if (!
|
|
3141
|
-
|
|
3149
|
+
if (!Ur(e)) return;
|
|
3150
|
+
Yr(Y.store.state, e);
|
|
3142
3151
|
let t, n = null, r = () => {
|
|
3143
|
-
t = void 0, n !== null && (
|
|
3152
|
+
t = void 0, n !== null && (Yr(n, e), n = null);
|
|
3144
3153
|
}, i = Y.store.subscribe((e) => {
|
|
3145
|
-
n = e, t !== void 0 && clearTimeout(t), t = setTimeout(r,
|
|
3154
|
+
n = e, t !== void 0 && clearTimeout(t), t = setTimeout(r, vi);
|
|
3146
3155
|
});
|
|
3147
3156
|
return () => {
|
|
3148
3157
|
i.unsubscribe(), t !== void 0 && clearTimeout(t), r();
|
|
@@ -3192,11 +3201,11 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3192
3201
|
...e,
|
|
3193
3202
|
selectionAnchorRowId: t
|
|
3194
3203
|
})),
|
|
3195
|
-
setFocusedCell: (t) => e((e) =>
|
|
3204
|
+
setFocusedCell: (t) => e((e) => ni(e.focusedCell, t) ? e : {
|
|
3196
3205
|
...e,
|
|
3197
3206
|
focusedCell: t
|
|
3198
3207
|
}),
|
|
3199
|
-
setCellRange: (t) => e((e) =>
|
|
3208
|
+
setCellRange: (t) => e((e) => ni(e.cellRange?.anchor ?? null, t?.anchor ?? null) && ni(e.cellRange?.focus ?? null, t?.focus ?? null) ? e : {
|
|
3200
3209
|
...e,
|
|
3201
3210
|
cellRange: t
|
|
3202
3211
|
})
|
|
@@ -3222,7 +3231,7 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3222
3231
|
De.current = () => {
|
|
3223
3232
|
let e = S.initialState, t = [...e?.grouping ?? []];
|
|
3224
3233
|
Y.setGrouping(t), Y.setColumnVisibility({
|
|
3225
|
-
...
|
|
3234
|
+
...wi({ ...e?.columnVisibility }),
|
|
3226
3235
|
...L ? { [rn]: t.length > 0 } : {}
|
|
3227
3236
|
}), Y.setColumnSizing({ ...e?.columnSizing }), Y.setColumnOrder([...e?.columnOrder ?? []]), Y.setColumnPinning({
|
|
3228
3237
|
left: [
|
|
@@ -3251,17 +3260,17 @@ function Ti({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
3251
3260
|
scrollerRef: ke
|
|
3252
3261
|
};
|
|
3253
3262
|
}
|
|
3254
|
-
function
|
|
3263
|
+
function Di(e, t) {
|
|
3255
3264
|
let n = e.table.getColumn(t);
|
|
3256
3265
|
if (n === void 0 || n.getFilterValue() !== void 0) return;
|
|
3257
|
-
let r =
|
|
3266
|
+
let r = Dn(n);
|
|
3258
3267
|
n.setFilterValue({
|
|
3259
3268
|
operator: r,
|
|
3260
3269
|
value: _t(r)
|
|
3261
3270
|
});
|
|
3262
3271
|
}
|
|
3263
|
-
function
|
|
3264
|
-
if (
|
|
3272
|
+
function Oi(e, t) {
|
|
3273
|
+
if (Di(e, t), e.filters.inHeader) {
|
|
3265
3274
|
e.ui.actions.focusHeaderFilter(t);
|
|
3266
3275
|
return;
|
|
3267
3276
|
}
|
|
@@ -3269,24 +3278,24 @@ function Di(e, t) {
|
|
|
3269
3278
|
}
|
|
3270
3279
|
//#endregion
|
|
3271
3280
|
//#region src/tmdatagrid/components/TMDataGridFilterPills.tsx
|
|
3272
|
-
function
|
|
3273
|
-
let n = e(41), { api: r, size: i, showClearAll: a, onPillClick: o, className: s } = t, c = i === void 0 ? "sm" : i, l = a === void 0 || a, { table: u, labels: f } = r, p = A(u.store,
|
|
3281
|
+
function ki(t) {
|
|
3282
|
+
let n = e(41), { api: r, size: i, showClearAll: a, onPillClick: o, className: s } = t, c = i === void 0 ? "sm" : i, l = a === void 0 || a, { table: u, labels: f } = r, p = A(u.store, ji), m, h, g, _, v, b, x, S, C;
|
|
3274
3283
|
if (n[0] !== r || n[1] !== s || n[2] !== p || n[3] !== f || n[4] !== o || n[5] !== c || n[6] !== u) {
|
|
3275
3284
|
C = Symbol.for("react.early_return_sentinel");
|
|
3276
3285
|
bb0: {
|
|
3277
|
-
if (h = p.filter(
|
|
3286
|
+
if (h = p.filter(Ai), h.length === 0) {
|
|
3278
3287
|
C = null;
|
|
3279
3288
|
break bb0;
|
|
3280
3289
|
}
|
|
3281
3290
|
v = "group", b = f.activeFilters, x = "filter-pills";
|
|
3282
3291
|
let e;
|
|
3283
|
-
n[16] === s ? e = n[17] : (e = [
|
|
3292
|
+
n[16] === s ? e = n[17] : (e = [_r.filterPills, s].filter(Boolean), n[16] = s, n[17] = e), S = e.join(" "), m = y.Group, g = c;
|
|
3284
3293
|
let t;
|
|
3285
3294
|
n[18] !== r || n[19] !== p || n[20] !== f || n[21] !== o || n[22] !== c || n[23] !== u ? (t = (e) => {
|
|
3286
3295
|
let t = u.getColumn(e.id), n = t ? wn(t) : e.id, i = e.value;
|
|
3287
3296
|
return vt(i) ? /* @__PURE__ */ q(y, {
|
|
3288
3297
|
size: c,
|
|
3289
|
-
className:
|
|
3298
|
+
className: _r.pill,
|
|
3290
3299
|
"data-dg-part": "filter-pill",
|
|
3291
3300
|
"data-column-id": e.id,
|
|
3292
3301
|
withRemoveButton: !0,
|
|
@@ -3297,8 +3306,8 @@ function Oi(t) {
|
|
|
3297
3306
|
tabIndex: 0
|
|
3298
3307
|
},
|
|
3299
3308
|
children: /* @__PURE__ */ q(O, {
|
|
3300
|
-
className:
|
|
3301
|
-
onClick: () => o ? o(e.id) :
|
|
3309
|
+
className: _r.pillLabel,
|
|
3310
|
+
onClick: () => o ? o(e.id) : Oi(r, e.id),
|
|
3302
3311
|
children: St({
|
|
3303
3312
|
label: n,
|
|
3304
3313
|
type: t ? Tn(t) : "string",
|
|
@@ -3334,25 +3343,25 @@ function Oi(t) {
|
|
|
3334
3343
|
children: [w, T]
|
|
3335
3344
|
}), n[34] = w, n[35] = T, n[36] = v, n[37] = b, n[38] = x, n[39] = S, n[40] = E) : E = n[40], E;
|
|
3336
3345
|
}
|
|
3337
|
-
function
|
|
3346
|
+
function Ai(e) {
|
|
3338
3347
|
return bt(e.value);
|
|
3339
3348
|
}
|
|
3340
|
-
function
|
|
3349
|
+
function ji(e) {
|
|
3341
3350
|
return e.columnFilters;
|
|
3342
3351
|
}
|
|
3343
|
-
var
|
|
3344
|
-
function
|
|
3352
|
+
var Mi = { footer: "_footer_te0a3_1" }, Ni = "columnResizing";
|
|
3353
|
+
function Pi(t) {
|
|
3345
3354
|
let n = e(1), r;
|
|
3346
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (r = { compare: _e }, n[0] = r) : r = n[0], A(t,
|
|
3355
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (r = { compare: _e }, n[0] = r) : r = n[0], A(t, Fi, r);
|
|
3347
3356
|
}
|
|
3348
|
-
function
|
|
3357
|
+
function Fi(e) {
|
|
3349
3358
|
let t = {};
|
|
3350
|
-
for (let [n, r] of Object.entries(e)) n !==
|
|
3359
|
+
for (let [n, r] of Object.entries(e)) n !== Ni && (t[n] = r);
|
|
3351
3360
|
return t;
|
|
3352
3361
|
}
|
|
3353
3362
|
//#endregion
|
|
3354
3363
|
//#region src/tmdatagrid/components/TMDataGridFooter.tsx
|
|
3355
|
-
function
|
|
3364
|
+
function Ii(e, t = !0) {
|
|
3356
3365
|
let { pageIndex: n, pageSize: r } = e.store.state.pagination, i = e.getRowCount();
|
|
3357
3366
|
return {
|
|
3358
3367
|
state: {
|
|
@@ -3376,13 +3385,13 @@ function Fi(e, t = !0) {
|
|
|
3376
3385
|
}
|
|
3377
3386
|
};
|
|
3378
3387
|
}
|
|
3379
|
-
function
|
|
3388
|
+
function Li(t) {
|
|
3380
3389
|
let n = e(23), { pageSizeOptions: r } = t, { table: i, features: a, labels: o, controlSize: s } = Q();
|
|
3381
|
-
|
|
3390
|
+
Pi(i.store);
|
|
3382
3391
|
let c;
|
|
3383
3392
|
n[0] !== a || n[1] !== i ? (c = hn(i, a), n[0] = a, n[1] = i, n[2] = c) : c = n[2];
|
|
3384
3393
|
let l = c, { pageSize: u } = i.store.state.pagination, d;
|
|
3385
|
-
n[3] !== u || n[4] !== r ? (d = r.includes(u) ? r : [...r, u].sort(
|
|
3394
|
+
n[3] !== u || n[4] !== r ? (d = r.includes(u) ? r : [...r, u].sort(Ri), n[3] = u, n[4] = r, n[5] = d) : d = n[5];
|
|
3386
3395
|
let f = d, m;
|
|
3387
3396
|
n[6] !== s || n[7] !== o.rowsPerPage ? (m = /* @__PURE__ */ q(T, {
|
|
3388
3397
|
span: !0,
|
|
@@ -3415,12 +3424,12 @@ function Ii(t) {
|
|
|
3415
3424
|
children: [m, y]
|
|
3416
3425
|
}), n[20] = m, n[21] = y, n[22] = b) : b = n[22], b;
|
|
3417
3426
|
}
|
|
3418
|
-
function
|
|
3427
|
+
function Ri(e, t) {
|
|
3419
3428
|
return e - t;
|
|
3420
3429
|
}
|
|
3421
|
-
function
|
|
3430
|
+
function zi() {
|
|
3422
3431
|
let t = e(22), { table: n, features: r, labels: i, controlSize: a } = Q();
|
|
3423
|
-
|
|
3432
|
+
Pi(n.store);
|
|
3424
3433
|
let o;
|
|
3425
3434
|
t[0] !== r || t[1] !== n ? (o = hn(n, r), t[0] = r, t[1] = n, t[2] = o) : o = t[2];
|
|
3426
3435
|
let s = o, { pageIndex: c, pageSize: l } = n.store.state.pagination, u, d, f, p, m, h;
|
|
@@ -3441,9 +3450,9 @@ function Ri() {
|
|
|
3441
3450
|
children: h
|
|
3442
3451
|
}), t[15] = u, t[16] = d, t[17] = f, t[18] = p, t[19] = m, t[20] = h, t[21] = g) : g = t[21], g;
|
|
3443
3452
|
}
|
|
3444
|
-
function
|
|
3453
|
+
function Bi() {
|
|
3445
3454
|
let t = e(11), { table: n, features: r, labels: i, controlSize: a } = Q();
|
|
3446
|
-
|
|
3455
|
+
Pi(n.store);
|
|
3447
3456
|
let o;
|
|
3448
3457
|
t[0] !== r || t[1] !== n ? (o = hn(n, r), t[0] = r, t[1] = n, t[2] = o) : o = t[2];
|
|
3449
3458
|
let s = o, { pageIndex: c } = n.store.state.pagination, l;
|
|
@@ -3460,9 +3469,9 @@ function zi() {
|
|
|
3460
3469
|
children: l
|
|
3461
3470
|
}), t[8] = a, t[9] = l, t[10] = u) : u = t[10], u;
|
|
3462
3471
|
}
|
|
3463
|
-
function
|
|
3472
|
+
function Vi() {
|
|
3464
3473
|
let t = e(26), { table: n, features: r, labels: i } = Q();
|
|
3465
|
-
|
|
3474
|
+
Pi(n.store);
|
|
3466
3475
|
let a;
|
|
3467
3476
|
t[0] !== r || t[1] !== n ? (a = hn(n, r), t[0] = r, t[1] = n, t[2] = a) : a = t[2];
|
|
3468
3477
|
let o = a, s;
|
|
@@ -3510,32 +3519,32 @@ function Bi() {
|
|
|
3510
3519
|
children: [d, g]
|
|
3511
3520
|
}), t[23] = d, t[24] = g, t[25] = _) : _ = t[25], _;
|
|
3512
3521
|
}
|
|
3513
|
-
var
|
|
3522
|
+
var Hi = [
|
|
3514
3523
|
10,
|
|
3515
3524
|
25,
|
|
3516
3525
|
50,
|
|
3517
3526
|
100
|
|
3518
3527
|
];
|
|
3519
|
-
function
|
|
3520
|
-
let n = e(23), { pageSizeOptions: r, renderPagination: i } = t, a = r === void 0 ?
|
|
3521
|
-
|
|
3528
|
+
function Ui(t) {
|
|
3529
|
+
let n = e(23), { pageSizeOptions: r, renderPagination: i } = t, a = r === void 0 ? Hi : r, { table: o, features: s, labels: c } = Q();
|
|
3530
|
+
Pi(o.store);
|
|
3522
3531
|
let l;
|
|
3523
3532
|
n[0] === a ? l = n[1] : (l = {
|
|
3524
|
-
PageSize: () => /* @__PURE__ */ q(
|
|
3525
|
-
Range:
|
|
3526
|
-
PageNumber:
|
|
3527
|
-
Pager:
|
|
3533
|
+
PageSize: () => /* @__PURE__ */ q(Li, { pageSizeOptions: a }),
|
|
3534
|
+
Range: zi,
|
|
3535
|
+
PageNumber: Bi,
|
|
3536
|
+
Pager: Vi
|
|
3528
3537
|
}, n[0] = a, n[1] = l);
|
|
3529
3538
|
let u = l;
|
|
3530
|
-
if (!
|
|
3539
|
+
if (!Qr(o, s).canPaginate) return null;
|
|
3531
3540
|
let d, f;
|
|
3532
3541
|
if (n[2] !== u || n[3] !== s || n[4] !== i || n[5] !== o) {
|
|
3533
3542
|
f = Symbol.for("react.early_return_sentinel");
|
|
3534
3543
|
bb0: if (d = hn(o, s), i) {
|
|
3535
|
-
let { state: e, actions: t } =
|
|
3544
|
+
let { state: e, actions: t } = Ii(o, d);
|
|
3536
3545
|
f = /* @__PURE__ */ q("div", {
|
|
3537
3546
|
"data-dg-part": "footer",
|
|
3538
|
-
className:
|
|
3547
|
+
className: Mi.footer,
|
|
3539
3548
|
children: i({
|
|
3540
3549
|
state: e,
|
|
3541
3550
|
actions: t,
|
|
@@ -3556,7 +3565,7 @@ function Hi(t) {
|
|
|
3556
3565
|
let _;
|
|
3557
3566
|
n[14] !== p || n[15] !== m || n[16] !== h || n[17] !== g ? (_ = /* @__PURE__ */ J("div", {
|
|
3558
3567
|
"data-dg-part": "footer",
|
|
3559
|
-
className:
|
|
3568
|
+
className: Mi.footer,
|
|
3560
3569
|
"data-paging-suspended": p,
|
|
3561
3570
|
children: [
|
|
3562
3571
|
m,
|
|
@@ -3577,11 +3586,11 @@ function Hi(t) {
|
|
|
3577
3586
|
}
|
|
3578
3587
|
//#endregion
|
|
3579
3588
|
//#region src/tmdatagrid/components/TMDataGridMenu.tsx
|
|
3580
|
-
var
|
|
3589
|
+
var Wi = (e) => /* @__PURE__ */ q("button", {
|
|
3581
3590
|
...e,
|
|
3582
3591
|
role: "menuitemcheckbox"
|
|
3583
3592
|
});
|
|
3584
|
-
function
|
|
3593
|
+
function Gi(t) {
|
|
3585
3594
|
let n = e(20), r, i, a, o;
|
|
3586
3595
|
n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4]) : ({children: r, icon: i, label: a, ...o} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o);
|
|
3587
3596
|
let { labels: s, controlSize: c } = Q(), u = a ?? s.menuButton, d;
|
|
@@ -3616,10 +3625,10 @@ function Wi(t) {
|
|
|
3616
3625
|
children: [p, m]
|
|
3617
3626
|
}), n[16] = o, n[17] = p, n[18] = m, n[19] = h) : h = n[19], h;
|
|
3618
3627
|
}
|
|
3619
|
-
function
|
|
3620
|
-
let n = e(13), { searchable: r } = t, i = r === void 0 || r, { labels: a, controlSize: o } = Q(), { columns: s } =
|
|
3628
|
+
function Ki(t) {
|
|
3629
|
+
let n = e(13), { searchable: r } = t, i = r === void 0 || r, { labels: a, controlSize: o } = Q(), { columns: s } = Fn(), [l, u] = c("");
|
|
3621
3630
|
if (s.length === 0) return null;
|
|
3622
|
-
let d =
|
|
3631
|
+
let d = qi, f;
|
|
3623
3632
|
n[0] !== o || n[1] !== a || n[2] !== l || n[3] !== i ? (f = i && /* @__PURE__ */ q(g.Search, {
|
|
3624
3633
|
value: l,
|
|
3625
3634
|
onChange: (e) => u(e.currentTarget.value),
|
|
@@ -3629,9 +3638,9 @@ function Gi(t) {
|
|
|
3629
3638
|
"data-dg-part": "columns-search"
|
|
3630
3639
|
}), n[0] = o, n[1] = a, n[2] = l, n[3] = i, n[4] = f) : f = n[4];
|
|
3631
3640
|
let p;
|
|
3632
|
-
n[5] === l ? p = n[6] : (p = /* @__PURE__ */ q(
|
|
3641
|
+
n[5] === l ? p = n[6] : (p = /* @__PURE__ */ q(Ji, { search: l }), n[5] = l, n[6] = p);
|
|
3633
3642
|
let m, h, _;
|
|
3634
|
-
n[7] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ q(g.Divider, {}), h = /* @__PURE__ */ q(
|
|
3643
|
+
n[7] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ q(g.Divider, {}), h = /* @__PURE__ */ q(Yi, {}), _ = /* @__PURE__ */ q(Xi, {}), n[7] = m, n[8] = h, n[9] = _) : (m = n[7], h = n[8], _ = n[9]);
|
|
3635
3644
|
let v;
|
|
3636
3645
|
return n[10] !== f || n[11] !== p ? (v = /* @__PURE__ */ J(ue, { children: [
|
|
3637
3646
|
f,
|
|
@@ -3641,13 +3650,13 @@ function Gi(t) {
|
|
|
3641
3650
|
_
|
|
3642
3651
|
] }), n[10] = f, n[11] = p, n[12] = v) : v = n[12], v;
|
|
3643
3652
|
}
|
|
3644
|
-
function
|
|
3653
|
+
function qi(e) {
|
|
3645
3654
|
if (e.key !== "ArrowDown") return;
|
|
3646
3655
|
let t = e.currentTarget.closest("[role=\"menu\"]"), n = t?.querySelector("[role^=\"menuitem\"]"), r = t?.querySelector("[data-dg-part=\"columns-toggle\"]");
|
|
3647
3656
|
!n || !r || n === r || (e.preventDefault(), r.focus());
|
|
3648
3657
|
}
|
|
3649
|
-
function
|
|
3650
|
-
let n = e(11), { search: r } = t, { labels: i, controlSize: a } = Q(), { columns: o, columnVisibility: s } =
|
|
3658
|
+
function Ji(t) {
|
|
3659
|
+
let n = e(11), { search: r } = t, { labels: i, controlSize: a } = Q(), { columns: o, columnVisibility: s } = Fn();
|
|
3651
3660
|
if (o.length === 0) return null;
|
|
3652
3661
|
let c = r ?? "", l;
|
|
3653
3662
|
if (n[0] !== o || n[1] !== c) {
|
|
@@ -3658,7 +3667,7 @@ function qi(t) {
|
|
|
3658
3667
|
n[3] !== s || n[4] !== a || n[5] !== i || n[6] !== u || n[7] !== r ? (d = u.length === 0 ? /* @__PURE__ */ q(g.Label, { children: i.columnsNoMatch(r ?? "") }) : u.map((e) => {
|
|
3659
3668
|
let t = s[e.id] !== !1;
|
|
3660
3669
|
return /* @__PURE__ */ q(g.Item, {
|
|
3661
|
-
renderRoot:
|
|
3670
|
+
renderRoot: Wi,
|
|
3662
3671
|
"aria-checked": t,
|
|
3663
3672
|
closeMenuOnClick: !1,
|
|
3664
3673
|
leftSection: /* @__PURE__ */ q(f.Indicator, {
|
|
@@ -3678,8 +3687,8 @@ function qi(t) {
|
|
|
3678
3687
|
children: d
|
|
3679
3688
|
}), n[9] = d, n[10] = p), p;
|
|
3680
3689
|
}
|
|
3681
|
-
function
|
|
3682
|
-
let t = e(12), { labels: n, controlSize: r } = Q(), { columns: i, shownCount: a, setAllVisible: o } =
|
|
3690
|
+
function Yi() {
|
|
3691
|
+
let t = e(12), { labels: n, controlSize: r } = Q(), { columns: i, shownCount: a, setAllVisible: o } = Fn();
|
|
3683
3692
|
if (i.length === 0) return null;
|
|
3684
3693
|
let s = a === i.length, c = a > 0 && !s, l = c ? "mixed" : s, u;
|
|
3685
3694
|
t[0] !== s || t[1] !== r || t[2] !== c ? (u = /* @__PURE__ */ q(f.Indicator, {
|
|
@@ -3691,7 +3700,7 @@ function Ji() {
|
|
|
3691
3700
|
t[4] !== s || t[5] !== o ? (d = () => o(!s), t[4] = s, t[5] = o, t[6] = d) : d = t[6];
|
|
3692
3701
|
let p;
|
|
3693
3702
|
return t[7] !== n.columnsShowHideAll || t[8] !== l || t[9] !== u || t[10] !== d ? (p = /* @__PURE__ */ q(g.Item, {
|
|
3694
|
-
renderRoot:
|
|
3703
|
+
renderRoot: Wi,
|
|
3695
3704
|
"aria-checked": l,
|
|
3696
3705
|
closeMenuOnClick: !1,
|
|
3697
3706
|
leftSection: u,
|
|
@@ -3700,7 +3709,7 @@ function Ji() {
|
|
|
3700
3709
|
children: n.columnsShowHideAll
|
|
3701
3710
|
}), t[7] = n.columnsShowHideAll, t[8] = l, t[9] = u, t[10] = d, t[11] = p) : p = t[11], p;
|
|
3702
3711
|
}
|
|
3703
|
-
function
|
|
3712
|
+
function Xi() {
|
|
3704
3713
|
let t = e(6), { labels: n, resetSettings: r } = Q(), i;
|
|
3705
3714
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ q(M, {
|
|
3706
3715
|
size: 16,
|
|
@@ -3716,21 +3725,21 @@ function Yi() {
|
|
|
3716
3725
|
children: n.columnsReset
|
|
3717
3726
|
}), t[3] = n.columnsReset, t[4] = a, t[5] = o) : o = t[5], o;
|
|
3718
3727
|
}
|
|
3719
|
-
var
|
|
3720
|
-
Columns:
|
|
3721
|
-
ColumnToggles:
|
|
3722
|
-
ShowHideAll:
|
|
3723
|
-
ResetLayout:
|
|
3728
|
+
var Zi = Object.assign(Gi, {
|
|
3729
|
+
Columns: Ki,
|
|
3730
|
+
ColumnToggles: Ji,
|
|
3731
|
+
ShowHideAll: Yi,
|
|
3732
|
+
ResetLayout: Xi
|
|
3724
3733
|
});
|
|
3725
3734
|
//#endregion
|
|
3726
3735
|
//#region src/tmdatagrid/components/TMDataGridSearch.tsx
|
|
3727
|
-
function
|
|
3728
|
-
let n = e(25), { placeholder: r, debounce: a, w: o } = t, u = a === void 0 ? 250 : a, d = o === void 0 ? 220 : o, { table: f, features: p, labels: m, controlSize: h } = Q(), g = A(f.store,
|
|
3736
|
+
function Qi(t) {
|
|
3737
|
+
let n = e(25), { placeholder: r, debounce: a, w: o } = t, u = a === void 0 ? 250 : a, d = o === void 0 ? 220 : o, { table: f, features: p, labels: m, controlSize: h } = Q(), g = A(f.store, $i), [_, v] = c(g), y = s(void 0), b = s(g), x, S;
|
|
3729
3738
|
n[0] === g ? (x = n[1], S = n[2]) : (x = () => {
|
|
3730
3739
|
g !== b.current && (b.current = g, v(g));
|
|
3731
3740
|
}, S = [g], n[0] = g, n[1] = x, n[2] = S), i(x, S);
|
|
3732
3741
|
let C, w;
|
|
3733
|
-
if (n[3] === Symbol.for("react.memo_cache_sentinel") ? (C = () => () => clearTimeout(y.current), w = [], n[3] = C, n[4] = w) : (C = n[3], w = n[4]), i(C, w), !
|
|
3742
|
+
if (n[3] === Symbol.for("react.memo_cache_sentinel") ? (C = () => () => clearTimeout(y.current), w = [], n[3] = C, n[4] = w) : (C = n[3], w = n[4]), i(C, w), !Qr(f, p).canSearch) return null;
|
|
3734
3743
|
let T;
|
|
3735
3744
|
n[5] === f ? T = n[6] : (T = (e) => {
|
|
3736
3745
|
b.current = e, f.setGlobalFilter(e === "" ? void 0 : e);
|
|
@@ -3778,17 +3787,17 @@ function Zi(t) {
|
|
|
3778
3787
|
rightSection: P
|
|
3779
3788
|
}), n[17] = h, n[18] = _, n[19] = m.searchLabel, n[20] = M, n[21] = P, n[22] = j, n[23] = d, n[24] = F) : F = n[24], F;
|
|
3780
3789
|
}
|
|
3781
|
-
function
|
|
3790
|
+
function $i(e) {
|
|
3782
3791
|
return typeof e.globalFilter == "string" ? e.globalFilter : "";
|
|
3783
3792
|
}
|
|
3784
|
-
var
|
|
3793
|
+
var ea = {
|
|
3785
3794
|
stickyLeft: "_stickyLeft_1jwnm_16",
|
|
3786
3795
|
stickyRight: "_stickyRight_1jwnm_17",
|
|
3787
3796
|
stickyEdgeIn: "_stickyEdgeIn_1jwnm_1",
|
|
3788
3797
|
stickyEdgeOut: "_stickyEdgeOut_1jwnm_1",
|
|
3789
3798
|
headerBoundary: "_headerBoundary_1jwnm_120",
|
|
3790
3799
|
dgHeaderShadow: "_dgHeaderShadow_1jwnm_1"
|
|
3791
|
-
},
|
|
3800
|
+
}, ta = {
|
|
3792
3801
|
surfaceHeader: "_surfaceHeader_10bcx_5",
|
|
3793
3802
|
filterPopup: "_filterPopup_10bcx_18",
|
|
3794
3803
|
filterSidebar: "_filterSidebar_10bcx_33",
|
|
@@ -3796,7 +3805,7 @@ var $i = {
|
|
|
3796
3805
|
};
|
|
3797
3806
|
//#endregion
|
|
3798
3807
|
//#region src/tmdatagrid/components/TMDataGridFilterSurface.tsx
|
|
3799
|
-
function
|
|
3808
|
+
function na() {
|
|
3800
3809
|
let t = e(10), { ui: n, labels: r, controlSize: i } = Q(), a;
|
|
3801
3810
|
t[0] !== i || t[1] !== r.filters ? (a = /* @__PURE__ */ q(T, {
|
|
3802
3811
|
span: !0,
|
|
@@ -3821,12 +3830,12 @@ function ta() {
|
|
|
3821
3830
|
}), t[4] = r.closeFilters, t[5] = n.actions.closeFilterPanel, t[6] = s) : s = t[6];
|
|
3822
3831
|
let c;
|
|
3823
3832
|
return t[7] !== a || t[8] !== s ? (c = /* @__PURE__ */ J("div", {
|
|
3824
|
-
className:
|
|
3833
|
+
className: ta.surfaceHeader,
|
|
3825
3834
|
children: [a, s]
|
|
3826
3835
|
}), t[7] = a, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3827
3836
|
}
|
|
3828
|
-
function
|
|
3829
|
-
let n = e(5), { table: r, ui: a } = Q(), o = A(r.store,
|
|
3837
|
+
function ra(t) {
|
|
3838
|
+
let n = e(5), { table: r, ui: a } = Q(), o = A(r.store, ia), c = s(o), l, u;
|
|
3830
3839
|
n[0] !== o || n[1] !== t || n[2] !== a ? (l = () => {
|
|
3831
3840
|
let e = c.current > 0 && o === 0;
|
|
3832
3841
|
c.current = o, t && e && a.actions.closeFilterPanel();
|
|
@@ -3836,12 +3845,12 @@ function na(t) {
|
|
|
3836
3845
|
a
|
|
3837
3846
|
], n[0] = o, n[1] = t, n[2] = a, n[3] = l, n[4] = u) : (l = n[3], u = n[4]), i(l, u);
|
|
3838
3847
|
}
|
|
3839
|
-
function
|
|
3848
|
+
function ia(e) {
|
|
3840
3849
|
return e.columnFilters.length;
|
|
3841
3850
|
}
|
|
3842
|
-
function
|
|
3843
|
-
let t = e(11), { ui: n, labels: r } = Q(), a = A(n,
|
|
3844
|
-
|
|
3851
|
+
function aa() {
|
|
3852
|
+
let t = e(11), { ui: n, labels: r } = Q(), a = A(n, oa), o = s(null);
|
|
3853
|
+
ra(a);
|
|
3845
3854
|
let c, l;
|
|
3846
3855
|
if (t[0] !== a || t[1] !== n ? (c = () => {
|
|
3847
3856
|
if (!a) return;
|
|
@@ -3856,23 +3865,23 @@ function ia() {
|
|
|
3856
3865
|
e.key === "Escape" && (e.stopPropagation(), n.actions.closeFilterPanel());
|
|
3857
3866
|
}, t[4] = n, t[5] = u);
|
|
3858
3867
|
let d, f;
|
|
3859
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ q(
|
|
3868
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ q(na, {}), f = /* @__PURE__ */ q(fr, {}), t[6] = d, t[7] = f) : (d = t[6], f = t[7]);
|
|
3860
3869
|
let p;
|
|
3861
3870
|
return t[8] !== r.filters || t[9] !== u ? (p = /* @__PURE__ */ J("div", {
|
|
3862
3871
|
ref: o,
|
|
3863
3872
|
"data-dg-part": "filter-popup",
|
|
3864
|
-
className:
|
|
3873
|
+
className: ta.filterPopup,
|
|
3865
3874
|
"aria-label": r.filters,
|
|
3866
3875
|
onKeyDown: u,
|
|
3867
3876
|
children: [d, f]
|
|
3868
3877
|
}), t[8] = r.filters, t[9] = u, t[10] = p) : p = t[10], p;
|
|
3869
3878
|
}
|
|
3870
|
-
function
|
|
3879
|
+
function oa(e) {
|
|
3871
3880
|
return e.filterPanelOpen;
|
|
3872
3881
|
}
|
|
3873
|
-
function
|
|
3882
|
+
function sa() {
|
|
3874
3883
|
let t = e(11), { ui: n, filters: r, labels: i } = Q();
|
|
3875
|
-
if (!A(n,
|
|
3884
|
+
if (!A(n, ca)) return null;
|
|
3876
3885
|
let a;
|
|
3877
3886
|
t[0] === r.sidebarWidth ? a = t[1] : (a = { width: r.sidebarWidth }, t[0] = r.sidebarWidth, t[1] = a);
|
|
3878
3887
|
let o;
|
|
@@ -3880,28 +3889,28 @@ function oa() {
|
|
|
3880
3889
|
e.key === "Escape" && (e.stopPropagation(), n.actions.closeFilterPanel());
|
|
3881
3890
|
}, t[2] = n, t[3] = o);
|
|
3882
3891
|
let s;
|
|
3883
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ q(
|
|
3892
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ q(na, {}), t[4] = s) : s = t[4];
|
|
3884
3893
|
let c;
|
|
3885
3894
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ q(x, {
|
|
3886
3895
|
type: "auto",
|
|
3887
|
-
className:
|
|
3888
|
-
children: /* @__PURE__ */ q(
|
|
3896
|
+
className: ta.filterSidebarBody,
|
|
3897
|
+
children: /* @__PURE__ */ q(fr, { layout: "stacked" })
|
|
3889
3898
|
}), t[5] = c) : c = t[5];
|
|
3890
3899
|
let l;
|
|
3891
3900
|
return t[6] !== r.sidebarSide || t[7] !== i.filters || t[8] !== a || t[9] !== o ? (l = /* @__PURE__ */ J("div", {
|
|
3892
3901
|
"data-dg-part": "filter-sidebar",
|
|
3893
3902
|
"data-side": r.sidebarSide,
|
|
3894
|
-
className:
|
|
3903
|
+
className: ta.filterSidebar,
|
|
3895
3904
|
style: a,
|
|
3896
3905
|
"aria-label": i.filters,
|
|
3897
3906
|
onKeyDown: o,
|
|
3898
3907
|
children: [s, c]
|
|
3899
3908
|
}), t[6] = r.sidebarSide, t[7] = i.filters, t[8] = a, t[9] = o, t[10] = l) : l = t[10], l;
|
|
3900
3909
|
}
|
|
3901
|
-
function
|
|
3910
|
+
function ca(e) {
|
|
3902
3911
|
return e.filterPanelOpen;
|
|
3903
3912
|
}
|
|
3904
|
-
var
|
|
3913
|
+
var la = {
|
|
3905
3914
|
headerFilterRow: "_headerFilterRow_h1geg_9",
|
|
3906
3915
|
headerFilterCell: "_headerFilterCell_h1geg_18",
|
|
3907
3916
|
headerFilterValue: "_headerFilterValue_h1geg_39",
|
|
@@ -3910,53 +3919,53 @@ var ca = {
|
|
|
3910
3919
|
};
|
|
3911
3920
|
//#endregion
|
|
3912
3921
|
//#region src/tmdatagrid/components/TMDataGridHeaderFilterRow.tsx
|
|
3913
|
-
function
|
|
3922
|
+
function ua(e) {
|
|
3914
3923
|
return Array.isArray(e) ? e.every((e) => e === "") : e === "";
|
|
3915
3924
|
}
|
|
3916
|
-
function
|
|
3917
|
-
let { table: t, labels: n, controlSize: r } = Q(), i = A(t.store, (t) => t.columnFilters.find((t) => t.id === e.id)?.value), a =
|
|
3918
|
-
function
|
|
3919
|
-
let n = !
|
|
3925
|
+
function da({ column: e }) {
|
|
3926
|
+
let { table: t, labels: n, controlSize: r } = Q(), i = A(t.store, (t) => t.columnFilters.find((t) => t.id === e.id)?.value), a = Dn(e), s = vt(i) ? i : void 0, c = s?.operator ?? a, l = s?.value ?? _t(c), u = wn(e);
|
|
3927
|
+
function d(t) {
|
|
3928
|
+
let n = !ua(t.value) || t.operator !== a;
|
|
3920
3929
|
e.setFilterValue(n ? t : void 0);
|
|
3921
3930
|
}
|
|
3922
|
-
function
|
|
3923
|
-
|
|
3931
|
+
function f(e) {
|
|
3932
|
+
d({
|
|
3924
3933
|
operator: e,
|
|
3925
|
-
value: yt(e) === yt(
|
|
3934
|
+
value: yt(e) === yt(c) ? l : _t(e)
|
|
3926
3935
|
});
|
|
3927
3936
|
}
|
|
3928
|
-
let { options:
|
|
3937
|
+
let { options: p, ValueControl: m } = o(() => lr(t, e), [
|
|
3929
3938
|
t,
|
|
3930
3939
|
e,
|
|
3931
|
-
|
|
3932
|
-
]),
|
|
3940
|
+
sr(e) ? e.getFacetedUniqueValues() : void 0
|
|
3941
|
+
]), h = En(e);
|
|
3933
3942
|
return /* @__PURE__ */ J(ue, { children: [/* @__PURE__ */ q("div", {
|
|
3934
|
-
className:
|
|
3943
|
+
className: la.headerFilterValue,
|
|
3935
3944
|
"data-dg-filter-value-slot": !0,
|
|
3936
|
-
children: /* @__PURE__ */ q(
|
|
3945
|
+
children: /* @__PURE__ */ q(m, {
|
|
3937
3946
|
column: e,
|
|
3938
3947
|
table: t,
|
|
3939
|
-
operator:
|
|
3940
|
-
value:
|
|
3941
|
-
onChange: (e) =>
|
|
3942
|
-
operator:
|
|
3948
|
+
operator: c,
|
|
3949
|
+
value: l,
|
|
3950
|
+
onChange: (e) => d({
|
|
3951
|
+
operator: c,
|
|
3943
3952
|
value: e
|
|
3944
3953
|
}),
|
|
3945
|
-
options:
|
|
3954
|
+
options: p,
|
|
3946
3955
|
size: r,
|
|
3947
3956
|
labels: n,
|
|
3948
3957
|
layout: "header"
|
|
3949
3958
|
})
|
|
3950
|
-
}), /* @__PURE__ */ q(
|
|
3959
|
+
}), /* @__PURE__ */ q(fa, {
|
|
3951
3960
|
columnId: e.id,
|
|
3952
|
-
columnLabel:
|
|
3953
|
-
operator:
|
|
3954
|
-
isDefault:
|
|
3955
|
-
operators:
|
|
3956
|
-
onChange:
|
|
3961
|
+
columnLabel: u,
|
|
3962
|
+
operator: c,
|
|
3963
|
+
isDefault: c === a,
|
|
3964
|
+
operators: h,
|
|
3965
|
+
onChange: f
|
|
3957
3966
|
})] });
|
|
3958
3967
|
}
|
|
3959
|
-
function
|
|
3968
|
+
function fa(t) {
|
|
3960
3969
|
let n = e(27), { columnId: r, columnLabel: i, operator: a, isDefault: o, operators: s, onChange: u } = t, { labels: d } = Q(), [f, p] = c(!1), m = d.operators[a], h = o ? "gray" : void 0, _;
|
|
3961
3970
|
n[0] !== i || n[1] !== d ? (_ = d.filterOperatorFor(i), n[0] = i, n[1] = d, n[2] = _) : _ = n[2];
|
|
3962
3971
|
let v;
|
|
@@ -3966,7 +3975,7 @@ function da(t) {
|
|
|
3966
3975
|
}), n[3] = v) : v = n[3];
|
|
3967
3976
|
let y;
|
|
3968
3977
|
n[4] !== r || n[5] !== h || n[6] !== _ ? (y = /* @__PURE__ */ q(l, {
|
|
3969
|
-
className:
|
|
3978
|
+
className: la.headerFilterOperator,
|
|
3970
3979
|
variant: "subtle",
|
|
3971
3980
|
color: h,
|
|
3972
3981
|
size: "sm",
|
|
@@ -3986,7 +3995,7 @@ function da(t) {
|
|
|
3986
3995
|
if (n[12] !== d.operators || n[13] !== u || n[14] !== a || n[15] !== s) {
|
|
3987
3996
|
let e;
|
|
3988
3997
|
n[17] !== d.operators || n[18] !== u || n[19] !== a ? (e = (e) => /* @__PURE__ */ q(g.Item, {
|
|
3989
|
-
className: e === a ?
|
|
3998
|
+
className: e === a ? la.operatorItemActive : void 0,
|
|
3990
3999
|
onClick: () => u(e),
|
|
3991
4000
|
children: d.operators[e]
|
|
3992
4001
|
}, e), n[17] = d.operators, n[18] = u, n[19] = a, n[20] = e) : e = n[20], x = s.map(e), n[12] = d.operators, n[13] = u, n[14] = a, n[15] = s, n[16] = x;
|
|
@@ -4004,8 +4013,8 @@ function da(t) {
|
|
|
4004
4013
|
children: [b, S]
|
|
4005
4014
|
}), n[23] = f, n[24] = b, n[25] = S, n[26] = C) : C = n[26], C;
|
|
4006
4015
|
}
|
|
4007
|
-
function
|
|
4008
|
-
let n = e(14), { leafHeaders: r, layoutFor: a, ariaRowIndex: o } = t, { ui: c, labels: l } = Q(), u = A(c,
|
|
4016
|
+
function pa(t) {
|
|
4017
|
+
let n = e(14), { leafHeaders: r, layoutFor: a, ariaRowIndex: o } = t, { ui: c, labels: l } = Q(), u = A(c, ma), d = s(null), f, p;
|
|
4009
4018
|
n[0] !== u || n[1] !== c ? (f = () => {
|
|
4010
4019
|
if (u === null) return;
|
|
4011
4020
|
let e = d.current?.querySelector(`[data-dg-part="header-filter-cell"][data-column-id="${CSS.escape(u)}"]`);
|
|
@@ -4024,11 +4033,11 @@ function fa(t) {
|
|
|
4024
4033
|
"aria-label": l.filterOn(wn(t)),
|
|
4025
4034
|
"data-dg-part": "header-filter-cell",
|
|
4026
4035
|
"data-column-id": t.id,
|
|
4027
|
-
"data-control-column":
|
|
4036
|
+
"data-control-column": Mn(t.id),
|
|
4028
4037
|
className: [
|
|
4029
|
-
|
|
4030
|
-
n.isBoundary && n.pinnedAt === "left" ?
|
|
4031
|
-
n.isBoundary && n.pinnedAt === "right" ?
|
|
4038
|
+
la.headerFilterCell,
|
|
4039
|
+
n.isBoundary && n.pinnedAt === "left" ? ea.stickyLeft : "",
|
|
4040
|
+
n.isBoundary && n.pinnedAt === "right" ? ea.stickyRight : ""
|
|
4032
4041
|
].filter(Boolean).join(" "),
|
|
4033
4042
|
style: {
|
|
4034
4043
|
left: n.pinnedAt === "left" ? n.offset : void 0,
|
|
@@ -4036,7 +4045,7 @@ function fa(t) {
|
|
|
4036
4045
|
position: n.pinnedAt ? "sticky" : void 0,
|
|
4037
4046
|
zIndex: n.pinnedAt ? "var(--dg-z-header-pinned-cell, 7)" : void 0
|
|
4038
4047
|
},
|
|
4039
|
-
children: t.getCanFilter() && /* @__PURE__ */ q(
|
|
4048
|
+
children: t.getCanFilter() && /* @__PURE__ */ q(da, { column: t })
|
|
4040
4049
|
}, e.id);
|
|
4041
4050
|
}, n[8] = l, n[9] = a, n[10] = e) : e = n[10], m = r.map(e), n[4] = l, n[5] = a, n[6] = r, n[7] = m;
|
|
4042
4051
|
} else m = n[7];
|
|
@@ -4048,14 +4057,14 @@ function fa(t) {
|
|
|
4048
4057
|
"data-dg-header-row": !0,
|
|
4049
4058
|
"data-dg-header-filter-row": !0,
|
|
4050
4059
|
"data-dg-part": "header-filter-row",
|
|
4051
|
-
className: `${
|
|
4060
|
+
className: `${la.headerFilterRow} ${ea.headerBoundary}`,
|
|
4052
4061
|
children: m
|
|
4053
4062
|
}), n[11] = o, n[12] = m, n[13] = h) : h = n[13], h;
|
|
4054
4063
|
}
|
|
4055
|
-
function
|
|
4064
|
+
function ma(e) {
|
|
4056
4065
|
return e.headerFilterColumnId;
|
|
4057
4066
|
}
|
|
4058
|
-
var
|
|
4067
|
+
var ha = {
|
|
4059
4068
|
headerCell: "_headerCell_apk7q_1",
|
|
4060
4069
|
headerCellFiltered: "_headerCellFiltered_apk7q_35",
|
|
4061
4070
|
headerTitle: "_headerTitle_apk7q_35",
|
|
@@ -4071,39 +4080,39 @@ var ma = {
|
|
|
4071
4080
|
columnSeparatorResizable: "_columnSeparatorResizable_apk7q_162",
|
|
4072
4081
|
columnSeparatorActive: "_columnSeparatorActive_apk7q_185",
|
|
4073
4082
|
menuItemActive: "_menuItemActive_apk7q_191"
|
|
4074
|
-
},
|
|
4075
|
-
function
|
|
4083
|
+
}, ga = 30, _a = 2;
|
|
4084
|
+
function va(e) {
|
|
4076
4085
|
let t = document.createRange();
|
|
4077
4086
|
t.selectNodeContents(e);
|
|
4078
4087
|
let n = typeof t.getBoundingClientRect == "function" ? t.getBoundingClientRect().width : 0;
|
|
4079
4088
|
return n > 0 ? n : e.scrollWidth;
|
|
4080
4089
|
}
|
|
4081
|
-
function
|
|
4090
|
+
function ya(e, t) {
|
|
4082
4091
|
let n = CSS.escape(t);
|
|
4083
4092
|
return e.querySelectorAll(`[role="cell"][data-column-id="${n}"],[role="gridcell"][data-column-id="${n}"]`);
|
|
4084
4093
|
}
|
|
4085
|
-
function
|
|
4086
|
-
return
|
|
4094
|
+
function ba(e, t) {
|
|
4095
|
+
return ya(e, t).length > 0;
|
|
4087
4096
|
}
|
|
4088
|
-
function
|
|
4097
|
+
function xa({ container: e, columnId: t }) {
|
|
4089
4098
|
let n = 0;
|
|
4090
|
-
for (let r of
|
|
4099
|
+
for (let r of ya(e, t)) {
|
|
4091
4100
|
let e = r.firstElementChild;
|
|
4092
4101
|
if (!(e instanceof HTMLElement)) continue;
|
|
4093
4102
|
let t = getComputedStyle(r), i = (Number.parseFloat(t.paddingLeft) || 0) + (Number.parseFloat(t.paddingRight) || 0);
|
|
4094
|
-
n = Math.max(n,
|
|
4103
|
+
n = Math.max(n, va(e) + i + _a);
|
|
4095
4104
|
}
|
|
4096
4105
|
let r = e.querySelector(`[data-column-id="${CSS.escape(t)}"] [data-dg-header-title]`);
|
|
4097
4106
|
if (r) {
|
|
4098
4107
|
let e = r.closest("[role=\"columnheader\"]"), t = e ? getComputedStyle(e) : null, i = t ? (Number.parseFloat(t.paddingLeft) || 0) + (Number.parseFloat(t.paddingRight) || 0) : 0;
|
|
4099
|
-
n = Math.max(n,
|
|
4108
|
+
n = Math.max(n, va(r) + i + ga);
|
|
4100
4109
|
}
|
|
4101
4110
|
return n;
|
|
4102
4111
|
}
|
|
4103
|
-
function
|
|
4112
|
+
function Sa({ table: e, columnId: t, container: n }) {
|
|
4104
4113
|
let r = e, i = r.getColumn(t);
|
|
4105
4114
|
if (!i || !i.getCanResize()) return !1;
|
|
4106
|
-
let a =
|
|
4115
|
+
let a = xa({
|
|
4107
4116
|
container: n,
|
|
4108
4117
|
columnId: t
|
|
4109
4118
|
});
|
|
@@ -4116,46 +4125,46 @@ function xa({ table: e, columnId: t, container: n }) {
|
|
|
4116
4125
|
}
|
|
4117
4126
|
//#endregion
|
|
4118
4127
|
//#region src/tmdatagrid/core/columnOrdering.ts
|
|
4119
|
-
function
|
|
4128
|
+
function Ca(e, t) {
|
|
4120
4129
|
return e.left.includes(t) ? "left" : e.right.includes(t) ? "right" : "center";
|
|
4121
4130
|
}
|
|
4122
|
-
function
|
|
4131
|
+
function wa(e, t, n, r) {
|
|
4123
4132
|
let i = e.filter((e) => e !== t), a = i.indexOf(n);
|
|
4124
4133
|
return a === -1 ? [...e] : (i.splice(r === "before" ? a : a + 1, 0, t), i);
|
|
4125
4134
|
}
|
|
4126
|
-
function
|
|
4135
|
+
function Ta({ table: e, columnId: t, targetId: n, side: r }) {
|
|
4127
4136
|
if (t === n) return;
|
|
4128
|
-
let i = e.store.state.columnPinning, a =
|
|
4129
|
-
if (a !==
|
|
4137
|
+
let i = e.store.state.columnPinning, a = Ca(i, t);
|
|
4138
|
+
if (a !== Ca(i, n)) return;
|
|
4130
4139
|
let o = e.getAllLeafColumns().map((e) => e.id);
|
|
4131
|
-
e.setColumnOrder(
|
|
4140
|
+
e.setColumnOrder(wa(o, t, n, r)), a !== "center" && e.setColumnPinning((e) => ({
|
|
4132
4141
|
...e,
|
|
4133
|
-
[a]:
|
|
4142
|
+
[a]: wa(e[a], t, n, r)
|
|
4134
4143
|
}));
|
|
4135
4144
|
}
|
|
4136
|
-
function
|
|
4137
|
-
let t = (e) =>
|
|
4145
|
+
function Ea(e) {
|
|
4146
|
+
let t = (e) => Nn(e);
|
|
4138
4147
|
return {
|
|
4139
4148
|
left: [...e.left.filter(t), ...e.left.filter((e) => !t(e))],
|
|
4140
4149
|
right: [...e.right.filter((e) => !t(e)), ...e.right.filter(t)]
|
|
4141
4150
|
};
|
|
4142
4151
|
}
|
|
4143
|
-
function
|
|
4152
|
+
function Da(e, t) {
|
|
4144
4153
|
return t === "left" ? e.getLeftVisibleLeafColumns() : t === "right" ? e.getRightVisibleLeafColumns() : e.getCenterVisibleLeafColumns();
|
|
4145
4154
|
}
|
|
4146
|
-
function
|
|
4147
|
-
let r =
|
|
4155
|
+
function Oa({ table: e, columnId: t, direction: n }) {
|
|
4156
|
+
let r = Da(e, Ca(e.store.state.columnPinning, t)), i = r.findIndex((e) => e.id === t);
|
|
4148
4157
|
if (i === -1) return null;
|
|
4149
4158
|
let a = r[i + n];
|
|
4150
|
-
return !a || !
|
|
4159
|
+
return !a || !Pn(a) ? null : a;
|
|
4151
4160
|
}
|
|
4152
|
-
function
|
|
4153
|
-
let r =
|
|
4161
|
+
function ka({ table: e, columnId: t, direction: n }) {
|
|
4162
|
+
let r = Oa({
|
|
4154
4163
|
table: e,
|
|
4155
4164
|
columnId: t,
|
|
4156
4165
|
direction: n
|
|
4157
4166
|
});
|
|
4158
|
-
r &&
|
|
4167
|
+
r && Ta({
|
|
4159
4168
|
table: e,
|
|
4160
4169
|
columnId: t,
|
|
4161
4170
|
targetId: r.id,
|
|
@@ -4164,14 +4173,14 @@ function Oa({ table: e, columnId: t, direction: n }) {
|
|
|
4164
4173
|
}
|
|
4165
4174
|
//#endregion
|
|
4166
4175
|
//#region src/tmdatagrid/components/TMDataGridHeaderCell.tsx
|
|
4167
|
-
function
|
|
4176
|
+
function Aa(t) {
|
|
4168
4177
|
let n = e(278), { header: r, layout: i, renderColumnMenuItems: a } = t, o = Q(), { table: u, features: d, filters: f, labels: p } = o, m = r.column, [h, _] = c(!1), [v, y] = c(!1), [b, x] = c(null), S = s(null), C = s(!1), w;
|
|
4169
4178
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (w = { compare: _e }, n[0] = w) : w = n[0];
|
|
4170
|
-
let { sorting: T, columnFilters: E, resizingColumnId: O, columnPinning: k, grouping: M } = A(u.store,
|
|
4179
|
+
let { sorting: T, columnFilters: E, resizingColumnId: O, columnPinning: k, grouping: M } = A(u.store, La, w), z = A(o.ui, Ia), B = r.subHeaders.length === 0, V, oe, W, ce, le, G, K, ue, de, fe, pe, me, he, ge, ve, ye, be, xe, Se, Y, Ce, we;
|
|
4171
4180
|
if (n[1] !== o || n[2] !== m || n[3] !== E || n[4] !== k || n[5] !== z || n[6] !== b || n[7] !== d || n[8] !== f || n[9] !== M || n[10] !== r || n[11] !== B || n[12] !== p || n[13] !== i.pinnedAt || n[14] !== a || n[15] !== O || n[16] !== T || n[17] !== u) {
|
|
4172
4181
|
Se = wn(m);
|
|
4173
4182
|
let e;
|
|
4174
|
-
n[40] === m ? e = n[41] : (e =
|
|
4183
|
+
n[40] === m ? e = n[41] : (e = jn(m), n[40] = m, n[41] = e), V = e;
|
|
4175
4184
|
let t;
|
|
4176
4185
|
n[42] !== m.id || n[43] !== T ? (t = T.find((e) => e.id === m.id)?.desc, n[42] = m.id, n[43] = T, n[44] = t) : t = n[44], Ce = t, xe = Ce !== void 0;
|
|
4177
4186
|
let s;
|
|
@@ -4183,17 +4192,17 @@ function ka(t) {
|
|
|
4183
4192
|
} else c = n[51];
|
|
4184
4193
|
ye = c, be = O === m.id, he = O !== !1, Y = i.pinnedAt;
|
|
4185
4194
|
let l;
|
|
4186
|
-
n[54] !== m || n[55] !== d ? (l =
|
|
4195
|
+
n[54] !== m || n[55] !== d ? (l = Zr(m, d), n[54] = m, n[55] = d, n[56] = l) : l = n[56];
|
|
4187
4196
|
let h = l;
|
|
4188
4197
|
le = B && h.canSort;
|
|
4189
4198
|
let _ = B && h.canFilter, v = B && h.canHide, y = B && h.canPin;
|
|
4190
4199
|
ce = h.canResize, W = B && h.canReorder;
|
|
4191
|
-
let C = B && h.canGroup, w = B &&
|
|
4200
|
+
let C = B && h.canGroup, w = B && Qr(u, d).canHideAny, D;
|
|
4192
4201
|
n[57] !== m.id || n[58] !== M ? (D = M.includes(m.id), n[57] = m.id, n[58] = M, n[59] = D) : D = n[59];
|
|
4193
4202
|
let A = D, H = M.length > 0;
|
|
4194
4203
|
ge = z === m.id;
|
|
4195
4204
|
let _e;
|
|
4196
|
-
n[60] !== W || n[61] !== m.id || n[62] !== k || n[63] !== z || n[64] !== ge ? (_e = W && z !== null && !ge &&
|
|
4205
|
+
n[60] !== W || n[61] !== m.id || n[62] !== k || n[63] !== z || n[64] !== ge ? (_e = W && z !== null && !ge && Ca(k, z) === Ca(k, m.id), n[60] = W, n[61] = m.id, n[62] = k, n[63] = z, n[64] = ge, n[65] = _e) : _e = n[65], ve = _e;
|
|
4197
4206
|
let Te;
|
|
4198
4207
|
n[66] !== o.ui || n[67] !== m.id ? (Te = function(e) {
|
|
4199
4208
|
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", m.id), o.ui.actions.startColumnDrag(m.id);
|
|
@@ -4212,7 +4221,7 @@ function ka(t) {
|
|
|
4212
4221
|
}, n[71] = De) : De = n[71], de = De;
|
|
4213
4222
|
let Oe;
|
|
4214
4223
|
n[72] !== o.ui || n[73] !== m.id || n[74] !== z || n[75] !== b || n[76] !== ve || n[77] !== u ? (Oe = function(e) {
|
|
4215
|
-
e.preventDefault(), x(null), o.ui.actions.endColumnDrag(), !(!ve || !b || !z) &&
|
|
4224
|
+
e.preventDefault(), x(null), o.ui.actions.endColumnDrag(), !(!ve || !b || !z) && Ta({
|
|
4216
4225
|
table: u,
|
|
4217
4226
|
columnId: z,
|
|
4218
4227
|
targetId: m.id,
|
|
@@ -4226,7 +4235,7 @@ function ka(t) {
|
|
|
4226
4235
|
let Ae;
|
|
4227
4236
|
n[81] !== m.id || n[82] !== u ? (Ae = function() {
|
|
4228
4237
|
let e = S.current?.closest("[data-dg-scroll-container]");
|
|
4229
|
-
e &&
|
|
4238
|
+
e && Sa({
|
|
4230
4239
|
table: u,
|
|
4231
4240
|
columnId: m.id,
|
|
4232
4241
|
container: e
|
|
@@ -4250,7 +4259,7 @@ function ka(t) {
|
|
|
4250
4259
|
}, n[84] = r, n[85] = u, n[86] = je) : je = n[86], K = je;
|
|
4251
4260
|
let Me;
|
|
4252
4261
|
n[87] !== m || n[88] !== K || n[89] !== u ? (Me = function(e) {
|
|
4253
|
-
e && K(), m.pin(e), u.setColumnPinning(
|
|
4262
|
+
e && K(), m.pin(e), u.setColumnPinning(Ea);
|
|
4254
4263
|
}, n[87] = m, n[88] = K, n[89] = u, n[90] = Me) : Me = n[90];
|
|
4255
4264
|
let Ne = Me, X = [];
|
|
4256
4265
|
if (le) {
|
|
@@ -4290,7 +4299,7 @@ function ka(t) {
|
|
|
4290
4299
|
stroke: 1.6
|
|
4291
4300
|
}), n[104] = e) : e = n[104];
|
|
4292
4301
|
let t;
|
|
4293
|
-
n[105] !== o || n[106] !== m.id ? (t = () =>
|
|
4302
|
+
n[105] !== o || n[106] !== m.id ? (t = () => Oi(o, m.id), n[105] = o, n[106] = m.id, n[107] = t) : t = n[107];
|
|
4294
4303
|
let r;
|
|
4295
4304
|
n[108] !== p.filterMenuItem || n[109] !== t ? (r = /* @__PURE__ */ q(g.Item, {
|
|
4296
4305
|
leftSection: e,
|
|
@@ -4301,7 +4310,7 @@ function ka(t) {
|
|
|
4301
4310
|
n[111] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ q(g.Divider, {}, "filter-divider"), n[111] = i) : i = n[111], X.push(r, i);
|
|
4302
4311
|
}
|
|
4303
4312
|
if (C) {
|
|
4304
|
-
let e = A ?
|
|
4313
|
+
let e = A ? ha.menuItemActive : void 0, t;
|
|
4305
4314
|
n[112] === A ? t = n[113] : (t = q(A ? ie : ae, {
|
|
4306
4315
|
size: 16,
|
|
4307
4316
|
stroke: 1.6
|
|
@@ -4367,7 +4376,7 @@ function ka(t) {
|
|
|
4367
4376
|
n[135] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ q(g.Divider, {}, "group-divider"), n[135] = e) : e = n[135], X.push(e);
|
|
4368
4377
|
}
|
|
4369
4378
|
if (y) {
|
|
4370
|
-
let e = Y === "left" ?
|
|
4379
|
+
let e = Y === "left" ? ha.menuItemActive : void 0, t;
|
|
4371
4380
|
n[136] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ q(N, {
|
|
4372
4381
|
size: 16,
|
|
4373
4382
|
stroke: 1.6
|
|
@@ -4381,7 +4390,7 @@ function ka(t) {
|
|
|
4381
4390
|
onClick: r,
|
|
4382
4391
|
children: p.pinLeft
|
|
4383
4392
|
}, "pin-left"), n[140] = p.pinLeft, n[141] = e, n[142] = r, n[143] = i) : i = n[143];
|
|
4384
|
-
let a = Y === "right" ?
|
|
4393
|
+
let a = Y === "right" ? ha.menuItemActive : void 0, o;
|
|
4385
4394
|
n[144] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ q(P, {
|
|
4386
4395
|
size: 16,
|
|
4387
4396
|
stroke: 1.6
|
|
@@ -4414,13 +4423,13 @@ function ka(t) {
|
|
|
4414
4423
|
}
|
|
4415
4424
|
if (W) {
|
|
4416
4425
|
let e;
|
|
4417
|
-
n[159] !== m.id || n[160] !== u ? (e =
|
|
4426
|
+
n[159] !== m.id || n[160] !== u ? (e = Oa({
|
|
4418
4427
|
table: u,
|
|
4419
4428
|
columnId: m.id,
|
|
4420
4429
|
direction: -1
|
|
4421
4430
|
}), n[159] = m.id, n[160] = u, n[161] = e) : e = n[161];
|
|
4422
4431
|
let t = e, r;
|
|
4423
|
-
n[162] !== m.id || n[163] !== u ? (r =
|
|
4432
|
+
n[162] !== m.id || n[163] !== u ? (r = Oa({
|
|
4424
4433
|
table: u,
|
|
4425
4434
|
columnId: m.id,
|
|
4426
4435
|
direction: 1
|
|
@@ -4433,7 +4442,7 @@ function ka(t) {
|
|
|
4433
4442
|
stroke: 1.6
|
|
4434
4443
|
}), n[165] = r) : r = n[165];
|
|
4435
4444
|
let a;
|
|
4436
|
-
n[166] !== m.id || n[167] !== u ? (a = () =>
|
|
4445
|
+
n[166] !== m.id || n[167] !== u ? (a = () => ka({
|
|
4437
4446
|
table: u,
|
|
4438
4447
|
columnId: m.id,
|
|
4439
4448
|
direction: -1
|
|
@@ -4451,7 +4460,7 @@ function ka(t) {
|
|
|
4451
4460
|
stroke: 1.6
|
|
4452
4461
|
}), n[173] = c) : c = n[173];
|
|
4453
4462
|
let l;
|
|
4454
|
-
n[174] !== m.id || n[175] !== u ? (l = () =>
|
|
4463
|
+
n[174] !== m.id || n[175] !== u ? (l = () => ka({
|
|
4455
4464
|
table: u,
|
|
4456
4465
|
columnId: m.id,
|
|
4457
4466
|
direction: 1
|
|
@@ -4509,23 +4518,23 @@ function ka(t) {
|
|
|
4509
4518
|
children: p.manageColumns
|
|
4510
4519
|
}) }), n[194] = p.manageColumns, n[195] = t);
|
|
4511
4520
|
let r;
|
|
4512
|
-
n[196] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ q(g.Sub.Dropdown, { children: /* @__PURE__ */ q(
|
|
4521
|
+
n[196] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ q(g.Sub.Dropdown, { children: /* @__PURE__ */ q(Ki, { searchable: !1 }) }), n[196] = r) : r = n[196];
|
|
4513
4522
|
let i;
|
|
4514
4523
|
n[197] === t ? i = n[198] : (i = /* @__PURE__ */ J(g.Sub, { children: [t, r] }, "manage"), n[197] = t, n[198] = i), X.push(i);
|
|
4515
4524
|
}
|
|
4516
|
-
for (; X.length > 0 &&
|
|
4525
|
+
for (; X.length > 0 && Ra(X.at(-1));) X.pop();
|
|
4517
4526
|
for (G = a ? [...a({
|
|
4518
4527
|
column: m,
|
|
4519
4528
|
table: u,
|
|
4520
4529
|
internalItems: X
|
|
4521
|
-
})] : X; G.length > 0 &&
|
|
4530
|
+
})] : X; G.length > 0 && Ra(G.at(-1));) G.pop();
|
|
4522
4531
|
n[1] = o, n[2] = m, n[3] = E, n[4] = k, n[5] = z, n[6] = b, n[7] = d, n[8] = f, n[9] = M, n[10] = r, n[11] = B, n[12] = p, n[13] = i.pinnedAt, n[14] = a, n[15] = O, n[16] = T, n[17] = u, n[18] = V, n[19] = oe, n[20] = W, n[21] = ce, n[22] = le, n[23] = G, n[24] = K, n[25] = ue, n[26] = de, n[27] = fe, n[28] = pe, n[29] = me, n[30] = he, n[31] = ge, n[32] = ve, n[33] = ye, n[34] = be, n[35] = xe, n[36] = Se, n[37] = Y, n[38] = Ce, n[39] = we;
|
|
4523
4532
|
} else V = n[18], oe = n[19], W = n[20], ce = n[21], le = n[22], G = n[23], K = n[24], ue = n[25], de = n[26], fe = n[27], pe = n[28], me = n[29], he = n[30], ge = n[31], ve = n[32], ye = n[33], be = n[34], xe = n[35], Se = n[36], Y = n[37], Ce = n[38], we = n[39];
|
|
4524
4533
|
let Te;
|
|
4525
|
-
n[199] !== m.id || n[200] !== G || n[201] !== B ? (Te = B && G.length > 0 && !
|
|
4526
|
-
let Ee = Te, De = le ?
|
|
4534
|
+
n[199] !== m.id || n[200] !== G || n[201] !== B ? (Te = B && G.length > 0 && !Mn(m.id), n[199] = m.id, n[200] = G, n[201] = B, n[202] = Te) : Te = n[202];
|
|
4535
|
+
let Ee = Te, De = le ? ha.headerCellSortable : "", Oe = ye ? ha.headerCellFiltered : "", ke = ge ? ha.headerCellDragging : "", Ae = b === "before" ? ha.headerCellDropBefore : "", je = b === "after" ? ha.headerCellDropAfter : "", Me = i.isBoundary && Y === "left" ? ea.stickyLeft : "", Ne = i.isBoundary && Y === "right" ? ea.stickyRight : "", X;
|
|
4527
4536
|
n[203] !== De || n[204] !== Oe || n[205] !== ke || n[206] !== Ae || n[207] !== je || n[208] !== Me || n[209] !== Ne ? (X = [
|
|
4528
|
-
|
|
4537
|
+
ha.headerCell,
|
|
4529
4538
|
De,
|
|
4530
4539
|
Oe,
|
|
4531
4540
|
ke,
|
|
@@ -4535,7 +4544,7 @@ function ka(t) {
|
|
|
4535
4544
|
Ne
|
|
4536
4545
|
].filter(Boolean), n[203] = De, n[204] = Oe, n[205] = ke, n[206] = Ae, n[207] = je, n[208] = Me, n[209] = Ne, n[210] = X) : X = n[210];
|
|
4537
4546
|
let Pe = X.join(" "), Ie = m.id, Le = xe || ye, Z;
|
|
4538
|
-
n[211] === m.id ? Z = n[212] : (Z =
|
|
4547
|
+
n[211] === m.id ? Z = n[212] : (Z = Mn(m.id), n[211] = m.id, n[212] = Z);
|
|
4539
4548
|
let Re = le ? xe ? Ce ? "descending" : "ascending" : "none" : void 0, ze = W && !he, Be = W ? pe : void 0, Ve = W ? ue : void 0, He = ve ? fe : void 0, Ue = ve ? de : void 0, We = ve ? me : void 0, Ge = r.colSpan > 1 ? `span ${r.colSpan}` : void 0, Ke = Y === "left" ? i.offset : void 0, qe = Y === "right" ? i.offset : void 0, Je = Y ? "sticky" : void 0, Ye = Y ? "var(--dg-z-header-pinned-cell, 7)" : void 0, Xe;
|
|
4540
4549
|
n[213] !== Ge || n[214] !== Ke || n[215] !== qe || n[216] !== Je || n[217] !== Ye ? (Xe = {
|
|
4541
4550
|
gridColumn: Ge,
|
|
@@ -4544,7 +4553,7 @@ function ka(t) {
|
|
|
4544
4553
|
position: Je,
|
|
4545
4554
|
zIndex: Ye
|
|
4546
4555
|
}, n[213] = Ge, n[214] = Ke, n[215] = qe, n[216] = Je, n[217] = Ye, n[218] = Xe) : Xe = n[218];
|
|
4547
|
-
let Ze = le ?
|
|
4556
|
+
let Ze = le ? Fa : void 0, Qe;
|
|
4548
4557
|
n[219] !== le || n[220] !== m ? (Qe = le ? (e) => {
|
|
4549
4558
|
if (C.current) {
|
|
4550
4559
|
C.current = !1;
|
|
@@ -4559,17 +4568,17 @@ function ka(t) {
|
|
|
4559
4568
|
withinPortal: !0,
|
|
4560
4569
|
disabled: !B,
|
|
4561
4570
|
children: /* @__PURE__ */ q("span", {
|
|
4562
|
-
className:
|
|
4571
|
+
className: ha.headerTitle,
|
|
4563
4572
|
"data-dg-header-title": !0,
|
|
4564
4573
|
children: Fe(m.columnDef.header, r.getContext())
|
|
4565
4574
|
})
|
|
4566
4575
|
}), n[222] = m.columnDef, n[223] = r, n[224] = B, n[225] = Se, n[226] = $e) : $e = n[226];
|
|
4567
4576
|
let et;
|
|
4568
4577
|
n[227] !== o || n[228] !== le || n[229] !== m || n[230] !== v || n[231] !== f || n[232] !== G || n[233] !== Ee || n[234] !== ye || n[235] !== B || n[236] !== xe || n[237] !== Se || n[238] !== p || n[239] !== h || n[240] !== Ce || n[241] !== we ? (et = B && /* @__PURE__ */ J("div", {
|
|
4569
|
-
className:
|
|
4578
|
+
className: ha.headerActions,
|
|
4570
4579
|
children: [
|
|
4571
4580
|
ye && !f.inHeader && /* @__PURE__ */ q(l, {
|
|
4572
|
-
className:
|
|
4581
|
+
className: ha.headerAction,
|
|
4573
4582
|
"data-pinned-visible": "true",
|
|
4574
4583
|
variant: "subtle",
|
|
4575
4584
|
color: "gray",
|
|
@@ -4578,7 +4587,7 @@ function ka(t) {
|
|
|
4578
4587
|
"data-dg-part": "header-filter",
|
|
4579
4588
|
"data-column-id": m.id,
|
|
4580
4589
|
onClick: (e) => {
|
|
4581
|
-
e.stopPropagation(),
|
|
4590
|
+
e.stopPropagation(), Oi(o, m.id);
|
|
4582
4591
|
},
|
|
4583
4592
|
children: /* @__PURE__ */ q(U, {
|
|
4584
4593
|
size: 14,
|
|
@@ -4586,7 +4595,7 @@ function ka(t) {
|
|
|
4586
4595
|
})
|
|
4587
4596
|
}),
|
|
4588
4597
|
le && /* @__PURE__ */ q(l, {
|
|
4589
|
-
className: `${
|
|
4598
|
+
className: `${ha.headerAction} ${ha.sortAction}`,
|
|
4590
4599
|
"data-pinned-visible": xe,
|
|
4591
4600
|
"data-sorted": xe,
|
|
4592
4601
|
variant: "subtle",
|
|
@@ -4602,7 +4611,7 @@ function ka(t) {
|
|
|
4602
4611
|
})
|
|
4603
4612
|
}),
|
|
4604
4613
|
we !== null && /* @__PURE__ */ q("span", {
|
|
4605
|
-
className:
|
|
4614
|
+
className: ha.sortIndex,
|
|
4606
4615
|
"data-dg-part": "sort-index",
|
|
4607
4616
|
children: we
|
|
4608
4617
|
}),
|
|
@@ -4614,7 +4623,7 @@ function ka(t) {
|
|
|
4614
4623
|
width: 220,
|
|
4615
4624
|
withinPortal: !0,
|
|
4616
4625
|
children: [/* @__PURE__ */ q(g.Target, { children: /* @__PURE__ */ q(l, {
|
|
4617
|
-
className:
|
|
4626
|
+
className: ha.headerAction,
|
|
4618
4627
|
"data-pinned-visible": h || v,
|
|
4619
4628
|
variant: "subtle",
|
|
4620
4629
|
color: "gray",
|
|
@@ -4623,25 +4632,25 @@ function ka(t) {
|
|
|
4623
4632
|
"data-dg-part": "header-menu",
|
|
4624
4633
|
"data-column-id": m.id,
|
|
4625
4634
|
onClick: (e) => {
|
|
4626
|
-
e.stopPropagation(), _(
|
|
4635
|
+
e.stopPropagation(), _(Pa);
|
|
4627
4636
|
},
|
|
4628
4637
|
children: /* @__PURE__ */ q(H, {
|
|
4629
4638
|
size: 14,
|
|
4630
4639
|
stroke: 1.6
|
|
4631
4640
|
})
|
|
4632
4641
|
}) }), /* @__PURE__ */ q(g.Dropdown, {
|
|
4633
|
-
onClick:
|
|
4642
|
+
onClick: Na,
|
|
4634
4643
|
children: G
|
|
4635
4644
|
})]
|
|
4636
4645
|
})
|
|
4637
4646
|
]
|
|
4638
4647
|
}), n[227] = o, n[228] = le, n[229] = m, n[230] = v, n[231] = f, n[232] = G, n[233] = Ee, n[234] = ye, n[235] = B, n[236] = xe, n[237] = Se, n[238] = p, n[239] = h, n[240] = Ce, n[241] = we, n[242] = et) : et = n[242];
|
|
4639
4648
|
let tt;
|
|
4640
|
-
n[243] !== oe || n[244] !== ce || n[245] !== m.id || n[246] !== K || n[247] !== r || n[248] !== be ? (tt = !
|
|
4649
|
+
n[243] !== oe || n[244] !== ce || n[245] !== m.id || n[246] !== K || n[247] !== r || n[248] !== be ? (tt = !Mn(m.id) && /* @__PURE__ */ q("div", {
|
|
4641
4650
|
className: [
|
|
4642
|
-
|
|
4643
|
-
ce ?
|
|
4644
|
-
be ?
|
|
4651
|
+
ha.columnSeparator,
|
|
4652
|
+
ce ? ha.columnSeparatorResizable : "",
|
|
4653
|
+
be ? ha.columnSeparatorActive : ""
|
|
4645
4654
|
].filter(Boolean).join(" "),
|
|
4646
4655
|
draggable: !1,
|
|
4647
4656
|
onMouseDown: ce ? (e) => {
|
|
@@ -4650,7 +4659,7 @@ function ka(t) {
|
|
|
4650
4659
|
onTouchStart: ce ? (e) => {
|
|
4651
4660
|
K(), r.getResizeHandler()(e);
|
|
4652
4661
|
} : void 0,
|
|
4653
|
-
onClick:
|
|
4662
|
+
onClick: Ma,
|
|
4654
4663
|
onDoubleClick: ce ? (e) => {
|
|
4655
4664
|
e.stopPropagation(), oe();
|
|
4656
4665
|
} : void 0
|
|
@@ -4691,7 +4700,7 @@ function ka(t) {
|
|
|
4691
4700
|
n[270] === rt ? at = n[271] : (at = /* @__PURE__ */ q(g.ContextMenu, { children: rt }), n[270] = rt, n[271] = at);
|
|
4692
4701
|
let ot;
|
|
4693
4702
|
n[272] === G ? ot = n[273] : (ot = /* @__PURE__ */ q(g.Dropdown, {
|
|
4694
|
-
onClick:
|
|
4703
|
+
onClick: ja,
|
|
4695
4704
|
children: G
|
|
4696
4705
|
}), n[272] = G, n[273] = ot);
|
|
4697
4706
|
let st;
|
|
@@ -4705,9 +4714,6 @@ function ka(t) {
|
|
|
4705
4714
|
children: [at, ot]
|
|
4706
4715
|
}), n[274] = v, n[275] = at, n[276] = ot, n[277] = st) : st = n[277], st;
|
|
4707
4716
|
}
|
|
4708
|
-
function Aa(e) {
|
|
4709
|
-
return e.stopPropagation();
|
|
4710
|
-
}
|
|
4711
4717
|
function ja(e) {
|
|
4712
4718
|
return e.stopPropagation();
|
|
4713
4719
|
}
|
|
@@ -4715,15 +4721,18 @@ function Ma(e) {
|
|
|
4715
4721
|
return e.stopPropagation();
|
|
4716
4722
|
}
|
|
4717
4723
|
function Na(e) {
|
|
4718
|
-
return
|
|
4724
|
+
return e.stopPropagation();
|
|
4719
4725
|
}
|
|
4720
4726
|
function Pa(e) {
|
|
4721
|
-
|
|
4727
|
+
return !e;
|
|
4722
4728
|
}
|
|
4723
4729
|
function Fa(e) {
|
|
4724
|
-
|
|
4730
|
+
e.shiftKey && e.preventDefault();
|
|
4725
4731
|
}
|
|
4726
4732
|
function Ia(e) {
|
|
4733
|
+
return e.draggedColumnId;
|
|
4734
|
+
}
|
|
4735
|
+
function La(e) {
|
|
4727
4736
|
return {
|
|
4728
4737
|
sorting: e.sorting,
|
|
4729
4738
|
columnFilters: e.columnFilters,
|
|
@@ -4733,12 +4742,12 @@ function Ia(e) {
|
|
|
4733
4742
|
grouping: e.grouping
|
|
4734
4743
|
};
|
|
4735
4744
|
}
|
|
4736
|
-
function
|
|
4745
|
+
function Ra(e) {
|
|
4737
4746
|
return typeof e == "object" && !!e && "type" in e && e.type === g.Divider;
|
|
4738
4747
|
}
|
|
4739
4748
|
//#endregion
|
|
4740
4749
|
//#region src/tmdatagrid/core/editorFocus.ts
|
|
4741
|
-
var
|
|
4750
|
+
var za = [
|
|
4742
4751
|
"button:not([disabled])",
|
|
4743
4752
|
"input:not([disabled]):not([type=\"hidden\"])",
|
|
4744
4753
|
"select:not([disabled])",
|
|
@@ -4746,34 +4755,34 @@ var Ra = [
|
|
|
4746
4755
|
"a[href]",
|
|
4747
4756
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
4748
4757
|
].join(",");
|
|
4749
|
-
function
|
|
4750
|
-
(e.querySelector("[data-dg-part=\"editor-input\"]") ?? e.querySelector(
|
|
4758
|
+
function Ba(e) {
|
|
4759
|
+
(e.querySelector("[data-dg-part=\"editor-input\"]") ?? e.querySelector(za))?.focus();
|
|
4751
4760
|
}
|
|
4752
4761
|
//#endregion
|
|
4753
4762
|
//#region src/tmdatagrid/components/editors/editorShared.ts
|
|
4754
|
-
function Ba(e) {
|
|
4755
|
-
return me(e.store, Va);
|
|
4756
|
-
}
|
|
4757
4763
|
function Va(e) {
|
|
4758
|
-
return e.
|
|
4764
|
+
return me(e.store, Ha);
|
|
4759
4765
|
}
|
|
4760
4766
|
function Ha(e) {
|
|
4761
|
-
return
|
|
4767
|
+
return e.value;
|
|
4762
4768
|
}
|
|
4763
4769
|
function Ua(e) {
|
|
4764
|
-
return
|
|
4770
|
+
return me(e.store, Wa);
|
|
4765
4771
|
}
|
|
4766
4772
|
function Wa(e) {
|
|
4767
|
-
return
|
|
4773
|
+
return Gt(e.meta.errors);
|
|
4768
4774
|
}
|
|
4769
4775
|
function Ga(e) {
|
|
4770
|
-
return
|
|
4776
|
+
return me(e.store, Ka);
|
|
4771
4777
|
}
|
|
4772
4778
|
function Ka(e) {
|
|
4779
|
+
return Gt(e.meta.errors) !== void 0;
|
|
4780
|
+
}
|
|
4781
|
+
function qa(e) {
|
|
4773
4782
|
let t = e.currentTarget;
|
|
4774
4783
|
t instanceof HTMLInputElement && t.select();
|
|
4775
4784
|
}
|
|
4776
|
-
function
|
|
4785
|
+
function Ja() {
|
|
4777
4786
|
let t = e(2), n = s(null), r = s(null), i;
|
|
4778
4787
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
|
|
4779
4788
|
let e = r.current, t = n.current;
|
|
@@ -4794,8 +4803,8 @@ function qa() {
|
|
|
4794
4803
|
}
|
|
4795
4804
|
//#endregion
|
|
4796
4805
|
//#region src/tmdatagrid/components/editors/TMDataGridBooleanEditor.tsx
|
|
4797
|
-
function
|
|
4798
|
-
let n = e(12), { field: r, column: i, size: a } = t, { labels: o } = Q(), s =
|
|
4806
|
+
function Ya(t) {
|
|
4807
|
+
let n = e(12), { field: r, column: i, size: a } = t, { labels: o } = Q(), s = Va(r), c = Ga(r), l;
|
|
4799
4808
|
n[0] !== i || n[1] !== o ? (l = o.editCell(wn(i)), n[0] = i, n[1] = o, n[2] = l) : l = n[2];
|
|
4800
4809
|
let u = s === !0, d;
|
|
4801
4810
|
n[3] === r ? d = n[4] : (d = (e) => r.handleChange(e.currentTarget.checked), n[3] = r, n[4] = d);
|
|
@@ -4812,8 +4821,8 @@ function Ja(t) {
|
|
|
4812
4821
|
}
|
|
4813
4822
|
//#endregion
|
|
4814
4823
|
//#region src/tmdatagrid/components/editors/TMDataGridDateEditor.tsx
|
|
4815
|
-
function
|
|
4816
|
-
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = Q(), c =
|
|
4824
|
+
function Xa(t) {
|
|
4825
|
+
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = Q(), c = Va(r), l = Ga(r), u = s(c instanceof Date), d;
|
|
4817
4826
|
n[0] === c ? d = n[1] : (d = c instanceof Date ? c.toLocaleDateString("sv-SE") : typeof c == "string" ? c.slice(0, 10) : "", n[0] = c, n[1] = d);
|
|
4818
4827
|
let f = d, p;
|
|
4819
4828
|
n[2] !== i || n[3] !== o ? (p = o.editCell(wn(i)), n[2] = i, n[3] = o, n[4] = p) : p = n[4];
|
|
@@ -4841,13 +4850,13 @@ function Ya(t) {
|
|
|
4841
4850
|
}
|
|
4842
4851
|
//#endregion
|
|
4843
4852
|
//#region src/tmdatagrid/components/editors/TMDataGridMultiSelectEditor.tsx
|
|
4844
|
-
function
|
|
4845
|
-
let n = e(20), { field: r, column: i, row: a, table: o, size: s } = t, { labels: c } = Q(), l =
|
|
4853
|
+
function Za(t) {
|
|
4854
|
+
let n = e(20), { field: r, column: i, row: a, table: o, size: s } = t, { labels: c } = Q(), l = Va(r), u = Ga(r), d;
|
|
4846
4855
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (d = { withinPortal: !1 }, n[0] = d) : d = n[0];
|
|
4847
4856
|
let f;
|
|
4848
4857
|
n[1] !== i || n[2] !== c ? (f = c.editCell(wn(i)), n[1] = i, n[2] = c, n[3] = f) : f = n[3];
|
|
4849
4858
|
let p;
|
|
4850
|
-
n[4] !== i || n[5] !== a || n[6] !== o ? (p = nr(
|
|
4859
|
+
n[4] !== i || n[5] !== a || n[6] !== o ? (p = rr(nr({
|
|
4851
4860
|
table: o,
|
|
4852
4861
|
column: i,
|
|
4853
4862
|
row: a,
|
|
@@ -4874,8 +4883,8 @@ function Xa(t) {
|
|
|
4874
4883
|
}
|
|
4875
4884
|
//#endregion
|
|
4876
4885
|
//#region src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx
|
|
4877
|
-
function
|
|
4878
|
-
let n = e(15), { field: r, column: i, size: a } = t, { labels: o } = Q(), s =
|
|
4886
|
+
function Qa(t) {
|
|
4887
|
+
let n = e(15), { field: r, column: i, size: a } = t, { labels: o } = Q(), s = Va(r), l = Ga(r), { inputRef: u, remember: d } = Ja(), [f, p] = c(null), m = f === null || f === "" ? null : Number(f), h = Number.isFinite(m) ? m === s : s === null, g;
|
|
4879
4888
|
n[0] !== i || n[1] !== o ? (g = o.editCell(wn(i)), n[0] = i, n[1] = o, n[2] = g) : g = n[2];
|
|
4880
4889
|
let _ = f !== null && h ? f : typeof s == "number" ? s : "", y;
|
|
4881
4890
|
n[3] !== r || n[4] !== u || n[5] !== d ? (y = (e) => {
|
|
@@ -4892,7 +4901,7 @@ function Za(t) {
|
|
|
4892
4901
|
ref: u,
|
|
4893
4902
|
size: a,
|
|
4894
4903
|
w: "100%",
|
|
4895
|
-
onFocus:
|
|
4904
|
+
onFocus: qa,
|
|
4896
4905
|
hideControls: !0,
|
|
4897
4906
|
"aria-label": g,
|
|
4898
4907
|
"data-dg-part": "editor-input",
|
|
@@ -4904,13 +4913,13 @@ function Za(t) {
|
|
|
4904
4913
|
}
|
|
4905
4914
|
//#endregion
|
|
4906
4915
|
//#region src/tmdatagrid/components/editors/TMDataGridSelectEditor.tsx
|
|
4907
|
-
function
|
|
4908
|
-
let n = e(20), { field: r, column: i, row: a, table: o, size: s, commit: c } = t, { labels: l, features: u } = Q(), d =
|
|
4916
|
+
function $a(t) {
|
|
4917
|
+
let n = e(20), { field: r, column: i, row: a, table: o, size: s, commit: c } = t, { labels: l, features: u } = Q(), d = Va(r), f = Ga(r), p;
|
|
4909
4918
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (p = { withinPortal: !1 }, n[0] = p) : p = n[0];
|
|
4910
4919
|
let m;
|
|
4911
4920
|
n[1] !== i || n[2] !== l ? (m = l.editCell(wn(i)), n[1] = i, n[2] = l, n[3] = m) : m = n[3];
|
|
4912
4921
|
let h;
|
|
4913
|
-
n[4] !== i || n[5] !== a || n[6] !== o ? (h = nr(
|
|
4922
|
+
n[4] !== i || n[5] !== a || n[6] !== o ? (h = rr(nr({
|
|
4914
4923
|
table: o,
|
|
4915
4924
|
column: i,
|
|
4916
4925
|
row: a,
|
|
@@ -4937,8 +4946,8 @@ function Qa(t) {
|
|
|
4937
4946
|
}
|
|
4938
4947
|
//#endregion
|
|
4939
4948
|
//#region src/tmdatagrid/components/editors/TMDataGridStringEditor.tsx
|
|
4940
|
-
function
|
|
4941
|
-
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = Q(), s =
|
|
4949
|
+
function eo(t) {
|
|
4950
|
+
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = Q(), s = Va(r), c = Ga(r), { inputRef: l, remember: u } = Ja(), d;
|
|
4942
4951
|
n[0] !== i || n[1] !== o ? (d = o.editCell(wn(i)), n[0] = i, n[1] = o, n[2] = d) : d = n[2];
|
|
4943
4952
|
let f = typeof s == "string" ? s : "", p;
|
|
4944
4953
|
n[3] !== r || n[4] !== u ? (p = (e) => {
|
|
@@ -4949,7 +4958,7 @@ function $a(t) {
|
|
|
4949
4958
|
ref: l,
|
|
4950
4959
|
size: a,
|
|
4951
4960
|
w: "100%",
|
|
4952
|
-
onFocus:
|
|
4961
|
+
onFocus: qa,
|
|
4953
4962
|
"aria-label": d,
|
|
4954
4963
|
"data-dg-part": "editor-input",
|
|
4955
4964
|
value: f,
|
|
@@ -4960,15 +4969,15 @@ function $a(t) {
|
|
|
4960
4969
|
}
|
|
4961
4970
|
//#endregion
|
|
4962
4971
|
//#region src/tmdatagrid/components/TMDataGridCellEditor.tsx
|
|
4963
|
-
var
|
|
4964
|
-
string:
|
|
4965
|
-
number:
|
|
4966
|
-
boolean:
|
|
4967
|
-
date:
|
|
4968
|
-
select:
|
|
4969
|
-
multiSelect:
|
|
4972
|
+
var to = {
|
|
4973
|
+
string: eo,
|
|
4974
|
+
number: Qa,
|
|
4975
|
+
boolean: Ya,
|
|
4976
|
+
date: Xa,
|
|
4977
|
+
select: $a,
|
|
4978
|
+
multiSelect: Za
|
|
4970
4979
|
};
|
|
4971
|
-
function
|
|
4980
|
+
function no({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1 }) {
|
|
4972
4981
|
let { table: o, edit: u, features: d, labels: f, controlSize: p } = Q(), m = d.editMode === "row" || a, h = e.column, g = u.getForm(t.id), _ = Bt(h), [v] = c(() => n()), y = s(void 0);
|
|
4973
4982
|
i(() => {
|
|
4974
4983
|
y.current = h.columnDef.meta?.edit?.mapValue;
|
|
@@ -4991,7 +5000,7 @@ function to({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1
|
|
|
4991
5000
|
}), e;
|
|
4992
5001
|
});
|
|
4993
5002
|
i(() => b.mount(), [b]);
|
|
4994
|
-
let x =
|
|
5003
|
+
let x = Ua(b), [S, C] = c(!1), [w, T] = c(!1);
|
|
4995
5004
|
i(() => {
|
|
4996
5005
|
if (v === void 0) return;
|
|
4997
5006
|
let e = h.columnDef.meta?.type ?? "string";
|
|
@@ -5026,7 +5035,7 @@ function to({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1
|
|
|
5026
5035
|
if (e.key === "Enter") e.preventDefault(), e.stopPropagation(), O("enter");
|
|
5027
5036
|
else if (e.key === "Escape") e.preventDefault(), e.stopPropagation(), k();
|
|
5028
5037
|
else if (e.key === "Tab" && !m) if (e.preventDefault(), e.stopPropagation(), d.editMode === "cellConfirm") {
|
|
5029
|
-
let t = Array.from(e.currentTarget.querySelectorAll(
|
|
5038
|
+
let t = Array.from(e.currentTarget.querySelectorAll(za)).filter((e) => e.tabIndex >= 0), n = t.indexOf(e.target), r = t[n + (e.shiftKey ? -1 : 1)];
|
|
5030
5039
|
if (n >= 0 && r !== void 0) {
|
|
5031
5040
|
r.focus(), r instanceof HTMLInputElement && r.select();
|
|
5032
5041
|
return;
|
|
@@ -5058,7 +5067,7 @@ function to({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1
|
|
|
5058
5067
|
cancel: k,
|
|
5059
5068
|
size: p,
|
|
5060
5069
|
seedText: v
|
|
5061
|
-
}, P = h.columnDef.meta?.edit?.editor ??
|
|
5070
|
+
}, P = h.columnDef.meta?.edit?.editor ?? to[h.columnDef.meta?.type ?? "string"] ?? eo;
|
|
5062
5071
|
return /* @__PURE__ */ J("div", {
|
|
5063
5072
|
className: $.cellEditor,
|
|
5064
5073
|
"data-dg-part": "editor",
|
|
@@ -5116,11 +5125,11 @@ function to({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1
|
|
|
5116
5125
|
}
|
|
5117
5126
|
//#endregion
|
|
5118
5127
|
//#region src/tmdatagrid/components/TMDataGridEntryRows.tsx
|
|
5119
|
-
function
|
|
5120
|
-
return n.isColumnEditable(t) ?
|
|
5128
|
+
function ro(e, t, n) {
|
|
5129
|
+
return n.isColumnEditable(t) ? An(t, e) : !1;
|
|
5121
5130
|
}
|
|
5122
|
-
function
|
|
5123
|
-
let n = e(36), { orderedColumns: r, layoutFor: i, rowHeight: o } = t, { table: c, edit: l, features: u } = Q(), d = A(l.store,
|
|
5131
|
+
function io(t) {
|
|
5132
|
+
let n = e(36), { orderedColumns: r, layoutFor: i, rowHeight: o } = t, { table: c, edit: l, features: u } = Q(), d = A(l.store, uo), f = A(l.store, lo), p = s(null), m = s(null), h = s(null), g;
|
|
5124
5133
|
n[0] === d ? g = n[1] : (g = () => {
|
|
5125
5134
|
let e = d.at(-1)?.tempId;
|
|
5126
5135
|
if (e === void 0) {
|
|
@@ -5131,7 +5140,7 @@ function ro(t) {
|
|
|
5131
5140
|
let t = p.current;
|
|
5132
5141
|
if (t === null) return;
|
|
5133
5142
|
let n = t.querySelector(`[data-dg-part="editor"][data-row-id="${CSS.escape(e)}"]`);
|
|
5134
|
-
n !== null && (m.current = e,
|
|
5143
|
+
n !== null && (m.current = e, Ba(n));
|
|
5135
5144
|
}, n[0] = d, n[1] = g), a(g);
|
|
5136
5145
|
let _;
|
|
5137
5146
|
n[2] === f ? _ = n[3] : (_ = () => {
|
|
@@ -5144,7 +5153,7 @@ function ro(t) {
|
|
|
5144
5153
|
let t = p.current;
|
|
5145
5154
|
if (t === null) return;
|
|
5146
5155
|
let n = t.querySelector(f.columnId === null ? `[data-dg-part="editor"][data-row-id="${CSS.escape(f.rowId)}"]` : `[data-dg-part="editor"][data-row-id="${CSS.escape(f.rowId)}"][data-column-id="${CSS.escape(f.columnId)}"]`);
|
|
5147
|
-
n !== null && (h.current = e,
|
|
5156
|
+
n !== null && (h.current = e, Ba(n));
|
|
5148
5157
|
}, n[2] = f, n[3] = _), a(_);
|
|
5149
5158
|
let v;
|
|
5150
5159
|
if (n[4] !== l || n[5] !== d) {
|
|
@@ -5158,7 +5167,7 @@ function ro(t) {
|
|
|
5158
5167
|
n[9] === d ? b = n[10] : (b = (e, t) => d[t]?.tempId ?? String(t), n[9] = d, n[10] = b);
|
|
5159
5168
|
let x;
|
|
5160
5169
|
n[11] !== y || n[12] !== b || n[13] !== c.options.columns ? (x = {
|
|
5161
|
-
features:
|
|
5170
|
+
features: yi,
|
|
5162
5171
|
columns: c.options.columns,
|
|
5163
5172
|
data: y,
|
|
5164
5173
|
getRowId: b
|
|
@@ -5168,12 +5177,12 @@ function ro(t) {
|
|
|
5168
5177
|
let C;
|
|
5169
5178
|
if (n[15] !== l || n[16] !== S || n[17] !== u || n[18] !== i || n[19] !== d || n[20] !== r || n[21] !== o) {
|
|
5170
5179
|
let e = S.getCoreRowModel().rows, t;
|
|
5171
|
-
n[23] === d ? t = n[24] : (t = new Map(d.map(
|
|
5180
|
+
n[23] === d ? t = n[24] : (t = new Map(d.map(co)), n[23] = d, n[24] = t);
|
|
5172
5181
|
let a = t, s;
|
|
5173
5182
|
n[25] !== a || n[26] !== u ? (s = (e) => u.editNewRowsSticky || a.get(e.id) !== !0, n[25] = a, n[26] = u, n[27] = s) : s = n[27];
|
|
5174
5183
|
let c = e.filter(s), f;
|
|
5175
5184
|
n[28] !== a || n[29] !== l || n[30] !== i || n[31] !== r || n[32] !== o ? (f = (e, t) => {
|
|
5176
|
-
let n = new Map(e.getAllCells().map(
|
|
5185
|
+
let n = new Map(e.getAllCells().map(so)), s = a.get(e.id) === !0;
|
|
5177
5186
|
return /* @__PURE__ */ q("div", {
|
|
5178
5187
|
role: "row",
|
|
5179
5188
|
"data-dg-part": "entry-row",
|
|
@@ -5183,20 +5192,20 @@ function ro(t) {
|
|
|
5183
5192
|
"data-draft": s,
|
|
5184
5193
|
className: $.entryRow,
|
|
5185
5194
|
children: r.map((r) => {
|
|
5186
|
-
let a = n.get(r.id), c = i(r.id), u = a !== void 0 &&
|
|
5195
|
+
let a = n.get(r.id), c = i(r.id), u = a !== void 0 && ro(e, r, l);
|
|
5187
5196
|
return /* @__PURE__ */ q("div", {
|
|
5188
5197
|
role: "cell",
|
|
5189
5198
|
"data-column-id": r.id,
|
|
5190
|
-
"data-align":
|
|
5191
|
-
"data-control-column":
|
|
5199
|
+
"data-align": jn(r),
|
|
5200
|
+
"data-control-column": Mn(r.id),
|
|
5192
5201
|
onDoubleClick: s && u ? () => l.begin({
|
|
5193
5202
|
rowId: e.id,
|
|
5194
5203
|
columnId: r.id
|
|
5195
5204
|
}) : void 0,
|
|
5196
5205
|
className: [
|
|
5197
5206
|
$.entryCell,
|
|
5198
|
-
c.isBoundary && c.pinnedAt === "left" ?
|
|
5199
|
-
c.isBoundary && c.pinnedAt === "right" ?
|
|
5207
|
+
c.isBoundary && c.pinnedAt === "left" ? ea.stickyLeft : "",
|
|
5208
|
+
c.isBoundary && c.pinnedAt === "right" ? ea.stickyRight : ""
|
|
5200
5209
|
].filter(Boolean).join(" "),
|
|
5201
5210
|
style: {
|
|
5202
5211
|
minHeight: o,
|
|
@@ -5208,11 +5217,11 @@ function ro(t) {
|
|
|
5208
5217
|
children: a !== void 0 && r.id === "__edit__" ? Fe(a.column.columnDef.cell, a.getContext()) : s && a !== void 0 ? /* @__PURE__ */ q("span", {
|
|
5209
5218
|
className: $.cellContent,
|
|
5210
5219
|
children: Fe(a.column.columnDef.cell, a.getContext())
|
|
5211
|
-
}) : u && a !== void 0 ? /* @__PURE__ */ q(
|
|
5220
|
+
}) : u && a !== void 0 ? /* @__PURE__ */ q(no, {
|
|
5212
5221
|
cell: a,
|
|
5213
5222
|
row: e,
|
|
5214
|
-
takeSeedText:
|
|
5215
|
-
onClose:
|
|
5223
|
+
takeSeedText: oo,
|
|
5224
|
+
onClose: ao,
|
|
5216
5225
|
inEntryBlock: !0
|
|
5217
5226
|
}) : null
|
|
5218
5227
|
}, r.id);
|
|
@@ -5231,28 +5240,28 @@ function ro(t) {
|
|
|
5231
5240
|
let w;
|
|
5232
5241
|
return n[34] === C ? w = n[35] : (w = /* @__PURE__ */ q(ue, { children: C }), n[34] = C, n[35] = w), w;
|
|
5233
5242
|
}
|
|
5234
|
-
function io() {}
|
|
5235
5243
|
function ao() {}
|
|
5236
|
-
function oo(
|
|
5244
|
+
function oo() {}
|
|
5245
|
+
function so(e) {
|
|
5237
5246
|
return [e.column.id, e];
|
|
5238
5247
|
}
|
|
5239
|
-
function
|
|
5248
|
+
function co(e) {
|
|
5240
5249
|
return [e.tempId, e.committed];
|
|
5241
5250
|
}
|
|
5242
|
-
function
|
|
5251
|
+
function lo(e) {
|
|
5243
5252
|
return e.active !== null && e.newRows.some((t) => t.tempId === e.active?.rowId && !t.committed) ? e.active : null;
|
|
5244
5253
|
}
|
|
5245
|
-
function
|
|
5254
|
+
function uo(e) {
|
|
5246
5255
|
return e.newRows;
|
|
5247
5256
|
}
|
|
5248
5257
|
//#endregion
|
|
5249
5258
|
//#region src/tmdatagrid/core/resizePreview.ts
|
|
5250
|
-
var
|
|
5251
|
-
function
|
|
5259
|
+
var fo = 20, po = 2 ** 53 - 1;
|
|
5260
|
+
function mo(e, t, n) {
|
|
5252
5261
|
let r = Math.round(Math.max(e + e * t, 0) * 100) / 100;
|
|
5253
|
-
return Math.min(Math.max(n.minSize ??
|
|
5262
|
+
return Math.min(Math.max(n.minSize ?? fo, r), n.maxSize ?? po);
|
|
5254
5263
|
}
|
|
5255
|
-
function*
|
|
5264
|
+
function* ho(e, t, n) {
|
|
5256
5265
|
let r = 0;
|
|
5257
5266
|
for (let i of e) yield {
|
|
5258
5267
|
columnId: i,
|
|
@@ -5260,10 +5269,10 @@ function* mo(e, t, n) {
|
|
|
5260
5269
|
offset: r
|
|
5261
5270
|
}, r += n(i);
|
|
5262
5271
|
}
|
|
5263
|
-
function
|
|
5272
|
+
function go({ progress: e, tracks: t, boundsOf: n, leftLane: r, rightLane: i }) {
|
|
5264
5273
|
if (e.isResizingColumn === !1 || e.columnSizingStart.length === 0) return null;
|
|
5265
5274
|
let a = e.deltaPercentage ?? 0, o = /* @__PURE__ */ new Map();
|
|
5266
|
-
for (let [t, r] of e.columnSizingStart) o.set(t,
|
|
5275
|
+
for (let [t, r] of e.columnSizingStart) o.set(t, mo(r, a, n(t)));
|
|
5267
5276
|
let s = [], c = 0;
|
|
5268
5277
|
for (let e of t) {
|
|
5269
5278
|
let t = o.get(e.id);
|
|
@@ -5273,12 +5282,12 @@ function ho({ progress: e, tracks: t, boundsOf: n, leftLane: r, rightLane: i })
|
|
|
5273
5282
|
return {
|
|
5274
5283
|
gridTemplateColumns: s.join(" "),
|
|
5275
5284
|
minWidth: c,
|
|
5276
|
-
offsets: [...l(r) ?
|
|
5285
|
+
offsets: [...l(r) ? ho(r, "left", u) : [], ...l(i) ? ho(i, "right", u) : []]
|
|
5277
5286
|
};
|
|
5278
5287
|
}
|
|
5279
5288
|
//#endregion
|
|
5280
5289
|
//#region src/tmdatagrid/core/draftCellContext.ts
|
|
5281
|
-
function
|
|
5290
|
+
function _o(e, t) {
|
|
5282
5291
|
let n = Object.create(e.row), r = n;
|
|
5283
5292
|
r.original = t, r._valuesCache = Object.create(null), r._uniqueValuesCache = Object.create(null);
|
|
5284
5293
|
let i = Object.create(e);
|
|
@@ -5293,7 +5302,7 @@ function go(e, t) {
|
|
|
5293
5302
|
}
|
|
5294
5303
|
//#endregion
|
|
5295
5304
|
//#region src/tmdatagrid/core/cellRange.ts
|
|
5296
|
-
function
|
|
5305
|
+
function vo({ range: e, rowIndexOf: t, columnIndexOf: n }) {
|
|
5297
5306
|
if (e === null) return null;
|
|
5298
5307
|
let r = t(e.anchor.rowId), i = t(e.focus.rowId), a = n(e.anchor.columnId), o = n(e.focus.columnId);
|
|
5299
5308
|
return r < 0 || i < 0 || a < 0 || o < 0 ? null : {
|
|
@@ -5303,14 +5312,14 @@ function _o({ range: e, rowIndexOf: t, columnIndexOf: n }) {
|
|
|
5303
5312
|
right: Math.max(a, o)
|
|
5304
5313
|
};
|
|
5305
5314
|
}
|
|
5306
|
-
function
|
|
5315
|
+
function yo(e, t, n) {
|
|
5307
5316
|
return e !== null && t >= e.top && t <= e.bottom && n >= e.left && n <= e.right;
|
|
5308
5317
|
}
|
|
5309
|
-
function
|
|
5318
|
+
function bo(e) {
|
|
5310
5319
|
return e === null ? 0 : (e.bottom - e.top + 1) * (e.right - e.left + 1);
|
|
5311
5320
|
}
|
|
5312
|
-
function
|
|
5313
|
-
return !
|
|
5321
|
+
function xo(e, t, n) {
|
|
5322
|
+
return !yo(e, t, n) || e === null ? null : {
|
|
5314
5323
|
top: t === e.top,
|
|
5315
5324
|
bottom: t === e.bottom,
|
|
5316
5325
|
left: n === e.left,
|
|
@@ -5319,13 +5328,13 @@ function bo(e, t, n) {
|
|
|
5319
5328
|
}
|
|
5320
5329
|
//#endregion
|
|
5321
5330
|
//#region src/tmdatagrid/core/cellExport.ts
|
|
5322
|
-
var
|
|
5331
|
+
var So = "", Co = {
|
|
5323
5332
|
separator: ";",
|
|
5324
5333
|
decimalComma: !0,
|
|
5325
5334
|
includeHeaders: !0,
|
|
5326
5335
|
fileName: "export"
|
|
5327
5336
|
};
|
|
5328
|
-
function
|
|
5337
|
+
function wo(e, { decimalComma: t }) {
|
|
5329
5338
|
if (e == null) return "";
|
|
5330
5339
|
if (typeof e == "number") {
|
|
5331
5340
|
if (!Number.isFinite(e)) return "";
|
|
@@ -5334,7 +5343,7 @@ function Co(e, { decimalComma: t }) {
|
|
|
5334
5343
|
}
|
|
5335
5344
|
if (typeof e == "string") return e;
|
|
5336
5345
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
5337
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
5346
|
+
if (Array.isArray(e)) return e.map((e) => wo(e, { decimalComma: t })).join(", ");
|
|
5338
5347
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : e.toLocaleString("sv-SE");
|
|
5339
5348
|
if (typeof e == "object") try {
|
|
5340
5349
|
return JSON.stringify(e);
|
|
@@ -5343,18 +5352,18 @@ function Co(e, { decimalComma: t }) {
|
|
|
5343
5352
|
}
|
|
5344
5353
|
return String(e);
|
|
5345
5354
|
}
|
|
5346
|
-
function
|
|
5347
|
-
let a = t.slice(n.left, n.right + 1).filter((e) => !
|
|
5355
|
+
function To({ rows: e, columns: t, bounds: n, includeHeaders: r, decimalComma: i }) {
|
|
5356
|
+
let a = t.slice(n.left, n.right + 1).filter((e) => !Mn(e.id));
|
|
5348
5357
|
if (a.length === 0) return [];
|
|
5349
5358
|
let o = [];
|
|
5350
5359
|
r && o.push(a.map((e) => wn(e)));
|
|
5351
5360
|
for (let t = n.top; t <= n.bottom; t += 1) {
|
|
5352
5361
|
let n = e[t];
|
|
5353
|
-
n !== void 0 && o.push(a.map((e) =>
|
|
5362
|
+
n !== void 0 && o.push(a.map((e) => wo(n.getValue(e.id), { decimalComma: i })));
|
|
5354
5363
|
}
|
|
5355
5364
|
return o;
|
|
5356
5365
|
}
|
|
5357
|
-
function
|
|
5366
|
+
function Eo({ table: e, includeHeaders: t = Co.includeHeaders, decimalComma: n = Co.decimalComma }) {
|
|
5358
5367
|
let r = e, i = [
|
|
5359
5368
|
...r.getLeftVisibleLeafColumns(),
|
|
5360
5369
|
...r.getCenterVisibleLeafColumns(),
|
|
@@ -5362,7 +5371,7 @@ function To({ table: e, includeHeaders: t = So.includeHeaders, decimalComma: n =
|
|
|
5362
5371
|
], a = [], o = (e) => {
|
|
5363
5372
|
for (let t of e) t.getIsGrouped() ? o(t.subRows) : a.push(t);
|
|
5364
5373
|
};
|
|
5365
|
-
return o(r.getSortedRowModel().rows),
|
|
5374
|
+
return o(r.getSortedRowModel().rows), To({
|
|
5366
5375
|
rows: a,
|
|
5367
5376
|
columns: i,
|
|
5368
5377
|
bounds: {
|
|
@@ -5375,43 +5384,43 @@ function To({ table: e, includeHeaders: t = So.includeHeaders, decimalComma: n =
|
|
|
5375
5384
|
decimalComma: n
|
|
5376
5385
|
});
|
|
5377
5386
|
}
|
|
5378
|
-
function
|
|
5387
|
+
function Do({ table: e, options: t }) {
|
|
5379
5388
|
let n = {
|
|
5380
|
-
...
|
|
5389
|
+
...Co,
|
|
5381
5390
|
...t
|
|
5382
|
-
}, r =
|
|
5391
|
+
}, r = Eo({
|
|
5383
5392
|
table: e,
|
|
5384
5393
|
includeHeaders: n.includeHeaders,
|
|
5385
5394
|
decimalComma: n.decimalComma
|
|
5386
5395
|
});
|
|
5387
|
-
r.length !== 0 &&
|
|
5396
|
+
r.length !== 0 && Mo({
|
|
5388
5397
|
fileName: `${n.fileName}.csv`,
|
|
5389
|
-
text:
|
|
5398
|
+
text: Ao(r, { separator: n.separator })
|
|
5390
5399
|
});
|
|
5391
5400
|
}
|
|
5392
|
-
function
|
|
5401
|
+
function Oo(e, t) {
|
|
5393
5402
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? `"${e.replaceAll("\"", "\"\"")}"` : e;
|
|
5394
5403
|
}
|
|
5395
|
-
function
|
|
5396
|
-
return e.map((e) => e.map((e) =>
|
|
5404
|
+
function ko(e) {
|
|
5405
|
+
return e.map((e) => e.map((e) => Oo(e, " ")).join(" ")).join("\r\n");
|
|
5397
5406
|
}
|
|
5398
|
-
function
|
|
5399
|
-
return `${
|
|
5407
|
+
function Ao(e, { separator: t }) {
|
|
5408
|
+
return `${So}sep=${t}\r\n${e.map((e) => e.map((e) => Oo(e, t)).join(t)).join("\r\n")}\r\n`;
|
|
5400
5409
|
}
|
|
5401
|
-
async function
|
|
5410
|
+
async function jo(e) {
|
|
5402
5411
|
try {
|
|
5403
5412
|
return await navigator.clipboard.writeText(e), !0;
|
|
5404
5413
|
} catch {
|
|
5405
5414
|
return !1;
|
|
5406
5415
|
}
|
|
5407
5416
|
}
|
|
5408
|
-
function
|
|
5417
|
+
function Mo({ fileName: e, text: t, mimeType: n = "text/csv;charset=utf-8" }) {
|
|
5409
5418
|
let r = URL.createObjectURL(new Blob([t], { type: n })), i = document.createElement("a");
|
|
5410
5419
|
i.href = r, i.download = e, i.style.display = "none", document.body.append(i), i.click(), i.remove(), setTimeout(() => URL.revokeObjectURL(r), 0);
|
|
5411
5420
|
}
|
|
5412
5421
|
//#endregion
|
|
5413
5422
|
//#region src/tmdatagrid/core/rowPinning.ts
|
|
5414
|
-
function
|
|
5423
|
+
function No(e, t) {
|
|
5415
5424
|
let n = e.store.state.rowPinning[t];
|
|
5416
5425
|
if (n.length === 0) return [];
|
|
5417
5426
|
let r = e.getPrePaginatedRowModel().rowsById, i = e.getCoreRowModel().rowsById, a = [];
|
|
@@ -5423,17 +5432,17 @@ function Mo(e, t) {
|
|
|
5423
5432
|
}
|
|
5424
5433
|
//#endregion
|
|
5425
5434
|
//#region src/tmdatagrid/core/matchHighlight.ts
|
|
5426
|
-
var
|
|
5435
|
+
var Po = [
|
|
5427
5436
|
"contains",
|
|
5428
5437
|
"startsWith",
|
|
5429
5438
|
"endsWith"
|
|
5430
5439
|
];
|
|
5431
|
-
function
|
|
5440
|
+
function Fo(e) {
|
|
5432
5441
|
let t = e.store.state, n = typeof t.globalFilter == "string" ? t.globalFilter.trim() : "", r = /* @__PURE__ */ new Map();
|
|
5433
5442
|
for (let e of t.columnFilters) {
|
|
5434
5443
|
if (!vt(e.value)) continue;
|
|
5435
5444
|
let { operator: t, value: n } = e.value;
|
|
5436
|
-
if (!
|
|
5445
|
+
if (!Po.includes(t) || typeof n != "string" || n === "") continue;
|
|
5437
5446
|
let i = r.get(e.id) ?? [];
|
|
5438
5447
|
i.push(n), r.set(e.id, i);
|
|
5439
5448
|
}
|
|
@@ -5447,7 +5456,7 @@ function Po(e) {
|
|
|
5447
5456
|
}
|
|
5448
5457
|
return i.size > 0 ? i : null;
|
|
5449
5458
|
}
|
|
5450
|
-
function
|
|
5459
|
+
function Io(e, t) {
|
|
5451
5460
|
let n = e.toLowerCase(), r = [];
|
|
5452
5461
|
for (let e of t) {
|
|
5453
5462
|
let t = e.toLowerCase();
|
|
@@ -5469,26 +5478,26 @@ function Fo(e, t) {
|
|
|
5469
5478
|
}
|
|
5470
5479
|
//#endregion
|
|
5471
5480
|
//#region src/tmdatagrid/components/TMDataGridTable.tsx
|
|
5472
|
-
var
|
|
5481
|
+
var Lo = {
|
|
5473
5482
|
pinnedAt: !1,
|
|
5474
5483
|
offset: 0,
|
|
5475
5484
|
isBoundary: !1
|
|
5476
5485
|
};
|
|
5477
|
-
function
|
|
5486
|
+
function Ro(e, t) {
|
|
5478
5487
|
return e.querySelector(`[data-cell="true"][data-row-id="${CSS.escape(t.rowId)}"][data-column-id="${CSS.escape(t.columnId)}"]`);
|
|
5479
5488
|
}
|
|
5480
|
-
function
|
|
5489
|
+
function zo({ container: e, cellElement: t, leftPinnedWidth: n, rightPinnedWidth: r }) {
|
|
5481
5490
|
let i = t.getBoundingClientRect(), a = e.getBoundingClientRect(), o = a.left + n, s = a.right - r;
|
|
5482
5491
|
i.left < o ? e.scrollLeft -= o - i.left : i.right > s && (e.scrollLeft += i.right - s);
|
|
5483
5492
|
}
|
|
5484
|
-
function
|
|
5493
|
+
function Bo(e) {
|
|
5485
5494
|
if (e.getIsPlaceholder()) return null;
|
|
5486
5495
|
if (!e.getIsAggregated()) return Fe(e.column.columnDef.cell, e.getContext());
|
|
5487
5496
|
let { aggregatedCell: t, aggregationFn: n } = e.column.columnDef;
|
|
5488
5497
|
return t === void 0 ? n === void 0 ? null : Fe(e.column.columnDef.cell, e.getContext()) : Fe(t, e.getContext());
|
|
5489
5498
|
}
|
|
5490
|
-
function
|
|
5491
|
-
let n =
|
|
5499
|
+
function Vo(e, t) {
|
|
5500
|
+
let n = Io(e, t);
|
|
5492
5501
|
if (n === null) return e;
|
|
5493
5502
|
let r = [], i = 0;
|
|
5494
5503
|
for (let t of n) t.start > i && r.push(e.slice(i, t.start)), r.push(/* @__PURE__ */ q("mark", {
|
|
@@ -5497,11 +5506,11 @@ function Bo(e, t) {
|
|
|
5497
5506
|
}, t.start)), i = t.end;
|
|
5498
5507
|
return i < e.length && r.push(e.slice(i)), r;
|
|
5499
5508
|
}
|
|
5500
|
-
function
|
|
5509
|
+
function Ho(t) {
|
|
5501
5510
|
let n = e(59), { cell: r, rowHeight: i, layout: a, nav: o, editor: s, contentOverride: c, highlightNeedles: l, onFocus: u, onClick: d, onMouseDown: f, onMouseEnter: p, onDoubleClick: m, onContextMenu: h } = t, { table: g, edit: _ } = Q(), v;
|
|
5502
5511
|
n[0] === r.column ? v = n[1] : (v = Bt(r.column), n[0] = r.column, n[1] = v);
|
|
5503
5512
|
let y = v, b = r.row.id, x;
|
|
5504
|
-
n[2] === r.column.id ? x = n[3] : (x =
|
|
5513
|
+
n[2] === r.column.id ? x = n[3] : (x = Mn(r.column.id), n[2] = r.column.id, n[3] = x);
|
|
5505
5514
|
let S = x, C;
|
|
5506
5515
|
n[4] !== b || n[5] !== y ? (C = (e) => {
|
|
5507
5516
|
if (y === null) return !1;
|
|
@@ -5519,8 +5528,8 @@ function Vo(t) {
|
|
|
5519
5528
|
if (!S && !e.committedRowIds.includes(b) && !e.newRows.some((e) => e.tempId === b && e.committed)) return e.rows[b]?.values;
|
|
5520
5529
|
}, n[10] = b, n[11] = S, n[12] = D) : D = n[12];
|
|
5521
5530
|
let O = A(_.store, D), k = o ? "gridcell" : "cell", j = o?.columnIndex, M = o?.tabIndex, N = o ? !0 : void 0, P = r.row.id, F = r.column.id, I = o?.focused, L = o?.selected, R = o?.selected, z = o?.edges?.top, B = o?.edges?.bottom, V = o?.edges?.left, ee = o?.edges?.right, H = s !== void 0 || void 0, te = w || void 0, U = E || void 0, ne;
|
|
5522
|
-
n[13] === r.column ? ne = n[14] : (ne =
|
|
5523
|
-
let re = a.isBoundary && a.pinnedAt === "left" ?
|
|
5531
|
+
n[13] === r.column ? ne = n[14] : (ne = jn(r.column), n[13] = r.column, n[14] = ne);
|
|
5532
|
+
let re = a.isBoundary && a.pinnedAt === "left" ? ea.stickyLeft : "", ie = a.isBoundary && a.pinnedAt === "right" ? ea.stickyRight : "", ae;
|
|
5524
5533
|
n[15] !== re || n[16] !== ie ? (ae = [
|
|
5525
5534
|
$.bodyCell,
|
|
5526
5535
|
re,
|
|
@@ -5538,12 +5547,12 @@ function Vo(t) {
|
|
|
5538
5547
|
n[24] !== r || n[25] !== c || n[26] !== O || n[27] !== s || n[28] !== l || n[29] !== g ? (K = s ?? /* @__PURE__ */ q("span", {
|
|
5539
5548
|
className: $.cellContent,
|
|
5540
5549
|
children: (() => {
|
|
5541
|
-
let e = O !== void 0 && c === void 0 && !r.getIsPlaceholder() && !r.getIsAggregated() ?
|
|
5550
|
+
let e = O !== void 0 && c === void 0 && !r.getIsPlaceholder() && !r.getIsAggregated() ? _o(r, O) : void 0;
|
|
5542
5551
|
if (l !== void 0 && c === void 0 && !r.getIsPlaceholder() && !r.getIsAggregated() && r.column.columnDef.cell === g.getDefaultColumnDef().cell) {
|
|
5543
5552
|
let t = e === void 0 ? r.renderValue() : e.renderValue();
|
|
5544
|
-
if (typeof t == "string" || typeof t == "number") return
|
|
5553
|
+
if (typeof t == "string" || typeof t == "number") return Vo(String(t), l);
|
|
5545
5554
|
}
|
|
5546
|
-
return e === void 0 ? c ??
|
|
5555
|
+
return e === void 0 ? c ?? Bo(r) : Fe(r.column.columnDef.cell, e);
|
|
5547
5556
|
})()
|
|
5548
5557
|
}), n[24] = r, n[25] = c, n[26] = O, n[27] = s, n[28] = l, n[29] = g, n[30] = K) : K = n[30];
|
|
5549
5558
|
let ue;
|
|
@@ -5577,7 +5586,7 @@ function Vo(t) {
|
|
|
5577
5586
|
children: K
|
|
5578
5587
|
}), n[31] = r.column.id, n[32] = r.row.id, n[33] = S, n[34] = d, n[35] = h, n[36] = m, n[37] = u, n[38] = f, n[39] = p, n[40] = I, n[41] = L, n[42] = R, n[43] = z, n[44] = B, n[45] = V, n[46] = ee, n[47] = H, n[48] = te, n[49] = U, n[50] = ne, n[51] = oe, n[52] = G, n[53] = K, n[54] = k, n[55] = j, n[56] = M, n[57] = N, n[58] = ue) : ue = n[58], ue;
|
|
5579
5588
|
}
|
|
5580
|
-
function
|
|
5589
|
+
function Uo(t) {
|
|
5581
5590
|
let n = e(16), { enabled: r, menuContent: i, menuProps: a, onContextMenu: o, onClose: s, children: c } = t, l;
|
|
5582
5591
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (l = { display: "contents" }, n[0] = l) : l = n[0];
|
|
5583
5592
|
let u = r ? o : void 0, d;
|
|
@@ -5608,10 +5617,10 @@ function Ho(t) {
|
|
|
5608
5617
|
children: [h, _]
|
|
5609
5618
|
}), n[10] = a, n[11] = p, n[12] = m, n[13] = h, n[14] = _, n[15] = v) : v = n[15], v;
|
|
5610
5619
|
}
|
|
5611
|
-
function
|
|
5620
|
+
function Wo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContextMenu: o, rowClassName: l, rowStyle: u, striped: d = !1, onScrollToTop: p, onScrollToBottom: m, onScrollToLeft: _, onScrollToRight: v, renderEmptyState: y, renderRowContextMenu: b, renderColumnMenuItems: x, rowContextMenuProps: S, cellExport: C, onReachEnd: w, reachEndThreshold: E = 10, "aria-label": D, "aria-labelledby": O }) {
|
|
5612
5621
|
let { table: k, ui: j, edit: M, features: N, filters: P, labels: F, rowHeight: I, controlSize: L, renderDetails: R, renderDetailsEstHeight: z, overscan: B, scrollerRef: V } = Q();
|
|
5613
|
-
|
|
5614
|
-
let ee = A(j, (e) => e.highlightedRowId), H = A(j, (e) => e.focusedCell), te = A(j, (e) => e.cellRange), U = A(M.store, (e) => e.active), ne = A(M.store, (e) => e.openRowIds), re = A(M.store, (e) => e.newRows), ie = re.length, ae = A(M.store, (e) => e.deletedRowIds), oe = A(M.store, (e) => e.openRowIds.filter((t) => (e.rows[t]?.dirtyFields.length ?? 0) > 0)), W = A(M.store, (e) => e.committedRowIds), { loading: se, noResultsLabel: ce = F.noResults } = k.options.meta ?? {}, G = s(null), K = mn(k, N), de = N.matchHighlighting ?
|
|
5622
|
+
Pi(k.store);
|
|
5623
|
+
let ee = A(j, (e) => e.highlightedRowId), H = A(j, (e) => e.focusedCell), te = A(j, (e) => e.cellRange), U = A(M.store, (e) => e.active), ne = A(M.store, (e) => e.openRowIds), re = A(M.store, (e) => e.newRows), ie = re.length, ae = A(M.store, (e) => e.deletedRowIds), oe = A(M.store, (e) => e.openRowIds.filter((t) => (e.rows[t]?.dirtyFields.length ?? 0) > 0)), W = A(M.store, (e) => e.committedRowIds), { loading: se, noResultsLabel: ce = F.noResults } = k.options.meta ?? {}, G = s(null), K = mn(k, N), de = N.matchHighlighting ? Fo(k) : null, fe = N.rowPinning ? No(k, "top") : [], pe = N.rowPinning ? No(k, "bottom") : [], me = fe.length + pe.length, he = null;
|
|
5615
5624
|
if (N.rowNumbers) {
|
|
5616
5625
|
he = /* @__PURE__ */ new Map();
|
|
5617
5626
|
let e = hn(k, N) ? k.store.state.pagination.pageIndex * k.store.state.pagination.pageSize : 0;
|
|
@@ -5628,14 +5637,14 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5628
5637
|
t.delete(n);
|
|
5629
5638
|
continue;
|
|
5630
5639
|
}
|
|
5631
|
-
|
|
5640
|
+
ba(e, n) && (Sa({
|
|
5632
5641
|
table: k,
|
|
5633
5642
|
columnId: n,
|
|
5634
5643
|
container: e
|
|
5635
5644
|
}), t.delete(n));
|
|
5636
5645
|
}
|
|
5637
5646
|
});
|
|
5638
|
-
let ve = s(null), ye = P.inHeader &&
|
|
5647
|
+
let ve = s(null), ye = P.inHeader && Qr(k, N).canFilterAny, be = k.getCenterHeaderGroups().length, xe = s(null), [Se, Y] = c(0), [Ce, we] = c(0), [Te, Ee] = c(0);
|
|
5639
5648
|
i(() => {
|
|
5640
5649
|
let e = ve.current;
|
|
5641
5650
|
if (e === null) return;
|
|
@@ -5751,7 +5760,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5751
5760
|
offset: 0,
|
|
5752
5761
|
isBoundary: !1
|
|
5753
5762
|
});
|
|
5754
|
-
let Ze = (e) => Ke.get(e) ??
|
|
5763
|
+
let Ze = (e) => Ke.get(e) ?? Lo, Qe = s({
|
|
5755
5764
|
tracks: Ue,
|
|
5756
5765
|
leftLane: [],
|
|
5757
5766
|
rightLane: []
|
|
@@ -5766,7 +5775,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5766
5775
|
let e = ve.current;
|
|
5767
5776
|
if (!e) return;
|
|
5768
5777
|
let t = "", n = k.store.subscribe((n) => {
|
|
5769
|
-
let r =
|
|
5778
|
+
let r = go({
|
|
5770
5779
|
progress: n.columnResizing,
|
|
5771
5780
|
boundsOf: (e) => k.getColumn(e)?.columnDef ?? {},
|
|
5772
5781
|
...Qe.current
|
|
@@ -5833,8 +5842,8 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5833
5842
|
if (Ct === null) return;
|
|
5834
5843
|
mt.current = !0, j.actions.setFocusedCell(Ct);
|
|
5835
5844
|
let e = G.current;
|
|
5836
|
-
e !== null &&
|
|
5837
|
-
}, Tt = (e, t, n) => e !== null && e.rowId === t && e.columnId === n, Et =
|
|
5845
|
+
e !== null && Ro(e, Ct)?.focus({ preventScroll: !0 });
|
|
5846
|
+
}, Tt = (e, t, n) => e !== null && e.rowId === t && e.columnId === n, Et = vo({
|
|
5838
5847
|
range: pt ? te : null,
|
|
5839
5848
|
rowIndexOf: (e) => K.findIndex((t) => t.id === e),
|
|
5840
5849
|
columnIndexOf: (e) => Z.findIndex((t) => t.id === e)
|
|
@@ -5850,10 +5859,10 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5850
5859
|
bottom: yt,
|
|
5851
5860
|
left: bt,
|
|
5852
5861
|
right: bt
|
|
5853
|
-
} : null), kt =
|
|
5854
|
-
...
|
|
5862
|
+
} : null), kt = bo(Ot), At = Ot === null ? 0 : Z.slice(Ot.left, Ot.right + 1).filter((e) => !Mn(e.id)).length, jt = {
|
|
5863
|
+
...Co,
|
|
5855
5864
|
...C
|
|
5856
|
-
}, [Mt, Nt] = c(jt.includeHeaders), Pt = (e) => Ot === null ? [] :
|
|
5865
|
+
}, [Mt, Nt] = c(jt.includeHeaders), Pt = (e) => Ot === null ? [] : To({
|
|
5857
5866
|
rows: K,
|
|
5858
5867
|
columns: Z,
|
|
5859
5868
|
bounds: Ot,
|
|
@@ -5861,7 +5870,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5861
5870
|
decimalComma: jt.decimalComma
|
|
5862
5871
|
}), Ft = async () => {
|
|
5863
5872
|
let e = Pt(!1);
|
|
5864
|
-
e.length !== 0 && await
|
|
5873
|
+
e.length !== 0 && await jo(ko(e));
|
|
5865
5874
|
}, [It, Lt] = c(!1);
|
|
5866
5875
|
i(() => {
|
|
5867
5876
|
if (!It) return;
|
|
@@ -5872,9 +5881,9 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5872
5881
|
j.actions.setFocusedCell(e), Dt(e, { extend: t }), t || Lt(!0);
|
|
5873
5882
|
}, zt = (e) => {
|
|
5874
5883
|
let t = Pt(e);
|
|
5875
|
-
t.length !== 0 &&
|
|
5884
|
+
t.length !== 0 && Mo({
|
|
5876
5885
|
fileName: `${jt.fileName}.csv`,
|
|
5877
|
-
text:
|
|
5886
|
+
text: Ao(t, { separator: jt.separator })
|
|
5878
5887
|
});
|
|
5879
5888
|
}, Bt = (e, { extend: t } = { extend: !1 }) => {
|
|
5880
5889
|
let n = K[e.rowIndex], r = Z[e.columnIndex];
|
|
@@ -5909,11 +5918,11 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5909
5918
|
return;
|
|
5910
5919
|
}
|
|
5911
5920
|
let n = e.querySelector(`[data-dg-part="editor"][data-row-id="${CSS.escape(U.rowId)}"][data-column-id="${CSS.escape(t)}"]`);
|
|
5912
|
-
n !== null && (Wt.current = U,
|
|
5921
|
+
n !== null && (Wt.current = U, Ba(n));
|
|
5913
5922
|
});
|
|
5914
5923
|
let Gt = (e) => {
|
|
5915
5924
|
let t = G.current;
|
|
5916
|
-
t !== null && (mt.current = !0,
|
|
5925
|
+
t !== null && (mt.current = !0, Ro(t, e)?.focus());
|
|
5917
5926
|
}, Kt = (e) => {
|
|
5918
5927
|
ft && j.actions.setFocusedCell(e), M.begin({
|
|
5919
5928
|
rowId: e.rowId,
|
|
@@ -5937,7 +5946,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5937
5946
|
}) : Gt(e);
|
|
5938
5947
|
return;
|
|
5939
5948
|
}
|
|
5940
|
-
let a =
|
|
5949
|
+
let a = ti({
|
|
5941
5950
|
from: {
|
|
5942
5951
|
rowIndex: r,
|
|
5943
5952
|
columnIndex: i
|
|
@@ -5973,7 +5982,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5973
5982
|
if (n === null) return;
|
|
5974
5983
|
if (e.key === "Tab") {
|
|
5975
5984
|
if (t.dataset.cell !== "true") {
|
|
5976
|
-
let r = n.closest("[data-dg-part=\"row\"]"), i = r === null ? [] : Array.from(r.querySelectorAll(
|
|
5985
|
+
let r = n.closest("[data-dg-part=\"row\"]"), i = r === null ? [] : Array.from(r.querySelectorAll(za)).filter((e) => e.tabIndex >= 0), a = i.indexOf(t);
|
|
5977
5986
|
if (a < 0) return;
|
|
5978
5987
|
let o = i[a + (e.shiftKey ? -1 : 1)];
|
|
5979
5988
|
if (o !== void 0) {
|
|
@@ -5986,7 +5995,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5986
5995
|
rowIndex: c,
|
|
5987
5996
|
columnIndex: e.shiftKey ? Z.length - 1 : 0
|
|
5988
5997
|
});
|
|
5989
|
-
let n = G.current, r = n === null ? null :
|
|
5998
|
+
let n = G.current, r = n === null ? null : Ro(n, {
|
|
5990
5999
|
rowId: l.id,
|
|
5991
6000
|
columnId: u.id
|
|
5992
6001
|
});
|
|
@@ -6041,7 +6050,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6041
6050
|
}
|
|
6042
6051
|
}
|
|
6043
6052
|
if (e.key === "Enter" || e.key === "F2") {
|
|
6044
|
-
let n = t.querySelector(
|
|
6053
|
+
let n = t.querySelector(za);
|
|
6045
6054
|
if (n === null) return;
|
|
6046
6055
|
e.preventDefault(), n.focus();
|
|
6047
6056
|
return;
|
|
@@ -6060,7 +6069,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6060
6069
|
t && Jt(t, { extend: e.shiftKey });
|
|
6061
6070
|
return;
|
|
6062
6071
|
}
|
|
6063
|
-
let l =
|
|
6072
|
+
let l = ei({
|
|
6064
6073
|
key: e.key,
|
|
6065
6074
|
ctrlKey: e.ctrlKey || e.metaKey,
|
|
6066
6075
|
from: {
|
|
@@ -6082,8 +6091,8 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6082
6091
|
return;
|
|
6083
6092
|
}
|
|
6084
6093
|
if (!mt.current && !e.contains(document.activeElement) || !mt.current && document.activeElement instanceof Element && document.activeElement.closest("[data-dg-part=\"tab-guard\"]") !== null) return;
|
|
6085
|
-
let t =
|
|
6086
|
-
t !== null && (mt.current = !1, !t.contains(document.activeElement) && (document.activeElement instanceof Element && document.activeElement.closest("[data-dg-part=\"editor\"]") !== null || (t.focus({ preventScroll: !0 }), Ze(H.columnId).pinnedAt === !1 &&
|
|
6094
|
+
let t = Ro(e, H);
|
|
6095
|
+
t !== null && (mt.current = !1, !t.contains(document.activeElement) && (document.activeElement instanceof Element && document.activeElement.closest("[data-dg-part=\"editor\"]") !== null || (t.focus({ preventScroll: !0 }), Ze(H.columnId).pinnedAt === !1 && zo({
|
|
6087
6096
|
container: e,
|
|
6088
6097
|
cellElement: t,
|
|
6089
6098
|
leftPinnedWidth: Je,
|
|
@@ -6094,7 +6103,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6094
6103
|
let e = $t.current, t = en.current;
|
|
6095
6104
|
if ($t.current = null, en.current = null, ft && e !== null && t !== null) {
|
|
6096
6105
|
let n = K.findIndex((t) => t.id === e), r = Z.findIndex((e) => e.id === t);
|
|
6097
|
-
n >= 0 && !
|
|
6106
|
+
n >= 0 && !yo(Ot, n, r) && (j.actions.setFocusedCell({
|
|
6098
6107
|
rowId: e,
|
|
6099
6108
|
columnId: t
|
|
6100
6109
|
}), Dt({
|
|
@@ -6191,13 +6200,13 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6191
6200
|
role: "row",
|
|
6192
6201
|
"aria-rowindex": t + 1,
|
|
6193
6202
|
"data-dg-header-row": !0,
|
|
6194
|
-
className: [$.headerRow, !ye && t === Ve.length - 1 ?
|
|
6195
|
-
children: e.headers.map((e) => /* @__PURE__ */ q(
|
|
6203
|
+
className: [$.headerRow, !ye && t === Ve.length - 1 ? ea.headerBoundary : ""].filter(Boolean).join(" "),
|
|
6204
|
+
children: e.headers.map((e) => /* @__PURE__ */ q(Aa, {
|
|
6196
6205
|
renderColumnMenuItems: x,
|
|
6197
6206
|
header: e,
|
|
6198
6207
|
layout: Ze(e.column.id)
|
|
6199
6208
|
}, e.id))
|
|
6200
|
-
}, e.id)), ye && /* @__PURE__ */ q(
|
|
6209
|
+
}, e.id)), ye && /* @__PURE__ */ q(pa, {
|
|
6201
6210
|
leafHeaders: nt,
|
|
6202
6211
|
layoutFor: Ze,
|
|
6203
6212
|
ariaRowIndex: it
|
|
@@ -6212,12 +6221,12 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6212
6221
|
className: $.tabGuard,
|
|
6213
6222
|
onFocus: wt
|
|
6214
6223
|
}),
|
|
6215
|
-
N.editing && ie > 0 && /* @__PURE__ */ q(
|
|
6224
|
+
N.editing && ie > 0 && /* @__PURE__ */ q(io, {
|
|
6216
6225
|
orderedColumns: Z,
|
|
6217
6226
|
layoutFor: Ze,
|
|
6218
6227
|
rowHeight: I
|
|
6219
6228
|
}),
|
|
6220
|
-
/* @__PURE__ */ q(
|
|
6229
|
+
/* @__PURE__ */ q(Uo, {
|
|
6221
6230
|
enabled: b !== void 0 || pt,
|
|
6222
6231
|
menuContent: cn,
|
|
6223
6232
|
menuProps: S,
|
|
@@ -6277,13 +6286,13 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6277
6286
|
} : void 0,
|
|
6278
6287
|
children: [l.map((i, a) => {
|
|
6279
6288
|
let c = U !== null && U.rowId === e.id && U.columnId === i.column.id || u && M.canEditCell(e, i.column);
|
|
6280
|
-
return /* @__PURE__ */ q(
|
|
6289
|
+
return /* @__PURE__ */ q(Ho, {
|
|
6281
6290
|
cell: i,
|
|
6282
6291
|
rowHeight: I,
|
|
6283
6292
|
layout: Ze(i.column.id),
|
|
6284
6293
|
contentOverride: he !== null && i.column.id === "__rowNumber__" ? he.get(e.id) : void 0,
|
|
6285
6294
|
highlightNeedles: de?.get(i.column.id),
|
|
6286
|
-
editor: c ? /* @__PURE__ */ q(
|
|
6295
|
+
editor: c ? /* @__PURE__ */ q(no, {
|
|
6287
6296
|
cell: i,
|
|
6288
6297
|
row: e,
|
|
6289
6298
|
takeSeedText: Ht,
|
|
@@ -6304,8 +6313,8 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6304
6313
|
columnIndex: a + 1,
|
|
6305
6314
|
focused: Tt(H, e.id, i.column.id),
|
|
6306
6315
|
tabIndex: -1,
|
|
6307
|
-
selected: pt ?
|
|
6308
|
-
edges:
|
|
6316
|
+
selected: pt ? yo(Et, n, a) : Tt(H, e.id, i.column.id),
|
|
6317
|
+
edges: xo(Et, n, a)
|
|
6309
6318
|
} : void 0,
|
|
6310
6319
|
onFocus: ft ? () => j.actions.setFocusedCell({
|
|
6311
6320
|
rowId: e.id,
|
|
@@ -6313,7 +6322,7 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6313
6322
|
}) : void 0,
|
|
6314
6323
|
onMouseDown: pt ? (t) => {
|
|
6315
6324
|
if (t.button !== 0) return;
|
|
6316
|
-
let n = t.target, r = n === t.currentTarget ? null : n.closest(
|
|
6325
|
+
let n = t.target, r = n === t.currentTarget ? null : n.closest(za);
|
|
6317
6326
|
r !== null && t.currentTarget.contains(r) || (t.shiftKey && t.preventDefault(), mt.current = !0, Rt({
|
|
6318
6327
|
rowId: e.id,
|
|
6319
6328
|
columnId: i.column.id
|
|
@@ -6416,12 +6425,12 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6416
6425
|
return /* @__PURE__ */ q("div", {
|
|
6417
6426
|
role: "cell",
|
|
6418
6427
|
"data-column-id": e.column.id,
|
|
6419
|
-
"data-align":
|
|
6420
|
-
"data-control-column":
|
|
6428
|
+
"data-align": jn(e.column),
|
|
6429
|
+
"data-control-column": Mn(e.column.id),
|
|
6421
6430
|
className: [
|
|
6422
6431
|
$.summaryCell,
|
|
6423
|
-
t.isBoundary && t.pinnedAt === "left" ?
|
|
6424
|
-
t.isBoundary && t.pinnedAt === "right" ?
|
|
6432
|
+
t.isBoundary && t.pinnedAt === "left" ? ea.stickyLeft : "",
|
|
6433
|
+
t.isBoundary && t.pinnedAt === "right" ? ea.stickyRight : ""
|
|
6425
6434
|
].filter(Boolean).join(" "),
|
|
6426
6435
|
style: {
|
|
6427
6436
|
minHeight: I,
|
|
@@ -6449,31 +6458,31 @@ function Uo({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
6449
6458
|
]
|
|
6450
6459
|
})
|
|
6451
6460
|
}),
|
|
6452
|
-
P.surface === "popup" && /* @__PURE__ */ q(
|
|
6453
|
-
P.surface === "sidebar" && /* @__PURE__ */ q(
|
|
6461
|
+
P.surface === "popup" && /* @__PURE__ */ q(aa, {}),
|
|
6462
|
+
P.surface === "sidebar" && /* @__PURE__ */ q(sa, {})
|
|
6454
6463
|
]
|
|
6455
6464
|
});
|
|
6456
6465
|
}
|
|
6457
|
-
var
|
|
6466
|
+
var Go = {
|
|
6458
6467
|
toolbar: "_toolbar_1459c_1",
|
|
6459
6468
|
toolbarSpacer: "_toolbarSpacer_1459c_10",
|
|
6460
6469
|
summaryCount: "_summaryCount_1459c_14"
|
|
6461
6470
|
};
|
|
6462
6471
|
//#endregion
|
|
6463
6472
|
//#region src/tmdatagrid/components/TMDataGridToolbar.tsx
|
|
6464
|
-
function
|
|
6473
|
+
function Ko(t) {
|
|
6465
6474
|
let n = e(2), { children: r } = t, i;
|
|
6466
6475
|
return n[0] === r ? i = n[1] : (i = /* @__PURE__ */ q("div", {
|
|
6467
6476
|
"data-dg-part": "toolbar",
|
|
6468
|
-
className:
|
|
6477
|
+
className: Go.toolbar,
|
|
6469
6478
|
children: r
|
|
6470
6479
|
}), n[0] = r, n[1] = i), i;
|
|
6471
6480
|
}
|
|
6472
|
-
function
|
|
6481
|
+
function qo() {
|
|
6473
6482
|
let t = e(1), n;
|
|
6474
|
-
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ q("div", { className:
|
|
6483
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ q("div", { className: Go.toolbarSpacer }), t[0] = n) : n = t[0], n;
|
|
6475
6484
|
}
|
|
6476
|
-
function
|
|
6485
|
+
function Jo() {
|
|
6477
6486
|
let t = e(2), { table: n, labels: r } = Q();
|
|
6478
6487
|
if (n.options.meta?.loading !== !0) return null;
|
|
6479
6488
|
let i;
|
|
@@ -6483,9 +6492,9 @@ function qo() {
|
|
|
6483
6492
|
"aria-label": r.loading
|
|
6484
6493
|
}), t[0] = r.loading, t[1] = i), i;
|
|
6485
6494
|
}
|
|
6486
|
-
function
|
|
6495
|
+
function Yo(t) {
|
|
6487
6496
|
let n = e(8), { children: r } = t, { table: i, controlSize: a } = Q();
|
|
6488
|
-
|
|
6497
|
+
Pi(i.store);
|
|
6489
6498
|
let o = i.options.manualFiltering === !0 || i.options.manualPagination === !0, s;
|
|
6490
6499
|
n[0] === i ? s = n[1] : (s = i.getRowCount(), n[0] = i, n[1] = s);
|
|
6491
6500
|
let c = s, l;
|
|
@@ -6495,22 +6504,22 @@ function Jo(t) {
|
|
|
6495
6504
|
span: !0,
|
|
6496
6505
|
size: a,
|
|
6497
6506
|
c: "dimmed",
|
|
6498
|
-
className:
|
|
6507
|
+
className: Go.summaryCount,
|
|
6499
6508
|
"data-dg-part": "summary-count",
|
|
6500
6509
|
children: d
|
|
6501
6510
|
}), n[5] = a, n[6] = d, n[7] = f) : f = n[7], f;
|
|
6502
6511
|
}
|
|
6503
|
-
function
|
|
6504
|
-
let t = e(16), n = Q(), { table: r, ui: i, features: a, filters: o, labels: s, controlSize: c } = n, u = A(i,
|
|
6505
|
-
if (!
|
|
6512
|
+
function Xo() {
|
|
6513
|
+
let t = e(16), n = Q(), { table: r, ui: i, features: a, filters: o, labels: s, controlSize: c } = n, u = A(i, es), d = A(r.store, $o), f = d.filter(Qo).length;
|
|
6514
|
+
if (!Qr(r, a).canFilterAny || o.surface === "none") return null;
|
|
6506
6515
|
let p = u || f > 0 ? "light" : "subtle", m = f > 0 ? void 0 : "gray", h;
|
|
6507
6516
|
t[0] !== n || t[1] !== d.length || t[2] !== u || t[3] !== r || t[4] !== i.actions ? (h = () => {
|
|
6508
6517
|
if (u) {
|
|
6509
6518
|
i.actions.closeFilterPanel();
|
|
6510
6519
|
return;
|
|
6511
6520
|
}
|
|
6512
|
-
let e = d.length === 0 ? r.getAllLeafColumns().find(
|
|
6513
|
-
e &&
|
|
6521
|
+
let e = d.length === 0 ? r.getAllLeafColumns().find(Zo) : void 0;
|
|
6522
|
+
e && Di(n, e.id), i.actions.openFilterPanel(e?.id ?? null);
|
|
6514
6523
|
}, t[0] = n, t[1] = d.length, t[2] = u, t[3] = r, t[4] = i.actions, t[5] = h) : h = t[5];
|
|
6515
6524
|
let g;
|
|
6516
6525
|
t[6] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ q(U, {
|
|
@@ -6534,27 +6543,27 @@ function Yo() {
|
|
|
6534
6543
|
children: _
|
|
6535
6544
|
}), t[13] = s.filters, t[14] = _, t[15] = v) : v = t[15], v;
|
|
6536
6545
|
}
|
|
6537
|
-
function
|
|
6546
|
+
function Zo(e) {
|
|
6538
6547
|
return e.getCanFilter();
|
|
6539
6548
|
}
|
|
6540
|
-
function
|
|
6549
|
+
function Qo(e) {
|
|
6541
6550
|
return bt(e.value);
|
|
6542
6551
|
}
|
|
6543
|
-
function
|
|
6552
|
+
function $o(e) {
|
|
6544
6553
|
return e.columnFilters;
|
|
6545
6554
|
}
|
|
6546
|
-
function
|
|
6555
|
+
function es(e) {
|
|
6547
6556
|
return e.filterPanelOpen;
|
|
6548
6557
|
}
|
|
6549
6558
|
//#endregion
|
|
6550
6559
|
//#region src/tmdatagrid/core/sizes.ts
|
|
6551
|
-
var
|
|
6560
|
+
var ts = "md", ns = {
|
|
6552
6561
|
xs: 34,
|
|
6553
6562
|
sm: 42,
|
|
6554
6563
|
md: 52,
|
|
6555
6564
|
lg: 62,
|
|
6556
6565
|
xl: 72
|
|
6557
|
-
},
|
|
6566
|
+
}, rs = {
|
|
6558
6567
|
xs: "xs",
|
|
6559
6568
|
sm: "xs",
|
|
6560
6569
|
md: "sm",
|
|
@@ -6563,8 +6572,8 @@ var es = "md", ts = {
|
|
|
6563
6572
|
};
|
|
6564
6573
|
//#endregion
|
|
6565
6574
|
//#region src/tmdatagrid/components/TMDataGrid.tsx
|
|
6566
|
-
function
|
|
6567
|
-
let n = e(28), { table: r, ui: i, edit: a, features: o, filters: s, labels: c, renderDetails: l, renderDetailsEstHeight: u, overscan: d, resetSettings: f, scrollToRow: p, scrollerRef: m, size: h, children: g, className: _, style: v, id: y, "data-testid": b } = t, x = h === void 0 ? "md" : h, S = r.options.meta?.rowHeight ??
|
|
6575
|
+
function is(t) {
|
|
6576
|
+
let n = e(28), { table: r, ui: i, edit: a, features: o, filters: s, labels: c, renderDetails: l, renderDetailsEstHeight: u, overscan: d, resetSettings: f, scrollToRow: p, scrollerRef: m, size: h, children: g, className: _, style: v, id: y, "data-testid": b } = t, x = h === void 0 ? "md" : h, S = r.options.meta?.rowHeight ?? ns[x], C = rs[x], w;
|
|
6568
6577
|
n[0] !== a || n[1] !== o || n[2] !== s || n[3] !== c || n[4] !== d || n[5] !== l || n[6] !== u || n[7] !== f || n[8] !== S || n[9] !== p || n[10] !== m || n[11] !== x || n[12] !== C || n[13] !== r || n[14] !== i ? (w = {
|
|
6569
6578
|
table: r,
|
|
6570
6579
|
ui: i,
|
|
@@ -6600,28 +6609,28 @@ function rs(t) {
|
|
|
6600
6609
|
children: O
|
|
6601
6610
|
}), n[25] = T, n[26] = O, n[27] = k) : k = n[27], k;
|
|
6602
6611
|
}
|
|
6603
|
-
var
|
|
6604
|
-
Toolbar:
|
|
6605
|
-
Spacer:
|
|
6606
|
-
SummaryCount:
|
|
6607
|
-
LoadingIndicator:
|
|
6608
|
-
Search:
|
|
6609
|
-
DraftActions:
|
|
6610
|
-
Menu:
|
|
6611
|
-
FilterButton:
|
|
6612
|
-
Table:
|
|
6613
|
-
Footer:
|
|
6614
|
-
FilterPanel:
|
|
6615
|
-
FilterPills:
|
|
6616
|
-
ColumnsPanel:
|
|
6612
|
+
var as = Object.assign(is, {
|
|
6613
|
+
Toolbar: Ko,
|
|
6614
|
+
Spacer: qo,
|
|
6615
|
+
SummaryCount: Yo,
|
|
6616
|
+
LoadingIndicator: Jo,
|
|
6617
|
+
Search: Qi,
|
|
6618
|
+
DraftActions: Xn,
|
|
6619
|
+
Menu: Zi,
|
|
6620
|
+
FilterButton: Xo,
|
|
6621
|
+
Table: Wo,
|
|
6622
|
+
Footer: Ui,
|
|
6623
|
+
FilterPanel: fr,
|
|
6624
|
+
FilterPills: ki,
|
|
6625
|
+
ColumnsPanel: Rn
|
|
6617
6626
|
});
|
|
6618
6627
|
//#endregion
|
|
6619
6628
|
//#region src/tmdatagrid/components/filters/DgRangeSliderFilter.tsx
|
|
6620
|
-
function
|
|
6629
|
+
function os(t) {
|
|
6621
6630
|
let n = e(26), { column: r, operator: i, value: a, onChange: o, size: s, labels: c } = t;
|
|
6622
6631
|
if (!gt(i)) {
|
|
6623
6632
|
let e;
|
|
6624
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ q(
|
|
6633
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ q(ar, { ...t }), n[0] = t, n[1] = e), e;
|
|
6625
6634
|
}
|
|
6626
6635
|
let l;
|
|
6627
6636
|
if (n[2] !== r) {
|
|
@@ -6635,7 +6644,7 @@ function as(t) {
|
|
|
6635
6644
|
let u = l.length > 0 ? Math.min(...l) : 0, d = l.length > 0 ? Math.max(...l) : 100, f;
|
|
6636
6645
|
n[4] === a ? f = n[5] : (f = Array.isArray(a) ? a : ["", ""], n[4] = a, n[5] = f);
|
|
6637
6646
|
let p = f, h = p[0] === void 0 || p[0] === "" ? u : Number(p[0]), g = p[1] === void 0 || p[1] === "" ? d : Number(p[1]), _;
|
|
6638
|
-
n[6] !== t || n[7] !== c.filterValue ? (_ =
|
|
6647
|
+
n[6] !== t || n[7] !== c.filterValue ? (_ = ir(t, {
|
|
6639
6648
|
label: c.filterValue,
|
|
6640
6649
|
width: 180
|
|
6641
6650
|
}), n[6] = t, n[7] = c.filterValue, n[8] = _) : _ = n[8];
|
|
@@ -6667,16 +6676,16 @@ function as(t) {
|
|
|
6667
6676
|
}
|
|
6668
6677
|
//#endregion
|
|
6669
6678
|
//#region src/tmdatagrid/components/filters/DgDateRangeFilter.tsx
|
|
6670
|
-
function
|
|
6679
|
+
function ss(t) {
|
|
6671
6680
|
let n = e(32), { operator: r, value: i, onChange: a, size: o, labels: s } = t;
|
|
6672
6681
|
if (!gt(r)) {
|
|
6673
6682
|
let e;
|
|
6674
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ q(
|
|
6683
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ q(ar, { ...t }), n[0] = t, n[1] = e), e;
|
|
6675
6684
|
}
|
|
6676
6685
|
let c = t.layout !== "row", l;
|
|
6677
6686
|
n[2] === i ? l = n[3] : (l = Array.isArray(i) ? [String(i[0] ?? ""), String(i[1] ?? "")] : ["", ""], n[2] = i, n[3] = l);
|
|
6678
6687
|
let u = l, d = c ? "100%" : void 0, f;
|
|
6679
|
-
n[4] !== t || n[5] !== s.filterFrom ? (f =
|
|
6688
|
+
n[4] !== t || n[5] !== s.filterFrom ? (f = ir(t, {
|
|
6680
6689
|
label: s.filterFrom,
|
|
6681
6690
|
width: 88
|
|
6682
6691
|
}, s.filterFrom), n[4] = t, n[5] = s.filterFrom, n[6] = f) : f = n[6];
|
|
@@ -6693,7 +6702,7 @@ function os(t) {
|
|
|
6693
6702
|
onChange: h
|
|
6694
6703
|
}), n[10] = u[0], n[11] = o, n[12] = f, n[13] = m, n[14] = h, n[15] = g) : g = n[15];
|
|
6695
6704
|
let _;
|
|
6696
|
-
n[16] !== t || n[17] !== s.filterTo ? (_ =
|
|
6705
|
+
n[16] !== t || n[17] !== s.filterTo ? (_ = ir(t, {
|
|
6697
6706
|
label: s.filterTo,
|
|
6698
6707
|
width: 88
|
|
6699
6708
|
}, s.filterTo), n[16] = t, n[17] = s.filterTo, n[18] = _) : _ = n[18];
|
|
@@ -6720,27 +6729,27 @@ function os(t) {
|
|
|
6720
6729
|
}
|
|
6721
6730
|
//#endregion
|
|
6722
6731
|
//#region src/tmdatagrid/components/filters/DgAutocompleteFilter.tsx
|
|
6723
|
-
function
|
|
6732
|
+
function cs(t) {
|
|
6724
6733
|
let n = e(21), { column: r, table: i, operator: a, value: o, onChange: s, options: c, size: l, labels: d } = t;
|
|
6725
6734
|
if (ht(a) || gt(a)) {
|
|
6726
6735
|
let e;
|
|
6727
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ q(
|
|
6736
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ q(ar, { ...t }), n[0] = t, n[1] = e), e;
|
|
6728
6737
|
}
|
|
6729
6738
|
let f;
|
|
6730
6739
|
n[2] === a ? f = n[3] : (f = mt(a), n[2] = a, n[3] = f);
|
|
6731
6740
|
let p = f, m;
|
|
6732
|
-
n[4] !== r || n[5] !== c || n[6] !== i ? (m = c.length > 0 ? c :
|
|
6741
|
+
n[4] !== r || n[5] !== c || n[6] !== i ? (m = c.length > 0 ? c : nr({
|
|
6733
6742
|
table: i,
|
|
6734
6743
|
column: r,
|
|
6735
6744
|
fallback: "faceted"
|
|
6736
6745
|
}), n[4] = r, n[5] = c, n[6] = i, n[7] = m) : m = n[7];
|
|
6737
6746
|
let h = m, g;
|
|
6738
|
-
n[8] !== t || n[9] !== d.filterValue ? (g =
|
|
6747
|
+
n[8] !== t || n[9] !== d.filterValue ? (g = ir(t, {
|
|
6739
6748
|
label: d.filterValue,
|
|
6740
6749
|
width: 180
|
|
6741
6750
|
}), n[8] = t, n[9] = d.filterValue, n[10] = g) : g = n[10];
|
|
6742
6751
|
let _ = !p, v = p && t.layout !== "header" ? d.filterValuePlaceholder : "", y;
|
|
6743
|
-
n[11] === h ? y = n[12] : (y = h.map(
|
|
6752
|
+
n[11] === h ? y = n[12] : (y = h.map(ls), n[11] = h, n[12] = y);
|
|
6744
6753
|
let b = p && typeof o == "string" ? o : "", x;
|
|
6745
6754
|
return n[13] !== s || n[14] !== l || n[15] !== g || n[16] !== _ || n[17] !== v || n[18] !== y || n[19] !== b ? (x = /* @__PURE__ */ q(u, {
|
|
6746
6755
|
...g,
|
|
@@ -6753,21 +6762,21 @@ function ss(t) {
|
|
|
6753
6762
|
onChange: s
|
|
6754
6763
|
}), n[13] = s, n[14] = l, n[15] = g, n[16] = _, n[17] = v, n[18] = y, n[19] = b, n[20] = x) : x = n[20], x;
|
|
6755
6764
|
}
|
|
6756
|
-
function
|
|
6765
|
+
function ls(e) {
|
|
6757
6766
|
return e.value;
|
|
6758
6767
|
}
|
|
6759
6768
|
//#endregion
|
|
6760
6769
|
//#region src/tmdatagrid/components/filters/DgTriStateFilter.tsx
|
|
6761
|
-
function
|
|
6770
|
+
function us(t) {
|
|
6762
6771
|
let n = e(29), { operator: r, value: i, onChange: a, size: o, labels: s } = t;
|
|
6763
6772
|
if (ht(r) || gt(r)) {
|
|
6764
6773
|
let e;
|
|
6765
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ q(
|
|
6774
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ q(ar, { ...t }), n[0] = t, n[1] = e), e;
|
|
6766
6775
|
}
|
|
6767
6776
|
let c;
|
|
6768
6777
|
n[2] === r ? c = n[3] : (c = mt(r), n[2] = r, n[3] = c);
|
|
6769
6778
|
let l = c, u = typeof i == "string" ? i : "", d;
|
|
6770
|
-
n[4] !== t || n[5] !== s.filterValue ? (d =
|
|
6779
|
+
n[4] !== t || n[5] !== s.filterValue ? (d = ir(t, { label: s.filterValue }), n[4] = t, n[5] = s.filterValue, n[6] = d) : d = n[6];
|
|
6771
6780
|
let f = !l, p;
|
|
6772
6781
|
n[7] === s.filterAll ? p = n[8] : (p = {
|
|
6773
6782
|
value: "all",
|
|
@@ -6808,7 +6817,7 @@ function ls(t) {
|
|
|
6808
6817
|
}
|
|
6809
6818
|
//#endregion
|
|
6810
6819
|
//#region src/tmdatagrid/core/labelsSv.ts
|
|
6811
|
-
var
|
|
6820
|
+
var ds = {
|
|
6812
6821
|
operators: {
|
|
6813
6822
|
contains: "innehåller",
|
|
6814
6823
|
equals: "är lika med",
|
|
@@ -6923,11 +6932,11 @@ var us = {
|
|
|
6923
6932
|
};
|
|
6924
6933
|
//#endregion
|
|
6925
6934
|
//#region src/tmdatagrid/core/summary.ts
|
|
6926
|
-
function
|
|
6935
|
+
function fs({ table: e, columnId: t, fn: n = "sum" }) {
|
|
6927
6936
|
let r = e.getFilteredRowModel().flatRows;
|
|
6928
6937
|
return ve[n](t, r, r);
|
|
6929
6938
|
}
|
|
6930
6939
|
//#endregion
|
|
6931
|
-
export {
|
|
6940
|
+
export { Er as DATA_STATE_SLICES, Co as DEFAULT_CELL_EXPORT_OPTIONS, ts as DEFAULT_TMDATAGRID_SIZE, Nt as DETAILS_COLUMN_ID, cs as DgAutocompleteFilter, ss as DgDateRangeFilter, os as DgRangeSliderFilter, us as DgTriStateFilter, Zt as EDIT_COLUMN_ID, tt as FILTER_OPERATOR_LABELS, rn as GROUP_COLUMN_ID, Or as PERSIST_PAYLOAD_VERSION, fn as ROW_NUMBER_COLUMN_ID, vn as SELECT_COLUMN_ID, Dr as SETTINGS_STATE_SLICES, rs as SIZE_CONTROL_SIZE, ns as SIZE_ROW_HEIGHT, wr as TMDATAGRID_LABELS_EN, ds as TMDATAGRID_LABELS_SV, as as TMDataGrid, Ya as TMDataGridBooleanEditor, Xa as TMDataGridDateEditor, Xn as TMDataGridDraftActions, ki as TMDataGridFilterPills, ar as TMDataGridFilterValueInput, Za as TMDataGridMultiSelectEditor, Qa as TMDataGridNumberEditor, Qi as TMDataGridSearch, $a as TMDataGridSelectEditor, eo as TMDataGridStringEditor, xt as activeColumnFilters, fs as aggregateColumn, jt as areAllRowsExpanded, Sa as autosizeColumn, bo as boundsCellCount, xo as boundsEdges, To as buildCellMatrix, Eo as buildGridCellMatrix, Vt as clearedValueForType, bi as createTMDataGridColumnHelper, Mo as downloadTextFile, _t as emptyValueForOperator, Do as exportGridToCsv, yt as filterValueShape, wo as formatExportValue, St as formatFilterLabel, sn as formatGroupValue, br as fuzzyGlobalFilterFn, Zr as getColumnCapabilities, Dn as getColumnDefaultOperator, On as getColumnFilterControl, wn as getColumnLabel, En as getColumnOperators, Ca as getColumnRegion, Tn as getColumnType, pt as getDefaultOperator, mn as getDisplayedRows, Bt as getEditFieldName, Qr as getGridCapabilities, nn as getGroupDataRows, ft as getOperatorsForType, gn as getSelectableRowIds, Oa as getStepTargetColumn, Ii as getTMDataGridPaginationApi, An as isColumnEditableForRow, Pn as isColumnReorderable, Mn as isControlColumn, bt as isFilterActive, Nn as isGeneratedColumn, hn as isPagingActive, ni as isSameCell, yo as isWithinBounds, Ea as keepGeneratedColumnsOutermost, xa as measureColumnContentWidth, Tr as mergeLabels, Ta as moveColumn, ka as moveColumnByStep, Xt as normalizeFieldValidate, Oi as openColumnFilter, mt as operatorNeedsValue, ht as operatorTakesArrayValue, gt as operatorTakesRangeValue, rr as optionsToComboboxData, Xr as readFeatureFlags, ei as resolveCellMove, nr as resolveColumnOptions, Mt as resolveExpandAll, vo as resolveRangeBounds, _n as resolveRowSelectionClick, yi as tmDataGridFeatures, ko as toClipboardText, Ao as toExcelCsv, Ei as useTMDataGrid, Q as useTMDataGridContext, jo as writeClipboardText };
|
|
6932
6941
|
|
|
6933
6942
|
//# sourceMappingURL=index.js.map
|