@applica-software-guru/react-admin 1.0.16 → 1.0.30

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,5 +1,5 @@
1
1
  import { useResourceDefinitions as UP, useGetIdentity as NC, usePermissions as YP, useTranslate as Jr, useRecordContext as jt, useResourceContext as Tr, useLogout as GP, useDataProvider as qu, useAuthProvider as LC, useNotify as Ti, useRedirect as _u, useUpdate as jC, useLocaleState as yl, useGetList as KP, LoadingIndicator as qP, Notification as _P, Toolbar as Ju, Form as Xu, SaveButton as vl, Edit as JP, FormGroupContextProvider as XP, getTabbedFormTabFullPath as ZP, SimpleForm as Zu, DeleteWithConfirmButton as HC, TabbedForm as bl, CreateButtonClasses as VC, Button as $n, useCreateController as $P, CreateContextProvider as eR, useGetOne as tR, useEditController as rR, EditContextProvider as nR, EditButton as oR, CloneButton as iR, FileField as $u, ImageField as zC, DateField as ws, EmailField as xl, FunctionField as sR, FieldTitle as WC, ReferenceManyField as eg, TextField as wl, useInput as aR, ArrayInput as UC, FileInput as Tl, AutocompleteArrayInput as YC, AutocompleteInput as GC, BooleanInput as tg, DateInput as rg, ImageInput as KC, NumberInput as ng, ReferenceArrayInput as og, ReferenceInput as ig, ResourceContextProvider as lR, Pagination as cR, ListToolbar as AR, SearchInput as uR, SelectArrayInput as sg, SelectInput as qC, TextInput as ag, maxLength as gR, TimeInput as lg, Datagrid as Pl, List as Rl, useRefresh as _C, useUnselectAll as JC, useListContext as XC, useUpdateMany as ZC, CoreAdminContext as cg, localStorageStore as dR, AdminUI as $C } from "react-admin";
2
- import { ArrayInput as x9, ArrayInputContext as w9, BooleanField as T9, BulkDeleteWithConfirmButton as P9, Button as R9, ChipField as S9, Confirm as O9, Create as D9, CreateButton as M9, CreateContextProvider as k9, DeleteWithConfirmButton as F9, DeleteWithUndoButton as N9, EditButton as L9, Form as j9, ListToolbar as H9, Pagination as V9, RecordContextProvider as z9, ReferenceArrayField as W9, ReferenceField as U9, Resource as Y9, ResourceContextProvider as G9, SaveButton as K9, SimpleFormIterator as q9, SimpleFormIteratorContext as _9, SimpleList as J9, SingleFieldList as X9, TopToolbar as Z9, choices as $9, email as eU, maxLength as tU, maxValue as rU, minLength as nU, minValue as oU, number as iU, regex as sU, required as aU, useArrayInput as lU, useAuthProvider as cU, useDataProvider as AU, useGetIdentity as uU, useGetList as gU, useGetMany as dU, useGetManyReference as fU, useGetOne as pU, useListContext as hU, useNotify as EU, usePermissions as CU, useRecordContext as IU, useResourceContext as BU, useResourceDefinition as mU, useResourceDefinitions as QU, useTranslate as yU, useUnselect as vU, useUnselectAll as bU, useUpdateMany as xU } from "react-admin";
2
+ import { ArrayInput as x9, ArrayInputContext as w9, BooleanField as T9, BulkDeleteWithConfirmButton as P9, Button as R9, ChipField as S9, Confirm as O9, Create as D9, CreateButton as M9, CreateContextProvider as k9, DeleteWithConfirmButton as F9, DeleteWithUndoButton as N9, EditButton as L9, Form as j9, HttpError as H9, ListToolbar as V9, Pagination as z9, RecordContextProvider as W9, ReferenceArrayField as U9, ReferenceField as Y9, Resource as G9, ResourceContextProvider as K9, SaveButton as q9, SimpleFormIterator as _9, SimpleFormIteratorContext as J9, SimpleList as X9, SingleFieldList as Z9, TopToolbar as $9, choices as eU, email as tU, maxLength as rU, maxValue as nU, minLength as oU, minValue as iU, number as sU, regex as aU, required as lU, useArrayInput as cU, useAuthProvider as AU, useDataProvider as uU, useGetIdentity as gU, useGetList as dU, useGetMany as fU, useGetManyReference as pU, useGetOne as hU, useListContext as EU, useNotify as CU, usePermissions as IU, useRecordContext as BU, useResourceContext as mU, useResourceDefinition as QU, useResourceDefinitions as yU, useTranslate as vU, useUnselect as bU, useUnselectAll as xU, useUpdateMany as wU } from "react-admin";
3
3
  import * as Y from "react";
