@scmlatam/web-ui 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import { CoreProps } from './types/types';
2
- declare const Core: ({ sidebar, routes, product, account, languages, loginForm: form, signup, unsavedChangesAlert, }: CoreProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Core: ({ sidebar, routes, product, account, languages, loginForm: form, signup, unsavedChangesAlert, msalInstance, }: CoreProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export { Core };
package/dist/web-ui.js CHANGED
@@ -2999,9 +2999,51 @@ $.Axios = qi, $.CanceledError = ri, $.CancelToken = Ji, $.isCancel = ni, $.VERSI
2999
2999
  //#region src/auth.ts
3000
3000
  var $i = { scopes: ["User.Read"] };
3001
3001
  window.location.origin, `${window.location.origin}`, Pt.SessionStorage;
3002
- //#endregion
3003
- //#region src/components/core/signin/SignIn.tsx
3004
- var ea = ({ product: e, languages: t, form: n }) => {
3002
+ var ea = async (e, t) => await e.acquireTokenSilent({
3003
+ ...$i,
3004
+ account: t
3005
+ }).then((e) => (console.log("Token acquired silently:", e), e.accessToken)).catch((e) => (console.error("Error acquiring token silently:", e), null)) || "", ta = async (e, t) => await $.get("/auth/sso/exist_user", {
3006
+ headers: { appkey: void 0 },
3007
+ baseURL: "https://api.easymanager.scmlatam.com/easy_manager/api/v1//",
3008
+ timeout: 1e3 * 60,
3009
+ params: {
3010
+ email: e.username,
3011
+ access_token: t
3012
+ }
3013
+ }).then((e) => {
3014
+ console.log("response", e);
3015
+ let t = /* @__PURE__ */ new Date();
3016
+ localStorage.setItem("token", e.data.token), localStorage.setItem("account", JSON.stringify({
3017
+ id: e.data.user.id,
3018
+ username: e.data.user.username,
3019
+ name: e.data.user.name,
3020
+ lastname: e.data.user.lastname,
3021
+ email: e.data.user.email,
3022
+ expire: new Date(t.getFullYear(), t.getMonth(), t.getDate() + 7),
3023
+ signin: "MS_SSO"
3024
+ })), localStorage.setItem("company", JSON.stringify({
3025
+ id: e.data.company.id,
3026
+ name: e.data.company.name,
3027
+ integration: e.data.company.integration,
3028
+ expire: new Date(t.getFullYear(), t.getMonth(), t.getDate() + 7)
3029
+ })), localStorage.setItem("privileges", JSON.stringify(e.data.permissions.template)), localStorage.setItem("language", e.data.language), localStorage.setItem("config", JSON.stringify({
3030
+ theme: "light",
3031
+ language: e.data.language,
3032
+ date_format: "DD/MM/YYYY"
3033
+ })), localStorage.setItem("type-signin", "ms"), localStorage.setItem("authenticated", "true"), window.location.href = "/home?module=home&view=resume";
3034
+ }).catch((e) => {
3035
+ switch (e.response?.status) {
3036
+ case 404:
3037
+ console.error("Correo sin cuenta vinculada:", e), localStorage.setItem("ues", "403"), window.location.href = "/signup";
3038
+ return;
3039
+ case 403:
3040
+ console.error("Correo sin cuenta vinculada:", e), localStorage.setItem("ues", "403"), window.location.href = "/signup";
3041
+ return;
3042
+ default: console.error("Error validating SSO token:", e), window.location.href = "/signin";
3043
+ }
3044
+ }), na = async (e, t) => {
3045
+ await ta(t, await ea(e, t));
3046
+ }, ra = ({ product: e, languages: t, form: n }) => {
3005
3047
  let o = Te(), { instance: s } = Ut(), { user: c, setUser: l, pass: u, setPass: d, loadingAuth: f, isAuthenticated: p, setLoadingAuth: m } = F(H), [h, g] = I(!1), [_, v] = I(null), [y, b] = I(t.find((e) => e.active)?.code || "en"), [x, S] = I(!1);
3006
3048
  return p ? (console.log("Usuario ya autenticado"), null) : /* @__PURE__ */ z(R, { children: /* @__PURE__ */ B(C, {
3007
3049
  container: !0,
@@ -3368,7 +3410,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
3368
3410
  })
3369
3411
  })]
3370
3412
  }) });
