diff --git a/src/app.postcss b/src/app.postcss
index b340066f..e12220b2 100644
--- a/src/app.postcss
+++ b/src/app.postcss
@@ -12,3 +12,16 @@ body {
[type='text']:focus {
--tw-ring-color: #00000;
}
+
+.svelte-select, .svelte-select-list {
+ @apply dark:!bg-zinc-700 border dark:!border-zinc-500;
+}
+
+.multi-item {
+ @apply dark:!bg-zinc-500 dark:!outline-zinc-400;
+}
+
+.list-item .item.hover:not(.active):not(.list-group-title) {
+ @apply dark:!text-black;
+}
+
diff --git a/src/lib/components/Facets/Facets.svelte b/src/lib/components/Facets/Facets.svelte
index f4fa6e5c..5783d901 100644
--- a/src/lib/components/Facets/Facets.svelte
+++ b/src/lib/components/Facets/Facets.svelte
@@ -26,7 +26,7 @@
ref: ShowMore,
props: {
group,
- handleSave,
+ handleApply,
handleCancel
}
}
@@ -45,7 +45,7 @@
const modalStore = getModalStore();
- const handleSave = (group: SelectedFacetGroup) => {
+ const handleApply = (group: SelectedFacetGroup) => {
const { name: groupName, children } = group;
dispatch('showMoreOpenChange', {
@@ -110,9 +110,8 @@
changed.length && dispatch('facetSelect', changed);
};
- // Keeping the sorting function, but stays unused for now
const sortOptions = () => {
- // Sort facets in a descending order if count exits, or sort alphabetically
+ // Sort facets in a descending order if count exits
Object.keys(selected).forEach((group) => {
const checked = Object.keys(selected[group].children)
.filter((item) => selected[group].children[item].selected)
@@ -121,13 +120,20 @@
if (a.count != undefined && b.count != undefined) {
return b.count - a.count;
}
- return a.displayName.localeCompare(b.displayName);
+ return 0;
})
.map((item) => item.name);
- const unchecked = Object.keys(selected[group].children).filter(
- (item) => !checked.includes(item)
- );
+ const unchecked = Object.keys(selected[group].children)
+ .filter((item) => !checked.includes(item))
+ .map((item) => selected[group].children[item])
+ .sort((a, b) => {
+ if (a.count != undefined && b.count != undefined) {
+ return b.count - a.count;
+ }
+ return 0;
+ })
+ .map((item) => item.name);
const groupIndex = displayedGroups.findIndex((g) => g.name === group);
@@ -172,7 +178,7 @@
});
$: displayedGroups = structuredClone($groups);
- $: selectedItems, mapSelected('items'); // sortOptions(); // Sorting is not used for now
+ $: selectedItems, mapSelected('items'), sortOptions();
$: selectedGroups, mapSelected('groups');
@@ -186,7 +192,7 @@
bind:checked={selectedGroups[group.name]}
bind:group={selectedGroups}
>
-
+
{group.displayName}{group.count !== undefined ? ` (${group.count})` : ''}
@@ -204,7 +210,12 @@
selection
multiple
>
- {item.displayName} ({item.count})
+
+
+ {item.displayName}
+
+
({item.count})
+
{/each}
@@ -226,7 +237,12 @@
selection
multiple
>
- {item.displayName} ({item.count})
+
+
+ {item.displayName}
+
+
({item.count})
+
{/each}
{/if}
diff --git a/src/lib/components/Facets/ShowMore.svelte b/src/lib/components/Facets/ShowMore.svelte
index 24598fbe..56964025 100644
--- a/src/lib/components/Facets/ShowMore.svelte
+++ b/src/lib/components/Facets/ShowMore.svelte
@@ -2,7 +2,7 @@
import type { SelectedFacetGroup } from '$models/Models';
export let group: SelectedFacetGroup;
- export let handleSave: (group: SelectedFacetGroup) => {};
+ export let handleApply: (group: SelectedFacetGroup) => {};
export let handleCancel: (groupName: string) => {};
let selected = structuredClone(group.children);
@@ -15,8 +15,8 @@
Object.keys(selected).forEach((key) => (selected[key].selected = false));
};
- const onSave = () => {
- handleSave({
+ const onApply = () => {
+ handleApply({
...group,
children: selected
});
@@ -29,32 +29,46 @@
};
const gridClass = (items: any[]) => {
- if (items.length >= 50) {
- return 'grid-cols-5';
- } else if (items.length >= 30) {
- return 'grid-cols-4';
- } else if (items.length >= 20) {
- return 'grid-cols-3';
- }
+ const ceil = Math.ceil(Math.sqrt(items.length));
+ const max = Math.max(ceil, Math.floor(items.length / 3));
- return 'grid-cols-2';
+ const classes = [
+ 'grid-rows-1',
+ 'grid-rows-2',
+ 'grid-rows-3',
+ 'grid-rows-4',
+ 'grid-rows-5',
+ 'grid-rows-6',
+ 'grid-rows-7',
+ 'grid-rows-8',
+ 'grid-rows-9',
+ 'grid-rows-10',
+ 'grid-rows-11',
+ 'grid-rows-12'
+ ];
+
+ if (max > 12) {
+ return 'grid-rows-12';
+ } else return classes[max - 1 || 1];
};
-
+
diff --git a/src/lib/components/Table/ColumnsMenu.svelte b/src/lib/components/Table/ColumnsMenu.svelte
index f30ecdc2..38f3756f 100644
--- a/src/lib/components/Table/ColumnsMenu.svelte
+++ b/src/lib/components/Table/ColumnsMenu.svelte
@@ -15,6 +15,7 @@
@@ -25,6 +26,7 @@
{#each columns as column}
c.visible).length === 1 && column.visible}
diff --git a/src/lib/components/Table/TableContent.svelte b/src/lib/components/Table/TableContent.svelte
index 291eb0b4..c30610a4 100644
--- a/src/lib/components/Table/TableContent.svelte
+++ b/src/lib/components/Table/TableContent.svelte
@@ -165,9 +165,9 @@
header: header ?? key,
accessor: accessor,
// Render the cell with the provided component, or use the toStringFn if provided, or just use the value
- cell: ({ value, row }) => {
+ cell: ({ value, row, column }) => {
return renderComponent
- ? createRender(renderComponent, { value, row, dispatchFn: actionDispatcher })
+ ? createRender(renderComponent, { value, row, column, dispatchFn: actionDispatcher })
: toStringFn
? toStringFn(value)
: value;
@@ -394,7 +394,7 @@
} else {
sendModel.q = searchValue;
}
-
+
$filterValue = searchValue;
}}
>
@@ -409,6 +409,7 @@
type="reset"
id="{tableId}-searchReset"
class="absolute right-3 items-center"
+ aria-label="Clear search"
on:click|preventDefault={() => {
if (serverSide && !sendModel) {
throw new Error('Server-side configuration is missing');
diff --git a/src/lib/components/Table/TableFilter.svelte b/src/lib/components/Table/TableFilter.svelte
index 86778670..2284f337 100644
--- a/src/lib/components/Table/TableFilter.svelte
+++ b/src/lib/components/Table/TableFilter.svelte
@@ -240,6 +240,7 @@
type="button"
use:popup={popupFeatured}
id="{popupId}-button"
+ aria-label="Open filter menu for column {id}"
>
@@ -249,6 +250,7 @@
@@ -328,6 +335,7 @@
@@ -242,6 +243,7 @@
{/if}
@@ -294,6 +298,7 @@
class="input p-1 border border-primary-500"
on:input={(e) => valueChangeHandler(e, index)}
bind:value={dropdown.value}
+ aria-label="Filter value"
/>
{:else}
valueChangeHandler(e, index)}
bind:value={dropdown.value}
+ aria-label="Filter value"
/>
{/if}
@@ -313,6 +319,7 @@
{#if remainingFilters.length}
{
addFilter(remainingFilters[0].value, undefined);
}}
@@ -326,6 +333,7 @@
diff --git a/src/lib/components/Table/TablePagination.svelte b/src/lib/components/Table/TablePagination.svelte
index be2c7ac1..51cdf0c3 100644
--- a/src/lib/components/Table/TablePagination.svelte
+++ b/src/lib/components/Table/TablePagination.svelte
@@ -62,7 +62,11 @@
{/each}
-->
-
goTo('next')}
+ aria-label="Go to next page"
disabled={goToNextPageDisabled}>
goTo('last')}
disabled={goToLastPageDisabled}>
diff --git a/src/lib/components/form/Checkbox.svelte b/src/lib/components/form/Checkbox.svelte
index bc7b91a0..1ade6727 100644
--- a/src/lib/components/form/Checkbox.svelte
+++ b/src/lib/components/form/Checkbox.svelte
@@ -14,7 +14,7 @@