react-crud-mui 0.2.82 → 0.2.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,18 @@
1
1
  import { default as React } from 'react';
2
2
  import { FieldValues } from 'react-hook-form';
3
+ type CommandsOptions<T extends FieldValues> = {
4
+ onCreate: () => void;
5
+ onClose: () => void;
6
+ model?: T;
7
+ };
3
8
  export interface SuccessPanelProps<T extends FieldValues = FieldValues> {
4
9
  title: string;
5
10
  helperText?: string;
6
- onCommands?: (model?: T) => React.ReactNode;
11
+ onCommands?: (options: CommandsOptions<T>) => React.ReactNode;
7
12
  model?: T;
8
13
  icon?: React.ReactNode;
14
+ onCreate: () => void;
15
+ onClose: () => void;
9
16
  }
10
- declare function SuccessPanel<T extends FieldValues = FieldValues>({ icon, title, helperText, onCommands, model, }: SuccessPanelProps<T>): import("react/jsx-runtime").JSX.Element;
17
+ declare function SuccessPanel<T extends FieldValues = FieldValues>({ icon, title, helperText, onCommands, onCreate, onClose, model, }: SuccessPanelProps<T>): import("react/jsx-runtime").JSX.Element;
11
18
  export default SuccessPanel;
@@ -481,7 +481,7 @@ declare function useDetailPageModal<TModel extends FieldValues, TProps extends S
481
481
  readonly onAfterDelete?: ((variables: import('../pages/DetailPageData').DeletePayload<TModel>, form: import('../../form/hooks/useForm').UseFormReturn<TModel, FieldValues>) => void) | undefined;
482
482
  readonly onAfterSave?: ((result: void | Awaited<TModel> | undefined, variables: import('../pages/DetailPageData').SavePayload<TModel>, form: import('../../form/hooks/useForm').UseFormReturn<TModel, FieldValues>) => void) | undefined;
483
483
  readonly showSuccessMessages?: boolean;
484
- readonly successPanelProps?: import('../components/SuccessPanel').SuccessPanelProps;
484
+ readonly successPanelProps?: Omit<import('../components/SuccessPanel').SuccessPanelProps<TModel>, "onClose" | "model" | "onCreate"> | undefined;
485
485
  readonly uid?: string;
486
486
  readonly index?: number;
487
487
  }];
@@ -55,7 +55,7 @@ export interface DetailPageDataProps<TModel extends FieldValues> extends Omit<De
55
55
  /**
56
56
  * Show success panel on create/save (Default false)
57
57
  */
58
- successPanelProps?: SuccessPanelProps;
58
+ successPanelProps?: Omit<SuccessPanelProps<TModel>, 'onCreate' | 'onClose' | 'model'>;
59
59
  /**
60
60
  * Event called after succesfull save
61
61
  */
