@firecms/core 3.0.0-canary.162 → 3.0.0-canary.163
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 +11 -11
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +11 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +2 -4
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +1 -1
- package/src/components/EntityCollectionView/useSelectionController.tsx +5 -4
package/dist/index.es.js
CHANGED
|
@@ -8852,7 +8852,6 @@ const EntityCollectionTable = function EntityCollectionTable2({
|
|
|
8852
8852
|
const selectedEntities = (selectionController?.selectedEntities?.length > 0 ? selectionController?.selectedEntities : highlightedEntities)?.filter(Boolean);
|
|
8853
8853
|
const context = useFireCMSContext();
|
|
8854
8854
|
const [size, setSize] = React__default.useState(defaultSize ?? "m");
|
|
8855
|
-
const selectedEntityIds = selectedEntities?.map((e) => e.id);
|
|
8856
8855
|
const updateSize = useCallback((size_0) => {
|
|
8857
8856
|
if (onSizeChanged) onSizeChanged(size_0);
|
|
8858
8857
|
setSize(size_0);
|
|
@@ -8908,7 +8907,7 @@ const EntityCollectionTable = function EntityCollectionTable2({
|
|
|
8908
8907
|
context
|
|
8909
8908
|
})?.toString() });
|
|
8910
8909
|
return /* @__PURE__ */ jsx(EntityTableCell, { width, size, value: value_0, selected: false, disabled: true, align: "left", allowScroll: false, showExpandIcon: false, disabledTooltip: "This column can't be edited directly", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: child }) }, `additional_table_cell_${entity_0.id}_${column_0.key}`);
|
|
8911
|
-
}, [size
|
|
8910
|
+
}, [size]);
|
|
8912
8911
|
const collectionColumns = (() => {
|
|
8913
8912
|
const columnsResult = propertiesToColumns({
|
|
8914
8913
|
properties,
|
|
@@ -8958,14 +8957,14 @@ const EntityCollectionTable = function EntityCollectionTable2({
|
|
|
8958
8957
|
} else {
|
|
8959
8958
|
throw Error("Internal: columns not mapped properly");
|
|
8960
8959
|
}
|
|
8961
|
-
} catch (
|
|
8962
|
-
console.error("Error rendering cell",
|
|
8963
|
-
return /* @__PURE__ */ jsx(EntityTableCell, { size, width: column_1.width, saved: false, value: null, align: "left", fullHeight: false, disabled: true, children: /* @__PURE__ */ jsx(ErrorView, { error:
|
|
8960
|
+
} catch (e) {
|
|
8961
|
+
console.error("Error rendering cell", e);
|
|
8962
|
+
return /* @__PURE__ */ jsx(EntityTableCell, { size, width: column_1.width, saved: false, value: null, align: "left", fullHeight: false, disabled: true, children: /* @__PURE__ */ jsx(ErrorView, { error: e }) });
|
|
8964
8963
|
}
|
|
8965
8964
|
}, [tableRowActionsBuilder, additionalCellRenderer, propertyCellRenderer, size]);
|
|
8966
8965
|
return /* @__PURE__ */ jsxs("div", { ref, style, className: cls("h-full w-full flex flex-col bg-white dark:bg-surface-950", className), children: [
|
|
8967
8966
|
/* @__PURE__ */ jsx(CollectionTableToolbar, { onTextSearch: textSearchEnabled ? onTextSearch : void 0, textSearchLoading, onTextSearchClick: textSearchEnabled ? onTextSearchClick : void 0, size, onSizeChanged: updateSize, title, actionsStart, actions, loading: tableController.dataLoading }),
|
|
8968
|
-
/* @__PURE__ */ jsx(SelectableTable, { columns, size, inlineEditing, cellRenderer, onEntityClick, highlightedRow:
|
|
8967
|
+
/* @__PURE__ */ jsx(SelectableTable, { columns, size, inlineEditing, cellRenderer, onEntityClick, highlightedRow: (entity_1) => Boolean(selectedEntities?.find((e_0) => e_0.id === entity_1.id && e_0.path === entity_1.path)), tableController, onValueChange, onColumnResize, hoverRow, filterable, emptyComponent, endAdornment, AddColumnComponent })
|
|
8969
8968
|
] });
|
|
8970
8969
|
};
|
|
8971
8970
|
function useDataOrder({
|
|
@@ -9160,9 +9159,10 @@ function useSelectionController(onSelectionChange) {
|
|
|
9160
9159
|
const toggleEntitySelection = useCallback((entity, newSelectedState) => {
|
|
9161
9160
|
let newValue;
|
|
9162
9161
|
if (newSelectedState === void 0) {
|
|
9163
|
-
|
|
9162
|
+
const isSelected = Boolean(selectedEntities.find((e) => e.id === entity.id && e.path === entity.path));
|
|
9163
|
+
if (isSelected) {
|
|
9164
9164
|
onSelectionChange?.(entity, false);
|
|
9165
|
-
newValue = selectedEntities.filter((item) => item.id
|
|
9165
|
+
newValue = selectedEntities.filter((item) => !(item.id === entity.id && item.path === entity.path));
|
|
9166
9166
|
} else {
|
|
9167
9167
|
onSelectionChange?.(entity, true);
|
|
9168
9168
|
newValue = [...selectedEntities, entity];
|
|
@@ -9173,13 +9173,13 @@ function useSelectionController(onSelectionChange) {
|
|
|
9173
9173
|
newValue = [...selectedEntities, entity];
|
|
9174
9174
|
} else {
|
|
9175
9175
|
onSelectionChange?.(entity, false);
|
|
9176
|
-
newValue = selectedEntities.filter((item_0) => item_0.id
|
|
9176
|
+
newValue = selectedEntities.filter((item_0) => !(item_0.id === entity.id && item_0.path === entity.path));
|
|
9177
9177
|
}
|
|
9178
9178
|
}
|
|
9179
9179
|
setSelectedEntities(newValue);
|
|
9180
9180
|
}, [selectedEntities]);
|
|
9181
9181
|
const isEntitySelected = useCallback((entity_0) => {
|
|
9182
|
-
return selectedEntities.
|
|
9182
|
+
return Boolean(selectedEntities.find((e_0) => e_0.id === entity_0.id && e_0.path === entity_0.path));
|
|
9183
9183
|
}, [selectedEntities]);
|
|
9184
9184
|
return {
|
|
9185
9185
|
selectedEntities,
|
|
@@ -12389,7 +12389,7 @@ const EntityCollectionView = React__default.memo(function EntityCollectionView2(
|
|
|
12389
12389
|
width: width_0,
|
|
12390
12390
|
frozen
|
|
12391
12391
|
}) => {
|
|
12392
|
-
const isSelected = usedSelectionController.selectedEntities.
|
|
12392
|
+
const isSelected = Boolean(usedSelectionController.selectedEntities.find((e_1) => e_1.id == entity_6.id && e_1.path == entity_6.path));
|
|
12393
12393
|
const actions_0 = getActionsForEntity({
|
|
12394
12394
|
entity: entity_6,
|
|
12395
12395
|
customEntityActions: collection.entityActions
|