3371
- }, ta = ({ product: e, languages: t, form: n }) => {
3413
+ }, ia = ({ product: e, languages: t, form: n }) => {
3372
3414
  let { instance: o, accounts: s } = Ut(), { user: c, setUser: l, pass: u, setPass: d, loadingAuth: f, setLoadingAuth: p, isAuthenticated: m, email: h, setEmail: g, setIsAuthenticated: _ } = F(H), [v, y] = I(!1), [b, x] = I(null), [S, w] = I(t.find((e) => e.active)?.code || "en"), [D, k] = I(!1);
3373
3415
  return m ? (console.log("Usuario ya autenticado"), null) : (ge(() => {
3374
3416
  console.log("Cuentas MSAL disponibles:", s, o.getAllAccounts()), g(s[0]?.username || "");
@@ -3706,10 +3748,10 @@ var ea = ({ product: e, languages: t, form: n }) => {
3706
3748
  })
3707
3749
  })]
3708
3750
  }) }));
3709
- }, na = ({ product: e, languages: t, form: n, signup: r }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ B(Ce, { children: [
3751
+ }, aa = ({ product: e, languages: t, form: n, signup: r }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ B(Ce, { children: [
3710
3752
  /* @__PURE__ */ z(Se, {
3711
3753
  path: "/signin",
3712
- element: /* @__PURE__ */ z(ea, {
3754
+ element: /* @__PURE__ */ z(ra, {
3713
3755
  product: e,
3714
3756
  languages: t,
3715
3757
  form: n
@@ -3717,7 +3759,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
3717
3759
  }),
3718
3760
  /* @__PURE__ */ z(Se, {
3719
3761
  path: "/signup",
3720
- element: /* @__PURE__ */ z(ta, {
3762
+ element: /* @__PURE__ */ z(ia, {
3721
3763
  product: e,
3722
3764
  languages: t,
3723
3765
  form: r
@@ -3727,7 +3769,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
3727
3769
  path: "*",
3728
3770
  element: /* @__PURE__ */ z(xe, { to: "/signin" })
3729
3771
  })
3730
- ] }) }), ra = ({ routes: e }) => {
3772
+ ] }) }), oa = ({ routes: e }) => {
3731
3773
  let t = we(), n = Te();
3732
3774
  switch (sessionStorage.getItem("type-signin")) {
3733
3775
  case "ms": return /* @__PURE__ */ z(Kt, { children: /* @__PURE__ */ B(Ce, { children: [e.map((e, r) => /* @__PURE__ */ z(Se, {
@@ -3753,7 +3795,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
3753
3795
  element: /* @__PURE__ */ z(xe, { to: "/" })
3754
3796
  })] }) });
3755
3797
  }
3756
- }, ia = ({ username: e, options: t }) => {
3798
+ }, sa = ({ username: e, options: t }) => {
3757
3799
  let [n, i] = I(!1);
3758
3800
  return /* @__PURE__ */ B(o, {
3759
3801
  sx: {
@@ -3823,23 +3865,23 @@ var ea = ({ product: e, languages: t, form: n }) => {
3823
3865
  }, t)) })
3824
3866
  })]
3825
3867
  });
3826
- }, aa = ({ getWidth: e, state: t, routes: n, account: r }) => /* @__PURE__ */ B(i, {
3868
+ }, ca = ({ getWidth: e, state: t, routes: n, account: r }) => /* @__PURE__ */ B(i, {
3827
3869
  sx: {
3828
3870
  width: `calc(100vw - ${e(t)} - 60px)`,
3829
3871
  height: "calc(100vh - 40px)"
3830
3872
  },
3831
3873
  children: [/* @__PURE__ */ z(i, {
3832
3874
  sx: { height: "10%" },
3833
- children: /* @__PURE__ */ z(ia, {
3875
+ children: /* @__PURE__ */ z(sa, {
3834
3876
  username: r.username,
3835
3877
  avatarUrl: r.avatarUrl,
3836
3878
  options: r.options
3837
3879
  })
3838
3880
  }), /* @__PURE__ */ z(i, {
3839
3881
  sx: { height: "90%" },
3840
- children: /* @__PURE__ */ z(ra, { routes: n })
3882
+ children: /* @__PURE__ */ z(oa, { routes: n })
3841
3883
  })]
3842
- }), oa = ({ sidebar: e, routes: t, account: n }) => {
3884
+ }), la = ({ sidebar: e, routes: t, account: n }) => {
3843
3885
  let { state: r, setState: a, getWidth: o } = Yt();
3844
3886
  return /* @__PURE__ */ B(i, {
3845
3887
  sx: {
@@ -3855,29 +3897,29 @@ var ea = ({ product: e, languages: t, form: n }) => {
3855
3897
  state: r,
3856
3898
  setState: a,
3857
3899
  getWidth: o
3858
- }), /* @__PURE__ */ z(aa, {
3900
+ }), /* @__PURE__ */ z(ca, {
3859
3901
  state: r,
3860
3902
  getWidth: o,
3861
3903
  routes: t,
3862
3904
  account: n
3863
3905
  })]
3864
3906
  });
3865
- }, sa = ({ sidebar: e, routes: t, product: n, account: r, languages: i, loginForm: a, signup: o, unsavedChangesAlert: s }) => {
3907
+ }, ua = ({ sidebar: e, routes: t, product: n, account: r, languages: i, loginForm: a, signup: o, unsavedChangesAlert: s }) => {
3866
3908
  let { isAuthenticated: c, openUnsaved: l, setOpenUnsaved: u } = F(H), d = [{
3867
3909
  text: s.message,
3868
3910
  ncolumn: 12,
3869
3911
  element: "TypographyField"
3870
3912
  }];
3871
- return /* @__PURE__ */ B(R, { children: [c ? /* @__PURE__ */ z(oa, {
3913
+ return /* @__PURE__ */ B(R, { children: [c ? /* @__PURE__ */ z(la, {
3872
3914
  routes: t,
3873
3915
  sidebar: e,
3874
3916
  account: r
3875
- }) : /* @__PURE__ */ z(na, {
3917
+ }) : /* @__PURE__ */ z(aa, {
3876
3918
  product: n,
3877
3919
  languages: i,
3878
3920
  form: a,
3879
3921
  signup: o
3880
- }), /* @__PURE__ */ z(ja, {
3922
+ }), /* @__PURE__ */ z(Pa, {
3881
3923
  title: s.title,
3882
3924
  open: l,
3883
3925
  setOpen: u,
@@ -3889,10 +3931,10 @@ var ea = ({ product: e, languages: t, form: n }) => {
3889
3931
  cancelButton: s.cancelButton
3890
3932
  }
3891
3933
  })] });
3892
- }, ca = ({ sidebar: e, routes: t, product: n, account: r, languages: a, loginForm: o, signup: s, unsavedChangesAlert: c }) => {
3893
- let l = a.find((e) => e.active) || a[0];
3934
+ }, da = ({ sidebar: e, routes: t, product: n, account: r, languages: a, loginForm: o, signup: s, unsavedChangesAlert: c, msalInstance: l }) => {
3935
+ let { setIsAuthenticated: u } = F(H), [d, p] = I(0), m = a.find((e) => e.active) || a[0];
3894
3936
  return ge(() => {
3895
- switch (l.code) {
3937
+ switch (m.code) {
3896
3938
  case "es":
3897
3939
  de.locale("es");
3898
3940
  break;
@@ -3904,7 +3946,22 @@ var ea = ({ product: e, languages: t, form: n }) => {
3904
3946
  break;
3905
3947
  default: de.locale("en");
3906
3948
  }
3907
- }, [l]), /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(i, {
3949
+ let e = [
3950
+ "token",
3951
+ "company",
3952
+ "config",
3953
+ "privileges",
3954
+ "account",
3955
+ "language",
3956
+ "authenticated",
3957
+ "type-signin"
3958
+ ].filter((e) => localStorage.getItem(e) === null);
3959
+ if (localStorage.getItem("ues") === "403") {
3960
+ localStorage.removeItem("ues"), window.location.href = "/signup";
3961
+ return;
3962
+ }
3963
+ d === 0 && window.location.pathname !== "/signup" && (l.getActiveAccount() && e.length > 0 && (console.log("if 1"), na(l, l.getActiveAccount())), l.getActiveAccount() && e.length === 0 && (console.log("if 2"), u(!0), localStorage.setItem("authenticated", "true")), !l.getActiveAccount() && e.length === 0 && (console.log("if 3"), u(!0), localStorage.setItem("authenticated", "true")), !l.getActiveAccount() && e.length > 0 && (console.log("if 4"), u(!1), localStorage.setItem("authenticated", "false")), p(d + 1));
3964
+ }, [m, d]), /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(i, {
3908
3965
  sx: {
3909
3966
  overflow: "hidden",
3910
3967
  height: "100vh"
@@ -3912,11 +3969,11 @@ var ea = ({ product: e, languages: t, form: n }) => {
3912
3969
  children: /* @__PURE__ */ z(ye, { children: /* @__PURE__ */ z(le, {
3913
3970
  theme: {
3914
3971
  rabbitLight: gt,
3915
- rabbitDark: ue(mt, l.theme.dg, l.theme.core, l.theme.pickers)
3972
+ rabbitDark: ue(mt, m.theme.dg, m.theme.core, m.theme.pickers)
3916
3973
  }.rabbitDark,
3917
3974
  children: /* @__PURE__ */ z(Ie, {
3918
3975
  dateAdapter: Re,
3919
- adapterLocale: l.code,
3976
+ adapterLocale: m.code,
3920
3977
  children: /* @__PURE__ */ B(Me, {
3921
3978
  maxSnack: 15,
3922
3979
  autoHideDuration: 1e4,
@@ -3924,12 +3981,13 @@ var ea = ({ product: e, languages: t, form: n }) => {
3924
3981
  vertical: "top",
3925
3982
  horizontal: "center"
3926
3983
  },
3927
- children: [/* @__PURE__ */ z(f, {}), /* @__PURE__ */ z(sa, {
3984
+ children: [/* @__PURE__ */ z(f, {}), /* @__PURE__ */ z(ua, {
3928
3985
  sidebar: e,
3929
3986
  routes: t,
3930
3987
  product: n,
3931
3988
  account: r,
3932
3989
  languages: a,
3990
+ msalInstance: l,
3933
3991
  loginForm: o,
3934
3992
  signup: s,
3935
3993
  unsavedChangesAlert: c
@@ -3938,7 +3996,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
3938
3996
  })
3939
3997
  }) })
3940
3998
  }) });
3941
- }, la = ({ children: e }) => {
3999
+ }, fa = ({ children: e }) => {
3942
4000
  let [t, n] = I(localStorage.getItem("authenticated") === "true"), [r, i] = I(""), [a, o] = I(""), [s, c] = I(""), [l, u] = I(""), [d, f] = I("DD/MM/YYYY"), [p, m] = I([]), [h, g] = I([]), [_, v] = I(!1), [y, b] = I(""), [x, S] = I(!1);
3943
4001
  return /* @__PURE__ */ z(H.Provider, {
3944
4002
  value: {
@@ -3971,7 +4029,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
3971
4029
  },
3972
4030
  children: e
3973
4031
  });
3974
- }, ua = ({ contextMenu: e, setContextMenu: t, options: n, checked: r, optionGroup: a }) => /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(re, {
4032
+ }, pa = ({ contextMenu: e, setContextMenu: t, options: n, checked: r, optionGroup: a }) => /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(re, {
3975
4033
  open: e !== null,
3976
4034
  onClose: () => t(null),
3977
4035
  anchorReference: "anchorPosition",
@@ -4022,7 +4080,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4022
4080
  }) : null
4023
4081
  ]
4024
4082
  }, t)] }, t))
4025
- }), n.filter((e) => !e.hide).map((e, t) => /* @__PURE__ */ z(i, { children: e.dialog }, t))] }), da = ({ label: e, values: t, placeholder: n, value: r, setValue: i, disabled: a, fullWidth: o, white: s, search: c }) => {
4083
+ }), n.filter((e) => !e.hide).map((e, t) => /* @__PURE__ */ z(i, { children: e.dialog }, t))] }), ma = ({ label: e, values: t, placeholder: n, value: r, setValue: i, disabled: a, fullWidth: o, white: s, search: c }) => {
4026
4084
  let l = ve(null), u = ve(null), [d, f] = I({
4027
4085
  width: 0,
4028
4086
  height: 0
@@ -4158,7 +4216,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4158
4216
  }, e.value))]
4159
4217
  })]
