@marktiderman/genesis-ui 2.3.0 → 2.3.1
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.
|
@@ -451,7 +451,20 @@ type ResourcePageSlotMap<T extends Record<string, unknown> = Record<string, unkn
|
|
|
451
451
|
/** The create / edit form. */
|
|
452
452
|
form: ComponentProps<typeof ResourceForm>;
|
|
453
453
|
};
|
|
454
|
-
|
|
454
|
+
/**
|
|
455
|
+
* `slots` for {@link ResourcePage}, with one asymmetry the map cannot express:
|
|
456
|
+
* every part may be ejected with `null` EXCEPT `shell`.
|
|
457
|
+
*
|
|
458
|
+
* The shell is not an interior part, it is the page — `Shell` is what the
|
|
459
|
+
* render returns, so ejecting it does not remove a piece, it removes the
|
|
460
|
+
* component (`const Shell = slots?.shell ?? DataPageShell` would become
|
|
461
|
+
* `null`, and React throws on the element). A caller who wants no shell wants
|
|
462
|
+
* rung 3 of the ladder, not a `null` here. Replacing it stays supported, which
|
|
463
|
+
* is the way to wrap it and change one thing.
|
|
464
|
+
*/
|
|
465
|
+
type ResourcePageSlots<T extends Record<string, unknown> = Record<string, unknown>> = Omit<Slots<ResourcePageSlotMap<T>>, "shell"> & {
|
|
466
|
+
shell?: ComponentType<ComponentProps<typeof DataPageShell>>;
|
|
467
|
+
};
|
|
455
468
|
interface ResourcePageProps<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
456
469
|
/** Client-side mode: resource name passed to useResource / DataProvider. */
|
|
457
470
|
resource?: string;
|
|
@@ -87,7 +87,7 @@ function DataPageShell({
|
|
|
87
87
|
header
|
|
88
88
|
}) {
|
|
89
89
|
const entity = entityName || title.toLowerCase();
|
|
90
|
-
const collapseFilters = filtersCollapsible && filters != null;
|
|
90
|
+
const collapseFilters = filtersCollapsible && filters != null && header !== null;
|
|
91
91
|
const mergedOptions = {
|
|
92
92
|
defaultDetailsOpen: defaultFiltersOpen,
|
|
93
93
|
detailsLabel: filtersLabel,
|