Skip to content

Columns Component

The FlyqlColumns component provides a dedicated input for column expressions — selecting, filtering, and applying transformers to columns.

<script setup>
import { ref } from 'vue'
import { FlyqlColumns, ColumnSchema } from 'flyql-vue'
const expr = ref('')
const columns = ColumnSchema.fromPlainObject({
status: { type: 'number', suggest: true },
level: { type: 'enum', suggest: true },
service: { type: 'string', suggest: true },
host: { type: 'string', suggest: true },
})
function onParsed(parsed) {
console.log('Parsed columns:', parsed)
}
</script>
<template>
<FlyqlColumns
v-model="expr"
:columns="columns"
:capabilities="{ transformers: true }"
placeholder="message, status|upper, host as h"
@update:parsed="onParsed"
/>
</template>
PropTypeDefaultDescription
modelValueString''Expression text (v-model)
columnsObject{}Column schema
capabilitiesObjectnullParser capabilities (e.g., { transformers: true })
registryTransformerRegistrynullCustom transformer registry (see Custom Transformers)
rendererRegistryRendererRegistrynullCustom renderer registry (see Custom Renderers). When null the editor disables renderer parsing entirely; supplying any registry (even an empty one) enables the post-alias | grammar.
onKeyDiscoveryFunctionnullRemote key discovery callback
placeholderString''Placeholder text
autofocusBooleanfalseAuto-focus on mount
debugBooleanfalseDebug logging
darkBooleanfalseEnable dark theme (see theming)
labelString''Text shown inside the field, to the left of the query
iconString | Object | Function | BooleannullIcon shown before the label: a string renders as text, a component renders as-is, false removes it
multilineBooleantrueAllow multi-line input. When false, newlines are collapsed to spaces and the field stays one line
hasClearBooleanfalseShow a clear button at the trailing edge; it appears only when the field has a value
clearButtonLabelString'Clear'Accessible name of the clear button
panelContainerString | Object'body'Where to portal the suggestion panel: a selector or an element. Defaults to body
<script setup>
import { FlyqlColumns } from 'flyql-vue'
import { Renderer, RendererRegistry, ArgSpec } from 'flyql/renderers'
import { Type } from 'flyql'
class HrefRenderer extends Renderer {
get name() { return 'href' }
get argSchema() { return [new ArgSpec(Type.String, true)] }
}
const rendererRegistry = new RendererRegistry()
rendererRegistry.register(new HrefRenderer())
</script>
<template>
<FlyqlColumns v-model="query" :columns="schema" :renderer-registry="rendererRegistry" />
</template>

label and icon share the slot on the left of the field, ahead of the query text. Clicking either focuses the input, and an overlong label is truncated with an ellipsis at half the field width instead of squeezing the input. A text label also becomes the input’s accessible name, replacing the component’s default aria-label.

<template>
<FlyqlColumns v-model="expr" :columns="columns" label="Filter" />
<FlyqlColumns v-model="expr" :columns="columns" icon="🔎" />
<FlyqlColumns v-model="expr" :columns="columns" :icon="MyIcon" />
<FlyqlColumns v-model="expr" :columns="columns" :icon="false" label="Filter" />
</template>

The icon and label slots take precedence over the props when you need richer content:

<template>
<FlyqlColumns v-model="expr" :columns="columns">
<template #icon><MyIcon /></template>
<template #label><strong>Filter</strong></template>
</FlyqlColumns>
</template>
EventPayloadDescription
update:modelValuestringExpression text changed (v-model)
update:parsedParsedColumn[]Parsed column array updated
submitUser pressed Ctrl/Cmd+Enter
parse-errorstringParse error message
focusComponent gained focus
blurComponent lost focus
MethodReturnsDescription
focus()Focus the input
blur()Blur the input
getQueryStatus(){ valid: boolean, message: string }Validate the expression
getParsedColumns()ParsedColumn[]Get parsed column array

Column expressions use a comma-separated format with optional transformers and aliases:

message, status|upper, host as h, metadata.labels.env
PartSyntaxExample
Columnnamemessage
Transformername|transformerstatus|upper
Transformer with argsname|transformer(arg)name|truncate(50)
Aliasname as aliashost as h
Nestedparent.childmetadata.labels.env
Chained transformersname|t1|t2msg|lower|truncate(100)