Skip to content

Commit

Permalink
add pageSizeOptions prop and add max-h-none to table wrapper (#2280)
Browse files Browse the repository at this point in the history
  • Loading branch information
rossedfort authored Aug 26, 2024
1 parent eaf2401 commit 389cc02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/lib/holocene/table/paginated-table/api-paginated.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
itemsKeyname?: string;
previousButtonLabel: string;
nextButtonLabel: string;
pageSizeOptions?: string[];
};
export let onError: (error: Error) => void | undefined = undefined;
Expand All @@ -58,8 +59,12 @@
export let itemsKeyname = 'items';
export let previousButtonLabel: string;
export let nextButtonLabel: string;
export let pageSizeOptions = options;
let store: PaginationStore<T> = createPaginationStore();
let store: PaginationStore<T> = createPaginationStore(
pageSizeOptions,
pageSizeOptions[0],
);
let error: Error;
function clearError() {
Expand Down Expand Up @@ -193,7 +198,7 @@
label={pageSizeSelectLabel}
parameter={$store.key}
value={String($store.pageSize)}
{options}
options={pageSizeOptions}
/>
</svelte:fragment>

Expand Down
2 changes: 1 addition & 1 deletion src/lib/holocene/table/paginated-table/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<style lang="postcss">
.paginated-table-wrapper {
@apply surface-primary min-h-[154px] overflow-auto rounded-lg border-2 border-table;
@apply surface-primary max-h-none min-h-[154px] overflow-auto rounded-lg border-2 border-table;
}
.paginated-table {
Expand Down

0 comments on commit 389cc02

Please sign in to comment.