4
4
  import We, { useState as ut, Children as eI, createContext as wn, useContext as Wt, useMemo as it, useEffect as kt, forwardRef as ko, isValidElement as Ya, cloneElement as Ga, useLayoutEffect as fR, useRef as Po, useInsertionEffect as pR, useCallback as xt, createElement as hR, useId as ER, Fragment as Pi, Suspense as CR } from "react";
5
5
  import { Popover as IR, styled as tI, IconButton as BR, MenuItem as mR, Card as QR, CardHeader as du, Typography as Pe, Divider as Ii, CardContent as rI, Grid as bt, Box as Me, Tooltip as Sl, tooltipClasses as Sa, Grow as yR, Collapse as nI, Fade as vR, Slide as bR, Zoom as oI, CircularProgress as fu, circularProgressClasses as xR, LinearProgress as iI, useMediaQuery as xr, ListItemButton as Ro, ListItemIcon as Gn, ListItemText as So, Chip as _p, Avatar as el, Popper as Ts, Paper as vi, ClickAwayListener as bi, List as Is, ButtonBase as sI, Drawer as wR, Stack as To, AppBar as Ag, Toolbar as ug, ListItemAvatar as TR, ListItemSecondaryAction as aI, Badge as PR, Container as lI, useScrollTrigger as RR, Fab as SR, Dialog as cI, InputLabel as AI, FormHelperText as OR, TextField as DR, useTheme as MR, darken as kR, lighten as FR, StyledEngineProvider as NR, CssBaseline as LR } from "@mui/material";
@@ -7205,42 +7205,52 @@ const sn = () => Wt(zI), gM = ["e-", "entities/"], dM = (e) => {
7205
7205
  pathname: s
7206
7206
  } = Ri();
