@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 +24 -1
- package/dist/cdn/GAR4QMLU.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-unique-values-list/customElement.d.ts +3 -0
- package/dist/components/arcgis-unique-values-list/customElement.js +155 -149
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/dist/utils/types.d.ts +3 -0
- package/package.json +3 -3
- package/dist/cdn/2BDHDUXG.js +0 -2
package/dist/loader.js
CHANGED
|
@@ -16,7 +16,7 @@ const l = i(e, {
|
|
|
16
16
|
"arcgis-slider": [() => import("./components/arcgis-slider/customElement.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"],
|
|
17
17
|
"arcgis-slider-input": [() => import("./components/arcgis-slider-input/customElement.js"), "disabled,flipLabels,label,max,min,step,unitsLabel,value,withSteppers"],
|
|
18
18
|
"arcgis-ticks": [() => import("./components/arcgis-ticks/customElement.js"), "interactive,interpolationExponent,labelFormatter:,labelPlacement,layout,max,min,mirrored,mode,showBaseline,showLabels,values"],
|
|
19
|
-
"arcgis-unique-values-list": [() => import("./components/arcgis-unique-values-list/customElement.js"), "_messages:,fieldName,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:;getUniqueValues,setFocus"]
|
|
19
|
+
"arcgis-unique-values-list": [() => import("./components/arcgis-unique-values-list/customElement.js"), "_messages:,fieldName,fieldSource,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:;getUniqueValues,setFocus"]
|
|
20
20
|
});
|
|
21
21
|
export {
|
|
22
22
|
l as defineCustomElements
|
package/dist/types/lumina.d.ts
CHANGED
|
@@ -94,7 +94,7 @@ interface LuminaArcgisTicks extends Partial<Pick<ArcgisTicks, "interactive" | "i
|
|
|
94
94
|
onarcgisTickClick?: EventHandler<ArcgisTicks["arcgisTickClick"]>;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
interface LuminaArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, "fieldName" | "layer" | "maxHeight" | "multiple" | "numberFormatOptions" | "partialUniqueValues" | "selectedValues" | "showFilterLength" | "sortBy" | "uniqueValues" | "view">>, h.JSX.HTMLAttributes<ArcgisUniqueValuesList> {
|
|
97
|
+
interface LuminaArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, "fieldName" | "fieldSource" | "layer" | "maxHeight" | "multiple" | "numberFormatOptions" | "partialUniqueValues" | "selectedValues" | "showFilterLength" | "sortBy" | "uniqueValues" | "view">>, h.JSX.HTMLAttributes<ArcgisUniqueValuesList> {
|
|
98
98
|
onarcgisChange?: EventHandler<ArcgisUniqueValuesList["arcgisChange"]>;
|
|
99
99
|
onarcgisLoad?: EventHandler<ArcgisUniqueValuesList["arcgisLoad"]>;
|
|
100
100
|
onarcgisSortByChange?: EventHandler<ArcgisUniqueValuesList["arcgisSortByChange"]>;
|
package/dist/types/preact.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ interface PreactArcgisTicks extends Partial<Pick<ArcgisTicks, "interactive" | "i
|
|
|
95
95
|
onarcgisTickClick?: EventHandler<ArcgisTicks["arcgisTickClick"]>;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
interface PreactArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, "fieldName" | "layer" | "maxHeight" | "multiple" | "numberFormatOptions" | "partialUniqueValues" | "selectedValues" | "showFilterLength" | "sortBy" | "uniqueValues" | "view">>, HTMLAttributes<ArcgisUniqueValuesList> {
|
|
98
|
+
interface PreactArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, "fieldName" | "fieldSource" | "layer" | "maxHeight" | "multiple" | "numberFormatOptions" | "partialUniqueValues" | "selectedValues" | "showFilterLength" | "sortBy" | "uniqueValues" | "view">>, HTMLAttributes<ArcgisUniqueValuesList> {
|
|
99
99
|
onarcgisChange?: EventHandler<ArcgisUniqueValuesList["arcgisChange"]>;
|
|
100
100
|
onarcgisLoad?: EventHandler<ArcgisUniqueValuesList["arcgisLoad"]>;
|
|
101
101
|
onarcgisSortByChange?: EventHandler<ArcgisUniqueValuesList["arcgisSortByChange"]>;
|
package/dist/types/react.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ interface ReactArcgisTicks extends Partial<Pick<ArcgisTicks, "interactive" | "in
|
|
|
95
95
|
onarcgisTickClick?: EventHandler<ArcgisTicks["arcgisTickClick"]>;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
interface ReactArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, "fieldName" | "layer" | "maxHeight" | "multiple" | "numberFormatOptions" | "partialUniqueValues" | "selectedValues" | "showFilterLength" | "sortBy" | "uniqueValues" | "view">>, HTMLProps<ArcgisUniqueValuesList> {
|
|
98
|
+
interface ReactArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, "fieldName" | "fieldSource" | "layer" | "maxHeight" | "multiple" | "numberFormatOptions" | "partialUniqueValues" | "selectedValues" | "showFilterLength" | "sortBy" | "uniqueValues" | "view">>, HTMLProps<ArcgisUniqueValuesList> {
|
|
99
99
|
onarcgisChange?: EventHandler<ArcgisUniqueValuesList["arcgisChange"]>;
|
|
100
100
|
onarcgisLoad?: EventHandler<ArcgisUniqueValuesList["arcgisLoad"]>;
|
|
101
101
|
onarcgisSortByChange?: EventHandler<ArcgisUniqueValuesList["arcgisSortByChange"]>;
|
package/dist/types/stencil.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ interface StencilArcgisTicks extends Partial<Pick<ArcgisTicks, "interactive" | "
|
|
|
95
95
|
onArcgisTickClick?: EventHandler<ArcgisTicks["arcgisTickClick"]>;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
interface StencilArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, "fieldName" | "layer" | "maxHeight" | "multiple" | "numberFormatOptions" | "partialUniqueValues" | "selectedValues" | "showFilterLength" | "sortBy" | "uniqueValues" | "view">>, StencilJsx.HTMLAttributes<ArcgisUniqueValuesList> {
|
|
98
|
+
interface StencilArcgisUniqueValuesList extends Partial<Pick<ArcgisUniqueValuesList, "fieldName" | "fieldSource" | "layer" | "maxHeight" | "multiple" | "numberFormatOptions" | "partialUniqueValues" | "selectedValues" | "showFilterLength" | "sortBy" | "uniqueValues" | "view">>, StencilJsx.HTMLAttributes<ArcgisUniqueValuesList> {
|
|
99
99
|
onArcgisChange?: EventHandler<ArcgisUniqueValuesList["arcgisChange"]>;
|
|
100
100
|
onArcgisLoad?: EventHandler<ArcgisUniqueValuesList["arcgisLoad"]>;
|
|
101
101
|
onArcgisSortByChange?: EventHandler<ArcgisUniqueValuesList["arcgisSortByChange"]>;
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -55,6 +55,9 @@ export interface IPickListGroupInfo {
|
|
|
55
55
|
/** @internal */
|
|
56
56
|
export type LastSortBy = "default" | "display" | "field" | "type";
|
|
57
57
|
|
|
58
|
+
/** @internal */
|
|
59
|
+
export type FieldSource = "feature-reduction" | undefined;
|
|
60
|
+
|
|
58
61
|
/** @internal */
|
|
59
62
|
export const FieldInfoPrefix: {
|
|
60
63
|
expression: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/common-components",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.20",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript common components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"2D",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"lit": "^3.3.0",
|
|
48
48
|
"luxon": "~3.7.2",
|
|
49
49
|
"tslib": "^2.8.1",
|
|
50
|
-
"@arcgis/lumina": "5.1.0-next.
|
|
51
|
-
"@arcgis/toolkit": "5.1.0-next.
|
|
50
|
+
"@arcgis/lumina": "5.1.0-next.20",
|
|
51
|
+
"@arcgis/toolkit": "5.1.0-next.20"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@arcgis/core": "^5.0.0-next",
|
package/dist/cdn/2BDHDUXG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as h}from"./EKKJN7WZ.js";import{a as k}from"./23DDMSOB.js";import{a as R}from"./7Y42J3JI.js";import{b as B}from"./7PB2GGQH.js";import"./7CI55VCH.js";import{A as F,B as S,H as O,g as L,i as b,m as w,n as N,q as Z,z as U}from"./UTXWKXMT.js";export default $arcgis.t(([{formatDate:q,convertDateFormatToIntlOptions:y,formatDateOnly:K,formatTimeOnly:Q,formatTimestamp:C,formatNumber:X},Y,{clone:I}])=>{function _(i){return new Date(`1970-01-01T${i}Z`).getTime()}function M(i){return new Date(`${i} 00:00:00`).getTime()}function ee(i,e,t){let o;return e==="unknown"?o=q(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):o=q(i,{...y("short-date-short-time"),timeZone:e}),o}function te(i){return i?K(i,y("short-date")):""}function ie(i){let e;return typeof i=="string"?e=Q(i,y("short-date-long-time")):e=q(i,{...y("long-time"),timeZone:"utc"}),e}function se(i,e){return typeof i=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?C(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):C(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?q(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):q(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function A(i,e){if(i.type!=="feature"&&i.type!=="subtype-group"&&i.type!=="subtype-sublayer"&&i.type!=="imagery")return;let t;return i.fields.forEach(o=>{let s=o.name,r=o.domain;if(i.type!=="imagery"&&i.subtypeField===s){let p;i.type==="subtype-group"||i.type==="feature"?p=i.subtypes:p=i.parent.subtypes,p.forEach(l=>{i.type==="subtype-sublayer"&&i.subtypeCode!==l.code||(e.name===s&&(t=t||[],t.push({code:l.code,name:l.name})),l.domains&&Object.keys(l.domains).forEach(a=>{if(e.name===a){let n=l.domains[a];n?.type==="coded-value"&&n?.codedValues&&n.codedValues.forEach(u=>{let f=!1;t=t||[],t.forEach(c=>{c.code===u.code&&(f=!0,`| ${c.name} |`.includes(`| ${u.name} |`)||(c.name+=` | ${u.name}`))}),f||t.push({code:u.code,name:u.name})})}}))})}if(e.name===s&&(i.type==="feature"||i.type==="imagery")){let p=i.type==="feature"?i.typeIdField:void 0,l=i.type==="feature"?i.types:void 0;i.type==="feature"&&p&&l?(p===s?t=l.map(a=>({code:a.id,name:a.name})):(t=t||[],l.forEach(a=>{if(!a.domains?.[s]||a.domains[s].type==="inherited"){let n=r;n?.codedValues&&n.codedValues.forEach(u=>{let f=!1;t.forEach(c=>{c.code===u.code&&(f=!0,`| ${c.name} |`.includes(`| ${u.name} |`)||(c.name+=` | ${u.name}`))}),f||t.push(I(u))})}else a.domains?.[s]?.codedValues&&a.domains[s].codedValues.forEach(n=>{let u=!1;t.forEach(f=>{f.code===n.code&&(u=!0,`| ${f.name} |`.includes(`| ${n.name} |`)||(f.name+=` | ${n.name}`))}),u||t.push(I(n))})})),!t?.length&&r?.codedValues&&(t=I(r.codedValues))):r?.codedValues&&(t=r.codedValues)}}),t}function E(i,e){let t=e;if(t){let o="";for(let s=0;s<t.length;s++){let r=t[s];r.code==i&&(o+=(o.length?" | ":"")+r.name)}return o.length||(o=`${i}`),o}return i}function W(i){return["small-integer","big-integer","integer","single","double","long"].includes(i.type)}function P(i){switch(i.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 i.type}}var ne=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}`,D=class extends S{constructor(){super(...arguments),this.dropdownNode=U(),this._messages=B({blocking:!0}),this._propWatcherTask=new k(this,{task:async([e,t,o])=>{let s=h(e)&&h(t)||h(o);if(!h(o)&&!h(e)&&!h(t)?w("error",this,N("uniqueValues")):h(o)||(h(e)||w("error",this,N("layer")),h(t)||w("error",this,N("fieldName"))),h(e)&&h(t)&&!e.fields?.filter(r=>r.name===t))throw w("error",this,"Field could not be found."),new Error;if(!s)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=Z(),this.arcgisSortByChange=Z(),this.arcgisLoad=Z()}static{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}}static{this.styles=ne}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(h(e?.uniqueValueInfos)){let{uniqueValueInfos:t,partialUniqueValues:o}=e;return{uniqueValues:t,partialUniqueValues:o}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}async processProps(){let{layer:e,fieldName:t,view:o}=this,s=e?.fields?.filter(r=>r.name===t)?.[0];if(h(this.uniqueValues))this.fieldInfo={layerField:s,fieldDomains:e&&s?A(e,s):void 0,simpleType:e&&s?P(s):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&s){this.fieldInfo={layerField:s,fieldDomains:A(e,s),simpleType:P(s),partialUniqueValues:!1};let{fieldInfo:r}=this;try{let p=await Y({layer:e,view:o,field:t,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:!1}),l=W(s),a=p.uniqueValueInfos.filter(n=>h(n.value)?s.type==="string"&&!l||s.type==="guid"?n.value!=="<Null>"&&`${n.value}`.trim()!=="":(W(s)||s.type,n.value!=="<Null>"&&n.value!==""):!1);a.sort((n,u)=>n.count>u.count?-1:n.count<u.count?1:0),r.fieldDomains?.length&&r.fieldDomains.forEach(n=>{a.find(u=>u.value===n.code)||a.push({value:n.code,count:0})}),r.uniqueValueInfos=a,r.partialUniqueValues=p.uniqueValueInfos.length===2e3,this.arcgisLoad.emit()}catch(p){if(w("error",this,`uniqueValues() - ${p.message}`),this.hasFieldDomains(r)){let l=[];r.fieldDomains.forEach(a=>{l.find(n=>n.value===a.code)||l.push({value:a.code,count:void 0})})}}setTimeout(()=>{this.initialRender=!1,this.listNode?.setFocus()},800)}}setListRef(e){let{maxHeight:t}=this;this.listNode=e,t&&e?.setAttribute("style",`max-height: ${t||400}px`)}onSortMenuSelect(e){let t=e.currentTarget.selectedItems?.[0].getAttribute("data-value");this.sortBy=t||void 0,this.arcgisSortByChange.emit(t||void 0)}isSameLists(e,t){if(!e&&!t)return!0;if(!e||!t||e?.length!==t?.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:t,sortBy:o,multiple:s,initialRender:r,showFilterLength:p,_messages:l}=this,{fieldDomains:a,uniqueValueInfos:n,partialUniqueValues:u,layerField:f}=e,c=f?.type;if(!n?.length)return"";let x=c?["small-integer","big-integer","integer","single","double","long","oid"].includes(c):!1,z=c?["date","date-only","time-only"].includes(c):!1,H=g=>{g.sort((d,m)=>d.count<=m.count?1:-1)},j=g=>{let d=a?.length;g.sort((m,v)=>{if(!d&&x)return(typeof m.value=="string"?Number.parseFloat(m.value):m.value)-(typeof v.value=="string"?Number.parseFloat(v.value):v.value);{let $=d?E(m.value,a):m.value,V=d?E(v.value,a):v.value;return`${$}`.startsWith("_")?1:`${V}`.startsWith("_")?-1:`${$}`.localeCompare(`${V}`)}})},G=(g,d)=>{g.sort((m,v)=>{let $=d?.indexOf(m.value)??-1,V=d?.indexOf(v.value)??-1;return $===V||$>-1&&V>-1?0:$>V?-1:1})};j(n),!o||o==="count"?H(n):o==="selected"&&G(n,t);let J=n.map(g=>this.renderUniqueValue(g)),T;return u&&!r&&(T=b`<div class="unique-values-content-list-msg">${l.errors.tooManyUniqueValues}</div>`),b`<div class="container"><calcite-list .label=${l.values} class="popover-unique-list" .filterEnabled=${n.length>=p} .selectionMode=${s?"multiple":"single"} .filterPlaceholder=${l.searchValues} @calciteListChange=${g=>{let d=g.target.selectedItems.map(m=>m.value);!a&&c==="date-only"?d=d?.map(m=>M(m)):!a&&c==="time-only"?d=d?.map(m=>_(m)):c&&["date","oid","small-integer","big-integer","integer","long"].includes(c)?d=d?.map(m=>Number.parseInt(m)):c&&["single","double"].includes(c)&&(d=d?.map(m=>Number.parseFloat(m))),!this.isSameLists(d,this.selectedValues)&&(this.selectedValues=d,this.arcgisChange.emit(d))}} @calciteListFilter=${()=>{this.dropdownNode.value&&(this.dropdownNode.value.disabled=this.listNode.filteredItems.length<4)}} ${F(this.setListRef)}>${n.length>=p&&!r?this.renderSort(x,z):null}${J}</calcite-list>${T}</div>`},error:()=>""})}renderSort(e,t){let{sortBy:o,_messages:s}=this;return b`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${F(this.dropdownNode)}><calcite-action slot=trigger .label=${s.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>${s.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${o==="name"} data-value=name>${e||t?s.sortAscending:s.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${o==="selected"} data-value=selected>${s.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:t,initialRender:o,view:s,fieldInfo:r,numberFormatOptions:p}=this,{fieldDomains:l,uniqueValueInfos:a,simpleType:n}=r,u=s&&"timeZone"in s&&s.timeZone||"system",f=l?.length?E(e.value,l):n==="date"?ee(e.value,u):n==="date-only"?te(e.value):n==="time-only"?ie(e.value):n==="timestamp-offset"?se(e.value,s):typeof e.value=="number"?X(e.value,p):e.value,c=t?n==="date-only"?t.includes(l?.length?e.value:M(e.value)):n==="time-only"?t.includes(l?.length?e.value:_(e.value)):t.includes(e.value):!1;return R(`list-item_${e.value}`,b`<calcite-list-item .label=${`${f}`} .value=${`${e.value}`} .selected=${c}>${h(e.count)&&(a.length>200&&!o||a.length<=200)?b`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};O("arcgis-unique-values-list",D);return D},"intl","smartMapping/statistics/uniqueValues","core/lang")
|