@arcgis/common-components 4.29.0-beta.43 → 4.29.0-beta.44
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/dist/arcgis-common-components/arcgis-common-components.esm.js +1 -1
- package/dist/arcgis-common-components/{p-4b73c2b4.entry.js → p-0a9f9233.entry.js} +1 -1
- package/dist/arcgis-common-components/{p-9109c91f.entry.js → p-20e63d91.entry.js} +1 -1
- package/dist/arcgis-common-components/{p-c2d3283c.entry.js → p-b98229f1.entry.js} +1 -1
- package/dist/arcgis-common-components/{p-1c5290e5.entry.js → p-bc099d11.entry.js} +1 -1
- package/dist/cjs/arcgis-api-key.cjs.entry.js +1 -1
- package/dist/cjs/arcgis-field-info.cjs.entry.js +1 -1
- package/dist/cjs/arcgis-field-pick-list.cjs.entry.js +1 -1
- package/dist/cjs/arcgis-identity.cjs.entry.js +1 -1
- package/dist/esm/arcgis-api-key.entry.js +1 -1
- package/dist/esm/arcgis-field-info.entry.js +1 -1
- package/dist/esm/arcgis-field-pick-list.entry.js +1 -1
- package/dist/esm/arcgis-identity.entry.js +1 -1
- package/package.json +7 -7
- /package/dist/arcgis-common-components/{p-17c2d70f.js → p-19ebc914.js} +0 -0
- /package/dist/cjs/{index-b1be8f83.js → index-81d57760.js} +0 -0
- /package/dist/esm/{index-dbc88bff.js → index-877e3851.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-f27af39c.js";export{s as setNonce}from"./p-f27af39c.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),e(s)})().then((e=>t([["p-
|
|
1
|
+
import{p as e,b as t}from"./p-f27af39c.js";export{s as setNonce}from"./p-f27af39c.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),e(s)})().then((e=>t([["p-20e63d91",[[1,"arcgis-field-pick-list",{selectedFields:[1040],fields:[16],popoverProps:[16],layer:[16],mapView:[16],showFieldInfo:[4,"show-field-info"],showFieldName:[4,"show-field-name"],showDescription:[4,"show-description"],showSelectionAll:[4,"show-selection-all"],showCancel:[4,"show-cancel"],showSort:[4,"show-sort"],showFilterLength:[2,"show-filter-length"],multiple:[4],heading:[1],okBtnText:[1,"ok-btn-text"],filterPlaceholderText:[1,"filter-placeholder-text"],sortBy:[1,"sort-by"],lastSortyBy:[32],filterFields:[32],_lang:[32],_t9nLocale:[32],_t9nStrings:[32],setFocus:[64],reposition:[64]}]]],["p-0a9f9233",[[0,"arcgis-api-key",{apiKey:[1,"api-key"]},null,{apiKey:["apiKeyWatcher"]}]]],["p-b98229f1",[[0,"arcgis-identity",{identity:[1040],appId:[1,"app-id"],credential:[1040],expiration:[1026],locale:[1],usePopup:[4,"use-popup"],popupCallbackUrl:[1,"popup-callback-url"],portalUrl:[1,"portal-url"],preserveUrlHash:[4,"preserve-url-hash"],signIn:[64],signOut:[64]},null,{appId:["appIdWatcher"]}]]],["p-bc099d11",[[1,"arcgis-field-info",{view:[16],layer:[16],fieldName:[1,"field-name"],hideStatistics:[4,"hide-statistics"],oneFeatureResponse:[32],oneFeatureResponseStatus:[32],statistics:[32],statisticsStatus:[32],uniqueValues:[32],uniqueValuesStatus:[32],_lang:[32],_t9nLocale:[32],_t9nStrings:[32]}]]]],e)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as a,g as t}from"./p-f27af39c.js";import{i}from"./p-
|
|
1
|
+
import{r as s,c as a,g as t}from"./p-f27af39c.js";import{i}from"./p-19ebc914.js";const e=class{constructor(t){s(this,t),this.apiKeyReady=a(this,"apiKeyReady",7),this.apiKey=void 0}apiKeyWatcher(s){this._setApiKey(s)}async connectedCallback(){this.apiKey&&await this._setApiKey(this.apiKey)}async _setApiKey(s){(await i()).apiKey=s,this.apiKeyReady.emit(!0)}get el(){return t(this)}static get watchers(){return{apiKey:["apiKeyWatcher"]}}};e.style=":host{display:none}arcgis-api-key{display:none}";export{e as arcgis_api_key}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,a as e,H as h,g as o}from"./p-f27af39c.js";import{a as l}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,a as e,H as h,g as o}from"./p-f27af39c.js";import{a as l}from"./p-19ebc914.js";import{F as n,U as c,C as a}from"./p-b23318c8.js";var r,d;!function(t){t.expression="expression/",t.relationship="relationships/",t.raster="Raster."}(r||(r={})),function(t){t.default="default",t.display="display",t.type="type",t.field="field"}(d||(d={}));const p=class{constructor(e){t(this,e),this.arcgisFieldPickListDismissed=i(this,"arcgisFieldPickListDismissed",7),this.arcgisFieldPickListChange=i(this,"arcgisFieldPickListChange",7),this.arcgisFieldPickListSortByChange=i(this,"arcgisFieldPickListSortByChange",7),this.calciteValueList=t=>s("calcite-pick-list-item",{key:t.name,label:t.alias||t.name,description:(()=>this.showFieldName?`{${t.name}}`:this.showDescription&&t.description?t.description:null)(),value:t.name,selected:!this.multiple&&t.name===this.selectedFields[0]||this.multiple&&this.selectedFields.indexOf(t.name)>-1,metadata:{label:t.alias,fieldName:t.name}},this.showFieldInfoCheck(t)&&s("calcite-action",{slot:"actions-end",text:this._t9nStrings.info,title:this._t9nStrings.info,scale:"s",icon:"information",onClick:i=>{i.stopPropagation();const s=i.target,e=document.createElement("calcite-flow-item");e.heading=t.alias??t.name,e.description=t.name,e.className="panel";const h=document.createElement("arcgis-field-info");h.lang=this._lang,h.fieldName=t.name,h.layer=this.layer,h.view=this.mapView,h.classList.add("content"),e.appendChild(h),e.addEventListener("calciteFlowItemBack",(()=>setTimeout((()=>requestAnimationFrame((()=>s.setFocus()))),200))),this.flowElement.appendChild(e),setTimeout((()=>requestAnimationFrame((()=>e.setFocus()))),200)}})),this.selectedFields=[],this.fields=void 0,this.popoverProps=void 0,this.layer=void 0,this.mapView=void 0,this.showFieldInfo=!1,this.showFieldName=!1,this.showDescription=!1,this.showSelectionAll=!1,this.showCancel=!0,this.showSort=!0,this.showFilterLength=10,this.multiple=!1,this.heading=void 0,this.okBtnText=void 0,this.filterPlaceholderText=void 0,this.sortBy=void 0,this.lastSortyBy=d.default,this.filterFields=null,this._lang="",this._t9nLocale="",this._t9nStrings=void 0}async componentWillLoad(){await n(this,e("./assets")),!this.multiple&&this.selectedFields.length>1&&(this.selectedFields=[this.selectedFields[0]]),this.lastSortyBy=this.sortBy||this.lastSortyBy}async componentDidLoad(){(await l()).setLocale(this._lang),this.setUpObserver(),this.popoverNode.open=!0,setTimeout((()=>requestAnimationFrame((()=>this.panelElement.setFocus()))),200)}disconnectedCallback(){c(this),this.observer?.disconnect()}async setFocus(){setTimeout((()=>requestAnimationFrame((()=>this.panelElement.setFocus()))),1)}async reposition(){this.popoverNode?.reposition()}getSortedList(){const t=[...this.fields];return this.lastSortyBy===d.display?t.sort(((t,i)=>t.alias.localeCompare(i.alias))):this.lastSortyBy===d.field?t.sort(((t,i)=>t.name.localeCompare(i.name))):this.lastSortyBy===d.type&&t.sort(((t,i)=>t.type.localeCompare(i.type))),t}showFieldInfoCheck(t){return!!this.showFieldInfo&&!t.name.includes(r.expression)&&!t.name.includes(r.relationship)}selectDeselect(){return this.filterFields?.length?this.filterContainsAll():this.selectedFields.length===this.fields.length}filterContainsAll(){return!!this.filterFields?.every((t=>this.selectedFields.some((i=>i===t))))}render(){const t=s("calcite-button",{slot:"footer",appearance:this.showCancel?"solid":"outline-fill",width:this.showCancel?"half":"full",scale:"m",onClick:()=>{this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields})}},this.okBtnText||(this.multiple?this._t9nStrings.done:this._t9nStrings.ok)),i=s("calcite-button",{slot:"footer",appearance:"outline-fill",width:this.multiple?"half":"full",scale:"m",onClick:()=>this.arcgisFieldPickListDismissed.emit()},this._t9nStrings.cancel),e=this.fields.every((t=>!!t.type)),o=s("calcite-dropdown",{slot:"menu-actions",placement:"bottom-end",overlayPositioning:"fixed",ref:t=>this.dropdownNode=t,onCalciteDropdownOpen:()=>{this.observer?.disconnect(),this.observer?.observe(this.popoverNode,{attributes:!0})},onCalciteDropdownClose:()=>this.observer?.disconnect()},s("calcite-action",{slot:"trigger",text:this._t9nStrings.sort,title:this._t9nStrings.sort},s("calcite-icon",{scale:"s",icon:"sortDescending"})),s("calcite-dropdown-group",null,s("calcite-dropdown-item",{selected:this.lastSortyBy===d.default,onClick:()=>{this.lastSortyBy=d.default,this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy)}},this._t9nStrings.default),s("calcite-dropdown-item",{selected:this.lastSortyBy===d.display,onClick:()=>{this.lastSortyBy=d.display,this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy)}},this._t9nStrings.displayName),e&&s("calcite-dropdown-item",{selected:this.lastSortyBy===d.type,onClick:()=>{this.lastSortyBy=d.type,this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy)}},this._t9nStrings.type),s("calcite-dropdown-item",{selected:this.lastSortyBy===d.field,onClick:()=>{this.lastSortyBy=d.field,this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy)}},this._t9nStrings.fieldName))),l=s("div",{class:"selection-button-div"},s("calcite-button",{appearance:"transparent",scale:"s",width:"full",onClick:()=>{this.selectedFields=this.selectDeselect()?this.filterFields?.length?this.selectedFields.filter((t=>!this.filterFields?.includes(t))):[]:this.filterFields?.length?[...new Set([...this.selectedFields,...this.filterFields])]:this.fields.map((t=>t.name))}},this.selectDeselect()?this._t9nStrings.deselectAll:this._t9nStrings.selectAll));return s(h,{class:"js-app-flyout"},s("calcite-popover",{dir:a(this._hostElement),class:"popover",placement:this.popoverProps.placement||"leading-start",open:!1,pointerDisabled:!0,referenceElement:this.popoverProps.refElement,offsetDistance:this.popoverProps.offsetDistance||-Math.round(this.popoverProps.refElement.getBoundingClientRect().width),offsetSkidding:this.popoverProps.offsetSkidding||0,overlayPositioning:this.popoverProps.overlayPositioning,triggerDisabled:this.popoverProps.triggerDisabled,autoClose:this.popoverProps.autoClose,label:this.heading||(this.multiple?this._t9nStrings.headerSelect:this._t9nStrings.header),onCalcitePopoverClose:()=>this.arcgisFieldPickListDismissed.emit(),ref:t=>this.popoverNode=t},s("calcite-flow",{ref:t=>{this.flowElement=t},style:{width:`${this.popoverProps.popoverWidth||this.popoverProps.refElement.getBoundingClientRect().width}px`}},s("calcite-flow-item",{ref:t=>this.panelElement=t,class:"panel",heading:this.heading||(this.multiple?this._t9nStrings.headerSelect:this._t9nStrings.header),closable:!0,onCalciteFlowItemClose:()=>this.arcgisFieldPickListDismissed.emit()},this.multiple&&t,this.showCancel&&i,s("calcite-pick-list",{multiple:this.multiple,ref:t=>{this.pickListNode=t},class:"content",filterEnabled:this.fields.length>=this.showFilterLength,filterPlaceholder:this.filterPlaceholderText??this._t9nStrings.filter,onCalciteListChange:async()=>{const t=await this.pickListNode.getSelectedItems();this.selectedFields=[...new Set([...this.selectedFields.filter((i=>t.has(i))),...t.keys()])],this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields}),this.multiple||this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields})},onCalciteListFilter:t=>{t.stopPropagation();const i=t.target;this.filterFields=i.filteredItems?.map((t=>t.value))}},this.fields.length>=this.showFilterLength&&this.showSort&&o,this.multiple&&this.showSelectionAll&&l,[...this.getSortedList()].map((t=>this.calciteValueList(t))))))))}setUpObserver(){this.observer=new MutationObserver((t=>{for(const i of t)"style"===i.attributeName&&"hidden"===this.popoverNode.style.visibility&&(this.dropdownNode.open=!1)}))}static get assetsDirs(){return["assets"]}get _hostElement(){return o(this)}};p.style=".popover{z-index:100}.panel{min-height:300px}.content{max-height:60vh}.selection-button-div{padding:4px 10px}";export{p as arcgis_field_pick_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,g as s}from"./p-f27af39c.js";import{b as h,n as a,c as e}from"./p-
|
|
1
|
+
import{r as t,c as i,g as s}from"./p-f27af39c.js";import{b as h,n as a,c as e}from"./p-19ebc914.js";const r=class{constructor(s){t(this,s),this.identityReady=i(this,"identityReady",7),this.credentialCreate=i(this,"credentialCreate",7),this.dialogCreate=i(this,"dialogCreate",7),this.identity=void 0,this.appId=void 0,this.credential=void 0,this.expiration=void 0,this.locale=void 0,this.usePopup=!1,this.popupCallbackUrl=void 0,this.portalUrl=void 0,this.preserveUrlHash=!1}appIdWatcher(t,i){i!==t&&this._registerOAuth()}async signIn(){if(!this.credential)try{this.credential=await this._checkCurrentStatus()}catch(t){this.credential=await this._fetchCredential()}return this.credential}async signOut(){if(!this.credential)try{this.identity.destroyCredentials()}catch(t){this.credential=void 0}this.credential=void 0}async connectedCallback(){this.appId&&await this._registerOAuth(),this._proxyEvents(),await this._addWatchers(),this.identityReady.emit({identity:this.identity,ready:!0})}async _addWatchers(){const{watch:t}=await h();t((()=>this._info.expiration),(t=>this.expiration=t),{initial:!0})}_checkCurrentStatus(){return this.identity.checkSignInStatus(`${this._info.portalUrl}/sharing`)}async _createOAuthInfo(){const t={};void 0!==this.appId&&(t.appId=this.appId),void 0!==this.locale&&(t.locale=this.locale),void 0!==this.popupCallbackUrl&&(t.popupCallbackUrl=this.popupCallbackUrl),void 0!==this.preserveUrlHash&&(t.preserveUrlHash=this.preserveUrlHash),void 0!==this.usePopup&&(t.popup=this.usePopup),void 0!==this.portalUrl&&(t.portalUrl=this.portalUrl);const i=await a(t);return this._info=i,i}async _fetchCredential(){return await this.identity.getCredential(`${this._info?.portalUrl}/sharing`,{error:null,oAuthPopupConfirmation:!1,token:null})}async _registerOAuth(){this.identity=await e();const t=await this._createOAuthInfo();this.identity.registerOAuthInfos([t])}_proxyEvents(){this.identity.on("credential-create",(t=>this.credentialCreate.emit(t))),this.identity.on("dialog-create",(t=>this.dialogCreate.emit(t)))}get el(){return s(this)}static get watchers(){return{appId:["appIdWatcher"]}}};r.style=":host{display:none}arcgis-identity{display:none}";export{r as arcgis_identity}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,a as e,h as i,H as n,g as r,F as a}from"./p-f27af39c.js";import{d as l,i as o,a as c,e as u,f as d,g as h,b as f}from"./p-17c2d70f.js";import{F as g,U as m}from"./p-b23318c8.js";var v,p;function y(t){return null!=t}function w(t){return"scene"===t.type?t.associatedLayer?.url:t.url}async function S(t){t.statisticsStatus=v.IN_PROGRESS;const{layer:s,view:e}=t;if("imagery"===s.type||"imagery-tile"===s.type||"stream"===s.type)throw new Error("could not get feature count");try{return await async function(t,s){return"feature"!==t.type||t.url?"feature"===t.type||"csv"===t.type||"scene"===t.type||"wfs"===t.type||"geojson"===t.type?await t.queryFeatureCount():!s||"stream"!==t.type&&"ogc-feature"!==t.type?void 0:async function(t,s){return(await s.whenLayerView(t)).queryFeatureCount()}(t,s):async function(t){const s=t.createQuery();s.outFields=["*"];const e=await t.queryFeatures(s);if(e.features?.length)return e.features.length;throw new Error("could not get feature count")}(t)}(s,e)}catch(t){return}}async function b(t){const{layer:s,modules:e}=t;if(["imagery","imagery-tile","stream","ogc-feature"].indexOf(s.type)>-1)throw new Error("cannot get feature from service");const i=new e.Query({where:"1=1",outFields:["*"],returnGeometry:!1});return s.queryFeatures(i)}!function(t){t.MISSING="missing",t.IN_PROGRESS="inProgress",t.SUCCESS="success",t.FAILED="failed"}(v||(v={})),function(t){t.NUMBER="number",t.STRING="string",t.DATE="date",t.DATE_ONLY="date-only",t.TIME_ONLY="time-only",t.TIMESTAMP_OFFSET="timestamp-offset",t.OID="oid",t.GUID="guid",t.UNKNOWN="unknown"}(p||(p={}));const _=class{constructor(e){t(this,e),this.arcgisFieldInfoComplete=s(this,"arcgisFieldInfoComplete",7),this.view=void 0,this.layer=void 0,this.fieldName=void 0,this.hideStatistics=!1,this.oneFeatureResponse=void 0,this.oneFeatureResponseStatus=v.MISSING,this.statistics=void 0,this.statisticsStatus=v.MISSING,this.uniqueValues=void 0,this.uniqueValuesStatus=v.MISSING,this._lang="",this._t9nLocale="",this._t9nStrings=void 0}async componentWillLoad(){await g(this,e("./assets"));const t=await l(),s=await o(),i=await c(),n=await u(),r=await d(),a=await h(),{view:m,layer:_,fieldName:k,hideStatistics:$}=this;let I;if("esri.layers.support.Sublayer"===_.declaredClass){const t=_,{whenOnce:s}=await f();m&&await s((()=>!m.updating)),I=await t.createFeatureLayer(),await I.load()}this.props={view:m,layer:I||_,fieldName:k,hideStatistics:$,modules:{esriLang:t,esriConfig:s,intl:i,Query:n,summaryStatistics:r,uniqueValues:a}},this.props.fieldInfo=function(t){const{layer:s,fieldName:e}=t;let i;const{popupTemplate:n}=s,r=n?n.fieldInfos:[];return("imagery-tile"===s.type||"imagery"===s.type&&s.rasterFields?.length?s.rasterFields:s.fields).filter((t=>t.name===e)).forEach((s=>{const n=r?r.filter((t=>t.fieldName===s.name)):null,a=n?.length?n[0].label:null;/^raster.(item|service)pixelvalue/i.test(e)&&(s.type="double");const l={layerField:s,label:a||s.alias||s.name};l.codedValues=function(t,s){const{layer:e,modules:i}=s;if("feature"!==e.type)return;const n=e.typeIdField,r=e.types;let a;const l=e.fields.find((s=>s.name===t)),o=l.domain;return n&&r?(n===t?a=r.map((t=>({code:t.id,name:t.name}))):(a=[],r.forEach((s=>{if(s.domains&&s.domains[t]&&"inherited"!==s.domains[t].type)s.domains?.[t]?.codedValues&&s.domains[t].codedValues.forEach((async t=>{let s=!1;a.forEach((e=>{e.code===t.code&&(s=!0,-1===`, ${e.name},`.indexOf(`, ${t.name},`)&&(e.name+=`, ${t.name}`))})),s||a.push(i.esriLang.clone(t))}));else{const t=o;t?.codedValues&&t.codedValues.forEach((async t=>{let s=!1;a.forEach((e=>{e.code===t.code&&(s=!0,-1===`, ${e.name},`.indexOf(`, ${t.name},`)&&(e.name+=`, ${t.name}`))})),s||a.push(i.esriLang.clone(t))}))}}))),!a?.length&&o?.codedValues&&(a=i.esriLang.clone(o.codedValues))):o?.codedValues&&(a=l.domain.codedValues),a?.length?a:null}(e,t),function(t){switch(t.layerField.type){case"string":t.simpleFieldType=p.STRING;break;case"date":t.simpleFieldType=p.DATE;break;case"timestamp-offset":t.simpleFieldType=p.TIMESTAMP_OFFSET;break;case"date-only":t.simpleFieldType=p.DATE_ONLY;break;case"time-only":t.simpleFieldType=p.TIME_ONLY;break;case"oid":t.simpleFieldType=p.OID;break;case"guid":case"global-id":t.simpleFieldType=p.GUID;break;case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":t.simpleFieldType=p.NUMBER}}(l),l.simpleFieldType&&(i=l)})),i}(this.props),"scene"===_.type&&s.request.interceptors?.push({urls:w(_)+"/"+_.layerId,before:function(t){t.requestOptions.authMode="no-prompt"}}),this.oneFeatureResponseStatus=v.IN_PROGRESS;try{const t=await async function(t){const{view:s,layer:e}=t;if("imagery"===e.type||"imagery-tile"===e.type)throw new Error("could not get feature");if("feature"===e.type&&!e.url||"wfs"===e.type){const t=e.createQuery();t.start=0,t.num=5,t.outFields=["*"];const s=await e.queryFeatures(t);if(s.features?.length)return s;throw new Error("could not get feature")}{if(!s)return b(t);const i=await s.whenLayerView(e);if(i.availableFields.length===e.fields.length||["stream","ogc-feature"].indexOf(e.type)>-1&&i.availableFields.length>0){const s=e.createQuery();s.start=0,s.num=5,s.outFields=["*"];const n=await i.queryFeatures(s);return n.features?.length?n:b(t)}return b(t)}}(this.props);this.oneFeatureResponse=t,this.oneFeatureResponseStatus=v.SUCCESS}catch(t){this.oneFeatureResponseStatus=v.FAILED}if("stream"===_.type)return this.uniqueValuesStatus=v.FAILED,void(this.statisticsStatus=v.FAILED);if($)this.uniqueValuesStatus=v.FAILED;else{this.uniqueValuesStatus=v.IN_PROGRESS;try{const t=await async function(t){const{layer:s,view:e,fieldName:i,modules:n}=t;if("imagery"===s.type||"imagery-tile"===s.type)throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer");"feature"!==s.type||s.url||(s.outFields=["*"]);try{return await n.uniqueValues({layer:s,view:e,field:i})}catch(t){throw new Error("could not get unique values")}}(this.props);this.uniqueValues=t,this.uniqueValuesStatus=t?.uniqueValueInfos?.length?v.SUCCESS:v.FAILED}catch(t){this.uniqueValuesStatus=v.FAILED}}if($)this.statisticsStatus=v.FAILED;else{this.statisticsStatus=v.IN_PROGRESS;try{const t=await async function(t){const{layer:s,view:e,fieldName:i,fieldInfo:n,modules:r}=t;if("imagery"===s.type||"imagery-tile"===s.type)throw new Error("could not get statistics for ImageryLayer/ImageryTileLayer");if(!n||"oid"===n.layerField.type||"guid"===n.layerField.type||"global-id"===n.layerField.type){const s=await S(t);return Promise.resolve({totalCount:s,nullcount:0})}try{const n=await r.summaryStatistics({layer:s,view:e,field:i});if(!y(n.count))throw new Error("could not get statistics");const a="sourceJSON"in s&&s.sourceJSON.maxRecordCount===n.count;if(y(n.nullcount)&&!a)return{...n,totalCount:n.count+n.nullcount};{const s=await S(t);return{...n,totalCount:s}}}catch(t){throw new Error("could not get statistics")}}(this.props);if(!y(t.totalCount)&&y(t.count)&&this.uniqueValuesStatus===v.SUCCESS){const s=this.uniqueValues.uniqueValueInfos;for(let e=0;e<s.length;e++){const i=s[e];if(null===i.value){t.totalCount=i.count+t.count;break}}y(t.totalCount)||(t.totalCount=t.count)}this.statistics=t,this.statisticsStatus=v.SUCCESS}catch(t){this.statisticsStatus=v.FAILED}}}async componentDidLoad(){const{props:t}=this,{modules:s}=t;s.intl.setLocale(this._lang)}disconnectedCallback(){m(this)}render(){const{props:t}=this,{fieldInfo:s}=t;return s?i(n,null,i("div",{class:"container"},this.renderFieldType(),this.renderFieldAlias(),this.renderFieldDescription(),this.renderFieldValueType(),this.renderFieldSampleValue(),this.renderFieldFormat(),this.renderFieldStatistics())):i(a,null)}renderFieldType(){const{_t9nStrings:t,props:s}=this,{fieldInfo:e}=s,n=this._getFieldTypeLabel(e.layerField.type);return i("div",{class:"section"},i("div",{class:"title"},t.fieldType),i("div",null,n))}renderFieldAlias(){const{_t9nStrings:t,props:s}=this,{fieldInfo:e}=s;return i("div",{class:"section"},i("div",{class:"title"},t.fieldAlias),i("div",null,e.label))}renderFieldDescription(){const{_t9nStrings:t,props:s}=this,{layer:e}=s;if("feature"!==e.type)return i(a,null);const{fieldInfo:n}=s,r=n.layerField.description;return i("div",{class:"section"},i("div",{class:"title"},t.fieldDescription),i("div",{class:{missing:!r}},r||t.fieldDescriptionNotSet))}renderFieldValueType(){const{_t9nStrings:t,props:s}=this,{layer:e}=s;if("feature"!==e.type)return i(a,null);const{fieldInfo:n}=s,r=this._getFieldValueTypeCamelCase(n);return i("div",{class:"section"},i("div",{class:"title"},t.fieldValueType),i("div",{class:r?"":"missing"},r?t.fieldValueTypes[r]:t.fieldValueTypeNotSet))}renderFieldSampleValue(){const{oneFeatureResponse:t,oneFeatureResponseStatus:s,statisticsStatus:e,statistics:n,uniqueValuesStatus:r,uniqueValues:l,_t9nStrings:o,props:c}=this,{layer:u,fieldName:d,fieldInfo:h}=c,{statistics:f}=o;let g;if(["imagery","imagery-tile"].indexOf(u.type)>-1)return i(a,null);if("stream"!==u.type&&[p.STRING,p.OID,p.GUID].indexOf(this._getStatisticsType(h))>-1&&r!==v.FAILED)return i(a,null);s===v.SUCCESS?t.features.forEach((t=>{(void 0===g||null===g&&null!==t.attributes[d])&&(g=t.attributes[d])})):e===v.SUCCESS?g=n.min:r===v.SUCCESS&&(g=l.uniqueValueInfos?.[0]?.value||l.uniqueValueInfos?.[1]?.value);const m=h.codedValues;return y(g)&&(g=m?m.find((t=>g===t.code))?.name||g:this._getDisplayString(g)),i("div",{class:"section"},i("div",{class:"title"},o.fieldSampleValue),i("div",{class:s===v.FAILED&&e===v.FAILED&&r===v.FAILED||!y(g)?"missing":""},s===v.SUCCESS||e===v.SUCCESS||r===v.SUCCESS?y(g)?`${g}`:f.allNulls:s===v.FAILED&&e===v.FAILED&&r===v.FAILED?o.fieldSampleNotAvailable:o.fieldSampleRetrieving))}renderFieldFormat(){const{_t9nStrings:t,props:s}=this,{fieldName:e,fieldInfo:n,layer:r}=s;if(-1===["single","double","long"].indexOf(n.layerField.type))return i(a,null);const l=r.popupTemplate;if(l?.fieldInfos){const s=l.fieldInfos?.filter((t=>t.fieldName===e));if(s?.length){const e=s[0];if(y(e?.format?.places)){const s=e.format.places;return i("div",{class:"section"},i("div",{class:"title"},t.fieldDecimalPlaces),i("div",null,t.fieldNumDecimalPlaces.replace("${number}",s.toString())))}}}return i("div",{class:"section"},i("div",{class:"title"},t.fieldDecimalPlaces),i("div",{class:"missing"},t.fieldDecimalPlacesNotAvailable))}renderFieldStatistics(){const{statisticsStatus:t,uniqueValuesStatus:s,hideStatistics:e,_t9nStrings:n,props:r}=this,{layer:l,fieldInfo:o}=r;return e||["stream","imagery","imagery-tile"].indexOf(l.type)>-1||["long"].indexOf(o.layerField.type)>-1?(this.arcgisFieldInfoComplete.emit(),i(a,null)):i("div",{class:"section"},i("div",{class:"title"},n.fieldStatistics),t&&t!==v.MISSING&&t!==v.IN_PROGRESS?t===v.FAILED&&s!==v.SUCCESS?this.renderNoStatistics():i("div",{key:"field-info-statistics-content",ref:()=>this.arcgisFieldInfoComplete.emit()},this.renderStatistics()):i("div",{key:"field-info-statistics-content",class:"missing"},n.fieldStatisticsRetrieving))}renderNoStatistics(){const{_t9nStrings:t}=this;return i("div",{key:"field-info-statistics-content",ref:()=>this.arcgisFieldInfoComplete.emit(),class:"missing"},t.fieldStatisticsNotAvailable)}renderStatistics(){const{props:t}=this,{fieldInfo:s}=t;switch(this._getStatisticsType(s)){case p.NUMBER:return this.renderNumberStatistics();case p.STRING:case p.OID:case p.GUID:return this.renderStringStatistics();case p.DATE:case p.DATE_ONLY:case p.TIME_ONLY:case p.TIMESTAMP_OFFSET:return this.renderDateStatistics();default:return i(a,null)}}renderNumberStatistics(){const{statistics:t,_t9nStrings:s}=this;if(!t)return this.renderNoStatistics();const{statistics:e}=s;return i("div",null,i("div",{class:"statistics-row"},i("div",null,e.numberOfValues),i("div",{class:"data"},this._printNumValue(t.totalCount))),y(t.sum)?i("div",{class:"statistics-row"},i("div",null,e.sumOfValues),i("div",{class:"data"},this._printNumValue(t.sum))):null,y(t.min)?i("div",{class:"statistics-row"},i("div",null,e.minimum),i("div",{class:"data"},this._printNumValue(t.min))):null,y(t.max)?i("div",{class:"statistics-row"},i("div",null,e.maximum),i("div",{class:"data"},this._printNumValue(t.max))):null,y(t.avg)?i("div",{class:"statistics-row"},i("div",null,e.average),i("div",{class:"data"},this._printNumValue(t.avg))):null,y(t.stddev)?i("div",{class:"statistics-row"},i("div",null,e.standardDeviation),i("div",{class:"data"},this._printNumValue(t.stddev))):null,this.renderNullValues())}renderStringStatistics(){const{statistics:t,uniqueValuesStatus:s,_t9nStrings:e}=this,{statistics:n}=e;return i("div",null,i("div",{class:"statistics-row"},i("div",null,n.numberOfValues),s!==v.SUCCESS?i("div",{class:"missing"},"--"):i("div",{class:"data"},this._printNumValue(t?.totalCount))),this.renderNullValues(),this.renderTopValues())}renderDateStatistics(){const{statistics:t,view:s,props:e,_t9nStrings:n}=this,{fieldInfo:r}=e;if(!t)return this.renderNoStatistics();const{statistics:a}=n,l=t.max-t.min,o=Math.floor(l/31536e6);let c=Math.floor((l-31536e6*o)/2628e6),u=Math.ceil((l-2628e6*c)/864e5);u>=30&&(c+=1,u=0);let d=1===o?a.timeSpanOptions.year:o>1?a.timeSpanOptions.years.replace("${years}",o.toString()):"";d+=o>0&&(c>0||u>0)?", ":"",d+=1===c?a.timeSpanOptions.month:c>1?a.timeSpanOptions.months.replace("${months}",c.toString()):"",d+=c>0&&u>0?", ":"",d+=1===u?a.timeSpanOptions.day:u>1?a.timeSpanOptions.days.replace("${days}",u.toString()):"";const h=r.simpleFieldType!==p.TIMESTAMP_OFFSET||!s||"unknown"!==s.timeZone,f=r.simpleFieldType===p.TIME_ONLY;return i("div",null,i("div",{class:"statistics-row"},i("div",null,a.numberOfValues),i("div",{class:"data"},this._printNumValue(t?.totalCount))),h&&y(t.min)?i("div",{class:"statistics-row"},i("div",null,f?a.minimumTime:a.minimumDate),i("div",{class:"data"},`${this._getDisplayString(t.min)}`)):null,h&&y(t.max)?i("div",{class:"statistics-row"},i("div",null,f?a.maximumTime:a.maximumDate),i("div",{class:"data"},`${this._getDisplayString(t.max)}`)):null,h&&y(t.avg)?i("div",{class:"statistics-row"},i("div",null,f?a.averageTime:a.averageDate),i("div",{class:"data"},`${this._getDisplayString(t.avg)}`)):null,h&&!f&&y(t.min)&&y(t.max)&&l>0?i("div",{class:"statistics-row"},i("div",null,a.timespan),i("div",{class:"data"},d)):null,this.renderNullValues())}renderTopValues(){const{uniqueValues:t,uniqueValuesStatus:s,_t9nStrings:e,props:n}=this,{fieldInfo:r}=n,{statistics:l}=e;if(t?.uniqueValueInfos?.length){const s=t.uniqueValueInfos;s.sort(((t,s)=>t.count<s.count?1:t.count>s.count?-1:0));const e=r.codedValues,n=s.filter((t=>null!==t.value)).filter(((t,s)=>t&&s<10)).map((t=>{let s=t.value;return e?e.forEach((t=>{s===t.code&&(s=t.name)})):s=this._getDisplayString(s),i("div",{class:"statistics-row"},i("div",{class:"data"},`${s}`),i("div",{class:'$"data" $"count"'},this._printNumValue(t.count)))}));return n.length?i("div",null,i("div",{class:"statistics-row-top-values"},i("div",null,s.length>10?l.topTenValues:l.topValues),i("div",null,l.count)),n):i(a,null)}return i("div",null,i("div",{class:"statistics-row-top-values"},i("div",null,l.topValues),i("div",null,l.count)),i("div",{class:"statistics-row"},i("div",{class:"missing"},s===v.FAILED?e.fieldUniqueValuesNotAvailable:e.fieldSampleRetrieving)))}renderNullValues(){const{statistics:t,uniqueValues:s,_t9nStrings:e}=this,{statistics:n}=e;let r=t?.nullcount;if(!y(r)&&s){const t=s.uniqueValueInfos;for(let s=0;s<t.length;s++){const e=t[s];if(null===e.value){r=e.count;break}}}return i("div",{class:"statistics-row"},i("div",null,n.numberOfNulls),y(r)?i("div",{class:"data"},`${new Number(r).toLocaleString()}`):i("div",{class:"missing"},"--"))}_getFieldTypeLabel(t){const{_t9nStrings:s}=this,e=s.fieldTypes;switch(t){case"small-integer":return e.smallInteger;case"big-integer":return e.bigInteger;case"integer":return e.integer;case"single":return e.single;case"double":return e.double;case"long":return e.long;case"string":default:return e.string;case"date":return e.date;case"date-only":return e.dateOnly;case"time-only":return e.timeOnly;case"timestamp-offset":return e.timestampOffset;case"oid":return e.oid;case"guid":return e.guid;case"global-id":return e.globalId}}_getStatisticsType(t){switch(t.layerField.type){case"small-integer":case"big-integer":case"integer":case"single":case"double":if(t.codedValues)return p.STRING;switch(t.layerField.valueType){case"name-or-title":case"type-or-category":case"description":case"location-or-place-name":case"ordered-or-ranked":case"binary":return p.STRING;default:return p.NUMBER}case"string":return p.STRING;case"date":return p.DATE;case"timestamp-offset":return p.TIMESTAMP_OFFSET;case"date-only":return p.DATE_ONLY;case"time-only":return p.TIME_ONLY;default:return p.STRING}}_getFieldValueTypeCamelCase(t){switch(t.layerField.valueType){case"count-or-amount":return"countOrAmount";case"percentage-or-ratio":return"percentageOrRatio";case"unique-identifier":return"uniqueIdentifier";case"name-or-title":return"nameOrTitle";case"type-or-category":return"typeOrCategory";case"location-or-place-name":return"locationOrPlaceName";case"ordered-or-ranked":return"orderedOrRanked";case"date-and-time":return"dateAndTime";default:return t.layerField.valueType}}_getDisplayString(t){const{props:s}=this,{fieldInfo:e}=s;switch(e.simpleFieldType){case p.DATE:return this._getDateString(t);case p.TIMESTAMP_OFFSET:return this._getTimestampOffsetString(t);case p.DATE_ONLY:return this._getDateOnlyString(t);case p.TIME_ONLY:return this._getTimeOnlyString(t);case p.NUMBER:return this._getNumberString(t);case p.GUID:return this._getGuidString(t);default:return`${t}`}}_getDateString(t){const{modules:s,view:e}=this.props;return s.intl.formatDate(t,e&&"unknown"===e.timeZone?{...s.intl.convertDateFormatToIntlOptions("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}:{...s.intl.convertDateFormatToIntlOptions("short-date-short-time"),timeZone:e?.timeZone||"system"})}_getTimestampOffsetString(t){const{modules:s,view:e}=this.props;return"string"==typeof t?s.intl.formatTimestamp(t,e&&"unknown"===e.timeZone?{...s.intl.convertDateFormatToIntlOptions("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}:{...s.intl.convertDateFormatToIntlOptions("short-date-short-time"),timeZone:e?.timeZone||"system"}):this._getDateString(t)}_getDateOnlyString(t){const{props:s}=this,{modules:e}=s;return e.intl.formatDateOnly(t,e.intl.convertDateFormatToIntlOptions("short-date"))}_getTimeOnlyString(t){const{props:s}=this,{modules:e}=s;return"string"==typeof t?e.intl.formatTimeOnly(t,e.intl.convertDateFormatToIntlOptions("short-date-long-time")):e.intl.formatDate(t,{...e.intl.convertDateFormatToIntlOptions("long-time"),timeZone:"utc"})}_getGuidString(t){return t.startsWith("{")?t:`{${t}}`}_getNumberString(t){return this.props.modules.intl.formatNumber(t)}_printNumValue(t){return y(t)?this._getNumberString(Math.round(100*t)/100):"--"}static get assetsDirs(){return["assets"]}get _hostElement(){return r(this)}};_.style=":host{height:100%}.container{padding:6px;background-color:white}.title{font-weight:bold;padding:5px 0}.missing{color:#a9a9a9}.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:6px 0}.statistics-row{border-top:1px solid #e0e0e0;padding:6px 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:1px solid #e0e0e0;padding:20px 0 6px 0;display:flex;justify-content:space-between}";export{_ as arcgis_field_info}
|
|
1
|
+
import{r as t,c as s,a as e,h as i,H as n,g as r,F as a}from"./p-f27af39c.js";import{d as l,i as o,a as c,e as u,f as d,g as h,b as f}from"./p-19ebc914.js";import{F as g,U as m}from"./p-b23318c8.js";var v,p;function y(t){return null!=t}function w(t){return"scene"===t.type?t.associatedLayer?.url:t.url}async function S(t){t.statisticsStatus=v.IN_PROGRESS;const{layer:s,view:e}=t;if("imagery"===s.type||"imagery-tile"===s.type||"stream"===s.type)throw new Error("could not get feature count");try{return await async function(t,s){return"feature"!==t.type||t.url?"feature"===t.type||"csv"===t.type||"scene"===t.type||"wfs"===t.type||"geojson"===t.type?await t.queryFeatureCount():!s||"stream"!==t.type&&"ogc-feature"!==t.type?void 0:async function(t,s){return(await s.whenLayerView(t)).queryFeatureCount()}(t,s):async function(t){const s=t.createQuery();s.outFields=["*"];const e=await t.queryFeatures(s);if(e.features?.length)return e.features.length;throw new Error("could not get feature count")}(t)}(s,e)}catch(t){return}}async function b(t){const{layer:s,modules:e}=t;if(["imagery","imagery-tile","stream","ogc-feature"].indexOf(s.type)>-1)throw new Error("cannot get feature from service");const i=new e.Query({where:"1=1",outFields:["*"],returnGeometry:!1});return s.queryFeatures(i)}!function(t){t.MISSING="missing",t.IN_PROGRESS="inProgress",t.SUCCESS="success",t.FAILED="failed"}(v||(v={})),function(t){t.NUMBER="number",t.STRING="string",t.DATE="date",t.DATE_ONLY="date-only",t.TIME_ONLY="time-only",t.TIMESTAMP_OFFSET="timestamp-offset",t.OID="oid",t.GUID="guid",t.UNKNOWN="unknown"}(p||(p={}));const _=class{constructor(e){t(this,e),this.arcgisFieldInfoComplete=s(this,"arcgisFieldInfoComplete",7),this.view=void 0,this.layer=void 0,this.fieldName=void 0,this.hideStatistics=!1,this.oneFeatureResponse=void 0,this.oneFeatureResponseStatus=v.MISSING,this.statistics=void 0,this.statisticsStatus=v.MISSING,this.uniqueValues=void 0,this.uniqueValuesStatus=v.MISSING,this._lang="",this._t9nLocale="",this._t9nStrings=void 0}async componentWillLoad(){await g(this,e("./assets"));const t=await l(),s=await o(),i=await c(),n=await u(),r=await d(),a=await h(),{view:m,layer:_,fieldName:k,hideStatistics:$}=this;let I;if("esri.layers.support.Sublayer"===_.declaredClass){const t=_,{whenOnce:s}=await f();m&&await s((()=>!m.updating)),I=await t.createFeatureLayer(),await I.load()}this.props={view:m,layer:I||_,fieldName:k,hideStatistics:$,modules:{esriLang:t,esriConfig:s,intl:i,Query:n,summaryStatistics:r,uniqueValues:a}},this.props.fieldInfo=function(t){const{layer:s,fieldName:e}=t;let i;const{popupTemplate:n}=s,r=n?n.fieldInfos:[];return("imagery-tile"===s.type||"imagery"===s.type&&s.rasterFields?.length?s.rasterFields:s.fields).filter((t=>t.name===e)).forEach((s=>{const n=r?r.filter((t=>t.fieldName===s.name)):null,a=n?.length?n[0].label:null;/^raster.(item|service)pixelvalue/i.test(e)&&(s.type="double");const l={layerField:s,label:a||s.alias||s.name};l.codedValues=function(t,s){const{layer:e,modules:i}=s;if("feature"!==e.type)return;const n=e.typeIdField,r=e.types;let a;const l=e.fields.find((s=>s.name===t)),o=l.domain;return n&&r?(n===t?a=r.map((t=>({code:t.id,name:t.name}))):(a=[],r.forEach((s=>{if(s.domains&&s.domains[t]&&"inherited"!==s.domains[t].type)s.domains?.[t]?.codedValues&&s.domains[t].codedValues.forEach((async t=>{let s=!1;a.forEach((e=>{e.code===t.code&&(s=!0,-1===`, ${e.name},`.indexOf(`, ${t.name},`)&&(e.name+=`, ${t.name}`))})),s||a.push(i.esriLang.clone(t))}));else{const t=o;t?.codedValues&&t.codedValues.forEach((async t=>{let s=!1;a.forEach((e=>{e.code===t.code&&(s=!0,-1===`, ${e.name},`.indexOf(`, ${t.name},`)&&(e.name+=`, ${t.name}`))})),s||a.push(i.esriLang.clone(t))}))}}))),!a?.length&&o?.codedValues&&(a=i.esriLang.clone(o.codedValues))):o?.codedValues&&(a=l.domain.codedValues),a?.length?a:null}(e,t),function(t){switch(t.layerField.type){case"string":t.simpleFieldType=p.STRING;break;case"date":t.simpleFieldType=p.DATE;break;case"timestamp-offset":t.simpleFieldType=p.TIMESTAMP_OFFSET;break;case"date-only":t.simpleFieldType=p.DATE_ONLY;break;case"time-only":t.simpleFieldType=p.TIME_ONLY;break;case"oid":t.simpleFieldType=p.OID;break;case"guid":case"global-id":t.simpleFieldType=p.GUID;break;case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":t.simpleFieldType=p.NUMBER}}(l),l.simpleFieldType&&(i=l)})),i}(this.props),"scene"===_.type&&s.request.interceptors?.push({urls:w(_)+"/"+_.layerId,before:function(t){t.requestOptions.authMode="no-prompt"}}),this.oneFeatureResponseStatus=v.IN_PROGRESS;try{const t=await async function(t){const{view:s,layer:e}=t;if("imagery"===e.type||"imagery-tile"===e.type)throw new Error("could not get feature");if("feature"===e.type&&!e.url||"wfs"===e.type){const t=e.createQuery();t.start=0,t.num=5,t.outFields=["*"];const s=await e.queryFeatures(t);if(s.features?.length)return s;throw new Error("could not get feature")}{if(!s)return b(t);const i=await s.whenLayerView(e);if(i.availableFields.length===e.fields.length||["stream","ogc-feature"].indexOf(e.type)>-1&&i.availableFields.length>0){const s=e.createQuery();s.start=0,s.num=5,s.outFields=["*"];const n=await i.queryFeatures(s);return n.features?.length?n:b(t)}return b(t)}}(this.props);this.oneFeatureResponse=t,this.oneFeatureResponseStatus=v.SUCCESS}catch(t){this.oneFeatureResponseStatus=v.FAILED}if("stream"===_.type)return this.uniqueValuesStatus=v.FAILED,void(this.statisticsStatus=v.FAILED);if($)this.uniqueValuesStatus=v.FAILED;else{this.uniqueValuesStatus=v.IN_PROGRESS;try{const t=await async function(t){const{layer:s,view:e,fieldName:i,modules:n}=t;if("imagery"===s.type||"imagery-tile"===s.type)throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer");"feature"!==s.type||s.url||(s.outFields=["*"]);try{return await n.uniqueValues({layer:s,view:e,field:i})}catch(t){throw new Error("could not get unique values")}}(this.props);this.uniqueValues=t,this.uniqueValuesStatus=t?.uniqueValueInfos?.length?v.SUCCESS:v.FAILED}catch(t){this.uniqueValuesStatus=v.FAILED}}if($)this.statisticsStatus=v.FAILED;else{this.statisticsStatus=v.IN_PROGRESS;try{const t=await async function(t){const{layer:s,view:e,fieldName:i,fieldInfo:n,modules:r}=t;if("imagery"===s.type||"imagery-tile"===s.type)throw new Error("could not get statistics for ImageryLayer/ImageryTileLayer");if(!n||"oid"===n.layerField.type||"guid"===n.layerField.type||"global-id"===n.layerField.type){const s=await S(t);return Promise.resolve({totalCount:s,nullcount:0})}try{const n=await r.summaryStatistics({layer:s,view:e,field:i});if(!y(n.count))throw new Error("could not get statistics");const a="sourceJSON"in s&&s.sourceJSON.maxRecordCount===n.count;if(y(n.nullcount)&&!a)return{...n,totalCount:n.count+n.nullcount};{const s=await S(t);return{...n,totalCount:s}}}catch(t){throw new Error("could not get statistics")}}(this.props);if(!y(t.totalCount)&&y(t.count)&&this.uniqueValuesStatus===v.SUCCESS){const s=this.uniqueValues.uniqueValueInfos;for(let e=0;e<s.length;e++){const i=s[e];if(null===i.value){t.totalCount=i.count+t.count;break}}y(t.totalCount)||(t.totalCount=t.count)}this.statistics=t,this.statisticsStatus=v.SUCCESS}catch(t){this.statisticsStatus=v.FAILED}}}async componentDidLoad(){const{props:t}=this,{modules:s}=t;s.intl.setLocale(this._lang)}disconnectedCallback(){m(this)}render(){const{props:t}=this,{fieldInfo:s}=t;return s?i(n,null,i("div",{class:"container"},this.renderFieldType(),this.renderFieldAlias(),this.renderFieldDescription(),this.renderFieldValueType(),this.renderFieldSampleValue(),this.renderFieldFormat(),this.renderFieldStatistics())):i(a,null)}renderFieldType(){const{_t9nStrings:t,props:s}=this,{fieldInfo:e}=s,n=this._getFieldTypeLabel(e.layerField.type);return i("div",{class:"section"},i("div",{class:"title"},t.fieldType),i("div",null,n))}renderFieldAlias(){const{_t9nStrings:t,props:s}=this,{fieldInfo:e}=s;return i("div",{class:"section"},i("div",{class:"title"},t.fieldAlias),i("div",null,e.label))}renderFieldDescription(){const{_t9nStrings:t,props:s}=this,{layer:e}=s;if("feature"!==e.type)return i(a,null);const{fieldInfo:n}=s,r=n.layerField.description;return i("div",{class:"section"},i("div",{class:"title"},t.fieldDescription),i("div",{class:{missing:!r}},r||t.fieldDescriptionNotSet))}renderFieldValueType(){const{_t9nStrings:t,props:s}=this,{layer:e}=s;if("feature"!==e.type)return i(a,null);const{fieldInfo:n}=s,r=this._getFieldValueTypeCamelCase(n);return i("div",{class:"section"},i("div",{class:"title"},t.fieldValueType),i("div",{class:r?"":"missing"},r?t.fieldValueTypes[r]:t.fieldValueTypeNotSet))}renderFieldSampleValue(){const{oneFeatureResponse:t,oneFeatureResponseStatus:s,statisticsStatus:e,statistics:n,uniqueValuesStatus:r,uniqueValues:l,_t9nStrings:o,props:c}=this,{layer:u,fieldName:d,fieldInfo:h}=c,{statistics:f}=o;let g;if(["imagery","imagery-tile"].indexOf(u.type)>-1)return i(a,null);if("stream"!==u.type&&[p.STRING,p.OID,p.GUID].indexOf(this._getStatisticsType(h))>-1&&r!==v.FAILED)return i(a,null);s===v.SUCCESS?t.features.forEach((t=>{(void 0===g||null===g&&null!==t.attributes[d])&&(g=t.attributes[d])})):e===v.SUCCESS?g=n.min:r===v.SUCCESS&&(g=l.uniqueValueInfos?.[0]?.value||l.uniqueValueInfos?.[1]?.value);const m=h.codedValues;return y(g)&&(g=m?m.find((t=>g===t.code))?.name||g:this._getDisplayString(g)),i("div",{class:"section"},i("div",{class:"title"},o.fieldSampleValue),i("div",{class:s===v.FAILED&&e===v.FAILED&&r===v.FAILED||!y(g)?"missing":""},s===v.SUCCESS||e===v.SUCCESS||r===v.SUCCESS?y(g)?`${g}`:f.allNulls:s===v.FAILED&&e===v.FAILED&&r===v.FAILED?o.fieldSampleNotAvailable:o.fieldSampleRetrieving))}renderFieldFormat(){const{_t9nStrings:t,props:s}=this,{fieldName:e,fieldInfo:n,layer:r}=s;if(-1===["single","double","long"].indexOf(n.layerField.type))return i(a,null);const l=r.popupTemplate;if(l?.fieldInfos){const s=l.fieldInfos?.filter((t=>t.fieldName===e));if(s?.length){const e=s[0];if(y(e?.format?.places)){const s=e.format.places;return i("div",{class:"section"},i("div",{class:"title"},t.fieldDecimalPlaces),i("div",null,t.fieldNumDecimalPlaces.replace("${number}",s.toString())))}}}return i("div",{class:"section"},i("div",{class:"title"},t.fieldDecimalPlaces),i("div",{class:"missing"},t.fieldDecimalPlacesNotAvailable))}renderFieldStatistics(){const{statisticsStatus:t,uniqueValuesStatus:s,hideStatistics:e,_t9nStrings:n,props:r}=this,{layer:l,fieldInfo:o}=r;return e||["stream","imagery","imagery-tile"].indexOf(l.type)>-1||["long"].indexOf(o.layerField.type)>-1?(this.arcgisFieldInfoComplete.emit(),i(a,null)):i("div",{class:"section"},i("div",{class:"title"},n.fieldStatistics),t&&t!==v.MISSING&&t!==v.IN_PROGRESS?t===v.FAILED&&s!==v.SUCCESS?this.renderNoStatistics():i("div",{key:"field-info-statistics-content",ref:()=>this.arcgisFieldInfoComplete.emit()},this.renderStatistics()):i("div",{key:"field-info-statistics-content",class:"missing"},n.fieldStatisticsRetrieving))}renderNoStatistics(){const{_t9nStrings:t}=this;return i("div",{key:"field-info-statistics-content",ref:()=>this.arcgisFieldInfoComplete.emit(),class:"missing"},t.fieldStatisticsNotAvailable)}renderStatistics(){const{props:t}=this,{fieldInfo:s}=t;switch(this._getStatisticsType(s)){case p.NUMBER:return this.renderNumberStatistics();case p.STRING:case p.OID:case p.GUID:return this.renderStringStatistics();case p.DATE:case p.DATE_ONLY:case p.TIME_ONLY:case p.TIMESTAMP_OFFSET:return this.renderDateStatistics();default:return i(a,null)}}renderNumberStatistics(){const{statistics:t,_t9nStrings:s}=this;if(!t)return this.renderNoStatistics();const{statistics:e}=s;return i("div",null,i("div",{class:"statistics-row"},i("div",null,e.numberOfValues),i("div",{class:"data"},this._printNumValue(t.totalCount))),y(t.sum)?i("div",{class:"statistics-row"},i("div",null,e.sumOfValues),i("div",{class:"data"},this._printNumValue(t.sum))):null,y(t.min)?i("div",{class:"statistics-row"},i("div",null,e.minimum),i("div",{class:"data"},this._printNumValue(t.min))):null,y(t.max)?i("div",{class:"statistics-row"},i("div",null,e.maximum),i("div",{class:"data"},this._printNumValue(t.max))):null,y(t.avg)?i("div",{class:"statistics-row"},i("div",null,e.average),i("div",{class:"data"},this._printNumValue(t.avg))):null,y(t.stddev)?i("div",{class:"statistics-row"},i("div",null,e.standardDeviation),i("div",{class:"data"},this._printNumValue(t.stddev))):null,this.renderNullValues())}renderStringStatistics(){const{statistics:t,uniqueValuesStatus:s,_t9nStrings:e}=this,{statistics:n}=e;return i("div",null,i("div",{class:"statistics-row"},i("div",null,n.numberOfValues),s!==v.SUCCESS?i("div",{class:"missing"},"--"):i("div",{class:"data"},this._printNumValue(t?.totalCount))),this.renderNullValues(),this.renderTopValues())}renderDateStatistics(){const{statistics:t,view:s,props:e,_t9nStrings:n}=this,{fieldInfo:r}=e;if(!t)return this.renderNoStatistics();const{statistics:a}=n,l=t.max-t.min,o=Math.floor(l/31536e6);let c=Math.floor((l-31536e6*o)/2628e6),u=Math.ceil((l-2628e6*c)/864e5);u>=30&&(c+=1,u=0);let d=1===o?a.timeSpanOptions.year:o>1?a.timeSpanOptions.years.replace("${years}",o.toString()):"";d+=o>0&&(c>0||u>0)?", ":"",d+=1===c?a.timeSpanOptions.month:c>1?a.timeSpanOptions.months.replace("${months}",c.toString()):"",d+=c>0&&u>0?", ":"",d+=1===u?a.timeSpanOptions.day:u>1?a.timeSpanOptions.days.replace("${days}",u.toString()):"";const h=r.simpleFieldType!==p.TIMESTAMP_OFFSET||!s||"unknown"!==s.timeZone,f=r.simpleFieldType===p.TIME_ONLY;return i("div",null,i("div",{class:"statistics-row"},i("div",null,a.numberOfValues),i("div",{class:"data"},this._printNumValue(t?.totalCount))),h&&y(t.min)?i("div",{class:"statistics-row"},i("div",null,f?a.minimumTime:a.minimumDate),i("div",{class:"data"},`${this._getDisplayString(t.min)}`)):null,h&&y(t.max)?i("div",{class:"statistics-row"},i("div",null,f?a.maximumTime:a.maximumDate),i("div",{class:"data"},`${this._getDisplayString(t.max)}`)):null,h&&y(t.avg)?i("div",{class:"statistics-row"},i("div",null,f?a.averageTime:a.averageDate),i("div",{class:"data"},`${this._getDisplayString(t.avg)}`)):null,h&&!f&&y(t.min)&&y(t.max)&&l>0?i("div",{class:"statistics-row"},i("div",null,a.timespan),i("div",{class:"data"},d)):null,this.renderNullValues())}renderTopValues(){const{uniqueValues:t,uniqueValuesStatus:s,_t9nStrings:e,props:n}=this,{fieldInfo:r}=n,{statistics:l}=e;if(t?.uniqueValueInfos?.length){const s=t.uniqueValueInfos;s.sort(((t,s)=>t.count<s.count?1:t.count>s.count?-1:0));const e=r.codedValues,n=s.filter((t=>null!==t.value)).filter(((t,s)=>t&&s<10)).map((t=>{let s=t.value;return e?e.forEach((t=>{s===t.code&&(s=t.name)})):s=this._getDisplayString(s),i("div",{class:"statistics-row"},i("div",{class:"data"},`${s}`),i("div",{class:'$"data" $"count"'},this._printNumValue(t.count)))}));return n.length?i("div",null,i("div",{class:"statistics-row-top-values"},i("div",null,s.length>10?l.topTenValues:l.topValues),i("div",null,l.count)),n):i(a,null)}return i("div",null,i("div",{class:"statistics-row-top-values"},i("div",null,l.topValues),i("div",null,l.count)),i("div",{class:"statistics-row"},i("div",{class:"missing"},s===v.FAILED?e.fieldUniqueValuesNotAvailable:e.fieldSampleRetrieving)))}renderNullValues(){const{statistics:t,uniqueValues:s,_t9nStrings:e}=this,{statistics:n}=e;let r=t?.nullcount;if(!y(r)&&s){const t=s.uniqueValueInfos;for(let s=0;s<t.length;s++){const e=t[s];if(null===e.value){r=e.count;break}}}return i("div",{class:"statistics-row"},i("div",null,n.numberOfNulls),y(r)?i("div",{class:"data"},`${new Number(r).toLocaleString()}`):i("div",{class:"missing"},"--"))}_getFieldTypeLabel(t){const{_t9nStrings:s}=this,e=s.fieldTypes;switch(t){case"small-integer":return e.smallInteger;case"big-integer":return e.bigInteger;case"integer":return e.integer;case"single":return e.single;case"double":return e.double;case"long":return e.long;case"string":default:return e.string;case"date":return e.date;case"date-only":return e.dateOnly;case"time-only":return e.timeOnly;case"timestamp-offset":return e.timestampOffset;case"oid":return e.oid;case"guid":return e.guid;case"global-id":return e.globalId}}_getStatisticsType(t){switch(t.layerField.type){case"small-integer":case"big-integer":case"integer":case"single":case"double":if(t.codedValues)return p.STRING;switch(t.layerField.valueType){case"name-or-title":case"type-or-category":case"description":case"location-or-place-name":case"ordered-or-ranked":case"binary":return p.STRING;default:return p.NUMBER}case"string":return p.STRING;case"date":return p.DATE;case"timestamp-offset":return p.TIMESTAMP_OFFSET;case"date-only":return p.DATE_ONLY;case"time-only":return p.TIME_ONLY;default:return p.STRING}}_getFieldValueTypeCamelCase(t){switch(t.layerField.valueType){case"count-or-amount":return"countOrAmount";case"percentage-or-ratio":return"percentageOrRatio";case"unique-identifier":return"uniqueIdentifier";case"name-or-title":return"nameOrTitle";case"type-or-category":return"typeOrCategory";case"location-or-place-name":return"locationOrPlaceName";case"ordered-or-ranked":return"orderedOrRanked";case"date-and-time":return"dateAndTime";default:return t.layerField.valueType}}_getDisplayString(t){const{props:s}=this,{fieldInfo:e}=s;switch(e.simpleFieldType){case p.DATE:return this._getDateString(t);case p.TIMESTAMP_OFFSET:return this._getTimestampOffsetString(t);case p.DATE_ONLY:return this._getDateOnlyString(t);case p.TIME_ONLY:return this._getTimeOnlyString(t);case p.NUMBER:return this._getNumberString(t);case p.GUID:return this._getGuidString(t);default:return`${t}`}}_getDateString(t){const{modules:s,view:e}=this.props;return s.intl.formatDate(t,e&&"unknown"===e.timeZone?{...s.intl.convertDateFormatToIntlOptions("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}:{...s.intl.convertDateFormatToIntlOptions("short-date-short-time"),timeZone:e?.timeZone||"system"})}_getTimestampOffsetString(t){const{modules:s,view:e}=this.props;return"string"==typeof t?s.intl.formatTimestamp(t,e&&"unknown"===e.timeZone?{...s.intl.convertDateFormatToIntlOptions("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}:{...s.intl.convertDateFormatToIntlOptions("short-date-short-time"),timeZone:e?.timeZone||"system"}):this._getDateString(t)}_getDateOnlyString(t){const{props:s}=this,{modules:e}=s;return e.intl.formatDateOnly(t,e.intl.convertDateFormatToIntlOptions("short-date"))}_getTimeOnlyString(t){const{props:s}=this,{modules:e}=s;return"string"==typeof t?e.intl.formatTimeOnly(t,e.intl.convertDateFormatToIntlOptions("short-date-long-time")):e.intl.formatDate(t,{...e.intl.convertDateFormatToIntlOptions("long-time"),timeZone:"utc"})}_getGuidString(t){return t.startsWith("{")?t:`{${t}}`}_getNumberString(t){return this.props.modules.intl.formatNumber(t)}_printNumValue(t){return y(t)?this._getNumberString(Math.round(100*t)/100):"--"}static get assetsDirs(){return["assets"]}get _hostElement(){return r(this)}};_.style=":host{height:100%}.container{padding:6px;background-color:white}.title{font-weight:bold;padding:5px 0}.missing{color:#a9a9a9}.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:6px 0}.statistics-row{border-top:1px solid #e0e0e0;padding:6px 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:1px solid #e0e0e0;padding:20px 0 6px 0;display:flex;justify-content:space-between}";export{_ as arcgis_field_info}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-ab5f2576.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-81d57760.js');
|
|
7
7
|
|
|
8
8
|
const apiKeyCss = ":host{display:none}arcgis-api-key{display:none}";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-ab5f2576.js');
|
|
6
|
-
const index$2 = require('./index-
|
|
6
|
+
const index$2 = require('./index-81d57760.js');
|
|
7
7
|
const index$1 = require('./index-f8bf4df6.js');
|
|
8
8
|
|
|
9
9
|
var Status;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-ab5f2576.js');
|
|
6
|
-
const index$2 = require('./index-
|
|
6
|
+
const index$2 = require('./index-81d57760.js');
|
|
7
7
|
const index$1 = require('./index-f8bf4df6.js');
|
|
8
8
|
|
|
9
9
|
const fieldPickListScss = ".popover{z-index:100}.panel{min-height:300px}.content{max-height:60vh}.selection-button-div{padding:4px 10px}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-ab5f2576.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-81d57760.js');
|
|
7
7
|
|
|
8
8
|
const identityCss = ":host{display:none}arcgis-identity{display:none}";
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, g as getElement } from './index-74897166.js';
|
|
2
|
-
import { i as importConfig } from './index-
|
|
2
|
+
import { i as importConfig } from './index-877e3851.js';
|
|
3
3
|
|
|
4
4
|
const apiKeyCss = ":host{display:none}arcgis-api-key{display:none}";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, a as getAssetPath, h, H as Host, g as getElement, F as Fragment } from './index-74897166.js';
|
|
2
|
-
import { d as importCoreLang, i as importConfig, a as importIntl, e as importRestSupportQuery, f as importSmartMappingStatisticsSummaryStatistics, g as importSmartMappingStatisticsUniqueValues, b as importCoreReactiveUtils } from './index-
|
|
2
|
+
import { d as importCoreLang, i as importConfig, a as importIntl, e as importRestSupportQuery, f as importSmartMappingStatisticsSummaryStatistics, g as importSmartMappingStatisticsUniqueValues, b as importCoreReactiveUtils } from './index-877e3851.js';
|
|
3
3
|
import { F, U } from './index-e7244815.js';
|
|
4
4
|
|
|
5
5
|
var Status;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as getAssetPath, H as Host, g as getElement } from './index-74897166.js';
|
|
2
|
-
import { a as importIntl } from './index-
|
|
2
|
+
import { a as importIntl } from './index-877e3851.js';
|
|
3
3
|
import { F, U, C } from './index-e7244815.js';
|
|
4
4
|
|
|
5
5
|
const fieldPickListScss = ".popover{z-index:100}.panel{min-height:300px}.content{max-height:60vh}.selection-button-div{padding:4px 10px}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, g as getElement } from './index-74897166.js';
|
|
2
|
-
import { b as importCoreReactiveUtils, n as newIdentityOAuthInfo, c as importIdentityIdentityManager } from './index-
|
|
2
|
+
import { b as importCoreReactiveUtils, n as newIdentityOAuthInfo, c as importIdentityIdentityManager } from './index-877e3851.js';
|
|
3
3
|
|
|
4
4
|
const identityCss = ":host{display:none}arcgis-identity{display:none}";
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@arcgis/common-components",
|
|
3
3
|
"description": "ArcGIS Common Components",
|
|
4
4
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
5
|
-
"version": "4.29.0-beta.
|
|
5
|
+
"version": "4.29.0-beta.44",
|
|
6
6
|
"module": "dist/components/index.js",
|
|
7
7
|
"main": "dist/index.cjs.js",
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"@stencil/core": "4.7.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@arcgis/components-plugins": "4.29.0-beta.
|
|
56
|
-
"@arcgis/components-utils": "4.29.0-beta.
|
|
55
|
+
"@arcgis/components-plugins": "4.29.0-beta.44",
|
|
56
|
+
"@arcgis/components-utils": "4.29.0-beta.44",
|
|
57
57
|
"@arcgis/core": ">=4.29.0-next <4.30",
|
|
58
|
-
"@arcgis/core-adapter": "4.29.0-beta.
|
|
59
|
-
"@arcgis/map-components": "4.29.0-beta.
|
|
58
|
+
"@arcgis/core-adapter": "4.29.0-beta.44",
|
|
59
|
+
"@arcgis/map-components": "4.29.0-beta.44",
|
|
60
60
|
"@arcgis/typescript-config": "1.0.0",
|
|
61
61
|
"@esri/calcite-components": "^2.1.0",
|
|
62
62
|
"@stencil/angular-output-target": "0.8.1",
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
"rimraf": "^5.0.0",
|
|
81
81
|
"storybook": "^7.6.0",
|
|
82
82
|
"typescript": "5.2.2",
|
|
83
|
-
"vite": "^5.0
|
|
83
|
+
"vite": "^4.5.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@arcgis/core": ">=4.29.0-next <4.30",
|
|
87
87
|
"@esri/calcite-components": "^2.1.0"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "6de003aff308be8dd552425a13be7eaa75957ca4"
|
|
90
90
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|