@firecms/core 3.0.0-canary.60 → 3.0.0-canary.61

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
@@ -5,7 +5,7 @@ import { SnackbarProvider as oa, useSnackbar as aa } from "notistack";
5
5
  import Qi from "object-hash";
6
6
  import { useCreateFormex as pn, Formex as fn, setIn as jr, Field as hn, getIn as Dt, useFormex as ri } from "@firecms/formex";
7
7
  import { getColorSchemeForSeed as gn, CHIP_COLORS as sa, Tooltip as ke, ErrorIcon as An, Typography as q, CircleIcon as bn, FunctionsIcon as la, iconKeys as ii, coolIconKeys as Yr, Icon as ni, IconButton as de, ContentCopyIcon as pr, OpenInNewIcon as Yt, DescriptionIcon as ca, Skeleton as Ye, Chip as oi, cls as Z, defaultBorderMixin as Se, KeyboardTabIcon as ai, Checkbox as Lt, Markdown as si, TextareaAutosize as da, MultiSelect as yn, MultiSelectItem as wn, Select as tt, SelectItem as rt, BooleanSwitch as ua, DateTimeField as Ut, paperMixin as fr, ErrorOutlineIcon as ma, EditIcon as pa, Button as ge, RemoveCircleIcon as fa, Menu as xt, MoreVertIcon as vn, MenuItem as Re, CircularProgress as Et, SearchBar as li, Badge as Ri, ArrowUpwardIcon as Sr, Popover as ci, FilterListIcon as ha, AssignmentIcon as ga, CenteredView as er, Label as di, TextField as wt, ClearIcon as Tt, BooleanSwitchWithLabel as hr, useOutsideAlerter as kn, Dialog as ui, DialogContent as mi, DialogActions as Ct, FileCopyIcon as Aa, ArchiveIcon as ba, DeleteIcon as Lr, AddIcon as ct, ExpandablePanel as dt, Card as ya, ArrowForwardIcon as _n, cardMixin as wa, cardClickableMixin as va, focusedMixin as Ur, StarIcon as xn, StarBorderIcon as En, Collapse as Cn, Container as ka, FilterListOffIcon as _a, SearchIcon as xa, LoadingButton as Ea, Avatar as Di, DarkModeIcon as Ca, LightModeIcon as Ba, LogoutIcon as Sa, fieldBackgroundHoverMixin as pi, HandleIcon as Ia, RemoveIcon as fi, debounce as Na, InfoIcon as Fa, CloseIcon as Bn, fieldBackgroundMixin as ar, fieldBackgroundDisabledMixin as Sn, ArrowDropDownIcon as In, useInjectStyles as Pa, Alert as Qa, ShortTextIcon as Ra, SubjectIcon as Da, FormatQuoteIcon as Ta, HttpIcon as Oa, EmailIcon as Ma, FlagIcon as za, ListIcon as Va, ListAltIcon as Ga, NumbersIcon as ja, FormatListNumberedIcon as Ti, UploadFileIcon as Ya, DriveFolderUploadIcon as La, LinkIcon as Ua, AddLinkIcon as $a, ScheduleIcon as qa, BallotIcon as Oi, RepeatIcon as Mi, ViewStreamIcon as Wa, Tab as Ir, Tabs as Ja, Sheet as Nn, useLocaleConfig as Ha, MenuIcon as zi, ChevronLeftIcon as Za } from "@firecms/ui";
8
- import $ from "react-fast-compare";
8
+ import U from "react-fast-compare";
9
9
  import { Link as gr, useNavigate as $t, useLocation as Ar, UNSAFE_NavigationContext as Xa, NavLink as Ka, Route as tr, Routes as es } from "react-router-dom";
10
10
  import { format as ts } from "date-fns";
11
11
  import * as rs from "date-fns/locale";
@@ -2445,7 +2445,7 @@ const Hr = S.memo(
2445
2445
  const s = Yr.length;
2446
2446
  return o || (o = Yr[xs(t.path) % s]), /* @__PURE__ */ n(ni, { iconKey: o, size: "medium", className: r });
2447
2447
  },
2448
- (e, t) => $(e.collectionOrView?.icon, t.collectionOrView?.icon)
2448
+ (e, t) => U(e.collectionOrView?.icon, t.collectionOrView?.icon)
2449
2449
  ), cr = ii.reduce((e, t) => (e[t] = t, e), {});
2450
2450
  function Nu(e, t) {
2451
2451
  if (t !== void 0 && t === 1)
@@ -3359,9 +3359,9 @@ function Uu(e) {
3359
3359
  ]
3360
3360
  );
3361
3361
  let J = !1;
3362
- ho(m.current ?? [], T) || (m.current = T, J = !0), $(p.current, oe) || (p.current = oe, J = !0), $(h.current, te) || (h.current = te, J = !0);
3362
+ ho(m.current ?? [], T) || (m.current = T, J = !0), U(p.current, oe) || (p.current = oe, J = !0), U(h.current, te) || (h.current = te, J = !0);
3363
3363
  const j = Y(T, oe, te, c);
3364
- J && !$(b, j) && y(j);
3364
+ J && !U(b, j) && y(j);
3365
3365
  } catch (T) {
3366
3366
  console.error(T), C(T);
3367
3367
  }
