UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

111 lines (109 loc) 5.51 kB
import type FieldElement from "../../form/elements/FieldElement.js"; import type Field from "../../layers/support/Field.js"; import type EditableInput from "./EditableInput.js"; import type GroupInput from "./GroupInput.js"; import type { InputType } from "../../form/elements/inputs/Input.js"; import type { FieldValue } from "../../layers/support/fieldUtils.js"; import type { DomainUnion } from "../../layers/support/types.js"; import type { EditableInputProperties } from "./EditableInput.js"; import type { FieldInputDataTypes } from "../support/forms/types.js"; export interface FieldInputProperties extends EditableInputProperties, Partial<Pick<FieldInput, "value">> { /** Indicates whether the field is required. If the field is not editable, this property returns `false`. */ required?: boolean | null; } /** * This is a read-only support class that represents a field's input. * It helps provide a consistent API for the different types input * used by the [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) widget. * The values are computed internally by the * [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/FeatureFormViewModel/). * * @since 4.27 * @see [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) * @see [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/FeatureFormViewModel/) * @see [GroupInput](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/GroupInput/) */ export default class FieldInput extends EditableInput<FieldElement | null | undefined> { constructor(properties?: FieldInputProperties); /** * The type of data displayed by the field input. Possible values are listed below. * * Value | Description * ------|------------ * number | Input represents a number. * text | Input represents text. * date | Input represents a date. * unsupported | The field represents an unsupported value. A `blob` field type is an example of this. */ get dataType(): FieldInputDataTypes; /** The input value's domain. This is used to constrain the allowable values of the layer. */ get domain(): DomainUnion | null | undefined; /** Indicates if the field is editable. */ get editable(): boolean; /** If the input field's value is invalid, this property returns a validation error code. Otherwise, it is `null`. */ get error(): string | null | undefined; /** The associated field. */ get field(): Field; /** The group containing the field input. */ get group(): GroupInput | null | undefined; /** * A hint for the field's value. This is a temporary placeholder * inputs in either [TextAreaInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/TextAreaInput/) * or [TextBoxInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/TextBoxInput/). */ get hint(): string | null | undefined; /** * Indicates whether date information is included for date inputs. * * @default true */ get includeDate(): boolean; /** * Indicates whether time information is included for date inputs. * * @default true */ get includeTime(): boolean; /** * Indicates whether timestamp information is included for date inputs. * * @default false * @since 4.28 */ get includeTimeOffset(): boolean; /** * The type of editor used when working with `string` fields. * Possible values are in the table below. * * Value | Description * ------|------------ * text-box | An HTML textbox used to capture input. * text-area | An HTML textarea used to capture input. * * @default "text-box" */ get inputType(): InputType | null | undefined; /** The field's label. */ get label(): string; /** Restricts the input length. */ get maxLength(): number; /** Restricts the input length. */ get minLength(): number; /** The associated field name. */ get name(): string; /** Indicates whether the field is required. If the field is not editable, this property returns `false`. */ get required(): boolean; set required(value: boolean | null | undefined); /** Indicates if the field's value can be submitted without introducing data validation issues. */ get submittable(): boolean; /** The type of input. */ get type(): "field"; /** Indicates if the field is updating. This is applicable if the field has a value defined for [FieldElement.valueExpression](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/#valueExpression) or [FieldElement.editableExpression](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/#editableExpression). The property returns `true` whenever one or both of these expressions are processing. If the field belongs to a form configured with preserveFieldValuesWhenHidden set to false, this will also be true when [FieldElement.visibilityExpression](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/#visibilityExpression) is processing. */ get updating(): boolean; /** Indicates if the input value is valid. */ get valid(): boolean; /** The field input's value. */ accessor value: FieldValue; /** Indicates if the field is visible. */ get visible(): boolean; }