@firecms/core 3.0.0-canary.118 → 3.0.0-canary.119
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/core/DrawerNavigationItem.d.ts +2 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +1 -1
- package/dist/index.es.js +46 -24
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +46 -24
- package/dist/index.umd.js.map +1 -1
- package/dist/types/datasource.d.ts +4 -0
- package/dist/types/properties.d.ts +1 -1
- package/dist/util/resolutions.d.ts +13 -0
- package/package.json +5 -5
- package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +0 -2
- package/src/core/DefaultDrawer.tsx +5 -3
- package/src/core/DrawerNavigationItem.tsx +3 -1
- package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
- package/src/form/field_bindings/RepeatFieldBinding.tsx +13 -4
- package/src/form/field_bindings/SelectFieldBinding.tsx +44 -43
- package/src/form/field_bindings/TextFieldBinding.tsx +0 -1
- package/src/form/index.tsx +0 -5
- package/src/types/datasource.ts +5 -0
- package/src/types/properties.ts +1 -1
- package/src/util/resolutions.ts +39 -11
package/dist/index.umd.js
CHANGED
|
@@ -6392,8 +6392,6 @@
|
|
|
6392
6392
|
className: "w-full h-full p-0 bg-transparent",
|
|
6393
6393
|
position: "item-aligned",
|
|
6394
6394
|
disabled,
|
|
6395
|
-
padding: false,
|
|
6396
|
-
includeFocusOutline: false,
|
|
6397
6395
|
value: validValue ? internalValue.map((v) => v.toString()) : [],
|
|
6398
6396
|
onMultiValueChange: onChange,
|
|
6399
6397
|
renderValue,
|
|
@@ -13910,7 +13908,7 @@
|
|
|
13910
13908
|
setValue(null);
|
|
13911
13909
|
}, [setValue]);
|
|
13912
13910
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13913
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13911
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13914
13912
|
ui.Select,
|
|
13915
13913
|
{
|
|
13916
13914
|
size: size === "medium" ? "medium" : "small",
|
|
@@ -13918,7 +13916,7 @@
|
|
|
13918
13916
|
disabled,
|
|
13919
13917
|
position: "item-aligned",
|
|
13920
13918
|
inputClassName: ui.cls("w-full"),
|
|
13921
|
-
label: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13919
|
+
label: /* @__PURE__ */ jsxRuntime.jsx(PropertyIdCopyTooltip, { propertyKey, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13922
13920
|
LabelWithIcon,
|
|
13923
13921
|
{
|
|
13924
13922
|
icon: getIconForProperty(property, "small"),
|
|
@@ -13926,7 +13924,7 @@
|
|
|
13926
13924
|
title: property.name,
|
|
13927
13925
|
className: "text-text-secondary dark:text-text-secondary-dark ml-3.5"
|
|
13928
13926
|
}
|
|
13929
|
-
),
|
|
13927
|
+
) }),
|
|
13930
13928
|
endAdornment: property.clearable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13931
13929
|
ui.IconButton,
|
|
13932
13930
|
{
|
|
@@ -13966,7 +13964,7 @@
|
|
|
13966
13964
|
);
|
|
13967
13965
|
})
|
|
13968
13966
|
}
|
|
13969
|
-
)
|
|
13967
|
+
),
|
|
13970
13968
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13971
13969
|
FieldHelperText,
|
|
13972
13970
|
{
|
|
@@ -14651,7 +14649,6 @@
|
|
|
14651
14649
|
) });
|
|
14652
14650
|
}
|
|
14653
14651
|
function TextFieldBinding({
|
|
14654
|
-
context,
|
|
14655
14652
|
propertyKey,
|
|
14656
14653
|
value,
|
|
14657
14654
|
setValue,
|
|
@@ -15280,7 +15277,7 @@
|
|
|
15280
15277
|
}
|
|
15281
15278
|
const mapFormView = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1 flex flex-col space-y-2", children: Object.entries(mapProperties).filter(([_, property2]) => !isHidden(property2)).map(
|
|
15282
15279
|
([entryKey, childProperty], index) => {
|
|
15283
|
-
const
|
|
15280
|
+
const fieldBindingProps = {
|
|
15284
15281
|
propertyKey: `${propertyKey}.${entryKey}`,
|
|
15285
15282
|
disabled,
|
|
15286
15283
|
property: childProperty,
|
|
@@ -15294,7 +15291,7 @@
|
|
|
15294
15291
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15295
15292
|
PropertyFieldBinding,
|
|
15296
15293
|
{
|
|
15297
|
-
...
|
|
15294
|
+
...fieldBindingProps
|
|
15298
15295
|
}
|
|
15299
15296
|
) }) }, `map-${propertyKey}-${index}`);
|
|
15300
15297
|
}
|
|
@@ -15975,8 +15972,15 @@
|
|
|
15975
15972
|
}) {
|
|
15976
15973
|
if (!property.of)
|
|
15977
15974
|
throw Error("RepeatFieldBinding misconfiguration. Property `of` not set");
|
|
15978
|
-
|
|
15979
|
-
|
|
15975
|
+
let resolvedProperties = property.resolvedProperties;
|
|
15976
|
+
if (!resolvedProperties) {
|
|
15977
|
+
resolvedProperties = getArrayResolvedProperties({
|
|
15978
|
+
propertyValue: value,
|
|
15979
|
+
propertyKey,
|
|
15980
|
+
property,
|
|
15981
|
+
ignoreMissingFields: false
|
|
15982
|
+
});
|
|
15983
|
+
}
|
|
15980
15984
|
const expanded = property.expanded === void 0 ? true : property.expanded;
|
|
15981
15985
|
const ofProperty = property.of;
|
|
15982
15986
|
const [lastAddedId, setLastAddedId] = React.useState();
|
|
@@ -15986,7 +15990,7 @@
|
|
|
15986
15990
|
setValue
|
|
15987
15991
|
});
|
|
15988
15992
|
const buildEntry = (index, internalId) => {
|
|
15989
|
-
const childProperty =
|
|
15993
|
+
const childProperty = resolvedProperties[index] ?? ofProperty;
|
|
15990
15994
|
const fieldProps = {
|
|
15991
15995
|
propertyKey: `${propertyKey}.${index}`,
|
|
15992
15996
|
disabled,
|
|
@@ -16926,6 +16930,22 @@
|
|
|
16926
16930
|
resolved: true
|
|
16927
16931
|
} : null;
|
|
16928
16932
|
}
|
|
16933
|
+
function getArrayResolvedProperties({
|
|
16934
|
+
propertyKey,
|
|
16935
|
+
propertyValue,
|
|
16936
|
+
property,
|
|
16937
|
+
...props
|
|
16938
|
+
}) {
|
|
16939
|
+
const of = property.of;
|
|
16940
|
+
return Array.isArray(propertyValue) ? propertyValue.map((v, index) => {
|
|
16941
|
+
return resolveProperty({
|
|
16942
|
+
propertyKey: `${propertyKey}.${index}`,
|
|
16943
|
+
propertyOrBuilder: of,
|
|
16944
|
+
...props,
|
|
16945
|
+
index
|
|
16946
|
+
});
|
|
16947
|
+
}).filter((e) => Boolean(e)) : [];
|
|
16948
|
+
}
|
|
16929
16949
|
function resolveArrayProperty({
|
|
16930
16950
|
propertyKey,
|
|
16931
16951
|
property,
|
|
@@ -16951,15 +16971,13 @@
|
|
|
16951
16971
|
};
|
|
16952
16972
|
} else {
|
|
16953
16973
|
const of = property.of;
|
|
16954
|
-
const resolvedProperties =
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
|
|
16961
|
-
});
|
|
16962
|
-
}).filter((e) => Boolean(e)) : [];
|
|
16974
|
+
const resolvedProperties = getArrayResolvedProperties({
|
|
16975
|
+
propertyValue,
|
|
16976
|
+
propertyKey,
|
|
16977
|
+
property,
|
|
16978
|
+
ignoreMissingFields,
|
|
16979
|
+
...props
|
|
16980
|
+
});
|
|
16963
16981
|
const ofProperty = resolveProperty({
|
|
16964
16982
|
propertyOrBuilder: of,
|
|
16965
16983
|
ignoreMissingFields,
|
|
@@ -19350,6 +19368,7 @@
|
|
|
19350
19368
|
name,
|
|
19351
19369
|
icon,
|
|
19352
19370
|
drawerOpen,
|
|
19371
|
+
adminMenuOpen,
|
|
19353
19372
|
tooltipsOpen,
|
|
19354
19373
|
url,
|
|
19355
19374
|
onClick
|
|
@@ -19398,7 +19417,7 @@
|
|
|
19398
19417
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19399
19418
|
ui.Tooltip,
|
|
19400
19419
|
{
|
|
19401
|
-
open: drawerOpen ? false : tooltipsOpen,
|
|
19420
|
+
open: drawerOpen || adminMenuOpen ? false : tooltipsOpen,
|
|
19402
19421
|
side: "right",
|
|
19403
19422
|
title: name,
|
|
19404
19423
|
children: listItem
|
|
@@ -19415,12 +19434,12 @@
|
|
|
19415
19434
|
closeDrawer,
|
|
19416
19435
|
logo
|
|
19417
19436
|
} = useApp();
|
|
19437
|
+
const [adminMenuOpen, setAdminMenuOpen] = React.useState(false);
|
|
19418
19438
|
const analyticsController = useAnalyticsController();
|
|
19419
19439
|
const navigation = useNavigationController();
|
|
19420
|
-
const tooltipsOpen = drawerHovered && !drawerOpen;
|
|
19440
|
+
const tooltipsOpen = drawerHovered && !drawerOpen && !adminMenuOpen;
|
|
19421
19441
|
const largeLayout = useLargeLayout();
|
|
19422
19442
|
const navigate = reactRouterDom.useNavigate();
|
|
19423
|
-
const [adminMenuOpen, setAdminMenuOpen] = React.useState(false);
|
|
19424
19443
|
if (!navigation.topLevelNavigation)
|
|
19425
19444
|
throw Error("Navigation not ready in Drawer");
|
|
19426
19445
|
const {
|
|
@@ -19465,6 +19484,7 @@
|
|
|
19465
19484
|
{
|
|
19466
19485
|
icon: /* @__PURE__ */ jsxRuntime.jsx(IconForView, { collectionOrView: view.collection ?? view.view }),
|
|
19467
19486
|
tooltipsOpen,
|
|
19487
|
+
adminMenuOpen,
|
|
19468
19488
|
drawerOpen,
|
|
19469
19489
|
onClick: () => onClick(view),
|
|
19470
19490
|
url: view.url,
|
|
@@ -19479,6 +19499,7 @@
|
|
|
19479
19499
|
adminViews.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19480
19500
|
ui.Menu,
|
|
19481
19501
|
{
|
|
19502
|
+
side: "right",
|
|
19482
19503
|
open: adminMenuOpen,
|
|
19483
19504
|
onOpenChange: setAdminMenuOpen,
|
|
19484
19505
|
trigger: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -19790,6 +19811,7 @@
|
|
|
19790
19811
|
exports2.enumToObjectEntries = enumToObjectEntries;
|
|
19791
19812
|
exports2.flattenObject = flattenObject;
|
|
19792
19813
|
exports2.fullPathToCollectionSegments = fullPathToCollectionSegments;
|
|
19814
|
+
exports2.getArrayResolvedProperties = getArrayResolvedProperties;
|
|
19793
19815
|
exports2.getArrayValuesCount = getArrayValuesCount;
|
|
19794
19816
|
exports2.getBracketNotation = getBracketNotation;
|
|
19795
19817
|
exports2.getCollectionByPathOrId = getCollectionByPathOrId;
|