@firecms/core 3.0.0-canary.246 → 3.0.0-canary.247
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/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/index.es.js +112 -121
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +112 -121
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/ArrayContainer.tsx +1 -0
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +13 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +52 -26
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +9 -9
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +1 -0
- package/src/components/HomePage/NavigationCardBinding.tsx +3 -1
- package/src/form/PropertyFieldBinding.tsx +0 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +3 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +5 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.d.ts +0 -5
- package/src/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.tsx +0 -59
package/dist/index.umd.js
CHANGED
|
@@ -8853,7 +8853,7 @@
|
|
|
8853
8853
|
return t8;
|
|
8854
8854
|
};
|
|
8855
8855
|
const EntityTableCell = React.memo(function EntityTableCell2(t0) {
|
|
8856
|
-
const $ = reactCompilerRuntime.c(
|
|
8856
|
+
const $ = reactCompilerRuntime.c(48);
|
|
8857
8857
|
const {
|
|
8858
8858
|
children,
|
|
8859
8859
|
actions,
|
|
@@ -9082,11 +9082,11 @@
|
|
|
9082
9082
|
}
|
|
9083
9083
|
let t25;
|
|
9084
9084
|
if ($[37] !== actions || $[38] !== onFocus || $[39] !== t16 || $[40] !== t19 || $[41] !== t20 || $[42] !== t23 || $[43] !== t24) {
|
|
9085
|
-
t25 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t16, ref, style: t19, tabIndex: t20, onFocus, onMouseEnter: setOnHoverTrue, onMouseMove: setOnHoverTrue, onMouseLeave: setOnHoverFalse, children: [
|
|
9085
|
+
t25 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t16, ref, style: t19, tabIndex: t20, onFocus, onMouseEnter: setOnHoverTrue, onMouseMove: setOnHoverTrue, onMouseLeave: setOnHoverFalse, children: [
|
|
9086
9086
|
t23,
|
|
9087
9087
|
actions,
|
|
9088
9088
|
t24
|
|
9089
|
-
] });
|
|
9089
|
+
] }) });
|
|
9090
9090
|
$[37] = actions;
|
|
9091
9091
|
$[38] = onFocus;
|
|
9092
9092
|
$[39] = t16;
|
|
@@ -9098,7 +9098,21 @@
|
|
|
9098
9098
|
} else {
|
|
9099
9099
|
t25 = $[44];
|
|
9100
9100
|
}
|
|
9101
|
-
|
|
9101
|
+
const result = t25;
|
|
9102
|
+
if (showError) {
|
|
9103
|
+
const t26 = error?.message ?? "Error";
|
|
9104
|
+
let t27;
|
|
9105
|
+
if ($[45] !== result || $[46] !== t26) {
|
|
9106
|
+
t27 = /* @__PURE__ */ jsxRuntime.jsx(ErrorTooltip, { align: "start", title: t26, children: result });
|
|
9107
|
+
$[45] = result;
|
|
9108
|
+
$[46] = t26;
|
|
9109
|
+
$[47] = t27;
|
|
9110
|
+
} else {
|
|
9111
|
+
t27 = $[47];
|
|
9112
|
+
}
|
|
9113
|
+
return t27;
|
|
9114
|
+
}
|
|
9115
|
+
return result;
|
|
9102
9116
|
}, (a, b) => {
|
|
9103
9117
|
return a.error === b.error && a.value === b.value && a.disabled === b.disabled && a.saved === b.saved && a.allowScroll === b.allowScroll && a.align === b.align && a.size === b.size && a.disabledTooltip === b.disabledTooltip && a.width === b.width && a.showExpandIcon === b.showExpandIcon && a.removePadding === b.removePadding && a.fullHeight === b.fullHeight && a.selected === b.selected;
|
|
9104
9118
|
});
|
|
@@ -12944,7 +12958,7 @@
|
|
|
12944
12958
|
const favourite = t4;
|
|
12945
12959
|
let t5;
|
|
12946
12960
|
if ($[7] !== collection || $[8] !== context || $[9] !== customizationController.plugins || $[10] !== favourite || $[11] !== path || $[12] !== userConfigurationPersistence) {
|
|
12947
|
-
const actionsArray = userConfigurationPersistence ? [/* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: (e) => {
|
|
12961
|
+
const actionsArray = userConfigurationPersistence ? [/* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (e) => {
|
|
12948
12962
|
e.preventDefault();
|
|
12949
12963
|
e.stopPropagation();
|
|
12950
12964
|
if (favourite) {
|
|
@@ -12952,7 +12966,7 @@
|
|
|
12952
12966
|
} else {
|
|
12953
12967
|
userConfigurationPersistence.setFavouritePaths([...userConfigurationPersistence.favouritePaths, path]);
|
|
12954
12968
|
}
|
|
12955
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx(ui.StarIcon, { size:
|
|
12969
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(ui.StarIcon, { size: "small", className: favourite ? "text-secondary" : "text-surface-400 dark:text-surface-500" }) }, "favourite")] : [];
|
|
12956
12970
|
if (customizationController.plugins && collection) {
|
|
12957
12971
|
let t62;
|
|
12958
12972
|
if ($[14] !== collection || $[15] !== context || $[16] !== path) {
|
|
@@ -13712,7 +13726,7 @@
|
|
|
13712
13726
|
let relX = 0;
|
|
13713
13727
|
let relY = 0;
|
|
13714
13728
|
const listeningRef = React.useRef(false);
|
|
13715
|
-
const onMouseDown = (event) => {
|
|
13729
|
+
const onMouseDown = React.useCallback((event) => {
|
|
13716
13730
|
if (event.button !== 0 || !containerRef.current || event.defaultPrevented || event.innerClicked) {
|
|
13717
13731
|
return;
|
|
13718
13732
|
}
|
|
@@ -13726,14 +13740,14 @@
|
|
|
13726
13740
|
document.addEventListener("mouseup", onMouseUp);
|
|
13727
13741
|
document.addEventListener("selectstart", onSelect);
|
|
13728
13742
|
listeningRef.current = true;
|
|
13729
|
-
};
|
|
13730
|
-
const onMouseDownInner = (event_0) => {
|
|
13743
|
+
}, [containerRef, onMove]);
|
|
13744
|
+
const onMouseDownInner = React.useCallback((event_0) => {
|
|
13731
13745
|
event_0.innerClicked = true;
|
|
13732
|
-
};
|
|
13733
|
-
const onSelect = (event_1) => {
|
|
13746
|
+
}, []);
|
|
13747
|
+
const onSelect = React.useCallback((event_1) => {
|
|
13734
13748
|
event_1.preventDefault();
|
|
13735
13749
|
event_1.stopPropagation();
|
|
13736
|
-
};
|
|
13750
|
+
}, []);
|
|
13737
13751
|
const onMouseUp = (event_2) => {
|
|
13738
13752
|
document.removeEventListener("mousemove", onMouseMove);
|
|
13739
13753
|
document.removeEventListener("mouseup", onMouseUp);
|
|
@@ -13766,7 +13780,7 @@
|
|
|
13766
13780
|
if (current) current.removeEventListener("mousedown", onMouseDown);
|
|
13767
13781
|
if (innerCurrent) innerCurrent.removeEventListener("mousedown", onMouseDownInner);
|
|
13768
13782
|
};
|
|
13769
|
-
});
|
|
13783
|
+
}, [containerRef, innerRef, onMouseDownInner, onMouseDown]);
|
|
13770
13784
|
}
|
|
13771
13785
|
function useWindowSize() {
|
|
13772
13786
|
const $ = reactCompilerRuntime.c(3);
|
|
@@ -13805,46 +13819,6 @@
|
|
|
13805
13819
|
React.useLayoutEffect(t1, t2);
|
|
13806
13820
|
return size;
|
|
13807
13821
|
}
|
|
13808
|
-
const ElementResizeListener = ({
|
|
13809
|
-
onResize
|
|
13810
|
-
}) => {
|
|
13811
|
-
const rafRef = React.useRef(0);
|
|
13812
|
-
const objectRef = React.useRef(null);
|
|
13813
|
-
const onResizeRef = React.useRef(onResize);
|
|
13814
|
-
onResizeRef.current = onResize;
|
|
13815
|
-
const _onResize = React.useCallback((e) => {
|
|
13816
|
-
if (rafRef.current) {
|
|
13817
|
-
cancelAnimationFrame(rafRef.current);
|
|
13818
|
-
}
|
|
13819
|
-
rafRef.current = requestAnimationFrame(() => {
|
|
13820
|
-
onResizeRef.current(e);
|
|
13821
|
-
});
|
|
13822
|
-
}, []);
|
|
13823
|
-
const onLoad = React.useCallback(() => {
|
|
13824
|
-
const obj = objectRef.current;
|
|
13825
|
-
if (obj && obj.contentDocument && obj.contentDocument.defaultView) {
|
|
13826
|
-
obj.contentDocument.defaultView.addEventListener("resize", _onResize);
|
|
13827
|
-
}
|
|
13828
|
-
}, [_onResize]);
|
|
13829
|
-
React.useEffect(() => {
|
|
13830
|
-
const obj_0 = objectRef.current;
|
|
13831
|
-
return () => {
|
|
13832
|
-
if (obj_0 && obj_0.contentDocument && obj_0.contentDocument.defaultView) {
|
|
13833
|
-
obj_0.contentDocument.defaultView.removeEventListener("resize", _onResize);
|
|
13834
|
-
}
|
|
13835
|
-
};
|
|
13836
|
-
}, [_onResize]);
|
|
13837
|
-
return /* @__PURE__ */ jsxRuntime.jsx("object", { onLoad, ref: objectRef, tabIndex: -1, type: "text/html", data: "about:blank", title: "", style: {
|
|
13838
|
-
position: "absolute",
|
|
13839
|
-
top: 0,
|
|
13840
|
-
left: 0,
|
|
13841
|
-
height: "100%",
|
|
13842
|
-
width: "100%",
|
|
13843
|
-
pointerEvents: "none",
|
|
13844
|
-
zIndex: -1,
|
|
13845
|
-
opacity: 0
|
|
13846
|
-
} });
|
|
13847
|
-
};
|
|
13848
13822
|
function CustomIdField({
|
|
13849
13823
|
customId,
|
|
13850
13824
|
entityId,
|
|
@@ -15150,7 +15124,8 @@
|
|
|
15150
15124
|
!collection && /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error: "The specified collection does not exist. Check console" }),
|
|
15151
15125
|
collection && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "group", children: [
|
|
15152
15126
|
/* @__PURE__ */ jsxRuntime.jsx(ArrayContainer, { droppableId: propertyKey, value, disabled: isSubmitting, buildEntry, canAddElements: false, addLabel: property.name ? "Add reference to " + property.name : "Add reference", newDefaultEntry: property.of.defaultValue, onValueChange: (value_0) => setFieldValue(propertyKey, value_0) }),
|
|
15153
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { className: "my-4 justify-center text-left", variant: "text", color: "primary", disabled: isSubmitting, onClick: onEntryClick, children: [
|
|
15127
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { className: "ml-3.5 my-4 justify-center text-left", variant: "text", color: "primary", disabled: isSubmitting, onClick: onEntryClick, children: [
|
|
15128
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.EditIcon, { size: "small" }),
|
|
15154
15129
|
"Edit ",
|
|
15155
15130
|
property.name
|
|
15156
15131
|
] })
|
|
@@ -16821,6 +16796,7 @@
|
|
|
16821
16796
|
error,
|
|
16822
16797
|
disabled,
|
|
16823
16798
|
property,
|
|
16799
|
+
partOfArray,
|
|
16824
16800
|
minimalistView: minimalistViewProp,
|
|
16825
16801
|
includeDescription,
|
|
16826
16802
|
autoFocus,
|
|
@@ -16945,7 +16921,7 @@
|
|
|
16945
16921
|
}
|
|
16946
16922
|
const t6 = minimalistView && mapFormView;
|
|
16947
16923
|
const t7 = showError ?? false;
|
|
16948
|
-
const t8 = error ? typeof error === "string" ? error : "A property of this map has an error" : void 0;
|
|
16924
|
+
const t8 = error && !partOfArray ? typeof error === "string" ? error : "A property of this map has an error" : void 0;
|
|
16949
16925
|
let t9;
|
|
16950
16926
|
if ($[31] !== disabled || $[32] !== includeDescription || $[33] !== property || $[34] !== t7 || $[35] !== t8) {
|
|
16951
16927
|
t9 = /* @__PURE__ */ jsxRuntime.jsx(FieldHelperText, { includeDescription, showError: t7, error: t8, disabled, property });
|
|
@@ -17796,6 +17772,7 @@
|
|
|
17796
17772
|
minimalistView: false,
|
|
17797
17773
|
autoFocus: internalId === lastAddedId
|
|
17798
17774
|
};
|
|
17775
|
+
console.debug("Building entry for", index, fieldProps);
|
|
17799
17776
|
return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(PropertyFieldBinding, { ...fieldProps, index }) });
|
|
17800
17777
|
};
|
|
17801
17778
|
$[4] = context;
|
|
@@ -18432,7 +18409,7 @@
|
|
|
18432
18409
|
return t0;
|
|
18433
18410
|
}
|
|
18434
18411
|
function PopupFormFieldLoading(t0) {
|
|
18435
|
-
const $ = reactCompilerRuntime.c(
|
|
18412
|
+
const $ = reactCompilerRuntime.c(21);
|
|
18436
18413
|
const {
|
|
18437
18414
|
tableKey,
|
|
18438
18415
|
entityId,
|
|
@@ -18449,6 +18426,7 @@
|
|
|
18449
18426
|
const dataSource = useDataSource();
|
|
18450
18427
|
const [entity, setEntity] = React.useState(void 0);
|
|
18451
18428
|
let t1;
|
|
18429
|
+
let t2;
|
|
18452
18430
|
if ($[0] !== dataSource || $[1] !== entityId || $[2] !== inputCollection || $[3] !== path) {
|
|
18453
18431
|
t1 = () => {
|
|
18454
18432
|
if (entityId && inputCollection) {
|
|
@@ -18459,29 +18437,23 @@
|
|
|
18459
18437
|
}).then(setEntity);
|
|
18460
18438
|
}
|
|
18461
18439
|
};
|
|
18440
|
+
t2 = [entityId, inputCollection, dataSource, path];
|
|
18462
18441
|
$[0] = dataSource;
|
|
18463
18442
|
$[1] = entityId;
|
|
18464
18443
|
$[2] = inputCollection;
|
|
18465
18444
|
$[3] = path;
|
|
18466
18445
|
$[4] = t1;
|
|
18446
|
+
$[5] = t2;
|
|
18467
18447
|
} else {
|
|
18468
18448
|
t1 = $[4];
|
|
18469
|
-
|
|
18470
|
-
let t2;
|
|
18471
|
-
if ($[5] !== entityId || $[6] !== inputCollection) {
|
|
18472
|
-
t2 = [entityId, inputCollection];
|
|
18473
|
-
$[5] = entityId;
|
|
18474
|
-
$[6] = inputCollection;
|
|
18475
|
-
$[7] = t2;
|
|
18476
|
-
} else {
|
|
18477
|
-
t2 = $[7];
|
|
18449
|
+
t2 = $[5];
|
|
18478
18450
|
}
|
|
18479
18451
|
React.useEffect(t1, t2);
|
|
18480
18452
|
if (!entity) {
|
|
18481
18453
|
return null;
|
|
18482
18454
|
}
|
|
18483
18455
|
let t3;
|
|
18484
|
-
if ($[
|
|
18456
|
+
if ($[6] !== cellRect || $[7] !== container || $[8] !== customFieldValidator || $[9] !== entityId || $[10] !== inputCollection || $[11] !== onCellValueChange || $[12] !== onClose || $[13] !== open || $[14] !== path || $[15] !== propertyKey || $[16] !== tableKey) {
|
|
18485
18457
|
t3 = {
|
|
18486
18458
|
tableKey,
|
|
18487
18459
|
entityId,
|
|
@@ -18495,29 +18467,29 @@
|
|
|
18495
18467
|
onCellValueChange,
|
|
18496
18468
|
container
|
|
18497
18469
|
};
|
|
18498
|
-
$[
|
|
18499
|
-
$[
|
|
18500
|
-
$[
|
|
18501
|
-
$[
|
|
18502
|
-
$[
|
|
18503
|
-
$[
|
|
18504
|
-
$[
|
|
18505
|
-
$[
|
|
18506
|
-
$[
|
|
18507
|
-
$[
|
|
18508
|
-
$[
|
|
18509
|
-
$[
|
|
18470
|
+
$[6] = cellRect;
|
|
18471
|
+
$[7] = container;
|
|
18472
|
+
$[8] = customFieldValidator;
|
|
18473
|
+
$[9] = entityId;
|
|
18474
|
+
$[10] = inputCollection;
|
|
18475
|
+
$[11] = onCellValueChange;
|
|
18476
|
+
$[12] = onClose;
|
|
18477
|
+
$[13] = open;
|
|
18478
|
+
$[14] = path;
|
|
18479
|
+
$[15] = propertyKey;
|
|
18480
|
+
$[16] = tableKey;
|
|
18481
|
+
$[17] = t3;
|
|
18510
18482
|
} else {
|
|
18511
|
-
t3 = $[
|
|
18483
|
+
t3 = $[17];
|
|
18512
18484
|
}
|
|
18513
18485
|
let t4;
|
|
18514
|
-
if ($[
|
|
18486
|
+
if ($[18] !== entity || $[19] !== t3) {
|
|
18515
18487
|
t4 = /* @__PURE__ */ jsxRuntime.jsx(PopupFormFieldInternal, { ...t3, entity });
|
|
18516
|
-
$[
|
|
18517
|
-
$[
|
|
18518
|
-
$[
|
|
18488
|
+
$[18] = entity;
|
|
18489
|
+
$[19] = t3;
|
|
18490
|
+
$[20] = t4;
|
|
18519
18491
|
} else {
|
|
18520
|
-
t4 = $[
|
|
18492
|
+
t4 = $[20];
|
|
18521
18493
|
}
|
|
18522
18494
|
return t4;
|
|
18523
18495
|
}
|
|
@@ -18559,23 +18531,26 @@
|
|
|
18559
18531
|
y: cellRect.top < windowSize.height - cellRect.bottom ? cellRect.y + cellRect.height / 2 : cellRect.y - cellRect.height / 2
|
|
18560
18532
|
};
|
|
18561
18533
|
}, [cellRect, windowSize.height, windowSize.width]);
|
|
18562
|
-
const normalizePosition = React.useCallback(({
|
|
18563
|
-
|
|
18564
|
-
|
|
18565
|
-
|
|
18566
|
-
const draggableBoundingRect = draggableRef.current?.getBoundingClientRect();
|
|
18567
|
-
if (!draggableBoundingRect) throw Error("normalizePosition called before draggableBoundingRect is set");
|
|
18534
|
+
const normalizePosition = React.useCallback((pos, draggableBoundingRect, currentWindowSize) => {
|
|
18535
|
+
if (!draggableBoundingRect || draggableBoundingRect.width === 0 || draggableBoundingRect.height === 0) {
|
|
18536
|
+
return pos;
|
|
18537
|
+
}
|
|
18568
18538
|
return {
|
|
18569
|
-
x: Math.max(0, Math.min(x,
|
|
18570
|
-
y: Math.max(0, Math.min(y,
|
|
18539
|
+
x: Math.max(0, Math.min(pos.x, currentWindowSize.width - draggableBoundingRect.width)),
|
|
18540
|
+
y: Math.max(0, Math.min(pos.y, currentWindowSize.height - draggableBoundingRect.height))
|
|
18571
18541
|
};
|
|
18572
|
-
}, [
|
|
18573
|
-
const updatePopupLocation = React.useCallback((
|
|
18542
|
+
}, []);
|
|
18543
|
+
const updatePopupLocation = React.useCallback((newPositionCandidate) => {
|
|
18574
18544
|
const draggableBoundingRect_0 = draggableRef.current?.getBoundingClientRect();
|
|
18575
|
-
if (!cellRect || !draggableBoundingRect_0)
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18545
|
+
if (!cellRect || !draggableBoundingRect_0 || draggableBoundingRect_0.width === 0 || draggableBoundingRect_0.height === 0) {
|
|
18546
|
+
return;
|
|
18547
|
+
}
|
|
18548
|
+
const basePosition = newPositionCandidate ?? getInitialLocation();
|
|
18549
|
+
const newNormalizedPosition = normalizePosition(basePosition, draggableBoundingRect_0, windowSize);
|
|
18550
|
+
if (!popupLocation || newNormalizedPosition.x !== popupLocation.x || newNormalizedPosition.y !== popupLocation.y) {
|
|
18551
|
+
setPopupLocation(newNormalizedPosition);
|
|
18552
|
+
}
|
|
18553
|
+
}, [cellRect, getInitialLocation, normalizePosition, popupLocation, windowSize]);
|
|
18579
18554
|
useDraggable({
|
|
18580
18555
|
containerRef: draggableRef,
|
|
18581
18556
|
innerRef,
|
|
@@ -18586,15 +18561,22 @@
|
|
|
18586
18561
|
React.useEffect(() => {
|
|
18587
18562
|
initialPositionSet.current = false;
|
|
18588
18563
|
}, [propertyKey, entity]);
|
|
18589
|
-
React.useLayoutEffect(
|
|
18590
|
-
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
18564
|
+
React.useLayoutEffect(
|
|
18565
|
+
() => {
|
|
18566
|
+
if (!cellRect || initialPositionSet.current) return;
|
|
18567
|
+
const draggableBoundingRect_1 = draggableRef.current?.getBoundingClientRect();
|
|
18568
|
+
if (!draggableBoundingRect_1 || draggableBoundingRect_1.width === 0 || draggableBoundingRect_1.height === 0) {
|
|
18569
|
+
return;
|
|
18570
|
+
}
|
|
18571
|
+
updatePopupLocation();
|
|
18572
|
+
initialPositionSet.current = true;
|
|
18573
|
+
},
|
|
18574
|
+
[cellRect, updatePopupLocation]
|
|
18575
|
+
// Removed initialPositionSet.current from deps as it's a ref
|
|
18576
|
+
);
|
|
18595
18577
|
React.useLayoutEffect(() => {
|
|
18596
18578
|
updatePopupLocation(popupLocation);
|
|
18597
|
-
}, [windowSize, cellRect]);
|
|
18579
|
+
}, [windowSize, cellRect, updatePopupLocation, popupLocation]);
|
|
18598
18580
|
const validationSchema = React.useMemo(() => {
|
|
18599
18581
|
if (!collection || !entityId) return;
|
|
18600
18582
|
return getYupEntitySchema(entityId, propertyKey && collection.properties[propertyKey] ? {
|
|
@@ -18604,6 +18586,18 @@
|
|
|
18604
18586
|
const adaptResize = React.useCallback(() => {
|
|
18605
18587
|
return updatePopupLocation(popupLocation);
|
|
18606
18588
|
}, [popupLocation, updatePopupLocation]);
|
|
18589
|
+
React.useEffect(() => {
|
|
18590
|
+
const element = draggableRef.current;
|
|
18591
|
+
if (!element) return;
|
|
18592
|
+
const observer = new ResizeObserver(() => {
|
|
18593
|
+
adaptResize();
|
|
18594
|
+
});
|
|
18595
|
+
observer.observe(element);
|
|
18596
|
+
return () => {
|
|
18597
|
+
observer.unobserve(element);
|
|
18598
|
+
observer.disconnect();
|
|
18599
|
+
};
|
|
18600
|
+
}, [adaptResize, draggableRef]);
|
|
18607
18601
|
const saveValue = async (values) => {
|
|
18608
18602
|
setSavingError(null);
|
|
18609
18603
|
if (inputCollection && entity && onCellValueChange && propertyKey) {
|
|
@@ -18684,21 +18678,18 @@
|
|
|
18684
18678
|
internalForm,
|
|
18685
18679
|
savingError && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { color: "error", children: savingError.message })
|
|
18686
18680
|
] });
|
|
18687
|
-
const draggable = /* @__PURE__ */ jsxRuntime.
|
|
18681
|
+
const draggable = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
18688
18682
|
boxShadow: "0 0 0 2px rgba(128,128,128,0.2)"
|
|
18689
|
-
}, className: `inline-block fixed z-20 shadow-outline rounded-md bg-white dark:bg-surface-950 ${!open ? "invisible" : "visible"} cursor-grab overflow-visible`, ref: draggableRef, children: [
|
|
18690
|
-
|
|
18691
|
-
/* @__PURE__ */ jsxRuntime.
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, { className: "text-white", size: "small" }) }) })
|
|
18700
|
-
] })
|
|
18701
|
-
] }, `draggable_${propertyKey}_${entityId}_${open}`);
|
|
18683
|
+
}, className: `inline-block fixed z-20 shadow-outline rounded-md bg-white dark:bg-surface-950 ${!open ? "invisible" : "visible"} cursor-grab overflow-visible`, ref: draggableRef, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden", children: [
|
|
18684
|
+
form,
|
|
18685
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -top-3.5 -right-3.5 bg-surface-500 rounded-full", style: {
|
|
18686
|
+
width: "32px",
|
|
18687
|
+
height: "32px"
|
|
18688
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (event) => {
|
|
18689
|
+
event.stopPropagation();
|
|
18690
|
+
onClose();
|
|
18691
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(ui.CloseIcon, { className: "text-white", size: "small" }) }) })
|
|
18692
|
+
] }) }, `draggable_${propertyKey}_${entityId}_${open}`);
|
|
18702
18693
|
return /* @__PURE__ */ jsxRuntime.jsx(Portal__namespace.Root, { asChild: true, container, children: /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formex$1, children: draggable }) });
|
|
18703
18694
|
}
|
|
18704
18695
|
function ClearFilterSortButton(t0) {
|
|
@@ -19093,7 +19084,7 @@
|
|
|
19093
19084
|
dependencies: [],
|
|
19094
19085
|
Builder: ({
|
|
19095
19086
|
entity: entity_3
|
|
19096
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { color: "primary", variant: "outlined", startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.KeyboardTabIcon, { size: "small" }), onClick: (event) => {
|
|
19087
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { color: "primary", variant: "outlined", className: "max-w-full truncate justify-start", startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.KeyboardTabIcon, { size: "small" }), onClick: (event) => {
|
|
19097
19088
|
event.stopPropagation();
|
|
19098
19089
|
navigateToEntity({
|
|
19099
19090
|
openEntityMode,
|
|
@@ -20237,7 +20228,7 @@
|
|
|
20237
20228
|
};
|
|
20238
20229
|
return sortable$1 ? /* @__PURE__ */ jsxRuntime.jsx(core.DndContext, { sensors, modifiers: [modifiers.restrictToVerticalAxis], collisionDetection: core.closestCenter, onDragEnd, children: /* @__PURE__ */ jsxRuntime.jsx(sortable.SortableContext, { items: internalIds, strategy: sortable.verticalListSortingStrategy, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("space-y-1", className), id: droppableId, children: [
|
|
20239
20230
|
hasValue && internalIds.map((internalId_0, index_3) => /* @__PURE__ */ jsxRuntime.jsx(SortableItem, { id: internalId_0, index: index_3, size, disabled, buildEntry, remove, copy, addInIndex, canAddElements, sortable: sortable$1, storedProps: itemCustomPropsRef.current[internalId_0], updateItemCustomProps }, `array_field_${internalId_0}`)),
|
|
20240
|
-
canAddElements && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-4 justify-center text-left", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: size === "small" ? "small" : "medium", color: "primary", disabled: disabled || (value?.length ?? 0) >= max, startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.AddIcon, {}), onClick: insertInEnd, children: addLabel ?? "Add" }) })
|
|
20231
|
+
canAddElements && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-4 justify-center text-left", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: size === "small" ? "small" : "medium", color: "primary", disabled: disabled || (value?.length ?? 0) >= max, startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.AddIcon, {}), onClick: insertInEnd, className: "ml-3.5", children: addLabel ?? "Add" }) })
|
|
20241
20232
|
] }) }) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("space-y-1", className), id: droppableId, children: [
|
|
20242
20233
|
hasValue && internalIds.map((internalId_1, index_4) => /* @__PURE__ */ jsxRuntime.jsx(ArrayContainerItem, { nodeRef: (node) => {
|
|
20243
20234
|
}, style: {}, dragHandleProps: {}, internalId: internalId_1, index: index_4, size, disabled, buildEntry, remove, copy, addInIndex, canAddElements, sortable: false, isDragging: false, storedProps: itemCustomPropsRef.current[internalId_1], updateItemCustomProps }, `array_field_${internalId_1}`)),
|