From afeffe31bd7d0f8333627a972e1d32e64a325b5b Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Fri, 1 Mar 2024 18:17:42 -0500 Subject: reformat fe --- fe/src/lib/Card.svelte | 14 +-- fe/src/lib/Counter.svelte | 10 --- fe/src/lib/DataView.svelte | 177 +++++++++++++++++++------------------- fe/src/lib/Layout.svelte | 77 +++++++++-------- fe/src/lib/LoginForm.svelte | 105 +++++++++++++--------- fe/src/lib/PreferencesForm.svelte | 32 ++++--- fe/src/lib/Table.svelte | 138 ++++++++++++++--------------- fe/src/lib/errors.ts | 6 +- fe/src/lib/utils.ts | 16 ++-- 9 files changed, 296 insertions(+), 279 deletions(-) delete mode 100644 fe/src/lib/Counter.svelte (limited to 'fe/src/lib') diff --git a/fe/src/lib/Card.svelte b/fe/src/lib/Card.svelte index feb5bcc..0835940 100644 --- a/fe/src/lib/Card.svelte +++ b/fe/src/lib/Card.svelte @@ -1,16 +1,16 @@
- {#if title} -

{title}

- {/if} - + {#if title} +

{title}

+ {/if} +
diff --git a/fe/src/lib/Counter.svelte b/fe/src/lib/Counter.svelte deleted file mode 100644 index 979b4df..0000000 --- a/fe/src/lib/Counter.svelte +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/fe/src/lib/DataView.svelte b/fe/src/lib/DataView.svelte index dc8acae..1458c9a 100644 --- a/fe/src/lib/DataView.svelte +++ b/fe/src/lib/DataView.svelte @@ -1,126 +1,123 @@ - +
- - - -

Add Water

-
-
- - -
-
- - -
- - -
-
- - {#await json then data} - - {:catch error} -

{error}

- {/await} - + + +

Add Water

+
+
+ + +
+
+ + +
+ + + +
+ + {#await json then data} +
+ {:catch error} +

{error}

+ {/await} + diff --git a/fe/src/lib/Layout.svelte b/fe/src/lib/Layout.svelte index f349632..94ce84d 100644 --- a/fe/src/lib/Layout.svelte +++ b/fe/src/lib/Layout.svelte @@ -1,57 +1,62 @@
- {#if $authenticated} + {#if $authenticated} - {/if} -
- -
+ + {/if} +
+ +
diff --git a/fe/src/lib/LoginForm.svelte b/fe/src/lib/LoginForm.svelte index 499a457..bf6d9ad 100644 --- a/fe/src/lib/LoginForm.svelte +++ b/fe/src/lib/LoginForm.svelte @@ -1,66 +1,85 @@ - -
-
- - -
-
- - -
- {#if error} -

{error}

- {/if} - - +
+
+ + +
+
+ + +
+ {#if error} +

{error}

+ {/if} + +
diff --git a/fe/src/lib/PreferencesForm.svelte b/fe/src/lib/PreferencesForm.svelte index 781866c..95e04c1 100644 --- a/fe/src/lib/PreferencesForm.svelte +++ b/fe/src/lib/PreferencesForm.svelte @@ -1,7 +1,8 @@ - +

User Preferences

- - + +
- - + +
@@ -42,4 +43,9 @@ dialog { background: white; color: black; } + +input[type="color"] { + width: 100%; + height: 100%; +} diff --git a/fe/src/lib/Table.svelte b/fe/src/lib/Table.svelte index 4b81800..3a66e0d 100644 --- a/fe/src/lib/Table.svelte +++ b/fe/src/lib/Table.svelte @@ -1,105 +1,105 @@ +
- {#if title} + {#if title}

{title}

- {/if} - {#if !noheader} + {/if} + {#if !noheader && data} - - {#each getDataKeys(data) as header} - - {/each} - + + {#each getDataKeys(data) as header} + + {/each} + - {/if} - - {#if data} - {#each data as row} + {/if} + + {#if data} + {#each data as row} - {#each getRow(row) as datum} - + {#each getRow(row) as datum} - {/each} + {/each} - {/each} - {:else} - - There is not data. - - {/if} - - {#if !nofooter} + {/each} + {:else} + There is not data. + {/if} + + {#if !nofooter} - + - + - + - {/if} + {/if}
{header}
{header}
{formatDatum(datum)}
Table FooterTable Footer
+ diff --git a/fe/src/lib/errors.ts b/fe/src/lib/errors.ts index 0663d63..d44bec5 100644 --- a/fe/src/lib/errors.ts +++ b/fe/src/lib/errors.ts @@ -1,7 +1,7 @@ export class UnauthorizedError extends Error { - constructor (message?: string , options?: ErrorOptions) { - super(message, options); - } + constructor(message?: string, options?: ErrorOptions) { + super(message, options); + } } diff --git a/fe/src/lib/utils.ts b/fe/src/lib/utils.ts index c5501ae..22d4e9a 100644 --- a/fe/src/lib/utils.ts +++ b/fe/src/lib/utils.ts @@ -1,9 +1,9 @@ -export function processFormInput(form) { - const formData = new FormData(form); - const data = {}; - for (let field of formData) { - const [key, value] = field; - data[key] = value; - } - return data; +export function processFormInput(form: HTMLFormElement) { + const formData = new FormData(form); + const data: Record = {}; + for (let field of formData) { + const [key, value] = field; + data[key] = value; + } + return data; } -- cgit v1.1