UNPKG

@arcgis/core

Version:

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

84 lines (82 loc) 4.2 kB
import type Graphic from "../../../Graphic.js"; import type Field from "../../../layers/support/Field.js"; import type EditableInput from "./EditableInput.js"; import type GroupInput from "./GroupInput.js"; import type { FieldValue } from "../../../layers/support/fieldUtils.js"; import type { DomainUnion as Domain } from "../../../layers/support/types.js"; import type { EditableInputProperties } from "./EditableInput.js"; import type { FieldInputDataTypes } from "../../support/forms/types.js"; export interface FieldInputProperties extends EditableInputProperties {} /** * This is a read-only support class that represents a [field element](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) in a [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/). * * @since 4.33 * @see [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/) * @see [BatchAttributeFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/) * @see [BatchFormInputs](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/inputs/BatchFormInputs/) */ export default class FieldInput extends EditableInput<any> { 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; /** * Returns an array of distinct values of the field input. If all features have the same value, this property returns an array with a single element containing that value. * If the features have different values, this property returns an array containing all distinct values of the field across the features. */ get distinctValues(): FieldValue[]; /** The input value's domain. This is used to constrain the allowable values of the layer. */ get domain(): Domain | null | undefined; /** Indicates if the field is editable. The field must be editable for all layers associated with the input for this property to be true. */ get editable(): boolean; /** Indicates whether all features have the same value for this field. */ get featuresHaveSameValue(): boolean; /** The associated field. */ get field(): Field; /** The field name as defined by the feature layer. */ get fieldName(): string; /** The group containing the field input. */ get group(): GroupInput | null; /** Indicates whether time information is included for date and time inputs. */ get includeTime(): boolean; /** * Indicates whether timestamp information is included for date inputs. This * property is always `false` for field types other than `timestamp-offset.` * * @default false */ get includeTimeOffset(): boolean; /** An array of features that do not have a valid value for this field. */ get invalidFeatures(): Graphic[]; /** The input's label. */ get label(): string; /** The maximum length of the input. If no length is specified, the value is `-1`. */ get maxLength(): number; /** The minimum length of the input. If no length is specified, the value is `-1`. */ get minLength(): number; /** Indicates whether the field is required. This property will be true if it is required for any associated layers of the input. */ get required(): boolean; /** The type of input. */ get type(): "field"; /** * Indicates whether the user has changed the value of this field. * * @default false */ get userHasChangedValue(): boolean; /** Indicates whether the field has any validation errors. Evaluates to `true` only if the value of this field is valid for all features. */ get valid(): boolean; /** * @param value * @internal */ setValueFromUser(value: FieldValue): Promise<void>; }