@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.es.js
CHANGED
|
@@ -5173,7 +5173,7 @@ function EntityPreview({
|
|
|
5173
5173
|
hover: disabled ? void 0 : hover,
|
|
5174
5174
|
size,
|
|
5175
5175
|
children: [
|
|
5176
|
-
/* @__PURE__ */ jsxs("div", { className: cls("w-10 h-10 mr-2 shrink-0 grow-0", size === "smallest" ? "my-0.5" : "m-2 self-start"), children: [
|
|
5176
|
+
/* @__PURE__ */ jsxs("div", { className: cls("flex w-10 h-10 mr-2 shrink-0 grow-0", size === "smallest" ? "my-0.5" : "m-2 self-start"), children: [
|
|
5177
5177
|
imageProperty && /* @__PURE__ */ jsx(
|
|
5178
5178
|
PropertyPreview,
|
|
5179
5179
|
{
|
|
@@ -5183,7 +5183,7 @@ function EntityPreview({
|
|
|
5183
5183
|
value: getValueInPath(entity.values, imagePropertyKey)
|
|
5184
5184
|
}
|
|
5185
5185
|
),
|
|
5186
|
-
!imageProperty && /* @__PURE__ */ jsx(IconForView, { collectionOrView: collection, size, className: "
|
|
5186
|
+
!imageProperty && /* @__PURE__ */ jsx(IconForView, { collectionOrView: collection, size, className: "m-auto" })
|
|
5187
5187
|
] }),
|
|
5188
5188
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-grow w-full m-1", children: [
|
|
5189
5189
|
size !== "smallest" && includeId && (entity ? /* @__PURE__ */ jsx("div", { className: `${size !== "medium" ? "block whitespace-nowrap overflow-hidden truncate" : ""}`, children: /* @__PURE__ */ jsx(
|
|
@@ -7243,7 +7243,7 @@ const TableReferenceFieldInternal = React__default.memo(
|
|
|
7243
7243
|
EntityPreviewContainer,
|
|
7244
7244
|
{
|
|
7245
7245
|
className: cls(
|
|
7246
|
-
"
|
|
7246
|
+
"px-4 py-2 text-sm font-medium flex items-center uppercase",
|
|
7247
7247
|
multiselect ? "gap-4" : "gap-6",
|
|
7248
7248
|
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"
|
|
7249
7249
|
),
|
|
@@ -10385,6 +10385,16 @@ function useDataSourceEntityCollectionTableController({
|
|
|
10385
10385
|
const pageSize = typeof collection.pagination === "number" ? collection.pagination : DEFAULT_PAGE_SIZE;
|
|
10386
10386
|
const [searchString, setSearchString] = React__default.useState();
|
|
10387
10387
|
const [itemCount, setItemCount] = React__default.useState(paginationEnabled ? pageSize : void 0);
|
|
10388
|
+
const checkFilterCombination = useCallback((filterValues2, sortBy2) => {
|
|
10389
|
+
if (!dataSource.isFilterCombinationValid)
|
|
10390
|
+
return true;
|
|
10391
|
+
return dataSource.isFilterCombinationValid({
|
|
10392
|
+
path: resolvedPath,
|
|
10393
|
+
collection,
|
|
10394
|
+
filterValues: filterValues2,
|
|
10395
|
+
sortBy: sortBy2
|
|
10396
|
+
});
|
|
10397
|
+
}, []);
|
|
10388
10398
|
const initialSortInternal = useMemo(() => {
|
|
10389
10399
|
if (initialSort && forceFilter && !checkFilterCombination(forceFilter, initialSort)) {
|
|
10390
10400
|
console.warn("Initial sort is not compatible with the force filter. Ignoring initial sort");
|
|
@@ -10406,16 +10416,6 @@ function useDataSourceEntityCollectionTableController({
|
|
|
10406
10416
|
const [dataLoading, setDataLoading] = useState(false);
|
|
10407
10417
|
const [dataLoadingError, setDataLoadingError] = useState();
|
|
10408
10418
|
const [noMoreToLoad, setNoMoreToLoad] = useState(false);
|
|
10409
|
-
const checkFilterCombination = useCallback((filterValues2, sortBy2) => {
|
|
10410
|
-
if (!dataSource.isFilterCombinationValid)
|
|
10411
|
-
return true;
|
|
10412
|
-
return dataSource.isFilterCombinationValid({
|
|
10413
|
-
path: resolvedPath,
|
|
10414
|
-
collection,
|
|
10415
|
-
filterValues: filterValues2,
|
|
10416
|
-
sortBy: sortBy2
|
|
10417
|
-
});
|
|
10418
|
-
}, []);
|
|
10419
10419
|
const clearFilter = useCallback(() => setFilterValues(forceFilter ?? void 0), [forceFilter]);
|
|
10420
10420
|
const updateFilterValues = useCallback((updatedFilter) => {
|
|
10421
10421
|
if (forceFilter) {
|
|
@@ -19419,18 +19419,18 @@ function DrawerNavigationItem({
|
|
|
19419
19419
|
{
|
|
19420
19420
|
onClick,
|
|
19421
19421
|
style: {
|
|
19422
|
-
width:
|
|
19422
|
+
width: "100%",
|
|
19423
19423
|
transition: drawerOpen ? "width 150ms ease-in" : void 0
|
|
19424
19424
|
},
|
|
19425
19425
|
className: ({ isActive }) => cls(
|
|
19426
|
-
"rounded-
|
|
19426
|
+
"rounded-lg truncate",
|
|
19427
19427
|
"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",
|
|
19428
19428
|
"flex flex-row items-center mr-8",
|
|
19429
19429
|
// "transition-all ease-in-out delay-100 duration-300",
|
|
19430
19430
|
// drawerOpen ? "w-full" : "w-18",
|
|
19431
|
-
drawerOpen ? "pl-
|
|
19431
|
+
drawerOpen ? "pl-4 h-12" : "pl-4 h-11",
|
|
19432
19432
|
"font-medium text-sm",
|
|
19433
|
-
isActive ? "bg-slate-200 bg-opacity-60 dark:bg-gray-800 dark:bg-opacity-
|
|
19433
|
+
isActive ? "bg-slate-200 bg-opacity-60 dark:bg-gray-800 dark:bg-opacity-50" : ""
|
|
19434
19434
|
),
|
|
19435
19435
|
to: url,
|
|
19436
19436
|
children: [
|
|
@@ -19483,11 +19483,11 @@ function DefaultDrawer({
|
|
|
19483
19483
|
const adminViews = navigationEntries.filter((e) => e.type === "admin") ?? [];
|
|
19484
19484
|
const groupsWithoutAdmin = groups.filter((g) => g !== "Admin");
|
|
19485
19485
|
const buildGroupHeader = useCallback((group) => {
|
|
19486
|
-
if (!drawerOpen) return /* @__PURE__ */ jsx("div", { className: "
|
|
19486
|
+
if (!drawerOpen) return /* @__PURE__ */ jsx("div", { className: "w-full" });
|
|
19487
19487
|
return /* @__PURE__ */ jsx(
|
|
19488
19488
|
"div",
|
|
19489
19489
|
{
|
|
19490
|
-
className: "
|
|
19490
|
+
className: "pl-6 pr-8 py-4 flex flex-row items-center",
|
|
19491
19491
|
children: /* @__PURE__ */ jsx(
|
|
19492
19492
|
Typography,
|
|
19493
19493
|
{
|
|
@@ -19508,28 +19508,38 @@ function DefaultDrawer({
|
|
|
19508
19508
|
};
|
|
19509
19509
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cls("flex flex-col h-full relative flex-grow w-full", className), style, children: [
|
|
19510
19510
|
/* @__PURE__ */ jsx(DrawerLogo, { logo }),
|
|
19511
|
-
/* @__PURE__ */ jsx(
|
|
19512
|
-
|
|
19511
|
+
/* @__PURE__ */ jsx(
|
|
19512
|
+
"div",
|
|
19513
19513
|
{
|
|
19514
|
-
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19521
|
-
|
|
19522
|
-
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
|
|
19529
|
-
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19514
|
+
className: "mt-4 flex-grow overflow-scroll no-scrollbar",
|
|
19515
|
+
style: {
|
|
19516
|
+
maskImage: "linear-gradient(to bottom, transparent 0, black 20px, black calc(100% - 20px), transparent 100%)"
|
|
19517
|
+
},
|
|
19518
|
+
children: groupsWithoutAdmin.map((group) => /* @__PURE__ */ jsxs(
|
|
19519
|
+
"div",
|
|
19520
|
+
{
|
|
19521
|
+
className: "bg-gray-50 dark:bg-gray-800 dark:bg-opacity-30 my-4 rounded-lg ml-4",
|
|
19522
|
+
children: [
|
|
19523
|
+
buildGroupHeader(group),
|
|
19524
|
+
Object.values(navigationEntries).filter((e) => e.group === group).map((view, index) => /* @__PURE__ */ jsx(
|
|
19525
|
+
DrawerNavigationItem,
|
|
19526
|
+
{
|
|
19527
|
+
icon: /* @__PURE__ */ jsx(IconForView, { collectionOrView: view.collection ?? view.view }),
|
|
19528
|
+
tooltipsOpen,
|
|
19529
|
+
adminMenuOpen,
|
|
19530
|
+
drawerOpen,
|
|
19531
|
+
onClick: () => onClick(view),
|
|
19532
|
+
url: view.url,
|
|
19533
|
+
name: view.name
|
|
19534
|
+
},
|
|
19535
|
+
`navigation_${index}`
|
|
19536
|
+
))
|
|
19537
|
+
]
|
|
19538
|
+
},
|
|
19539
|
+
`drawer_group_${group}`
|
|
19540
|
+
))
|
|
19541
|
+
}
|
|
19542
|
+
),
|
|
19533
19543
|
adminViews.length > 0 && /* @__PURE__ */ jsx(
|
|
19534
19544
|
Menu,
|
|
19535
19545
|
{
|