@firecms/core 3.0.0-canary.204 → 3.0.0-canary.205
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/form/EntityForm.d.ts +0 -10
- package/dist/index.es.js +155 -387
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +155 -387
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildSideEntityController.d.ts +2 -2
- package/dist/util/resolutions.d.ts +6 -1
- package/package.json +5 -5
- package/src/core/EntityEditView.tsx +14 -50
- package/src/core/EntitySidePanel.tsx +2 -2
- package/src/form/EntityForm.tsx +56 -98
- package/src/internal/useBuildSideEntityController.tsx +28 -14
- package/src/util/resolutions.ts +26 -5
package/dist/index.umd.js
CHANGED
|
@@ -3685,7 +3685,7 @@
|
|
|
3685
3685
|
}
|
|
3686
3686
|
setDataLoading(false);
|
|
3687
3687
|
setDataLoadingError(void 0);
|
|
3688
|
-
setData(entities.map(_temp$
|
|
3688
|
+
setData(entities.map(_temp$s));
|
|
3689
3689
|
setNoMoreToLoad(!itemCount || entities.length < itemCount);
|
|
3690
3690
|
};
|
|
3691
3691
|
const onError = (error) => {
|
|
@@ -3768,7 +3768,7 @@
|
|
|
3768
3768
|
}
|
|
3769
3769
|
function _temp2$e() {
|
|
3770
3770
|
}
|
|
3771
|
-
function _temp$
|
|
3771
|
+
function _temp$s(e_0) {
|
|
3772
3772
|
return {
|
|
3773
3773
|
...e_0
|
|
3774
3774
|
};
|
|
@@ -3833,7 +3833,7 @@
|
|
|
3833
3833
|
setEntity(CACHE[`${path}/${entityId}`]);
|
|
3834
3834
|
setDataLoading(false);
|
|
3835
3835
|
setDataLoadingError(void 0);
|
|
3836
|
-
return _temp$
|
|
3836
|
+
return _temp$r;
|
|
3837
3837
|
} else {
|
|
3838
3838
|
if (entityId && path && collection) {
|
|
3839
3839
|
if (dataSource.listenEntity) {
|
|
@@ -3901,7 +3901,7 @@
|
|
|
3901
3901
|
}
|
|
3902
3902
|
function _temp2$d() {
|
|
3903
3903
|
}
|
|
3904
|
-
function _temp$
|
|
3904
|
+
function _temp$r() {
|
|
3905
3905
|
}
|
|
3906
3906
|
async function saveEntityWithCallbacks({
|
|
3907
3907
|
collection,
|
|
@@ -4751,7 +4751,7 @@
|
|
|
4751
4751
|
t0 = $[0];
|
|
4752
4752
|
}
|
|
4753
4753
|
const configCache = React.useRef(t0);
|
|
4754
|
-
const getCollectionFromStorage = _temp$
|
|
4754
|
+
const getCollectionFromStorage = _temp$q;
|
|
4755
4755
|
let t1;
|
|
4756
4756
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
4757
4757
|
t1 = (path) => {
|
|
@@ -4874,7 +4874,7 @@
|
|
|
4874
4874
|
}
|
|
4875
4875
|
return t11;
|
|
4876
4876
|
}
|
|
4877
|
-
function _temp$
|
|
4877
|
+
function _temp$q(storageKey) {
|
|
4878
4878
|
const item = localStorage.getItem(storageKey);
|
|
4879
4879
|
return item ? JSON.parse(item) : {};
|
|
4880
4880
|
}
|
|
@@ -5167,7 +5167,7 @@
|
|
|
5167
5167
|
}
|
|
5168
5168
|
let t9;
|
|
5169
5169
|
if ($[16] !== url) {
|
|
5170
|
-
t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "small", onClick: _temp$
|
|
5170
|
+
t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "small", onClick: _temp$p, children: t8 }) });
|
|
5171
5171
|
$[16] = url;
|
|
5172
5172
|
$[17] = t9;
|
|
5173
5173
|
} else {
|
|
@@ -5201,7 +5201,7 @@
|
|
|
5201
5201
|
}
|
|
5202
5202
|
return t11;
|
|
5203
5203
|
}
|
|
5204
|
-
function _temp$
|
|
5204
|
+
function _temp$p(e_0) {
|
|
5205
5205
|
return e_0.stopPropagation();
|
|
5206
5206
|
}
|
|
5207
5207
|
function UrlComponentPreview(t0) {
|
|
@@ -5234,7 +5234,7 @@
|
|
|
5234
5234
|
}
|
|
5235
5235
|
let t3;
|
|
5236
5236
|
if ($[2] !== url) {
|
|
5237
|
-
t3 = /* @__PURE__ */ jsxRuntime.jsxs("a", { className: "flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary", href: url, rel: "noopener noreferrer", onMouseDown: _temp$
|
|
5237
|
+
t3 = /* @__PURE__ */ jsxRuntime.jsxs("a", { className: "flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary", href: url, rel: "noopener noreferrer", onMouseDown: _temp$o, target: "_blank", children: [
|
|
5238
5238
|
t2,
|
|
5239
5239
|
url
|
|
5240
5240
|
] });
|
|
@@ -5365,7 +5365,7 @@
|
|
|
5365
5365
|
function _temp2$c(e_0) {
|
|
5366
5366
|
return e_0.stopPropagation();
|
|
5367
5367
|
}
|
|
5368
|
-
function _temp$
|
|
5368
|
+
function _temp$o(e) {
|
|
5369
5369
|
e.preventDefault();
|
|
5370
5370
|
}
|
|
5371
5371
|
function VideoPreview(t0) {
|
|
@@ -5499,7 +5499,7 @@
|
|
|
5499
5499
|
if (Array.isArray(arrayProperty.of)) {
|
|
5500
5500
|
let t1;
|
|
5501
5501
|
if ($[6] !== arrayProperty.of) {
|
|
5502
|
-
t1 = arrayProperty.of.map(_temp$
|
|
5502
|
+
t1 = arrayProperty.of.map(_temp$n);
|
|
5503
5503
|
$[6] = arrayProperty.of;
|
|
5504
5504
|
$[7] = t1;
|
|
5505
5505
|
} else {
|
|
@@ -5637,7 +5637,7 @@
|
|
|
5637
5637
|
}
|
|
5638
5638
|
return content || null;
|
|
5639
5639
|
}
|
|
5640
|
-
function _temp$
|
|
5640
|
+
function _temp$n(p, i) {
|
|
5641
5641
|
return renderGenericArrayCell(p, i);
|
|
5642
5642
|
}
|
|
5643
5643
|
function renderMap(property, size) {
|
|
@@ -6801,7 +6801,7 @@
|
|
|
6801
6801
|
}
|
|
6802
6802
|
let t1;
|
|
6803
6803
|
if ($[1] !== value) {
|
|
6804
|
-
t1 = Object.entries(value).map(_temp$
|
|
6804
|
+
t1 = Object.entries(value).map(_temp$m);
|
|
6805
6805
|
$[1] = value;
|
|
6806
6806
|
$[2] = t1;
|
|
6807
6807
|
} else {
|
|
@@ -6817,7 +6817,7 @@
|
|
|
6817
6817
|
}
|
|
6818
6818
|
return t2;
|
|
6819
6819
|
}
|
|
6820
|
-
function _temp$
|
|
6820
|
+
function _temp$m(t0) {
|
|
6821
6821
|
const [key, childValue] = t0;
|
|
6822
6822
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls(ui.defaultBorderMixin, "last:border-b-0 border-b"), children: [
|
|
6823
6823
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row pt-0.5 pb-0.5 gap-2", children: [
|
|
@@ -7563,7 +7563,7 @@
|
|
|
7563
7563
|
console.trace("onChange");
|
|
7564
7564
|
if (valueType === "number") {
|
|
7565
7565
|
if (multiple) {
|
|
7566
|
-
const newValue = updatedValue.map(_temp$
|
|
7566
|
+
const newValue = updatedValue.map(_temp$l);
|
|
7567
7567
|
updateValue(newValue);
|
|
7568
7568
|
} else {
|
|
7569
7569
|
updateValue(parseFloat(updatedValue));
|
|
@@ -7618,7 +7618,7 @@
|
|
|
7618
7618
|
function _temp2$b(v_0) {
|
|
7619
7619
|
return v_0.toString();
|
|
7620
7620
|
}
|
|
7621
|
-
function _temp$
|
|
7621
|
+
function _temp$l(v) {
|
|
7622
7622
|
return parseFloat(v);
|
|
7623
7623
|
}
|
|
7624
7624
|
function VirtualTableNumberInput(props) {
|
|
@@ -8161,7 +8161,7 @@
|
|
|
8161
8161
|
const snackbarContext = useSnackbarController();
|
|
8162
8162
|
let t1;
|
|
8163
8163
|
if ($[0] !== storage.acceptedFiles) {
|
|
8164
|
-
t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$
|
|
8164
|
+
t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$k).reduce(_temp2$a, {}) : void 0;
|
|
8165
8165
|
$[0] = storage.acceptedFiles;
|
|
8166
8166
|
$[1] = t1;
|
|
8167
8167
|
} else {
|
|
@@ -8390,7 +8390,7 @@
|
|
|
8390
8390
|
...b
|
|
8391
8391
|
};
|
|
8392
8392
|
}
|
|
8393
|
-
function _temp$
|
|
8393
|
+
function _temp$k(e) {
|
|
8394
8394
|
return {
|
|
8395
8395
|
[e]: []
|
|
8396
8396
|
};
|
|
@@ -8497,7 +8497,7 @@
|
|
|
8497
8497
|
let t1;
|
|
8498
8498
|
if ($[2] !== updateValue) {
|
|
8499
8499
|
t1 = (entities) => {
|
|
8500
|
-
updateValue(entities.map(_temp$
|
|
8500
|
+
updateValue(entities.map(_temp$j));
|
|
8501
8501
|
};
|
|
8502
8502
|
$[2] = updateValue;
|
|
8503
8503
|
$[3] = t1;
|
|
@@ -8658,7 +8658,7 @@
|
|
|
8658
8658
|
}
|
|
8659
8659
|
return t10;
|
|
8660
8660
|
}, equal);
|
|
8661
|
-
function _temp$
|
|
8661
|
+
function _temp$j(e) {
|
|
8662
8662
|
return getReferenceFrom(e);
|
|
8663
8663
|
}
|
|
8664
8664
|
function _temp2$9(ref) {
|
|
@@ -9794,7 +9794,7 @@
|
|
|
9794
9794
|
}
|
|
9795
9795
|
let t6;
|
|
9796
9796
|
if ($[6] !== t3 || $[7] !== t4) {
|
|
9797
|
-
t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Table row size", side: "right", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: t3, className: "w-16 h-10", size: "small", onValueChange: t4, renderValue: _temp$
|
|
9797
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Table row size", side: "right", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: t3, className: "w-16 h-10", size: "small", onValueChange: t4, renderValue: _temp$i, children: t5 }) });
|
|
9798
9798
|
$[6] = t3;
|
|
9799
9799
|
$[7] = t4;
|
|
9800
9800
|
$[8] = t6;
|
|
@@ -9881,7 +9881,7 @@
|
|
|
9881
9881
|
function _temp2$8(size_0) {
|
|
9882
9882
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: size_0, className: "w-12 font-medium text-center", children: size_0.toUpperCase() }, size_0);
|
|
9883
9883
|
}
|
|
9884
|
-
function _temp$
|
|
9884
|
+
function _temp$i(v_0) {
|
|
9885
9885
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: v_0.toUpperCase() });
|
|
9886
9886
|
}
|
|
9887
9887
|
function getTableCellAlignment(property) {
|
|
@@ -10990,7 +10990,7 @@
|
|
|
10990
10990
|
let t1;
|
|
10991
10991
|
if ($[0] !== text) {
|
|
10992
10992
|
const urlRegex = /https?:\/\/[^\s]+/g;
|
|
10993
|
-
t1 = text.replace(urlRegex, _temp$
|
|
10993
|
+
t1 = text.replace(urlRegex, _temp$h);
|
|
10994
10994
|
$[0] = text;
|
|
10995
10995
|
$[1] = t1;
|
|
10996
10996
|
} else {
|
|
@@ -11009,7 +11009,7 @@
|
|
|
11009
11009
|
}
|
|
11010
11010
|
return t2;
|
|
11011
11011
|
};
|
|
11012
|
-
function _temp$
|
|
11012
|
+
function _temp$h(url) {
|
|
11013
11013
|
return `<a href="${url}" class="underline" target="_blank">Link</a><br/>`;
|
|
11014
11014
|
}
|
|
11015
11015
|
const operationLabels$2 = {
|
|
@@ -11217,7 +11217,7 @@
|
|
|
11217
11217
|
}
|
|
11218
11218
|
let t6;
|
|
11219
11219
|
if ($[16] !== operation || $[17] !== t4 || $[18] !== t5) {
|
|
11220
|
-
t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: operation, fullWidth: true, position: "item-aligned", onValueChange: t4, renderValue: _temp$
|
|
11220
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: operation, fullWidth: true, position: "item-aligned", onValueChange: t4, renderValue: _temp$g, children: t5 }) });
|
|
11221
11221
|
$[16] = operation;
|
|
11222
11222
|
$[17] = t4;
|
|
11223
11223
|
$[18] = t5;
|
|
@@ -11341,7 +11341,7 @@
|
|
|
11341
11341
|
function _temp2$7(op_1) {
|
|
11342
11342
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: op_1, children: operationLabels$1[op_1] }, op_1);
|
|
11343
11343
|
}
|
|
11344
|
-
function _temp$
|
|
11344
|
+
function _temp$g(op_0) {
|
|
11345
11345
|
return operationLabels$1[op_0];
|
|
11346
11346
|
}
|
|
11347
11347
|
function BooleanFilterField(t0) {
|
|
@@ -11480,7 +11480,7 @@
|
|
|
11480
11480
|
}
|
|
11481
11481
|
let t6;
|
|
11482
11482
|
if ($[13] !== operation || $[14] !== t4 || $[15] !== t5) {
|
|
11483
|
-
t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: operation, size: "large", fullWidth: true, onValueChange: t4, renderValue: _temp$
|
|
11483
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: operation, size: "large", fullWidth: true, onValueChange: t4, renderValue: _temp$f, children: t5 }) });
|
|
11484
11484
|
$[13] = operation;
|
|
11485
11485
|
$[14] = t4;
|
|
11486
11486
|
$[15] = t5;
|
|
@@ -11569,7 +11569,7 @@
|
|
|
11569
11569
|
function _temp2$6(op_1) {
|
|
11570
11570
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: op_1, children: operationLabels[op_1] }, op_1);
|
|
11571
11571
|
}
|
|
11572
|
-
function _temp$
|
|
11572
|
+
function _temp$f(op_0) {
|
|
11573
11573
|
return operationLabels[op_0];
|
|
11574
11574
|
}
|
|
11575
11575
|
const SelectableTable = React.memo(
|
|
@@ -12276,7 +12276,7 @@
|
|
|
12276
12276
|
const searchBlocked = t12;
|
|
12277
12277
|
let t2;
|
|
12278
12278
|
if ($[15] !== customizationController.plugins || $[16] !== dataSource?.initTextSearch) {
|
|
12279
|
-
t2 = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$
|
|
12279
|
+
t2 = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$e);
|
|
12280
12280
|
$[15] = customizationController.plugins;
|
|
12281
12281
|
$[16] = dataSource?.initTextSearch;
|
|
12282
12282
|
$[17] = t2;
|
|
@@ -12368,7 +12368,7 @@
|
|
|
12368
12368
|
}
|
|
12369
12369
|
return t1;
|
|
12370
12370
|
}
|
|
12371
|
-
function _temp$
|
|
12371
|
+
function _temp$e(p_0) {
|
|
12372
12372
|
return Boolean(p_0.collectionView?.onTextSearchClick);
|
|
12373
12373
|
}
|
|
12374
12374
|
function DeleteEntityDialog({
|
|
@@ -12918,7 +12918,7 @@
|
|
|
12918
12918
|
}
|
|
12919
12919
|
let t3;
|
|
12920
12920
|
if ($[3] !== actions) {
|
|
12921
|
-
t3 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", onClick: _temp$
|
|
12921
|
+
t3 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", onClick: _temp$d, children: actions });
|
|
12922
12922
|
$[3] = actions;
|
|
12923
12923
|
$[4] = t3;
|
|
12924
12924
|
} else {
|
|
@@ -13004,7 +13004,7 @@
|
|
|
13004
13004
|
}
|
|
13005
13005
|
return t11;
|
|
13006
13006
|
}
|
|
13007
|
-
function _temp$
|
|
13007
|
+
function _temp$d(event) {
|
|
13008
13008
|
event.preventDefault();
|
|
13009
13009
|
event.stopPropagation();
|
|
13010
13010
|
}
|
|
@@ -13296,7 +13296,7 @@
|
|
|
13296
13296
|
T0 = ui.Collapse;
|
|
13297
13297
|
t4 = favouriteCollections.length > 0;
|
|
13298
13298
|
t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
|
|
13299
|
-
t3 = favouriteCollections.map(_temp$
|
|
13299
|
+
t3 = favouriteCollections.map(_temp$c);
|
|
13300
13300
|
$[2] = navigationController.topLevelNavigation?.navigationEntries;
|
|
13301
13301
|
$[3] = t1;
|
|
13302
13302
|
$[4] = T0;
|
|
@@ -13330,7 +13330,7 @@
|
|
|
13330
13330
|
}
|
|
13331
13331
|
return t6;
|
|
13332
13332
|
}
|
|
13333
|
-
function _temp$
|
|
13333
|
+
function _temp$c(entry_0) {
|
|
13334
13334
|
return /* @__PURE__ */ jsxRuntime.jsx(NavigationChip, { entry: entry_0 }, entry_0.path);
|
|
13335
13335
|
}
|
|
13336
13336
|
const scrollsMap = {};
|
|
@@ -13427,7 +13427,7 @@
|
|
|
13427
13427
|
} else {
|
|
13428
13428
|
const searchResult = fuse.current?.search(value);
|
|
13429
13429
|
if (searchResult) {
|
|
13430
|
-
setFilteredUrls(searchResult.map(_temp$
|
|
13430
|
+
setFilteredUrls(searchResult.map(_temp$b));
|
|
13431
13431
|
}
|
|
13432
13432
|
}
|
|
13433
13433
|
};
|
|
@@ -13705,7 +13705,7 @@
|
|
|
13705
13705
|
function _temp2$5(entry) {
|
|
13706
13706
|
return entry.group;
|
|
13707
13707
|
}
|
|
13708
|
-
function _temp$
|
|
13708
|
+
function _temp$b(e_0) {
|
|
13709
13709
|
return e_0.item.url;
|
|
13710
13710
|
}
|
|
13711
13711
|
function EntityCollectionViewActions(t0) {
|
|
@@ -15483,7 +15483,7 @@
|
|
|
15483
15483
|
}
|
|
15484
15484
|
let t7;
|
|
15485
15485
|
if ($[18] !== breadcrumbs.breadcrumbs) {
|
|
15486
|
-
t7 = breadcrumbs.breadcrumbs && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2", children: breadcrumbs.breadcrumbs.map(_temp$
|
|
15486
|
+
t7 = breadcrumbs.breadcrumbs && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2", children: breadcrumbs.breadcrumbs.map(_temp$a) }) });
|
|
15487
15487
|
$[18] = breadcrumbs.breadcrumbs;
|
|
15488
15488
|
$[19] = t7;
|
|
15489
15489
|
} else {
|
|
@@ -15595,7 +15595,7 @@
|
|
|
15595
15595
|
}
|
|
15596
15596
|
return t14;
|
|
15597
15597
|
};
|
|
15598
|
-
function _temp$
|
|
15598
|
+
function _temp$a(breadcrumb, index) {
|
|
15599
15599
|
return /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
15600
15600
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", children: "/" }),
|
|
15601
15601
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Link, { className: "visited:text-inherit visited:dark:text-inherit block", to: breadcrumb.url, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", children: breadcrumb.title }) }, index)
|
|
@@ -15965,7 +15965,7 @@
|
|
|
15965
15965
|
} else {
|
|
15966
15966
|
const searchResult = iconsSearch.search(value);
|
|
15967
15967
|
const limited = searchResult.slice(0, 50);
|
|
15968
|
-
setKeys(limited.map(_temp$
|
|
15968
|
+
setKeys(limited.map(_temp$9));
|
|
15969
15969
|
}
|
|
15970
15970
|
}, UPDATE_SEARCH_INDEX_WAIT_MS);
|
|
15971
15971
|
$[0] = t3;
|
|
@@ -16032,7 +16032,7 @@
|
|
|
16032
16032
|
}
|
|
16033
16033
|
return t8;
|
|
16034
16034
|
}
|
|
16035
|
-
function _temp$
|
|
16035
|
+
function _temp$9(e) {
|
|
16036
16036
|
return e.item.key;
|
|
16037
16037
|
}
|
|
16038
16038
|
function FieldCaption(t0) {
|
|
@@ -16659,7 +16659,7 @@
|
|
|
16659
16659
|
};
|
|
16660
16660
|
const formRef = React.useRef(null);
|
|
16661
16661
|
const formView = /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16662
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full py-2 flex flex-col items-start my-4 lg:my-6", children: [
|
|
16662
|
+
!Builder && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full py-2 flex flex-col items-start my-4 lg:my-6", children: [
|
|
16663
16663
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { className: "py-4 flex-grow line-clamp-1 " + (collection.hideIdFromForm ? "mb-2" : "mb-0"), variant: "h4", children: title ?? collection.singularName ?? collection.name }),
|
|
16664
16664
|
showEntityPath && /* @__PURE__ */ jsxRuntime.jsx(ui.Alert, { color: "base", className: "w-full", size: "small", children: /* @__PURE__ */ jsxRuntime.jsxs("code", { className: "text-xs select-all text-text-secondary dark:text-text-secondary-dark", children: [
|
|
16665
16665
|
entity?.path ?? path,
|
|
@@ -16668,7 +16668,7 @@
|
|
|
16668
16668
|
] }) })
|
|
16669
16669
|
] }),
|
|
16670
16670
|
children,
|
|
16671
|
-
!collection.hideIdFromForm && /* @__PURE__ */ jsxRuntime.jsx(CustomIdField, { customId: collection.customId, entityId, status, onChange: setEntityId, error: entityIdError, loading: customIdLoading, entity }),
|
|
16671
|
+
!Builder && !collection.hideIdFromForm && /* @__PURE__ */ jsxRuntime.jsx(CustomIdField, { customId: collection.customId, entityId, status, onChange: setEntityId, error: entityIdError, loading: customIdLoading, entity }),
|
|
16672
16672
|
entityId && formContext && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-12 flex flex-col gap-8", ref: formRef, children: [
|
|
16673
16673
|
formFields(),
|
|
16674
16674
|
/* @__PURE__ */ jsxRuntime.jsx(ErrorFocus, { containerRef: formRef })
|
|
@@ -16678,7 +16678,20 @@
|
|
|
16678
16678
|
React.useEffect(() => {
|
|
16679
16679
|
if (entityId && onIdChange) onIdChange(entityId);
|
|
16680
16680
|
}, [entityId, onIdChange]);
|
|
16681
|
-
|
|
16681
|
+
const disabled_0 = formex$1.isSubmitting || !formex$1.dirty && status === "existing";
|
|
16682
|
+
if (!resolvedCollection || !path) {
|
|
16683
|
+
throw Error("INTERNAL: Collection and path must be defined in form context");
|
|
16684
|
+
}
|
|
16685
|
+
const dialogActions = /* @__PURE__ */ jsxRuntime.jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex: formex$1, disabled: disabled_0, status, pluginActions, openEntityMode, showDefaultActions });
|
|
16686
|
+
return /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formContext.formex, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: formContext.formex.handleSubmit, onReset: () => formex$1.resetForm({
|
|
16687
|
+
values: getInitialEntityValues(collection, path, status, entity, customizationController.propertyConfigs)
|
|
16688
|
+
}), noValidate: true, className: ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className), children: [
|
|
16689
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { id: `form_${path}`, className: ui.cls("relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex flex-col w-full pt-12 pb-16 px-4 sm:px-8 md:px-10"), children: [
|
|
16690
|
+
formContext.formex.dirty ? /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Unsaved changes", className: "self-end sticky top-4 z-10", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { size: "small", colorScheme: "orangeDarker", children: /* @__PURE__ */ jsxRuntime.jsx(ui.EditIcon, { size: "smallest" }) }) }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "In sync with the database", className: "self-end sticky top-4 z-10", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { size: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CheckIcon, { size: "smallest" }) }) }),
|
|
16691
|
+
formView
|
|
16692
|
+
] }) }),
|
|
16693
|
+
dialogActions
|
|
16694
|
+
] }) });
|
|
16682
16695
|
}
|
|
16683
16696
|
function getInitialEntityValues(collection, path, status, entity, propertyConfigs) {
|
|
16684
16697
|
const resolvedCollection = resolveCollection({
|
|
@@ -16719,150 +16732,6 @@
|
|
|
16719
16732
|
}
|
|
16720
16733
|
return errors;
|
|
16721
16734
|
}
|
|
16722
|
-
function FormLayoutInner(t0) {
|
|
16723
|
-
const $ = reactCompilerRuntime.c(43);
|
|
16724
|
-
const {
|
|
16725
|
-
id,
|
|
16726
|
-
formContext,
|
|
16727
|
-
children,
|
|
16728
|
-
className,
|
|
16729
|
-
forceActionsAtTheBottom,
|
|
16730
|
-
pluginActions,
|
|
16731
|
-
EntityFormActionsComponent,
|
|
16732
|
-
showDefaultActions
|
|
16733
|
-
} = t0;
|
|
16734
|
-
const formex$1 = formContext.formex;
|
|
16735
|
-
const collection = formContext.collection;
|
|
16736
|
-
const path = formContext.path;
|
|
16737
|
-
const entity = formContext.entity;
|
|
16738
|
-
const savingError = formContext.savingError;
|
|
16739
|
-
const status = formContext.status;
|
|
16740
|
-
const openEntityMode = formContext.openEntityMode;
|
|
16741
|
-
const disabled = formex$1.isSubmitting || !formex$1.dirty && status === "existing";
|
|
16742
|
-
const customizationController = useCustomizationController();
|
|
16743
|
-
if (!collection || !path) {
|
|
16744
|
-
throw Error("INTERNAL: Collection and path must be defined in form context");
|
|
16745
|
-
}
|
|
16746
|
-
const t1 = forceActionsAtTheBottom ? "bottom" : "side";
|
|
16747
|
-
let t2;
|
|
16748
|
-
if ($[0] !== pluginActions) {
|
|
16749
|
-
t2 = pluginActions ?? [];
|
|
16750
|
-
$[0] = pluginActions;
|
|
16751
|
-
$[1] = t2;
|
|
16752
|
-
} else {
|
|
16753
|
-
t2 = $[1];
|
|
16754
|
-
}
|
|
16755
|
-
let t3;
|
|
16756
|
-
if ($[2] !== EntityFormActionsComponent || $[3] !== collection || $[4] !== disabled || $[5] !== entity || $[6] !== formex$1 || $[7] !== openEntityMode || $[8] !== path || $[9] !== savingError || $[10] !== showDefaultActions || $[11] !== status || $[12] !== t1 || $[13] !== t2) {
|
|
16757
|
-
t3 = /* @__PURE__ */ jsxRuntime.jsx(EntityFormActionsComponent, { collection, path, entity, layout: t1, savingError, formex: formex$1, disabled, status, pluginActions: t2, openEntityMode, showDefaultActions });
|
|
16758
|
-
$[2] = EntityFormActionsComponent;
|
|
16759
|
-
$[3] = collection;
|
|
16760
|
-
$[4] = disabled;
|
|
16761
|
-
$[5] = entity;
|
|
16762
|
-
$[6] = formex$1;
|
|
16763
|
-
$[7] = openEntityMode;
|
|
16764
|
-
$[8] = path;
|
|
16765
|
-
$[9] = savingError;
|
|
16766
|
-
$[10] = showDefaultActions;
|
|
16767
|
-
$[11] = status;
|
|
16768
|
-
$[12] = t1;
|
|
16769
|
-
$[13] = t2;
|
|
16770
|
-
$[14] = t3;
|
|
16771
|
-
} else {
|
|
16772
|
-
t3 = $[14];
|
|
16773
|
-
}
|
|
16774
|
-
const dialogActions = t3;
|
|
16775
|
-
const t4 = formContext.formex;
|
|
16776
|
-
const t5 = formContext.formex.handleSubmit;
|
|
16777
|
-
let t6;
|
|
16778
|
-
if ($[15] !== collection || $[16] !== customizationController.propertyConfigs || $[17] !== entity || $[18] !== formex$1 || $[19] !== path || $[20] !== status) {
|
|
16779
|
-
t6 = () => formex$1.resetForm({
|
|
16780
|
-
values: getInitialEntityValues(collection, path, status, entity, customizationController.propertyConfigs)
|
|
16781
|
-
});
|
|
16782
|
-
$[15] = collection;
|
|
16783
|
-
$[16] = customizationController.propertyConfigs;
|
|
16784
|
-
$[17] = entity;
|
|
16785
|
-
$[18] = formex$1;
|
|
16786
|
-
$[19] = path;
|
|
16787
|
-
$[20] = status;
|
|
16788
|
-
$[21] = t6;
|
|
16789
|
-
} else {
|
|
16790
|
-
t6 = $[21];
|
|
16791
|
-
}
|
|
16792
|
-
let t7;
|
|
16793
|
-
if ($[22] !== className) {
|
|
16794
|
-
t7 = ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className);
|
|
16795
|
-
$[22] = className;
|
|
16796
|
-
$[23] = t7;
|
|
16797
|
-
} else {
|
|
16798
|
-
t7 = $[23];
|
|
16799
|
-
}
|
|
16800
|
-
let t8;
|
|
16801
|
-
let t9;
|
|
16802
|
-
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
16803
|
-
t8 = ui.cls("relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit");
|
|
16804
|
-
t9 = ui.cls("flex flex-col w-full pt-12 pb-16 px-4 sm:px-8 md:px-10");
|
|
16805
|
-
$[24] = t8;
|
|
16806
|
-
$[25] = t9;
|
|
16807
|
-
} else {
|
|
16808
|
-
t8 = $[24];
|
|
16809
|
-
t9 = $[25];
|
|
16810
|
-
}
|
|
16811
|
-
let t10;
|
|
16812
|
-
if ($[26] !== formContext.formex.dirty) {
|
|
16813
|
-
t10 = formContext.formex.dirty ? /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Unsaved changes", className: "self-end sticky top-4 z-10", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { size: "small", colorScheme: "orangeDarker", children: /* @__PURE__ */ jsxRuntime.jsx(ui.EditIcon, { size: "smallest" }) }) }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "In sync with the database", className: "self-end sticky top-4 z-10", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { size: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CheckIcon, { size: "smallest" }) }) });
|
|
16814
|
-
$[26] = formContext.formex.dirty;
|
|
16815
|
-
$[27] = t10;
|
|
16816
|
-
} else {
|
|
16817
|
-
t10 = $[27];
|
|
16818
|
-
}
|
|
16819
|
-
let t11;
|
|
16820
|
-
if ($[28] !== children || $[29] !== t10) {
|
|
16821
|
-
t11 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t9, children: [
|
|
16822
|
-
t10,
|
|
16823
|
-
children
|
|
16824
|
-
] });
|
|
16825
|
-
$[28] = children;
|
|
16826
|
-
$[29] = t10;
|
|
16827
|
-
$[30] = t11;
|
|
16828
|
-
} else {
|
|
16829
|
-
t11 = $[30];
|
|
16830
|
-
}
|
|
16831
|
-
let t12;
|
|
16832
|
-
if ($[31] !== id || $[32] !== t11) {
|
|
16833
|
-
t12 = /* @__PURE__ */ jsxRuntime.jsx("div", { id, className: t8, children: t11 });
|
|
16834
|
-
$[31] = id;
|
|
16835
|
-
$[32] = t11;
|
|
16836
|
-
$[33] = t12;
|
|
16837
|
-
} else {
|
|
16838
|
-
t12 = $[33];
|
|
16839
|
-
}
|
|
16840
|
-
let t13;
|
|
16841
|
-
if ($[34] !== dialogActions || $[35] !== formContext.formex.handleSubmit || $[36] !== t12 || $[37] !== t6 || $[38] !== t7) {
|
|
16842
|
-
t13 = /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: t5, onReset: t6, noValidate: true, className: t7, children: [
|
|
16843
|
-
t12,
|
|
16844
|
-
dialogActions
|
|
16845
|
-
] });
|
|
16846
|
-
$[34] = dialogActions;
|
|
16847
|
-
$[35] = formContext.formex.handleSubmit;
|
|
16848
|
-
$[36] = t12;
|
|
16849
|
-
$[37] = t6;
|
|
16850
|
-
$[38] = t7;
|
|
16851
|
-
$[39] = t13;
|
|
16852
|
-
} else {
|
|
16853
|
-
t13 = $[39];
|
|
16854
|
-
}
|
|
16855
|
-
let t14;
|
|
16856
|
-
if ($[40] !== formContext.formex || $[41] !== t13) {
|
|
16857
|
-
t14 = /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: t4, children: t13 });
|
|
16858
|
-
$[40] = formContext.formex;
|
|
16859
|
-
$[41] = t13;
|
|
16860
|
-
$[42] = t14;
|
|
16861
|
-
} else {
|
|
16862
|
-
t14 = $[42];
|
|
16863
|
-
}
|
|
16864
|
-
return t14;
|
|
16865
|
-
}
|
|
16866
16735
|
function useOnAutoSave(autoSave, formex2, lastSavedValues, save) {
|
|
16867
16736
|
if (!autoSave) return;
|
|
16868
16737
|
React.useEffect(() => {
|
|
@@ -17438,7 +17307,7 @@
|
|
|
17438
17307
|
}
|
|
17439
17308
|
let t5;
|
|
17440
17309
|
if ($[14] !== placeholder) {
|
|
17441
|
-
t5 = placeholder && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: _temp$
|
|
17310
|
+
t5 = placeholder && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: _temp$8, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsx(ui.DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
|
|
17442
17311
|
$[14] = placeholder;
|
|
17443
17312
|
$[15] = t5;
|
|
17444
17313
|
} else {
|
|
@@ -17461,7 +17330,7 @@
|
|
|
17461
17330
|
}
|
|
17462
17331
|
return t6;
|
|
17463
17332
|
}
|
|
17464
|
-
function _temp$
|
|
17333
|
+
function _temp$8(e) {
|
|
17465
17334
|
return e.stopPropagation();
|
|
17466
17335
|
}
|
|
17467
17336
|
const dropZoneClasses = "box-border relative pt-[2px] items-center border border-transparent min-h-[254px] outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid";
|
|
@@ -17644,7 +17513,7 @@
|
|
|
17644
17513
|
const snackbarContext = useSnackbarController();
|
|
17645
17514
|
let t1;
|
|
17646
17515
|
if ($[0] !== storage.acceptedFiles) {
|
|
17647
|
-
t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$
|
|
17516
|
+
t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$7).reduce(_temp2$4, {}) : void 0;
|
|
17648
17517
|
$[0] = storage.acceptedFiles;
|
|
17649
17518
|
$[1] = t1;
|
|
17650
17519
|
} else {
|
|
@@ -17860,7 +17729,7 @@
|
|
|
17860
17729
|
...b
|
|
17861
17730
|
};
|
|
17862
17731
|
}
|
|
17863
|
-
function _temp$
|
|
17732
|
+
function _temp$7(e) {
|
|
17864
17733
|
return {
|
|
17865
17734
|
[e]: []
|
|
17866
17735
|
};
|
|
@@ -18825,7 +18694,7 @@
|
|
|
18825
18694
|
} else {
|
|
18826
18695
|
t42 = $[20];
|
|
18827
18696
|
}
|
|
18828
|
-
t3 = Object.entries(mapProperties).filter(_temp$
|
|
18697
|
+
t3 = Object.entries(mapProperties).filter(_temp$6).map(t42);
|
|
18829
18698
|
$[6] = autoFocus;
|
|
18830
18699
|
$[7] = context;
|
|
18831
18700
|
$[8] = disabled;
|
|
@@ -18895,7 +18764,7 @@
|
|
|
18895
18764
|
}
|
|
18896
18765
|
return t10;
|
|
18897
18766
|
}
|
|
18898
|
-
function _temp$
|
|
18767
|
+
function _temp$6(t0) {
|
|
18899
18768
|
const [, property_0] = t0;
|
|
18900
18769
|
return !isHidden(property_0);
|
|
18901
18770
|
}
|
|
@@ -20018,7 +19887,7 @@
|
|
|
20018
19887
|
const property = t4;
|
|
20019
19888
|
let t5;
|
|
20020
19889
|
if ($[9] !== properties) {
|
|
20021
|
-
t5 = Object.entries(properties).map(_temp$
|
|
19890
|
+
t5 = Object.entries(properties).map(_temp$5);
|
|
20022
19891
|
$[9] = properties;
|
|
20023
19892
|
$[10] = t5;
|
|
20024
19893
|
} else {
|
|
@@ -20109,7 +19978,7 @@
|
|
|
20109
19978
|
}
|
|
20110
19979
|
return t11;
|
|
20111
19980
|
}
|
|
20112
|
-
function _temp$
|
|
19981
|
+
function _temp$5(t0) {
|
|
20113
19982
|
const [key, property_0] = t0;
|
|
20114
19983
|
return {
|
|
20115
19984
|
id: key,
|
|
@@ -21179,6 +21048,16 @@
|
|
|
21179
21048
|
return entityView;
|
|
21180
21049
|
}
|
|
21181
21050
|
}
|
|
21051
|
+
function resolvedSelectedEntityView(customViews, customizationController, selectedTab) {
|
|
21052
|
+
const resolvedEntityViews = customViews ? customViews.map((e) => resolveEntityView(e, customizationController.entityViews)).filter(Boolean) : [];
|
|
21053
|
+
const selectedEntityView = resolvedEntityViews.find((e) => e.key === selectedTab);
|
|
21054
|
+
const selectedSecondaryForm = customViews && resolvedEntityViews.filter((e) => e.includeActions).find((e) => e.key === selectedTab);
|
|
21055
|
+
return {
|
|
21056
|
+
resolvedEntityViews,
|
|
21057
|
+
selectedEntityView,
|
|
21058
|
+
selectedSecondaryForm
|
|
21059
|
+
};
|
|
21060
|
+
}
|
|
21182
21061
|
function getNavigationEntriesFromPath(props) {
|
|
21183
21062
|
const {
|
|
21184
21063
|
path,
|
|
@@ -21798,12 +21677,14 @@
|
|
|
21798
21677
|
const customViews = collection.entityViews;
|
|
21799
21678
|
const customViewsCount = customViews?.length ?? 0;
|
|
21800
21679
|
const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0;
|
|
21801
|
-
const
|
|
21802
|
-
|
|
21803
|
-
|
|
21680
|
+
const {
|
|
21681
|
+
resolvedEntityViews,
|
|
21682
|
+
selectedEntityView,
|
|
21683
|
+
selectedSecondaryForm
|
|
21684
|
+
} = resolvedSelectedEntityView(customViews, customizationController, selectedTab);
|
|
21804
21685
|
const actionsAtTheBottom = !largeLayout || layout === "side_panel" || selectedEntityView?.includeActions === "bottom";
|
|
21805
21686
|
const mainViewVisible = selectedTab === MAIN_TAB_VALUE || Boolean(selectedSecondaryForm);
|
|
21806
|
-
const customViewsView = customViews && resolvedEntityViews.filter((
|
|
21687
|
+
const customViewsView = customViews && resolvedEntityViews.filter((e) => !e.includeActions).map((customView) => {
|
|
21807
21688
|
if (!customView) return null;
|
|
21808
21689
|
const Builder = customView.Builder;
|
|
21809
21690
|
if (!Builder) {
|
|
@@ -21979,16 +21860,19 @@
|
|
|
21979
21860
|
}
|
|
21980
21861
|
const NEW_URL_HASH = "new_side";
|
|
21981
21862
|
const SIDE_URL_HASH = "side";
|
|
21982
|
-
function getEntityViewWidth(props, small) {
|
|
21863
|
+
function getEntityViewWidth(props, small, customizationController) {
|
|
21983
21864
|
if (small) return CONTAINER_FULL_WIDTH;
|
|
21984
|
-
const
|
|
21865
|
+
const {
|
|
21866
|
+
selectedSecondaryForm
|
|
21867
|
+
} = resolvedSelectedEntityView(props.collection?.entityViews, customizationController, props.selectedTab);
|
|
21868
|
+
const shouldUseSmallLayout = !props.selectedTab || Boolean(selectedSecondaryForm);
|
|
21985
21869
|
let resolvedWidth;
|
|
21986
21870
|
if (props.width) {
|
|
21987
21871
|
resolvedWidth = typeof props.width === "number" ? `${props.width}px` : props.width;
|
|
21988
21872
|
} else if (props.collection?.sideDialogWidth) {
|
|
21989
21873
|
resolvedWidth = typeof props.collection.sideDialogWidth === "number" ? `${props.collection.sideDialogWidth}px` : props.collection.sideDialogWidth;
|
|
21990
21874
|
}
|
|
21991
|
-
if (!
|
|
21875
|
+
if (!shouldUseSmallLayout) {
|
|
21992
21876
|
return `calc(${ADDITIONAL_TAB_WIDTH} + ${resolvedWidth ?? FORM_CONTAINER_WIDTH})`;
|
|
21993
21877
|
} else {
|
|
21994
21878
|
if (resolvedWidth) {
|
|
@@ -22040,194 +21924,81 @@
|
|
|
22040
21924
|
}
|
|
22041
21925
|
}
|
|
22042
21926
|
const useBuildSideEntityController = (navigation, sideDialogsController) => {
|
|
22043
|
-
const $ = reactCompilerRuntime.c(44);
|
|
22044
21927
|
const location = reactRouterDom.useLocation();
|
|
22045
21928
|
const initialised = React.useRef(false);
|
|
21929
|
+
const customizationController = useCustomizationController();
|
|
22046
21930
|
const smallLayout = !useLargeLayout();
|
|
22047
|
-
|
|
22048
|
-
|
|
22049
|
-
|
|
22050
|
-
|
|
22051
|
-
|
|
22052
|
-
|
|
22053
|
-
|
|
22054
|
-
|
|
22055
|
-
const
|
|
22056
|
-
|
|
22057
|
-
|
|
22058
|
-
if (i === 0) {
|
|
22059
|
-
sideDialogsController.replace(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout));
|
|
22060
|
-
} else {
|
|
22061
|
-
sideDialogsController.open(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout));
|
|
22062
|
-
}
|
|
22063
|
-
}
|
|
21931
|
+
React.useEffect(() => {
|
|
21932
|
+
const newFlag = location.hash === `#${NEW_URL_HASH}`;
|
|
21933
|
+
const sideFlag = location.hash === `#${SIDE_URL_HASH}`;
|
|
21934
|
+
if (!navigation.loading) {
|
|
21935
|
+
if ((newFlag || sideFlag) && navigation.isUrlCollectionPath(location.pathname)) {
|
|
21936
|
+
const entityOrCollectionPath = navigation.urlPathToDataPath(location.pathname);
|
|
21937
|
+
const panelsFromUrl = buildSidePanelsFromUrl(entityOrCollectionPath, navigation.collections ?? [], newFlag);
|
|
21938
|
+
for (let i = 0; i < panelsFromUrl.length; i++) {
|
|
21939
|
+
const props = panelsFromUrl[i];
|
|
21940
|
+
if (i === 0) sideDialogsController.replace(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
|
|
21941
|
+
else sideDialogsController.open(propsToSidePanel(props, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
|
|
22064
21942
|
}
|
|
22065
|
-
initialised.current = true;
|
|
22066
21943
|
}
|
|
22067
|
-
|
|
22068
|
-
|
|
22069
|
-
|
|
22070
|
-
|
|
22071
|
-
|
|
22072
|
-
|
|
22073
|
-
|
|
22074
|
-
|
|
22075
|
-
|
|
22076
|
-
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
t1 = [navigation.loading];
|
|
22080
|
-
$[6] = navigation.loading;
|
|
22081
|
-
$[7] = t1;
|
|
22082
|
-
} else {
|
|
22083
|
-
t1 = $[7];
|
|
22084
|
-
}
|
|
22085
|
-
React.useEffect(t0, t1);
|
|
22086
|
-
let t2;
|
|
22087
|
-
if ($[8] !== sideDialogsController.sidePanels) {
|
|
22088
|
-
t2 = sideDialogsController.sidePanels.map(_temp$5);
|
|
22089
|
-
$[8] = sideDialogsController.sidePanels;
|
|
22090
|
-
$[9] = t2;
|
|
22091
|
-
} else {
|
|
22092
|
-
t2 = $[9];
|
|
22093
|
-
}
|
|
22094
|
-
const currentPanelKeys = t2;
|
|
22095
|
-
let t3;
|
|
22096
|
-
if ($[10] !== currentPanelKeys || $[11] !== location.hash || $[12] !== location.pathname || $[13] !== navigation || $[14] !== sideDialogsController || $[15] !== smallLayout) {
|
|
22097
|
-
t3 = () => {
|
|
22098
|
-
if (initialised.current) {
|
|
22099
|
-
const sideFlag_0 = location.hash === `#${SIDE_URL_HASH}`;
|
|
22100
|
-
if (sideFlag_0) {
|
|
22101
|
-
const entityOrCollectionPath_0 = navigation.urlPathToDataPath(location.pathname);
|
|
22102
|
-
const panelsFromUrl_0 = buildSidePanelsFromUrl(entityOrCollectionPath_0, navigation.collections ?? [], false);
|
|
22103
|
-
if (panelsFromUrl_0.length <= currentPanelKeys.length) {
|
|
22104
|
-
return;
|
|
22105
|
-
}
|
|
22106
|
-
const lastPanel = panelsFromUrl_0[panelsFromUrl_0.length - 1];
|
|
22107
|
-
const panelProps = propsToSidePanel(lastPanel, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout);
|
|
22108
|
-
const lastCurrentPanel = currentPanelKeys.length > 0 ? currentPanelKeys[currentPanelKeys.length - 1] : void 0;
|
|
22109
|
-
if (!lastCurrentPanel || lastCurrentPanel !== panelProps.key) {
|
|
22110
|
-
sideDialogsController.replace(panelProps);
|
|
22111
|
-
}
|
|
21944
|
+
initialised.current = true;
|
|
21945
|
+
}
|
|
21946
|
+
}, [navigation.loading]);
|
|
21947
|
+
const currentPanelKeys = sideDialogsController.sidePanels.map((p) => p.key);
|
|
21948
|
+
React.useEffect(() => {
|
|
21949
|
+
if (initialised.current) {
|
|
21950
|
+
const sideFlag_0 = location.hash === `#${SIDE_URL_HASH}`;
|
|
21951
|
+
if (sideFlag_0) {
|
|
21952
|
+
const entityOrCollectionPath_0 = navigation.urlPathToDataPath(location.pathname);
|
|
21953
|
+
const panelsFromUrl_0 = buildSidePanelsFromUrl(entityOrCollectionPath_0, navigation.collections ?? [], false);
|
|
21954
|
+
if (panelsFromUrl_0.length <= currentPanelKeys.length) {
|
|
21955
|
+
return;
|
|
22112
21956
|
}
|
|
22113
|
-
|
|
22114
|
-
|
|
22115
|
-
|
|
22116
|
-
|
|
22117
|
-
|
|
22118
|
-
$[13] = navigation;
|
|
22119
|
-
$[14] = sideDialogsController;
|
|
22120
|
-
$[15] = smallLayout;
|
|
22121
|
-
$[16] = t3;
|
|
22122
|
-
} else {
|
|
22123
|
-
t3 = $[16];
|
|
22124
|
-
}
|
|
22125
|
-
let t4;
|
|
22126
|
-
if ($[17] !== currentPanelKeys || $[18] !== location.hash || $[19] !== location.pathname) {
|
|
22127
|
-
t4 = [location.pathname, location.hash, currentPanelKeys];
|
|
22128
|
-
$[17] = currentPanelKeys;
|
|
22129
|
-
$[18] = location.hash;
|
|
22130
|
-
$[19] = location.pathname;
|
|
22131
|
-
$[20] = t4;
|
|
22132
|
-
} else {
|
|
22133
|
-
t4 = $[20];
|
|
22134
|
-
}
|
|
22135
|
-
React.useEffect(t3, t4);
|
|
22136
|
-
let t5;
|
|
22137
|
-
if ($[21] !== navigation.buildUrlCollectionPath || $[22] !== navigation.resolveIdsFrom || $[23] !== sideDialogsController || $[24] !== smallLayout) {
|
|
22138
|
-
t5 = () => {
|
|
22139
|
-
const updatedSidePanels = sideDialogsController.sidePanels.map((sidePanelProps) => {
|
|
22140
|
-
if (sidePanelProps.additional) {
|
|
22141
|
-
return propsToSidePanel(sidePanelProps.additional, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout);
|
|
21957
|
+
const lastPanel = panelsFromUrl_0[panelsFromUrl_0.length - 1];
|
|
21958
|
+
const panelProps = propsToSidePanel(lastPanel, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController);
|
|
21959
|
+
const lastCurrentPanel = currentPanelKeys.length > 0 ? currentPanelKeys[currentPanelKeys.length - 1] : void 0;
|
|
21960
|
+
if (!lastCurrentPanel || lastCurrentPanel !== panelProps.key) {
|
|
21961
|
+
sideDialogsController.replace(panelProps);
|
|
22142
21962
|
}
|
|
22143
|
-
return sidePanelProps;
|
|
22144
|
-
});
|
|
22145
|
-
sideDialogsController.setSidePanels(updatedSidePanels);
|
|
22146
|
-
};
|
|
22147
|
-
$[21] = navigation.buildUrlCollectionPath;
|
|
22148
|
-
$[22] = navigation.resolveIdsFrom;
|
|
22149
|
-
$[23] = sideDialogsController;
|
|
22150
|
-
$[24] = smallLayout;
|
|
22151
|
-
$[25] = t5;
|
|
22152
|
-
} else {
|
|
22153
|
-
t5 = $[25];
|
|
22154
|
-
}
|
|
22155
|
-
let t6;
|
|
22156
|
-
if ($[26] !== smallLayout) {
|
|
22157
|
-
t6 = [smallLayout];
|
|
22158
|
-
$[26] = smallLayout;
|
|
22159
|
-
$[27] = t6;
|
|
22160
|
-
} else {
|
|
22161
|
-
t6 = $[27];
|
|
22162
|
-
}
|
|
22163
|
-
React.useEffect(t5, t6);
|
|
22164
|
-
let t7;
|
|
22165
|
-
if ($[28] !== sideDialogsController) {
|
|
22166
|
-
t7 = () => {
|
|
22167
|
-
sideDialogsController.close();
|
|
22168
|
-
};
|
|
22169
|
-
$[28] = sideDialogsController;
|
|
22170
|
-
$[29] = t7;
|
|
22171
|
-
} else {
|
|
22172
|
-
t7 = $[29];
|
|
22173
|
-
}
|
|
22174
|
-
const close = t7;
|
|
22175
|
-
let t8;
|
|
22176
|
-
if ($[30] !== navigation.buildUrlCollectionPath || $[31] !== navigation.resolveIdsFrom || $[32] !== sideDialogsController || $[33] !== smallLayout) {
|
|
22177
|
-
t8 = (props_0) => {
|
|
22178
|
-
if (props_0.copy && !props_0.entityId) {
|
|
22179
|
-
throw Error("If you want to copy an entity you need to provide an entityId");
|
|
22180
21963
|
}
|
|
22181
|
-
|
|
22182
|
-
|
|
22183
|
-
|
|
22184
|
-
|
|
22185
|
-
|
|
22186
|
-
|
|
22187
|
-
...props_0
|
|
22188
|
-
}, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout));
|
|
22189
|
-
};
|
|
22190
|
-
$[30] = navigation.buildUrlCollectionPath;
|
|
22191
|
-
$[31] = navigation.resolveIdsFrom;
|
|
22192
|
-
$[32] = sideDialogsController;
|
|
22193
|
-
$[33] = smallLayout;
|
|
22194
|
-
$[34] = t8;
|
|
22195
|
-
} else {
|
|
22196
|
-
t8 = $[34];
|
|
22197
|
-
}
|
|
22198
|
-
const open = t8;
|
|
22199
|
-
let t9;
|
|
22200
|
-
if ($[35] !== navigation.buildUrlCollectionPath || $[36] !== navigation.resolveIdsFrom || $[37] !== sideDialogsController || $[38] !== smallLayout) {
|
|
22201
|
-
t9 = (props_1) => {
|
|
22202
|
-
if (props_1.copy && !props_1.entityId) {
|
|
22203
|
-
throw Error("If you want to copy an entity you need to provide an entityId");
|
|
21964
|
+
}
|
|
21965
|
+
}, [location.pathname, location.hash, currentPanelKeys]);
|
|
21966
|
+
React.useEffect(() => {
|
|
21967
|
+
const updatedSidePanels = sideDialogsController.sidePanels.map((sidePanelProps) => {
|
|
21968
|
+
if (sidePanelProps.additional) {
|
|
21969
|
+
return propsToSidePanel(sidePanelProps.additional, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController);
|
|
22204
21970
|
}
|
|
22205
|
-
|
|
22206
|
-
};
|
|
22207
|
-
|
|
22208
|
-
|
|
22209
|
-
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
21971
|
+
return sidePanelProps;
|
|
21972
|
+
});
|
|
21973
|
+
sideDialogsController.setSidePanels(updatedSidePanels);
|
|
21974
|
+
}, [smallLayout]);
|
|
21975
|
+
const close = React.useCallback(() => {
|
|
21976
|
+
sideDialogsController.close();
|
|
21977
|
+
}, [sideDialogsController]);
|
|
21978
|
+
const open = React.useCallback((props_0) => {
|
|
21979
|
+
if (props_0.copy && !props_0.entityId) {
|
|
21980
|
+
throw Error("If you want to copy an entity you need to provide an entityId");
|
|
21981
|
+
}
|
|
21982
|
+
const defaultSelectedView = resolveDefaultSelectedView(props_0.collection ? props_0.collection.defaultSelectedView : void 0, {
|
|
21983
|
+
status: props_0.copy ? "copy" : props_0.entityId ? "existing" : "new",
|
|
21984
|
+
entityId: props_0.entityId
|
|
21985
|
+
});
|
|
21986
|
+
sideDialogsController.open(propsToSidePanel({
|
|
21987
|
+
selectedTab: defaultSelectedView,
|
|
21988
|
+
...props_0
|
|
21989
|
+
}, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
|
|
21990
|
+
}, [sideDialogsController, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout]);
|
|
21991
|
+
const replace = React.useCallback((props_1) => {
|
|
21992
|
+
if (props_1.copy && !props_1.entityId) {
|
|
21993
|
+
throw Error("If you want to copy an entity you need to provide an entityId");
|
|
21994
|
+
}
|
|
21995
|
+
sideDialogsController.replace(propsToSidePanel(props_1, navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, smallLayout, customizationController));
|
|
21996
|
+
}, [navigation.buildUrlCollectionPath, navigation.resolveIdsFrom, sideDialogsController, smallLayout]);
|
|
21997
|
+
return {
|
|
21998
|
+
close,
|
|
21999
|
+
open,
|
|
22000
|
+
replace
|
|
22001
|
+
};
|
|
22231
22002
|
};
|
|
22232
22003
|
function buildSidePanelsFromUrl(path, collections, newFlag) {
|
|
22233
22004
|
const navigationViewsForPath = getNavigationEntriesFromPath({
|
|
@@ -22267,7 +22038,7 @@
|
|
|
22267
22038
|
}
|
|
22268
22039
|
return sidePanel ? [sidePanel] : [];
|
|
22269
22040
|
}
|
|
22270
|
-
const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout) => {
|
|
22041
|
+
const propsToSidePanel = (props, buildUrlCollectionPath, resolveIdsFrom, smallLayout, customizationController) => {
|
|
22271
22042
|
const collectionPath = removeInitialAndTrailingSlashes(props.path);
|
|
22272
22043
|
const newPath = props.entityId ? buildUrlCollectionPath(`${collectionPath}/${props.entityId}${props.selectedTab ? "/" + props.selectedTab : ""}#${SIDE_URL_HASH}`) : buildUrlCollectionPath(`${collectionPath}#${NEW_URL_HASH}`);
|
|
22273
22044
|
const resolvedPath = resolveIdsFrom(props.path);
|
|
@@ -22276,7 +22047,7 @@
|
|
|
22276
22047
|
path: resolvedPath,
|
|
22277
22048
|
formProps: props.formProps
|
|
22278
22049
|
};
|
|
22279
|
-
const entityViewWidth = getEntityViewWidth(props, smallLayout);
|
|
22050
|
+
const entityViewWidth = getEntityViewWidth(props, smallLayout, customizationController);
|
|
22280
22051
|
return {
|
|
22281
22052
|
key: `${props.path}/${props.entityId}`,
|
|
22282
22053
|
component: /* @__PURE__ */ jsxRuntime.jsx(EntitySidePanel, { ...resolvedPanelProps }),
|
|
@@ -22287,9 +22058,6 @@
|
|
|
22287
22058
|
additional: props
|
|
22288
22059
|
};
|
|
22289
22060
|
};
|
|
22290
|
-
function _temp$5(p) {
|
|
22291
|
-
return p.key;
|
|
22292
|
-
}
|
|
22293
22061
|
function useBuildSideDialogsController() {
|
|
22294
22062
|
const $ = reactCompilerRuntime.c(24);
|
|
22295
22063
|
const location = reactRouterDom.useLocation();
|
|
@@ -24174,7 +23942,6 @@
|
|
|
24174
23942
|
exports2.FireCMSRouter = FireCMSRouter;
|
|
24175
23943
|
exports2.FormEntry = FormEntry;
|
|
24176
23944
|
exports2.FormLayout = FormLayout;
|
|
24177
|
-
exports2.FormLayoutInner = FormLayoutInner;
|
|
24178
23945
|
exports2.GeoPoint = GeoPoint;
|
|
24179
23946
|
exports2.IconForView = IconForView;
|
|
24180
23947
|
exports2.ImagePreview = ImagePreview;
|
|
@@ -24331,6 +24098,7 @@
|
|
|
24331
24098
|
exports2.resolvePropertyEnum = resolvePropertyEnum;
|
|
24332
24099
|
exports2.resolveStorageFilenameString = resolveStorageFilenameString;
|
|
24333
24100
|
exports2.resolveStoragePathString = resolveStoragePathString;
|
|
24101
|
+
exports2.resolvedSelectedEntityView = resolvedSelectedEntityView;
|
|
24334
24102
|
exports2.sanitizeData = sanitizeData;
|
|
24335
24103
|
exports2.saveEntityWithCallbacks = saveEntityWithCallbacks;
|
|
24336
24104
|
exports2.segmentsToStrippedPath = segmentsToStrippedPath;
|