@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.umd.js
CHANGED
|
@@ -8855,7 +8855,6 @@
|
|
|
8855
8855
|
const selectedEntities = (selectionController?.selectedEntities?.length > 0 ? selectionController?.selectedEntities : highlightedEntities)?.filter(Boolean);
|
|
8856
8856
|
const context = useFireCMSContext();
|
|
8857
8857
|
const [size, setSize] = React.useState(defaultSize ?? "m");
|
|
8858
|
-
const selectedEntityIds = selectedEntities?.map((e) => e.id);
|
|
8859
8858
|
const updateSize = React.useCallback((size_0) => {
|
|
8860
8859
|
if (onSizeChanged) onSizeChanged(size_0);
|
|
8861
8860
|
setSize(size_0);
|
|
@@ -8911,7 +8910,7 @@
|
|
|
8911
8910
|
context
|
|
8912
8911
|
})?.toString() });
|
|
8913
8912
|
return /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(ErrorBoundary, { children: child }) }, `additional_table_cell_${entity_0.id}_${column_0.key}`);
|
|
8914
|
-
}, [size
|
|
8913
|
+
}, [size]);
|
|
8915
8914
|
const collectionColumns = (() => {
|
|
8916
8915
|
const columnsResult = propertiesToColumns({
|
|
8917
8916
|
properties,
|
|
@@ -8961,14 +8960,14 @@
|
|
|
8961
8960
|
} else {
|
|
8962
8961
|
throw Error("Internal: columns not mapped properly");
|
|
8963
8962
|
}
|
|
8964
|
-
} catch (
|
|
8965
|
-
console.error("Error rendering cell",
|
|
8966
|
-
return /* @__PURE__ */ jsxRuntime.jsx(EntityTableCell, { size, width: column_1.width, saved: false, value: null, align: "left", fullHeight: false, disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error:
|
|
8963
|
+
} catch (e) {
|
|
8964
|
+
console.error("Error rendering cell", e);
|
|
8965
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EntityTableCell, { size, width: column_1.width, saved: false, value: null, align: "left", fullHeight: false, disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error: e }) });
|
|
8967
8966
|
}
|
|
8968
8967
|
}, [tableRowActionsBuilder, additionalCellRenderer, propertyCellRenderer, size]);
|
|
8969
8968
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, style, className: ui.cls("h-full w-full flex flex-col bg-white dark:bg-surface-950", className), children: [
|
|
8970
8969
|
/* @__PURE__ */ jsxRuntime.jsx(CollectionTableToolbar, { onTextSearch: textSearchEnabled ? onTextSearch : void 0, textSearchLoading, onTextSearchClick: textSearchEnabled ? onTextSearchClick : void 0, size, onSizeChanged: updateSize, title, actionsStart, actions, loading: tableController.dataLoading }),
|
|
8971
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectableTable, { columns, size, inlineEditing, cellRenderer, onEntityClick, highlightedRow:
|
|
8970
|
+
/* @__PURE__ */ jsxRuntime.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 })
|
|
8972
8971
|
] });
|
|
8973
8972
|
};
|
|
8974
8973
|
function useDataOrder({
|
|
@@ -9163,9 +9162,10 @@
|
|
|
9163
9162
|
const toggleEntitySelection = React.useCallback((entity, newSelectedState) => {
|
|
9164
9163
|
let newValue;
|
|
9165
9164
|
if (newSelectedState === void 0) {
|
|
9166
|
-
|
|
9165
|
+
const isSelected = Boolean(selectedEntities.find((e) => e.id === entity.id && e.path === entity.path));
|
|
9166
|
+
if (isSelected) {
|
|
9167
9167
|
onSelectionChange?.(entity, false);
|
|
9168
|
-
newValue = selectedEntities.filter((item) => item.id
|
|
9168
|
+
newValue = selectedEntities.filter((item) => !(item.id === entity.id && item.path === entity.path));
|
|
9169
9169
|
} else {
|
|
9170
9170
|
onSelectionChange?.(entity, true);
|
|
9171
9171
|
newValue = [...selectedEntities, entity];
|
|
@@ -9176,13 +9176,13 @@
|
|
|
9176
9176
|
newValue = [...selectedEntities, entity];
|
|
9177
9177
|
} else {
|
|
9178
9178
|
onSelectionChange?.(entity, false);
|
|
9179
|
-
newValue = selectedEntities.filter((item_0) => item_0.id
|
|
9179
|
+
newValue = selectedEntities.filter((item_0) => !(item_0.id === entity.id && item_0.path === entity.path));
|
|
9180
9180
|
}
|
|
9181
9181
|
}
|
|
9182
9182
|
setSelectedEntities(newValue);
|
|
9183
9183
|
}, [selectedEntities]);
|
|
9184
9184
|
const isEntitySelected = React.useCallback((entity_0) => {
|
|
9185
|
-
return selectedEntities.
|
|
9185
|
+
return Boolean(selectedEntities.find((e_0) => e_0.id === entity_0.id && e_0.path === entity_0.path));
|
|
9186
9186
|
}, [selectedEntities]);
|
|
9187
9187
|
return {
|
|
9188
9188
|
selectedEntities,
|
|
@@ -12392,7 +12392,7 @@
|
|
|
12392
12392
|
width: width_0,
|
|
12393
12393
|
frozen
|
|
12394
12394
|
}) => {
|
|
12395
|
-
const isSelected = usedSelectionController.selectedEntities.
|
|
12395
|
+
const isSelected = Boolean(usedSelectionController.selectedEntities.find((e_1) => e_1.id == entity_6.id && e_1.path == entity_6.path));
|
|
12396
12396
|
const actions_0 = getActionsForEntity({
|
|
12397
12397
|
entity: entity_6,
|
|
12398
12398
|
customEntityActions: collection.entityActions
|