From 5977de5d149108e46d6ef1c5375bc5496d1f90bb Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Thu, 26 Aug 2021 10:28:27 +0300 Subject: [PATCH] New Table layout (#62) Signed-off-by: Alexander Platov --- packages/theme/styles/_colors.scss | 9 + packages/theme/styles/_layouts.scss | 13 ++ .../src/components/TableView.svelte | 170 +++++++++--------- 3 files changed, 105 insertions(+), 87 deletions(-) diff --git a/packages/theme/styles/_colors.scss b/packages/theme/styles/_colors.scss index a2129731bd..1e00a0b6c7 100644 --- a/packages/theme/styles/_colors.scss +++ b/packages/theme/styles/_colors.scss @@ -80,6 +80,9 @@ --theme-button-border-focused: rgba(255, 255, 255, .4); --theme-button-border-error: rgba(205, 104, 104, .1); + --theme-table-bg-color: rgba(255, 255, 255, .02); + --theme-table-bg-hover: rgba(255, 255, 255, .04); + --theme-caption-color: #fff; --theme-content-accent-color: rgba(255, 255, 255, 0.8); --theme-content-color: rgba(255, 255, 255, 0.6); @@ -132,6 +135,9 @@ --theme-button-border-focused: rgba(255, 255, 255, .4); --theme-button-border-error: rgba(205, 104, 104, .1); + --theme-table-bg-color: rgba(255, 255, 255, .02); + --theme-table-bg-hover: rgba(255, 255, 255, .04); + --theme-caption-color: #fff; --theme-content-accent-color: rgba(255, 255, 255, 0.8); --theme-content-color: rgba(255, 255, 255, 0.6); @@ -183,6 +189,9 @@ --theme-button-border-focused: rgba(255, 255, 255, .4); --theme-button-border-error: rgba(205, 104, 104, .1); + --theme-table-bg-color: rgba(0, 0, 0, .02); + --theme-table-bg-hover: rgba(0, 0, 0, .04); + --theme-caption-color: #272121; --theme-content-accent-color: rgba(39, 33, 33, 0.8); --theme-content-color: rgba(39, 33, 33, 0.6); diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index b531f072bd..0b7111c7b9 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -52,6 +52,19 @@ select:-webkit-autofill:focus { background: transparent; } +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: middle; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + // input:-webkit-autofill, // input:-webkit-autofill:hover, // input:-webkit-autofill:focus, diff --git a/plugins/view-resources/src/components/TableView.svelte b/plugins/view-resources/src/components/TableView.svelte index 6c604c8dc2..1ef4b3bbec 100644 --- a/plugins/view-resources/src/components/TableView.svelte +++ b/plugins/view-resources/src/components/TableView.svelte @@ -15,117 +15,113 @@ --> {#await buildModel(client, _class, config, options)} {:then model} - - - {#each model as attribute} - - {/each} - - {#if objects} - {#each objects as object (object._id)} - onClick(object)}> - {#each model as attribute} - - {/each} - - {/each} - {/if} -
+
+ + + + + {#each model as attribute} + + {/each} + + + {#if objects} + + {#each objects as object (object._id)} + onClick(object)}> + {#each model as attribute} + + {/each} + + {/each} + + {/if} +
+
+
{/await}