4160
4218
  }) });
4161
- }, fa = ({ label: e, value: t, setValue: n, values: r, placeholder: a, disabled: o, fullWidth: s, white: c, search: u }) => {
4219
+ }, ha = ({ label: e, value: t, setValue: n, values: r, placeholder: a, disabled: o, fullWidth: s, white: c, search: u }) => {
4162
4220
  let d = ve(null), f = ve(null), [p, m] = I({
4163
4221
  width: 0,
4164
4222
  height: 0
@@ -4325,7 +4383,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4325
4383
  ]
4326
4384
  })]
4327
4385
  }) });
4328
- }, pa = ({ label: e, value: t, setValue: n, disabled: r, fullWidth: i }) => {
4386
+ }, ga = ({ label: e, value: t, setValue: n, disabled: r, fullWidth: i }) => {
4329
4387
  let { format: a } = F(H);
4330
4388
  return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(Ue, {
4331
4389
  dateAdapter: Re,
@@ -4345,7 +4403,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4345
4403
  fullWidth: i
4346
4404
  })
4347
4405
  }) });
4348
- }, ma = ({ label: e, initialValue: t, value: n, setValue: r, calendars: i, disabled: a, white: o, fullWidth: s, maxDate: c, minDate: l }) => {
4406
+ }, _a = ({ label: e, initialValue: t, value: n, setValue: r, calendars: i, disabled: a, white: o, fullWidth: s, maxDate: c, minDate: l }) => {
4349
4407
  let { format: u, rangeShortcut: d } = F(H), f = qe();
4350
4408
  return /* @__PURE__ */ z(Ge, {
4351
4409
  theme: Ke({
@@ -4411,7 +4469,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4411
4469
  minDate: l
4412
4470
  })
4413
4471
  });
4414
- }, ha = ({ label: e, initialValue: t, value: n, setValue: r, disabled: i, white: a, fullWidth: o }) => {
4472
+ }, va = ({ label: e, initialValue: t, value: n, setValue: r, disabled: i, white: a, fullWidth: o }) => {
4415
4473
  let { format: s, singleShortcut: c } = F(H);
4416
4474
  return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(Fe, {
4417
4475
  label: e,
@@ -4456,7 +4514,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4456
4514
  } }
4457
4515
  }
