Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions new/apps/web/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
rel="stylesheet"
>
<!--

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you mean to leave this section commented out?

<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/5.0.0/mdb.dark.min.css"
rel="stylesheet"
>
-->
<link href="/css/main.css?v=2" rel="stylesheet" >
<link href="/css/tables.css" rel="stylesheet" >

Expand Down Expand Up @@ -46,13 +48,16 @@
></script>


<!--
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/5.0.0/mdb.min.js"
type="text/javascript"
></script>



<script defer="defer" src="js/tables.js?v=1" type="module"></script>
<script defer="defer" src="js/main.js?v=2"></script>
-->

</head>
<body data-sveltekit-preload-data="hover">
Expand Down
29 changes: 10 additions & 19 deletions new/apps/web/src/lib/common/ModalWidget.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
// of IDs
let moreInfoExpanded = $state(false);

const widget = 'w-60 max-w-80 grow bg-surface-900 p-1 rounded-4',
const widget = 'min-h-32 self-stretch max-w-96 basis-72 flex flex-col grow bg-surface-900 p-1 py-4 rounded-md',
h1 = 'font-normal text-[13pt] m-0 pt-1 pb-2 text-center text-surface-50',
contents = 'flex flex-col grow text-center text-[1rem]',
animation = 'transition transition-discrete translate-y-[100px] starting:data-[state=open]:opacity-0 starting:data-[state=open]:translate-y-[100px] data-[state=open]:opacity-100 data-[state=open]:translate-y-0';
contents = 'flex flex-col text-center flex-1 justify-center text-[1rem]',
animation = 'transition transition-discrete translate-y-[50px] starting:data-[state=open]:opacity-0 starting:data-[state=open]:translate-y-[50px] data-[state=open]:opacity-100 data-[state=open]:translate-y-0 starting:data-[state=closed]:opacity-100 starting:data-[state=closed]:translate-y-0 data-[state=closed]:opacity-0 data-[state=closed]:translate-y-[50px] duration-150';
</script>

{#if !modalContents}
Expand All @@ -43,8 +43,8 @@
</div>
{:else}
<Dialog>
<Dialog.Trigger class="transition-all duration-100 hover:brightness-75">
<div class="{widget}">
<Dialog.Trigger class={widget}>
<div class="flex flex-col h-full">
<h1 class="{h1}">{title}</h1>
<div class="{contents}">
{@render widgetContents()}
Expand All @@ -53,16 +53,16 @@
</Dialog.Trigger>
<Portal>
<Dialog.Backdrop class="fixed inset-0 z-50 bg-surface-50-950/50" />
<Dialog.Positioner class="fixed inset-0 z-100 flex justify-center items-center p-4">
<Dialog.Content class="card bg-surface-100-900 {fullScreen ? "w-full max-w-11/12 max-h-11/12" : "w-fit max-w-6xl max-h-4xl"} p-4 space-y-4 shadow-xl {animation}">
<Dialog.Positioner class="fixed inset-0 z-100 flex justify-center items-center p-8">
<Dialog.Content class="flex flex-col card bg-surface-100-900 {fullScreen ? "w-full h-full max-h-[98%]" : "w-fit max-w-svw max-h-svh"} p-8 space-y-4 shadow-xl rounded-md {animation}">
<header class="flex justify-between items-center">
<Dialog.Title class="text-lg font-bold">{title}</Dialog.Title>
<Dialog.CloseTrigger class="btn-icon hover:preset-tonal">
X
</Dialog.CloseTrigger>
</header>

<div class="max-h-200 overflow-scroll">
<div class="max-h- overflow-auto">
{@render modalContents()}

<!-- more info -->
Expand All @@ -77,19 +77,10 @@
{#if extraModalContents && moreInfoExpanded == false}
<button onclick={() => {moreInfoExpanded = true}} type="button" class="btn preset-filled">More Info</button>
{/if}
<Dialog.CloseTrigger class="btn preset-tonal">Close</Dialog.CloseTrigger>
<Dialog.CloseTrigger class="btn preset-filled">Close</Dialog.CloseTrigger>
</footer>
</Dialog.Content>
</Dialog.Positioner>
</Portal>
</Dialog>
{/if}


<style>

/*
Underscore needed to stop bootstrap from interfering with css
can be removed when bootstrap is
*/
</style>
{/if}
68 changes: 36 additions & 32 deletions new/apps/web/src/lib/common/TabledData.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@

</script>

<div class="table-wrap">
<div class="overflow-auto max-w-full flex flex-col">
{#if params.length > 0}
<div class="table-options">
<div class="flex flex-row justify-between">
{#if paginate}
<label class="label">
<label class="max-w-32 label">
<span class="label-text">Page size</span>
<select bind:value={pageSize} class="select">
<option value="5">5</option>
Expand All @@ -69,17 +69,17 @@
</select>
</label>
{/if}
</div>

{#if search}
<label class="label">
<span class="label-text">Search: </span>
<input bind:value={searchTerm} class="input" type="text" placeholder="Input" />
</label>
{/if}
{#if search}
<label class="max-w-64 label">
<span class="label-text">Search: </span>
<input bind:value={searchTerm} class="input" type="text" placeholder="Input" />
</label>
{/if}
</div>
{/if}

<table class="table caption-bottom">
<table class="overflow-auto table caption-bottom">
<thead>
<tr>
{#each headers as header}
Expand All @@ -100,26 +100,30 @@
</table>

{#if paginate}
<Pagination count={finalData.length} pageSize={pageSize} {currentPage} onPageChange={(event) => (currentPage = event.page)}>
<Pagination.PrevTrigger>
<a>Previous</a>
</Pagination.PrevTrigger>
<Pagination.Context>
{#snippet children(pagination)}
{#each pagination().pages as page, index (page)}
{#if page.type === 'page'}
<Pagination.Item {...page}>
{page.value}
</Pagination.Item>
{:else}
<Pagination.Ellipsis {index}>&#8230;</Pagination.Ellipsis>
{/if}
{/each}
{/snippet}
</Pagination.Context>
<Pagination.NextTrigger>
<a onclick={console.log(end)}>Next</a>
</Pagination.NextTrigger>
</Pagination>
<div class="min-w-full flex items-end justify-end">
<Pagination class="flex gap-1 flex-row" count={finalData.length} pageSize={pageSize} {currentPage} onPageChange={(event) => (currentPage = event.page)}>
<Pagination.PrevTrigger class="btn bg-surface-800/50 text-sm">
<a>Previous</a>
</Pagination.PrevTrigger>
<Pagination.Context>
{#snippet children(pagination)}
<div class="flex flex-row gap-1">
{#each pagination().pages as page, index (page)}
{#if page.type === 'page'}
<Pagination.Item class="cursor-pointer btn bg-surface-800/50 text-sm" {...page}>
<a>{page.value}</a>
</Pagination.Item>
{:else}
<Pagination.Ellipsis {index}>&#8230;</Pagination.Ellipsis>
{/if}
{/each}
</div>
{/snippet}
</Pagination.Context>
<Pagination.NextTrigger class="btn bg-surface-800/50 text-sm">
<a onclick={console.log(end)}>Next</a>
</Pagination.NextTrigger>
</Pagination>
</div>
{/if}
</div>
Loading