UNPKG

@arcgis/coding-components

Version:
85 lines (84 loc) 3.15 kB
/// <reference path="../../index.d.ts" /> import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { IPredefinedProfile, PredefinedProfile } from "../types.js"; import type { editor } from "monaco-editor"; import type { T9nMeta } from "@arcgis/lumina/controllers"; /** * The SQL Expression Editor provides a familiar code editor experience for writing your own SQL expressions. * It supports syntax highlighting, code completion, and validation, allowing users to write SQL expressions using the * [standardized SQL functions](https://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm) supported by ArcGIS. * * @internal */ export abstract class ArcgisSqlExpressionEditor extends LitElement { /** * If true, field aliases are hidden in the fields panel so only field names are displayed. * Validation, completion, and inserted field snippets are unchanged. * * @default false * @example * ```html * <arcgis-sql-expression-editor hideDescriptionsInFieldsPanel></arcgis-sql-expression-editor> * ``` */ accessor hideDescriptionsInFieldsPanel: boolean; /** * If true, it will hide the side actions bar. The editor will be in a minimalistic UX. * * @default false * @example * ```html * <arcgis-sql-expression-editor hideSideBar></arcgis-sql-expression-editor> * ``` */ accessor hideSideBar: boolean; /** * Replace localized message strings with your own strings. * * **Note**: Individual message keys may change between releases. */ accessor messageOverrides: { fields?: string | undefined; functions?: string | undefined; profileempty?: string | undefined; }; /** @internal */ protected messages: Partial<{ fields: string; functions: string; profileempty: string; }> & T9nMeta<{ fields: string; functions: string; profileempty: string; }>; /** * The profile to use for the editor. The profile defines the variables and functions that are available to the editor. * * @example * ```jsx * <arcgis-sql-expression-editor profile={id: "field-calculation", definitions: { $layer: layer }}></arcgis-sql-expression-editor> * ``` */ accessor profile: IPredefinedProfile | PredefinedProfile | undefined; /** * The sql expression script. Use this property to define or update the script. * * @default "" * @example * ```html * <arcgis-sql-expression-editor script="CAST(2.45 AS INTEGER)"></arcgis-sql-expression-editor> * ``` */ accessor script: string; /** Set the focus on the element. */ setFocus(): Promise<void>; /** Emitted when the diagnostics collection has changed. */ readonly arcgisDiagnosticsChange: import("@arcgis/lumina").TargetedEvent<this, editor.IMarkerData[]>; /** Emitted when the script string has changed. */ readonly arcgisScriptChange: import("@arcgis/lumina").TargetedEvent<this, string>; readonly "@eventTypes": { arcgisDiagnosticsChange: ArcgisSqlExpressionEditor["arcgisDiagnosticsChange"]["detail"]; arcgisScriptChange: ArcgisSqlExpressionEditor["arcgisScriptChange"]["detail"]; }; }