@rkosafo/cai.components 0.0.54 → 0.0.56

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.
@@ -683,6 +683,7 @@ export interface DatatableProps<T = any> extends TableProps {
683
683
  customFilter?: Snippet<[TableFilter]>;
684
684
  modalFooter?: Snippet;
685
685
  showModalButtons?: boolean;
686
+ customAddAction?: Snippet;
686
687
  }
687
688
  export interface DatatableEditorFormProps {
688
689
  recordId?: number | string | null;
@@ -82,6 +82,7 @@
82
82
  },
83
83
  modalFooter,
84
84
  showModalButtons = true,
85
+ customAddAction,
85
86
  ...otherProps
86
87
  }: DatatableProps = $props();
87
88
 
@@ -452,9 +453,13 @@
452
453
  bind:hiddenColumns
453
454
  />
454
455
  </div>
455
- <div class:hidden={!showAdd} class="shrink-0">
456
- <Button onclick={addNew}>{addButtonLabel}</Button>
457
- </div>
456
+ {#if customAddAction}
457
+ {@render customAddAction?.()}
458
+ {:else}
459
+ <div class:hidden={!showAdd} class="shrink-0">
460
+ <Button onclick={addNew}>{addButtonLabel}</Button>
461
+ </div>
462
+ {/if}
458
463
  </div>
459
464
  </div>
460
465
  </div>
@@ -467,7 +472,7 @@
467
472
  {#if busy}
468
473
  <TableLoader bodySize={loadingBodySize} headerSize={loadingHeaderSize} />
469
474
  {:else}
470
- <div class="h-full w-full flex-grow overflow-y-auto">
475
+ <div class="h-full w-full flex-grow">
471
476
  <Table
472
477
  data={tableData}
473
478
  {headerColor}
@@ -14,7 +14,7 @@
14
14
  let {
15
15
  data = [],
16
16
  headerColor = 'white',
17
- height = 400,
17
+ height = 780,
18
18
  bgWhite = false,
19
19
  headerTextColor = 'black',
20
20
  tableColumns = [],
@@ -117,7 +117,8 @@
117
117
  <div class="h-full w-full flex-auto">
118
118
  <div class="grid grid-cols-1 gap-2">
119
119
  <div
120
- class=" scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch h-full w-full overflow-x-auto"
120
+ class=" scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch h-full w-full max-h-[{height}px] overflow-x-auto"
121
+ style="max-height: {height}px; min-height: {showMiniWidth && '250px'};"
121
122
  >
122
123
  <table {...$tableAttrs} class="mb-6 w-full pb-6">
123
124
  <thead
@@ -358,7 +359,7 @@
358
359
  {/each}
359
360
  </tbody>
360
361
  </table>
361
- <div class="h-48"></div>
362
+ <!-- <div class="h-48"></div> -->
362
363
 
363
364
  {#if !$pageRows.length}
364
365
  <div class="flex h-72 w-full items-center justify-center">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rkosafo/cai.components",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",