@espresso-lab/mantine-data-table 1.0.23 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4611,7 +4611,7 @@ ${new this._window.XMLSerializer().serializeToString(p)}`;
4611
4611
  }
4612
4612
  L_();
4613
4613
  const Cd = wl(void 0);
4614
- function C4(i) {
4614
+ function A4(i) {
4615
4615
  const t = bn.c(9), {
4616
4616
  children: r,
4617
4617
  baseUrl: s,
@@ -4687,7 +4687,7 @@ async function N_(i, t) {
4687
4687
  return r;
4688
4688
  }).then((r) => r.status == 204 ? t : r.json()).then((r) => r);
4689
4689
  }
4690
- async function A4(i, t, r) {
4690
+ async function O4(i, t, r) {
4691
4691
  return fetch(t, {
4692
4692
  method: i,
4693
4693
  headers: await zi(),
@@ -11746,9 +11746,25 @@ function u4(i) {
11746
11746
  se
11747
11747
  ] }), t[24] = M, t[25] = N, t[26] = se, t[27] = Y) : Y = t[27], Y;
11748
11748
  }
11749
+ function l4(i, t) {
11750
+ const r = bn.c(8);
11751
+ let s;
11752
+ r[0] !== i || r[1] !== t ? (s = () => {
11753
+ const C = localStorage.getItem(`use_persistent_storage_${t}`);
11754
+ return C ? JSON.parse(C) : i;
11755
+ }, r[0] = i, r[1] = t, r[2] = s) : s = r[2];
11756
+ const [l, g] = Je(s);
11757
+ let f;
11758
+ r[3] !== t ? (f = (C) => {
11759
+ g(C), localStorage.setItem(`use_persistent_storage_${t}`, JSON.stringify(C));
11760
+ }, r[3] = t, r[4] = f) : f = r[4];
11761
+ const c = f;
11762
+ let b;
11763
+ return r[5] !== c || r[6] !== l ? (b = [l, c], r[5] = c, r[6] = l, r[7] = b) : b = r[7], b;
11764
+ }
11749
11765
  const Jh = [10, 15, 20, 50, 100];
11750
- function l4(i) {
11751
- const t = bn.c(128), {
11766
+ function c4(i) {
11767
+ const t = bn.c(129), {
11752
11768
  title: r,
11753
11769
  queryKey: s,
11754
11770
  connectedQueryKeys: l,
@@ -11827,7 +11843,7 @@ function l4(i) {
11827
11843
  }, t[17] = Y, t[18] = Ce.columnAccessor, t[19] = Ce.direction, t[20] = p) : p = t[20];
11828
11844
  let _;
11829
11845
  t[21] !== Y || t[22] !== Ce ? (_ = [Ce, Y], t[21] = Y, t[22] = Ce, t[23] = _) : _ = t[23], Qt(p, _);
11830
- const [d, m] = Je(Jh[1]), [D, q] = Je(1);
11846
+ const [d, m] = l4(Jh[1], "mantine-table-page-size"), [D, q] = Je(1);
11831
11847
  let V;
11832
11848
  t[24] !== d || t[25] !== C || t[26] !== A ? (V = C ? A.slice(0, d) : A, t[24] = d, t[25] = C, t[26] = A, t[27] = V) : V = t[27];
11833
11849
  const [ue, he] = Je(V);
@@ -11864,18 +11880,18 @@ function l4(i) {
11864
11880
  let Te;
11865
11881
  t[49] !== _e ? (Te = /* @__PURE__ */ R.jsx(Gs, { variant: "subtle", onClick: _e, "aria-label": "Neuladen", children: De }), t[49] = _e, t[50] = Te) : Te = t[50];
11866
11882
  let be;
11867
- t[51] !== L || t[52] !== c || t[53] !== j || t[54] !== b ? (be = (c.some(m4) || b) && /* @__PURE__ */ R.jsxs(Jr, { shadow: "md", children: [
11883
+ t[51] !== L || t[52] !== c || t[53] !== j || t[54] !== b ? (be = (c.some(y4) || b) && /* @__PURE__ */ R.jsxs(Jr, { shadow: "md", children: [
11868
11884
  /* @__PURE__ */ R.jsx(Jr.Target, { children: /* @__PURE__ */ R.jsx(ar, { variant: "outline", rightSection: /* @__PURE__ */ R.jsx(Ky, { size: 14 }), disabled: !j.length, children: "Aktionen" }) }),
11869
11885
  /* @__PURE__ */ R.jsxs(Jr.Dropdown, { children: [
11870
- c.find(v4) && /* @__PURE__ */ R.jsx(Jr.Item, { leftSection: /* @__PURE__ */ R.jsx(Qy, { size: 14 }), onClick: () => h(!0), disabled: j.length !== 1, children: "Bearbeiten" }),
11886
+ c.find(m4) && /* @__PURE__ */ R.jsx(Jr.Item, { leftSection: /* @__PURE__ */ R.jsx(Qy, { size: 14 }), onClick: () => h(!0), disabled: j.length !== 1, children: "Bearbeiten" }),
11871
11887
  (L ?? []).map((ht, Ot) => /* @__PURE__ */ Ly(Jr.Item, { ...ht.icon && {
11872
11888
  leftSection: ht.icon
11873
11889
  }, key: `custom_action_${Ot}`, onClick: () => ht.onClick(j) }, ht.label)),
11874
- c.find(g4) && /* @__PURE__ */ R.jsx(Jr.Item, { leftSection: /* @__PURE__ */ R.jsx(Jy, { size: 14 }), onClick: () => P(!0), color: "red", children: "Löschen" })
11890
+ c.find(v4) && /* @__PURE__ */ R.jsx(Jr.Item, { leftSection: /* @__PURE__ */ R.jsx(Jy, { size: 14 }), onClick: () => P(!0), color: "red", children: "Löschen" })
11875
11891
  ] })
11876
11892
  ] }), t[51] = L, t[52] = c, t[53] = j, t[54] = b, t[55] = be) : be = t[55];
11877
11893
  let Ee;
11878
- t[56] !== M || t[57] !== c ? (Ee = c.find(p4) && /* @__PURE__ */ R.jsx(ar, { onClick: () => Ae(!0), children: M ?? "Erstellen" }), t[56] = M, t[57] = c, t[58] = Ee) : Ee = t[58];
11894
+ t[56] !== M || t[57] !== c ? (Ee = c.find(g4) && /* @__PURE__ */ R.jsx(ar, { onClick: () => Ae(!0), children: M ?? "Erstellen" }), t[56] = M, t[57] = c, t[58] = Ee) : Ee = t[58];
11879
11895
  let Ie;
11880
11896
  t[59] !== f || t[60] !== Te || t[61] !== be || t[62] !== Ee ? (Ie = /* @__PURE__ */ R.jsxs(sr, { align: "center", gap: "xs", children: [
11881
11897
  Te,
@@ -11893,10 +11909,10 @@ function l4(i) {
11893
11909
  let Ye;
11894
11910
  t[70] !== N || t[71] !== X ? (Ye = (N || X) && /* @__PURE__ */ R.jsxs(_l, { my: "md", children: [
11895
11911
  /* @__PURE__ */ R.jsx(Ri, { height: 40 }),
11896
- Array(5).fill(0).map(d4)
11912
+ Array(5).fill(0).map(p4)
11897
11913
  ] }), t[70] = N, t[71] = X, t[72] = Ye) : Ye = t[72];
11898
11914
  let Xe;
11899
- t[73] !== c || t[74] !== K || t[75] !== N || t[76] !== X || t[77] !== D || t[78] !== d || t[79] !== C || t[80] !== ue || t[81] !== j || t[82] !== b || t[83] !== Ce || t[84] !== A ? (Xe = !N && !X && /* @__PURE__ */ R.jsx(Kx, { my: "md", striped: !0, minHeight: 150, fetching: K, records: ue, sortStatus: Ce, onSortStatusChange: B, ...b && {
11915
+ t[73] !== c || t[74] !== K || t[75] !== N || t[76] !== X || t[77] !== D || t[78] !== d || t[79] !== C || t[80] !== ue || t[81] !== j || t[82] !== b || t[83] !== m || t[84] !== Ce || t[85] !== A ? (Xe = !N && !X && /* @__PURE__ */ R.jsx(Kx, { my: "md", striped: !0, minHeight: 150, fetching: K, records: ue, sortStatus: Ce, onSortStatusChange: B, ...b && {
11900
11916
  selectedRecords: j,
11901
11917
  onSelectedRecordsChange: W
11902
11918
  }, ...C && ue.length && {
@@ -11907,46 +11923,46 @@ function l4(i) {
11907
11923
  recordsPerPageOptions: Jh,
11908
11924
  onRecordsPerPageChange: m,
11909
11925
  recordsPerPageLabel: "Einträge pro Seite"
11910
- }, columns: c.map(h4), noRecordsText: "Keine Einträge gefunden" }), t[73] = c, t[74] = K, t[75] = N, t[76] = X, t[77] = D, t[78] = d, t[79] = C, t[80] = ue, t[81] = j, t[82] = b, t[83] = Ce, t[84] = A, t[85] = Xe) : Xe = t[85];
11926
+ }, columns: c.map(d4), noRecordsText: "Keine Einträge gefunden" }), t[73] = c, t[74] = K, t[75] = N, t[76] = X, t[77] = D, t[78] = d, t[79] = C, t[80] = ue, t[81] = j, t[82] = b, t[83] = m, t[84] = Ce, t[85] = A, t[86] = Xe) : Xe = t[86];
11911
11927
  let ft;
11912
- t[86] === Symbol.for("react.memo_cache_sentinel") ? (ft = () => {
11928
+ t[87] === Symbol.for("react.memo_cache_sentinel") ? (ft = () => {
11913
11929
  h(!1), W([]);
11914
- }, t[86] = ft) : ft = t[86];
11930
+ }, t[87] = ft) : ft = t[87];
11915
11931
  const bt = r ?? "Bearbeiten";
11916
11932
  let at;
11917
- t[87] !== g || t[88] !== c || t[89] !== s || t[90] !== j[0] || t[91] !== j.length || t[92] !== k ? (at = j.length > 0 && /* @__PURE__ */ R.jsx(e4, { fields: c.filter(f4), queryKey: s, apiPath: g, id: j[0].id, onClose: () => {
11933
+ t[88] !== g || t[89] !== c || t[90] !== s || t[91] !== j[0] || t[92] !== j.length || t[93] !== k ? (at = j.length > 0 && /* @__PURE__ */ R.jsx(e4, { fields: c.filter(h4), queryKey: s, apiPath: g, id: j[0].id, onClose: () => {
11918
11934
  h(!1), W([]);
11919
- }, steps: k }), t[87] = g, t[88] = c, t[89] = s, t[90] = j[0], t[91] = j.length, t[92] = k, t[93] = at) : at = t[93];
11935
+ }, steps: k }), t[88] = g, t[89] = c, t[90] = s, t[91] = j[0], t[92] = j.length, t[93] = k, t[94] = at) : at = t[94];
11920
11936
  let xt;
11921
- t[94] !== bt || t[95] !== at || t[96] !== u ? (xt = /* @__PURE__ */ R.jsx(Nu, { opened: u, onClose: ft, title: bt, children: at }), t[94] = bt, t[95] = at, t[96] = u, t[97] = xt) : xt = t[97];
11937
+ t[95] !== bt || t[96] !== at || t[97] !== u ? (xt = /* @__PURE__ */ R.jsx(Nu, { opened: u, onClose: ft, title: bt, children: at }), t[95] = bt, t[96] = at, t[97] = u, t[98] = xt) : xt = t[98];
11922
11938
  let Sn;
11923
- t[98] === Symbol.for("react.memo_cache_sentinel") ? (Sn = () => {
11939
+ t[99] === Symbol.for("react.memo_cache_sentinel") ? (Sn = () => {
11924
11940
  P(!1), W([]);
11925
- }, t[98] = Sn) : Sn = t[98];
11941
+ }, t[99] = Sn) : Sn = t[99];
11926
11942
  const zn = r ?? "Löschen";
11927
11943
  let wt;
11928
- t[99] !== g || t[100] !== s || t[101] !== j ? (wt = j.length > 0 && /* @__PURE__ */ R.jsx(u4, { onClose: () => {
11944
+ t[100] !== g || t[101] !== s || t[102] !== j ? (wt = j.length > 0 && /* @__PURE__ */ R.jsx(u4, { onClose: () => {
11929
11945
  P(!1), W([]);
11930
- }, queryKey: s, apiPath: g, selectedRecords: j }), t[99] = g, t[100] = s, t[101] = j, t[102] = wt) : wt = t[102];
11946
+ }, queryKey: s, apiPath: g, selectedRecords: j }), t[100] = g, t[101] = s, t[102] = j, t[103] = wt) : wt = t[103];
11931
11947
  let Jt;
11932
- t[103] !== w || t[104] !== zn || t[105] !== wt ? (Jt = /* @__PURE__ */ R.jsx(Nu, { opened: w, onClose: Sn, title: zn, children: wt }), t[103] = w, t[104] = zn, t[105] = wt, t[106] = Jt) : Jt = t[106];
11948
+ t[104] !== w || t[105] !== zn || t[106] !== wt ? (Jt = /* @__PURE__ */ R.jsx(Nu, { opened: w, onClose: Sn, title: zn, children: wt }), t[104] = w, t[105] = zn, t[106] = wt, t[107] = Jt) : Jt = t[107];
11933
11949
  let Cn;
11934
- t[107] === Symbol.for("react.memo_cache_sentinel") ? (Cn = () => {
11950
+ t[108] === Symbol.for("react.memo_cache_sentinel") ? (Cn = () => {
11935
11951
  Ae(!1);
11936
- }, t[107] = Cn) : Cn = t[107];
11952
+ }, t[108] = Cn) : Cn = t[108];
11937
11953
  const Fn = r ?? "Anlegen";
11938
11954
  let Mn;
11939
- t[108] === Symbol.for("react.memo_cache_sentinel") ? (Mn = () => {
11955
+ t[109] === Symbol.for("react.memo_cache_sentinel") ? (Mn = () => {
11940
11956
  Ae(!1);
11941
- }, t[108] = Mn) : Mn = t[108];
11957
+ }, t[109] = Mn) : Mn = t[109];
11942
11958
  let un;
11943
- t[109] !== c ? (un = c.filter(c4), t[109] = c, t[110] = un) : un = t[110];
11959
+ t[110] !== c ? (un = c.filter(f4), t[110] = c, t[111] = un) : un = t[111];
11944
11960
  let ln;
11945
- t[111] !== g || t[112] !== s || t[113] !== k || t[114] !== un ? (ln = /* @__PURE__ */ R.jsx(tx, { queryKey: s, apiPath: g, onClose: Mn, fields: un, steps: k }), t[111] = g, t[112] = s, t[113] = k, t[114] = un, t[115] = ln) : ln = t[115];
11961
+ t[112] !== g || t[113] !== s || t[114] !== k || t[115] !== un ? (ln = /* @__PURE__ */ R.jsx(tx, { queryKey: s, apiPath: g, onClose: Mn, fields: un, steps: k }), t[112] = g, t[113] = s, t[114] = k, t[115] = un, t[116] = ln) : ln = t[116];
11946
11962
  let et;
11947
- t[116] !== ae || t[117] !== Fn || t[118] !== ln ? (et = /* @__PURE__ */ R.jsx(Nu, { opened: ae, onClose: Cn, title: Fn, children: ln }), t[116] = ae, t[117] = Fn, t[118] = ln, t[119] = et) : et = t[119];
11963
+ t[117] !== ae || t[118] !== Fn || t[119] !== ln ? (et = /* @__PURE__ */ R.jsx(Nu, { opened: ae, onClose: Cn, title: Fn, children: ln }), t[117] = ae, t[118] = Fn, t[119] = ln, t[120] = et) : et = t[120];
11948
11964
  let Wt;
11949
- return t[120] !== Me || t[121] !== Ge || t[122] !== Ye || t[123] !== Xe || t[124] !== xt || t[125] !== Jt || t[126] !== et ? (Wt = /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
11965
+ return t[121] !== Me || t[122] !== Ge || t[123] !== Ye || t[124] !== Xe || t[125] !== xt || t[126] !== Jt || t[127] !== et ? (Wt = /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
11950
11966
  Me,
11951
11967
  Ge,
11952
11968
  Ye,
@@ -11954,61 +11970,45 @@ function l4(i) {
11954
11970
  xt,
11955
11971
  Jt,
11956
11972
  et
11957
- ] }), t[120] = Me, t[121] = Ge, t[122] = Ye, t[123] = Xe, t[124] = xt, t[125] = Jt, t[126] = et, t[127] = Wt) : Wt = t[127], Wt;
11973
+ ] }), t[121] = Me, t[122] = Ge, t[123] = Ye, t[124] = Xe, t[125] = xt, t[126] = Jt, t[127] = et, t[128] = Wt) : Wt = t[128], Wt;
11958
11974
  }
11959
- function c4(i) {
11975
+ function f4(i) {
11960
11976
  return i.create;
11961
11977
  }
11962
- function f4(i) {
11978
+ function h4(i) {
11963
11979
  return i.update;
11964
11980
  }
11965
- function h4(i) {
11981
+ function d4(i) {
11966
11982
  return i.column;
11967
11983
  }
11968
- function d4(i, t) {
11984
+ function p4(i, t) {
11969
11985
  return /* @__PURE__ */ R.jsx(Ri, { height: 35 }, `skeleton-${t}`);
11970
11986
  }
11971
- function p4(i) {
11987
+ function g4(i) {
11972
11988
  return i.create;
11973
11989
  }
11974
- function g4(i) {
11990
+ function v4(i) {
11975
11991
  return i.delete;
11976
11992
  }
11977
- function v4(i) {
11993
+ function m4(i) {
11978
11994
  return i.update;
11979
11995
  }
11980
- function m4(i) {
11996
+ function y4(i) {
11981
11997
  return i.update;
11982
11998
  }
11983
- function O4(i) {
11999
+ function D4(i) {
11984
12000
  const t = bn.c(5), {
11985
12001
  queryClient: r
11986
12002
  } = si();
11987
12003
  let s;
11988
- t[0] !== i ? (s = /* @__PURE__ */ R.jsx(l4, { ...i }), t[0] = i, t[1] = s) : s = t[1];
12004
+ t[0] !== i ? (s = /* @__PURE__ */ R.jsx(c4, { ...i }), t[0] = i, t[1] = s) : s = t[1];
11989
12005
  let l;
11990
12006
  return t[2] !== r || t[3] !== s ? (l = /* @__PURE__ */ R.jsx(md, { client: r, children: s }), t[2] = r, t[3] = s, t[4] = l) : l = t[4], l;
11991
12007
  }
11992
- function D4(i, t) {
11993
- const r = bn.c(8);
11994
- let s;
11995
- r[0] !== i || r[1] !== t ? (s = () => {
11996
- const C = localStorage.getItem(`use_persistent_storage_${t}`);
11997
- return C ? JSON.parse(C) : i;
11998
- }, r[0] = i, r[1] = t, r[2] = s) : s = r[2];
11999
- const [l, g] = Je(s);
12000
- let f;
12001
- r[3] !== t ? (f = (C) => {
12002
- g(C), localStorage.setItem(`use_persistent_storage_${t}`, JSON.stringify(C));
12003
- }, r[3] = t, r[4] = f) : f = r[4];
12004
- const c = f;
12005
- let b;
12006
- return r[5] !== c || r[6] !== l ? (b = [l, c], r[5] = c, r[6] = l, r[7] = b) : b = r[7], b;
12007
- }
12008
12008
  export {
12009
- O4 as DataTable,
12010
- C4 as DataTableProvider,
12011
- A4 as api,
12009
+ D4 as DataTable,
12010
+ A4 as DataTableProvider,
12011
+ O4 as api,
12012
12012
  N_ as createOne,
12013
12013
  P_ as deleteOne,
12014
12014
  I_ as getAll,
@@ -12020,7 +12020,7 @@ export {
12020
12020
  V_ as useDeleteOne,
12021
12021
  z_ as useGetAll,
12022
12022
  B_ as useGetOne,
12023
- D4 as usePersistentState,
12023
+ l4 as usePersistentState,
12024
12024
  Ad as useUpdateOne
12025
12025
  };
12026
12026
  //# sourceMappingURL=index.es.js.map