@firecms/core 3.0.0-alpha.47 → 3.0.0-alpha.48
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 +50 -32
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +10 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/util/join_collections.d.ts +2 -2
- package/package.json +2 -2
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +1 -0
- package/src/components/ReferenceSelectionInner.tsx +34 -30
- package/src/components/VirtualTable/VirtualTableRow.tsx +10 -8
- package/src/util/join_collections.ts +34 -12
package/dist/index.es.js
CHANGED
|
@@ -13465,11 +13465,13 @@ const rs = ({
|
|
|
13465
13465
|
hoverRow: s,
|
|
13466
13466
|
rowClassName: u
|
|
13467
13467
|
}) {
|
|
13468
|
-
const d = v((m) =>
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13468
|
+
const d = v((m) => {
|
|
13469
|
+
console.debug("VirtualTableRow click"), c && c({
|
|
13470
|
+
rowData: o,
|
|
13471
|
+
rowIndex: r,
|
|
13472
|
+
event: m
|
|
13473
|
+
});
|
|
13474
|
+
}, [c, o, r]);
|
|
13473
13475
|
return /* @__PURE__ */ n(
|
|
13474
13476
|
"div",
|
|
13475
13477
|
{
|
|
@@ -14321,7 +14323,7 @@ const _s = {}, Ei = F.createContext(_s), ys = () => Ve(Ei), Bi = F.memo(
|
|
|
14321
14323
|
}, Ln = v(() => {
|
|
14322
14324
|
Z?.(re);
|
|
14323
14325
|
}, [re]), un = v(({ rowData: ne }) => {
|
|
14324
|
-
if (!h)
|
|
14326
|
+
if (console.debug("EntityCollectionTable click"), !h)
|
|
14325
14327
|
return A && A(ne);
|
|
14326
14328
|
}, [A, h]), dn = v((ne) => {
|
|
14327
14329
|
f && f(ne), Oe(ne);
|
|
@@ -17695,6 +17697,7 @@ function ru({
|
|
|
17695
17697
|
forceFilter: s,
|
|
17696
17698
|
maxSelection: u
|
|
17697
17699
|
}) {
|
|
17700
|
+
console.log("ReferenceSelectionInner");
|
|
17698
17701
|
const d = Bo(), m = kn(), A = ve(), p = ue(), f = A.resolveAliasesFrom(c), _ = je(), [y, h] = T([]), g = Ti();
|
|
17699
17702
|
O(() => {
|
|
17700
17703
|
let E = !1;
|
|
@@ -17714,11 +17717,12 @@ function ru({
|
|
|
17714
17717
|
E = !0;
|
|
17715
17718
|
};
|
|
17716
17719
|
}, [_, f, a, i, g.setSelectedEntities]);
|
|
17717
|
-
const b =
|
|
17720
|
+
const b = () => {
|
|
17718
17721
|
p.onAnalyticsEvent?.("reference_selection_clear", {
|
|
17719
17722
|
path: f
|
|
17720
17723
|
}), g.setSelectedEntities([]), !r && e ? e(null) : o && o([]);
|
|
17721
|
-
},
|
|
17724
|
+
}, w = (E) => {
|
|
17725
|
+
console.debug("ReferenceSelectionInner toggleEntitySelection", E);
|
|
17722
17726
|
let P;
|
|
17723
17727
|
const D = g.selectedEntities;
|
|
17724
17728
|
if (p.onAnalyticsEvent?.("reference_selection_toggle", {
|
|
@@ -17734,27 +17738,24 @@ function ru({
|
|
|
17734
17738
|
}
|
|
17735
17739
|
g.setSelectedEntities(P), o && o(P);
|
|
17736
17740
|
}
|
|
17737
|
-
},
|
|
17738
|
-
!r && e ? (p.onAnalyticsEvent?.("reference_selected_single", {
|
|
17741
|
+
}, k = (E) => {
|
|
17742
|
+
console.debug("ReferenceSelectionInner onEntityClick", E), !r && e ? (p.onAnalyticsEvent?.("reference_selected_single", {
|
|
17739
17743
|
path: f,
|
|
17740
17744
|
entityId: E.id
|
|
17741
17745
|
}), e(E), d.close(!1)) : w(E);
|
|
17742
|
-
},
|
|
17743
|
-
(
|
|
17744
|
-
|
|
17745
|
-
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17754
|
-
|
|
17755
|
-
},
|
|
17756
|
-
[m, f, i, y, k]
|
|
17757
|
-
), x = v(({
|
|
17746
|
+
}, C = () => {
|
|
17747
|
+
p.onAnalyticsEvent?.("reference_selection_new_entity", {
|
|
17748
|
+
path: f
|
|
17749
|
+
}), m.open({
|
|
17750
|
+
path: f,
|
|
17751
|
+
collection: i,
|
|
17752
|
+
updateUrl: !0,
|
|
17753
|
+
onUpdate: ({ entity: E }) => {
|
|
17754
|
+
h([E, ...y]), k(E);
|
|
17755
|
+
},
|
|
17756
|
+
closeOnSave: !0
|
|
17757
|
+
});
|
|
17758
|
+
}, x = ({
|
|
17758
17759
|
entity: E,
|
|
17759
17760
|
size: P,
|
|
17760
17761
|
width: D,
|
|
@@ -17775,7 +17776,7 @@ function ru({
|
|
|
17775
17776
|
selectionController: g
|
|
17776
17777
|
}
|
|
17777
17778
|
);
|
|
17778
|
-
},
|
|
17779
|
+
}, K = v((E) => {
|
|
17779
17780
|
E.stopPropagation(), d.close(!1);
|
|
17780
17781
|
}, [d]);
|
|
17781
17782
|
if (!i)
|
|
@@ -23344,8 +23345,14 @@ function od(e) {
|
|
|
23344
23345
|
function rd(e, o, r = [], i) {
|
|
23345
23346
|
const c = (o ?? []).map((l) => {
|
|
23346
23347
|
const s = e?.find((u) => u.id === l.id);
|
|
23347
|
-
return s ? id(s, l, r, i) :
|
|
23348
|
-
|
|
23348
|
+
return s ? id(s, l, r, i) : i ? i({
|
|
23349
|
+
collection: l,
|
|
23350
|
+
parentPaths: r
|
|
23351
|
+
}) ?? l : l;
|
|
23352
|
+
}), a = e.filter((l) => !c.map((s) => s.id).includes(l.id)).map((l) => i ? i({
|
|
23353
|
+
collection: l,
|
|
23354
|
+
parentPaths: r
|
|
23355
|
+
}) ?? l : l);
|
|
23349
23356
|
return [...c, ...a];
|
|
23350
23357
|
}
|
|
23351
23358
|
function id(e, o, r = [], i) {
|
|
@@ -23368,7 +23375,10 @@ function id(e, o, r = [], i) {
|
|
|
23368
23375
|
entityViews: m
|
|
23369
23376
|
};
|
|
23370
23377
|
if (i) {
|
|
23371
|
-
const p = i({
|
|
23378
|
+
const p = i({
|
|
23379
|
+
collection: A,
|
|
23380
|
+
parentPaths: r
|
|
23381
|
+
});
|
|
23372
23382
|
p && (A = p);
|
|
23373
23383
|
}
|
|
23374
23384
|
return A;
|
|
@@ -23383,9 +23393,17 @@ function cc(e, o) {
|
|
|
23383
23393
|
return Object.keys(o.properties).forEach((A) => {
|
|
23384
23394
|
const p = a[A];
|
|
23385
23395
|
p && (m[A] = cc(p, l[A]));
|
|
23386
|
-
}), {
|
|
23396
|
+
}), {
|
|
23397
|
+
...r,
|
|
23398
|
+
editable: i && c,
|
|
23399
|
+
properties: m,
|
|
23400
|
+
propertiesOrder: d
|
|
23401
|
+
};
|
|
23387
23402
|
}
|
|
23388
|
-
return {
|
|
23403
|
+
return {
|
|
23404
|
+
...r,
|
|
23405
|
+
editable: i && c
|
|
23406
|
+
};
|
|
23389
23407
|
}
|
|
23390
23408
|
}
|
|
23391
23409
|
function wr(e) {
|