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
<QueryInput
value={query}
onChange={setQuery}
fields={fields}
onParsed={(parsed) => setResults(tasks.filter((t) => matchesQuery(t, parsed, fields)))}
/>Syntax
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 textProps
| Prop | Type | Default | Description |
|---|---|---|---|
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. |
placeholder | string | — | The hint in an empty field. |
value*stringThe query string.
onChange*(value: string) => voidThe string changed.
fields*QueryField<T>[]The searchable fields: key, type, value options, and how to read the value off an item.
onParsed(parsed) => voidThe parsed query — usually for filtering right away.
onSubmit(value: string) => voidEnter outside the suggestions.
placeholderstringThe hint in an empty field.
The parser, separately
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.