@rkosafo/cai.components 0.0.50 → 0.0.52
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/types/index.d.ts
CHANGED
|
@@ -681,6 +681,8 @@ export interface DatatableProps<T = any> extends TableProps {
|
|
|
681
681
|
take?: number;
|
|
682
682
|
editor?: Snippet<[DatatableEditorFormProps]>;
|
|
683
683
|
customFilter?: Snippet<[TableFilter]>;
|
|
684
|
+
modalFooter?: Snippet;
|
|
685
|
+
showModalButtons?: boolean;
|
|
684
686
|
}
|
|
685
687
|
export interface DatatableEditorFormProps {
|
|
686
688
|
recordId?: number | string | null;
|
|
@@ -80,6 +80,8 @@
|
|
|
80
80
|
deleteEntry = async (id: string | number) => {
|
|
81
81
|
return { success: false, data: null, error: null } as any;
|
|
82
82
|
},
|
|
83
|
+
modalFooter,
|
|
84
|
+
showModalButtons = true,
|
|
83
85
|
...otherProps
|
|
84
86
|
}: DatatableProps = $props();
|
|
85
87
|
|
|
@@ -506,10 +508,14 @@
|
|
|
506
508
|
})}
|
|
507
509
|
|
|
508
510
|
{#snippet footer()}
|
|
509
|
-
{#if
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
511
|
+
{#if showModalButtons}
|
|
512
|
+
{#if modalFooter}
|
|
513
|
+
{@render modalFooter()}
|
|
514
|
+
{:else if !viewing}
|
|
515
|
+
<Button disabled={!isValid} loading={isLoading} type="submit" class="w-full" value="submit"
|
|
516
|
+
>Submit</Button
|
|
517
|
+
>
|
|
518
|
+
{/if}
|
|
513
519
|
{/if}
|
|
514
520
|
{/snippet}
|
|
515
521
|
</Drawer>
|