package/dist/coreui.js CHANGED
@@ -1585,7 +1585,7 @@ function to(n) {
1585
1585
  (${N.toUpperCase()})`,
1586
1586
  children: A(Se ? "savecreate" : "updatecreate")
1587
1587
  }
1588
- }, ye = (fe) => !Q.save || _ != null && _.save ? null : /* @__PURE__ */ so(Xi, { ...De[fe], key: De[fe].key, color: "success", startIcon: /* @__PURE__ */ c(Wc, {}), disabled: o === "steps" ? !We : ue.save, loading: be, ...M == null ? void 0 : M.save }), je = () => !Q.create || _ != null && _.create ? null : /* @__PURE__ */ c(
1588
+ }, ye = (fe) => !Q.save || _ != null && _.save ? null : /* @__PURE__ */ so(Xi, { ...De[fe], key: De[fe].key, color: "success", startIcon: /* @__PURE__ */ c(Wc, {}), disabled: o === "steps" ? !We : ue.save, loading: be, ...M == null ? void 0 : M.save }), qe = () => !Q.create || _ != null && _.create ? null : /* @__PURE__ */ c(
1589
1589
  Xi,
1590
1590
  {
1591
1591
  color: "primary",
@@ -1745,7 +1745,7 @@ function to(n) {
1745
1745
  ] })
1746
1746
  ] });
1747
1747
  }
1748
- const se = ye($), et = je(), ut = J(), de = Ae(), xt = [ge(), ut, et, de, se];
1748
+ const se = ye($), et = qe(), ut = J(), de = Ae(), xt = [ge(), ut, et, de, se];
1749
1749
  return /* @__PURE__ */ O(Ue, { children: [
1750
1750
  I,
1751
1751
  xt,
@@ -2782,7 +2782,9 @@ function Ny({
2782
2782
  title: o,
2783
2783
  helperText: i,
2784
2784
  onCommands: a,
2785
- model: s
2785
+ onCreate: s,
2786
+ onClose: f,
2787
+ model: g
2786
2788
  }) {
2787
2789
  return /* @__PURE__ */ c(bt.Content, { children: /* @__PURE__ */ O(_t, { flexDirection: "column", justifyContent: "center", alignItems: "center", minHeight: "300px", children: [
2788
2790
  /* @__PURE__ */ O(hn, { sx: {
@@ -2798,7 +2800,11 @@ function Ny({
2798
2800
  /* @__PURE__ */ c(Lu, { fontSize: 22, children: o }),
2799
2801
  /* @__PURE__ */ c(un, { marginTop: 1, display: "block", marginBottom: 5, color: "text.secondary", children: i })
2800
2802
  ] }),
2801
- /* @__PURE__ */ c(hn, { children: a == null ? void 0 : a(s) })
2803
+ /* @__PURE__ */ c(hn, { children: a == null ? void 0 : a({
2804
+ model: g,
2805
+ onCreate: s,
2806
+ onClose: f
2807
+ }) })
2802
2808
  ] }) });
2803
2809
  }
2804
2810
  function Hy(n) {
@@ -2896,7 +2902,7 @@ var Pr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2896
2902
  ro.exports;
2897
2903
  (function(n, o) {
2898
2904
  (function() {
2899
- var i, a = "4.17.21", s = 200, f = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", g = "Expected a function", m = "Invalid `variable` option passed into `_.template`", p = "__lodash_hash_undefined__", x = 500, b = "__lodash_placeholder__", w = 1, I = 2, _ = 4, M = 1, D = 2, z = 1, U = 2, B = 4, X = 8, V = 16, q = 32, $ = 64, A = 128, Z = 256, N = 512, ke = 30, Ee = "...", ae = 800, ne = 16, le = 1, Q = 2, ue = 3, be = 1 / 0, Se = 9007199254740991, We = 17976931348623157e292, De = NaN, ye = 4294967295, je = ye - 1, J = ye >>> 1, Ae = [
2905
+ var i, a = "4.17.21", s = 200, f = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", g = "Expected a function", m = "Invalid `variable` option passed into `_.template`", p = "__lodash_hash_undefined__", x = 500, b = "__lodash_placeholder__", w = 1, I = 2, _ = 4, M = 1, D = 2, z = 1, U = 2, B = 4, X = 8, V = 16, q = 32, $ = 64, A = 128, Z = 256, N = 512, ke = 30, Ee = "...", ae = 800, ne = 16, le = 1, Q = 2, ue = 3, be = 1 / 0, Se = 9007199254740991, We = 17976931348623157e292, De = NaN, ye = 4294967295, qe = ye - 1, J = ye >>> 1, Ae = [
2900
2906
  ["ary", A],
2901
2907
  ["bind", z],
2902
2908
  ["bindKey", U],
@@ -2906,7 +2912,7 @@ ro.exports;
2906
2912
  ["partial", q],
2907
2913
  ["partialRight", $],
2908
2914
  ["rearg", Z]
2909
- ], ge = "[object Arguments]", Te = "[object Array]", Oe = "[object AsyncFunction]", j = "[object Boolean]", Y = "[object Date]", fe = "[object DOMException]", se = "[object Error]", et = "[object Function]", ut = "[object GeneratorFunction]", de = "[object Map]", ft = "[object Number]", xt = "[object Null]", it = "[object Object]", kt = "[object Promise]", Nt = "[object Proxy]", Re = "[object RegExp]", ee = "[object Set]", P = "[object String]", ce = "[object Symbol]", _e = "[object Undefined]", Ce = "[object WeakMap]", ze = "[object WeakSet]", lt = "[object ArrayBuffer]", gt = "[object DataView]", Dt = "[object Float32Array]", Bn = "[object Float64Array]", R = "[object Int8Array]", H = "[object Int16Array]", te = "[object Int32Array]", Ve = "[object Uint8Array]", qe = "[object Uint8ClampedArray]", yt = "[object Uint16Array]", st = "[object Uint32Array]", Mt = /\b__p \+= '';/g, qt = /\b(__p \+=) '' \+/g, $f = /(__e\(.*?\)|\b__t\)) \+\n'';/g, us = /&(?:amp|lt|gt|quot|#39);/g, fs = /[&<>"']/g, Bf = RegExp(us.source), Wf = RegExp(fs.source), Nf = /<%-([\s\S]+?)%>/g, Hf = /<%([\s\S]+?)%>/g, ds = /<%=([\s\S]+?)%>/g, Pf = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Uf = /^\w*$/, Gf = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, bo = /[\\^$.*+?()[\]{}|]/g, Vf = RegExp(bo.source), yo = /^\s+/, Zf = /\s/, Xf = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Jf = /\{\n\/\* \[wrapped with (.+)\] \*/, Kf = /,? & /, Yf = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, qf = /[()=,{}\[\]\/\s]/, Qf = /\\(\\)?/g, jf = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, ps = /\w*$/, ed = /^[-+]0x[0-9a-f]+$/i, td = /^0b[01]+$/i, nd = /^\[object .+?Constructor\]$/, rd = /^0o[0-7]+$/i, id = /^(?:0|[1-9]\d*)$/, od = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, ti = /($^)/, ld = /['\n\r\u2028\u2029\\]/g, ni = "\\ud800-\\udfff", sd = "\\u0300-\\u036f", ad = "\\ufe20-\\ufe2f", cd = "\\u20d0-\\u20ff", gs = sd + ad + cd, hs = "\\u2700-\\u27bf", ms = "a-z\\xdf-\\xf6\\xf8-\\xff", ud = "\\xac\\xb1\\xd7\\xf7", fd = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", dd = "\\u2000-\\u206f", pd = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", xs = "A-Z\\xc0-\\xd6\\xd8-\\xde", vs = "\\ufe0e\\ufe0f", bs = ud + fd + dd + pd, wo = "['’]", gd = "[" + ni + "]", ys = "[" + bs + "]", ri = "[" + gs + "]", ws = "\\d+", hd = "[" + hs + "]", Ss = "[" + ms + "]", _s = "[^" + ni + bs + ws + hs + ms + xs + "]", So = "\\ud83c[\\udffb-\\udfff]", md = "(?:" + ri + "|" + So + ")", Cs = "[^" + ni + "]", _o = "(?:\\ud83c[\\udde6-\\uddff]){2}", Co = "[\\ud800-\\udbff][\\udc00-\\udfff]", ar = "[" + xs + "]", Is = "\\u200d", ks = "(?:" + Ss + "|" + _s + ")", xd = "(?:" + ar + "|" + _s + ")", Ms = "(?:" + wo + "(?:d|ll|m|re|s|t|ve))?", As = "(?:" + wo + "(?:D|LL|M|RE|S|T|VE))?", Ts = md + "?", Ls = "[" + vs + "]?", vd = "(?:" + Is + "(?:" + [Cs, _o, Co].join("|") + ")" + Ls + Ts + ")*", bd = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", yd = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Fs = Ls + Ts + vd, wd = "(?:" + [hd, _o, Co].join("|") + ")" + Fs, Sd = "(?:" + [Cs + ri + "?", ri, _o, Co, gd].join("|") + ")", _d = RegExp(wo, "g"), Cd = RegExp(ri, "g"), Io = RegExp(So + "(?=" + So + ")|" + Sd + Fs, "g"), Id = RegExp([
2915
+ ], ge = "[object Arguments]", Te = "[object Array]", Oe = "[object AsyncFunction]", j = "[object Boolean]", Y = "[object Date]", fe = "[object DOMException]", se = "[object Error]", et = "[object Function]", ut = "[object GeneratorFunction]", de = "[object Map]", ft = "[object Number]", xt = "[object Null]", it = "[object Object]", kt = "[object Promise]", Nt = "[object Proxy]", Re = "[object RegExp]", ee = "[object Set]", P = "[object String]", ce = "[object Symbol]", _e = "[object Undefined]", Ce = "[object WeakMap]", ze = "[object WeakSet]", lt = "[object ArrayBuffer]", gt = "[object DataView]", Dt = "[object Float32Array]", Bn = "[object Float64Array]", R = "[object Int8Array]", H = "[object Int16Array]", te = "[object Int32Array]", Ve = "[object Uint8Array]", Qe = "[object Uint8ClampedArray]", yt = "[object Uint16Array]", st = "[object Uint32Array]", Mt = /\b__p \+= '';/g, qt = /\b(__p \+=) '' \+/g, $f = /(__e\(.*?\)|\b__t\)) \+\n'';/g, us = /&(?:amp|lt|gt|quot|#39);/g, fs = /[&<>"']/g, Bf = RegExp(us.source), Wf = RegExp(fs.source), Nf = /<%-([\s\S]+?)%>/g, Hf = /<%([\s\S]+?)%>/g, ds = /<%=([\s\S]+?)%>/g, Pf = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Uf = /^\w*$/, Gf = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, bo = /[\\^$.*+?()[\]{}|]/g, Vf = RegExp(bo.source), yo = /^\s+/, Zf = /\s/, Xf = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Jf = /\{\n\/\* \[wrapped with (.+)\] \*/, Kf = /,? & /, Yf = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, qf = /[()=,{}\[\]\/\s]/, Qf = /\\(\\)?/g, jf = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, ps = /\w*$/, ed = /^[-+]0x[0-9a-f]+$/i, td = /^0b[01]+$/i, nd = /^\[object .+?Constructor\]$/, rd = /^0o[0-7]+$/i, id = /^(?:0|[1-9]\d*)$/, od = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, ti = /($^)/, ld = /['\n\r\u2028\u2029\\]/g, ni = "\\ud800-\\udfff", sd = "\\u0300-\\u036f", ad = "\\ufe20-\\ufe2f", cd = "\\u20d0-\\u20ff", gs = sd + ad + cd, hs = "\\u2700-\\u27bf", ms = "a-z\\xdf-\\xf6\\xf8-\\xff", ud = "\\xac\\xb1\\xd7\\xf7", fd = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", dd = "\\u2000-\\u206f", pd = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", xs = "A-Z\\xc0-\\xd6\\xd8-\\xde", vs = "\\ufe0e\\ufe0f", bs = ud + fd + dd + pd, wo = "['’]", gd = "[" + ni + "]", ys = "[" + bs + "]", ri = "[" + gs + "]", ws = "\\d+", hd = "[" + hs + "]", Ss = "[" + ms + "]", _s = "[^" + ni + bs + ws + hs + ms + xs + "]", So = "\\ud83c[\\udffb-\\udfff]", md = "(?:" + ri + "|" + So + ")", Cs = "[^" + ni + "]", _o = "(?:\\ud83c[\\udde6-\\uddff]){2}", Co = "[\\ud800-\\udbff][\\udc00-\\udfff]", ar = "[" + xs + "]", Is = "\\u200d", ks = "(?:" + Ss + "|" + _s + ")", xd = "(?:" + ar + "|" + _s + ")", Ms = "(?:" + wo + "(?:d|ll|m|re|s|t|ve))?", As = "(?:" + wo + "(?:D|LL|M|RE|S|T|VE))?", Ts = md + "?", Ls = "[" + vs + "]?", vd = "(?:" + Is + "(?:" + [Cs, _o, Co].join("|") + ")" + Ls + Ts + ")*", bd = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", yd = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Fs = Ls + Ts + vd, wd = "(?:" + [hd, _o, Co].join("|") + ")" + Fs, Sd = "(?:" + [Cs + ri + "?", ri, _o, Co, gd].join("|") + ")", _d = RegExp(wo, "g"), Cd = RegExp(ri, "g"), Io = RegExp(So + "(?=" + So + ")|" + Sd + Fs, "g"), Id = RegExp([
2910
2916
  ar + "?" + Ss + "+" + Ms + "(?=" + [ys, ar, "$"].join("|") + ")",
2911
2917
  xd + "+" + As + "(?=" + [ys, ar + ks, "$"].join("|") + ")",
2912
2918
  ar + "?" + ks + "+" + Ms,
@@ -2946,10 +2952,10 @@ ro.exports;
2946
2952
  "isFinite",
2947
2953
  "parseInt",
2948
2954
  "setTimeout"
2949
- ], Td = -1, Qe = {};
2950
- Qe[Dt] = Qe[Bn] = Qe[R] = Qe[H] = Qe[te] = Qe[Ve] = Qe[qe] = Qe[yt] = Qe[st] = !0, Qe[ge] = Qe[Te] = Qe[lt] = Qe[j] = Qe[gt] = Qe[Y] = Qe[se] = Qe[et] = Qe[de] = Qe[ft] = Qe[it] = Qe[Re] = Qe[ee] = Qe[P] = Qe[Ce] = !1;
2955
+ ], Td = -1, je = {};
2956
+ je[Dt] = je[Bn] = je[R] = je[H] = je[te] = je[Ve] = je[Qe] = je[yt] = je[st] = !0, je[ge] = je[Te] = je[lt] = je[j] = je[gt] = je[Y] = je[se] = je[et] = je[de] = je[ft] = je[it] = je[Re] = je[ee] = je[P] = je[Ce] = !1;
2951
2957
  var Xe = {};
2952
- Xe[ge] = Xe[Te] = Xe[lt] = Xe[gt] = Xe[j] = Xe[Y] = Xe[Dt] = Xe[Bn] = Xe[R] = Xe[H] = Xe[te] = Xe[de] = Xe[ft] = Xe[it] = Xe[Re] = Xe[ee] = Xe[P] = Xe[ce] = Xe[Ve] = Xe[qe] = Xe[yt] = Xe[st] = !0, Xe[se] = Xe[et] = Xe[Ce] = !1;
2958
+ Xe[ge] = Xe[Te] = Xe[lt] = Xe[gt] = Xe[j] = Xe[Y] = Xe[Dt] = Xe[Bn] = Xe[R] = Xe[H] = Xe[te] = Xe[de] = Xe[ft] = Xe[it] = Xe[Re] = Xe[ee] = Xe[P] = Xe[ce] = Xe[Ve] = Xe[Qe] = Xe[yt] = Xe[st] = !0, Xe[se] = Xe[et] = Xe[Ce] = !1;
2953
2959
  var Ld = {
2954
2960
  // Latin-1 Supplement block.
2955
2961
  À: "A",
@@ -4005,7 +4011,7 @@ ro.exports;
4005
4011
  return ot(e) && It(e) == ee;
4006
4012
  }
4007
4013
  function hp(e) {
4008
- return ot(e) && Ni(e.length) && !!Qe[At(e)];
4014
+ return ot(e) && Ni(e.length) && !!je[At(e)];
4009
4015
  }
4010
4016
  function ha(e) {
4011
4017
  return typeof e == "function" ? e : e == null ? Bt : typeof e == "object" ? he(e) ? va(e[0], e[1]) : xa(e) : $c(e);
@@ -4219,7 +4225,7 @@ ro.exports;
4219
4225
  else L ? oe = ie && (l || W) : y ? oe = ie && W && (l || !K) : C ? oe = ie && W && !K && (l || !ve) : K || ve ? oe = !1 : oe = l ? E <= t : E < t;
4220
4226
  oe ? u = F + 1 : h = F;
4221
4227
  }
4222
- return Ct(h, je);
4228
+ return Ct(h, qe);
4223
4229
  }
4224
4230
  function Ca(e, t) {
4225
4231
  for (var r = -1, l = e.length, u = 0, h = []; ++r < l; ) {
@@ -4938,7 +4944,7 @@ ro.exports;
4938
4944
  case H:
4939
4945
  case te:
4940
4946
  case Ve:
4941
- case qe:
4947
+ case Qe:
4942
4948
  case yt:
4943
4949
  case st:
4944
4950
  return Fa(e, r);
@@ -6735,7 +6741,7 @@ function qy({
6735
6741
  onWrapperLayout: We,
6736
6742
  readOnly: De,
6737
6743
  reason: ye = "create",
6738
- showHeader: je = !0,
6744
+ showHeader: qe = !0,
6739
6745
  steps: J,
6740
6746
  stepsProps: Ae,
6741
6747
  tabExtraContent: ge,
@@ -6860,7 +6866,7 @@ function qy({
6860
6866
  const Dt = ne == null ? void 0 : ne();
6861
6867
  return /* @__PURE__ */ c(to, { ...gt, children: Dt });
6862
6868
  }, it = (ee) => {
6863
- if (!je)
6869
+ if (!qe)
6864
6870
  return null;
6865
6871
  const P = {
6866
6872
  ...ee,
@@ -6953,7 +6959,7 @@ function Qy({
6953
6959
  }, be = async () => {
6954
6960
  await ue();
6955
6961
  }, Se = async () => {
6956
- await ue("save-create"), je();
6962
+ await ue("save-create"), qe();
6957
6963
  }, We = async () => {
6958
6964
  await ue("save-close"), p == null || p("action");
6959
6965
  }, De = async () => {
@@ -6966,7 +6972,7 @@ function Qy({
6966
6972
  no(Te) && await V(Te), z && Yi.success(X("deletedsuccesfully")), g == null || g(ge, s), p == null || p("action");
6967
6973
  }, ye = () => {
6968
6974
  ke(), b == null || b();
6969
- }, je = (Ae = "create") => {
6975
+ }, qe = (Ae = "create") => {
6970
6976
  I == null || I(Ae), A(), N(!1);
6971
6977
  }, J = (Ae) => {
6972
6978
  const ge = ae(), Te = {
@@ -6976,7 +6982,7 @@ function Qy({
6976
6982
  };
6977
6983
  _ == null || _(Te, s);
6978
6984
  };
6979
- return /* @__PURE__ */ c(qy, { ...B, form: s, alerts: Q, error: a, data: i ?? ne, autoSave: o, loading: f || q || le, reason: D, onCreate: () => je(), onCopy: () => je("copy"), onSaveCreate: () => void Se(), onSaveClose: () => void We(), onSave: () => void be(), onDelete: () => void De(), onNavigate: (Ae) => void J(Ae), onDiscardChanges: ye, onClose: p, onLayout: (Ae) => {
6985
+ return /* @__PURE__ */ c(qy, { ...B, form: s, alerts: Q, error: a, data: i ?? ne, autoSave: o, loading: f || q || le, reason: D, onCreate: () => qe(), onCopy: () => qe("copy"), onSaveCreate: () => void Se(), onSaveClose: () => void We(), onSave: () => void be(), onDelete: () => void De(), onNavigate: (Ae) => void J(Ae), onDiscardChanges: ye, onClose: p, onLayout: (Ae) => {
6980
6986
  let ge = Ae;
6981
6987
  if (Z) {
6982
6988
  const Te = ae();
@@ -6985,7 +6991,7 @@ function Qy({
6985
6991
  tabsContent: null,
6986
6992
  tabsHeaderContent: null,
6987
6993
  footerContent: null,
6988
- content: /* @__PURE__ */ c(Ny, { title: X("savedsuccesfully"), ...U, model: Te })
6994
+ content: /* @__PURE__ */ c(Ny, { title: X("savedsuccesfully"), ...U, model: Te, onCreate: () => qe(), onClose: () => p == null ? void 0 : p("close-button") })
6989
6995
  };
6990
6996
  }
6991
6997
  return w ? w(ge) : /* @__PURE__ */ c(bt.Layout, { ...ge });
@@ -7201,7 +7207,7 @@ function Wt({
7201
7207
  }) {
7202
7208
  const [s, f] = Ge(n), [g, m] = Ge(o);
7203
7209
  return /* @__PURE__ */ c(ff, { reason: s, onReasonChange: (x) => {
7204
- f(x), i == null || i(x);
7210
+ f(x), i == null || i(x), m(o);
7205
7211
  }, activeSegmentIndex: g, onSegmentChanged: m, ...a });
7206
7212
  }
7207
7213
  Wt.Header = Uu;
@@ -7418,7 +7424,7 @@ function Kn({
7418
7424
  showNewRowButton: We,
7419
7425
  skeletonRows: De = l4,
7420
7426
  state: ye,
7421
- sx: je,
7427
+ sx: qe,
7422
7428
  ...J
7423
7429
  }) {
7424
7430
  const {
@@ -7507,11 +7513,11 @@ function Kn({
7507
7513
  }, xt = (R, H) => {
7508
7514
  x && ft(H), q == null || q(R, H);
7509
7515
  }, it = (R, H) => {
7510
- var Ve, qe, yt;
7516
+ var Ve, Qe, yt;
7511
7517
  const te = (Ve = ge.current) == null ? void 0 : Ve.children.namedItem(H.id);
7512
7518
  switch (R.code) {
7513
7519
  case "ArrowUp":
7514
- (qe = te == null ? void 0 : te.previousElementSibling) == null || qe.focus(), R.stopPropagation();
7520
+ (Qe = te == null ? void 0 : te.previousElementSibling) == null || Qe.focus(), R.stopPropagation();
7515
7521
  break;
7516
7522
  case "ArrowDown":
7517
7523
  (yt = te == null ? void 0 : te.nextElementSibling) == null || yt.focus(), R.stopPropagation();
@@ -7529,7 +7535,7 @@ function Kn({
7529
7535
  }, children: [
7530
7536
  R.column.icon,
7531
7537
  Rl(R.column.columnDef.header, R.getContext())
7532
- ] }), Ve = de.options.enableColumnPinning ? iu(R.column) : null, qe = R.column.getCanSort(), yt = R.column.getIsSorted(), st = R.column.getToggleSortingHandler(), Mt = !!yt, qt = B == null ? void 0 : B(R, de);
7538
+ ] }), Ve = de.options.enableColumnPinning ? iu(R.column) : null, Qe = R.column.getCanSort(), yt = R.column.getIsSorted(), st = R.column.getToggleSortingHandler(), Mt = !!yt, qt = B == null ? void 0 : B(R, de);
7533
7539
  return /* @__PURE__ */ c(hf, { size: ae, colSpan: R.colSpan, style: {
7534
7540
  ...Ve
7535
7541
  }, ...qt, sx: {
@@ -7542,7 +7548,7 @@ function Kn({
7542
7548
  minWidth: R.getSize()
7543
7549
  },
7544
7550
  ...qt == null ? void 0 : qt.sx
7545
- }, children: qe ? /* @__PURE__ */ c(z3, { active: Mt, onClick: st, direction: yt === !1 ? void 0 : yt, sx: {
7551
+ }, children: Qe ? /* @__PURE__ */ c(z3, { active: Mt, onClick: st, direction: yt === !1 ? void 0 : yt, sx: {
7546
7552
  "&.Mui-active, &.MuiTableSortLabel-root >.MuiTableSortLabel-icon": {
7547
7553
  color: Mt ? "primary.main" : void 0
7548
7554
  }
@@ -7554,18 +7560,18 @@ function Kn({
7554
7560
  return /* @__PURE__ */ c(or, { sx: {
7555
7561
  "& .MuiTableCell-root": {
7556
7562
  borderBottom: H && !Ve ? "1px solid" : "none",
7557
- borderColor: (qe) => Fe(qe) ? qe.palette.grey[600] : qe.palette.grey[200],
7563
+ borderColor: (Qe) => Fe(Qe) ? Qe.palette.grey[600] : Qe.palette.grey[200],
7558
7564
  "&:not(:first-child)": {
7559
7565
  borderLeft: H ? "1px solid" : "none",
7560
- borderColor: (qe) => Fe(qe) ? qe.palette.grey[600] : qe.palette.grey[200]
7566
+ borderColor: (Qe) => Fe(Qe) ? Qe.palette.grey[600] : Qe.palette.grey[200]
7561
7567
  }
7562
7568
  },
7563
7569
  ...I
7564
- }, children: te.headers.map((qe) => kt(qe, Ve)) }, te.id);
7570
+ }, children: te.headers.map((Qe) => kt(Qe, Ve)) }, te.id);
7565
7571
  }) });
7566
7572
  }, Re = (R) => {
7567
7573
  let H = Rl(R.column.columnDef.cell, R.getContext());
7568
- const te = s4(R.column.id), Ve = R.row.depth > 0 && R.column.getIndex() === 1, qe = R.column.getCanSort() && !!R.column.getIsSorted(), yt = de.options.enableColumnPinning ? iu(R.column) : null, st = R.column.columnDef.ellipsis, Mt = z == null ? void 0 : z(R, de);
7574
+ const te = s4(R.column.id), Ve = R.row.depth > 0 && R.column.getIndex() === 1, Qe = R.column.getCanSort() && !!R.column.getIsSorted(), yt = de.options.enableColumnPinning ? iu(R.column) : null, st = R.column.columnDef.ellipsis, Mt = z == null ? void 0 : z(R, de);
7569
7575
  if (R.column.columnDef.link) {
7570
7576
  const qt = R.column.columnDef.link(R.row);
7571
7577
  qt && (H = /* @__PURE__ */ c(Ym, { to: qt, children: H }));
@@ -7583,7 +7589,7 @@ function Kn({
7583
7589
  return /* @__PURE__ */ c(_r, { title: R.column.title || (st ? R.getValue() : void 0), size: te ? "small" : ae, style: {
7584
7590
  ...yt
7585
7591
  }, ellipsis: st, ...Mt, sx: {
7586
- backgroundColor: qe ? Fe(Y) ? Be(Y.palette.primary.main, 0.04) : Be(Y.palette.primary.main, 0.07) : void 0,
7592
+ backgroundColor: Qe ? Fe(Y) ? Be(Y.palette.primary.main, 0.04) : Be(Y.palette.primary.main, 0.07) : void 0,
7587
7593
  ...R.column.getSize() === Number.MAX_SAFE_INTEGER ? {
7588
7594
  width: "auto"
7589
7595
  } : {
@@ -7624,7 +7630,7 @@ function Kn({
7624
7630
  }, _e = () => de.getRowModel().rows.map((te) => {
7625
7631
  let Ve;
7626
7632
  g && (Ve = typeof g == "function" ? g(te) : Dn(te.original, g));
7627
- const qe = V && te.getIsExpanded(), yt = te.getIsSelected(), st = A == null ? void 0 : A(te, de);
7633
+ const Qe = V && te.getIsExpanded(), yt = te.getIsSelected(), st = A == null ? void 0 : A(te, de);
7628
7634
  return /* @__PURE__ */ O(Hl, { children: [
7629
7635
  /* @__PURE__ */ so(
7630
7636
  Wl,
@@ -7657,7 +7663,7 @@ function Kn({
7657
7663
  ...Ee,
7658
7664
  ...st == null ? void 0 : st.sx
7659
7665
  }) : null,
7660
- qe && gt(te)
7666
+ Qe && gt(te)
7661
7667
  ] }, te.id);
7662
7668
  }), Ce = () => /* @__PURE__ */ O(E3, { ref: ge, children: [
7663
7669
  _e(),
@@ -7670,7 +7676,7 @@ function Kn({
7670
7676
  const {
7671
7677
  pageSize: R,
7672
7678
  pageIndex: H
7673
- } = de.getState().pagination, te = /* @__PURE__ */ c(O3, { component: "div", rowsPerPageOptions: o4, page: H, rowsPerPage: R, count: de.getRowCount(), onPageChange: (Ve, qe) => de.setPageIndex(qe), onRowsPerPageChange: (Ve) => de.setPageSize(+Ve.target.value || 5), ...N });
7679
+ } = de.getState().pagination, te = /* @__PURE__ */ c(O3, { component: "div", rowsPerPageOptions: o4, page: H, rowsPerPage: R, count: de.getRowCount(), onPageChange: (Ve, Qe) => de.setPageIndex(Qe), onRowsPerPageChange: (Ve) => de.setPageSize(+Ve.target.value || 5), ...N });
7674
7680
  return N != null && N.extraContent ? /* @__PURE__ */ O(Yr, { sx: {
7675
7681
  pl: 1
7676
7682
  }, children: [
@@ -7700,7 +7706,7 @@ function Kn({
7700
7706
  if (!w || !_ || !Te.current)
7701
7707
  return null;
7702
7708
  const H = de.getVisibleFlatColumns();
7703
- return [...Array(R)].map((te, Ve) => /* @__PURE__ */ c(or, { children: H.map((qe, yt) => /* @__PURE__ */ c(_r, { scope: "row", children: /* @__PURE__ */ c(L3, { animation: "wave", variant: "text" }) }, `skeloton-${yt}`)) }, Ve));
7709
+ return [...Array(R)].map((te, Ve) => /* @__PURE__ */ c(or, { children: H.map((Qe, yt) => /* @__PURE__ */ c(_r, { scope: "row", children: /* @__PURE__ */ c(L3, { animation: "wave", variant: "text" }) }, `skeloton-${yt}`)) }, Ve));
7704
7710
  };
7705
7711
  return /* @__PURE__ */ O(Ue, { children: [
7706
7712
  /* @__PURE__ */ O(mo, { autoHide: !1, forceVisible: !0, ...be, children: [
@@ -7712,7 +7718,7 @@ function Kn({
7712
7718
  }),
7713
7719
  borderCollapse: "separate",
7714
7720
  borderSpacing: 0,
7715
- ...je
7721
+ ...qe
7716
7722
  }, children: [
7717
7723
  le ? Nt() : null,
7718
7724
  Ce(),
@@ -7819,7 +7825,7 @@ function as({
7819
7825
  models: le
7820
7826
  }), {
7821
7827
  disabled: ye
7822
- } = ho(), je = Je(() => ye === !0 ? {
7828
+ } = ho(), qe = Je(() => ye === !0 ? {
7823
7829
  disabled: !0
7824
7830
  } : {
7825
7831
  disabled: _
@@ -7867,14 +7873,14 @@ function as({
7867
7873
  showCopy: a,
7868
7874
  showDelete: s,
7869
7875
  showEdit: f,
7870
- showView: !!je.disabled,
7876
+ showView: !!qe.disabled,
7871
7877
  index: Re.row.index,
7872
- ...je
7878
+ ...qe
7873
7879
  };
7874
7880
  return q ? q(P) : /* @__PURE__ */ c(qr, { ...P });
7875
7881
  },
7876
7882
  ...p
7877
- }], [n, o, i, m, p, je, De, j, ue, q, a, s, f]), ut = xe((Re) => {
7883
+ }], [n, o, i, m, p, qe, De, j, ue, q, a, s, f]), ut = xe((Re) => {
7878
7884
  const {
7879
7885
  model: ee,
7880
7886
  reason: P,
@@ -7941,7 +7947,7 @@ function as({
7941
7947
  onDeleteAll: () => Se([]),
7942
7948
  enableDeleteAllButton: M,
7943
7949
  api: ne,
7944
- ...je
7950
+ ...qe
7945
7951
  };
7946
7952
  return x ? x(Re) : /* @__PURE__ */ c(wf, { ...Re });
7947
7953
  }, kt = () => {
@@ -8797,7 +8803,7 @@ function z4({
8797
8803
  return null;
8798
8804
  const Y = U ? j : be(j);
8799
8805
  return Y ? Array.isArray(Y) ? Y.map((fe) => ae == null ? void 0 : ae(fe)).join(", ") : ae == null ? void 0 : ae(Y) : null;
8800
- }, je = () => /* @__PURE__ */ O(ku, { ...Ee, readOnly: B, notched: N ? !!(A != null && A.length) : !!A, error: m, multiple: N, ref: V, labelId: `${w}-label`, id: `${w}-select`, label: I, value: Q, title: N && eo(ye(A)) || "", onChange: Se, disabled: s, MenuProps: {
8806
+ }, qe = () => /* @__PURE__ */ O(ku, { ...Ee, readOnly: B, notched: N ? !!(A != null && A.length) : !!A, error: m, multiple: N, ref: V, labelId: `${w}-label`, id: `${w}-select`, label: I, value: Q, title: N && eo(ye(A)) || "", onChange: Se, disabled: s, MenuProps: {
8801
8807
  PaperProps: {
8802
8808
  sx: {
8803
8809
  maxHeight: g
@@ -8836,7 +8842,7 @@ function z4({
8836
8842
  }, children: I }),
8837
8843
  j,
8838
8844
  Y
8839
- ] }), ge = je(), Te = J();
8845
+ ] }), ge = qe(), Te = J();
8840
8846
  return I ? Ae(ge, Te) : /* @__PURE__ */ O(Ue, { children: [
8841
8847
  ge,
8842
8848
  Te
@@ -9514,7 +9520,7 @@ function r5({
9514
9520
  onLayout: We,
9515
9521
  onSearch: De,
9516
9522
  onTabChanged: ye,
9517
- tableProps: je,
9523
+ tableProps: qe,
9518
9524
  onWrapperLayout: J,
9519
9525
  showHeader: Ae = !0,
9520
9526
  showDataCountOnHeader: ge = !0,
@@ -9533,7 +9539,7 @@ function r5({
9533
9539
  }, [V]);
9534
9540
  const [Y, fe] = Bu({
9535
9541
  models: x,
9536
- uniqueIdParamName: (je == null ? void 0 : je.rowIdField) ?? bf
9542
+ uniqueIdParamName: (qe == null ? void 0 : qe.rowIdField) ?? bf
9537
9543
  }), se = xe((P, ce) => {
9538
9544
  if (typeof Q == "function" ? !0 : !!(Q != null && Q[P]))
9539
9545
  return Y({
@@ -9610,7 +9616,7 @@ function r5({
9610
9616
  const P = {
9611
9617
  newRowButtonText: ((_e = p == null ? void 0 : p.create) == null ? void 0 : _e.children) ?? Oe("newitem"),
9612
9618
  onNewRow: () => se("create"),
9613
- ...je,
9619
+ ...qe,
9614
9620
  columns: _ ? [...m ?? [], {
9615
9621
  id: "commands",
9616
9622
  align: "center",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-crud-mui",
3
3
  "private": false,
4
- "version": "0.2.82",
4
+ "version": "0.2.84",
5
5
  "type": "module",
6
6
  "main": "./dist/coreui.js",
7
7
  "module": "./dist/coreui.js",