API reference: @salmonui/query-builder
QueryFieldinterface
import type { QueryField } from '@salmonui/query-builder';interface QueryField {
readonly field: string;
readonly label?: string | undefined;
readonly type?: QueryFieldType | undefined;
readonly operators?: readonly string[] | undefined;
readonly values?: readonly QueryFieldValue[] | undefined;
readonly defaultValue?: Json | undefined;
readonly format?: string | FormatOptions | undefined;
readonly step?: number | undefined;
readonly validation?: FieldValidation | undefined;
readonly category?: string | undefined;
readonly fields?: readonly QueryField[] | undefined;
readonly renderValueEditor?: ((ctx: QueryValueEditorContext) => ReactNode) | undefined;
}
| Name | Signature | Description |
|---|---|---|
field | readonly field: string; | Field name; with |
labeloptional | readonly label?: string | undefined; | |
typeoptional | readonly type?: QueryFieldType | undefined; | Default |
operatorsoptional | readonly operators?: readonly string[] | undefined; | Operators offered (Data Grid filter operator names or custom ones); default per type ( |
valuesoptional | readonly values?: readonly QueryFieldValue[] | undefined; | Fixed values: a Select (or a multiple Select for |
defaultValueoptional | readonly defaultValue?: Json | undefined; | Value of a new rule on this field. |
formatoptional | readonly format?: string | FormatOptions | undefined; | Display format of values (summary): a Data Grid format ( |
stepoptional | readonly step?: number | undefined; | Step of the numeric editor. |
validationoptional | readonly validation?: FieldValidation | undefined; | Rules of the value (the Form rule vocabulary), checked by |
categoryoptional | readonly category?: string | undefined; | Group of the field in the field list. |
fieldsoptional | readonly fields?: readonly QueryField[] | undefined; | Nested fields: paths |
renderValueEditoroptional | readonly renderValueEditor?: ((ctx: QueryValueEditorContext) => ReactNode) | undefined; | Custom value editor. |