@casinogate/ui 1.11.3 → 1.11.5
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/assets/css/root.css +3 -0
- package/dist/components/data-table/components/data-table.cell.svelte +7 -1
- package/dist/components/data-table/components/data-table.expand-button.svelte +1 -5
- package/dist/components/data-table/data-table.svelte +5 -5
- package/dist/components/data-table/styles.js +1 -0
- package/dist/components/data-table/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/assets/css/root.css
CHANGED
|
@@ -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
|
|
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 cgui:flex-1': isEmpty })}>
|
|
42
42
|
<DataTableHeader>
|
|
43
43
|
{#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
|
|
44
44
|
<DataTableRow>
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
return typeof val === 'boolean' ? null : val;
|
|
65
65
|
})}
|
|
66
66
|
|
|
67
|
-
<DataTableSortButton direction={dir} />
|
|
67
|
+
<DataTableSortButton direction={dir} disabled={isEmpty} />
|
|
68
68
|
{/if}
|
|
69
69
|
|
|
70
70
|
{#if restProps.resizable && header.column.getCanResize()}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
{/if}
|
|
97
97
|
<DataTableRow>
|
|
98
98
|
{#each row.getVisibleCells() as cell (cell.id)}
|
|
99
|
-
<DataTableCell {cell}>
|
|
99
|
+
<DataTableCell {cell} depth={row.depth}>
|
|
100
100
|
<FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
|
|
101
101
|
</DataTableCell>
|
|
102
102
|
{/each}
|
|
@@ -4,6 +4,7 @@ import { Context } from 'runed';
|
|
|
4
4
|
export const dataTableVariants = tv({
|
|
5
5
|
slots: {
|
|
6
6
|
root: [
|
|
7
|
+
'cgui:flex cgui:flex-col',
|
|
7
8
|
'cgui:scrollbar-thin cgui:scrollbar-thumb-surface-regular cgui:scrollbar-track-surface-lightest cgui:scrollbar-thumb-rounded-full cgui:scrollbar-track-rounded-full',
|
|
8
9
|
'cgui:overflow-auto cgui:w-full',
|
|
9
10
|
'cgui:border cgui:border-stroke-divider',
|
|
@@ -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<{
|