Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,20 @@
"dependencies": {
"@codemirror/autocomplete": "^6.17.0",
"@codemirror/commands": "^6.6.0",
"@codemirror/lang-go": "^6.0.1",
"@codemirror/lang-java": "^6.0.2",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-php": "^6.0.2",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably don't need these codemirror addons?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like they just got alphabetized

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this happened when I ran install for some reason. But Those aren't new additions.

"@codemirror/language": "^6.10.2",
"@codemirror/legacy-modes": "^6.4.0",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.29.0",
"@codemirror/lang-java": "^6.0.2",
"@codemirror/lang-go": "^6.0.1",
"@codemirror/lang-php": "^6.0.2",
"@fontsource-variable/inter": "^5.0.8",
"@fontsource/noto-sans-mono": "^5.0.9",
"@lezer/highlight": "^1.1.3",
"@sveltejs/package": "^2.3.10",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"date-fns": "^2.29.3",
"date-fns-tz": "^1.3.7",
"esm-env": "^1.0.0",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 20 additions & 14 deletions src/lib/holocene/table/paginated-table/index.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<script lang="ts">
import type { HTMLAttributes } from 'svelte/elements';
import type { ClassValue, HTMLAttributes } from 'svelte/elements';
import { clsx } from 'clsx';
import { twMerge as twMergeOriginal } from 'tailwind-merge';
function merge(...args: ClassValue[]) {
return twMergeOriginal(clsx(...args));
}
import SkeletonTable from '$lib/holocene/skeleton/table.svelte';
import Table from '$lib/holocene/table/table.svelte';
Expand All @@ -12,6 +19,7 @@
updating?: boolean;
maxHeight?: string;
fixed?: boolean;
class?: ClassValue;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ClassNameValue from twmerge

}
export let visibleItems: Item[];
Expand All @@ -20,15 +28,21 @@
export let maxHeight = '';
export let fixed = false;
let className: ClassValue = '';
export { className as class };
let tableContainer: HTMLDivElement;
$: tableOffset = tableContainer?.offsetTop
? tableContainer?.offsetTop + 32
? tableContainer.offsetTop + 32
: 0;
</script>

<div
class="paginated-table-wrapper"
class={merge(
'surface-primary min-h-[154px] grow overflow-auto border border-subtle',
className,
)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use the regular merge with the different type on classes and we gucci

bind:this={tableContainer}
style="max-height: {maxHeight || `calc(100vh - ${tableOffset}px)`}"
>
Expand All @@ -45,7 +59,9 @@
<slot />
</Table>
{#if visibleItems.length}
<div class="paginated-table-controls">
<div
class="surface-primary sticky bottom-0 left-0 flex w-full grow items-center justify-between gap-2 border-t border-subtle px-4 py-2"
>
<slot name="actions-start" />
<slot name="actions-center" />
<slot name="actions-end" />
Expand All @@ -55,13 +71,3 @@
{/if}
{/if}
</div>

<style lang="postcss">
.paginated-table-wrapper {
@apply surface-primary min-h-[154px] grow overflow-auto border border-subtle;
}
.paginated-table-controls {
@apply surface-primary sticky bottom-0 left-0 flex w-full grow items-center justify-between gap-2 border-t border-subtle px-4 py-2;
}
</style>
Loading