4458
4516
  }) });
4459
- }, ga = (e) => {
4517
+ }, ya = (e) => {
4460
4518
  let { name: t = {
4461
4519
  title: "",
4462
4520
  ncolumn: 0
@@ -4467,7 +4525,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4467
4525
  switch (e.element) {
4468
4526
  case "SelectField": return /* @__PURE__ */ z(C, {
4469
4527
  size: e.ncolumn,
4470
- children: /* @__PURE__ */ z(da, {
4528
+ children: /* @__PURE__ */ z(ma, {
4471
4529
  label: e.label,
4472
4530
  placeholder: e.placeholder,
4473
4531
  value: e.value,
@@ -4482,7 +4540,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4482
4540
  }, t);
4483
4541
  case "MultiSelectField": return /* @__PURE__ */ z(C, {
4484
4542
  size: e.ncolumn,
4485
- children: /* @__PURE__ */ z(fa, {
4543
+ children: /* @__PURE__ */ z(ha, {
4486
4544
  label: e.label,
4487
4545
  placeholder: e.placeholder,
4488
4546
  value: e.value,
@@ -4496,7 +4554,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4496
4554
  }, t);
4497
4555
  case "DateRangeField": return /* @__PURE__ */ z(C, {
4498
4556
  size: e.ncolumn,
4499
- children: /* @__PURE__ */ z(pa, {
4557
+ children: /* @__PURE__ */ z(ga, {
4500
4558
  label: e.label,
4501
4559
  value: e.value,
4502
4560
  setValue: e.setValue,
@@ -4506,7 +4564,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4506
4564
  }, t);
4507
4565
  case "DatePickerField": return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(C, {
4508
4566
  size: e.ncolumn,
4509
- children: /* @__PURE__ */ z(ha, {
4567
+ children: /* @__PURE__ */ z(va, {
4510
4568
  label: e.label,
4511
4569
  initialValue: e.initialValue,
4512
4570
  value: e.value,
@@ -4518,7 +4576,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4518
4576
  }, t) });
4519
4577
  case "DateRangePickerField": return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(C, {
4520
4578
  size: e.ncolumn,
4521
- children: /* @__PURE__ */ z(ma, {
4579
+ children: /* @__PURE__ */ z(_a, {
4522
4580
  label: e.label,
4523
4581
  initialValue: e.initialValue,
4524
4582
  value: e.value,
@@ -4591,13 +4649,13 @@ var ea = ({ product: e, languages: t, form: n }) => {
4591
4649
  ]
4592
4650
  })
4593
4651
  }) });
4594
- }, _a = (e) => /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(ze, {
4652
+ }, ba = (e) => /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(ze, {
4595
4653
  ...e,
4596
4654
  apiRef: e.apiRef,
4597
4655
  showToolbar: e.toolbar !== void 0,
4598
4656
  headerFilters: e.headerFilters,
4599
4657
  slots: {
4600
- toolbar: ga,
4658
+ toolbar: ya,
4601
4659
  headerFilterMenu: null
4602
4660
  },
4603
4661
  slotProps: {
@@ -4713,13 +4771,13 @@ var ea = ({ product: e, languages: t, form: n }) => {
4713
4771
  onCellEditStop: e.onCellEditStop,
4714
4772
  disableVirtualization: !0,
4715
4773
  initialState: e.initialState
4716
- }), /* @__PURE__ */ z(ua, {
4774
+ }), /* @__PURE__ */ z(pa, {
4717
4775
  contextMenu: e.contextMenu,
4718
4776
  setContextMenu: e.setContextMenu,
4719
4777
  options: e.options,
4720
4778
  checked: e.rowSelectionModel,
4721
4779
  optionGroup: e.optionGroup
4722
- })] }), va = () => {
4780
+ })] }), xa = () => {
4723
4781
  let e = Be(), [t, n] = I(!1), [r, i] = I([]), [a, o] = I({
4724
4782
  pageSize: 25,
4725
4783
  page: 0
@@ -4742,7 +4800,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4742
4800
  optionGroup: d,
4743
4801
  setOptionGroup: f
4744
4802
  };
4745
- }, ya = () => {
4803
+ }, Sa = () => {
4746
4804
  let { enqueueSnackbar: t } = Pe(), n = (e) => {
4747
4805
  Ne(e);
4748
4806
  };
@@ -4773,7 +4831,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4773
4831
  }),
4774
4832
  closeAlert: n
4775
4833
  };
4776
- }, ba = ({ label: e, initialValue: t, value: n, setValue: r, disabled: i, fullWidth: a, white: o }) => {
4834
+ }, Ca = ({ label: e, initialValue: t, value: n, setValue: r, disabled: i, fullWidth: a, white: o }) => {
4777
4835
  let { format: s } = F(H);
4778
4836
  return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(tt, {
4779
4837
  label: e,
@@ -4801,7 +4859,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4801
4859
  disabled: i,
4802
4860
  fullWidth: a
4803
4861
  }) });
4804
- }, xa = ({ label: e, placeholder: t, values: r, value: i, setValue: a, white: o }) => {
4862
+ }, wa = ({ label: e, placeholder: t, values: r, value: i, setValue: a, white: o }) => {
4805
4863
  let [s, c] = I(!1);
4806
4864
  return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(n, {
4807
4865
  multiple: !0,
@@ -4888,7 +4946,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4888
4946
  limitTags: 2,
4889
4947
  size: "small"
4890
4948
  }) });
4891
- }, Sa = ({ label: e, value: t, setValue: n, values: r, placeholder: i, disabled: a, fullWidth: o, white: s }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ B(y, {
4949
+ }, Ta = ({ label: e, value: t, setValue: n, values: r, placeholder: i, disabled: a, fullWidth: o, white: s }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ B(y, {
4892
4950
  fullWidth: o,
4893
4951
  focused: !0,
4894
4952
  children: [/* @__PURE__ */ z(D, {
@@ -4946,7 +5004,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4946
5004
  children: e.label
4947
5005
  }, e.value))]
4948
5006
  })]
4949
- }) }), Ca = ({ item: e, path: t }) => e.children.length === 0 ? /* @__PURE__ */ z(it, {
5007
+ }) }), Ea = ({ item: e, path: t }) => e.children.length === 0 ? /* @__PURE__ */ z(it, {
4950
5008
  itemId: `${t}/${e.id}`,
4951
5009
  label: e.name,
4952
5010
  disabled: e.disabled,
@@ -4957,21 +5015,21 @@ var ea = ({ product: e, languages: t, form: n }) => {
4957
5015
  itemId: `${t}/${e.id}`,
4958
5016
  label: e.name,
4959
5017
  disabled: e.disabled,
4960
- children: e.children.map((n) => /* @__PURE__ */ z(Ca, {
5018
+ children: e.children.map((n) => /* @__PURE__ */ z(Ea, {
4961
5019
  item: n,
4962
5020
  path: `${t}/${e.id}`
4963
5021
  }, n.id))
4964
- }) }), wa = ({ items: e }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(rt, {
5022
+ }) }), Da = ({ items: e }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(rt, {
4965
5023
  sx: {
4966
5024
  borderRadius: "16px",
4967
5025
  border: (e) => `1px solid ${e.palette["gr-base-dark"].main}`,
4968
5026
  p: 1.5
4969
5027
  },
4970
- children: e.map((e) => /* @__PURE__ */ z(Ca, {
5028
+ children: e.map((e) => /* @__PURE__ */ z(Ea, {
4971
5029
  item: e,
4972
5030
  path: "origin"
4973
5031
  }, e.id))
4974
- }) }), Ta = ({ label: e, initialValue: t, value: n, setValue: r, disabled: i, fullWidth: a, white: o }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(Le, {
5032
+ }) }), Oa = ({ label: e, initialValue: t, value: n, setValue: r, disabled: i, fullWidth: a, white: o }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(Le, {
4975
5033
  label: e,
4976
5034
  disabled: i,
4977
5035
  format: "HH:mm",
@@ -4997,7 +5055,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
4997
5055
  endAdornment: /* @__PURE__ */ z(at, { style: { color: o ? "black" : "white" } })
4998
5056
  } }
4999
5057
  } }
5000
- }) }), Ea = ({ label: e, initialValue: t, value: n, setValue: r, disabled: i, white: a, fullWidth: o }) => {
5058
+ }) }), ka = ({ label: e, initialValue: t, value: n, setValue: r, disabled: i, white: a, fullWidth: o }) => {
5001
5059
  let { format: s, singleShortcut: c } = F(H);
5002
5060
  return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(Fe, {
5003
5061
  label: e,
@@ -5042,7 +5100,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5042
5100
  } }
5043
5101
  }
