import { FieldElement, GroupElement, RelationshipElement, TextElement, AttachmentElement } from "@arcgis/core/form/elements.js";
Since
ArcGIS Maps SDK for JavaScript 4.16

A convenience module for importing Element classes when developing with TypeScript. For example, rather than importing form elements one at a time like this:

import FieldElement from "@arcgis/core/form/elements/FieldElement.js";
import GroupElement from "@arcgis/core/form/elements/GroupElement.js";
import RelationshipElement from "@arcgis/core/form/elements/RelationshipElement.js";
import TextElement from "@arcgis/core/form/elements/TextElement.js";
import AttachmentElement from "@arcgis/core/form/elements/AttachmentElement.js";

You can use this module to import them on a single line:

import { FieldElement, GroupElement, RelationshipElement, TextElement, AttachmentElement } from "@arcgis/core/form/elements.js";

This module also allows you to implement type guards on the form elements, making your code smarter.

import { Element } from "@arcgis/core/form/elements.js";
function logFormElement(element: Element): void {
if (element.type === "field") {
console.log("Form element type is field");
}
else {
// The compiler knows the content element must be `field | group | relationship | attachment | text | utilityNetworkAssociations`
console.log("The value is not a valid form element.")
}
}
See also

Variables

FieldElement

deprecated Variable

FieldElement defines how a feature layer's field participates in the form.

Type
typeof FieldElementClass

GroupElement

deprecated Variable

GroupElement defines a container that holds a set of form elements that can be expanded, collapsed, or displayed together.

Type
typeof GroupElementClass

RelationshipElement

deprecated Variable

RelationshipElement defines how a relationship between feature layers and Map.tables participates in the FeatureForm.

Type
typeof RelationshipElementClass

TextElement

deprecated Variable

TextElement form element is used to define descriptive text as an element within a layer or FeatureForm FormTemplate and can be used to aid those entering or updating information.

Type
typeof TextElementClass

AttachmentElement

deprecated Variable
Since
ArcGIS Maps SDK for JavaScript 5.1

AttachmentElement defines how one or more attachments can participate in the form. When present in the form, the user has the ability to upload an attachment specific to the form element.

Type
typeof AttachmentElementClass

UtilityNetworkAssociationsElement

deprecated Variable

UtilityNetworkAssociationsElement defines how utility network associations can participate in the form.

Type
typeof UtilityNetworkAssociationsElementClass

Type definitions

FieldElement

deprecated Type definition

FieldElement defines how a feature layer's field participates in the form.

Supertypes
default

GroupElement

deprecated Type definition

GroupElement defines a container that holds a set of form elements that can be expanded, collapsed, or displayed together.

Supertypes
default

RelationshipElement

deprecated Type definition

RelationshipElement defines how a relationship between feature layers and Map.tables participates in the FeatureForm.

Supertypes
default

TextElement

deprecated Type definition

TextElement form element is used to define descriptive text as an element within a layer or FeatureForm FormTemplate and can be used to aid those entering or updating information.

Supertypes
default

AttachmentElement

deprecated Type definition
Since
ArcGIS Maps SDK for JavaScript 5.1

AttachmentElement defines how one or more attachments can participate in the form. When present in the form, the user has the ability to upload an attachment specific to the form element.

Supertypes
default

UtilityNetworkAssociationsElement

deprecated Type definition

UtilityNetworkAssociationsElement defines how utility network associations can participate in the form.

Supertypes
default