# @salmonui/query-builder API reference

> 28 exported symbols of @salmonui/query-builder: 1 component, 3 functions, 16 interfaces, 7 types and 1 constant.

Canonical: https://salmonui.dev/docs/reference/query-builder

```ts
import { … } from '@salmonui/query-builder';
```

## Components

### QueryBuilder

Kind: component

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilder

```ts
function QueryBuilder(props: QueryBuilderProps): import("react").JSX.Element;
```

Props: [`QueryBuilderProps`](https://salmonui.dev/docs/reference/query-builder/QueryBuilderProps) (its members are the props)

## Functions

### filterRows

Kind: function

Page: https://salmonui.dev/docs/reference/query-builder/filterRows

```ts
function filterRows<Row>(rows: readonly Row[], value: QueryGroup, fields?: readonly QueryField[], options?: FilterRowsOptions): Row[];
```

The rows of `rows` that pass `value`.

### isQueryGroup

Kind: function

Page: https://salmonui.dev/docs/reference/query-builder/isQueryGroup

```ts
function isQueryGroup<N extends QueryNode>(node: N): node is Extract<N, {
    readonly filters: readonly unknown[];
}>;
```

Whether a node is a group (it has `filters` and no `field`).

### operatorsFor

Kind: function

Page: https://salmonui.dev/docs/reference/query-builder/operatorsFor

```ts
function operatorsFor(type?: QueryFieldType): readonly string[];
```

The built-in operators of a field type (Data Grid filter operator names), plus `in` / `notIn` for string and number fields.

## Interfaces

### FilterRowsOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/FilterRowsOptions

```ts
interface FilterRowsOptions {
    readonly pathSeparator?: string | undefined;
    readonly matchCase?: boolean | undefined;
    readonly ignoreAccents?: boolean | undefined;
    readonly operators?: readonly QueryOperator[] | undefined;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pathSeparator` | `readonly pathSeparator?: string \| undefined;` | optional | Separator of nested paths. Default `'.'`. |
| `matchCase` | `readonly matchCase?: boolean \| undefined;` | optional | Default `matchCase` of conditions that omit it. Default false. |
| `ignoreAccents` | `readonly ignoreAccents?: boolean \| undefined;` | optional | Default `ignoreAccents` of conditions that omit it. Default false. |
| `operators` | `readonly operators?: readonly QueryOperator[] \| undefined;` | optional | Custom operators with `evaluate`. |

### QueryBuilderApi

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderApi

```ts
interface QueryBuilderApi {
    getValue(): QueryGroup;
    setValue(value: QueryGroup): void;
    getValidValue(): QueryGroup;
    getNode(id: string): QueryNode | null;
    addRules(rules: readonly QueryRule[], groupId?: string): string[];
    addGroups(groups: readonly QueryGroup[], groupId?: string): string[];
    remove(ids: string | readonly string[]): void;
    clone(id: string, options?: {
        readonly parentId?: string;
        readonly index?: number;
    }): string | null;
    lock(id: string, locked?: boolean): void;
    validate(): boolean;
    reset(): void;
    focus(): void;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getValue` | `getValue(): QueryGroup;` |  |  |
| `setValue` | `setValue(value: QueryGroup): void;` |  |  |
| `getValidValue` | `getValidValue(): QueryGroup;` |  | The value without incomplete rules and empty groups. |
| `getNode` | `getNode(id: string): QueryNode \| null;` |  |  |
| `addRules` | `addRules(rules: readonly QueryRule[], groupId?: string): string[];` |  | Appends rules to the group `groupId` (default: the root); returns their ids. |
| `addGroups` | `addGroups(groups: readonly QueryGroup[], groupId?: string): string[];` |  |  |
| `remove` | `remove(ids: string \| readonly string[]): void;` |  |  |
| `clone` | `clone(id: string, options?: {     readonly parentId?: string;     readonly index?: number; }): string \| null;` |  | Copies a node next to itself (or into `parentId` at `index`); returns the copy's id. |
| `lock` | `lock(id: string, locked?: boolean): void;` |  |  |
| `validate` | `validate(): boolean;` |  | Validates every rule, shows inline errors and returns whether the value is valid. |
| `reset` | `reset(): void;` |  | Back to `defaultValue` (uncontrolled) or proposes it (controlled). |
| `focus` | `focus(): void;` |  | Moves focus to the first control. |

### QueryBuilderBeforeChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderBeforeChangeEvent

```ts
interface QueryBuilderBeforeChangeEvent {
    readonly action: QueryBuilderAction;
    readonly nodeId: string | null;
    readonly previousValue: QueryGroup;
    readonly value: QueryGroup;
    readonly source: QueryBuilderChangeDetails['source'];
    preventDefault(): void;
    readonly defaultPrevented: boolean;
}
```

`onBeforeChange` event: cancellable.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `action` | `readonly action: QueryBuilderAction;` |  |  |
| `nodeId` | `readonly nodeId: string \| null;` |  |  |
| `previousValue` | `readonly previousValue: QueryGroup;` |  |  |
| `value` | `readonly value: QueryGroup;` |  |  |
| `source` | `readonly source: QueryBuilderChangeDetails['source'];` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |

### QueryBuilderButtons

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderButtons

```ts
interface QueryBuilderButtons {
    readonly deleteRule?: boolean | undefined;
    readonly addGroup?: boolean | undefined;
    readonly deleteGroup?: boolean | undefined;
    readonly clone?: boolean | undefined;
    readonly lock?: boolean | undefined;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `deleteRule` | `readonly deleteRule?: boolean \| undefined;` | optional | Remove buttons on rules. Default true. |
| `addGroup` | `readonly addGroup?: boolean \| undefined;` | optional | Add-group buttons. Default true. |
| `deleteGroup` | `readonly deleteGroup?: boolean \| undefined;` | optional | Remove buttons on groups. Default true. |
| `clone` | `readonly clone?: boolean \| undefined;` | optional | Clone buttons on rules and groups. Default false. |
| `lock` | `readonly lock?: boolean \| undefined;` | optional | Lock buttons on rules and groups. Default false. |

### QueryBuilderChangeDetails

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderChangeDetails

```ts
interface QueryBuilderChangeDetails {
    readonly source: 'pointer' | 'keyboard' | 'touch' | 'api';
    readonly reason: QueryBuilderAction;
    readonly action: QueryBuilderAction;
    readonly nodeId: string | null;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `source` | `readonly source: 'pointer' \| 'keyboard' \| 'touch' \| 'api';` |  |  |
| `reason` | `readonly reason: QueryBuilderAction;` |  |  |
| `action` | `readonly action: QueryBuilderAction;` |  |  |
| `nodeId` | `readonly nodeId: string \| null;` |  | The node the action acted on (the new node for add and clone). |

### QueryBuilderDragEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderDragEvent

```ts
interface QueryBuilderDragEvent {
    readonly nodeId: string;
    readonly targetGroupId: string | null;
    readonly index: number;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `nodeId` | `readonly nodeId: string;` |  |  |
| `targetGroupId` | `readonly targetGroupId: string \| null;` |  | Target group and index of the drop position (null while outside the tree). |
| `index` | `readonly index: number;` |  |  |

### QueryBuilderDropEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderDropEvent

```ts
interface QueryBuilderDropEvent extends QueryBuilderDragEvent {
    readonly source: 'pointer' | 'keyboard';
    preventDefault(): void;
    readonly defaultPrevented: boolean;
}
```

`onDrop` event: cancellable.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `source` | `readonly source: 'pointer' \| 'keyboard';` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |
| `nodeId` | `nodeId: string;` | inherited |  |
| `targetGroupId` | `targetGroupId: string \| null;` | inherited | Target group and index of the drop position (null while outside the tree). |
| `index` | `index: number;` | inherited |  |

### QueryBuilderEditorProps

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderEditorProps

```ts
interface QueryBuilderEditorProps {
    readonly field?: Readonly<Record<string, unknown>> | undefined;
    readonly operator?: Readonly<Record<string, unknown>> | undefined;
    readonly value?: Readonly<Record<string, unknown>> | undefined;
}
```

Settings forwarded to the built-in editors.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field?: Readonly<Record<string, unknown>> \| undefined;` | optional | Props of the field Select. |
| `operator` | `readonly operator?: Readonly<Record<string, unknown>> \| undefined;` | optional | Props of the operator Select. |
| `value` | `readonly value?: Readonly<Record<string, unknown>> \| undefined;` | optional | Props of the value editors (TextField, numeric field, DateField, Select, Combobox). |

### QueryBuilderProps

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderProps

```ts
interface QueryBuilderProps {
    readonly fields: readonly QueryField[];
    readonly value?: QueryGroup | undefined;
    readonly defaultValue?: QueryGroup | undefined;
    readonly onValueChange?: ((value: QueryGroup, details: QueryBuilderChangeDetails) => void) | undefined;
    readonly onBeforeChange?: ((event: QueryBuilderBeforeChangeEvent) => void) | undefined;
    readonly operators?: readonly QueryOperator[] | undefined;
    readonly notCondition?: boolean | undefined;
    readonly buttons?: QueryBuilderButtons | undefined;
    readonly maxGroups?: number | undefined;
    readonly addRuleToNewGroups?: boolean | undefined;
    readonly autoSelectField?: boolean | undefined;
    readonly autoSelectOperator?: boolean | undefined;
    readonly fieldSort?: 'asc' | 'desc' | null | undefined;
    readonly matchCase?: boolean | undefined;
    readonly summary?: boolean | undefined;
    readonly fieldPicker?: 'list' | 'tree' | undefined;
    readonly pathSeparator?: string | undefined;
    readonly validation?: boolean | undefined;
    readonly readOnly?: boolean | undefined;
    readonly disabled?: boolean | undefined;
    readonly reorderable?: boolean | undefined;
    readonly onDragStart?: ((event: QueryBuilderDragEvent) => void) | undefined;
    readonly onDrag?: ((event: QueryBuilderDragEvent) => void) | undefined;
    readonly onDrop?: ((event: QueryBuilderDropEvent) => void) | undefined;
    readonly renderRule?: ((ctx: QueryRuleRenderContext) => ReactNode) | undefined;
    readonly renderGroupHeader?: ((ctx: QueryGroupHeaderContext) => ReactNode) | undefined;
    readonly editorProps?: QueryBuilderEditorProps | undefined;
    readonly localeText?: Partial<QueryBuilderLocaleText> | undefined;
    readonly locale?: string | undefined;
    readonly name?: string | undefined;
    readonly form?: string | undefined;
    readonly id?: string | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly 'aria-label'?: string | undefined;
    readonly 'aria-labelledby'?: string | undefined;
    readonly dir?: 'ltr' | 'rtl' | undefined;
    readonly ref?: Ref<QueryBuilderApi> | undefined;
}
```

Members (38):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `fields` | `readonly fields: readonly QueryField[];` |  |  |
| `value` | `readonly value?: QueryGroup \| undefined;` | optional |  |
| `defaultValue` | `readonly defaultValue?: QueryGroup \| undefined;` | optional |  |
| `onValueChange` | `readonly onValueChange?: ((value: QueryGroup, details: QueryBuilderChangeDetails) => void) \| undefined;` | optional |  |
| `onBeforeChange` | `readonly onBeforeChange?: ((event: QueryBuilderBeforeChangeEvent) => void) \| undefined;` | optional |  |
| `operators` | `readonly operators?: readonly QueryOperator[] \| undefined;` | optional | Custom operators. |
| `notCondition` | `readonly notCondition?: boolean \| undefined;` | optional | NOT toggles on groups. Default false. |
| `buttons` | `readonly buttons?: QueryBuilderButtons \| undefined;` | optional |  |
| `maxGroups` | `readonly maxGroups?: number \| undefined;` | optional | Maximum group nesting levels, the root included. Default 5. |
| `addRuleToNewGroups` | `readonly addRuleToNewGroups?: boolean \| undefined;` | optional | A new group starts with one rule. Default true. |
| `autoSelectField` | `readonly autoSelectField?: boolean \| undefined;` | optional | A new rule starts with the first field. Default false. |
| `autoSelectOperator` | `readonly autoSelectOperator?: boolean \| undefined;` | optional | A rule gets its field's first operator when the field is picked. Default true. |
| `fieldSort` | `readonly fieldSort?: 'asc' \| 'desc' \| null \| undefined;` | optional | Field list order. Default `null` (as given). |
| `matchCase` | `readonly matchCase?: boolean \| undefined;` | optional | Written to every condition (`matchCase`). |
| `summary` | `readonly summary?: boolean \| undefined;` | optional | Read-only sentence view with an Edit button. |
| `fieldPicker` | `readonly fieldPicker?: 'list' \| 'tree' \| undefined;` | optional | Field picker: `'list'` (default) is a `Select` grouped by `field.category`; `'tree'` is a `TreeSelect` with categories and nested `field.fields` as parents (a lazy chunk). |
| `pathSeparator` | `readonly pathSeparator?: string \| undefined;` | optional | Separator of nested field paths. Default `'.'`. |
| `validation` | `readonly validation?: boolean \| undefined;` | optional | Show errors of incomplete rules and field rules. |
| `readOnly` | `readonly readOnly?: boolean \| undefined;` | optional |  |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional |  |
| `reorderable` | `readonly reorderable?: boolean \| undefined;` | optional | Drag reorder with handles and keyboard move commands (Alt+ArrowUp / Alt+ArrowDown on a handle). |
| `onDragStart` | `readonly onDragStart?: ((event: QueryBuilderDragEvent) => void) \| undefined;` | optional |  |
| `onDrag` | `readonly onDrag?: ((event: QueryBuilderDragEvent) => void) \| undefined;` | optional | Once per frame while dragging. |
| `onDrop` | `readonly onDrop?: ((event: QueryBuilderDropEvent) => void) \| undefined;` | optional |  |
| `renderRule` | `readonly renderRule?: ((ctx: QueryRuleRenderContext) => ReactNode) \| undefined;` | optional |  |
| `renderGroupHeader` | `readonly renderGroupHeader?: ((ctx: QueryGroupHeaderContext) => ReactNode) \| undefined;` | optional |  |
| `editorProps` | `readonly editorProps?: QueryBuilderEditorProps \| undefined;` | optional |  |
| `localeText` | `readonly localeText?: Partial<QueryBuilderLocaleText> \| undefined;` | optional |  |
| `locale` | `readonly locale?: string \| undefined;` | optional | Locale of value formatting (summary) and the editors. Default `'en-US'`. |
| `name` | `readonly name?: string \| undefined;` | optional | Form field name: a hidden input posts the value as JSON. |
| `form` | `readonly form?: string \| undefined;` | optional |  |
| `id` | `readonly id?: string \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string \| undefined;` | optional |  |
| `aria-labelledby` | `readonly 'aria-labelledby'?: string \| undefined;` | optional |  |
| `dir` | `readonly dir?: 'ltr' \| 'rtl' \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<QueryBuilderApi> \| undefined;` | optional |  |

### QueryField

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryField

```ts
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;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  | Field name; with `fields` it is the path segment of the children. |
| `label` | `readonly label?: string \| undefined;` | optional |  |
| `type` | `readonly type?: QueryFieldType \| undefined;` | optional | Default `'string'`. |
| `operators` | `readonly operators?: readonly string[] \| undefined;` | optional | Operators offered (Data Grid filter operator names or custom ones); default per type (`operatorsFor`). |
| `values` | `readonly values?: readonly QueryFieldValue[] \| undefined;` | optional | Fixed values: a Select (or a multiple Select for `in` / `notIn`). |
| `defaultValue` | `readonly defaultValue?: Json \| undefined;` | optional | Value of a new rule on this field. |
| `format` | `readonly format?: string \| FormatOptions \| undefined;` | optional | Display format of values (summary): a Data Grid format (`'N2'`, `'C2'`, `'yMMMd'`, `'dd/MM/yyyy'`) or format options. |
| `step` | `readonly step?: number \| undefined;` | optional | Step of the numeric editor. |
| `validation` | `readonly validation?: FieldValidation \| undefined;` | optional | Rules of the value (the Form rule vocabulary), checked by `validation` / `api.validate()`. |
| `category` | `readonly category?: string \| undefined;` | optional | Group of the field in the field list. |
| `fields` | `readonly fields?: readonly QueryField[] \| undefined;` | optional | Nested fields: paths `parent.child` with `pathSeparator`. A field with children is not selectable itself. |
| `renderValueEditor` | `readonly renderValueEditor?: ((ctx: QueryValueEditorContext) => ReactNode) \| undefined;` | optional | Custom value editor. |

### QueryGroupHeaderContext

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryGroupHeaderContext

```ts
interface QueryGroupHeaderContext {
    readonly group: QueryGroup & {
        readonly id: string;
    };
    readonly depth: number;
    readonly locked: boolean;
    readonly isRoot: boolean;
    readonly controls: ReactNode;
    readonly actions: ReactNode;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `group` | `readonly group: QueryGroup & {     readonly id: string; };` |  |  |
| `depth` | `readonly depth: number;` |  |  |
| `locked` | `readonly locked: boolean;` |  |  |
| `isRoot` | `readonly isRoot: boolean;` |  |  |
| `controls` | `readonly controls: ReactNode;` |  | The default header: connector, NOT toggle, add / remove buttons. |
| `actions` | `readonly actions: ReactNode;` |  | Clone, lock and drag controls. |

### QueryOperator

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryOperator

```ts
interface QueryOperator {
    readonly name: string;
    readonly label?: string | undefined;
    readonly types?: readonly QueryFieldType[] | undefined;
    readonly valueless?: boolean | undefined;
    readonly list?: boolean | undefined;
    readonly evaluate?: ((cellValue: unknown, filterValue: Json, ctx: {
        readonly matchCase: boolean;
        readonly ignoreAccents: boolean;
    }) => boolean) | undefined;
}
```

A custom operator: labels and types here; evaluation through `filterRows` / the Data Grid filter module, SQL / Mongo through the converter hooks.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  |  |
| `label` | `readonly label?: string \| undefined;` | optional |  |
| `types` | `readonly types?: readonly QueryFieldType[] \| undefined;` | optional | Field types that offer it; default every type. |
| `valueless` | `readonly valueless?: boolean \| undefined;` | optional | The operator takes no value. |
| `list` | `readonly list?: boolean \| undefined;` | optional | The value is a list (like `in`). |
| `evaluate` | `readonly evaluate?: ((cellValue: unknown, filterValue: Json, ctx: {     readonly matchCase: boolean;     readonly ignoreAccents: boolean; }) => boolean) \| undefined;` | optional | Row test for `filterRows` (the core custom operator signature). |

### QueryRuleRenderContext

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryRuleRenderContext

```ts
interface QueryRuleRenderContext {
    readonly rule: QueryRule & {
        readonly id: string;
    };
    readonly index: number;
    readonly parentId: string;
    readonly locked: boolean;
    readonly fieldPicker: ReactNode;
    readonly operatorPicker: ReactNode;
    readonly valueEditor: ReactNode;
    readonly actions: ReactNode;
    readonly errors: readonly string[];
    setRule(rule: QueryRule): void;
    remove(): void;
}
```

Members (11):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rule` | `readonly rule: QueryRule & {     readonly id: string; };` |  |  |
| `index` | `readonly index: number;` |  |  |
| `parentId` | `readonly parentId: string;` |  |  |
| `locked` | `readonly locked: boolean;` |  |  |
| `fieldPicker` | `readonly fieldPicker: ReactNode;` |  |  |
| `operatorPicker` | `readonly operatorPicker: ReactNode;` |  |  |
| `valueEditor` | `readonly valueEditor: ReactNode;` |  |  |
| `actions` | `readonly actions: ReactNode;` |  | Remove, clone, lock and drag controls. |
| `errors` | `readonly errors: readonly string[];` |  |  |
| `setRule` | `setRule(rule: QueryRule): void;` |  |  |
| `remove` | `remove(): void;` |  |  |

### QueryValueEditorContext

Kind: interface

Page: https://salmonui.dev/docs/reference/query-builder/QueryValueEditorContext

```ts
interface QueryValueEditorContext {
    readonly rule: QueryRule & {
        readonly id: string;
    };
    readonly field: QueryField | undefined;
    readonly operator: string;
    readonly value: Json | undefined;
    setValue(value: Json | undefined): void;
    readonly label: string;
    readonly invalid: boolean;
    readonly disabled: boolean;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rule` | `readonly rule: QueryRule & {     readonly id: string; };` |  |  |
| `field` | `readonly field: QueryField \| undefined;` |  |  |
| `operator` | `readonly operator: string;` |  |  |
| `value` | `readonly value: Json \| undefined;` |  |  |
| `setValue` | `setValue(value: Json \| undefined): void;` |  | Writes the rule's value. |
| `label` | `readonly label: string;` |  | Accessible name for the editor. |
| `invalid` | `readonly invalid: boolean;` |  |  |
| `disabled` | `readonly disabled: boolean;` |  |  |

## Types

### QueryBuilderAction

Kind: type

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderAction

```ts
type QueryBuilderAction = 'addCondition' | 'addGroup' | 'removeGroup' | 'removeCondition' | 'logic' | 'not' | 'edit' | 'clone' | 'lock' | 'move' | 'set' | 'reset';
```

### QueryBuilderLocaleKey

Kind: type

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderLocaleKey

```ts
type QueryBuilderLocaleKey = keyof typeof QUERY_BUILDER_DEFAULT_LOCALE_TEXT;
```

### QueryBuilderLocaleText

Kind: type

Page: https://salmonui.dev/docs/reference/query-builder/QueryBuilderLocaleText

```ts
type QueryBuilderLocaleText = {
    readonly [K in QueryBuilderLocaleKey]: string;
} & {
    readonly [key: string]: string;
};
```

Every key, plus `operator<Name>` labels of custom operators and `validation<Rule>` messages.

Members (51):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `addCondition` | `addCondition: string;` | inherited |  |
| `addGroup` | `addGroup: string;` | inherited |  |
| `and` | `and: string;` | inherited |  |
| `cloneGroup` | `cloneGroup: string;` | inherited |  |
| `cloneRule` | `cloneRule: string;` | inherited |  |
| `done` | `done: string;` | inherited |  |
| `edit` | `edit: string;` | inherited |  |
| `false` | `false: string;` | inherited |  |
| `filterField` | `filterField: string;` | inherited |  |
| `filterFrom` | `filterFrom: string;` | inherited |  |
| `filterNot` | `filterNot: string;` | inherited |  |
| `filterOperator` | `filterOperator: string;` | inherited |  |
| `filterTo` | `filterTo: string;` | inherited |  |
| `filterValue` | `filterValue: string;` | inherited |  |
| `groupLabel` | `groupLabel: string;` | inherited |  |
| `incomplete` | `incomplete: string;` | inherited |  |
| `lock` | `lock: string;` | inherited |  |
| `move` | `move: string;` | inherited |  |
| `moved` | `moved: string;` | inherited |  |
| `operatorBetween` | `operatorBetween: string;` | inherited |  |
| `operatorContains` | `operatorContains: string;` | inherited |  |
| `operatorDoesNotContain` | `operatorDoesNotContain: string;` | inherited |  |
| `operatorDoesNotEndWith` | `operatorDoesNotEndWith: string;` | inherited |  |
| `operatorDoesNotStartWith` | `operatorDoesNotStartWith: string;` | inherited |  |
| `operatorEndsWith` | `operatorEndsWith: string;` | inherited |  |
| `operatorEqual` | `operatorEqual: string;` | inherited |  |
| `operatorGreaterThan` | `operatorGreaterThan: string;` | inherited |  |
| `operatorGreaterThanOrEqual` | `operatorGreaterThanOrEqual: string;` | inherited |  |
| `operatorIn` | `operatorIn: string;` | inherited |  |
| `operatorIsEmpty` | `operatorIsEmpty: string;` | inherited |  |
| `operatorIsNotEmpty` | `operatorIsNotEmpty: string;` | inherited |  |
| `operatorIsNotNull` | `operatorIsNotNull: string;` | inherited |  |
| `operatorIsNull` | `operatorIsNull: string;` | inherited |  |
| `operatorLessThan` | `operatorLessThan: string;` | inherited |  |
| `operatorLessThanOrEqual` | `operatorLessThanOrEqual: string;` | inherited |  |
| `operatorLike` | `operatorLike: string;` | inherited |  |
| `operatorNotEqual` | `operatorNotEqual: string;` | inherited |  |
| `operatorNotIn` | `operatorNotIn: string;` | inherited |  |
| `operatorStartsWith` | `operatorStartsWith: string;` | inherited |  |
| `operatorWildcard` | `operatorWildcard: string;` | inherited |  |
| `or` | `or: string;` | inherited |  |
| `queryBuilder` | `queryBuilder: string;` | inherited |  |
| `removeCondition` | `removeCondition: string;` | inherited |  |
| `removeGroup` | `removeGroup: string;` | inherited |  |
| `ruleLabel` | `ruleLabel: string;` | inherited |  |
| `selectField` | `selectField: string;` | inherited |  |
| `selectOperator` | `selectOperator: string;` | inherited |  |
| `summaryEmpty` | `summaryEmpty: string;` | inherited |  |
| `summaryRule` | `summaryRule: string;` | inherited |  |
| `true` | `true: string;` | inherited |  |
| `unlock` | `unlock: string;` | inherited |  |

### QueryFieldType

Kind: type

Page: https://salmonui.dev/docs/reference/query-builder/QueryFieldType

```ts
type QueryFieldType = 'string' | 'number' | 'date' | 'datetime' | 'boolean';
```

Value type of a field; selects the default operators and value editor.

### QueryFieldValue

Kind: type

Page: https://salmonui.dev/docs/reference/query-builder/QueryFieldValue

```ts
type QueryFieldValue = string | number | boolean | {
    readonly value: string | number | boolean;
    readonly label: string;
};
```

A fixed value of a field (`values`): a primitive, or a value with its label.

## Constants

### QUERY_BUILDER_DEFAULT_LOCALE_TEXT

Kind: const

Page: https://salmonui.dev/docs/reference/query-builder/QUERY_BUILDER_DEFAULT_LOCALE_TEXT

```ts
const QUERY_BUILDER_DEFAULT_LOCALE_TEXT: Readonly<{
    and: "And";
    or: "Or";
    filterNot: "Not";
    addCondition: "Add condition";
    addGroup: "Add group";
    removeCondition: "Remove condition";
    removeGroup: "Remove group";
    filterField: "Field";
    filterOperator: "Operator";
    filterValue: "Value";
    filterFrom: "From";
    filterTo: "To";
    true: "true";
    false: "false";
    queryBuilder: "Query builder";
    groupLabel: "{connector} group";
    ruleLabel: "Condition {index}";
    cloneRule: "Clone condition";
    cloneGroup: "Clone group";
    lock: "Lock";
    unlock: "Unlock";
    move: "Move";
    moved: "Moved to position {position}";
    edit: "Edit";
    done: "Done";
    selectField: "Select a field";
    selectOperator: "Select an operator";
    summaryEmpty: "No conditions";
    summaryRule: "{field} {operator} {value}";
    incomplete: "Complete this condition";
    operatorEqual: "Equal";
    operatorNotEqual: "Not equal";
    operatorContains: "Contains";
    operatorDoesNotContain: "Does not contain";
    operatorStartsWith: "Starts with";
    operatorDoesNotStartWith: "Does not start with";
    operatorEndsWith: "Ends with";
    operatorDoesNotEndWith: "Does not end with";
    operatorIsEmpty: "Empty";
    operatorIsNotEmpty: "Not empty";
    operatorIsNull: "Null";
    operatorIsNotNull: "Not null";
    operatorGreaterThan: "Greater than";
    operatorGreaterThanOrEqual: "Greater than or equal";
    operatorLessThan: "Less than";
    operatorLessThanOrEqual: "Less than or equal";
    operatorBetween: "Between";
    operatorIn: "In";
    operatorNotIn: "Not in";
    operatorLike: "Like";
    operatorWildcard: "Wildcard";
}>;
```

## Re-exported entry points

- [@salmonui/query-builder/sql](https://salmonui.dev/docs/reference/query-builder/sql.md): 4 symbols: 2 interfaces and 2 types
  `Json`, `QueryGroup`, `QueryNode`, `QueryRule`
