@firecms/core 3.0.0-canary.241 → 3.0.0-canary.244

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.
@@ -749,6 +749,7 @@ export const EntityCollectionView = React.memo(
749
749
  equal(a.defaultSize, b.defaultSize) &&
750
750
  equal(a.initialFilter, b.initialFilter) &&
751
751
  equal(a.initialSort, b.initialSort) &&
752
+ equal(a.includeJsonView, b.includeJsonView) &&
752
753
  equal(a.textSearchEnabled, b.textSearchEnabled) &&
753
754
  equal(a.additionalFields, b.additionalFields) &&
754
755
  equal(a.sideDialogWidth, b.sideDialogWidth) &&
@@ -114,6 +114,7 @@ export function DefaultHomePage({
114
114
  );
115
115
  })}
116
116
  </>;
117
+
117
118
  additionalPluginChildrenStart = <div className={"flex flex-col gap-2"}>
118
119
  {customizationController.plugins.filter(plugin => plugin.homePage?.additionalChildrenStart)
119
120
  .map((plugin, i) => {
@@ -115,7 +115,6 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
115
115
  endAdornment,
116
116
  AddColumnComponent,
117
117
  initialScroll = 0,
118
- debug
119
118
  }: VirtualTableProps<T>) {
120
119
 
121
120
  const sortByProperty: string | undefined = sortBy ? sortBy[0] : undefined;
@@ -131,7 +130,8 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
131
130
  // Set initial scroll position
132
131
  useEffect(() => {
133
132
  if (tableRef.current && initialScroll) {
134
- tableRef.current.scrollTo(0, initialScroll);
133
+ const { scrollLeft } = tableRef.current;
134
+ tableRef.current.scrollTo(scrollLeft, initialScroll);
135
135
  }
136
136
  }, [tableRef, initialScroll]);
137
137
 
@@ -170,7 +170,6 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
170
170
  });
171
171
 
