PathLogs UI
Русский

Components

QueryInput

Structured search is:open author:me — chips instead of text, with autocomplete.

Structured search: is:open author:me due:<now+7d. What FilterBar gives to clicking on fields, this gives to typing — and on the same condition model. Conditions are drawn as chips, and keys and values autocomplete at the caret.

Example

Попробуйте -status:done, priority:>=3, author:Мурат или свободное слово.

  • Тёмная тема мигает при загрузкеbugui

Syntax

text
status:open           field equals value
label:bug,ui          any of the values (OR within a condition)
label:bug label:ui    both values (AND between conditions)
-status:done          negation
priority:>=3          numeric comparison
due:<now+7d           date comparison in TimeRangePicker syntax
crash                 a bare word — searched in the text

Props

value*string

The query string.

onChange*(value: string) => void

The string changed.

fields*QueryField<T>[]

The searchable fields: key, type, value options, and how to read the value off an item.

onParsed(parsed) => void

The parsed query — usually for filtering right away.

onSubmit(value: string) => void

Enter outside the suggestions.

placeholderstring

The hint in an empty field.

The parser, separately

tsx
import {
  parseQuery,     // string → conditions plus free text
  matchesQuery,   // does an item satisfy the query
  suggestAt,      // what to suggest at this caret position
  stringifyQuery, // conditions → string (for links and presets)
} from "@toimetdev/pathlogs-core";

Date values are compared with the same parser as in TimeRangePicker: due:<now+7d works out of the box.