@arcgis/common-components 5.1.0-next.19 → 5.1.0-next.20

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/README.md CHANGED
@@ -1,6 +1,29 @@
1
1
  # ArcGIS Maps SDK for JavaScript - Common Components
2
2
 
3
- The ArcGIS Maps SDK for JavaScript provides a suite of ready-to-use UI components that simplify the process of creating GIS web applications. This package contains the `arcgis-slider` and `arcgis-histogram` components, which can be used as common components to build web mapping applications.
3
+ The ArcGIS Maps SDK for JavaScript provides a suite of ready-to-use UI components that simplify the process of creating GIS web applications. This package contains the [Histogram](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-histogram/), [Slider](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/), and [Ticks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/) components.
4
+
5
+ Want to get started immediately? See [Get started](https://developers.arcgis.com/javascript/latest/get-started/) or try out the [sample applications](https://developers.arcgis.com/javascript/latest/sample-code/?tagged=common-components).
6
+
7
+ ## Documentation
8
+
9
+ - [Key Features](https://developers.arcgis.com/javascript/latest/key-features/)
10
+ - [Build with npm](https://developers.arcgis.com/javascript/latest/get-started/#npm)
11
+ - [API and component references](https://developers.arcgis.com/javascript/latest/references/)
12
+ - [Functionality samples](https://developers.arcgis.com/javascript/latest/sample-code/)
13
+ - [TypeScript setup](https://developers.arcgis.com/javascript/latest/get-started/#typescript)
14
+
15
+ ## Resources
16
+
17
+ - [ArcGIS blog](https://blogs.esri.com/esri/arcgis/tag/javascript/)
18
+ - [System Requirements](https://developers.arcgis.com/javascript/latest/system-requirements/)
19
+ - [Terms of Use](https://www.esri.com/en-us/legal/terms/product-specific-scope-of-use)
20
+ - [Licensing](https://developers.arcgis.com/javascript/latest/licensing/)
21
+ - [Working with `next` versions](https://github.com/Esri/feedback-js-api-next/blob/main/README.md)
22
+
23
+ ## Issues
24
+
25
+ - General questions about using this package or the ArcGIS Maps SDK for JavaScript? See the [Esri developer community](https://community.esri.com/t5/arcgis-api-for-javascript/ct-p/arcgis-api-for-javascript).
26
+ - [Technical support](https://support.esri.com/).
4
27
 
5
28
  ## License
6
29
 
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as f}from"./EKKJN7WZ.js";import{a as k}from"./23DDMSOB.js";import{a as B}from"./7Y42J3JI.js";import{b as C}from"./7PB2GGQH.js";import"./7CI55VCH.js";import{A as I,B as O,H as R,g as L,i as w,m as q,n as Z,q as F,z as U}from"./UTXWKXMT.js";export default $arcgis.t(([{formatDate:N,convertDateFormatToIntlOptions:v,formatDateOnly:Q,formatTimeOnly:X,formatTimestamp:_,formatNumber:Y},ee,{clone:E}])=>{function M(t){return new Date(`1970-01-01T${t}Z`).getTime()}function A(t){return new Date(`${t} 00:00:00`).getTime()}function te(t,e,s){let i;return e==="unknown"?i=N(t,{...v("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):i=N(t,{...v("short-date-short-time"),timeZone:e}),i}function ie(t){return t?Q(t,v("short-date")):""}function se(t){let e;return typeof t=="string"?e=X(t,v("short-date-long-time")):e=N(t,{...v("long-time"),timeZone:"utc"}),e}function ne(t,e){return typeof t=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?_(t,{...v("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):_(t,{...v("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?N(t,{...v("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):N(t,{...v("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function W(t,e,s){if(t.type!=="feature"&&t.type!=="subtype-group"&&t.type!=="subtype-sublayer"&&t.type!=="imagery")return;let i;return x(t,s).fields.forEach(l=>{let n=l.name,d="domain"in l?l.domain:void 0;if(t.type!=="imagery"&&t.subtypeField===n){let m;t.type==="subtype-group"||t.type==="feature"?m=t.subtypes:m=t.parent.subtypes,m.forEach(r=>{t.type==="subtype-sublayer"&&t.subtypeCode!==r.code||(e.name===n&&(i=i||[],i.push({code:r.code,name:r.name})),r.domains&&Object.keys(r.domains).forEach(a=>{if(e.name===a){let o=r.domains[a];o?.type==="coded-value"&&o?.codedValues&&o.codedValues.forEach(u=>{let c=!1;i=i||[],i.forEach(g=>{g.code===u.code&&(c=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),c||i.push({code:u.code,name:u.name})})}}))})}if(e.name===n&&(t.type==="feature"||t.type==="imagery")){let m=t.type==="feature"?t.typeIdField:void 0,r=t.type==="feature"?t.types:void 0;t.type==="feature"&&m&&r?(m===n?i=r.map(a=>({code:a.id,name:a.name})):(i=i||[],r.forEach(a=>{if(!a.domains?.[n]||a.domains[n].type==="inherited"){let o=d;o?.codedValues&&o.codedValues.forEach(u=>{let c=!1;i.forEach(g=>{g.code===u.code&&(c=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),c||i.push(E(u))})}else a.domains?.[n]?.codedValues&&a.domains[n].codedValues.forEach(o=>{let u=!1;i.forEach(c=>{c.code===o.code&&(u=!0,`| ${c.name} |`.includes(`| ${o.name} |`)||(c.name+=` | ${o.name}`))}),u||i.push(E(o))})})),!i?.length&&d?.codedValues&&(i=E(d.codedValues))):d?.codedValues&&(i=d.codedValues)}}),i}function D(t,e){let s=e;if(s){let i="";for(let l=0;l<s.length;l++){let n=s[l];n.code==t&&(i+=(i.length?" | ":"")+n.name)}return i.length||(i=`${t}`),i}return t}function P(t){return["small-integer","big-integer","integer","single","double","long"].includes(t.type)}function z(t){switch(t.type){case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":return"number";case"blob":case"geometry":case"global-id":case"guid":case"oid":case"raster":case"xml":return;default:return t.type}}function x(t,e){return e==="feature-reduction"&&"featureReduction"in t?t.featureReduction:t}var ae=L`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`,S=class extends O{constructor(){super(...arguments),this.dropdownNode=U(),this._messages=C({blocking:!0}),this._propWatcherTask=new k(this,{task:async([e,s,i])=>{let l=f(e)&&f(s)||f(i);if(!f(i)&&!f(e)&&!f(s)?q("error",this,Z("uniqueValues")):f(i)||(f(e)||q("error",this,Z("layer")),f(s)||q("error",this,Z("fieldName"))),f(e)&&f(s)){let{fieldSource:n}=this;if(!x(e,n).fields?.filter(d=>d.name===s))throw q("error",this,"Field could not be found."),new Error}if(!l)throw new Error;await this.processProps()},args:()=>[this.layer,this.fieldName,this.uniqueValues]}),this.initialRender=!0,this.multiple=!1,this.partialUniqueValues=!1,this.showFilterLength=10,this.arcgisChange=F(),this.arcgisSortByChange=F(),this.arcgisLoad=F()}static{this.properties={initialRender:16,view:0,layer:0,fieldSource:1,fieldName:1,uniqueValues:0,numberFormatOptions:0,selectedValues:0,sortBy:1,multiple:5,partialUniqueValues:5,showFilterLength:9,maxHeight:9}}static{this.styles=ae}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(f(e?.uniqueValueInfos)){let{uniqueValueInfos:s,partialUniqueValues:i}=e;return{uniqueValues:s,partialUniqueValues:i}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}async processProps(){let{layer:e,fieldName:s,view:i,fieldSource:l}=this,n=(e?x(e,l):void 0)?.fields?.filter(d=>d.name===s)?.[0];if(f(this.uniqueValues))this.fieldInfo={layerField:n,fieldDomains:e&&n?W(e,n,l):void 0,simpleType:e&&n?z(n):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&n){this.fieldInfo={layerField:n,fieldDomains:W(e,n,l),simpleType:z(n),partialUniqueValues:!1};let{fieldInfo:d}=this;try{let m=await ee({layer:e,view:i,field:s,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:!1}),r=P(n),a=m.uniqueValueInfos.filter(o=>f(o.value)?n.type==="string"&&!r||n.type==="guid"?o.value!=="<Null>"&&`${o.value}`.trim()!=="":(P(n)||n.type,o.value!=="<Null>"&&o.value!==""):!1);a.sort((o,u)=>o.count>u.count?-1:o.count<u.count?1:0),d.fieldDomains?.length&&d.fieldDomains.forEach(o=>{a.find(u=>u.value===o.code)||a.push({value:o.code,count:0})}),d.uniqueValueInfos=a,d.partialUniqueValues=m.uniqueValueInfos.length===2e3,this.arcgisLoad.emit()}catch(m){if(q("error",this,`uniqueValues() - ${m.message}`),this.hasFieldDomains(d)){let r=[];d.fieldDomains.forEach(a=>{r.find(o=>o.value===a.code)||r.push({value:a.code,count:void 0})})}}setTimeout(()=>{this.initialRender=!1,this.listNode?.setFocus()},800)}}setListRef(e){let{maxHeight:s}=this;this.listNode=e,s&&e?.setAttribute("style",`max-height: ${s||400}px`)}onSortMenuSelect(e){let s=e.currentTarget.selectedItems?.[0].getAttribute("data-value");this.sortBy=s||void 0,this.arcgisSortByChange.emit(s||void 0)}isSameLists(e,s){if(!e&&!s)return!0;if(!e||!s||e?.length!==s?.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==s[i])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:s,sortBy:i,multiple:l,initialRender:n,showFilterLength:d,_messages:m}=this,{fieldDomains:r,uniqueValueInfos:a,partialUniqueValues:o,layerField:u}=e,c=u?.type;if(!a?.length)return"";let g=c?["small-integer","big-integer","integer","single","double","long","oid"].includes(c):!1,H=c?["date","date-only","time-only"].includes(c):!1,j=y=>{y.sort((h,p)=>h.count<=p.count?1:-1)},G=y=>{let h=r?.length;y.sort((p,V)=>{if(!h&&g)return(typeof p.value=="string"?Number.parseFloat(p.value):p.value)-(typeof V.value=="string"?Number.parseFloat(V.value):V.value);{let $=h?D(p.value,r):p.value,b=h?D(V.value,r):V.value;return`${$}`.startsWith("_")?1:`${b}`.startsWith("_")?-1:`${$}`.localeCompare(`${b}`)}})},J=(y,h)=>{y.sort((p,V)=>{let $=h?.indexOf(p.value)??-1,b=h?.indexOf(V.value)??-1;return $===b||$>-1&&b>-1?0:$>b?-1:1})};G(a),!i||i==="count"?j(a):i==="selected"&&J(a,s);let K=a.map(y=>this.renderUniqueValue(y)),T;return o&&!n&&(T=w`<div class="unique-values-content-list-msg">${m.errors.tooManyUniqueValues}</div>`),w`<div class="container"><calcite-list .label=${m.values} class="popover-unique-list" .filterEnabled=${a.length>=d} .selectionMode=${l?"multiple":"single"} .filterPlaceholder=${m.searchValues} @calciteListChange=${y=>{let h=y.target.selectedItems.map(p=>p.value);!r&&c==="date-only"?h=h?.map(p=>A(p)):!r&&c==="time-only"?h=h?.map(p=>M(p)):c&&["date","oid","small-integer","big-integer","integer","long"].includes(c)?h=h?.map(p=>Number.parseInt(p)):c&&["single","double"].includes(c)&&(h=h?.map(p=>Number.parseFloat(p))),!this.isSameLists(h,this.selectedValues)&&(this.selectedValues=h,this.arcgisChange.emit(h))}} @calciteListFilter=${()=>{this.dropdownNode.value&&(this.dropdownNode.value.disabled=this.listNode.filteredItems.length<4)}} ${I(this.setListRef)}>${a.length>=d&&!n?this.renderSort(g,H):null}${K}</calcite-list>${T}</div>`},error:()=>""})}renderSort(e,s){let{sortBy:i,_messages:l}=this;return w`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${I(this.dropdownNode)}><calcite-action slot=trigger .label=${l.sortValues} text><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${i==="count"||!f(i)} data-value=count>${l.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${i==="name"} data-value=name>${e||s?l.sortAscending:l.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${i==="selected"} data-value=selected>${l.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:s,initialRender:i,view:l,fieldInfo:n,numberFormatOptions:d}=this,{fieldDomains:m,uniqueValueInfos:r,simpleType:a}=n,o=l&&"timeZone"in l&&l.timeZone||"system",u=m?.length?D(e.value,m):a==="date"?te(e.value,o):a==="date-only"?ie(e.value):a==="time-only"?se(e.value):a==="timestamp-offset"?ne(e.value,l):typeof e.value=="number"?Y(e.value,d):e.value,c=s?a==="date-only"?s.includes(m?.length?e.value:A(e.value)):a==="time-only"?s.includes(m?.length?e.value:M(e.value)):s.includes(e.value):!1;return B(`list-item_${e.value}`,w`<calcite-list-item .label=${`${u}`} .value=${`${e.value}`} .selected=${c}>${f(e.count)&&(r.length>200&&!i||r.length<=200)?w`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};R("arcgis-unique-values-list",S);return S},"intl","smartMapping/statistics/uniqueValues","core/lang")
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{G as i,v as e}from"./UTXWKXMT.js";var s=e(i,{"arcgis-ckeditor5":[()=>import("./AXTSUI2Q.js"),"canResizeVertically,currentLanguage,customConfig,customExpressionCheck:,editorType,groupFieldsAndExpressions,intlExpressionsGroupHeading,intlFieldsGroupHeading,intlTextPlaceHolder,mentionFields:,readOnly,textData;getData,setFocus"],"arcgis-ckeditor5-popover":[()=>import("./4DCAUWTC.js"),"guid,intlCancel,intlLabel,intlOk,refElement:;reposition"],"arcgis-color-input":[()=>import("./C6JAR4IN.js"),"_messages:,clearable,color,compact,disabled,hideRecentColors,messageOverrides:,placement,popoverProps:,showTransparency,storageId;close,setFocus"],"arcgis-field-info":[()=>import("./4CW7U27R.js"),"_messages:,fieldName,hideAlias,hideNumericFormat,hideStatistics,layer:,view:;refresh"],"arcgis-field-pick-list":[()=>import("./ZLXAKPUH.js"),"_messages:,customExpressionCheck:,expressionsGroupHeading,fields:,fieldsGroupHeading,filterNoResultsText,filterPlaceholderText,groupFieldsAndExpressions,heading,hideCancel,hideSort,layer:,listOnly,mapView:,multiple,okBtnText,popoverProps:,selectedFields:,showCancel,showDescription,showFieldInfo,showFieldName,showFieldTypeIcon,showFilterLength,showSelectionAll,showSort,sortBy,view:;reposition,setDisabled,setFocus"],"arcgis-histogram":[()=>import("./6DQVLQL6.js"),"_messages:,average,bins:,colorBlendingEnabled,colorStops:,dataLines:,icon,label,layout,max,messageOverrides:,min,standardDeviation"],"arcgis-label-input":[()=>import("./ZL3E4ZGE.js"),"alignment,editing,labelFormatter:,readOnly,value;edit;getLabelBoundingClientRect"],"arcgis-picker-input":[()=>import("./J5X5TNVW.js"),"disabled,heading,iconEnd,intlDone,label,popoverProps:;close,setFocus"],"arcgis-ramp-color":[()=>import("./YVSTPEPS.js"),"layout,max,min,stops:"],"arcgis-ramp-color-break":[()=>import("./7HQMPKZO.js"),"layout,max,min,stops:"],"arcgis-ramp-opacity":[()=>import("./ZOWIFVL3.js"),"fillColor,layout,max,min,stops:"],"arcgis-slider":[()=>import("./JTRO7GRS.js"),"activeValue:,allowValuesOverlap,autoDestroyDisabled,disabled,fillPlacement,fullRangeMax,fullRangeMin,keyboardLargeStep,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverLabel,popoverPlacement,precision,rangeLabelsEditingEnabled,rangeLabelsPlacement,segmentsDraggingDisabled,showRangeLabels,steps,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values;destroy"],"arcgis-slider-input":[()=>import("./XEB2RUND.js"),"disabled,flipLabels,label,max,min,step,unitsLabel,value,withSteppers"],"arcgis-ticks":[()=>import("./3O7GAC23.js"),"interactive,interpolationExponent,labelFormatter:,labelPlacement,layout,max,min,mirrored,mode,showBaseline,showLabels,values"],"arcgis-unique-values-list":[()=>import("./2BDHDUXG.js"),"_messages:,fieldName,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:;getUniqueValues,setFocus"]});s({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-ckeditor5,arcgis-ckeditor5-popover,arcgis-color-input,arcgis-field-info,arcgis-field-pick-list,arcgis-histogram,arcgis-label-input,arcgis-picker-input,arcgis-ramp-color,arcgis-ramp-color-break,arcgis-ramp-opacity,arcgis-slider,arcgis-slider-input,arcgis-ticks,arcgis-unique-values-list){visibility:hidden}:root{--arcgis-ckeditor5-initial-height: 30vh;--arcgis-ckeditor5-max-width: 35vw;--arcgis-ckeditor5-mentions-max-width: 33vw;--arcgis-common-ckeditor5-initial-height: 30vh;--arcgis-common-ckeditor5-max-width: 35vw;--arcgis-common-ckeditor5-mentions-max-width: 33vw}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,i)
2
+ import{G as i,v as e}from"./UTXWKXMT.js";var s=e(i,{"arcgis-ckeditor5":[()=>import("./AXTSUI2Q.js"),"canResizeVertically,currentLanguage,customConfig,customExpressionCheck:,editorType,groupFieldsAndExpressions,intlExpressionsGroupHeading,intlFieldsGroupHeading,intlTextPlaceHolder,mentionFields:,readOnly,textData;getData,setFocus"],"arcgis-ckeditor5-popover":[()=>import("./4DCAUWTC.js"),"guid,intlCancel,intlLabel,intlOk,refElement:;reposition"],"arcgis-color-input":[()=>import("./C6JAR4IN.js"),"_messages:,clearable,color,compact,disabled,hideRecentColors,messageOverrides:,placement,popoverProps:,showTransparency,storageId;close,setFocus"],"arcgis-field-info":[()=>import("./4CW7U27R.js"),"_messages:,fieldName,hideAlias,hideNumericFormat,hideStatistics,layer:,view:;refresh"],"arcgis-field-pick-list":[()=>import("./ZLXAKPUH.js"),"_messages:,customExpressionCheck:,expressionsGroupHeading,fields:,fieldsGroupHeading,filterNoResultsText,filterPlaceholderText,groupFieldsAndExpressions,heading,hideCancel,hideSort,layer:,listOnly,mapView:,multiple,okBtnText,popoverProps:,selectedFields:,showCancel,showDescription,showFieldInfo,showFieldName,showFieldTypeIcon,showFilterLength,showSelectionAll,showSort,sortBy,view:;reposition,setDisabled,setFocus"],"arcgis-histogram":[()=>import("./6DQVLQL6.js"),"_messages:,average,bins:,colorBlendingEnabled,colorStops:,dataLines:,icon,label,layout,max,messageOverrides:,min,standardDeviation"],"arcgis-label-input":[()=>import("./ZL3E4ZGE.js"),"alignment,editing,labelFormatter:,readOnly,value;edit;getLabelBoundingClientRect"],"arcgis-picker-input":[()=>import("./J5X5TNVW.js"),"disabled,heading,iconEnd,intlDone,label,popoverProps:;close,setFocus"],"arcgis-ramp-color":[()=>import("./YVSTPEPS.js"),"layout,max,min,stops:"],"arcgis-ramp-color-break":[()=>import("./7HQMPKZO.js"),"layout,max,min,stops:"],"arcgis-ramp-opacity":[()=>import("./ZOWIFVL3.js"),"fillColor,layout,max,min,stops:"],"arcgis-slider":[()=>import("./JTRO7GRS.js"),"activeValue:,allowValuesOverlap,autoDestroyDisabled,disabled,fillPlacement,fullRangeMax,fullRangeMin,keyboardLargeStep,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverLabel,popoverPlacement,precision,rangeLabelsEditingEnabled,rangeLabelsPlacement,segmentsDraggingDisabled,showRangeLabels,steps,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values;destroy"],"arcgis-slider-input":[()=>import("./XEB2RUND.js"),"disabled,flipLabels,label,max,min,step,unitsLabel,value,withSteppers"],"arcgis-ticks":[()=>import("./3O7GAC23.js"),"interactive,interpolationExponent,labelFormatter:,labelPlacement,layout,max,min,mirrored,mode,showBaseline,showLabels,values"],"arcgis-unique-values-list":[()=>import("./GAR4QMLU.js"),"_messages:,fieldName,fieldSource,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:;getUniqueValues,setFocus"]});s({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-ckeditor5,arcgis-ckeditor5-popover,arcgis-color-input,arcgis-field-info,arcgis-field-pick-list,arcgis-histogram,arcgis-label-input,arcgis-picker-input,arcgis-ramp-color,arcgis-ramp-color-break,arcgis-ramp-opacity,arcgis-slider,arcgis-slider-input,arcgis-ticks,arcgis-unique-values-list){visibility:hidden}:root{--arcgis-ckeditor5-initial-height: 30vh;--arcgis-ckeditor5-max-width: 35vw;--arcgis-ckeditor5-mentions-max-width: 33vw;--arcgis-common-ckeditor5-initial-height: 30vh;--arcgis-common-ckeditor5-max-width: 35vw;--arcgis-common-ckeditor5-mentions-max-width: 33vw}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,i)
@@ -2,6 +2,7 @@
2
2
  /// <reference types="@arcgis/core/interfaces.d.ts" />
3
3
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
4
4
  import type { SupportedLayer } from "./utils/basic.js";
5
+ import type { FieldSource } from "../../utils/types.js";
5
6
  import type { T9nMeta } from "@arcgis/lumina/controllers";
6
7
 
7
8
  /**
@@ -32,6 +33,8 @@ export abstract class ArcgisUniqueValuesList extends LitElement {
32
33
  }>;
33
34
  /** Field name, required if uniqueValues is not provided, if component needs to format values, or needs to check for field domains. */
34
35
  accessor fieldName: string | undefined;
36
+ /** Optional, specify field source other than the layer's fields. */
37
+ accessor fieldSource: FieldSource | undefined;
35
38
  /** Layer instance, required if uniqueValues is not provided, if component needs to format values, or needs to check for field domains. */
36
39
  accessor layer: SupportedLayer | undefined;
37
40
  /** Optional, max height of list in pixel. */
@@ -1,127 +1,127 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as M } from "../../chunks/runtime.js";
3
- import { css as P, html as q } from "lit";
4
- import { keyed as W } from "lit/directives/keyed.js";
5
- import { LitElement as z, createEvent as D } from "@arcgis/lumina";
6
- import { Task as H } from "@lit/task";
7
- import { createRef as j, ref as S } from "lit/directives/ref.js";
8
- import { log as V, composeMissingPropertyMessage as F } from "@arcgis/toolkit/log";
9
- import { formatDate as w, convertDateFormatToIntlOptions as v, formatDateOnly as G, formatTimeOnly as J, formatTimestamp as T, formatNumber as K } from "@arcgis/core/intl.js";
10
- import Q from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
11
- import { clone as N } from "@arcgis/core/core/lang.js";
2
+ import { c as P } from "../../chunks/runtime.js";
3
+ import { css as W, html as F } from "lit";
4
+ import { keyed as z } from "lit/directives/keyed.js";
5
+ import { LitElement as H, createEvent as D } from "@arcgis/lumina";
6
+ import { Task as j } from "@lit/task";
7
+ import { createRef as G, ref as x } from "lit/directives/ref.js";
8
+ import { log as S, composeMissingPropertyMessage as N } from "@arcgis/toolkit/log";
9
+ import { formatDate as w, convertDateFormatToIntlOptions as b, formatDateOnly as J, formatTimeOnly as K, formatTimestamp as O, formatNumber as Q } from "@arcgis/core/intl.js";
10
+ import X from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
11
+ import { clone as I } from "@arcgis/core/core/lang.js";
12
12
  import { i as h } from "../../chunks/commonFunctions.js";
13
- import { u as X } from "../../chunks/useT9n.js";
14
- function x(i) {
13
+ import { u as Y } from "../../chunks/useT9n.js";
14
+ function U(i) {
15
15
  return (/* @__PURE__ */ new Date(`1970-01-01T${i}Z`)).getTime();
16
16
  }
17
- function O(i) {
17
+ function L(i) {
18
18
  return (/* @__PURE__ */ new Date(`${i} 00:00:00`)).getTime();
19
19
  }
20
- function Y(i, e, t) {
21
- let o;
22
- return e === "unknown" ? o = w(i, {
23
- ...v("short-date-short-time"),
20
+ function ee(i, e, s) {
21
+ let t;
22
+ return e === "unknown" ? t = w(i, {
23
+ ...b("short-date-short-time"),
24
24
  timeZone: "utc",
25
25
  timeZoneName: "shortOffset"
26
- }) : o = w(i, {
27
- ...v("short-date-short-time"),
26
+ }) : t = w(i, {
27
+ ...b("short-date-short-time"),
28
28
  timeZone: e
29
- }), o;
30
- }
31
- function ee(i) {
32
- return i ? G(i, v("short-date")) : "";
29
+ }), t;
33
30
  }
34
31
  function te(i) {
32
+ return i ? J(i, b("short-date")) : "";
33
+ }
34
+ function ie(i) {
35
35
  let e;
36
- return typeof i == "string" ? e = J(i, v("short-date-long-time")) : e = w(i, {
37
- ...v("long-time"),
36
+ return typeof i == "string" ? e = K(i, b("short-date-long-time")) : e = w(i, {
37
+ ...b("long-time"),
38
38
  timeZone: "utc"
39
39
  }), e;
40
40
  }
41
- function ie(i, e) {
42
- return typeof i == "string" ? e && "timeZone" in e && e.timeZone === "unknown" ? T(i, {
43
- ...v("short-date-short-time"),
41
+ function se(i, e) {
42
+ return typeof i == "string" ? e && "timeZone" in e && e.timeZone === "unknown" ? O(i, {
43
+ ...b("short-date-short-time"),
44
44
  timeZone: "utc",
45
45
  timeZoneName: "shortOffset"
46
- }) : T(i, {
47
- ...v("short-date-short-time"),
46
+ }) : O(i, {
47
+ ...b("short-date-short-time"),
48
48
  timeZone: e && "timeZone" in e && e.timeZone ? e.timeZone : "system"
49
49
  }) : e && "timeZone" in e && e.timeZone === "unknown" ? w(i, {
50
- ...v("short-date-short-time"),
50
+ ...b("short-date-short-time"),
51
51
  timeZone: "utc",
52
52
  timeZoneName: "shortOffset"
53
53
  }) : w(i, {
54
- ...v("short-date-short-time"),
54
+ ...b("short-date-short-time"),
55
55
  timeZone: e && "timeZone" in e && e.timeZone ? e.timeZone : "system"
56
56
  });
57
57
  }
58
- function U(i, e) {
58
+ function R(i, e, s) {
59
59
  if (i.type !== "feature" && i.type !== "subtype-group" && i.type !== "subtype-sublayer" && i.type !== "imagery")
60
60
  return;
61
61
  let t;
62
- return i.fields.forEach((o) => {
63
- const n = o.name, r = o.domain;
64
- if (i.type !== "imagery" && i.subtypeField === n) {
65
- let m;
66
- i.type === "subtype-group" || i.type === "feature" ? m = i.subtypes : m = i.parent.subtypes, m.forEach((u) => {
67
- i.type === "subtype-sublayer" && i.subtypeCode !== u.code || (e.name === n && (t = t || [], t.push({ code: u.code, name: u.name })), u.domains && Object.keys(u.domains).forEach((l) => {
68
- if (e.name === l) {
69
- const s = u.domains[l];
70
- s?.type === "coded-value" && s?.codedValues && s.codedValues.forEach((a) => {
71
- let p = !1;
72
- t = t || [], t.forEach((d) => {
73
- d.code === a.code && (p = !0, `| ${d.name} |`.includes(`| ${a.name} |`) || (d.name += ` | ${a.name}`));
74
- }), p || t.push({ code: a.code, name: a.name });
62
+ return E(i, s).fields.forEach((p) => {
63
+ const l = p.name, a = "domain" in p ? p.domain : void 0;
64
+ if (i.type !== "imagery" && i.subtypeField === l) {
65
+ let c;
66
+ i.type === "subtype-group" || i.type === "feature" ? c = i.subtypes : c = i.parent.subtypes, c.forEach((r) => {
67
+ i.type === "subtype-sublayer" && i.subtypeCode !== r.code || (e.name === l && (t = t || [], t.push({ code: r.code, name: r.name })), r.domains && Object.keys(r.domains).forEach((d) => {
68
+ if (e.name === d) {
69
+ const o = r.domains[d];
70
+ o?.type === "coded-value" && o?.codedValues && o.codedValues.forEach((n) => {
71
+ let g = !1;
72
+ t = t || [], t.forEach((v) => {
73
+ v.code === n.code && (g = !0, `| ${v.name} |`.includes(`| ${n.name} |`) || (v.name += ` | ${n.name}`));
74
+ }), g || t.push({ code: n.code, name: n.name });
75
75
  });
76
76
  }
77
77
  }));
78
78
  });
79
79
  }
80
- if (e.name === n && (i.type === "feature" || i.type === "imagery")) {
81
- const m = i.type === "feature" ? i.typeIdField : void 0, u = i.type === "feature" ? i.types : void 0;
82
- i.type === "feature" && m && u ? (m === n ? t = u.map(
83
- (l) => (
80
+ if (e.name === l && (i.type === "feature" || i.type === "imagery")) {
81
+ const c = i.type === "feature" ? i.typeIdField : void 0, r = i.type === "feature" ? i.types : void 0;
82
+ i.type === "feature" && c && r ? (c === l ? t = r.map(
83
+ (d) => (
84
84
  // fake coded Values
85
85
  {
86
- code: l.id,
87
- name: l.name
86
+ code: d.id,
87
+ name: d.name
88
88
  }
89
89
  )
90
- ) : (t = t || [], u.forEach((l) => {
91
- if (!l.domains?.[n] || l.domains[n].type === "inherited") {
92
- const s = r;
93
- s?.codedValues && s.codedValues.forEach((a) => {
94
- let p = !1;
95
- t.forEach((d) => {
96
- d.code === a.code && (p = !0, `| ${d.name} |`.includes(`| ${a.name} |`) || (d.name += ` | ${a.name}`));
97
- }), p || t.push(N(a));
90
+ ) : (t = t || [], r.forEach((d) => {
91
+ if (!d.domains?.[l] || d.domains[l].type === "inherited") {
92
+ const o = a;
93
+ o?.codedValues && o.codedValues.forEach((n) => {
94
+ let g = !1;
95
+ t.forEach((v) => {
96
+ v.code === n.code && (g = !0, `| ${v.name} |`.includes(`| ${n.name} |`) || (v.name += ` | ${n.name}`));
97
+ }), g || t.push(I(n));
98
98
  });
99
- } else l.domains?.[n]?.codedValues && l.domains[n].codedValues.forEach((s) => {
100
- let a = !1;
101
- t.forEach((p) => {
102
- p.code === s.code && (a = !0, `| ${p.name} |`.includes(`| ${s.name} |`) || (p.name += ` | ${s.name}`));
103
- }), a || t.push(N(s));
99
+ } else d.domains?.[l]?.codedValues && d.domains[l].codedValues.forEach((o) => {
100
+ let n = !1;
101
+ t.forEach((g) => {
102
+ g.code === o.code && (n = !0, `| ${g.name} |`.includes(`| ${o.name} |`) || (g.name += ` | ${o.name}`));
103
+ }), n || t.push(I(o));
104
104
  });
105
- })), !t?.length && r?.codedValues && (t = N(r.codedValues))) : r?.codedValues && (t = r.codedValues);
105
+ })), !t?.length && a?.codedValues && (t = I(a.codedValues))) : a?.codedValues && (t = a.codedValues);
106
106
  }
107
107
  }), t;
108
108
  }
109
- function I(i, e) {
110
- const t = e;
111
- if (t) {
112
- let o = "";
113
- for (let n = 0; n < t.length; n++) {
114
- const r = t[n];
115
- r.code == i && (o += (o.length ? " | " : "") + r.name);
109
+ function Z(i, e) {
110
+ const s = e;
111
+ if (s) {
112
+ let t = "";
113
+ for (let u = 0; u < s.length; u++) {
114
+ const p = s[u];
115
+ p.code == i && (t += (t.length ? " | " : "") + p.name);
116
116
  }
117
- return o.length || (o = `${i}`), o;
117
+ return t.length || (t = `${i}`), t;
118
118
  }
119
119
  return i;
120
120
  }
121
- function L(i) {
121
+ function B(i) {
122
122
  return ["small-integer", "big-integer", "integer", "single", "double", "long"].includes(i.type);
123
123
  }
124
- function B(i) {
124
+ function k(i) {
125
125
  switch (i.type) {
126
126
  case "small-integer":
127
127
  case "big-integer":
@@ -142,15 +142,21 @@ function B(i) {
142
142
  return i.type;
143
143
  }
144
144
  }
145
- const se = P`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`;
146
- class ne extends z {
145
+ function E(i, e) {
146
+ return e === "feature-reduction" && "featureReduction" in i ? i.featureReduction : i;
147
+ }
148
+ const ne = W`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`;
149
+ class oe extends H {
147
150
  constructor() {
148
- super(...arguments), this.dropdownNode = j(), this._messages = X({ blocking: !0 }), this._propWatcherTask = new H(this, {
149
- task: async ([e, t, o]) => {
150
- const n = h(e) && h(t) || h(o);
151
- if (!h(o) && !h(e) && !h(t) ? V("error", this, F("uniqueValues")) : h(o) || (h(e) || V("error", this, F("layer")), h(t) || V("error", this, F("fieldName"))), h(e) && h(t) && !e.fields?.filter((m) => m.name === t))
152
- throw V("error", this, "Field could not be found."), new Error();
153
- if (!n)
151
+ super(...arguments), this.dropdownNode = G(), this._messages = Y({ blocking: !0 }), this._propWatcherTask = new j(this, {
152
+ task: async ([e, s, t]) => {
153
+ const u = h(e) && h(s) || h(t);
154
+ if (!h(t) && !h(e) && !h(s) ? S("error", this, N("uniqueValues")) : h(t) || (h(e) || S("error", this, N("layer")), h(s) || S("error", this, N("fieldName"))), h(e) && h(s)) {
155
+ const { fieldSource: p } = this;
156
+ if (!E(e, p).fields?.filter((c) => c.name === s))
157
+ throw S("error", this, "Field could not be found."), new Error();
158
+ }
159
+ if (!u)
154
160
  throw new Error();
155
161
  await this.processProps();
156
162
  },
@@ -158,10 +164,10 @@ class ne extends z {
158
164
  }), this.initialRender = !0, this.multiple = !1, this.partialUniqueValues = !1, this.showFilterLength = 10, this.arcgisChange = D(), this.arcgisSortByChange = D(), this.arcgisLoad = D();
159
165
  }
160
166
  static {
161
- this.properties = { initialRender: 16, view: 0, layer: 0, fieldName: 1, uniqueValues: 0, numberFormatOptions: 0, selectedValues: 0, sortBy: 1, multiple: 5, partialUniqueValues: 5, showFilterLength: 9, maxHeight: 9 };
167
+ this.properties = { initialRender: 16, view: 0, layer: 0, fieldSource: 1, fieldName: 1, uniqueValues: 0, numberFormatOptions: 0, selectedValues: 0, sortBy: 1, multiple: 5, partialUniqueValues: 5, showFilterLength: 9, maxHeight: 9 };
162
168
  }
163
169
  static {
164
- this.styles = se;
170
+ this.styles = ne;
165
171
  }
166
172
  async setFocus() {
167
173
  this.listNode?.setFocus();
@@ -169,51 +175,51 @@ class ne extends z {
169
175
  async getUniqueValues() {
170
176
  const { fieldInfo: e } = this;
171
177
  if (h(e?.uniqueValueInfos)) {
172
- const { uniqueValueInfos: t, partialUniqueValues: o } = e;
173
- return { uniqueValues: t, partialUniqueValues: o };
178
+ const { uniqueValueInfos: s, partialUniqueValues: t } = e;
179
+ return { uniqueValues: s, partialUniqueValues: t };
174
180
  }
175
181
  }
176
182
  loaded() {
177
183
  this.layer && this.fieldInfo && (setTimeout(() => this.initialRender = !1, 800), this.listNode?.setFocus());
178
184
  }
179
185
  async processProps() {
180
- const { layer: e, fieldName: t, view: o } = this, n = e?.fields?.filter((r) => r.name === t)?.[0];
186
+ const { layer: e, fieldName: s, view: t, fieldSource: u } = this, l = (e ? E(e, u) : void 0)?.fields?.filter((a) => a.name === s)?.[0];
181
187
  if (h(this.uniqueValues))
182
188
  this.fieldInfo = {
183
- layerField: n,
184
- fieldDomains: e && n ? U(e, n) : void 0,
185
- simpleType: e && n ? B(n) : void 0,
189
+ layerField: l,
190
+ fieldDomains: e && l ? R(e, l, u) : void 0,
191
+ simpleType: e && l ? k(l) : void 0,
186
192
  partialUniqueValues: this.partialUniqueValues ?? !1,
187
193
  uniqueValueInfos: this.uniqueValues
188
194
  }, this.arcgisLoad.emit();
189
- else if (e && n) {
195
+ else if (e && l) {
190
196
  this.fieldInfo = {
191
- layerField: n,
192
- fieldDomains: U(e, n),
193
- simpleType: B(n),
197
+ layerField: l,
198
+ fieldDomains: R(e, l, u),
199
+ simpleType: k(l),
194
200
  partialUniqueValues: !1
195
201
  };
196
- const { fieldInfo: r } = this;
202
+ const { fieldInfo: a } = this;
197
203
  try {
198
- const m = await Q({
204
+ const c = await X({
199
205
  layer: e,
200
- view: o,
201
- field: t,
206
+ view: t,
207
+ field: s,
202
208
  sqlWhere: "definitionExpression" in e ? e.definitionExpression ?? void 0 : void 0,
203
209
  forBinning: !1
204
- }), u = L(n), l = m.uniqueValueInfos.filter((s) => h(s.value) ? n.type === "string" && !u || n.type === "guid" ? s.value !== "<Null>" && `${s.value}`.trim() !== "" : (L(n) || n.type === "oid" || u, s.value !== "<Null>" && s.value !== "") : !1);
205
- l.sort((s, a) => s.count > a.count ? -1 : s.count < a.count ? 1 : 0), r.fieldDomains?.length && r.fieldDomains.forEach((s) => {
206
- l.find((a) => a.value === s.code) || l.push({
207
- value: s.code,
210
+ }), r = B(l), d = c.uniqueValueInfos.filter((o) => h(o.value) ? l.type === "string" && !r || l.type === "guid" ? o.value !== "<Null>" && `${o.value}`.trim() !== "" : (B(l) || l.type === "oid" || r, o.value !== "<Null>" && o.value !== "") : !1);
211
+ d.sort((o, n) => o.count > n.count ? -1 : o.count < n.count ? 1 : 0), a.fieldDomains?.length && a.fieldDomains.forEach((o) => {
212
+ d.find((n) => n.value === o.code) || d.push({
213
+ value: o.code,
208
214
  count: 0
209
215
  });
210
- }), r.uniqueValueInfos = l, r.partialUniqueValues = m.uniqueValueInfos.length === 2e3, this.arcgisLoad.emit();
211
- } catch (m) {
212
- if (V("error", this, `uniqueValues() - ${m.message}`), this.hasFieldDomains(r)) {
213
- const l = [];
214
- r.fieldDomains.forEach((s) => {
215
- l.find((a) => a.value === s.code) || l.push({
216
- value: s.code,
216
+ }), a.uniqueValueInfos = d, a.partialUniqueValues = c.uniqueValueInfos.length === 2e3, this.arcgisLoad.emit();
217
+ } catch (c) {
218
+ if (S("error", this, `uniqueValues() - ${c.message}`), this.hasFieldDomains(a)) {
219
+ const d = [];
220
+ a.fieldDomains.forEach((o) => {
221
+ d.find((n) => n.value === o.code) || d.push({
222
+ value: o.code,
217
223
  count: void 0
218
224
  });
219
225
  });
@@ -225,20 +231,20 @@ class ne extends z {
225
231
  }
226
232
  }
227
233
  setListRef(e) {
228
- const { maxHeight: t } = this;
229
- this.listNode = e, t && e?.setAttribute("style", `max-height: ${t || 400}px`);
234
+ const { maxHeight: s } = this;
235
+ this.listNode = e, s && e?.setAttribute("style", `max-height: ${s || 400}px`);
230
236
  }
231
237
  onSortMenuSelect(e) {
232
- const o = e.currentTarget.selectedItems?.[0].getAttribute("data-value");
233
- this.sortBy = o || void 0, this.arcgisSortByChange.emit(o || void 0);
238
+ const t = e.currentTarget.selectedItems?.[0].getAttribute("data-value");
239
+ this.sortBy = t || void 0, this.arcgisSortByChange.emit(t || void 0);
234
240
  }
235
- isSameLists(e, t) {
236
- if (!e && !t)
241
+ isSameLists(e, s) {
242
+ if (!e && !s)
237
243
  return !0;
238
- if (!e || !t || e?.length !== t?.length)
244
+ if (!e || !s || e?.length !== s?.length)
239
245
  return !1;
240
- for (let o = 0; o < e.length; o++)
241
- if (e[o] !== t[o])
246
+ for (let t = 0; t < e.length; t++)
247
+ if (e[t] !== s[t])
242
248
  return !1;
243
249
  return !0;
244
250
  }
@@ -248,50 +254,50 @@ class ne extends z {
248
254
  render() {
249
255
  return this._propWatcherTask.render({
250
256
  complete: () => {
251
- const { fieldInfo: e, selectedValues: t, sortBy: o, multiple: n, initialRender: r, showFilterLength: m, _messages: u } = this, { fieldDomains: l, uniqueValueInfos: s, partialUniqueValues: a, layerField: p } = e, d = p?.type;
252
- if (!s?.length)
257
+ const { fieldInfo: e, selectedValues: s, sortBy: t, multiple: u, initialRender: p, showFilterLength: l, _messages: a } = this, { fieldDomains: c, uniqueValueInfos: r, partialUniqueValues: d, layerField: o } = e, n = o?.type;
258
+ if (!r?.length)
253
259
  return "";
254
- const Z = d ? ["small-integer", "big-integer", "integer", "single", "double", "long", "oid"].includes(d) : !1, R = d ? ["date", "date-only", "time-only"].includes(d) : !1, k = (g) => {
255
- g.sort((y, c) => y.count <= c.count ? 1 : -1);
256
- }, A = (g) => {
257
- const y = l?.length;
258
- g.sort((c, f) => {
259
- if (!y && Z)
260
- return (typeof c.value == "string" ? Number.parseFloat(c.value) : c.value) - (typeof f.value == "string" ? Number.parseFloat(f.value) : f.value);
260
+ const g = n ? ["small-integer", "big-integer", "integer", "single", "double", "long", "oid"].includes(n) : !1, v = n ? ["date", "date-only", "time-only"].includes(n) : !1, A = (y) => {
261
+ y.sort(($, m) => $.count <= m.count ? 1 : -1);
262
+ }, C = (y) => {
263
+ const $ = c?.length;
264
+ y.sort((m, f) => {
265
+ if (!$ && g)
266
+ return (typeof m.value == "string" ? Number.parseFloat(m.value) : m.value) - (typeof f.value == "string" ? Number.parseFloat(f.value) : f.value);
261
267
  {
262
- const $ = y ? I(c.value, l) : c.value, b = y ? I(f.value, l) : f.value;
263
- return `${$}`.startsWith("_") ? 1 : `${b}`.startsWith("_") ? -1 : `${$}`.localeCompare(`${b}`);
268
+ const q = $ ? Z(m.value, c) : m.value, V = $ ? Z(f.value, c) : f.value;
269
+ return `${q}`.startsWith("_") ? 1 : `${V}`.startsWith("_") ? -1 : `${q}`.localeCompare(`${V}`);
264
270
  }
265
271
  });
266
- }, C = (g, y) => {
267
- g.sort((c, f) => {
268
- const $ = y?.indexOf(c.value) ?? -1, b = y?.indexOf(f.value) ?? -1;
269
- return $ === b || $ > -1 && b > -1 ? 0 : $ > b ? -1 : 1;
272
+ }, _ = (y, $) => {
273
+ y.sort((m, f) => {
274
+ const q = $?.indexOf(m.value) ?? -1, V = $?.indexOf(f.value) ?? -1;
275
+ return q === V || q > -1 && V > -1 ? 0 : q > V ? -1 : 1;
270
276
  });
271
277
  };
272
- A(s), !o || o === "count" ? k(s) : o === "selected" && C(s, t);
273
- const _ = s.map((g) => this.renderUniqueValue(g));
274
- let E;
275
- return a && !r && (E = q`<div class="unique-values-content-list-msg">${u.errors.tooManyUniqueValues}</div>`), q`<div class="container"><calcite-list .label=${u.values} class="popover-unique-list" .filterEnabled=${s.length >= m} .selectionMode=${n ? "multiple" : "single"} .filterPlaceholder=${u.searchValues} @calciteListChange=${(g) => {
276
- let c = g.target.selectedItems.map((f) => f.value);
277
- !l && d === "date-only" ? c = c?.map((f) => O(f)) : !l && d === "time-only" ? c = c?.map((f) => x(f)) : d && ["date", "oid", "small-integer", "big-integer", "integer", "long"].includes(d) ? c = c?.map((f) => Number.parseInt(f)) : d && ["single", "double"].includes(d) && (c = c?.map((f) => Number.parseFloat(f))), !this.isSameLists(c, this.selectedValues) && (this.selectedValues = c, this.arcgisChange.emit(c));
278
+ C(r), !t || t === "count" ? A(r) : t === "selected" && _(r, s);
279
+ const M = r.map((y) => this.renderUniqueValue(y));
280
+ let T;
281
+ return d && !p && (T = F`<div class="unique-values-content-list-msg">${a.errors.tooManyUniqueValues}</div>`), F`<div class="container"><calcite-list .label=${a.values} class="popover-unique-list" .filterEnabled=${r.length >= l} .selectionMode=${u ? "multiple" : "single"} .filterPlaceholder=${a.searchValues} @calciteListChange=${(y) => {
282
+ let m = y.target.selectedItems.map((f) => f.value);
283
+ !c && n === "date-only" ? m = m?.map((f) => L(f)) : !c && n === "time-only" ? m = m?.map((f) => U(f)) : n && ["date", "oid", "small-integer", "big-integer", "integer", "long"].includes(n) ? m = m?.map((f) => Number.parseInt(f)) : n && ["single", "double"].includes(n) && (m = m?.map((f) => Number.parseFloat(f))), !this.isSameLists(m, this.selectedValues) && (this.selectedValues = m, this.arcgisChange.emit(m));
278
284
  }} @calciteListFilter=${() => {
279
285
  this.dropdownNode.value && (this.dropdownNode.value.disabled = this.listNode.filteredItems.length < 4);
280
- }} ${S(this.setListRef)}>${s.length >= m && !r ? this.renderSort(Z, R) : null}${_}</calcite-list>${E}</div>`;
286
+ }} ${x(this.setListRef)}>${r.length >= l && !p ? this.renderSort(g, v) : null}${M}</calcite-list>${T}</div>`;
281
287
  },
282
288
  error: () => ""
283
289
  });
284
290
  }
285
- renderSort(e, t) {
286
- const { sortBy: o, _messages: n } = this;
287
- return q`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${S(this.dropdownNode)}><calcite-action slot=trigger .label=${n.sortValues} text><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${o === "count" || !h(o)} data-value=count>${n.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${o === "name"} data-value=name>${e || t ? n.sortAscending : n.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${o === "selected"} data-value=selected>${n.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
291
+ renderSort(e, s) {
292
+ const { sortBy: t, _messages: u } = this;
293
+ return F`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${x(this.dropdownNode)}><calcite-action slot=trigger .label=${u.sortValues} text><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${t === "count" || !h(t)} data-value=count>${u.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${t === "name"} data-value=name>${e || s ? u.sortAscending : u.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${t === "selected"} data-value=selected>${u.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`;
288
294
  }
289
295
  renderUniqueValue(e) {
290
- const { selectedValues: t, initialRender: o, view: n, fieldInfo: r, numberFormatOptions: m } = this, { fieldDomains: u, uniqueValueInfos: l, simpleType: s } = r, a = n && "timeZone" in n && n.timeZone || "system", p = u?.length ? I(e.value, u) : s === "date" ? Y(e.value, a) : s === "date-only" ? ee(e.value) : s === "time-only" ? te(e.value) : s === "timestamp-offset" ? ie(e.value, n) : typeof e.value == "number" ? K(e.value, m) : e.value, d = t ? s === "date-only" ? t.includes(u?.length ? e.value : O(e.value)) : s === "time-only" ? t.includes(u?.length ? e.value : x(e.value)) : t.includes(e.value) : !1;
291
- return W(`list-item_${e.value}`, q`<calcite-list-item .label=${`${p}`} .value=${`${e.value}`} .selected=${d}>${h(e.count) && (l.length > 200 && !o || l.length <= 200) ? q`<div class="count" slot=actions-end>${`${e.count}`}</div>` : null}</calcite-list-item>`);
296
+ const { selectedValues: s, initialRender: t, view: u, fieldInfo: p, numberFormatOptions: l } = this, { fieldDomains: a, uniqueValueInfos: c, simpleType: r } = p, d = u && "timeZone" in u && u.timeZone || "system", o = a?.length ? Z(e.value, a) : r === "date" ? ee(e.value, d) : r === "date-only" ? te(e.value) : r === "time-only" ? ie(e.value) : r === "timestamp-offset" ? se(e.value, u) : typeof e.value == "number" ? Q(e.value, l) : e.value, n = s ? r === "date-only" ? s.includes(a?.length ? e.value : L(e.value)) : r === "time-only" ? s.includes(a?.length ? e.value : U(e.value)) : s.includes(e.value) : !1;
297
+ return z(`list-item_${e.value}`, F`<calcite-list-item .label=${`${o}`} .value=${`${e.value}`} .selected=${n}>${h(e.count) && (c.length > 200 && !t || c.length <= 200) ? F`<div class="count" slot=actions-end>${`${e.count}`}</div>` : null}</calcite-list-item>`);
292
298
  }
293
299
  }
294
- M("arcgis-unique-values-list", ne);
300
+ P("arcgis-unique-values-list", oe);
295
301
  export {
296
- ne as ArcgisUniqueValuesList
302
+ oe as ArcgisUniqueValuesList
297
303
  };