@@ -3409,7 +3409,7 @@ function Uu(e) {
3409
3409
  if (te = V.subcollections, J === T.length - 1)
3410
3410
  return V;
3411
3411
  }
3412
- }, []), U = x((T) => {
3412
+ }, []), $ = x((T) => {
3413
3413
  const oe = m.current;
3414
3414
  if (oe === void 0)
3415
3415
  throw Error("getCollectionFromIds: Collections have not been initialised yet");
@@ -3459,7 +3459,7 @@ function Uu(e) {
3459
3459
  J.push(N.path), te = N.subcollections;
3460
3460
  }
3461
3461
  return J;
3462
- }, [U]);
3462
+ }, [$]);
3463
3463
  return {
3464
3464
  collections: m.current,
3465
3465
  views: p.current,
@@ -3472,7 +3472,7 @@ function Uu(e) {
3472
3472
  initialised: A,
3473
3473
  getCollection: ie,
3474
3474
  getCollectionFromPaths: H,
3475
- getCollectionFromIds: U,
3475
+ getCollectionFromIds: $,
3476
3476
  isUrlCollectionPath: O,
3477
3477
  urlPathToDataPath: K,
3478
3478
  buildUrlCollectionPath: D,
@@ -3532,7 +3532,7 @@ function Us(e, t) {
3532
3532
  subcollections: a,
3533
3533
  ...o
3534
3534
  } = t;
3535
- return ho(r ?? [], a ?? []) ? $(i, o) : !1;
3535
+ return ho(r ?? [], a ?? []) ? U(i, o) : !1;
3536
3536
  }
3537
3537
  function qu() {
3538
3538
  const e = le({}), t = x((p) => {
@@ -3608,7 +3608,7 @@ function Ju({
3608
3608
  return;
3609
3609
  }
3610
3610
  const A = t.user;
3611
- if (r instanceof Function && A && !$(p.current?.uid, A.uid)) {
3611
+ if (r instanceof Function && A && !U(p.current?.uid, A.uid)) {
3612
3612
  l(!0);
3613
3613
  try {
3614
3614
  await r({
@@ -4947,7 +4947,7 @@ const Fe = S.memo(function(t) {
4947
4947
  }
4948
4948
  ) : i = lt(o, u.dataType, s) : i = JSON.stringify(s);
4949
4949
  return i == null || Array.isArray(i) && i.length === 0 ? /* @__PURE__ */ n(gt, {}) : i;
4950
- }, $);
4950
+ }, U);
4951
4951
  function lt(e, t, r) {
4952
4952
  return console.warn(`Unexpected value for property ${e}, of type ${t}`, r), /* @__PURE__ */ n(
4953
4953
  Ne,
@@ -5411,7 +5411,7 @@ function xo({
5411
5411
  size: m
5412
5412
  })), [A, g] = R(i), [b, y] = R(h);
5413
5413
  z(() => {
5414
- $(A, i) || (g(i), y(h));
5414
+ U(A, i) || (g(i), y(h));
5415
5415
  }, [h, i, A]);
5416
5416
  const w = x(async (k) => {
5417
5417
  if (d.fileName) {
@@ -5712,7 +5712,7 @@ function Fl({
5712
5712
  });
5713
5713
  }
5714
5714
  }
5715
- ), { ...Y } = B(), ne = d ? "Drag 'n' drop some files here, or click here to edit" : "Drag 'n' drop a file here, or click here edit", ie = d ? e.of : e, H = he(() => vt(w), [w]), U = !f && l;
5715
+ ), { ...Y } = B(), ne = d ? "Drag 'n' drop some files here, or click here to edit" : "Drag 'n' drop a file here, or click here edit", ie = d ? e.of : e, H = he(() => vt(w), [w]), $ = !f && l;
5716
5716
  return /* @__PURE__ */ v(
5717
5717
  "div",
5718
5718
  {
@@ -5773,7 +5773,7 @@ function Fl({
5773
5773
  /* @__PURE__ */ n(
5774
5774
  Co,
5775
5775
  {
5776
- showError: U,
5776
+ showError: $,
5777
5777
  disabled: f,
5778
5778
  showExpandIcon: !0,
5779
5779
  selected: s,
@@ -5915,7 +5915,7 @@ const Ql = S.memo(
5915
5915
  )
5916
5916
  ] }) : /* @__PURE__ */ n(Ne, { error: "The specified collection does not exist" });
5917
5917
  },
5918
- $
5918
+ U
5919
5919
  );
5920
5920
  ze.addMethod(ze.array, "uniqueInArray", function(e = (r) => r, t) {
5921
5921
  return this.test("uniqueInArray", t, (r) => !r || r.length === new Set(r.map(e)).size);
@@ -6261,7 +6261,7 @@ const Yl = ({
6261
6261
  o ? p(void 0) : !a && se && p(se);
6262
6262
  }, [w, p, a, o]), Y = x((se) => {
6263
6263
  D(), se.stopPropagation();
6264
- }, [D]), ne = he(() => y ? y.height > E : !1, [y, E]), ie = !F && a, H = !o && u && ne, U = !o && !u && ne, O = x(() => C(!0), []), K = x(() => C(!1), []), ee = F ? "border-red-500" : k ? "border-green-500" : ie ? "border-primary" : "border-transparent";
6264
+ }, [D]), ne = he(() => y ? y.height > E : !1, [y, E]), ie = !F && a, H = !o && u && ne, $ = !o && !u && ne, O = x(() => C(!0), []), K = x(() => C(!1), []), ee = F ? "border-red-500" : k ? "border-green-500" : ie ? "border-primary" : "border-transparent";
6265
6265
  return /* @__PURE__ */ v(
6266
6266
  "div",
6267
6267
  {
@@ -6288,14 +6288,14 @@ const Yl = ({
6288
6288
  onMouseLeave: K,
6289
6289
  children: [
6290
6290
  /* @__PURE__ */ v(me, { children: [
6291
- m && !U && t,
6292
- (!m || U) && /* @__PURE__ */ n(
6291
+ m && !$ && t,
6292
+ (!m || $) && /* @__PURE__ */ n(
6293
6293
  Yl,
6294
6294
  {
6295
6295
  fullHeight: m ?? !1,
6296
6296
  justifyContent: P,
6297
6297
  scrollable: H ?? !1,
6298
- faded: U,
6298
+ faded: $,
6299
6299
  children: !m && /* @__PURE__ */ n(
6300
6300
  "div",
6301
6301
  {
@@ -6358,7 +6358,7 @@ const $l = S.memo(
6358
6358
  P(!0), setTimeout(() => {
6359
6359
  P(!1);
6360
6360
  }, 100);
6361
- }, []), Y = !!a.Field, ne = !!a.Preview, ie = qt(a), H = typeof a.disabled == "object" ? a.disabled.disabledMessage : void 0, U = u || f || !!a.disabled, O = he(() => Gt({
6361
+ }, []), Y = !!a.Field, ne = !!a.Preview, ie = qt(a), H = typeof a.disabled == "object" ? a.disabled.disabledMessage : void 0, $ = u || f || !!a.disabled, O = he(() => Gt({
6362
6362
  property: a,
6363
6363
  entityId: d.id,
6364
6364
  customFieldValidator: r,
@@ -6366,12 +6366,12 @@ const $l = S.memo(
6366
6366
  }), [d.id, a, t]);
6367
6367
  z(
6368
6368
  () => {
6369
- $(i, _.current) || (F(void 0), E(i), _.current = i, D());
6369
+ U(i, _.current) || (F(void 0), E(i), _.current = i, D());
6370
6370
  },
6371
6371
  [D, i]
6372
6372
  );
6373
6373
  const K = (N) => {
6374
- $(N, _.current) || (P(!1), O.validate(N).then(() => {
6374
+ U(N, _.current) || (P(!1), O.validate(N).then(() => {
6375
6375
  if (F(void 0), _.current = N, p)
6376
6376
  try {
6377
6377
  p({
@@ -6418,7 +6418,7 @@ const $l = S.memo(
6418
6418
  } : void 0);
6419
6419
  };
6420
6420
  let W, re = !1, T = !1, oe = !0, te = !1, J = !1, j = !0;
6421
- const V = !U && C;
6421
+ const V = !$ && C;
6422
6422
  if (u || ie)
6423
6423
  return /* @__PURE__ */ n(
6424
6424
  ur,
@@ -6451,7 +6451,7 @@ const $l = S.memo(
6451
6451
  Nl,
6452
6452
  {
6453
6453
  error: B ?? C,
6454
- disabled: U,
6454
+ disabled: $,
6455
6455
  focused: y,
6456
6456
  selected: y,
6457
6457
  openPopup: b ? ce : void 0,
@@ -6471,7 +6471,7 @@ const $l = S.memo(
6471
6471
  {
6472
6472
  name: t,
6473
6473
  multiple: !1,
6474
- disabled: U,
6474
+ disabled: $,
6475
6475
  focused: y,
6476
6476
  valueType: "number",
6477
6477
  small: it(h) !== "medium",
@@ -6486,7 +6486,7 @@ const $l = S.memo(
6486
6486
  align: o,
6487
6487
  error: B ?? C,
6488
6488
  focused: y,
6489
- disabled: U,
6489
+ disabled: $,
6490
6490
  value: w,
6491
6491
  updateValue: ee
6492
6492
  }
@@ -6500,7 +6500,7 @@ const $l = S.memo(
6500
6500
  name: t,
6501
6501
  multiple: !1,
6502
6502
  focused: y,
6503
- disabled: U,
6503
+ disabled: $,
6504
6504
  valueType: "string",
6505
6505
  small: it(h) !== "medium",
6506
6506
  enumValues: Q.enumValues,
@@ -6515,7 +6515,7 @@ const $l = S.memo(
6515
6515
  yl,
6516
6516
  {
6517
6517
  error: B ?? C,
6518
- disabled: U,
6518
+ disabled: $,
6519
6519
  multiline: Ae,
6520
6520
  focused: y,
6521
6521
  value: w,
@@ -6528,7 +6528,7 @@ const $l = S.memo(
6528
6528
  vl,
6529
6529
  {
6530
6530
  error: B ?? C,
6531
- disabled: U,
6531
+ disabled: $,
6532
6532
  focused: y,
6533
6533
  internalValue: w,
6534
6534
  updateValue: ee
@@ -6540,7 +6540,7 @@ const $l = S.memo(
6540
6540
  {
6541
6541
  name: t,
6542
6542
  error: B ?? C,
6543
- disabled: U,
6543
+ disabled: $,
6544
6544
  mode: a.mode,
6545
6545
  focused: y,
6546
6546
  internalValue: w,
@@ -6554,7 +6554,7 @@ const $l = S.memo(
6554
6554
  name: t,
6555
6555
  internalValue: w,
6556
6556
  updateValue: ee,
6557
- disabled: U,
6557
+ disabled: $,
6558
6558
  size: h,
6559
6559
  path: a.path,
6560
6560
  multiselect: !1,
@@ -6574,7 +6574,7 @@ const $l = S.memo(
6574
6574
  {
6575
6575
  name: t,
6576
6576
  multiple: !0,
6577
- disabled: U,
6577
+ disabled: $,
6578
6578
  focused: y,
6579
6579
  small: it(h) !== "medium",
6580
6580
  valueType: Q.of.dataType,
@@ -6587,7 +6587,7 @@ const $l = S.memo(
6587
6587
  tn,
6588
6588
  {
6589
6589
  name: t,
6590
- disabled: U,
6590
+ disabled: $,
6591
6591
  internalValue: w,
6592
6592
  updateValue: ee,
6593
6593
  size: h,
@@ -6602,7 +6602,7 @@ const $l = S.memo(
6602
6602
  )), re = !1));
6603
6603
  }
6604
6604
  }
6605
- return W || (re = !1, T = m && y && !W && !U && !ie, W = /* @__PURE__ */ n(
6605
+ return W || (re = !1, T = m && y && !W && !$ && !ie, W = /* @__PURE__ */ n(
6606
6606
  Fe,
6607
6607
  {
6608
6608
  width: s,
@@ -6619,7 +6619,7 @@ const $l = S.memo(
6619
6619
  width: s,
6620
6620
  onSelect: se,
6621
6621
  selected: y,
6622
- disabled: U || ie,
6622
+ disabled: $ || ie,
6623
6623
  disabledTooltip: H ?? "Disabled",
6624
6624
  removePadding: te,
6625
6625
  fullHeight: J,
@@ -6634,10 +6634,10 @@ const $l = S.memo(
6634
6634
  Co,
6635
6635
  {
6636
6636
  showError: V,
6637
- disabled: U,
6637
+ disabled: $,
6638
6638
  showExpandIcon: T,
6639
6639
  selected: y,
6640
- openPopup: U ? void 0 : ce
6640
+ openPopup: $ ? void 0 : ce
6641
6641
  }
6642
6642
  ),
6643
6643
  children: W
@@ -6648,7 +6648,7 @@ const $l = S.memo(
6648
6648
  ql
6649
6649
  );
6650
6650
  function ql(e, t) {
6651
- return e.height === t.height && e.propertyKey === t.propertyKey && e.align === t.align && e.width === t.width && $(e.property, t.property) && $(e.value, t.value) && $(e.entity.id, t.entity.id) && $(e.entity.values, t.entity.values);
6651
+ return e.height === t.height && e.propertyKey === t.propertyKey && e.align === t.align && e.width === t.width && U(e.property, t.property) && U(e.value, t.value) && U(e.entity.id, t.entity.id) && U(e.entity.values, t.entity.values);
6652
6652
  }
6653
6653
  const ki = function({
6654
6654
  entity: t,
@@ -7094,7 +7094,7 @@ const Xl = S.memo(
7094
7094
  }
7095
7095
  ) });
7096
7096
  },
7097
- $
7097
+ U
7098
7098
  );
7099
7099
  function Kl({
7100
7100
  column: e,
@@ -7282,7 +7282,7 @@ const ec = ({
7282
7282
  }
7283
7283
  );
7284
7284
  },
7285
- $
7285
+ U
7286
7286
  ), rc = S.memo(
7287
7287
  function(t) {
7288
7288
  return t.rowData && t.cellRenderer(
@@ -7298,7 +7298,7 @@ const ec = ({
7298
7298
  }
7299
7299
  );
7300
7300
  },
7301
- (e, t) => $(e.rowData, t.rowData) && $(e.column, t.column) && $(e.cellData, t.cellData) && $(e.rowIndex, t.rowIndex) && $(e.cellRenderer, t.cellRenderer) && $(e.columnIndex, t.columnIndex)
7301
+ (e, t) => U(e.rowData, t.rowData) && U(e.column, t.column) && U(e.cellData, t.cellData) && U(e.rowIndex, t.rowIndex) && U(e.cellRenderer, t.cellRenderer) && U(e.columnIndex, t.columnIndex)
7302
7302
  ), _r = ra({});
7303
7303
  _r.displayName = "VirtualListContext";
7304
7304
  const ic = ia(({
@@ -7374,7 +7374,7 @@ const ic = ia(({
7374
7374
  }, [o]);
7375
7375
  const [ne, ie] = Fn(), H = x((j) => {
7376
7376
  P(I.map((V) => V.key === j.column.key ? j.column : V));
7377
- }, [I]), U = x((j) => {
7377
+ }, [I]), $ = x((j) => {
7378
7378
  P(I.map((V) => V.key === j.column.key ? j.column : V)), l && l(j);
7379
7379
  }, [I, l]), O = le();
7380
7380
  z(() => {
@@ -7429,7 +7429,7 @@ const ic = ia(({
7429
7429
  onRowClick: s,
7430
7430
  customView: te,
7431
7431
  onColumnResize: H,
7432
- onColumnResizeEnd: U,
7432
+ onColumnResizeEnd: $,
7433
7433
  filter: O.current,
7434
7434
  onColumnSort: ee,
7435
7435
  onFilterUpdate: re,
@@ -7468,7 +7468,7 @@ const ic = ia(({
7468
7468
  }
7469
7469
  );
7470
7470
  },
7471
- $
7471
+ U
7472
7472
  );
7473
7473
  function oc({
7474
7474
  outerRef: e,
@@ -7942,7 +7942,7 @@ const uc = S.memo(
7942
7942
  endAdornment: Y,
7943
7943
  AddColumnComponent: ne
7944
7944
  }) {
7945
- const ie = le(null), [H, U] = S.useState(void 0), O = () => {
7945
+ const ie = le(null), [H, $] = S.useState(void 0), O = () => {
7946
7946
  !_ || d || u || y !== void 0 && w?.(y + E);
7947
7947
  }, K = x(() => {
7948
7948
  w?.(E);
@@ -7965,9 +7965,9 @@ const uc = S.memo(
7965
7965
  };
7966
7966
  });
7967
7967
  const se = x((re) => {
7968
- U(re);
7968
+ $(re);
7969
7969
  }, []), ce = x(() => {
7970
- U(void 0);
7970
+ $(void 0);
7971
7971
  }, []), W = x((re) => {
7972
7972
  p?.({ ...re, ...P });
7973
7973
  }, [P]);
@@ -8019,7 +8019,7 @@ const uc = S.memo(
8019
8019
  }
8020
8020
  );
8021
8021
  },
8022
- $
8022
+ U
8023
8023
  );
8024
8024
  function mc({
8025
8025
  id: e,
@@ -8124,7 +8124,7 @@ const Qo = function({
8124
8124
  emptyComponent: ne,
8125
8125
  getIdColumnWidth: ie,
8126
8126
  onTextSearchClick: H,
8127
- textSearchLoading: U,
8127
+ textSearchLoading: $,
8128
8128
  enablePopupIcon: O
8129
8129
  }) {
8130
8130
  const K = le(null), ee = We(), se = (f?.selectedEntities?.length > 0 ? f?.selectedEntities : m)?.filter(Boolean), ce = Ie(), [W, re] = S.useState(_ ?? "m"), T = se?.map((M) => M.id), oe = x((M) => {
@@ -8265,7 +8265,7 @@ const Qo = function({
8265
8265
  Wl,
8266
8266
  {
8267
8267
  onTextSearch: g ? te : void 0,
8268
- textSearchLoading: U,
8268
+ textSearchLoading: $,
8269
8269
  onTextSearchClick: g ? H : void 0,
8270
8270
  size: W,
8271
8271
  onSizeChanged: oe,
@@ -8308,10 +8308,10 @@ function pc({
8308
8308
  return [...t, ...e.filter((i) => !r.has(i.id))];
8309
8309
  }
8310
8310
  function fc(e, t, r = 5e3) {
8311
- const [i, a] = S.useState(e), o = S.useRef(i.length ?? 0), s = S.useRef(!1), l = S.useRef(t), c = !$(l.current, t), d = e.length >= o.current || c;
8311
+ const [i, a] = S.useState(e), o = S.useRef(i.length ?? 0), s = S.useRef(!1), l = S.useRef(t), c = !U(l.current, t), d = e.length >= o.current || c;
8312
8312
  return S.useEffect(() => {
8313
8313
  const u = () => {
8314
- $(i, e) || (l.current = t, o.current = e.length, a(e)), s.current = !1;
8314
+ U(i, e) || (l.current = t, o.current = e.length, a(e)), s.current = !1;
8315
8315
  };
8316
8316
  s.current = !0;
8317
8317
  let f;
@@ -8340,9 +8340,9 @@ function Ro({
8340
8340
  return s;
8341
8341
  }, [s, p]);
8342
8342
  z(() => {
8343
- $(p, _) || C(p);
8343
+ U(p, _) || C(p);
8344
8344
  }, [p]);
8345
- const [_, C] = S.useState(p ?? o ?? void 0), [k, B] = S.useState(E), F = k ? k[0] : void 0, I = k ? k[1] : void 0, P = Ie(), [D, Y] = R([]), [ne, ie] = R(!1), [H, U] = R(), [O, K] = R(!1), ee = x((T, oe) => f.isFilterCombinationValid ? f.isFilterCombinationValid({
8345
+ const [_, C] = S.useState(p ?? o ?? void 0), [k, B] = S.useState(E), F = k ? k[0] : void 0, I = k ? k[1] : void 0, P = Ie(), [D, Y] = R([]), [ne, ie] = R(!1), [H, $] = R(), [O, K] = R(!1), ee = x((T, oe) => f.isFilterCombinationValid ? f.isFilterCombinationValid({
8346
8346
  path: m,
8347
8347
  collection: t,
8348
8348
  filterValues: T,
@@ -8370,12 +8370,12 @@ function Ro({
8370
8370
  } catch (J) {
8371
8371
  console.error(J);
8372
8372
  }
8373
- ie(!1), U(void 0), Y(te.map((J) => ({
8373
+ ie(!1), $(void 0), Y(te.map((J) => ({
8374
8374
  ...J
8375
8375
  // values: sanitizeData(e.values, resolvedCollection.properties)
8376
8376
  }))), K(!y || te.length < y);
8377
8377
  }, oe = (te) => {
8378
- console.error("ERROR", te), ie(!1), Y([]), U(te);
8378
+ console.error("ERROR", te), ie(!1), Y([]), $(te);
8379
8379
  };
8380
8380
  return f.listenCollection ? f.listenCollection({
8381
8381
  path: m,
@@ -8725,27 +8725,27 @@ function Ac({
8725
8725
  maxSelection: c
8726
8726
  }) {
8727
8727
  const d = Fi(), u = pt(), f = _e(), m = St(), p = pe(), h = f.resolveAliasesFrom(a), A = qe(i), [g, b] = R([]), y = (H) => {
8728
- let U;
8728
+ let $;
8729
8729
  const O = w.selectedEntities;
8730
8730
  if (m.onAnalyticsEvent?.("reference_selection_toggle", {
8731
8731
  path: h,
8732
8732
  entityId: H.id
8733
8733
  }), O) {
8734
8734
  if (O.map((K) => K.id).indexOf(H.id) > -1)
8735
- U = O.filter((K) => K.id !== H.id);
8735
+ $ = O.filter((K) => K.id !== H.id);
8736
8736
  else {
8737
8737
  if (c && O.length >= c)
8738
8738
  return;
8739
- U = [...O, H];
8739
+ $ = [...O, H];
8740
8740
  }
8741
- w.setSelectedEntities(U), t && t(U);
8741
+ w.setSelectedEntities($), t && t($);
8742
8742
  }
8743
8743
  }, w = Do(y);
8744
8744
  z(() => {
8745
8745
  let H = !1;
8746
- const U = o?.map((O) => O?.toString()).filter(Boolean);
8747
- return U && i ? Promise.all(
8748
- U.map((O) => A.fetchEntity({
8746
+ const $ = o?.map((O) => O?.toString()).filter(Boolean);
8747
+ return $ && i ? Promise.all(
8748
+ $.map((O) => A.fetchEntity({
8749
8749
  path: h,
8750
8750
  entityId: O,
8751
8751
  collection: i
@@ -8782,7 +8782,7 @@ function Ac({
8782
8782
  });
8783
8783
  }, k = ({
8784
8784
  entity: H,
8785
- size: U,
8785
+ size: $,
8786
8786
  width: O,
8787
8787
  frozen: K
8788
8788
  }) => {
@@ -8793,7 +8793,7 @@ function Ac({
8793
8793
  width: O,
8794
8794
  frozen: K,
8795
8795
  entity: H,
8796
- size: U,
8796
+ size: $,
8797
8797
  isSelected: se,
8798
8798
  selectionEnabled: r,
8799
8799
  hideId: i?.hideIdFromCollection,
@@ -9592,7 +9592,7 @@ function Fc({
9592
9592
  }) : Promise.resolve());
9593
9593
  if (!y)
9594
9594
  return /* @__PURE__ */ n(G, {});
9595
- const U = pn({
9595
+ const $ = pn({
9596
9596
  initialValues: y?.values ?? {},
9597
9597
  validation: (V) => ne?.validate(V, { abortEarly: !1 }).then(() => ({})).catch((N) => {
9598
9598
  const Q = {};
@@ -9604,9 +9604,9 @@ function Fc({
9604
9604
  onSubmit: (V, N) => {
9605
9605
  H(V).then(() => c()).finally(() => N.setSubmitting(!1));
9606
9606
  }
9607
- }), { values: O, isSubmitting: K, setFieldValue: ee, handleSubmit: se } = U;
9607
+ }), { values: O, isSubmitting: K, setFieldValue: ee, handleSubmit: se } = $;
9608
9608
  if (z(() => {
9609
- $(O, E) || _(O);
9609
+ U(O, E) || _(O);
9610
9610
  }, [O]), !y)
9611
9611
  return /* @__PURE__ */ n(
9612
9612
  Ne,
@@ -9756,7 +9756,7 @@ function Fc({
9756
9756
  {
9757
9757
  asChild: !0,
9758
9758
  container: u,
9759
- children: /* @__PURE__ */ n(fn, { value: U, children: j })
9759
+ children: /* @__PURE__ */ n(fn, { value: $, children: j })
9760
9760
  }
9761
9761
  );
9762
9762
  }
@@ -9843,7 +9843,7 @@ const Rc = "collectionGroupParent", Vo = S.memo(
9843
9843
  }, [w]), D = x((X) => {
9844
9844
  const fe = b.current;
9845
9845
  return Hn(fe, f, l, X ?? null) ? fe.inlineEditing === void 0 || fe.inlineEditing : !1;
9846
- }, [f, l]), Y = g.selectionEnabled === void 0 || g.selectionEnabled, ne = !D(), [ie, H] = R(!1), U = Do(), O = g.selectionController ?? U, {
9846
+ }, [f, l]), Y = g.selectionEnabled === void 0 || g.selectionEnabled, ne = !D(), [ie, H] = R(!1), $ = Do(), O = g.selectionController ?? $, {
9847
9847
  selectedEntities: K,
9848
9848
  isEntitySelected: ee,
9849
9849
  setSelectedEntities: se
@@ -10240,7 +10240,7 @@ const Rc = "collectionGroupParent", Vo = S.memo(
10240
10240
  }
10241
10241
  );
10242
10242
  },
10243
- (e, t) => $(e.fullPath, t.fullPath) && $(e.parentCollectionIds, t.parentCollectionIds) && $(e.isSubCollection, t.isSubCollection) && $(e.className, t.className) && $(e.properties, t.properties) && $(e.propertiesOrder, t.propertiesOrder) && $(e.hideIdFromCollection, t.hideIdFromCollection) && $(e.inlineEditing, t.inlineEditing) && $(e.selectionEnabled, t.selectionEnabled) && $(e.selectionController, t.selectionController) && $(e.Actions, t.Actions) && $(e.defaultSize, t.defaultSize) && $(e.initialFilter, t.initialFilter) && $(e.initialSort, t.initialSort) && $(e.textSearchEnabled, t.textSearchEnabled) && $(e.additionalFields, t.additionalFields) && $(e.sideDialogWidth, t.sideDialogWidth) && $(e.forceFilter, t.forceFilter)
10243
+ (e, t) => U(e.fullPath, t.fullPath) && U(e.parentCollectionIds, t.parentCollectionIds) && U(e.isSubCollection, t.isSubCollection) && U(e.className, t.className) && U(e.properties, t.properties) && U(e.propertiesOrder, t.propertiesOrder) && U(e.hideIdFromCollection, t.hideIdFromCollection) && U(e.inlineEditing, t.inlineEditing) && U(e.selectionEnabled, t.selectionEnabled) && U(e.selectionController, t.selectionController) && U(e.Actions, t.Actions) && U(e.defaultSize, t.defaultSize) && U(e.initialFilter, t.initialFilter) && U(e.initialSort, t.initialSort) && U(e.textSearchEnabled, t.textSearchEnabled) && U(e.additionalFields, t.additionalFields) && U(e.sideDialogWidth, t.sideDialogWidth) && U(e.forceFilter, t.forceFilter)
10244
10244
  );
10245
10245
  function Dc({
10246
10246
  fullPath: e,
@@ -12165,7 +12165,7 @@ const It = S.memo(rd, (e, t) => {
12165
12165
  if (e.propertyKey !== t.propertyKey)
12166
12166
  return !1;
12167
12167
  const r = De(e.property) || e.property.fromBuilder, i = De(t.property) || t.property.fromBuilder;
12168
- return !((r === i || $(e.property, t.property)) && e.disabled === t.disabled) || ei(t.property), !1;
12168
+ return !((r === i || U(e.property, t.property)) && e.disabled === t.disabled) || ei(t.property), !1;
12169
12169
  });
12170
12170
  function rd({
12171
12171
  propertyKey: e,
@@ -14077,7 +14077,10 @@ function yd({ propertyId: e }) {
14077
14077
  ) })
14078
14078
  ] });
14079
14079
  }
14080
- const wd = vd;
14080
+ const wd = S.memo(
14081
+ vd,
14082
+ (e, t) => e.status === t.status && e.path === t.path && U(e.entity?.values, t.entity?.values)
14083
+ );
14081
14084
  function mn(e, t, r) {
14082
14085
  const i = e.properties;
14083
14086
  if ((t === "existing" || t === "copy") && r)
@@ -14109,7 +14112,7 @@ function vd({
14109
14112
  path: t,
14110
14113
  values: i?.values,
14111
14114
  fields: h.propertyConfigs
14112
- }), [i?.values, t, h.propertyConfigs]), w = (e === "new" || e === "copy") && !!y.customId && y.customId !== "optional", E = he(() => e === "new" || e === "copy" ? w ? void 0 : g.generateEntityId(t) : i?.id, []), _ = le(!1), C = le(mn(y, e, i)), [k, B] = S.useState(E), [F, I] = S.useState(!1), [P, D] = S.useState(), [Y, ne] = S.useState(!1), [ie, H] = R(i?.values ?? C.current), U = (ae) => a({
14115
+ }), [i?.values, t, h.propertyConfigs]), w = (e === "new" || e === "copy") && !!y.customId && y.customId !== "optional", E = he(() => e === "new" || e === "copy" ? w ? void 0 : g.generateEntityId(t) : i?.id, []), _ = le(!1), C = le(mn(y, e, i)), [k, B] = S.useState(E), [F, I] = S.useState(!1), [P, D] = S.useState(), [Y, ne] = S.useState(!1), [ie, H] = R(i?.values ?? C.current), $ = (ae) => a({
14113
14116
  collection: se,
14114
14117
  path: t,
14115
14118
  entityId: k,
@@ -14137,7 +14140,7 @@ function vd({
14137
14140
  throw Error("Form misconfiguration when saving, entityId should be set");
14138
14141
  } else
14139
14142
  throw Error("New FormType added, check EntityForm");
14140
- return U(ae)?.then((ue) => {
14143
+ return $(ae)?.then((ue) => {
14141
14144
  M.resetForm({
14142
14145
  values: ae,
14143
14146
  submitCount: 0,
@@ -14164,13 +14167,13 @@ function vd({
14164
14167
  if (br(ue))
14165
14168
  return {};
14166
14169
  const ve = ae[M], we = C.current[M];
14167
- return $(ve, we) ? {} : { [M]: we };
14170
+ return U(ve, we) ? {} : { [M]: we };
14168
14171
  }).reduce((M, ue) => ({ ...M, ...ue }), {})
14169
14172
  ) : te({});
14170
14173
  }, [i, y, e]);
14171
14174
  const ee = (ae) => {
14172
14175
  const M = K.initialValues;
14173
- H(ae), l && l(ae), f && ae && !$(ae, M) && U(ae);
14176
+ H(ae), l && l(ae), f && ae && !U(ae, M) && $(ae);
14174
14177
  };
14175
14178
  z(() => {
14176
14179
  k && c && c(k);
@@ -14230,7 +14233,7 @@ function vd({
14230
14233
  collection: se,
14231
14234
  entityId: k,
14232
14235
  path: t,
14233
- save: U
14236
+ save: $
14234
14237
  }, Be = le(null);
14235
14238
  if (z(() => {
14236
14239
  d && !xd(Be.current ?? void 0, Ae) && (d(Ae), Be.current = Ae);
@@ -14346,7 +14349,7 @@ function kd(e) {
14346
14349
  }, [k, t]), z(() => {
14347
14350
  !y && !f && o && l && Object.entries(o).forEach(([P, D]) => {
14348
14351
  const Y = t[P];
14349
- !$(D, Y) && !c[P] && (console.debug("Updated value from the datasource:", P, D), d(P, D !== void 0 ? D : null));
14352
+ !U(D, Y) && !c[P] && (console.debug("Updated value from the datasource:", P, D), d(P, D !== void 0 ? D : null));
14350
14353
  });
14351
14354
  }, [f, y, o, l, t, c, d]);
14352
14355
  const B = /* @__PURE__ */ n("div", { className: "flex flex-col gap-8", children: (u.propertiesOrder ?? Object.keys(u.properties)).map((P) => {
@@ -14485,7 +14488,7 @@ function _d(e) {
14485
14488
  return t;
14486
14489
  }
14487
14490
  function xd(e, t) {
14488
- return e?.path === t?.path && e?.entityId === t?.entityId && $(e?.values, t?.values) && $(e?.collection, t?.collection);
14491
+ return e?.path === t?.path && e?.entityId === t?.entityId && U(e?.values, t?.values) && U(e?.collection, t?.collection);
14489
14492
  }
14490
14493
  function Ed(e) {
14491
14494
  return Object.keys(Si).includes(e);
@@ -15094,13 +15097,13 @@ function Id({
15094
15097
  closeAfterSave: !1
15095
15098
  });
15096
15099
  }, !1, 2e3);
15097
- const h = qe(a), A = Fi(), g = pt(), b = ft(), y = pe(), w = Ie(), E = mt(), [_, C] = R(void 0), [k, B] = R(i ? "copy" : t ? "existing" : "new"), F = le(void 0), I = F.current, P = (a.subcollections ?? []).filter((L) => !L.hideFromNavigation), D = P?.length ?? 0, Y = a.entityViews, ne = Y?.length ?? 0, ie = a.formAutoSave && !a.customId, H = ne > 0 || D > 0, U = r ?? qn(
15100
+ const h = qe(a), A = Fi(), g = pt(), b = ft(), y = pe(), w = Ie(), E = mt(), [_, C] = R(void 0), [k, B] = R(i ? "copy" : t ? "existing" : "new"), F = le(void 0), I = F.current, P = (a.subcollections ?? []).filter((L) => !L.hideFromNavigation), D = P?.length ?? 0, Y = a.entityViews, ne = Y?.length ?? 0, ie = a.formAutoSave && !a.customId, H = ne > 0 || D > 0, $ = r ?? qn(
15098
15101
  a ? a.defaultSelectedView : void 0,
15099
15102
  {
15100
15103
  status: k,
15101
15104
  entityId: t
15102
15105
  }
15103
- ), O = le(U ?? Zt), K = O.current === Zt, {
15106
+ ), O = le($ ?? Zt), K = O.current === Zt, {
15104
15107
  entity: ee,
15105
15108
  dataLoading: se,
15106
15109
  // eslint-disable-next-line no-unused-vars
@@ -15757,7 +15760,7 @@ function Md() {
15757
15760
  };
15758
15761
  z(() => {
15759
15762
  const p = (e.state?.panels ?? []).map((h) => o.current[h]).filter((h) => !!h);
15760
- $(a.current.map((h) => h.key), p.map((h) => h.key)) || l(p);
15763
+ U(a.current.map((h) => h.key), p.map((h) => h.key)) || l(p);
15761
15764
  }, [e]);
15762
15765
  const c = x(() => {
15763
15766
  if (r.length === 0)
@@ -16444,7 +16447,7 @@ const dm = S.memo(
16444
16447
  }
16445
16448
  ) });
16446
16449
  },
16447
- $
16450
+ U
16448
16451
  ), Wd = () => /* @__PURE__ */ n("div", { className: "flex flex-col min-h-[68px]" });
16449
16452
  function Jd(e) {
16450
16453
  const t = _e(), r = e.displayed ? e.open ? $d : 72 : 0, i = /* @__PURE__ */ v(