From 7183b445e1877a80fcbe702bb43af1d26d7d0d0c Mon Sep 17 00:00:00 2001 From: Holger Stitz Date: Thu, 15 Feb 2024 09:14:18 +0100 Subject: [PATCH] feat: improve string column search dialog --- src/styles/_dialogs.scss | 43 +++++++++++ src/ui/dialogs/SearchDialog.ts | 126 +++++++++++++++++++++++++++------ 2 files changed, 147 insertions(+), 22 deletions(-) diff --git a/src/styles/_dialogs.scss b/src/styles/_dialogs.scss index 0293f57bb..44f404bbf 100644 --- a/src/styles/_dialogs.scss +++ b/src/styles/_dialogs.scss @@ -265,3 +265,46 @@ bottom: -$arrow_size; } } + +/* search dialog for string columns */ +.#{$lu_css_prefix}-string-search-dialog { + display: flex; + gap: 5px; + + .#{$lu_css_prefix}-search-count { + color: $lu_toolbar_color_base; + } + + button { + border: none; + background: none; + color: $lu_toolbar_color_base2; + + &:disabled { + color: $lu_toolbar_color_base; + } + + &:not(:disabled) { + cursor: pointer; + + &:hover, + &:active, + &:focus { + color: $lu_toolbar_color_hover; + } + } + + &::before { + @include lu_icons(); + } + + &.#{$lu_css_prefix}-previous-result::before { + content: $lu_icon_up_open; + } + + &.#{$lu_css_prefix}-next-result::before { + content: $lu_icon_down_open; + } + + } +} \ No newline at end of file diff --git a/src/ui/dialogs/SearchDialog.ts b/src/ui/dialogs/SearchDialog.ts index 88af6612a..0ad61e46a 100644 --- a/src/ui/dialogs/SearchDialog.ts +++ b/src/ui/dialogs/SearchDialog.ts @@ -1,7 +1,7 @@ import type { Column } from '../../model'; import type { IDataProvider } from '../../provider'; import ADialog, { type IDialogContext } from './ADialog'; -import { cssClass } from '../../styles'; +import { aria, cssClass } from '../../styles'; import { debounce } from '../../internal'; /** @internal */ @@ -24,9 +24,17 @@ export default class SearchDialog extends ADialog { } protected build(node: HTMLElement) { + // NOTE: the next button is of type submit to enable jumping to the next search result with the enter key in the search input field node.insertAdjacentHTML( 'beforeend', - ` + `
+ + + + +