diff --git a/src/lib/components/Facets/ShowMore.svelte b/src/lib/components/Facets/ShowMore.svelte index 56964025..6c88cac6 100644 --- a/src/lib/components/Facets/ShowMore.svelte +++ b/src/lib/components/Facets/ShowMore.svelte @@ -5,7 +5,10 @@ export let handleApply: (group: SelectedFacetGroup) => {}; export let handleCancel: (groupName: string) => {}; - let selected = structuredClone(group.children); + let selected = Object.keys(group.children) + .sort((a, b) => group.children[a].displayName.localeCompare(group.children[b].displayName)) + .map((key) => ({ [key]: { ...group.children[key] } })) + .reduce((acc, val) => ({ ...acc, ...val }), {}); const selectAll = () => { Object.keys(selected).forEach((key) => (selected[key].selected = true)); @@ -23,67 +26,44 @@ }; const onCancel = () => { - console.log(selected, group.children); selected = structuredClone(group.children); handleCancel(group.name); }; - - const gridClass = (items: any[]) => { - const ceil = Math.ceil(Math.sqrt(items.length)); - const max = Math.max(ceil, Math.floor(items.length / 3)); - - 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]; - }; -
- -

{group.displayName}

+
+
+
+ +

{group.displayName}

- -
- {#each Object.keys(selected) as key} - - {/each} -
+ +
+ {#each Object.keys(selected) as key} + + {/each} +
- -
-
- - -
-
- - + +
+
+ + +
+
+ + +
+
diff --git a/src/lib/components/Table/ColumnsMenu.svelte b/src/lib/components/Table/ColumnsMenu.svelte index 38f3756f..09499d67 100644 --- a/src/lib/components/Table/ColumnsMenu.svelte +++ b/src/lib/components/Table/ColumnsMenu.svelte @@ -16,6 +16,7 @@ type="button" class="btn btn-sm variant-filled-primary rounded-full order-last" aria-label="Open menu to hide/show columns" + title="Open menu to hide/show columns" use:popup={popupCombobox}>Columns @@ -26,9 +27,10 @@ {#each columns as column}
c.visible).length === 1 && column.visible} /> {column.label} diff --git a/src/lib/components/Table/TableContent.svelte b/src/lib/components/Table/TableContent.svelte index c30610a4..f3c246f6 100644 --- a/src/lib/components/Table/TableContent.svelte +++ b/src/lib/components/Table/TableContent.svelte @@ -404,12 +404,14 @@ type="text" bind:value={searchValue} placeholder="Search rows..." + title="Search rows" id="{tableId}-search" /> exportAsCsv(tableId, $exportedData)} >Export as CSV @@ -517,6 +526,11 @@ class:cursor-pointer={!props.sort.disabled} on:click={props.sort.toggle} on:keydown={props.sort.toggle} + title={props.sort.order === 'asc' + ? `Sort by ${cell.label} column in descending order` + : props.sort.order === 'desc' + ? `Remove sorting by ${cell.label} column` + : `Sort by ${cell.label} column in ascending order`} > {cell.render()} diff --git a/src/lib/components/Table/TableFilter.svelte b/src/lib/components/Table/TableFilter.svelte index 2284f337..a1b3e5e2 100644 --- a/src/lib/components/Table/TableFilter.svelte +++ b/src/lib/components/Table/TableFilter.svelte @@ -240,7 +240,8 @@ type="button" use:popup={popupFeatured} id="{popupId}-button" - aria-label="Open filter menu for column {id}" + aria-label="Open filter menu for {id} column" + title="Open filter menu for {id} column" > @@ -251,6 +252,7 @@ class="btn variant-filled-primary btn-sm" type="button" aria-label="Clear Filters" + title="Clear Filters" on:click|preventDefault={() => { // Set the defaults when cleared clearFilters(); @@ -269,6 +271,7 @@ valueChangeHandler(e, index)} bind:value={dropdown.formValue} aria-label="Filter value" + title="Filter value" /> {/if}
@@ -328,6 +335,7 @@ addFilter(remainingFilters[0].value, undefined); }} aria-label="Add filter" + title="Add filter" >
Add Filter
@@ -336,6 +344,7 @@ class="btn variant-filled-primary btn-sm" type="button" aria-label="Apply filters" + title="Apply filters" on:click|preventDefault={() => { $pageIndex = 0; $filterValue = $filters[id]; diff --git a/src/lib/components/Table/TablePagination.svelte b/src/lib/components/Table/TablePagination.svelte index 51cdf0c3..683d9fde 100644 --- a/src/lib/components/Table/TablePagination.svelte +++ b/src/lib/components/Table/TablePagination.svelte @@ -63,7 +63,8 @@ --> @@ -105,6 +108,7 @@ value={$pageIndex + 1} max={$pageCount} aria-label="Current page" + title="Current page" min={1} on:change={handleChange} /> @@ -112,12 +116,14 @@ class="btn btn-sm variant-filled-primary" id="{id}-next" aria-label="Go to next page" + title="Go to next page" on:click|preventDefault={goToNextPage} disabled={goToNextPageDisabled}>