@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
107 lines (95 loc) • 6.35 kB
TypeScript
/**
* A convenience module for importing [Element](https://developers.arcgis.com/javascript/latest/references/core/form/elements/Element/) classes
* when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/get-started/#typescript).
* For example, rather than importing form elements one at a time like this:
*
* ```js
* 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";
* ```
*
* You can use this module to import them on a single line:
*
* ```js
* import { FieldElement, GroupElement, RelationshipElement, TextElement } from "@arcgis/core/form/elements.js";
* ```
*
* This module also allows you to implement [type guards](https://basarat.gitbook.io/typescript/type-system/typeguard)
* on the form elements, making your code smarter.
*
* ```js
* 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`
* console.log("The value is not a valid form element.")
* }
* }
* ```
*
* @since 4.16
* @see [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/)
* @see [FieldElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/)
* @see [GroupElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/GroupElement/)
* @see [RelationshipElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/RelationshipElement/)
* @see [TextElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/TextElement/)
* @see [UtilityNetworkAssociationsElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/UtilityNetworkAssociationsElement/)
*/
import type AttachmentElementClass from "./elements/AttachmentElement.js";
import type FieldElementClass from "./elements/FieldElement.js";
import type GroupElementClass from "./elements/GroupElement.js";
import type RelationshipElementClass from "./elements/RelationshipElement.js";
import type TextElementClass from "./elements/TextElement.js";
import type UtilityNetworkAssociationsElementClass from "./elements/UtilityNetworkAssociationsElement.js";
/** `FieldElement` defines how a feature layer's field participates in the form. */
export const FieldElement: typeof FieldElementClass;
/** `FieldElement` defines how a feature layer's field participates in the form. */
export type FieldElement = FieldElementClass;
/**
* `GroupElement` defines a container that holds a set of form elements
* that can be expanded, collapsed, or displayed together.
*/
export const GroupElement: typeof GroupElementClass;
/**
* `GroupElement` defines a container that holds a set of form elements
* that can be expanded, collapsed, or displayed together.
*/
export type GroupElement = GroupElementClass;
/** `RelationshipElement` defines how a relationship between [feature layers](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) and [Map.tables](https://developers.arcgis.com/javascript/latest/references/core/Map/#tables) participates in the [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/). */
export const RelationshipElement: typeof RelationshipElementClass;
/** `RelationshipElement` defines how a relationship between [feature layers](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) and [Map.tables](https://developers.arcgis.com/javascript/latest/references/core/Map/#tables) participates in the [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/). */
export type RelationshipElement = RelationshipElementClass;
/** `TextElement` form element is used to define descriptive text as an element within a layer or [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/) and can be used to aid those entering or updating information. */
export const TextElement: typeof TextElementClass;
/** `TextElement` form element is used to define descriptive text as an element within a layer or [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/) [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/) and can be used to aid those entering or updating information. */
export type TextElement = TextElementClass;
/**
* `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.
*
* > [!CAUTION]
* >
* > The `attachment` element is not yet fully supported within the SDK and is not intended for use in development. Support will be added in an upcoming release.
*
* @internal
*/
export const AttachmentElement: typeof AttachmentElementClass;
/**
* `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.
*
* > [!CAUTION]
* >
* > The `attachment` element is not yet fully supported within the SDK and is not intended for use in development. Support will be added in an upcoming release.
*
* @internal
*/
export type AttachmentElement = AttachmentElementClass;
/** `UtilityNetworkAssociationsElement` defines how utility network associations can participate in the form. */
export const UtilityNetworkAssociationsElement: typeof UtilityNetworkAssociationsElementClass;
/** `UtilityNetworkAssociationsElement` defines how utility network associations can participate in the form. */
export type UtilityNetworkAssociationsElement = UtilityNetworkAssociationsElementClass;