@casinogate/ui 1.11.3 → 1.11.4

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.
@@ -463,6 +463,9 @@
463
463
  .cgui\:h-\[300px\] {
464
464
  height: 300px;
465
465
  }
466
+ .cgui\:h-\[600px\] {
467
+ height: 600px;
468
+ }
466
469
  .cgui\:h-auto {
467
470
  height: auto;
468
471
  }
@@ -13,6 +13,7 @@
13
13
  children,
14
14
  class: className,
15
15
  cell,
16
+ depth = 0,
16
17
  ...restProps
17
18
  }: DataTableCellProps = $props();
18
19
 
@@ -30,6 +31,11 @@
30
31
  const mergedProps = $derived(mergeProps(restProps, cellState.props));
31
32
  </script>
32
33
 
33
- <td class={cn(styles.current.cell(), className)} {...mergedProps}>
34
+ <td
35
+ style:--depth={depth}
36
+ style:padding-left={depth > 0 ? `calc((var(--cgui-spacing)*2) + ${depth} * 1rem)` : undefined}
37
+ class={cn(styles.current.cell(), className)}
38
+ {...mergedProps}
39
+ >
34
40
  {@render children?.()}
35
41
  </td>
@@ -15,11 +15,7 @@
15
15
  </script>
16
16
 
17
17
  {#if canExpand}
18
- <button
19
- onclick={onToggle}
20
- class="cgui:flex cgui:items-center cgui:justify-center cgui:cursor-pointer"
21
- style="padding-left: {depth}rem"
22
- >
18
+ <button onclick={onToggle} class="cgui:flex cgui:items-center cgui:justify-center cgui:cursor-pointer">
23
19
  {#if isExpanded}
24
20
  <Icon.ChevronDown width={16} height={16} />
25
21
  {:else}
@@ -15,7 +15,7 @@
15
15
  import FlexRender from './components/flex-render.svelte';
16
16
  import { type DataTableProps, type RowData } from './types.js';
17
17
 
18
- let { ref = $bindable(null), table, empty, ...restProps }: DataTableProps<TData> = $props();
18
+ let { ref = $bindable(null), table, empty, class: className, ...restProps }: DataTableProps<TData> = $props();
19
19
 
20
20
  let isFirstLoaded = $state(false);
21
21
 
@@ -37,8 +37,8 @@
37
37
  );
38
38
  </script>
39
39
 
40
- <DataTableRoot bind:ref {table} {...restProps}>
41
- <DataTableTable>
40
+ <DataTableRoot bind:ref {table} class={cn(className, { 'cgui:h-full': isEmpty })} {...restProps}>
41
+ <DataTableTable class={cn({ 'cgui:h-full': isEmpty })}>
42
42
  <DataTableHeader>
43
43
  {#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
44
44
  <DataTableRow>
@@ -96,7 +96,8 @@
96
96
  {/if}
97
97
  <DataTableRow>
98
98
  {#each row.getVisibleCells() as cell (cell.id)}
99
- <DataTableCell {cell}>
99
+ {console.log(row.depth)}
100
+ <DataTableCell {cell} depth={row.depth}>
100
101
  <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
101
102
  </DataTableCell>
102
103
  {/each}
@@ -14,6 +14,7 @@ type DataTableBodyPropsWithoutHTML = WithElementRef<WithChildren<{}>>;
14
14
  export type DataTableBodyProps = DataTableBodyPropsWithoutHTML & Without<PrimitiveDivAttributes, DataTableBodyPropsWithoutHTML>;
15
15
  type DataTableCellPropsWithoutHTML = WithElementRef<WithChildren<{
16
16
  cell: Cell<any, unknown> | null;
17
+ depth?: number;
17
18
  }>>;
18
19
  export type DataTableCellProps = DataTableCellPropsWithoutHTML & Without<PrimitiveTdAttributes, DataTableCellPropsWithoutHTML>;
19
20
  type DataTableHeadPropsWithoutHTML = WithElementRef<WithChildren<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casinogate/ui",
3
- "version": "1.11.3",
3
+ "version": "1.11.4",
4
4
  "svelte": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",