1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-18 22:04:05 +00:00

Tried to fix grid height

This commit is contained in:
2023-01-10 20:10:39 +01:00
parent 34ba68b179
commit 11f6343843
8 changed files with 53 additions and 16 deletions

View File

@ -65,7 +65,7 @@
{#each _items as item (item[key])}
<tr on:click={() => select(item[key])} class:selected={activeKey === item[key] && !activeChildKey}>
<td class="has-toggle">
{#if item.children}
{#if item.children?.length}
<button class="toggle" on:click={() => toggleChildren(item[key])}>
<Icon name={childrenOpen[item[key]] ? 'chev-d' : 'chev-r'} />
</button>
@ -106,9 +106,9 @@
<style>
.grid {
background-color: #fff;
height: 100%;
width: 100%;
overflow: scroll;
max-height: 400px; /* fixme */
}
.grid.contained {
border: 1px solid #ccc;
@ -126,7 +126,7 @@
border-bottom: 2px solid #ccc;
}
table th {
th {
font-weight: 600;
text-align: left;
}
@ -137,7 +137,6 @@
td, th {
padding: 0.3rem;
height: 100%;
}
td.has-toggle {
width: calc(20px + 0.3rem);
@ -146,7 +145,7 @@
padding: 0;
}
table tbody tr.selected td {
tbody tr.selected td {
background-color: #00008b;
color: #fff;
}

View File

@ -4,6 +4,8 @@
{#if name === 'radio'}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-radio"><circle cx="12" cy="12" r="2"></circle><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"></path></svg>
{:else if name === 'chev-l'}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-left"><polyline points="15 18 9 12 15 6"></polyline></svg>
{:else if name === 'chev-r'}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>
{:else if name === 'chev-d'}

View File

@ -53,7 +53,7 @@
width: 100%;
border-radius: 10px;
display: flex;
flex-direction: column;
flex-flow: column;
cursor: auto;
}
.inner > :global(*:first-child) {

View File

@ -6,8 +6,6 @@
export let showHeaders = false;
export let contained = true;
console.log(data);
let items = [];
$: if (data) {
@ -31,6 +29,12 @@
if (Array.isArray(value)) {
return `array (${value.length} item${value.length === 1 ? '' : 's'})`;
}
else if (typeof value === 'number') {
if (value.toString().includes('.')) {
return 'double';
}
return 'integer';
}
else if (new Date(value).toString() !== 'Invalid Date') {
return 'date';
}