7207
7207
  return it(() => {
7208
- const a = s.split("/").filter((p) => p);
7209
- let l = at.exports.cloneDeep(r), u = a.length > 0 ? a[0] : null, g = n(l, u);
7210
- if (a.length >= 2) {
7211
- const p = a[a.length - 1];
7208
+ var E;
7209
+ const a = s.split("/").filter((h) => h);
7210
+ let l = at.exports.cloneDeep(r), u = s, g = n(l, s);
7211
+ if (g || (g = n(l, a[a.length - 1]), u = g ? g.id : u), !g)
7212
+ for (let h = a.length; h >= 0; h--) {
7213
+ let I = a.slice(0, h).join("/");
7214
+ if (g = n(l, I), g) {
7215
+ u = g.id;
7216
+ break;
7217
+ }
7218
+ }
7219
+ const d = (E = g == null ? void 0 : g.url) == null ? void 0 : E.split("/");
7220
+ if (a.length >= (d == null ? void 0 : d.length)) {
7221
+ const h = a[a.length - 1];
7212
7222
  if (g) {
7213
- const E = p === "create" ? "create" : "edit", h = `resources.${u}.breadcrumbs.${E}`, I = {
7214
- id: `${u}-${E}`,
7223
+ const I = h === "create" || s === g.url ? "create" : "edit", B = `resources.${u}.breadcrumbs.${I}`, Q = {
7224
+ id: `${u}-${I}`,
7215
7225
  type: "item",
7216
- title: e(h, {
7217
- _: e(h, {
7218
- _: h
7226
+ title: e(B, {
7227
+ _: e(B, {
7228
+ _: B
7219
7229
  })
7220
7230
  }),
7221
7231
  url: s,
7222
7232
  breadcrumbs: !0,
7223
7233
  parent: g
7224
7234
  };
7225
- g.type = "collapse", g.breadcrumbs = !0, g.children = g.children || [], g.children.push(I), g = I;
7235
+ g.type = "collapse", g.breadcrumbs = !0, g.children = g.children || [], g.children.push(Q), g = Q;
7226
7236
  }
7227
7237
  }
7228
- let d = [];
7238
+ let p = [];
7229
7239
  if (g) {
7230
- let p = {
7240
+ let h = {
7231
7241
  ...g,
7232
7242
  last: !0
7233
7243
  };
7234
- for (; p; )
7235
- d.push(p), p = p.parent;
7236
- d = d.reverse();
7244
+ for (; h; )
7245
+ p.push(h), h = h.parent;
7246
+ p = p.reverse();
7237
7247
  }
7238
7248
  return {
7239
7249
  isLoading: t,
7240
7250
  navigation: {
7241
7251
  items: l
7242
7252
  },
7243
- breadcrumbs: d
7253
+ breadcrumbs: p
7244
7254
  };
7245
7255
  }, [t, s, r, n, e]);
7246
7256
  };
@@ -19022,7 +19032,7 @@ var uQ = { exports: {} };
19022
19032
  });
19023
19033
  })(uQ);
19024
19034
  const xn = uQ.exports, oc = ({
19025
- resource: e = "e-notification",
19035
+ resource: e,
19026
19036
  selected: t,
19027
19037
  notification: r,
19028
19038
  onClick: n
@@ -19075,7 +19085,7 @@ const xn = uQ.exports, oc = ({
19075
19085
  };
19076
19086
  oc.displayName = "NotificationItem";
19077
19087
  oc.defaultProps = {
19078
- resource: "e-notification",
19088
+ resource: "entities/notification",
19079
19089
  selected: !1
19080
19090
  };
19081
19091
  oc.propTypes = {
@@ -19103,7 +19113,7 @@ const N8 = {
19103
19113
  alignSelf: "flex-start",
19104
19114
  transform: "none"
19105
19115
  }, ic = ({
19106
- resource: e = "e-notification"
19116
+ resource: e
19107
19117
  }) => {
19108
19118
  const t = dt(), r = xr(t.breakpoints.down("md")), n = Po(null), [s, a] = ut(!1), l = () => {
19109
19119
  a((Q) => !Q);
@@ -19238,7 +19248,7 @@ const N8 = {
19238
19248
  };
19239
19249
  ic.displayName = "Notification";
19240
19250
  ic.defaultProps = {
19241
- resource: "e-notification"
19251
+ resource: "entities/notification"
19242
19252
  };
19243
19253
  ic.propTypes = {
19244
19254
  resource: c.exports.string.isRequired
@@ -19439,7 +19449,7 @@ const H8 = () => {
19439
19449
  width: "calc(100% - 260px)",
19440
19450
  flexGrow: 1,
19441
19451
  p: {
19442
- xs: 2,
19452
+ xs: 0,
19443
19453
  sm: 2,
19444
19454
  lg: 1
19445
19455
  },
@@ -19463,8 +19473,7 @@ const H8 = () => {
19463
19473
  position: "relative",
19464
19474
  minHeight: "calc(100vh - 110px)",
19465
19475
  display: "flex",
19466
- flexDirection: "column",
19467
- backgroundColor: "yellow"
19476
+ flexDirection: "column"
19468
19477
  },
19469
19478
  children: [!d && /* @__PURE__ */ C(Sg, {
19470
19479
  titleBottom: !0,
@@ -22194,52 +22203,56 @@ ny.propTypes = {
22194
22203
  };
22195
22204
  const yz = () => {
22196
22205
  const e = _C(), t = Ti(), r = JC(), n = Tr(), {
22197
- selectedIds: s
22198
- } = XC(), a = jt(), [l, {
22199
- isLoading: u
22206
+ selectedIds: s,
22207
+ data: a
22208
+ } = XC(), l = jt(), u = s.map((E) => a.find((h) => h.id === E)), [g, {
22209
+ isLoading: d
22200
22210
  }] = ZC(n, {
22201
- ids: s.length > 0 ? s : [a == null ? void 0 : a.id],
22211
+ ids: s.length > 0 ? s : [l == null ? void 0 : l.id],
22202
22212
  data: {
22203
22213
  readed: xn().format("YYYY-MM-DD HH:mm:ss")
22204
- }
22214
+ },
22215
+ rows: u
22205
22216
  }, {
22206
22217
  onSuccess: () => {
22207
22218
  e(), t("resources.notifications.messages.readed.done"), r(n);
22208
22219
  },
22209
- onError: () => t("resources.notifications.messages.readed.error", "warning"),
22210
- onFailure: () => t("resources.notifications.messages.readed.error", "warning")
22211
- }), g = xt(() => {
22212
- l();
22213
- }, [l]);
22220
+ onError: () => t("ra.notification.readed_error", "warning"),
22221
+ onFailure: () => t("ra.notification.readed_error", "warning")
22222
+ }), p = xt(() => {
22223
+ g();
22224
+ }, [g]);
22214
22225
  return /* @__PURE__ */ C($n, {
22215
- label: "resources.notifications.buttons.mark_as_readed",
22216
- disabled: u || (a == null ? void 0 : a.readed) !== null,
22217
- onClick: g,
22226
+ label: "ra.notification.mark_as_readed",
22227
+ disabled: d || (l == null ? void 0 : l.readed) !== null,
22228
+ onClick: p,
22218
22229
  children: /* @__PURE__ */ C(YR, {})
22219
22230
  });
22220
22231
  }, vz = () => {
22221
22232
  const e = _C(), t = Ti(), r = JC(), {
22222
- selectedIds: n
22223
- } = XC(), s = jt(), a = Tr(), [l, {
22224
- isLoading: u
22225
- }] = ZC(a, {
22226
- ids: n.length > 0 ? n : [s == null ? void 0 : s.id],
22233
+ selectedIds: n,
22234
+ data: s
22235
+ } = XC(), a = jt(), l = Tr(), u = n.map((E) => s.find((h) => h.id === E)).concat([a]), [g, {
22236
+ isLoading: d
22237
+ }] = ZC(l, {
22238
+ ids: n.length > 0 ? n : [a == null ? void 0 : a.id],
22227
22239
  data: {
22228
22240
  readed: null
22229
- }
22241
+ },
22242
+ rows: u
22230
22243
  }, {
22231
22244
  onSuccess: () => {
22232
22245
  e(), t("resources.notifications.messages.unreaded.done"), r("notifications");
22233
22246
  },
22234
22247
  onFailure: () => t("resources.notifications.messages.unreaded.error", "warning")
22235
- }), g = xt(() => {
22236
- l();
22237
- }, [l]);
22248
+ }), p = xt(() => {
22249
+ g();
22250
+ }, [g]);
22238
22251
  return /* @__PURE__ */ C($n, {
22239
22252
  color: "secondary",
22240
- label: "resources.notifications.buttons.mark_as_unreaded",
22241
- disabled: u || s && !(s != null && s.readed),
22242
- onClick: g,
22253
+ label: "ra.notification.mark_as_unreaded",
22254
+ disabled: d || a && !(a != null && a.readed),
22255
+ onClick: p,
22243
22256
  children: /* @__PURE__ */ C(GR, {})
22244
22257
  });
22245
22258
  }, bz = (e) => {
@@ -22254,7 +22267,7 @@ const yz = () => {
22254
22267
  t != null && t.resource && (t != null && t.resource.startsWith("/") ? n(t == null ? void 0 : t.resource) : document.location.href = t == null ? void 0 : t.resource);
22255
22268
  },
22256
22269
  onFailure: () => {
22257
- s("resources.notifications.messages.readed.error", "warning");
22270
+ s("ra.notification.readed_error", "warning");
22258
22271
  }
22259
22272
  }), d = xt(() => g(), [g]);
22260
22273
  return /* @__PURE__ */ oe("div", {
@@ -22289,7 +22302,7 @@ const yz = () => {
22289
22302
  mt: 1
22290
22303
  },
22291
22304
  color: "textSecondary",
22292
- children: a("resources.notifications.readed", {
22305
+ children: a("ra.notification.readed", {
22293
22306
  readed: u
22294
22307
  })
22295
22308
  })]
@@ -22313,9 +22326,11 @@ const yz = () => {
22313
22326
  rowStyle: a,
22314
22327
  children: [/* @__PURE__ */ C(bz, {
22315
22328
  source: "notification",
22316
- sortable: !1
22329
+ sortable: !1,
22330
+ label: "ra.notification"
22317
22331
  }), /* @__PURE__ */ C(hd, {
22318
- source: "created"
22332
+ source: "created",
22333
+ label: "ra.notification.created"
22319
22334
  }), /* @__PURE__ */ oe(Yl, {
22320
22335
  children: [/* @__PURE__ */ C(yz, {}), /* @__PURE__ */ C(vz, {})]
22321
22336
  })]
@@ -26032,7 +26047,7 @@ Ay.defaultProps = {
26032
26047
  defaultLocale: "en",
26033
26048
  development: !1,
26034
26049
  version: "0.0.0",
26035
- notification: "e-notification",
26050
+ notification: "entities/notification",
26036
26051
  disableNotification: !1
26037
26052
  };
26038
26053
  Ay.propTypes = {
@@ -26098,6 +26113,7 @@ export {
26098
26113
  j9 as Form,
26099
26114
  IQ as FormHeader,
26100
26115
  XV as FunctionField,
26116
+ H9 as HttpError,
26101
26117
  Do as IconButton,
26102
26118
  gc as ImageField,
26103
26119
  qQ as ImageInput,
@@ -26107,7 +26123,7 @@ export {
26107
26123
  GL as LinearWithIcon,
26108
26124
  KL as LinearWithLabel,
26109
26125
  ny as List,
26110
- H9 as ListToolbar,
26126
+ V9 as ListToolbar,
26111
26127
  C9 as Loadable,
26112
26128
  $8 as Loader,
26113
26129
  km as LoadingButton,
@@ -26122,19 +26138,19 @@ export {
26122
26138
  e6 as Notification,
26123
26139
  y9 as NotificationList,
26124
26140
  _Q as NumberInput,
26125
- V9 as Pagination,
26141
+ z9 as Pagination,
26126
26142
  VQ as ReadonlyField,
26127
- z9 as RecordContextProvider,
26143
+ W9 as RecordContextProvider,
26128
26144
  Az as RecordInput,
26129
- W9 as ReferenceArrayField,
26145
+ U9 as ReferenceArrayField,
26130
26146
  JQ as ReferenceArrayInput,
26131
- U9 as ReferenceField,
26147
+ Y9 as ReferenceField,
26132
26148
  XQ as ReferenceInput,
26133
26149
  Vs as ReferenceManyField,
26134
26150
  ZQ as ReferenceManyInput,
26135
- Y9 as Resource,
26136
- G9 as ResourceContextProvider,
26137
- K9 as SaveButton,
26151
+ G9 as Resource,
26152
+ K9 as ResourceContextProvider,
26153
+ q9 as SaveButton,
26138
26154
  EQ as ScrollTop,
26139
26155
  I9 as ScrollX,
26140
26156
  m9 as SearchInput,
@@ -26142,10 +26158,10 @@ export {
26142
26158
  dz as SelectInput,
26143
26159
  G0 as SimpleBar,
26144
26160
  mQ as SimpleForm,
26145
- q9 as SimpleFormIterator,
26146
- _9 as SimpleFormIteratorContext,
26147
- J9 as SimpleList,
26148
- X9 as SingleFieldList,
26161
+ _9 as SimpleFormIterator,
26162
+ J9 as SimpleFormIteratorContext,
26163
+ X9 as SimpleList,
26164
+ Z9 as SingleFieldList,
26149
26165
  ez as SizeField,
26150
26166
  CQ as SmallIcon,
26151
26167
  Cd as SmartTextInput,
@@ -26157,43 +26173,43 @@ export {
26157
26173
  ty as TimeInput,
26158
26174
  Lo as Toolbar,
26159
26175
  WL as Tooltip,
26160
- Z9 as TopToolbar,
26176
+ $9 as TopToolbar,
26161
26177
  Mo as Transitions,
26162
- $9 as choices,
26163
- eU as email,
26164
- tU as maxLength,
26165
- rU as maxValue,
26166
- nU as minLength,
26167
- oU as minValue,
26168
- iU as number,
26178
+ eU as choices,
26179
+ tU as email,
26180
+ rU as maxLength,
26181
+ nU as maxValue,
26182
+ oU as minLength,
26183
+ iU as minValue,
26184
+ sU as number,
26169
26185
  fz as parseTime,
26170
- sU as regex,
26171
- aU as required,
26186
+ aU as regex,
26187
+ lU as required,
26172
26188
  Gl as useAppConfig,
26173
- lU as useArrayInput,
26174
- cU as useAuthProvider,
26189
+ cU as useArrayInput,
26190
+ AU as useAuthProvider,
26175
26191
  EM as useBreadcrumbs,
26176
- AU as useDataProvider,
26177
- uU as useGetIdentity,
26178
- gU as useGetList,
26179
- dU as useGetMany,
26180
- fU as useGetManyReference,
26181
- pU as useGetOne,
26182
- hU as useListContext,
26192
+ uU as useDataProvider,
26193
+ gU as useGetIdentity,
26194
+ dU as useGetList,
26195
+ fU as useGetMany,
26196
+ pU as useGetManyReference,
26197
+ hU as useGetOne,
26198
+ EU as useListContext,
26183
26199
  _I as useLocalStorage,
26184
26200
  qI as useMenu,
26185
26201
  sn as useMenuConfig,
26186
- EU as useNotify,
26187
- CU as usePermissions,
26188
- IU as useRecordContext,
26189
- BU as useResourceContext,
26190
- mU as useResourceDefinition,
26191
- QU as useResourceDefinitions,
26202
+ CU as useNotify,
26203
+ IU as usePermissions,
26204
+ BU as useRecordContext,
26205
+ mU as useResourceContext,
26206
+ QU as useResourceDefinition,
26207
+ yU as useResourceDefinitions,
26192
26208
  CM as useResourceTitle,
26193
26209
  Xt as useThemeConfig,
26194
- yU as useTranslate,
26195
- vU as useUnselect,
26196
- bU as useUnselectAll,
26197
- xU as useUpdateMany,
26210
+ vU as useTranslate,
26211
+ bU as useUnselect,
26212
+ xU as useUnselectAll,
26213
+ wU as useUpdateMany,
26198
26214
  Q9 as uuid
26199
26215
  };