172
172
  const onColumnResizeInternal = useCallback((params: OnVirtualTableColumnResizeParams) => {
173
- if (debug) console.log("onColumnResizeInternal", params);
174
173
  setColumns(prevColumns =>
175
174
  prevColumns.map((column) =>
176
175
  column.key === params.column.key ? params.column : column
@@ -179,8 +178,6 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
179
178
  }, []);
180
179
 
181
180
  const onColumnResizeEndInternal = useCallback((params: OnVirtualTableColumnResizeParams) => {
182
- if (debug)
183
- console.log("onColumnResizeEndInternal", params);
184
181
  setColumns(columns.map((column) => column.key === params.column.key ? params.column : column));
185
182
  if (onColumnResize) {
186
183
  onColumnResize(params);
@@ -191,14 +188,10 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
191
188
  const filterRef = useRef<VirtualTableFilterValues<any> | undefined>();
192
189
 
193
190
  useEffect(() => {
194
- if (debug)
195
- console.log("Filter updated", filterInput);
196
191
  filterRef.current = filterInput;
197
192
  }, [filterInput]);
198
193
 
199
194
  const scrollToTop = useCallback(() => {
200
- if (debug)
201
- console.log("scrollToTop");
202
195
  endReachCallbackThreshold.current = 0;
203
196
  if (tableRef.current) {
204
197
  tableRef.current.scrollTo(tableRef.current?.scrollLeft, 0);
@@ -207,9 +200,6 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
207
200
 
208
201
  const onColumnSort = useCallback((key: string) => {
209
202
 
210
- if (debug)
211
- console.log("onColumnSort", key);
212
-
213
203
  const isDesc = sortByProperty === key && currentSort === "desc";
214
204
  const isAsc = sortByProperty === key && currentSort === "asc";
215
205
  const newSort = isAsc ? "desc" : (isDesc ? undefined : "asc");
@@ -237,12 +227,8 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
237
227
  }, [checkFilterCombination, currentSort, onFilterUpdate, onResetPagination, onSortByUpdate, scrollToTop, sortByProperty]);
238
228
 
239
229
  const maxScroll = Math.max((data?.length ?? 0) * rowHeight - bounds.height, 0);
240
- if (debug)
241
- console.log("maxScroll", maxScroll);
242
230
 
243
231
  const onEndReachedInternal = useCallback((scrollOffset: number) => {
244
- if (debug)
245
- console.log("onEndReachedInternal", scrollOffset, endReachCallbackThreshold.current + endOffset);
246
232
  if (onEndReached && (data?.length ?? 0) > 0 && scrollOffset > endReachCallbackThreshold.current + endOffset) {
247
233
  endReachCallbackThreshold.current = scrollOffset;
248
234
  onEndReached();
@@ -258,12 +244,6 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
258
244
  scrollOffset: number,
259
245
  scrollUpdateWasRequested: boolean;
260
246
  }) => {
261
- if (debug)
262
- console.log("onScroll", {
263
- scrollDirection,
264
- scrollOffset,
265
- scrollUpdateWasRequested
266
- });
267
247
  if (onScrollProp) {
268
248
  debouncedScroll({
269
249
  scrollDirection,
@@ -276,8 +256,6 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
276
256
  }, [maxScroll, onEndReachedInternal]);
277
257
 
278
258
  const onFilterUpdateInternal = useCallback((column: VirtualTableColumn, filterForProperty?: [VirtualTableWhereFilterOp, any]) => {
279
- if (debug)
280
- console.log("onFilterUpdateInternal", column, filterForProperty);
281
259
 
282
260
  endReachCallbackThreshold.current = 0;
283
261
  const filter = filterRef.current;
@@ -340,9 +318,6 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
340
318
  AddColumnComponent
341
319
  };
342
320
 
343
- if (debug)
344
- console.log("VirtualTable render", virtualListController);
345
-
346
321
  return (
347
322
  <div
348
323
  ref={measureRef}
@@ -162,11 +162,6 @@ export interface VirtualTableProps<T extends Record<string, any>> {
162
162
  */
163
163
  initialScroll?: number;
164
164
 
165
- /**
166
- * Debug mode
167
- */
168
- debug?: boolean;
169
-
170
165
  }
171
166
 
172
167
  export type CellRendererParams<T = any> = {
@@ -66,7 +66,6 @@ export function VirtualTableInput(props: {
66
66
  width: "100%",
67
67
  color: "unset",
68
68
  fontWeight: "unset",
69
- lineHeight: 1.7142857,
70
69
  fontSize: "unset",
71
70
  fontFamily: "unset",
72
71
  background: "unset",
@@ -255,6 +255,7 @@ export function EntityEditViewInner<M extends Record<string, any>>({
255
255
  <ErrorBoundary>
256
256
  {usedFormContext && <Builder
257
257
  collection={collection}
258
+ parentCollectionIds={parentCollectionIds}
258
259
  entity={usedEntity}
259
260
  modifiedValues={usedFormContext?.formex?.values ?? usedEntity?.values}
260
261
  formContext={usedFormContext}
@@ -74,19 +74,7 @@ export function EntitySidePanel(props: EntitySidePanelProps) {
74
74
  return navigationController.getParentCollectionIds(path);
75
75
  }, [navigationController, path]);
76
76
 
77
- const collection = useMemo(() => {
78
- if (props.collection) {
79
- return props.collection;
80
- }
81
-
82
- const registryCollection = navigationController.getCollection(path);
83
- if (registryCollection) {
84
- return registryCollection;
85
- }
86
-
87
- console.error("ERROR: No collection found in path `", path, "`. Entity id: ", entityId);
88
- throw Error("ERROR: No collection found in path `" + path + "`. Make sure you have defined a collection for this path in the root navigation.");
89
- }, [navigationController, props.collection]);
77
+ const collection = props.collection ?? navigationController.getCollection(path);
90
78
 
91
79
  useEffect(() => {
92
80
  function beforeunload(e: any) {
@@ -103,7 +103,9 @@ export function CustomIdField<M extends Record<string, any>>({
103
103
  size={"large"}
104
104
  error={error}
105
105
  fullWidth={true}
106
- onValueChange={(v) => onChange(v as string)}
106
+ onValueChange={(v) => {
107
+ onChange(v as string);
108
+ }}
107
109
  {...fieldProps}
108
110
  renderValue={(option) => {
109
111
  const enumConfig = enumValues.find(e => e.id === option);
@@ -84,7 +84,7 @@ export function MultiSelectFieldBinding({
84
84
  <MultiSelect
85
85
  className={"w-full mt-2"}
86
86
  size={size}
87
- value={validValue ? value.map((v) => v.toString()) : []}
87
+ value={validValue ? value.map((v) => v?.toString()) : []}
88
88
  disabled={disabled}
89
89
  modalPopover={true}
90
90
  label={<LabelWithIconAndTooltip
@@ -67,8 +67,9 @@ export function SelectFieldBinding<T extends EnumType>({
67
67
  </PropertyIdCopyTooltip>}
68
68
  endAdornment={
69
69
  property.clearable && !disabled && <IconButton
70
+ size="small"
70
71
  onClick={handleClearClick}>
71
- <CloseIcon/>
72
+ <CloseIcon size={"small"}/>
72
73
  </IconButton>
73
74
  }
74
75
  onValueChange={(updatedValue: string) => {