@arcgis/map-components
Version:
ArcGIS Map Components
4 lines • 2.55 kB
JavaScript
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
v4.33.13 */
import b from"./IFIBUTSR.js";import{a as _}from"./VGX5A5BD.js";import{a as l}from"./F4DDZCNF.js";import"./4TYQGSWG.js";import"./JDUE7Q24.js";import{P as o,Q as a,U as n,j as r,k as t}from"./HX57SHRL.js";export default $arcgis.t(([{watch:g},{b:m,c:p,d:d,e:h}])=>{var $=r`.arcgis-print__template-select-container{border:1px solid var(--calcite-color-border-1);cursor:pointer}.arcgis-print__template-select-container .arcgis-print__template-select-error,.arcgis-print__template-select-container .arcgis-print__template-select-arrow{display:flex;align-self:center;margin-right:var(--calcite-spacing-md)}`,s="arcgis-print",i={templateSelectContainer:`${s}__template-select-container`,templateSelectError:`${s}__template-select-error`,templateSelectArrow:`${s}__template-select-arrow`},c=class extends o{constructor(){super(...arguments),this._handles=_("disconnect"),this._templateState="not-loaded"}static{this.properties={_selectedTemplate:16,_templateState:16,viewModel:0,messages:0,showTemplateSelector:0}}static{this.styles=$}loaded(){this.manager.onLifecycle(()=>[g(()=>this.viewModel.templateOptions.id,e=>{this._handles.removeHandles("template-handle"),this._selectedTemplate=e?this.viewModel.getLayoutTemplateById(e)??void 0:void 0,this._handles.addHandles(g(()=>this._selectedTemplate?.state,S=>this._templateState=S??"not-loaded",{initial:!0}),"template-handle")},{initial:!0})])}render(){return t`<calcite-block class=${a(i.templateSelectContainer)} .description=${p(this._selectedTemplate)} .heading=${this._selectedTemplate?d(this._selectedTemplate,this.messages):this.messages.selectTemplate} .loading=${this._templateState==="loading"} @click=${this.showTemplateSelector} @keydown=${e=>{(e.key==="Enter"||e.key===" ")&&this.showTemplateSelector()}} tabindex=0>${l("template-select-icon",t`<calcite-icon .icon=${(this._selectedTemplate?.layout?h(this._selectedTemplate.layout):null)||"custom-print"} scale=l slot=content-start></calcite-icon>`)}${this._templateState==="error"?l("template-select-error",t`<calcite-icon class=${a(i.templateSelectError)} icon=exclamation-mark-circle scale=s slot=actions-end></calcite-icon>`):null}${l("template-select-arrow",t`<calcite-icon class=${a(i.templateSelectArrow)} .icon=${m()?"chevron-left":"chevron-right"} scale=s slot=actions-end></calcite-icon>`)}</calcite-block>`}};n("arcgis-print-template-select",c);return c},"core/reactiveUtils",b)