5044
5102
  }) });
5045
- }, Da = ({ label: e, initialValue: t, value: n, setValue: r, calendars: i, disabled: a, white: o, fullWidth: s }) => {
5103
+ }, Aa = ({ label: e, initialValue: t, value: n, setValue: r, calendars: i, disabled: a, white: o, fullWidth: s }) => {
5046
5104
  let { format: c, rangeShortcut: l } = F(H);
5047
5105
  return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(We, {
5048
5106
  label: e,
@@ -5089,7 +5147,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5089
5147
  } }
5090
5148
  }
5091
5149
  }) });
5092
- }, Oa = ({ initialValue: e, value: t, setValue: n, calendars: r, disabled: i, white: a }) => {
5150
+ }, ja = ({ initialValue: e, value: t, setValue: n, calendars: r, disabled: i, white: a }) => {
5093
5151
  let { rangeShortcut: o } = F(H);
5094
5152
  return /* @__PURE__ */ z(ot, {
5095
5153
  defaultValue: e,
@@ -5132,7 +5190,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5132
5190
  } }
5133
5191
  }
5134
5192
  });
5135
- }, ka = ({ data: e, setData: t, columnLabels: n, buttons: r }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ B(C, {
5193
+ }, Ma = ({ data: e, setData: t, columnLabels: n, buttons: r }) => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ B(C, {
5136
5194
  sx: { overflow: "hidden" },
5137
5195
  container: !0,
5138
5196
  spacing: 2,
@@ -5250,7 +5308,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5250
5308
  ]
5251
5309
  })
5252
5310
  })]
