@svadmin/ui 0.32.8 → 0.32.10
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.
|
@@ -78,8 +78,10 @@
|
|
|
78
78
|
Skeleton: Skeleton as unknown as ComponentRegistry['Skeleton'],
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
//
|
|
82
|
-
|
|
81
|
+
// Merge and keep a local reference — setContext is only visible to *children*,
|
|
82
|
+
// so we must use the local variable for lookups within this component.
|
|
83
|
+
const mergedComponents: ComponentRegistry = { ...defaultComponents, ...userComponents };
|
|
84
|
+
setComponentRegistry(mergedComponents);
|
|
83
85
|
|
|
84
86
|
// Resolve router provider (default to hash)
|
|
85
87
|
const resolvedRouter = $derived(routerProvider ?? createHashRouterProvider());
|
|
@@ -195,27 +197,27 @@
|
|
|
195
197
|
{/if}
|
|
196
198
|
{:else if route === '/:resource' || route === '/:parent/:parentId/:resource'}
|
|
197
199
|
{#key params.resource}
|
|
198
|
-
{@const Comp =
|
|
200
|
+
{@const Comp = mergedComponents.AutoTable}
|
|
199
201
|
<Comp resourceName={params.resource} />
|
|
200
202
|
{/key}
|
|
201
203
|
{:else if route === '/:resource/create' || route === '/:parent/:parentId/:resource/create'}
|
|
202
204
|
{#key params.resource}
|
|
203
|
-
{@const Comp =
|
|
205
|
+
{@const Comp = mergedComponents.AutoForm}
|
|
204
206
|
<Comp resourceName={params.resource} mode="create" />
|
|
205
207
|
{/key}
|
|
206
208
|
{:else if route === '/:resource/edit/:id' || route === '/:parent/:parentId/:resource/edit/:id'}
|
|
207
209
|
{#key `${params.resource}-${params.id}`}
|
|
208
|
-
{@const Comp =
|
|
210
|
+
{@const Comp = mergedComponents.AutoForm}
|
|
209
211
|
<Comp resourceName={params.resource} mode="edit" id={params.id} />
|
|
210
212
|
{/key}
|
|
211
213
|
{:else if route === '/:resource/show/:id' || route === '/:parent/:parentId/:resource/show/:id'}
|
|
212
214
|
{#key `${params.resource}-${params.id}`}
|
|
213
|
-
{@const Comp =
|
|
215
|
+
{@const Comp = mergedComponents.ShowPage}
|
|
214
216
|
<Comp resourceName={params.resource} id={params.id} />
|
|
215
217
|
{/key}
|
|
216
218
|
{:else if route === '/:resource/clone/:id' || route === '/:parent/:parentId/:resource/clone/:id'}
|
|
217
219
|
{#key `${params.resource}-clone-${params.id}`}
|
|
218
|
-
{@const Comp =
|
|
220
|
+
{@const Comp = mergedComponents.AutoForm}
|
|
219
221
|
<Comp resourceName={params.resource} mode="clone" id={params.id} />
|
|
220
222
|
{/key}
|
|
221
223
|
{/if}
|
|
@@ -557,7 +557,7 @@
|
|
|
557
557
|
<Table.Head
|
|
558
558
|
{...dragProps}
|
|
559
559
|
class={cn("bg-transparent hover:bg-muted/10 border-b border-border/20 uppercase tracking-[0.12em] text-[10px] text-muted-foreground/70 font-semibold py-4", dragProps.class)}
|
|
560
|
-
style={header.getSize() !== 150 ? `width:${header.getSize()}px` : undefined}
|
|
560
|
+
style={header.getSize?.() != null && header.getSize() !== 150 ? `width:${header.getSize()}px` : undefined}
|
|
561
561
|
>
|
|
562
562
|
{#if header.id === '_select'}
|
|
563
563
|
<Checkbox
|