FeatureAttachments.js 2.1 KB

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.24/esri/copyright.txt for details.
  4. */
  5. import{_ as e}from"../../chunks/tslib.es6.js";import{watch as t,initial as s}from"../../core/reactiveUtils.js";import{aliasOf as i}from"../../core/accessorSupport/decorators/aliasOf.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import a from"../Attachments.js";import p from"../Widget.js";import n from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import l from"./support/FeatureElementInfo.js";import"../support/widgetUtils.js";import{tsx as c}from"../support/jsxFactory.js";const d={base:"esri-feature-attachments"};let h=class extends p{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new a,this.description=null,this.displayType=null,this.graphic=null,this.headingLevel=2,this.title=null,this.viewModel=new n}initialize(){this._featureElementInfo=new l,this.own([t((()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),s),t((()=>this.viewModel?.graphic),(e=>this.attachmentsWidget.graphic=e),s)])}destroy(){this.attachmentsWidget.destroy(),this._featureElementInfo.destroy()}render(){const{attachmentsWidget:e}=this;return c("div",{class:d.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:s}=this;this._featureElementInfo.set({description:e,title:t,headingLevel:s})}};e([o({readOnly:!0})],h.prototype,"attachmentsWidget",void 0),e([i("viewModel.description")],h.prototype,"description",void 0),e([i("attachmentsWidget.displayType")],h.prototype,"displayType",void 0),e([i("viewModel.graphic")],h.prototype,"graphic",void 0),e([o()],h.prototype,"headingLevel",void 0),e([i("viewModel.title")],h.prototype,"title",void 0),e([o({type:n})],h.prototype,"viewModel",void 0),h=e([r("esri.widgets.Feature.FeatureAttachments")],h);const m=h;export{m as default};