Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions frontend/viewer/src/lib/components/field-editors/select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
filterPlaceholder?: string;
emptyResultsPlaceholder?: string;
drawerTitle?: string;
onchange?: (value: Value) => void;
onchange?: (value: Value | undefined) => void;
class?: string;
nullOption?: string;
} = $props();
const {
Expand All @@ -40,7 +41,8 @@
emptyResultsPlaceholder,
drawerTitle,
onchange,
class: className
class: className,
nullOption,
} = $derived(constProps);
function getId(value: Value): Primitive {
Expand All @@ -66,7 +68,7 @@
open = false;
}
function selectValue(newValue: Value) {
function selectValue(newValue: Value | undefined) {
value = newValue;
onchange?.(newValue);
open = false;
Expand Down Expand Up @@ -96,7 +98,7 @@
</span>
{:else}
<span class="text-muted-foreground">
{placeholder ?? $t`None`}
{placeholder ?? nullOption ?? $t`None`}
<!-- ensures that baseline alignment works for consumers of this component -->
&nbsp;
</span>
Expand All @@ -123,6 +125,18 @@
<CommandList class="max-md:h-[300px] md:max-h-[50vh]">
<CommandEmpty>{emptyResultsPlaceholder ?? $t`No items found`}</CommandEmpty>
<CommandGroup>
{#if nullOption}
<CommandItem
keywords={[nullOption]}
onSelect={() => selectValue(undefined)}
class="group max-md:h-12 text-muted-foreground"
data-value-index={-1}
aria-label={nullOption}
>
<Icon icon="i-mdi-check" class={cn('md:hidden', value === null || 'invisible')} />
{nullOption}
</CommandItem>
{/if}
{#each renderedOptions as option, i (getId(option))}
{@const label = getLabel(option)}
{@const id = getId(option)}
Expand Down
4 changes: 2 additions & 2 deletions frontend/viewer/src/lib/components/ui/switch/switch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
bind:checked
class={cn(
'focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className,
label || className,
)}
{...restProps}
>
Expand All @@ -35,7 +35,7 @@
{/snippet}

{#if label}
<Label class="cursor-pointer flex items-center gap-2">
<Label class={cn('cursor-pointer flex items-center gap-4 max-md:w-full max-md:h-10', className)}>
{@render control()}
<span>{label}</span>
</Label>
Expand Down
47 changes: 29 additions & 18 deletions frontend/viewer/src/locales/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ msgstr "Add Word"
msgid "an entry"
msgstr "an entry"

#: src/project/browse/filter/SemanticDomainSelect.svelte
msgid "Any"
msgstr "Any"

#: src/project/browse/filter/WsSelect.svelte
msgid "Any Ws"
msgstr "Any Ws"
Expand Down Expand Up @@ -201,7 +205,7 @@ msgstr "Choose theme"
msgid "Citation form"
msgstr "Citation form"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
msgid "Citation Form"
msgstr "Citation Form"

Expand Down Expand Up @@ -338,7 +342,7 @@ msgstr "Dictionary Preview"
msgid "Discard"
msgstr "Discard"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
#: src/lib/entry-editor/object-editors/EntryEditorPrimitive.svelte
msgid "Display as"
msgstr "Display as"
Expand Down Expand Up @@ -463,7 +467,7 @@ msgstr "Failed to synchronize."
msgid "Feedback & Support"
msgstr "Feedback & Support"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
msgid "Field"
msgstr "Field"

Expand Down Expand Up @@ -557,7 +561,7 @@ msgstr "For any other inquiries, feel free to send us an email."
msgid "Get support"
msgstr "Get support"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
#: src/lib/entry-editor/object-editors/SenseEditorPrimitive.svelte
msgid "Gloss"
msgstr "Gloss"
Expand Down Expand Up @@ -603,6 +607,14 @@ msgstr "Import"
msgid "in {0}"
msgstr "in {0}"

#: src/project/browse/SearchFilter.svelte
msgid "Include subdomains"
msgstr "Include subdomains"

#: src/project/browse/SearchFilter.svelte
msgid "Incomplete entries"
msgstr "Incomplete entries"

#: src/project/tasks/DoneView.svelte
msgid "Keep going"
msgstr "Keep going"
Expand All @@ -628,7 +640,7 @@ msgstr "Lexbox logo"
msgid "Lexeme form"
msgstr "Lexeme form"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
msgid "Lexeme Form"
msgstr "Lexeme Form"

Expand Down Expand Up @@ -706,26 +718,17 @@ msgstr "Missing Definition {0}"
msgid "Missing Example sentence {0}"
msgstr "Missing Example sentence {0}"

#: src/project/browse/SearchFilter.svelte
msgid "Missing Examples"
msgstr "Missing Examples"

#: src/project/tasks/tasks-service.ts
msgid "Missing Gloss {0}"
msgstr "Missing Gloss {0}"

#: src/project/tasks/tasks-service.ts
#: src/project/browse/SearchFilter.svelte
msgid "Missing Part of Speech"
msgstr "Missing Part of Speech"

#: src/project/browse/SearchFilter.svelte
msgid "Missing Semantic Domains"
msgstr "Missing Semantic Domains"

#: src/project/browse/SearchFilter.svelte
msgid "Missing Senses"
msgstr "Missing Senses"
#: src/project/browse/filter/MissingSelect.svelte
msgid "Missing..."
msgstr "Missing..."

#: src/lib/entry-editor/ItemListItem.svelte
msgid "Move"
Expand Down Expand Up @@ -975,6 +978,10 @@ msgstr "Select a new task to work on"
msgid "Select file"
msgstr "Select file"

#: src/project/browse/SearchFilter.svelte
msgid "Semantic domain"
msgstr "Semantic domain"

#: src/lib/entry-editor/object-editors/SenseEditorPrimitive.svelte
msgid "Semantic domains"
msgstr "Semantic domains"
Expand Down Expand Up @@ -1034,6 +1041,10 @@ msgstr "Size:"
msgid "Skip"
msgstr "Skip"

#: src/project/browse/SearchFilter.svelte
msgid "Specific field"
msgstr "Specific field"

#: src/project/browse/filter/OpFilter.svelte
msgid "Starts with"
msgstr "Starts with"
Expand Down Expand Up @@ -1214,8 +1225,8 @@ msgstr "View Configuration"
msgid "Where are my projects?"
msgstr "Where are my projects?"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/EntryMenu.svelte
#: src/project/browse/filter/FieldSelect.svelte
#: src/lib/entry-editor/EntryOrSensePicker.svelte
#: src/lib/entry-editor/EditEntryDialog.svelte
#: src/lib/entry-editor/object-editors/EntryEditorPrimitive.svelte
Expand Down
47 changes: 29 additions & 18 deletions frontend/viewer/src/locales/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ msgstr ""
msgid "an entry"
msgstr "una entrada"

#: src/project/browse/filter/SemanticDomainSelect.svelte
msgid "Any"
msgstr ""

#: src/project/browse/filter/WsSelect.svelte
msgid "Any Ws"
msgstr "Cualquier W"
Expand Down Expand Up @@ -206,7 +210,7 @@ msgstr ""
msgid "Citation form"
msgstr "Formulario de cita"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
msgid "Citation Form"
msgstr "Formulario de citación"

Expand Down Expand Up @@ -343,7 +347,7 @@ msgstr "Vista previa del diccionario"
msgid "Discard"
msgstr "Descartar"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
#: src/lib/entry-editor/object-editors/EntryEditorPrimitive.svelte
msgid "Display as"
msgstr "Mostrar como"
Expand Down Expand Up @@ -468,7 +472,7 @@ msgstr "Error de sincronización."
msgid "Feedback & Support"
msgstr ""

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
msgid "Field"
msgstr "Campo"

Expand Down Expand Up @@ -562,7 +566,7 @@ msgstr "Para cualquier otra consulta, no dude en enviarnos un correo electrónic
msgid "Get support"
msgstr ""

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
#: src/lib/entry-editor/object-editors/SenseEditorPrimitive.svelte
msgid "Gloss"
msgstr "Glosa"
Expand Down Expand Up @@ -608,6 +612,14 @@ msgstr "Importar"
msgid "in {0}"
msgstr "en {0}"

#: src/project/browse/SearchFilter.svelte
msgid "Include subdomains"
msgstr ""

#: src/project/browse/SearchFilter.svelte
msgid "Incomplete entries"
msgstr ""

#: src/project/tasks/DoneView.svelte
msgid "Keep going"
msgstr "Continuar"
Expand All @@ -633,7 +645,7 @@ msgstr "Logotipo de Lexbox"
msgid "Lexeme form"
msgstr "Forma del lexema"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/filter/FieldSelect.svelte
msgid "Lexeme Form"
msgstr "Forma del lexema"

Expand Down Expand Up @@ -711,26 +723,17 @@ msgstr "Definición {0} perdida"
msgid "Missing Example sentence {0}"
msgstr "Frase de ejemplo {0} perdida"

#: src/project/browse/SearchFilter.svelte
msgid "Missing Examples"
msgstr "Ejemplos perdidos"

#: src/project/tasks/tasks-service.ts
msgid "Missing Gloss {0}"
msgstr "Glosa {0} perdida"

#: src/project/tasks/tasks-service.ts
#: src/project/browse/SearchFilter.svelte
msgid "Missing Part of Speech"
msgstr "Parte de la oración perdido"

#: src/project/browse/SearchFilter.svelte
msgid "Missing Semantic Domains"
msgstr "Dominios semánticos perdidos"

#: src/project/browse/SearchFilter.svelte
msgid "Missing Senses"
msgstr "Acepciones perdidas"
#: src/project/browse/filter/MissingSelect.svelte
msgid "Missing..."
msgstr ""

#: src/lib/entry-editor/ItemListItem.svelte
msgid "Move"
Expand Down Expand Up @@ -980,6 +983,10 @@ msgstr "Seleccione una nueva tarea en la que trabajar"
msgid "Select file"
msgstr "Seleccionar archivo"

#: src/project/browse/SearchFilter.svelte
msgid "Semantic domain"
msgstr ""

#: src/lib/entry-editor/object-editors/SenseEditorPrimitive.svelte
msgid "Semantic domains"
msgstr "Dominios semánticos"
Expand Down Expand Up @@ -1039,6 +1046,10 @@ msgstr "Tamaño:"
msgid "Skip"
msgstr "Saltar"

#: src/project/browse/SearchFilter.svelte
msgid "Specific field"
msgstr ""

#: src/project/browse/filter/OpFilter.svelte
msgid "Starts with"
msgstr "Empieza por"
Expand Down Expand Up @@ -1219,8 +1230,8 @@ msgstr "Ver configuración"
msgid "Where are my projects?"
msgstr "¿Dónde están mis proyectos?"

#: src/project/browse/SearchFilter.svelte
#: src/project/browse/EntryMenu.svelte
#: src/project/browse/filter/FieldSelect.svelte
#: src/lib/entry-editor/EntryOrSensePicker.svelte
#: src/lib/entry-editor/EditEntryDialog.svelte
#: src/lib/entry-editor/object-editors/EntryEditorPrimitive.svelte
Expand Down
Loading
Loading