5253
- }) }), Aa = (e) => {
5311
+ }) }), Na = (e) => {
5254
5312
  let t = ve(null);
5255
5313
  return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z($e, {
5256
5314
  nodeRef: t,
@@ -5272,7 +5330,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5272
5330
  }
5273
5331
  })
5274
5332
  }) });
5275
- }, ja = ({ title: n, alert: r, action: o, fields: s, open: c, setOpen: u, loading: f, onClickSave: _ }) => {
5333
+ }, Pa = ({ title: n, alert: r, action: o, fields: s, open: c, setOpen: u, loading: f, onClickSave: _ }) => {
5276
5334
  let [v, E] = I(!1), D = (e, t) => {
5277
5335
  switch (e.element) {
5278
5336
  case "TextField": return /* @__PURE__ */ z(C, {
@@ -5298,7 +5356,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5298
5356
  case "SelectField": return /* @__PURE__ */ z(C, {
5299
5357
  size: e.ncolumn,
5300
5358
  sx: { mb: "20px" },
5301
- children: /* @__PURE__ */ z(Sa, {
5359
+ children: /* @__PURE__ */ z(Ta, {
5302
5360
  label: e.label,
5303
5361
  placeholder: e.placeholder,
5304
5362
  value: e.value,
@@ -5312,7 +5370,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5312
5370
  case "DateField": return /* @__PURE__ */ z(C, {
5313
5371
  size: e.ncolumn,
5314
5372
  sx: { mb: "20px" },
5315
- children: /* @__PURE__ */ z(ba, {
5373
+ children: /* @__PURE__ */ z(Ca, {
5316
5374
  label: e.label,
5317
5375
  initialValue: e.initialValue,
5318
5376
  value: e.value,
@@ -5380,7 +5438,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5380
5438
  case "AutoCompleteField": return /* @__PURE__ */ z(C, {
5381
5439
  size: e.ncolumn,
5382
5440
  sx: { mb: "20px" },
5383
- children: /* @__PURE__ */ z(xa, {
5441
+ children: /* @__PURE__ */ z(wa, {
5384
5442
  label: e.label,
5385
5443
  placeholder: "Seleccionar",
5386
5444
  values: e.values,
@@ -5417,12 +5475,12 @@ var ea = ({ product: e, languages: t, form: n }) => {
5417
5475
  children: [/* @__PURE__ */ z(P, {
5418
5476
  variant: "body1",
5419
5477
  children: e.label
5420
- }), /* @__PURE__ */ z(wa, { items: e.items })]
5478
+ }), /* @__PURE__ */ z(Da, { items: e.items })]
5421
5479
  }, t);
5422
5480
  case "TimeField": return /* @__PURE__ */ z(C, {
5423
5481
  size: e.ncolumn,
5424
5482
  sx: { mb: "20px" },
5425
- children: /* @__PURE__ */ z(Ta, {
5483
+ children: /* @__PURE__ */ z(Oa, {
5426
5484
  label: e.label,
5427
5485
  initialValue: e.initialValue,
5428
5486
  value: e.value,
@@ -5443,7 +5501,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5443
5501
  case "DatePickerField": return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(C, {
5444
5502
  size: e.ncolumn,
5445
5503
  sx: { mb: "20px" },
5446
- children: /* @__PURE__ */ z(Ea, {
5504
+ children: /* @__PURE__ */ z(ka, {
5447
5505
  label: e.label,
5448
5506
  initialValue: e.initialValue,
5449
5507
  value: e.value,
@@ -5456,7 +5514,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5456
5514
  case "DateRangePickerField": return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(C, {
5457
5515
  size: e.ncolumn,
5458
5516
  sx: { mb: "20px" },
5459
- children: /* @__PURE__ */ z(Da, {
5517
+ children: /* @__PURE__ */ z(Aa, {
5460
5518
  label: e.label,
5461
5519
  initialValue: e.initialValue,
5462
5520
  value: e.value,
@@ -5470,7 +5528,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5470
5528
  case "DateRangeCalendarField": return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(C, {
5471
5529
  size: e.ncolumn,
5472
5530
  sx: { mb: "20px" },
5473
- children: /* @__PURE__ */ z(Oa, {
5531
+ children: /* @__PURE__ */ z(ja, {
5474
5532
  initialValue: e.initialValue,
5475
5533
  value: e.value,
5476
5534
  setValue: e.setValue,
@@ -5482,7 +5540,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5482
5540
  case "SheetField": return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z(C, {
5483
5541
  size: e.ncolumn,
5484
5542
  sx: { mb: "20px" },
5485
- children: /* @__PURE__ */ z(ka, {
5543
+ children: /* @__PURE__ */ z(Ma, {
5486
5544
  data: e.data,
5487
5545
  setData: e.setData,
5488
5546
  columnLabels: e.columnLabels,
@@ -5559,7 +5617,7 @@ var ea = ({ product: e, languages: t, form: n }) => {
5559
5617
  }, [c]), /* @__PURE__ */ z(R, { children: /* @__PURE__ */ B(p, {
5560
5618
  open: c,
5561
5619
  onClose: () => A(s),
5562
- PaperComponent: Aa,
5620
+ PaperComponent: Na,
5563
5621
  "aria-labelledby": "draggable-dialog-title",
5564
5622
  children: [
5565
5623
  /* @__PURE__ */ B(g, {
@@ -5698,4 +5756,4 @@ var ea = ({ product: e, languages: t, form: n }) => {
5698
5756
  }) });
5699
5757
  };
5700
5758
  //#endregion
5701
- export { ca as Core, H as CoreContext, la as CoreProvider, ja as Form, ht as GoodRabbitDarkTheme, gt as GoodRabbitLightTheme, _a as Table, ya as useSystemAlert, va as useTable };
5759
+ export { da as Core, H as CoreContext, fa as CoreProvider, Pa as Form, ht as GoodRabbitDarkTheme, gt as GoodRabbitLightTheme, ba as Table, Sa as useSystemAlert, xa as useTable };