@arcgis/map-components 5.1.0-next.124 → 5.1.0-next.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/map-components",
3
- "version": "5.1.0-next.124",
3
+ "version": "5.1.0-next.125",
4
4
  "description": "ArcGIS Map Components",
5
5
  "keywords": [
6
6
  "2D",
@@ -46,13 +46,13 @@
46
46
  "lit": "^3.3.0",
47
47
  "lodash-es": "^4.18.1",
48
48
  "tslib": "^2.8.1",
49
- "@arcgis/common-components": "5.1.0-next.124",
50
- "@arcgis/toolkit": "5.1.0-next.124",
51
- "@arcgis/lumina": "5.1.0-next.124"
49
+ "@arcgis/lumina": "5.1.0-next.125",
50
+ "@arcgis/toolkit": "5.1.0-next.125",
51
+ "@arcgis/common-components": "5.1.0-next.125"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@arcgis/core": "^5.1.0-next",
55
- "@esri/calcite-components": "^5.1.0-next.60"
55
+ "@esri/calcite-components": "^5.1.1-next.3"
56
56
  },
57
57
  "css.customData": [
58
58
  "dist/docs/vscode.css-custom-data.json"
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as x}from"./MP6Z45SA.js";import g from"./R3NYK6BO.js";import f from"./JYVV3JI3.js";import{a as S}from"./NHBQXARI.js";import e from"./VQIFXIMQ.js";import d from"./J26EKNWT.js";import{h as M}from"./R2NTRI4S.js";import"./FAECSPBC.js";import a from"./YDIKH6TZ.js";import"./GMFJ55C3.js";import{O as w,U as F,a as b,b as c,x as y}from"./FKJWY2PS.js";import"./3TTFCHAA.js";export default $arcgis.t(([{property:s,subclass:B},D,{getAllStandardFeatureTemplatesForLayer:U,getTemplatesForLayers:E},{isTable:u,getEffectiveLayerCapabilities:L},{watch:T},,{a:$},,_,{e:f,f:v}])=>{var I=b`:host{display:flex;position:relative;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.filter-no-results{padding:var(--calcite-spacing-md) var(--calcite-spacing-lg)}.root{display:flex;flex:1 1 auto;overflow:hidden auto;transition:max-height .25s ease-in-out}.root>*{width:100%;box-sizing:border-box}.feature-template-tabs{--calcite-tab-background-color: transparent}`,C=Object.defineProperty,R=Object.getOwnPropertyDescriptor,h=(t,e,i,o)=>{for(var r=o>1?void 0:o?R(e,i):e,p=t.length-1,n;p>=0;p--)(n=t[p])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&C(e,i,r),r},d=class extends D{constructor(t){super(t),this.layer=null,this.template=null}get description(){return this.template?.description??""}get label(){return this.template?.name??""}get id(){return`${this.label??""}\u2013${this.layer?.id}`}get supportsUpload(){return this.layer?.type==="scene"}};h([s()],d.prototype,"description",1);h([s()],d.prototype,"label",1);h([s()],d.prototype,"layer",2);h([s()],d.prototype,"template",2);h([s()],d.prototype,"thumbnail",2);h([s()],d.prototype,"id",1);h([s()],d.prototype,"supportsUpload",1);d=h([B("components.feature-templates.TemplateItem")],d);var A=Object.defineProperty,O=Object.getOwnPropertyDescriptor,l=(t,e,i,o)=>{for(var r=o>1?void 0:o?O(e,i):e,p=t.length-1,n;p>=0;p--)(n=t[p])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&A(e,i,r),r};function P(t){switch(t){case"point":case"multipoint":case"polyline":case"polygon":case"extent":case"mesh":return t}return"noneSpecified"}var j=t=>P(t.layer.geometryType??""),a=class extends D{constructor(t){super(t),this._hasRunInitialLoad=!1,this.favoritesEnabled=!1,this.recentlyUsedEnabled=!1,this.hideTemplateDescription=!1,this.filterText="",this.recentFilterText="",this.favoritesFilterText="",this.display="grouped",this.groupBy="layer",this.hideTemplatesMode="never",this.disableTemplatesMode="never",this.sectionSortBy="system",this.templateSortBy="alphabetical",this.sharedTemplatesDisabled=!1,this.excludeTables=!1,this.favorites=new Set,this.fetchingTemplateMetaData=!1,this.recentlyUsed=[]}async handleTemplateSourceDefinitionChanged(){if(this._hasRunInitialLoad=!1,this.applicationTemplates){await this._restore();return}try{this.fetchingTemplateMetaData=!0;let t=this.activeLayers;if(await Promise.allSettled(t.map(e=>e.load())),this.sharedTemplatesDisabled){let e=[];for(let i of t){let o=U(i);o.length>0&&e.push({layer:i,templates:o})}this.mapTemplates=e;return}this.mapTemplates=await E(t,this.view,void 0,{returnVisibleTemplatesOnly:!0}),await this._restore()}catch{this.mapTemplates=[]}finally{this.fetchingTemplateMetaData=!1}}get loading(){return!this._hasRunInitialLoad||this.layers!==void 0||this.applicationTemplates!==void 0||!this.view?.ready}async addFavorite(t){this.favorites.add(t.id),this.favorites=new Set(this.favorites)}async removeFavorite(t){this.favorites.delete(t.id),this.favorites=new Set(this.favorites)}addRecent(t){if(!this.recentlyUsedEnabled)return;let e=this.recentlyUsed.filter(i=>i!==t.id);e.unshift(t.id)>20&&(e.length=20),this.recentlyUsed=e}async removeRecent(t){this.recentlyUsed=this.recentlyUsed.filter(e=>e!==t.id)}async _restore(){try{if(this.favoritesEnabled&&this.restoreFavorites){let t=await this.restoreFavorites();this.favorites=new Set(t??[])}}catch{}try{if(this.recentlyUsedEnabled&&this.restoreRecentlyUsed){let t=await this.restoreRecentlyUsed();this.recentlyUsed=t??[]}}catch{}}_sortTemplates(t){if(this.templateSortByFunction){let e=this.templateSortByFunction(t)??null;return e===null?t:e}return this.templateSortBy==="alphabetical"?t.toSorted((e,i)=>e.label.localeCompare(i.label)):t}_sortSections(t){if(this.sectionSortByFunction){let e=this.sectionSortByFunction(t);e&&(t=e)}else if(this.sectionSortBy==="alphabetical")t=t.toSorted((e,i)=>e.sectionName.localeCompare(i.sectionName));else if(this.groupBy==="geometry"&&!this.groupByFunction){let e={point:1,multipoint:2,polyline:3,polygon:4,extent:5,mesh:6,noneSpecified:7};t=t.toSorted((i,o)=>{let r=e[i.sectionName]??10,p=e[o.sectionName]??10;return r-p})}for(let e of t)e.templates=this._sortTemplates(e.templates);return t}_layerIsVisibleAtCurrentScale(t){if(!this.view)return!0;let e=t;v(t)&&(e=t.parent);let i=this.view.allLayerViews.find(o=>o.layer===e);if(!i)return!0;if(v(t)){let o=this.view.scale;if(i.visibleAtCurrentScale){let r=t.minScale,p=t.maxScale,n=!r,m=!p;return!n&&o<=r&&(n=!0),!m&&o>=p&&(m=!0),n&&m}}return i.visibleAtCurrentScale}get activeLayers(){let t=[];for(let e of this.layers??[])if(f(e))for(let i of e.sublayers)t.push(i);else t.push(e);if(this.layers===void 0||this.layers===null){for(let e of[...this.view?.map?.allLayers?.slice(0).reverse()??[],...this.excludeTables?[]:this.view?.map?.allTables?.slice(0).reverse()??[]])if(e.type==="feature"||e.type==="scene"||e.type==="geojson"||e.type==="oriented-imagery"||e.type==="knowledge-graph")t.push(e);else if(f(e))for(let i of e.sublayers)t.push(i)}return t}get selectedTemplate(){return this.allTemplates.find(t=>t.id===this.selectedTemplateId)}get effectiveTemplates(){return this.templates.map(t=>({...t,templates:t.templates.filter(e=>this.inclusionFilter(e))})).filter(t=>t.templates.length>0)}get templateList(){return this._sortTemplates(this.effectiveTemplates.flatMap(t=>t.templates))}get allTemplates(){return this._sortTemplates(this.templates.flatMap(t=>t.templates))}inclusionFilter(t){if(this.excludeTables&&u(t.layer)||this.applicationFilterFunction?.(t)===!1)return!1;let e=L(t.layer)?.operations;return e?.supportsEditing===!1&&!e?.supportsAdd?!1:u(t.layer)?!0:!(this.hideTemplatesMode==="visible"&&!t.layer.visible||this.hideTemplatesMode==="scale"&&!this._layerIsVisibleAtCurrentScale(t.layer))}get templateSetKey(){return this._sortTemplates(this.allTemplates).map(t=>t.id).join(",")}get disabledTemplates(){let t=new Set;for(let e of this.allTemplates){if(this.applicationDisabledFunction&&this.applicationDisabledFunction(e)){t.add(e);continue}if(!u(e.layer)){if(this.disableTemplatesMode==="visible"&&!e.layer.visible){t.add(e);continue}if(this.disableTemplatesMode==="scale"&&this.view&&!this._layerIsVisibleAtCurrentScale(e.layer)){t.add(e);continue}}}return t}get templates(){return this.applicationTemplates??this.organizedMapTemplates}get organizedMapTemplates(){if(this.groupByFunction||this.groupBy==="geometry"){let t=!this.groupByFunction,e=this.groupByFunction??j,i=new Map;for(let o of this.mapTemplates??[])for(let r of o.templates){let p=new d({template:r,layer:o.layer}),n=e(p);if(n!=null)if(i.has(n))i.get(n)?.templates.push(p);else{let m={sectionName:n,...t?{autoTranslate:!0}:{},templates:[p]};i.set(n,m)}}return this._sortSections(Array.from(i.values()))}return this._sortSections((this.mapTemplates??[]).map(({layer:t,templates:e})=>({sectionName:t.title??"",templates:e.map(i=>new d({layer:t,template:i}))})).filter(t=>t.templates.length>0))}get updating(){return this.fetchingTemplateMetaData}get favoriteTemplates(){let t=[];for(let e of this.effectiveTemplates)for(let i of e.templates)this.favorites.has(i.id)&&t.push(i);return t}get recentTemplates(){let t=new Map;for(let i of this.effectiveTemplates)for(let o of i.templates)t.set(o.id,o);let e=[];for(let i of this.recentlyUsed)t.has(i)&&e.push(t.get(i));return e}};l([s()],a.prototype,"loading",1);l([s()],a.prototype,"_hasRunInitialLoad",2);l([s()],a.prototype,"activeLayers",1);l([s()],a.prototype,"favoritesEnabled",2);l([s()],a.prototype,"recentlyUsedEnabled",2);l([s()],a.prototype,"hideTemplateDescription",2);l([s()],a.prototype,"filterText",2);l([s()],a.prototype,"recentFilterText",2);l([s()],a.prototype,"favoritesFilterText",2);l([s()],a.prototype,"selectedTemplateId",2);l([s()],a.prototype,"selectedTemplate",1);l([s()],a.prototype,"layers",2);l([s()],a.prototype,"restoreFavorites",2);l([s()],a.prototype,"restoreRecentlyUsed",2);l([s()],a.prototype,"applicationDisabledFunction",2);l([s()],a.prototype,"applicationFilterFunction",2);l([s()],a.prototype,"display",2);l([s()],a.prototype,"groupBy",2);l([s()],a.prototype,"hideTemplatesMode",2);l([s()],a.prototype,"disableTemplatesMode",2);l([s()],a.prototype,"groupByFunction",2);l([s()],a.prototype,"sectionSortBy",2);l([s()],a.prototype,"templateSortBy",2);l([s()],a.prototype,"sectionSortByFunction",2);l([s()],a.prototype,"templateSortByFunction",2);l([s()],a.prototype,"sharedTemplatesDisabled",2);l([s()],a.prototype,"excludeTables",2);l([s()],a.prototype,"favorites",2);l([s()],a.prototype,"effectiveTemplates",1);l([s()],a.prototype,"templateList",1);l([s()],a.prototype,"allTemplates",1);l([s()],a.prototype,"templateSetKey",1);l([s()],a.prototype,"disabledTemplates",1);l([s()],a.prototype,"templates",1);l([s()],a.prototype,"mapTemplates",2);l([s()],a.prototype,"organizedMapTemplates",1);l([s()],a.prototype,"fetchingTemplateMetaData",2);l([s()],a.prototype,"updating",1);l([s()],a.prototype,"applicationTemplates",2);l([s()],a.prototype,"favoriteTemplates",1);l([s()],a.prototype,"recentTemplates",1);l([s()],a.prototype,"recentlyUsed",2);l([s()],a.prototype,"view",2);a=l([B("components.feature-templates.FeatureTemplatesViewModel")],a);var N=_(a),g=class extends w{constructor(){super(...arguments),this._messages=S(),this.viewModel=N(this),this.favoritesEnabled=this.viewModel.favoritesEnabled,this.favorites=this.viewModel.favorites,this.restoreFavorites=this.viewModel.restoreFavorites,this.restoreRecentlyUsed=this.viewModel.restoreRecentlyUsed,this.recentlyUsed=this.viewModel.recentlyUsed,this.sharedTemplatesDisabled=this.viewModel.sharedTemplatesDisabled,this.filterText=this.viewModel.filterText,this.recentFilterText=this.viewModel.recentFilterText,this.favoritesFilterText=this.viewModel.favoritesFilterText,this.recentlyUsedEnabled=this.viewModel.recentlyUsedEnabled,this.excludeTables=this.viewModel.excludeTables,this.effectiveTemplates=this.viewModel.effectiveTemplates,this.applicationTemplates=this.viewModel.applicationTemplates,this.selectedTemplateId=this.viewModel.selectedTemplateId,this.selectedTemplate=this.viewModel.selectedTemplate,this.applicationFilterFunction=this.viewModel.applicationFilterFunction,this.applicationDisabledFunction=this.viewModel.applicationDisabledFunction,this.display=this.viewModel.display,this.groupBy=this.viewModel.groupBy,this.sectionSortBy=this.viewModel.sectionSortBy,this.templateSortBy=this.viewModel.templateSortBy,this.templateSortByFunction=this.viewModel.templateSortByFunction,this.sectionSortByFunction=this.viewModel.sectionSortByFunction,this.hideTemplatesMode=this.viewModel.hideTemplatesMode,this.disableTemplatesMode=this.viewModel.disableTemplatesMode,this.groupByFunction=this.viewModel.groupByFunction,this.hideTemplateDescription=this.viewModel.hideTemplateDescription,this.layers=this.viewModel.layers,this.view=$(this),this.autoDestroyDisabled=!1,this.updating=this.viewModel.updating,this.disabled=!1,this.showCollapseButton=!1,this.showFilter=!1,this.arcgisPropertyChange=M()("effectiveTemplates","filterText","recentlyUsed","favorites"),this.arcgisReady=y(),this.arcgisTemplatesChanged=y(),this.arcgisSelectTemplate=y()}static{this.properties={favoritesEnabled:5,favorites:32,restoreFavorites:0,restoreRecentlyUsed:0,recentlyUsed:32,sharedTemplatesDisabled:5,filterText:1,recentFilterText:1,favoritesFilterText:1,recentlyUsedEnabled:5,excludeTables:5,effectiveTemplates:32,applicationTemplates:0,selectedTemplateId:1,selectedTemplate:32,applicationFilterFunction:0,applicationDisabledFunction:0,display:1,groupBy:1,sectionSortBy:1,templateSortBy:1,templateSortByFunction:0,sectionSortByFunction:0,hideTemplatesMode:1,disableTemplatesMode:1,groupByFunction:0,hideTemplateDescription:5,layers:0,view:0,referenceElement:1,autoDestroyDisabled:5,updating:32,disabled:5,showCollapseButton:5,showFilter:5}}static{this.styles=I}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[T(()=>this.view,()=>{this.viewModel.view=this.view},{initial:!0}),T(()=>this.viewModel.templateSetKey,()=>{this.arcgisTemplatesChanged.emit()}),T(()=>[this.viewModel.activeLayers?.map(e=>e.id).join(","),this.viewModel?.applicationTemplates,this.viewModel?.sharedTemplatesDisabled],x(()=>this.viewModel.handleTemplateSourceDefinitionChanged(),10),{initial:!0})])}_handleSelectTemplate(e){this.selectedTemplateId=e.id,this.arcgisSelectTemplate.emit({template:e}),this.viewModel.addRecent(e)}_removeTemplateFromList(e,i){if(i==="favorites"){this.viewModel.removeFavorite(e);return}this.viewModel.removeRecent(e)}_renderTemplates(){return this.effectiveTemplates.length===0?c`<calcite-notice icon=list open class="filter-no-results"><div slot=message>${this._messages.noTemplates}</div></calcite-notice>`:c`<calcite-list .filterText=${this.filterText} .label=${this._messages?.templates??""} .filterEnabled=${this.showFilter} selection-appearance=border selection-mode=single @calciteListFilter=${e=>{this.filterText=e.target.filterText}}>${this.display==="grouped"?this.effectiveTemplates.map(e=>c`<calcite-list-item-group .heading=${e.autoTranslate?this._messages[e.sectionName]??"":e.sectionName}>${e.templates.map(i=>c`<calcite-list-item .disabled=${this.viewModel.disabledTemplates.has(i)} .label=${i.label} .selected=${i.id===this.selectedTemplateId} .description=${this.hideTemplateDescription?void 0:i.description} .value=${i.id} @calciteListItemSelect=${()=>{this._handleSelectTemplate(i)}}><arcgis-template-image slot=content-start .template=${i}></arcgis-template-image>${this._renderAddFavorite(i)}</calcite-list-item>`)}</calcite-list-item-group>`):this.viewModel.templateList.map(e=>c`<calcite-list-item .disabled=${this.viewModel.disabledTemplates.has(e)} .label=${e.label} .selected=${e.id===this.selectedTemplateId} .description=${this.hideTemplateDescription?void 0:e.description} .value=${e.id} @calciteListItemSelect=${()=>{this._handleSelectTemplate(e)}}><arcgis-template-image slot=content-start .template=${e}></arcgis-template-image>${this._renderAddFavorite(e)}</calcite-list-item>`)}${this._renderFilteredEmpty()}</calcite-list>`}_renderAddFavorite(e){return this.viewModel.favoritesEnabled?c`<calcite-action slot=actions-end .icon=${this.viewModel.favorites.has(e.id)?"heart-f":"heart"} @click=${()=>{this.viewModel.favorites.has(e.id)?this.viewModel.removeFavorite(e):this.viewModel.addFavorite(e)}} .text=${this._messages.addFavorite??""}></calcite-action>`:""}_renderList(e){let i=e==="favorites"?this.viewModel.favoriteTemplates:this.viewModel.recentTemplates;return i.length===0?c`<calcite-notice icon=list open class="filter-no-results"><div slot=message>${e==="favorites"?this._messages.noFavorites:this._messages.noRecent}</div></calcite-notice>`:c`<calcite-list .filterText=${e==="favorites"?this.favoritesFilterText:this.recentFilterText} .label=${(e==="favorites"?this._messages.favorites:this._messages.recent)??""} .filterEnabled=${this.showFilter} selection-appearance=border selection-mode=single @calciteListFilter=${o=>{this.filterText=o.target.filterText}}>${i.map(o=>c`<calcite-list-item .disabled=${this.viewModel.disabledTemplates.has(o)} .label=${o.label} .description=${this.hideTemplateDescription?void 0:o.description} .value=${o.id} @calciteListItemSelect=${()=>{this._handleSelectTemplate(o)}}><arcgis-template-image slot=content-start .template=${o}></arcgis-template-image><calcite-action slot=actions-end icon=x @click=${()=>{this._removeTemplateFromList(o,e)}} .text=${(e==="favorites"?this._messages.removeFavorite:this._messages.removeRecent)??""}></calcite-action></calcite-list-item>`)}${this._renderFilteredEmpty()}</calcite-list>`}_renderFilteredEmpty(){return c`<calcite-notice icon=filter slot=filter-no-results open class="filter-no-results"><div slot=message>${this._messages.noMatchingTemplates}</div></calcite-notice>`}_renderContent(){return this.effectiveTemplates.length===0&&this.viewModel.loading?null:this.favoritesEnabled||this.recentlyUsedEnabled?c`<calcite-tabs class="feature-template-tabs"><calcite-tab-nav slot=title-group><calcite-tab-title icon-start=templates selected>${this._messages.templates}</calcite-tab-title>${this.recentlyUsedEnabled?c`<calcite-tab-title icon-start=clock>${this._messages.recent}</calcite-tab-title>`:""}${this.favoritesEnabled?c`<calcite-tab-title icon-start=heart>${this._messages.favorites}</calcite-tab-title>`:""}</calcite-tab-nav><calcite-tab selected>${this._renderTemplates()}</calcite-tab><calcite-tab>${this._renderList("recent")}</calcite-tab><calcite-tab>${this._renderList("favorites")}</calcite-tab></calcite-tabs>`:this._renderTemplates()}render(){return c`<div class="root">${this._renderContent()}${this.viewModel.updating||this.disabled?c`<calcite-scrim><calcite-loader scale=s label .hidden=${!this.viewModel.updating}></calcite-loader></calcite-scrim>`:null}</div>`}};F("arcgis-feature-templates",g);return g},"core/accessorSupport/decorators","core/Accessor","applications/Components/templateUtils","applications/Components/layerUtils","core/reactiveUtils",a,d,e,f,g)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as w}from"./GI5SSBWA.js";import{a as $}from"./NHBQXARI.js";import b from"./J26EKNWT.js";import{h as L}from"./R2NTRI4S.js";import"./FAECSPBC.js";import a from"./YDIKH6TZ.js";import"./GMFJ55C3.js";import{M as _,N as f,O as g,Q as u,R as M,U as v,V as y,a as x,b as n,x as S}from"./FKJWY2PS.js";import"./3TTFCHAA.js";export default $arcgis.t(([{watch:T},P,,{a:b}])=>{var r=new Set(["ar-iq","ar-kw","bg-bg","cs-cz","da-dk","da-gl","de-at","de-ch","de-de","de-li","el-gr","en-ae","en-au","en-ca","en-eg","en-gb","en-hk","en-id","en-ie","en-il","en-in","en-iq","en-ke","en-lu","en-mo","en-my","en-nz","en-rw","en-sg","en-us","en-vi","en-wo","en-za","es-ar","es-bo","es-cl","es-co","es-cr","es-es","es-gt","es-mx","es-ni","es-pe","es-pr","es-sv","es-ve","et-ee","fi-fi","fr-ci","fr-fr","fr-ma","fr-mg","fr-ml","fr-tn","is-is","it-it","ja-jp","ko-kr","lt-lt","lv-lv","nl-be","nl-nl","nl-sr","nn-no","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sv-se","th-th","zh-cn","zh-tw"]),R={ar:"iq",bg:"bg",cs:"cz",da:"dk",de:"de",el:"gr",en:"us",es:"es",et:"ee",fi:"fi",fr:"fr",is:"is",it:"it",ja:"jp",ko:"kr",lt:"lt",lv:"lv",nl:"nl",nn:"no",pl:"pl",pt:"br",ro:"ro",ru:"ru",sk:"sk",sv:"se",th:"th",zh:"cn"},k=x`:host{display:block;width:310px;max-width:100%}.slider{height:50px}.scale-indicator-container{position:relative;width:100%;margin-top:5px}.scale-indicator-icon{transform:scale(.8,1.7);margin-left:-6px;width:1px}.scale-menu-list{max-height:220px;overflow-y:auto}.scale-menu-input{max-width:120px}.scale-menu-button-container{display:flex;direction:ltr;justify-content:space-between}.scale-menu-button{min-width:0}:dir(rtl) .scale-menu-button-container>*{direction:rtl}.preview-container{padding:6px;background-color:var(--calcite-color-foreground-1);box-shadow:0 1px 2px #0000004d}`,l=[{id:"world",scale:147914382,minScale:147914382,maxScale:1e8},{id:"continent",scale:5e7,minScale:99999999,maxScale:35e6},{id:"countriesBig",scale:25e6,minScale:34999999,maxScale:15e6},{id:"countriesSmall",scale:12e6,minScale:14999999,maxScale:7e6},{id:"statesProvinces",scale:6e6,minScale:6999999,maxScale:4e6},{id:"stateProvince",scale:3e6,minScale:3999999,maxScale:2e6},{id:"counties",scale:15e5,minScale:1999999,maxScale:1e6},{id:"county",scale:75e4,minScale:999999,maxScale:5e5},{id:"metropolitanArea",scale:32e4,minScale:499999,maxScale:25e4},{id:"cities",scale:16e4,minScale:249999,maxScale:12e4},{id:"city",scale:8e4,minScale:119999,maxScale:6e4},{id:"town",scale:4e4,minScale:59999,maxScale:3e4},{id:"neighborhood",scale:2e4,minScale:29999,maxScale:15e3},{id:"streets",scale:1e4,minScale:14999,maxScale:7500},{id:"street",scale:5e3,minScale:7499,maxScale:4e3},{id:"buildings",scale:2500,minScale:3999,maxScale:2e3},{id:"building",scale:1250,minScale:1999,maxScale:801},{id:"smallBuilding",scale:800,minScale:800,maxScale:401},{id:"rooms",scale:400,minScale:400,maxScale:101},{id:"room",scale:100,minScale:100,maxScale:0}],p=class extends g{constructor(){super(...arguments),this.messages=$(),this._sliderRef=_(),this._activeMenu=null,this._customScaleSelected=null,this._portalRegion=null,this._layerMaxScaleLimit=l[l.length-1].maxScale,this._layerMinScaleLimit=l[0].minScale,this.autoDestroyDisabled=!1,this.disabled=!1,this.hidePreview=!1,this.hideMaxScaleMenu=!1,this.hideMinScaleMenu=!1,this.icon="actual-size",this.maxScale=0,this.maxScaleLimit=l[l.length-1].maxScale,this.minScale=0,this.minScaleLimit=l[0].minScale,this.mode="range",this.showWorldValue=!1,this.view=b(this),this.arcgisChange=S(),this.arcgisInput=S(),this.arcgisPropertyChange=L()("state","minScale","maxScale"),this.arcgisReady=S()}static{this.properties={_activeMenu:16,_customScaleSelected:16,_portalRegion:16,_layerMaxScaleLimit:16,_layerMinScaleLimit:16,autoDestroyDisabled:5,disabled:7,hidePreview:5,hideMaxScaleMenu:5,hideMinScaleMenu:5,icon:1,label:1,layer:0,maxScale:9,maxScaleLimit:9,minScale:9,minScaleLimit:9,mode:1,referenceElement:1,region:1,showWorldValue:5,state:32,view:0}}static{this.styles=k}get state(){let{view:e,layer:a}=this;return!e&&!a||!e&&a?.loadStatus==="loaded"||!a&&e?.ready||e?.ready&&a?.loadStatus==="loaded"?"ready":"disabled"}async destroy(){await this.manager.destroy()}willUpdate(e){if((e.has("maxScaleLimit")||e.has("minScaleLimit"))&&(this.minScaleLimit===0&&(this.minScaleLimit=this._layerMinScaleLimit),this.maxScaleLimit===0&&(this.maxScaleLimit=this._layerMaxScaleLimit),this.minScaleLimit=Math.min(this.minScaleLimit,this._layerMinScaleLimit),this.maxScaleLimit=Math.max(this.maxScaleLimit,this._layerMaxScaleLimit),this.minScale!==0&&(this.minScale=Math.min(this.minScale,this.minScaleLimit)),this.maxScale!==0&&(this.maxScale=Math.max(this.maxScale,this.maxScaleLimit)),this._syncLayerScale()),e.has("maxScale")||e.has("minScale")){if(this.minScale!==0){let a=this._clampScale("min",this.minScale);this.minScale=a===this.minScaleLimit?0:a}if(this.maxScale!==0){let a=this._clampScale("max",this.maxScale);this.maxScale=a===this.maxScaleLimit?0:a}}e.has("layer")&&this.layer&&this.layer.load().catch(()=>{}),e.has("mode")&&(this.mode==="max-scale-only"?this.minScale=0:this.mode==="min-scale-only"&&(this.maxScale=0),e.get("mode")!==void 0&&this._syncLayerScale())}loaded(){P.getDefault().load().then(e=>{let a=e.user?.culture??e.culture;a&&(this._portalRegion=a.split("-")[1]?.toLowerCase()??null)}).catch(()=>{}),this.manager.onLifecycle(()=>[T(()=>this.view?.scale,()=>this.requestUpdate(),{initial:!0}),T(()=>({loaded:this.layer?.loadStatus==="loaded",ready:this.view?.ready}),({loaded:e,ready:a})=>{if(!e||!a||!this.layer)return;let i=this.layer.type==="wcs"||this.layer.type==="imagery-tile"&&this.layer.raster?.tileType==="Raster"?null:"tileInfo"in this.layer?this.layer.tileInfo?.lods:null;if(i)this._layerMinScaleLimit=i[0].scale===0?l[0].minScale:Math.min(l[0].minScale,i[0].scale),!("resampling"in this.layer)||this.layer.resampling||(this._layerMaxScaleLimit=i[i.length-1].scale);else{let s=this.layer&&"maxScaleRange"in this.layer?this.layer.maxScaleRange:null,c=0,m=0;s&&(c=s.minScale,m=s.maxScale),m!==0&&(this._layerMaxScaleLimit=m),c!==0&&(this._layerMinScaleLimit=c)}this.minScaleLimit=Math.min(this.minScaleLimit,this._layerMinScaleLimit),this.maxScaleLimit=Math.max(this.maxScaleLimit,this._layerMaxScaleLimit);let t=this.layer;t&&"minScale"in t&&"maxScale"in t&&(t.minScale!==0&&this.minScale===0&&(this.minScale=Math.min(t.minScale,this.minScaleLimit)),t.maxScale!==0&&this.maxScale===0&&(this.maxScale=Math.max(t.maxScale,this.maxScaleLimit)))},{initial:!0})])}get _effectiveMinScale(){return this.minScale===0?this.minScaleLimit:this.minScale}get _effectiveMaxScale(){return this.maxScale===0?this.maxScaleLimit:this.maxScale}_clampScale(e,a){return e==="min"?Math.min(Math.max(a,this._effectiveMaxScale+1),this.minScaleLimit):Math.max(Math.min(a,this._effectiveMinScale-1),this.maxScaleLimit)}_getDropdownLabel(e){let a=e==="min"?this._effectiveMinScale:this._effectiveMaxScale,i=Math.floor(this._mapScaleToSlider(a)),t=this.messages.scaleRangeLabels;return t?t[l[i].id]:""}_getSpriteSheetFile(){let e=this.messages._lang.toLowerCase();if(r.has(e))return e;if(this.region){let i=this.region.toLowerCase(),t=`${this.messages._t9nLocale}-${i}`;if(r.has(t))return t;for(let s of r)if(s.endsWith(`-${i}`))return s}if(this._portalRegion){let i=`${this.messages._t9nLocale}-${this._portalRegion}`;if(r.has(i))return i}let a=R[this.messages._t9nLocale];if(a){let i=`${this.messages._t9nLocale}-${a}`;if(r.has(i))return i}for(let i of r)if(i.startsWith(`${this.messages._t9nLocale}-`))return i;return"en-wo"}_handleCustomScaleInput(e,a){let i=Number.parseFloat(a);this._setScale(e,i)}_handleSliderThumbDrag(){let e=this._sliderRef.value;if(e){if(this.mode==="max-scale-only"){let a=Math.max(this._mapSliderToScale(e.values[0]),this.maxScaleLimit);this.maxScale=a===this.maxScaleLimit?0:a}else if(this.mode==="min-scale-only"){let a=Math.min(this._mapSliderToScale(e.values[0]),this.minScaleLimit);this.minScale=a===this.minScaleLimit?0:a}else{let a=Math.min(this._mapSliderToScale(e.values[0]),this.minScaleLimit),i=Math.max(this._mapSliderToScale(e.values[1]),this.maxScaleLimit);this.minScale=a===this.minScaleLimit?0:a,this.maxScale=i===this.maxScaleLimit?0:i}this._syncLayerScale()}}_mapScaleToSlider(e){let a=Math.min(l[0].minScale,Math.max(l[l.length-1].maxScale,e)),i=l.findIndex(m=>a>=m.maxScale&&a<=m.minScale),t=l[i],s=i,c=i+.9999;return t?s+(a-t.minScale)*(c-s)/(t.maxScale-t.minScale):0}_mapSliderToScale(e){let a=Math.min(l.length-1,Math.max(0,Math.floor(e))),{maxScale:i,minScale:t}=l[a],s=a,c=s+.9999;return t+(e-s)*(i-t)/(c-s)}_setScale(e,a){e==="min"?this.minScale=a===0?0:this._clampScale("min",a):this.maxScale=a===0?0:this._clampScale("max",a),this._syncLayerScale(),this._activeMenu=null}_syncLayerScale(){this.layer&&"minScale"in this.layer&&"maxScale"in this.layer&&(this.layer.minScale=this.mode==="max-scale-only"?0:this._effectiveMinScale,this.layer.maxScale=this.mode==="min-scale-only"?0:this._effectiveMaxScale)}_renderScalePreviewPopover(){let e=this._renderScalePreview();return this.hidePreview||!e?null:n`<div slot=popover>${e}</div>`}render(){return n`<div><arcgis-slider class="slider" .disabled=${this.disabled} layout=horizontal .fillPlacement=${this.mode==="max-scale-only"?"start":this.mode==="min-scale-only"?"end":void 0} .fullRangeMin=${this._mapScaleToSlider(l[0].minScale)} .fullRangeMax=${this._mapScaleToSlider(l[l.length-1].maxScale)} .max=${this._mapScaleToSlider(this.maxScaleLimit)} .min=${this._mapScaleToSlider(this.minScaleLimit)} .labelFormatter=${(e,a,i)=>i(Math.round(this._mapSliderToScale(e)))} .values=${this.mode==="max-scale-only"?[this._mapScaleToSlider(this._effectiveMaxScale)]:this.mode==="min-scale-only"?[this._mapScaleToSlider(this._effectiveMinScale)]:[this._mapScaleToSlider(this._effectiveMinScale),this._mapScaleToSlider(this._effectiveMaxScale)]} @arcgisInput=${this._handleSliderThumbDrag} ${f(this._sliderRef)}>${this._renderScalePreviewPopover()}${this.view?.scale!=null&&this._renderCurrentScaleIndicator(this.view.scale)||""}</arcgis-slider><div class="scale-menu-button-container" slot=content-end>${this.mode!=="max-scale-only"&&!this.hideMinScaleMenu?[this._renderScaleMenuButtons("min"),this._renderScaleMenuPopover("min")]:n`<div></div>`}${this.mode!=="min-scale-only"&&!this.hideMaxScaleMenu&&[this._renderScaleMenuButtons("max"),this._renderScaleMenuPopover("max")]||""}</div></div>`}_renderCurrentScaleIndicator(e){let a=this._sliderRef.value,i=a?.fullRangeMax??this._mapScaleToSlider(l[l.length-1].maxScale),t=a?.fullRangeMin??this._mapScaleToSlider(l[0].minScale),s=i-t,c=Math.min(100,Math.max(0,(this._mapScaleToSlider(e)-t)/s*100));return w("scale-indicator",n`<div class="scale-indicator-container" slot=content-end><div class="scale-indicator-icon" style=${u({position:"absolute",left:`${c}%`})} .title=${`${this.messages.currentScale} 1:${Math.round(e).toLocaleString(this.messages._t9nLocale)}`}><calcite-icon icon=caret-up scale=s></calcite-icon></div></div>`)}_renderCustomScaleValue(e,a){let i=Math.round(a).toString();return n`<calcite-list-item .label=${this.messages?.featuredScaleLabels?.custom} .selected=${this._customScaleSelected===e} @calciteListItemSelect=${t=>{let s=t.target.querySelector("calcite-input-number");this._handleCustomScaleInput(e,s?.value??""),this._customScaleSelected=e}}><calcite-input-number dir=ltr class="scale-menu-input" slot=content-end group-separator inputmode=numeric .max=${l[0].minScale} .min=${l[l.length-1].maxScale} number-button-type=none .placeholder=${this.messages?.customScaleInputTooltip} prefix-text=1: scale=s step=1 .value=${i} @click=${t=>t.stopPropagation()} @keydown=${t=>{t.key==="Enter"&&(this._handleCustomScaleInput(e,t.target.value),this._customScaleSelected=e,t.stopPropagation())}}></calcite-input-number></calcite-list-item>`}_renderScaleMenuButtons(e){return n`<calcite-button .disabled=${this.disabled} class="scale-menu-button" .id=${`scale-menu-button-${e}`} icon-end=chevron-down scale=s .appearance=${this._activeMenu===e?"outline":"transparent"}>${this._getDropdownLabel(e)}</calcite-button>`}_renderScaleMenuPopover(e){return n`<calcite-popover auto-close .label=${`${e==="min"?"Min":"Max"} scale menu`} .referenceElement=${`scale-menu-button-${e}`} .placement=${e==="max"?"bottom-end":"bottom-start"} .open=${this._activeMenu===e} scale=s @calcitePopoverOpen=${()=>this._activeMenu=e} @calcitePopoverClose=${()=>{this._activeMenu===e&&(this._activeMenu=null)}}>${this._renderScaleMenu(e)}</calcite-popover>`}_renderScaleMenu(e){let a=Math.floor(this._mapScaleToSlider(this._effectiveMaxScale)),i=Math.floor(this._mapScaleToSlider(this._effectiveMinScale)),t=e==="min"?this._effectiveMinScale:this._effectiveMaxScale,s=this.messages.featuredScaleLabels;if(!s)return;let c=Math.floor(this._mapScaleToSlider(this.maxScaleLimit)),m=Math.floor(this._mapScaleToSlider(this.minScaleLimit)),d=l.filter((o,h)=>e==="min"?h<a&&h>=m:h>i&&h<=c).map(o=>this._renderScaleMenuItem({scaleLabel:s[o.id],scaleValue:o.scale,isSelected:t===o.scale,valueVisible:o.id!=="world"||this.showWorldValue,type:e}));return n`<calcite-list label="Scale Menu List" scale=s class="scale-menu-list" selection-appearance=icon selection-mode=single-persist>${this.view?.scale!=null&&this._renderCustomScaleValue(e,t)||""}${this.view?.scale!=null?this._renderScaleMenuItem({scaleValue:this.view.scale,scaleLabel:s.current,isSelected:t===this.view.scale,valueVisible:!0,type:e}):null}${d}</calcite-list>`}_renderScaleMenuItem(e){let{scaleValue:a,scaleLabel:i,isSelected:t,valueVisible:s}=e,c=a===l[0].scale?` ${this.messages.aboveSuffix}`:a===l[l.length-1].scale?` ${this.messages.belowSuffix}`:"";return n`<calcite-list-item .label=${i} .selected=${t&&this._customScaleSelected!==e.type} .description=${s?`1:${Math.round(a).toLocaleString(this.messages._t9nLocale)}${c}`:void 0} @calciteListItemSelect=${()=>{this._setScale(e.type,a),this._customScaleSelected=null}}></calcite-list-item>`}_renderScalePreview(){let e=this._sliderRef.value?.activeValue;if(typeof e!="number")return null;let a=Math.min(l.length-1,Math.max(0,Math.floor(e))),i=5,t=128,s=t*(a%i),c=t*Math.floor(a/i),m=`-${s}px -${c}px`,d=this._getSpriteSheetFile();return n`<div class="preview-container"><img src=${y(`./assets/slider-scale-range/images/${d}.avif`)??M} style=${u({display:"block",height:`${t}px`,width:`${t}px`,objectPosition:m,objectFit:"none"})}></div>`}};v("arcgis-slider-scale-range",p);return p},"core/reactiveUtils","portal/Portal",a,b)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"./JYVV3JI3.js";import{a as b}from"./NHBQXARI.js";import d from"./VQIFXIMQ.js";import c from"./J26EKNWT.js";import"./R2NTRI4S.js";import"./FAECSPBC.js";import a from"./YDIKH6TZ.js";import"./GMFJ55C3.js";import{M as y,N as S,O as L,U as _,a as I,b as g,g as V,q as E,x as f}from"./FKJWY2PS.js";import"./3TTFCHAA.js";export default $arcgis.t(([{once:M,watch:$},A,,,,C])=>{var U=I`:host{--arcgis-internal-color-black-30: color-mix(in srgb, #000000 30.2%, transparent);--arcgis-internal-box-shadow: var(--calcite-spacing-none) var(--calcite-spacing-px) var(--calcite-spacing-base) var(--arcgis-internal-color-black-30);--arcgis-internal-top-max-width: calc(min(100cqw, 100vw) - var(--calcite-spacing-xxxl));--arcgis-internal-panel-width: 300px;--arcgis-internal-panel-height: 100%;--arcgis-internal-panel-height-sm: 240px;--arcgis-internal-panel-height-md: 420px;--arcgis-internal-panel-height-lg: 540px;--arcgis-internal-panel-height-xl: 680px;--arcgis-internal-panel-gap: var(--calcite-spacing-lg);--arcgis-internal-panel-actions-gap: var(--calcite-spacing-sm);--arcgis-internal-basemap-gallery-width-lg: 450px;--arcgis-internal-collapse-icon-flip: scaleX(1);--arcgis-internal-row-direction: row;--arcgis-internal-legend-width: 300px;--arcgis-internal-layout-overlay-space-top: var(--arcgis-layout-overlay-space-top, 0px);--arcgis-internal-layout-overlay-space-bottom: var(--arcgis-layout-overlay-space-bottom, 0px);--arcgis-internal-layout-overlay-space-left: var(--arcgis-layout-overlay-space-left, 0px);--arcgis-internal-layout-overlay-space-right: var(--arcgis-layout-overlay-space-right, 0px);--arcgis-internal-view-color-focus: var(--arcgis-view-color-focus, var(--calcite-color-brand));--arcgis-internal-attribution-space-bottom: var(--arcgis-internal-layout-overlay-space-bottom);--arcgis-internal-attribution-space-left: var(--arcgis-internal-layout-overlay-space-left);--arcgis-internal-attribution-space-right: var(--arcgis-internal-layout-overlay-space-right);--arcgis-internal-attribution-font-size: var(--calcite-font-size-sm);--arcgis-internal-attribution-font-size-sm: var(--calcite-font-size-xs);--arcgis-internal-sketch-justify-content: flex-start}:host{display:flex;flex-direction:column;min-height:var(--arcgis-internal-panel-height-md, 420px);height:100%}calcite-notice{margin:var(--calcite-spacing-md)}`,T=C(A),P="map-components:version-management",u=class extends L{constructor(){super(...arguments),this.flowElement=y(),this.messages=b({blocking:!0}),this.viewModel=T(this),this._isInitialVersionInvalid=new Map,this._initialVersionInfos=[],this._showInvalidFeatureServiceNotice=!1,this.allowEditingDisabled=!1,this.autoDestroyDisabled=!1,this.closable=!1,this.pageSize=5,this.state=this.viewModel.state,this.versioningStates=this.viewModel.versioningStates,this.view=this.viewModel.view,this.arcgisReady=f(),this.arcgisVersioningStateChanged=f()}static{this.properties={versionList:16,_showInvalidFeatureServiceNotice:16,allowEditingDisabled:5,autoDestroyDisabled:5,closable:7,initialVersionInfos:0,icon:1,label:3,messageOverrides:0,mode:1,pageSize:9,referenceElement:1,state:32,versioningStates:0,view:0}}static{this.styles=U}get initialVersionInfos(){return this._initialVersionInfos}set initialVersionInfos(e){this._initialVersionInfos=e.map(i=>({...i,url:this._removeTrailingSlash(i.url)}))}async destroy(){await this.manager.destroy()}async load(){M(()=>this.viewModel.state==="ready").then(()=>{this.initialVersionInfos.forEach(e=>{try{this._changeToInitialVersion(e)}catch(i){E(this)(i)}})}),this.manager.onLifecycle(()=>[$(()=>this.viewModel.state,e=>{let{flowElement:{value:i},versionList:r}=this,t=i?.getElementsByTagName("arcgis-version-management-version-properties")[0];if(e==="disabled"&&i){t&&this._removeVersionPropertiesFlowItem(i),r&&this._removeVersionListFlowItem(i);return}r&&(r.versionListElementProps={...r.versionListElementProps,executionError:this.viewModel.executionError},r.versionListElementProps={...r.versionListElementProps,state:e}),t&&(t.versionPropertiesElementProps={...t.versionPropertiesElementProps,state:e})})])}disconnectedCallback(){super.disconnectedCallback(),this.versionPropertiesContainer?.remove()}_removeTrailingSlash(e){return e.replace(/\/+$/u,"")}_createVersionPropertiesFlowItem(e,i){let{closable:r,viewModel:t,viewModel:{state:n}}=this,o={closable:r,currentUser:t.userLookup.get(e),isVersionAdministrator:t.versionAdministratorLookup.get(e),serviceUrl:e,state:n,strings:this.messages,versionInfo:i};this.versionPropertiesContainer=document.createElement("div");let s=V(g`<arcgis-version-management-version-properties .versionPropertiesElementProps=${o} selected show-back-button></arcgis-version-management-version-properties>`,this.versionPropertiesContainer),a=Array.from(s.parentNode.childNodes).find(c=>c.nodeName.toUpperCase()==="ARCGIS-VERSION-MANAGEMENT-VERSION-PROPERTIES");return this.listenOn(a,"arcgisFlowItemBack",()=>{this._removeVersionPropertiesFlowItem(this.flowElement.value)}),this.listenOn(a,"calciteFlowItemBack",c=>{c.preventDefault(),this._removeVersionPropertiesFlowItem(this.flowElement.value),this.versionList&&(this.versionList.selected=!0)}),this.listenOn(a,"calciteFlowItemClose",this._handleFlowItemClose),this.listenOn(a,"arcgisCreateVersion",this._handleCreateVersion),this.listenOn(a,"arcgisAlterVersion",this._handleAlterVersion),a}_getLoadError(e){let{messages:i}=this;switch(e){case"no-feature-services":return i.loadErrors.noFeatureServices;case"no-view-property":return i.loadErrors.noViewProperty;default:return e}}async _handleAlterVersion(e){let{flowElement:{value:i},viewModel:r}=this,{alterVersionParameters:t}=e.detail;await r.alterVersion(t).then(async n=>{n&&this.arcgisVersioningStateChanged.emit({type:"version-changed",versionIdentifier:t.versionIdentifier,versioningState:r.versioningStateLookup.get(t.featureServerUrl)}),await this._refreshVersionList(t.featureServerUrl)}).finally(()=>{i&&this._removeVersionPropertiesFlowItem(i)})}_handleCreateVersion(e){let{flowElement:{value:i},viewModel:r}=this,{createVersionParameters:t,switchToVersion:n}=e.detail;r.createVersion(t).then(async o=>{o&&this.arcgisVersioningStateChanged.emit({type:"version-created",versionIdentifier:o.versionIdentifier,versioningState:r.versioningStateLookup.get(t.featureServerUrl)}),n&&await this.viewModel.changeVersion(t.featureServerUrl,o.versionIdentifier.name,o.versionIdentifier.guid).then(s=>{s&&this.arcgisVersioningStateChanged.emit({type:"version-switched",versionIdentifier:o.versionIdentifier,versioningState:r.versioningStateLookup.get(t.featureServerUrl)})}),await this._refreshVersionList(t.featureServerUrl)}).finally(()=>{i&&this._removeVersionPropertiesFlowItem(i)})}_changeToInitialVersion(e){let{_isInitialVersionInvalid:i,viewModel:r}=this,{url:t,name:n}=e,o=r.versioningStateLookup.get(t);if(!o)throw this._showInvalidFeatureServiceNotice=!0,new Error(`${P} - no versioning state found for feature service ${t}`);let s=o?.versionInfos.find(h=>h.versionIdentifier.name===n);if(!s)throw i.set(t,!0),new Error(`${P} - version ${n} not found in the versioning state for feature service ${t}`);let a=s.versionIdentifier,c=o?.currentVersionInfo?.versionIdentifier;a.guid!==c?.guid&&r.changeVersion(t,a.name,a.guid)}_handleFlowItemClose(){let e=document.querySelector("arcgis-version-management");e.parentElement?.removeChild(e)}async _handleNewVersionAction(e){let i=this._createVersionPropertiesFlowItem(e.detail.serviceUrl,void 0);this.flowElement.value?.appendChild(i),this.versionList&&(this.versionList.selected=!1)}async _handleManageVersionAction(e){let{actionType:i,serviceUrl:r,versionInfo:t}=e.detail,{viewModel:n,flowElement:o}=this;switch(i){case"changeVersion":{n.changeVersion(r,t.versionIdentifier.name,t.versionIdentifier.guid).then(s=>{s&&this.arcgisVersioningStateChanged.emit({type:"version-switched",versionIdentifier:t.versionIdentifier,versioningState:n.versioningStateLookup.get(r)});let{versionList:a}=this;a&&(a.versionListElementProps={...a.versionListElementProps,currentVersionIdentifier:n.versioningStateLookup.get(r).currentVersionInfo.versionIdentifier})});break}case"deleteVersion":{n.deleteVersion(r,t.versionIdentifier.name,t.versionIdentifier.guid).then(async s=>{s&&this.arcgisVersioningStateChanged.emit({type:"version-deleted",versionIdentifier:t.versionIdentifier,versioningState:n.versioningStateLookup.get(r)}),await this._refreshVersionList(r)});break}case"editVersion":{let s=this._createVersionPropertiesFlowItem(r,t);o.value?.appendChild(s),this.versionList&&(this.versionList.selected=!1);break}}}async _refreshVersionList(e){let{flowElement:{value:i},versionList:r,viewModel:t}=this;if(i){let n=await t.getVersionInfos(e),o=i.getElementsByTagName("arcgis-version-management-service-item");for(let s of o)s.serviceItemElementProps.serviceUrl===e&&(s.serviceItemElementProps={...s.serviceItemElementProps,versionInfos:n});r&&(r.versionListElementProps={...r.versionListElementProps,currentVersionIdentifier:t.versioningStateLookup.get(e).currentVersionInfo.versionIdentifier,versionInfos:n})}}_removeVersionListFlowItem(e){for(let i of e.childNodes)i.nodeName.toUpperCase()==="ARCGIS-VERSION-MANAGEMENT-VERSION-LIST"&&(e.removeChild(i),this.versionList=void 0),i.nodeName.toUpperCase()==="CALCITE-FLOW-ITEM"&&(i.hidden=!1)}_removeVersionPropertiesFlowItem(e){for(let i of e.childNodes)i.nodeName.toUpperCase()==="ARCGIS-VERSION-MANAGEMENT-VERSION-PROPERTIES"&&e.removeChild(i)}render(){let{allowEditingDisabled:e,closable:i,flowElement:{value:r},initialVersionInfos:t,_isInitialVersionInvalid:n,label:o,messages:s,mode:a,pageSize:c,versionList:h,viewModel:v,viewModel:{loadError:w,state:d}}=this,N=Array.from(v.serviceNameLookup,([l,m])=>({url:l,name:m})),k=d!=="disabled"?N.map(l=>{let m={allowEditing:!e,closable:i,currentUser:v.userLookup.get(l.url),currentVersionIdentifier:v.versioningStateLookup.get(l.url).currentVersionInfo.versionIdentifier,executionError:void 0,flowElement:r,heading:o,initialVersionInfos:t,isInitialVersionInvalid:n,isVersionAdministrator:v.versionAdministratorLookup.get(l.url),isVersioningApiAvailable:(v.serverVersionLookup.get(l.url)??0)>=11.2,mode:a,pageSize:c,serviceName:l.name,state:d,serviceUrl:l.url,strings:s,versionInfos:v.versioningStateLookup.get(l.url)?.versionInfos??[]};return g`<arcgis-version-management-service-item .serviceItemElementProps=${m} @arcgisFlowItemBack=${()=>{r&&(this._removeVersionListFlowItem(r),this.versionList=void 0)}} @arcgisFlowItemClose=${()=>this._handleFlowItemClose()} @arcgisGetVersions=${async p=>{await this._refreshVersionList(p.detail.serviceUrl)}} @arcgisManageVersion=${this._handleManageVersionAction} @arcgisNewVersion=${this._handleNewVersionAction} @arcgisCreateVersionList=${p=>this.versionList=p.detail}></arcgis-version-management-service-item>`}):void 0,F=d==="disabled"&&w!=null?g`<calcite-notice kind=warning open scale=s slot=footer width=full><div slot=message>${this._getLoadError(w)}</div></calcite-notice>`:void 0,x=this._showInvalidFeatureServiceNotice?g`<calcite-notice closable kind=warning open scale=s slot=content-top width=full icon @calciteNoticeClose=${()=>this._showInvalidFeatureServiceNotice=!1}><div slot=title>${s.headers.invalidInitialFeatureService}</div><div slot=message>${s.loadErrors.invalidInitialFeatureService}</div></calcite-notice>`:void 0;return g`<div class="root"><calcite-flow custom-item-selectors="arcgis-version-management-version-list, arcgis-version-management-version-properties" ${S(this.flowElement)}><calcite-flow-item .closable=${this.closable} .heading=${o??void 0} @calciteFlowItemClose=${()=>this._handleFlowItemClose()} .selected=${!h}>${x}<calcite-panel .loading=${d==="loading"||d==="executing"}>${k}${F}</calcite-panel></calcite-flow-item></calcite-flow></div>`}};_("arcgis-version-management",u);return u},"core/reactiveUtils","versionManagement/VersionManager",a,c,d,e)
@@ -1,33 +0,0 @@
1
- import type Accessor from "@arcgis/core/core/Accessor.js";
2
- import type SharedTemplateMetadata from "@arcgis/core/editing/sharedTemplates/SharedTemplateMetadata.js";
3
- import type FeatureTemplate from "@arcgis/core/layers/support/FeatureTemplate.js";
4
- import type { LayerWithFeatureTemplatesUnion } from "@arcgis/core/layers/types.js";
5
-
6
- export interface TemplateItemProperties extends Partial<Pick<TemplateItem, "layer" | "template" | "thumbnail">> {}
7
-
8
- /**
9
- * The item displayed within the FeatureTemplates component.
10
- *
11
- * @since 5.1
12
- */
13
- export default class TemplateItem extends Accessor {
14
- constructor(properties?: TemplateItemProperties);
15
- /**
16
- * The description that is displayed for the template item.
17
- * This is similar to the description provided in layers/support/FeatureTemplate#description.
18
- */
19
- get description(): string;
20
- get id(): string;
21
- /** The label that is displayed for the template item. */
22
- get label(): string;
23
- /** The layer associated with the template item. */
24
- accessor layer: LayerWithFeatureTemplatesUnion;
25
- get supportsUpload(): boolean;
26
- /** The associated FeatureTemplate for the item. */
27
- accessor template: FeatureTemplate | SharedTemplateMetadata;
28
- /**
29
- * An object used to create a thumbnail image that represents a feature type in the feature template.
30
- * This is similar to layers/support/FeatureTemplate#thumbnail.
31
- */
32
- accessor thumbnail: HTMLElement | undefined;
33
- }