UNPKG

@arcgis/map-components

Version:
149 lines (148 loc) 6.55 kB
/// <reference path="../../index.d.ts" /> import type Graphic from "@arcgis/core/Graphic.js"; import type Collection from "@arcgis/core/core/Collection.js"; import type AttachmentInfo from "@arcgis/core/rest/query/support/AttachmentInfo.js"; import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { ArcgisReferenceElement, IconName } from "../types.js"; import type { AttachmentsCapabilities, AttachmentsDisplay } from "@arcgis/core/widgets/Attachments/types.js"; import type { Icon } from "@esri/calcite-components/components/calcite-icon"; import type { AttachmentsViewModelState } from "@arcgis/core/widgets/Attachments/AttachmentsViewModel.js"; /** @internal */ export abstract class ArcgisAttachments extends LitElement { /** * A collection of [AttachmentInfo](https://developers.arcgis.com/javascript/latest/references/core/rest/query/support/AttachmentInfo/) defined on a feature. * * @see [ArcGIS REST API - Attachment Infos (Feature Service)](https://developers.arcgis.com/rest/services-reference/attachment-infos-feature-service-.htm) */ get attachmentInfos(): Collection<AttachmentInfo>; /** An array of strings used to identify attachment(s). When attachments are displayed, this property is used to query attachments using an exact match on the keywords provided. */ accessor attachmentKeywords: Array<string> | null | undefined; /** An array of strings representing MIME types. When attachments are displayed, this property is used to query attachments based on MIME type. Valid values: application, audio, image, model, text, and video. */ accessor attachmentTypes: Array<"image" | "model" | "text" | "video" | "application" | "audio"> | null | undefined; /** * If true, the component will not be destroyed automatically when it is * disconnected from the document. This is useful when you want to move the * component to a different place on the page, or temporarily hide it. If this * is set, make sure to call the [destroy()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-attachments/#destroy) method when you are done to * prevent memory leaks. * * @default false */ accessor autoDestroyDisabled: boolean; /** * The capabilities needed for the attachments component. * * @since 4.27 */ accessor capabilities: AttachmentsCapabilities; /** * String indicating how to [display](https://developers.arcgis.com/javascript/latest/references/core/widgets/Attachments/#displayType) the attachments. * * | Value | Description | * | ------ | ----------- | * | auto | Default value. If a feature layer's capabilities supports [resizing attachments](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#capabilities), the popup will display attachments in `preview` mode.| * | preview | Shows a thumbnail image of the attachment.| * | list | Shows a list of attachment links. | * * @default "auto" */ accessor displayType: AttachmentsDisplay; /** The graphic for the attachments. */ accessor graphic: Graphic | null | undefined; /** * Indicates whether to hide the `Add` button which prompts the dialog to add a new attachment. * * @default false */ accessor hideAddButton: boolean | undefined; /** * Indicates whether to hide the `add` button after selecting the attachment to add.. * * @default false */ accessor hideAddSubmitButton: boolean | undefined; /** * Indicates whether to hide the `cancel` button after selecting the attachment to add. * * @default false */ accessor hideCancelAddButton: boolean | undefined; /** * Indicates whether to hide the `cancel` button after selecting an attachment to update an existing attachment. * * @default false */ accessor hideCancelUpdateButton: boolean | undefined; /** * Indicates whether to hide the `delete` button to delete an existing attachment. * * @default false */ accessor hideDeleteButton: boolean | undefined; /** * Indicates whether to hide an error message if adding or updating an attachment results in errors. * * @default false */ accessor hideErrorMessage: boolean | undefined; /** * Indicates whether to hide a progress bar when adding an attachment. * * @default false */ accessor hideProgressBar: boolean | undefined; /** * Indicates whether to hide an `update` button to allow updating on existing attachments. * * @default false */ accessor hideUpdateButton: boolean | undefined; /** * Icon which represents the component. * Typically used when the component is controlled by another component (e.g. by the Expand component). * * @default "attachment" * @since 4.27 * @see [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/) */ get icon(): Icon["icon"]; set icon(value: IconName); /** * The component's default label. * * @since 4.11 */ accessor label: string | null | undefined; /** * By assigning the `id` attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene. * * @see [Associate components with a Map or Scene component](https://developers.arcgis.com/javascript/latest/programming-patterns/#associate-components-with-a-map-or-scene-component) */ accessor referenceElement: ArcgisReferenceElement | string | undefined; /** * The current state of the component. * * @default "ready" */ get state(): AttachmentsViewModelState; /** * Indicates whether there is currently an attachment being added, updated or deleted. * * @default false * @since 4.27 */ get submitting(): boolean; /** Permanently destroy the component. */ destroy(): Promise<void>; "@setterTypes": { icon?: IconName; }; /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "submitting" | "state" | "attachmentInfos"; }>; /** Emitted when the component associated with a map or scene view is ready to be interacted with. */ readonly arcgisReady: import("@arcgis/lumina").TargetedEvent<this, void>; readonly "@eventTypes": { arcgisPropertyChange: ArcgisAttachments["arcgisPropertyChange"]["detail"]; arcgisReady: ArcgisAttachments["arcgisReady"]["detail"]; }; }