@firecms/core 3.0.0-canary.122 → 3.0.0-canary.124
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 -40
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +50 -40
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +8 -7
- package/src/components/EntityPreview.tsx +2 -2
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +12 -12
- package/src/core/DefaultDrawer.tsx +9 -5
- package/src/core/DrawerNavigationItem.tsx +4 -4
package/dist/index.umd.js
CHANGED
|
@@ -5177,7 +5177,7 @@
|
|
|
5177
5177
|
hover: disabled ? void 0 : hover,
|
|
5178
5178
|
size,
|
|
5179
5179
|
children: [
|
|
5180
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("w-10 h-10 mr-2 shrink-0 grow-0", size === "smallest" ? "my-0.5" : "m-2 self-start"), children: [
|
|
5180
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex w-10 h-10 mr-2 shrink-0 grow-0", size === "smallest" ? "my-0.5" : "m-2 self-start"), children: [
|
|
5181
5181
|
imageProperty && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5182
5182
|
PropertyPreview,
|
|
5183
5183
|
{
|
|
@@ -5187,7 +5187,7 @@
|
|
|
5187
5187
|
value: getValueInPath(entity.values, imagePropertyKey)
|
|
5188
5188
|
}
|
|
5189
5189
|
),
|
|
5190
|
-
!imageProperty && /* @__PURE__ */ jsxRuntime.jsx(IconForView, { collectionOrView: collection, size, className: "
|
|
5190
|
+
!imageProperty && /* @__PURE__ */ jsxRuntime.jsx(IconForView, { collectionOrView: collection, size, className: "m-auto" })
|
|
5191
5191
|
] }),
|
|
5192
5192
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-grow w-full m-1", children: [
|
|
5193
5193
|
size !== "smallest" && includeId && (entity ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${size !== "medium" ? "block whitespace-nowrap overflow-hidden truncate" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7247,7 +7247,7 @@
|
|
|
7247
7247
|
EntityPreviewContainer,
|
|
7248
7248
|
{
|
|
7249
7249
|
className: ui.cls(
|
|
7250
|
-
"
|
|
7250
|
+
"px-4 py-2 text-sm font-medium flex items-center uppercase",
|
|
7251
7251
|
multiselect ? "gap-4" : "gap-6",
|
|
7252
7252
|
disabled ? "text-slate-500" : "cursor-pointer text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-gray-800 group-hover:bg-slate-50 dark:group-hover:bg-gray-800"
|
|
7253
7253
|
),
|
|
@@ -10389,6 +10389,16 @@
|
|
|
10389
10389
|
const pageSize = typeof collection.pagination === "number" ? collection.pagination : DEFAULT_PAGE_SIZE;
|
|
10390
10390
|
const [searchString, setSearchString] = React.useState();
|
|
10391
10391
|
const [itemCount, setItemCount] = React.useState(paginationEnabled ? pageSize : void 0);
|
|
10392
|
+
const checkFilterCombination = React.useCallback((filterValues2, sortBy2) => {
|
|
10393
|
+
if (!dataSource.isFilterCombinationValid)
|
|
10394
|
+
return true;
|
|
10395
|
+
return dataSource.isFilterCombinationValid({
|
|
10396
|
+
path: resolvedPath,
|
|
10397
|
+
collection,
|
|
10398
|
+
filterValues: filterValues2,
|
|
10399
|
+
sortBy: sortBy2
|
|
10400
|
+
});
|
|
10401
|
+
}, []);
|
|
10392
10402
|
const initialSortInternal = React.useMemo(() => {
|
|
10393
10403
|
if (initialSort && forceFilter && !checkFilterCombination(forceFilter, initialSort)) {
|
|
10394
10404
|
console.warn("Initial sort is not compatible with the force filter. Ignoring initial sort");
|
|
@@ -10410,16 +10420,6 @@
|
|
|
10410
10420
|
const [dataLoading, setDataLoading] = React.useState(false);
|
|
10411
10421
|
const [dataLoadingError, setDataLoadingError] = React.useState();
|
|
10412
10422
|
const [noMoreToLoad, setNoMoreToLoad] = React.useState(false);
|
|
10413
|
-
const checkFilterCombination = React.useCallback((filterValues2, sortBy2) => {
|
|
10414
|
-
if (!dataSource.isFilterCombinationValid)
|
|
10415
|
-
return true;
|
|
10416
|
-
return dataSource.isFilterCombinationValid({
|
|
10417
|
-
path: resolvedPath,
|
|
10418
|
-
collection,
|
|
10419
|
-
filterValues: filterValues2,
|
|
10420
|
-
sortBy: sortBy2
|
|
10421
|
-
});
|
|
10422
|
-
}, []);
|
|
10423
10423
|
const clearFilter = React.useCallback(() => setFilterValues(forceFilter ?? void 0), [forceFilter]);
|
|
10424
10424
|
const updateFilterValues = React.useCallback((updatedFilter) => {
|
|
10425
10425
|
if (forceFilter) {
|
|
@@ -19423,18 +19423,18 @@
|
|
|
19423
19423
|
{
|
|
19424
19424
|
onClick,
|
|
19425
19425
|
style: {
|
|
19426
|
-
width:
|
|
19426
|
+
width: "100%",
|
|
19427
19427
|
transition: drawerOpen ? "width 150ms ease-in" : void 0
|
|
19428
19428
|
},
|
|
19429
19429
|
className: ({ isActive }) => ui.cls(
|
|
19430
|
-
"rounded-
|
|
19430
|
+
"rounded-lg truncate",
|
|
19431
19431
|
"hover:bg-slate-300 hover:bg-opacity-75 dark:hover:bg-gray-700 dark:hover:bg-opacity-75 text-gray-800 dark:text-gray-200 hover:text-gray-900 hover:dark:text-white",
|
|
19432
19432
|
"flex flex-row items-center mr-8",
|
|
19433
19433
|
// "transition-all ease-in-out delay-100 duration-300",
|
|
19434
19434
|
// drawerOpen ? "w-full" : "w-18",
|
|
19435
|
-
drawerOpen ? "pl-
|
|
19435
|
+
drawerOpen ? "pl-4 h-12" : "pl-4 h-11",
|
|
19436
19436
|
"font-medium text-sm",
|
|
19437
|
-
isActive ? "bg-slate-200 bg-opacity-60 dark:bg-gray-800 dark:bg-opacity-
|
|
19437
|
+
isActive ? "bg-slate-200 bg-opacity-60 dark:bg-gray-800 dark:bg-opacity-50" : ""
|
|
19438
19438
|
),
|
|
19439
19439
|
to: url,
|
|
19440
19440
|
children: [
|
|
@@ -19487,11 +19487,11 @@
|
|
|
19487
19487
|
const adminViews = navigationEntries.filter((e) => e.type === "admin") ?? [];
|
|
19488
19488
|
const groupsWithoutAdmin = groups.filter((g) => g !== "Admin");
|
|
19489
19489
|
const buildGroupHeader = React.useCallback((group) => {
|
|
19490
|
-
if (!drawerOpen) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
19490
|
+
if (!drawerOpen) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full" });
|
|
19491
19491
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19492
19492
|
"div",
|
|
19493
19493
|
{
|
|
19494
|
-
className: "
|
|
19494
|
+
className: "pl-6 pr-8 py-4 flex flex-row items-center",
|
|
19495
19495
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19496
19496
|
ui.Typography,
|
|
19497
19497
|
{
|
|
@@ -19512,28 +19512,38 @@
|
|
|
19512
19512
|
};
|
|
19513
19513
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex flex-col h-full relative flex-grow w-full", className), style, children: [
|
|
19514
19514
|
/* @__PURE__ */ jsxRuntime.jsx(DrawerLogo, { logo }),
|
|
19515
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19516
|
-
|
|
19515
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19516
|
+
"div",
|
|
19517
19517
|
{
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19521
|
-
|
|
19522
|
-
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
|
|
19529
|
-
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19518
|
+
className: "mt-4 flex-grow overflow-scroll no-scrollbar",
|
|
19519
|
+
style: {
|
|
19520
|
+
maskImage: "linear-gradient(to bottom, transparent 0, black 20px, black calc(100% - 20px), transparent 100%)"
|
|
19521
|
+
},
|
|
19522
|
+
children: groupsWithoutAdmin.map((group) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19523
|
+
"div",
|
|
19524
|
+
{
|
|
19525
|
+
className: "bg-gray-50 dark:bg-gray-800 dark:bg-opacity-30 my-4 rounded-lg ml-4",
|
|
19526
|
+
children: [
|
|
19527
|
+
buildGroupHeader(group),
|
|
19528
|
+
Object.values(navigationEntries).filter((e) => e.group === group).map((view, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
19529
|
+
DrawerNavigationItem,
|
|
19530
|
+
{
|
|
19531
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(IconForView, { collectionOrView: view.collection ?? view.view }),
|
|
19532
|
+
tooltipsOpen,
|
|
19533
|
+
adminMenuOpen,
|
|
19534
|
+
drawerOpen,
|
|
19535
|
+
onClick: () => onClick(view),
|
|
19536
|
+
url: view.url,
|
|
19537
|
+
name: view.name
|
|
19538
|
+
},
|
|
19539
|
+
`navigation_${index}`
|
|
19540
|
+
))
|
|
19541
|
+
]
|
|
19542
|
+
},
|
|
19543
|
+
`drawer_group_${group}`
|
|
19544
|
+
))
|
|
19545
|
+
}
|
|
19546
|
+
),
|
|
19537
19547
|
adminViews.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19538
19548
|
ui.Menu,
|
|
19539
19549
|
{
|