@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.34 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{_ as e}from"../../chunks/tslib.es6.js";import{watch as t,initial as i}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Attachments.js";import a from"../Widget.js";import n from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import p from"./support/FeatureElementInfo.js";import"../support/widgetUtils.js";import{tsx as l}from"../support/jsxFactory.js";const d={base:"esri-feature-attachments"};let h=class extends a{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new o,this.headingLevel=2,this.viewModel=new n}initialize(){this._featureElementInfo=new p,this.addHandles([t((()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),i),t((()=>this.viewModel),(e=>this.attachmentsWidget.viewModel=e),i)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return l("div",{class:d.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};e([s({readOnly:!0})],h.prototype,"attachmentsWidget",void 0),e([s()],h.prototype,"description",null),e([s()],h.prototype,"displayType",null),e([s()],h.prototype,"graphic",null),e([s()],h.prototype,"headingLevel",void 0),e([s()],h.prototype,"title",null),e([s({type:n})],h.prototype,"viewModel",void 0),h=e([r("esri.widgets.Feature.FeatureAttachments")],h);const c=h;export{c as default};