@arcgis/common-components 5.2.0 → 5.2.2
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/cdn/{C462OTP3.js → 2CXE3HCV.js} +1 -1
- package/dist/cdn/{PXM22A4W.js → 4PE26X23.js} +1 -1
- package/dist/cdn/{RNLPUNWJ.js → 4RVALD5C.js} +1 -1
- package/dist/cdn/{ENYZ2JUB.js → AWUETPDK.js} +1 -1
- package/dist/cdn/{AQDHLYTU.js → BLI3BCP7.js} +1 -1
- package/dist/cdn/{MXOYFUNA.js → CUBQNY6X.js} +1 -1
- package/dist/cdn/{PCX66U2U.js → CWIU4RVD.js} +1 -1
- package/dist/cdn/{YVFMVC7S.js → DESMU7DN.js} +1 -1
- package/dist/cdn/{7LLZKIWR.js → DXV75P5I.js} +1 -1
- package/dist/cdn/{YLLIIP6N.js → FVVQC7DT.js} +1 -1
- package/dist/cdn/{KSPDGVUU.js → G4MYXSSQ.js} +1 -1
- package/dist/cdn/{EW33LYTO.js → GMUGXJMD.js} +1 -1
- package/dist/cdn/{AAPEBXI5.js → HDOXG2TT.js} +1 -1
- package/dist/cdn/{3VE4YUY3.js → INZYR5ZA.js} +1 -1
- package/dist/cdn/{H34RAA2R.js → JL344TT4.js} +1 -1
- package/dist/cdn/{RB3GRZTS.js → JU3KYYC3.js} +1 -1
- package/dist/cdn/{JVBXHMZZ.js → JYGAARVZ.js} +1 -1
- package/dist/cdn/{U4YHH4XW.js → KDHUW2AM.js} +1 -1
- package/dist/cdn/{H7YT6M7U.js → MUY3IO7O.js} +1 -1
- package/dist/cdn/{5BL2ZVAO.js → NANH53OO.js} +1 -1
- package/dist/cdn/{POTARK2J.js → NJ2VFSCR.js} +1 -1
- package/dist/cdn/{MSWZITYE.js → O5HO33NN.js} +1 -1
- package/dist/cdn/{3TI3WMQ7.js → Q7TDONTY.js} +1 -1
- package/dist/cdn/QCXV3JX7.js +2 -0
- package/dist/cdn/{D7EBOKKR.js → QGXZFY3M.js} +1 -1
- package/dist/cdn/{7GQB27Y6.js → R55VA5QO.js} +1 -1
- package/dist/cdn/{B4XGN56Y.js → RD2Y6TNI.js} +1 -1
- package/dist/cdn/{VIJOYDJV.js → RITITRTA.js} +1 -1
- package/dist/cdn/{G3JARXLK.js → RMITZ6YP.js} +1 -1
- package/dist/cdn/ST7UYNPV.js +2 -0
- package/dist/cdn/{3DRZ5HBF.js → TSR2TYLN.js} +1 -1
- package/dist/cdn/{RWIUPBP3.js → TUFLV3CN.js} +1 -1
- package/dist/cdn/{VDY6O5OG.js → W54XXNSL.js} +1 -1
- package/dist/cdn/W62VXAE7.js +2 -0
- package/dist/cdn/{LESK7PJP.js → WB323TNW.js} +1 -1
- package/dist/cdn/{E5KC44AF.js → WF34MNJY.js} +1 -1
- package/dist/cdn/{QO7Y7FVY.js → WPCYMWIZ.js} +1 -1
- package/dist/cdn/{OTBUP6VU.js → YHD734MR.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/intrinsic-sizing.js +18 -0
- package/dist/chunks/runtime.js +1 -1
- package/dist/components/arcgis-toolbar/customElement.d.ts +20 -0
- package/dist/components/arcgis-toolbar/customElement.js +40 -37
- package/dist/components/arcgis-toolbar-stack/customElement.d.ts +9 -2
- package/dist/components/arcgis-toolbar-stack/customElement.js +72 -74
- 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 +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +7 -7
- package/dist/cdn/2BAY5JIH.js +0 -2
- package/dist/cdn/D2DHNMUH.js +0 -2
- package/dist/cdn/SWJQKQVE.js +0 -2
- package/dist/chunks/toolbar.js +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{e as w,g as x,o as E,p as D}from"./Z5QBBHLD.js";import{a as B,b as f,c as T}from"./YLLIIP6N.js";import{a as A}from"./3TI3WMQ7.js";import"./MXOYFUNA.js";import"./H4Q2JVNO.js";import{a as C}from"./JVBXHMZZ.js";import{J as R,K as U,L as H,R as _,h as O,j as Z,o as $,p as F,t as I}from"./D7EBOKKR.js";export default $arcgis.t(([{formatDate:N,convertDateFormatToIntlOptions:y,formatDateOnly:ie,formatTimeOnly:se,formatTimestamp:M,formatNumber:ae},ne,K,{clone:S}])=>{function W(i){return new Date(`1970-01-01T${i}Z`).getTime()}function P(i){return new Date(`${i} 00:00:00`).getTime()}function oe(i,e,s){let t;return e==="unknown"?t=N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):t=N(i,{...y("short-date-short-time"),timeZone:e}),t}function le(i){return i?ie(i,y("short-date")):""}function re(i){let e;return typeof i=="string"?e=se(i,y("short-date-long-time")):e=N(i,{...y("long-time"),timeZone:"utc"}),e}function ue(i,e){return typeof i=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?M(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):M(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):N(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function j(i,e,s){if(!w(i)&&!D(i)&&!E(i)&&!x(i))return;let t;return T(i,s).fields.forEach(l=>{let a=l.name,c="domain"in l?l.domain:void 0;if(!x(i)&&i.subtypeField===a){let m;E(i)||w(i)?m=i.subtypes:m=i.parent.subtypes,m.forEach(r=>{D(i)&&i.subtypeCode!==r.code||(e.name===a&&(t=t||[],t.push({code:r.code,name:r.name})),r.domains&&Object.keys(r.domains).forEach(n=>{if(e.name===n){let o=r.domains[n];o?.type==="coded-value"&&o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t=t||[],t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push({code:u.code,name:u.name})})}}))})}if(e.name===a&&(w(i)||x(i))){let m=w(i)?i.typeIdField:void 0,r=w(i)?i.types:void 0;w(i)&&m&&r?(m===a?t=r.map(n=>({code:n.id,name:n.name})):(t=t||[],r.forEach(n=>{if(!n.domains?.[a]||n.domains[a].type==="inherited"){let o=c;o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push(S(u))})}else n.domains?.[a]?.codedValues&&n.domains[a].codedValues.forEach(o=>{let u=!1;t.forEach(d=>{d.code===o.code&&(u=!0,`| ${d.name} |`.includes(`| ${o.name} |`)||(d.name+=` | ${o.name}`))}),u||t.push(S(o))})})),!t?.length&&c?.codedValues&&(t=S(c.codedValues))):c?.codedValues&&(t=c.codedValues)}}),t}function L(i,e){let s=e;if(s){let t="";for(let l=0;l<s.length;l++){let a=s[l];a.code==i&&(t+=(t.length?" | ":"")+a.name)}return t.length||(t=`${i}`),t}return i}function G(i){return["small-integer","big-integer","integer","single","double","long"].includes(i.type)}function J(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 de=O`: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}`,k=class extends H{constructor(){super(...arguments),this.dropdownNode=R(),this.initialized=!1,this._messages=A({blocking:!0}),this._propWatcherTask=new B(this,{task:async([e,s,t])=>{let l=f(e)&&f(s)||f(t);if(!f(t)&&!f(e)&&!f(s)?$("error",this,F("uniqueValues")):f(t)||(f(e)||$("error",this,F("layer")),f(s)||$("error",this,F("fieldName"))),f(e)&&f(s)){let{visualizationSource:a}=this;if(!T(e,a).fields?.filter(c=>c.name===s))throw $("error",this,"Field could not be found."),new Error}if(!l)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName,this.uniqueValues]}),this.initialRender=!0,this.multiple=!1,this.partialUniqueValues=!1,this.showFilterLength=10,this.arcgisChange=I(),this.arcgisSortByChange=I(),this.arcgisLoad=I()}static{this.properties={initialRender:16,view:0,layer:0,visualizationSource:1,fieldName:1,uniqueValues:0,numberFormatOptions:0,selectedValues:0,sortBy:1,multiple:5,partialUniqueValues:5,showFilterLength:9,maxHeight:9}}static{this.styles=de}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(f(e?.uniqueValueInfos)){let{uniqueValueInfos:s,partialUniqueValues:t}=e;return{uniqueValues:s,partialUniqueValues:t}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}willUpdate(e){this.initialized&&(e.has("layer")||e.has("visualizationSource")||e.has("fieldName")||e.has("uniqueValues"))&&this.processProps().then(()=>this.requestUpdate()),e.has("maxHeight")&&this.maxHeight&&this.listNode?.setAttribute("style",`max-height: ${this.maxHeight||400}px`)}async processProps(){let{layer:e,fieldName:s,view:t,visualizationSource:l}=this,a=(e?T(e,l):void 0)?.fields?.filter(c=>c.name===s)?.[0];if(!a){$("error",this,`Field '${s}' not found in layer`),this.fieldInfo={layerField:a,fieldDomains:void 0,simpleType:void 0,partialUniqueValues:!1,uniqueValueInfos:[]};return}if(f(this.uniqueValues))this.fieldInfo={layerField:a,fieldDomains:e&&a?j(e,a,l):void 0,simpleType:e&&a?J(a):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&a){this.fieldInfo={layerField:a,fieldDomains:j(e,a,l),simpleType:J(a),partialUniqueValues:!1};let{fieldInfo:c}=this;try{let m=await ne({layer:e,view:t,field:s,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:l==="feature-reduction"}),r=G(a),n=m.uniqueValueInfos.filter(o=>f(o.value)?a.type==="string"&&!r||a.type==="guid"?o.value!=="<Null>"&&`${o.value}`.trim()!=="":(G(a)||a.type,o.value!=="<Null>"&&o.value!==""):!1);n.sort((o,u)=>o.count>u.count?-1:o.count<u.count?1:0),c.fieldDomains?.length&&c.fieldDomains.forEach(o=>{n.find(u=>u.value===o.code)||n.push({value:o.code,count:0})}),c.uniqueValueInfos=n,c.partialUniqueValues=m.uniqueValueInfos.length===2e3,this.initialized||this.arcgisLoad.emit(),this.setUpTimeZoneHandle(),this.initialized=!0}catch(m){if($("error",this,`uniqueValues() - ${m.message}`),this.hasFieldDomains(c)){let r=[];c.fieldDomains.forEach(n=>{r.find(o=>o.value===n.code)||r.push({value:n.code,count:void 0})})}this.initialized=!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)}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{view:e,fieldInfo:s}=this;s.simpleType&&["date","timestamp-offset"].includes(s.simpleType)&&(this.timeZoneHandle=K.watch(()=>e?.timeZone,()=>this.requestUpdate()))}isSameLists(e,s){if(!e&&!s)return!0;if(!e||!s||e?.length!==s?.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==s[t])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:s,sortBy:t,multiple:l,initialRender:a,showFilterLength:c,_messages:m}=this,{fieldDomains:r,uniqueValueInfos:n,partialUniqueValues:o,layerField:u}=e,d=u?.type;if(!n?.length)return"";let g=d?["small-integer","big-integer","integer","single","double","long","oid"].includes(d):!1,Q=d?["date","date-only","time-only"].includes(d):!1,X=v=>{v.sort((h,p)=>h.count<=p.count?1:-1)},Y=v=>{let h=r?.length;v.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 q=h?L(p.value,r):p.label??p.value,b=h?L(V.value,r):V.label??V.value;return`${q}`.startsWith("_")?1:`${b}`.startsWith("_")?-1:`${q}`.localeCompare(`${b}`)}})},ee=(v,h)=>{v.sort((p,V)=>{let q=h?.indexOf(p.value)??-1,b=h?.indexOf(V.value)??-1;return q===b||q>-1&&b>-1?0:q>b?-1:1})};Y(n),!t||t==="count"?X(n):t==="selected"&&ee(n,s);let te=n.map(v=>this.renderUniqueValue(v)),z;return o&&!a&&(z=Z`<div class="unique-values-content-list-msg">${m.errors.tooManyUniqueValues}</div>`),Z`<div class="container"><calcite-list .label=${m.values} class="popover-unique-list" .filterEnabled=${n.length>=c} .selectionMode=${l?"multiple":"single"} .filterPlaceholder=${m.searchValues} @calciteListChange=${v=>{let h=v.currentTarget.selectedItems.map(p=>p.value);!r&&d==="date-only"?h=h?.map(p=>P(p)):!r&&d==="time-only"?h=h?.map(p=>W(p)):d&&["date","oid","small-integer","big-integer","integer","long"].includes(d)?h=h?.map(p=>Number.parseInt(p)):d&&["single","double"].includes(d)&&(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)}} ${U(this.setListRef)}>${n.length>=c&&!a?this.renderSort(g,Q):null}${te}</calcite-list>${z}</div>`},error:()=>""})}renderSort(e,s){let{sortBy:t,_messages:l}=this;return Z`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${U(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=${t==="count"||!f(t)} data-value=count>${l.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="name"} data-value=name>${e||s?l.sortAscending:l.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="selected"} data-value=selected>${l.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:s,initialRender:t,view:l,fieldInfo:a,numberFormatOptions:c}=this,{fieldDomains:m,uniqueValueInfos:r,simpleType:n}=a,o=l&&"timeZone"in l&&l.timeZone||"system",u=m?.length?L(e.value,m):n==="date"?oe(e.value,o):n==="date-only"?le(e.value):n==="time-only"?re(e.value):n==="timestamp-offset"?ue(e.value,l):typeof e.value=="number"?ae(e.value,c):e.label??e.value,d=s?n==="date-only"?s.includes(m?.length?e.value:P(e.value)):n==="time-only"?s.includes(m?.length?e.value:W(e.value)):s.includes(e.value):!1;return C(`list-item_${e.value}`,Z`<calcite-list-item .label=${`${u}`} .value=${`${e.value}`} .selected=${d}>${f(e.count)&&(r.length>200&&!t||r.length<=200)?Z`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};_("arcgis-unique-values-list",k);return k},"intl","smartMapping/statistics/uniqueValues","core/reactiveUtils","core/lang")
|
|
2
|
+
import{e as w,g as x,o as E,p as D}from"./Z5QBBHLD.js";import{a as B,b as f,c as T}from"./FVVQC7DT.js";import{a as A}from"./Q7TDONTY.js";import"./CUBQNY6X.js";import"./H4Q2JVNO.js";import{a as C}from"./JYGAARVZ.js";import{J as R,K as U,L as H,R as _,h as O,j as Z,o as $,p as F,t as I}from"./QGXZFY3M.js";export default $arcgis.t(([{formatDate:N,convertDateFormatToIntlOptions:y,formatDateOnly:ie,formatTimeOnly:se,formatTimestamp:M,formatNumber:ae},ne,K,{clone:S}])=>{function W(i){return new Date(`1970-01-01T${i}Z`).getTime()}function P(i){return new Date(`${i} 00:00:00`).getTime()}function oe(i,e,s){let t;return e==="unknown"?t=N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):t=N(i,{...y("short-date-short-time"),timeZone:e}),t}function le(i){return i?ie(i,y("short-date")):""}function re(i){let e;return typeof i=="string"?e=se(i,y("short-date-long-time")):e=N(i,{...y("long-time"),timeZone:"utc"}),e}function ue(i,e){return typeof i=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?M(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):M(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):N(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function j(i,e,s){if(!w(i)&&!D(i)&&!E(i)&&!x(i))return;let t;return T(i,s).fields.forEach(l=>{let a=l.name,c="domain"in l?l.domain:void 0;if(!x(i)&&i.subtypeField===a){let m;E(i)||w(i)?m=i.subtypes:m=i.parent.subtypes,m.forEach(r=>{D(i)&&i.subtypeCode!==r.code||(e.name===a&&(t=t||[],t.push({code:r.code,name:r.name})),r.domains&&Object.keys(r.domains).forEach(n=>{if(e.name===n){let o=r.domains[n];o?.type==="coded-value"&&o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t=t||[],t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push({code:u.code,name:u.name})})}}))})}if(e.name===a&&(w(i)||x(i))){let m=w(i)?i.typeIdField:void 0,r=w(i)?i.types:void 0;w(i)&&m&&r?(m===a?t=r.map(n=>({code:n.id,name:n.name})):(t=t||[],r.forEach(n=>{if(!n.domains?.[a]||n.domains[a].type==="inherited"){let o=c;o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push(S(u))})}else n.domains?.[a]?.codedValues&&n.domains[a].codedValues.forEach(o=>{let u=!1;t.forEach(d=>{d.code===o.code&&(u=!0,`| ${d.name} |`.includes(`| ${o.name} |`)||(d.name+=` | ${o.name}`))}),u||t.push(S(o))})})),!t?.length&&c?.codedValues&&(t=S(c.codedValues))):c?.codedValues&&(t=c.codedValues)}}),t}function L(i,e){let s=e;if(s){let t="";for(let l=0;l<s.length;l++){let a=s[l];a.code==i&&(t+=(t.length?" | ":"")+a.name)}return t.length||(t=`${i}`),t}return i}function G(i){return["small-integer","big-integer","integer","single","double","long"].includes(i.type)}function J(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 de=O`: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}`,k=class extends H{constructor(){super(...arguments),this.dropdownNode=R(),this.initialized=!1,this._messages=A({blocking:!0}),this._propWatcherTask=new B(this,{task:async([e,s,t])=>{let l=f(e)&&f(s)||f(t);if(!f(t)&&!f(e)&&!f(s)?$("error",this,F("uniqueValues")):f(t)||(f(e)||$("error",this,F("layer")),f(s)||$("error",this,F("fieldName"))),f(e)&&f(s)){let{visualizationSource:a}=this;if(!T(e,a).fields?.filter(c=>c.name===s))throw $("error",this,"Field could not be found."),new Error}if(!l)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName,this.uniqueValues]}),this.initialRender=!0,this.multiple=!1,this.partialUniqueValues=!1,this.showFilterLength=10,this.arcgisChange=I(),this.arcgisSortByChange=I(),this.arcgisLoad=I()}static{this.properties={initialRender:16,view:0,layer:0,visualizationSource:1,fieldName:1,uniqueValues:0,numberFormatOptions:0,selectedValues:0,sortBy:1,multiple:5,partialUniqueValues:5,showFilterLength:9,maxHeight:9}}static{this.styles=de}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(f(e?.uniqueValueInfos)){let{uniqueValueInfos:s,partialUniqueValues:t}=e;return{uniqueValues:s,partialUniqueValues:t}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}willUpdate(e){this.initialized&&(e.has("layer")||e.has("visualizationSource")||e.has("fieldName")||e.has("uniqueValues"))&&this.processProps().then(()=>this.requestUpdate()),e.has("maxHeight")&&this.maxHeight&&this.listNode?.setAttribute("style",`max-height: ${this.maxHeight||400}px`)}async processProps(){let{layer:e,fieldName:s,view:t,visualizationSource:l}=this,a=(e?T(e,l):void 0)?.fields?.filter(c=>c.name===s)?.[0];if(!a){$("error",this,`Field '${s}' not found in layer`),this.fieldInfo={layerField:a,fieldDomains:void 0,simpleType:void 0,partialUniqueValues:!1,uniqueValueInfos:[]};return}if(f(this.uniqueValues))this.fieldInfo={layerField:a,fieldDomains:e&&a?j(e,a,l):void 0,simpleType:e&&a?J(a):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&a){this.fieldInfo={layerField:a,fieldDomains:j(e,a,l),simpleType:J(a),partialUniqueValues:!1};let{fieldInfo:c}=this;try{let m=await ne({layer:e,view:t,field:s,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:l==="feature-reduction"}),r=G(a),n=m.uniqueValueInfos.filter(o=>f(o.value)?a.type==="string"&&!r||a.type==="guid"?o.value!=="<Null>"&&`${o.value}`.trim()!=="":(G(a)||a.type,o.value!=="<Null>"&&o.value!==""):!1);n.sort((o,u)=>o.count>u.count?-1:o.count<u.count?1:0),c.fieldDomains?.length&&c.fieldDomains.forEach(o=>{n.find(u=>u.value===o.code)||n.push({value:o.code,count:0})}),c.uniqueValueInfos=n,c.partialUniqueValues=m.uniqueValueInfos.length===2e3,this.initialized||this.arcgisLoad.emit(),this.setUpTimeZoneHandle(),this.initialized=!0}catch(m){if($("error",this,`uniqueValues() - ${m.message}`),this.hasFieldDomains(c)){let r=[];c.fieldDomains.forEach(n=>{r.find(o=>o.value===n.code)||r.push({value:n.code,count:void 0})})}this.initialized=!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)}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{view:e,fieldInfo:s}=this;s.simpleType&&["date","timestamp-offset"].includes(s.simpleType)&&(this.timeZoneHandle=K.watch(()=>e?.timeZone,()=>this.requestUpdate()))}isSameLists(e,s){if(!e&&!s)return!0;if(!e||!s||e?.length!==s?.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==s[t])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:s,sortBy:t,multiple:l,initialRender:a,showFilterLength:c,_messages:m}=this,{fieldDomains:r,uniqueValueInfos:n,partialUniqueValues:o,layerField:u}=e,d=u?.type;if(!n?.length)return"";let g=d?["small-integer","big-integer","integer","single","double","long","oid"].includes(d):!1,Q=d?["date","date-only","time-only"].includes(d):!1,X=v=>{v.sort((h,p)=>h.count<=p.count?1:-1)},Y=v=>{let h=r?.length;v.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 q=h?L(p.value,r):p.label??p.value,b=h?L(V.value,r):V.label??V.value;return`${q}`.startsWith("_")?1:`${b}`.startsWith("_")?-1:`${q}`.localeCompare(`${b}`)}})},ee=(v,h)=>{v.sort((p,V)=>{let q=h?.indexOf(p.value)??-1,b=h?.indexOf(V.value)??-1;return q===b||q>-1&&b>-1?0:q>b?-1:1})};Y(n),!t||t==="count"?X(n):t==="selected"&&ee(n,s);let te=n.map(v=>this.renderUniqueValue(v)),z;return o&&!a&&(z=Z`<div class="unique-values-content-list-msg">${m.errors.tooManyUniqueValues}</div>`),Z`<div class="container"><calcite-list .label=${m.values} class="popover-unique-list" .filterEnabled=${n.length>=c} .selectionMode=${l?"multiple":"single"} .filterPlaceholder=${m.searchValues} @calciteListChange=${v=>{let h=v.currentTarget.selectedItems.map(p=>p.value);!r&&d==="date-only"?h=h?.map(p=>P(p)):!r&&d==="time-only"?h=h?.map(p=>W(p)):d&&["date","oid","small-integer","big-integer","integer","long"].includes(d)?h=h?.map(p=>Number.parseInt(p)):d&&["single","double"].includes(d)&&(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)}} ${U(this.setListRef)}>${n.length>=c&&!a?this.renderSort(g,Q):null}${te}</calcite-list>${z}</div>`},error:()=>""})}renderSort(e,s){let{sortBy:t,_messages:l}=this;return Z`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${U(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=${t==="count"||!f(t)} data-value=count>${l.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="name"} data-value=name>${e||s?l.sortAscending:l.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="selected"} data-value=selected>${l.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:s,initialRender:t,view:l,fieldInfo:a,numberFormatOptions:c}=this,{fieldDomains:m,uniqueValueInfos:r,simpleType:n}=a,o=l&&"timeZone"in l&&l.timeZone||"system",u=m?.length?L(e.value,m):n==="date"?oe(e.value,o):n==="date-only"?le(e.value):n==="time-only"?re(e.value):n==="timestamp-offset"?ue(e.value,l):typeof e.value=="number"?ae(e.value,c):e.label??e.value,d=s?n==="date-only"?s.includes(m?.length?e.value:P(e.value)):n==="time-only"?s.includes(m?.length?e.value:W(e.value)):s.includes(e.value):!1;return C(`list-item_${e.value}`,Z`<calcite-list-item .label=${`${u}`} .value=${`${e.value}`} .selected=${d}>${f(e.count)&&(r.length>200&&!t||r.length<=200)?Z`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};_("arcgis-unique-values-list",k);return k},"intl","smartMapping/statistics/uniqueValues","core/reactiveUtils","core/lang")
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{Q as a,y as e}from"./
|
|
2
|
+
import{Q as a,y as e}from"./QGXZFY3M.js";var i=e(a,{"arcgis-ckeditor5":[()=>import("./GMUGXJMD.js"),"canResizeVertically,currentLanguage,customConfig,customExpressionCheck:,editorType,groupFieldsAndExpressions,intlExpressionsGroupHeading,intlFieldsGroupHeading,intlTextPlaceHolder,mentionFields:,readOnly,textData;getData,setFocus"],"arcgis-ckeditor5-popover":[()=>import("./NANH53OO.js"),"guid,intlCancel,intlLabel,intlOk,refElement:;reposition"],"arcgis-color-input":[()=>import("./4RVALD5C.js"),"_messages:,clearable,color,compact,disabled,hideRecentColors,messageOverrides:,placement,popoverProps:,showTransparency,storageId;close,setFocus;isOpen"],"arcgis-coordinate-system-picker":[()=>import("./WPCYMWIZ.js"),"_messages:,autoFilterToDefault,defaultWkid,filterEnabled,hideCategories:,value:;getSRDescription"],"arcgis-coordinate-system-picker-tree":[()=>import("./O5HO33NN.js"),"data:,value"],"arcgis-field-info":[()=>import("./DXV75P5I.js"),"_messages:,fieldName,hideAlias,hideNumericFormat,hideStatistics,layer:,view:;refresh"],"arcgis-field-pick-list":[()=>import("./TSR2TYLN.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("./CWIU4RVD.js"),"_messages:,average,bins:,colorBlendingEnabled,colorStops:,dataLines:,icon,label,labelFormatter:,layout,max,messageOverrides:,min,mirrored,standardDeviation,standardDeviationCount"],"arcgis-label-input":[()=>import("./NJ2VFSCR.js"),"alignment,editing,labelFormatter:,readOnly,value;edit;getLabelBoundingClientRect"],"arcgis-picker-input":[()=>import("./BLI3BCP7.js"),"disabled,heading,iconEnd,intlDone,label,popoverProps:;close,setFocus"],"arcgis-ramp-color":[()=>import("./AWUETPDK.js"),"layout,max,min,stops:"],"arcgis-ramp-color-break":[()=>import("./WB323TNW.js"),"layout,max,min,stops:"],"arcgis-ramp-opacity":[()=>import("./RITITRTA.js"),"fillColor,layout,max,min,stops:"],"arcgis-slider":[()=>import("./RD2Y6TNI.js"),"activeValue:,allowValuesOverlap,autoDestroyDisabled,disabled,fillPlacement,fullRangeMax,fullRangeMin,keyboardLargeStep,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverDisplay,popoverLabel,popoverPlacement,precision,rangeLabelsEditingEnabled,rangeLabelsPlacement,segmentsDraggingDisabled,showRangeLabels,steps,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values,valuesDraggingDisabled;destroy"],"arcgis-slider-field":[()=>import("./R55VA5QO.js"),"activeValue:,disabled,fieldType,fillPlacement,label,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverLabel,rangeLabelsEditingEnabled,rangeLabelsPlacement,showRangeLabels,value,valueAsDateOnly:,valueAsFieldType:,valueAsNumbers:,valueAsTimeOnly:,valueAsTimestampOffset:,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values"],"arcgis-slider-histogram-range":[()=>import("./2CXE3HCV.js"),"activeValue:,average,bins:,dataLines:,excludedBarColor:,fieldType,fillPlacement,includedBarColor:,label,labelFormatter:,layout,max,min,rangeLabelsEditingEnabled,rangeLabelsPlacement,showRangeLabels,standardDeviation,standardDeviationCount,value,valueLabelsDisplay,valueLabelsEditingEnabled,values;destroy,generateWhereClause,updateFromHistogramResult"],"arcgis-slider-input":[()=>import("./DESMU7DN.js"),"disabled,flipLabels,label,max,min,scale,step,unitsLabel,value,withSteppers"],"arcgis-ticks":[()=>import("./W54XXNSL.js"),"_messages:,autoDestroyDisabled,interactive,interpolationExponent,labelFormatter:,labelPlacement,layout,max,min,mirrored,mode,showBaseline,showLabels,values;destroy"],"arcgis-toolbar":[()=>import("./ST7UYNPV.js"),"allocatedLength,barElement:,layout,relativePosition,scale,toolbarKind,tooltipAppearance;;allocate,measure,measureIntrinsicSize,proxiedRender"],"arcgis-toolbar-action":[()=>import("./MUY3IO7O.js"),"actionElement:,active,appearance,disabled,icon,iconFlipRtl,indicator,kind,labelText,loading,textEnabled,tooltipText;;measure,proxiedRender"],"arcgis-toolbar-group":[()=>import("./KDHUW2AM.js"),"preferEndSlot,priority;;measure,proxiedRender"],"arcgis-toolbar-item":[()=>import("./WF34MNJY.js"),"actionElement:,active,disabled,icon,iconFlipRtl,labelText,lastActivated:,loading,tooltipText;;measure,proxiedRender"],"arcgis-toolbar-more-button":[()=>import("./JL344TT4.js"),"menuAppearance,overflowActionLabel,priority;;measure,proxiedRender"],"arcgis-toolbar-split-button":[()=>import("./RMITZ6YP.js"),"menuAppearance,overflowActionLabel,priority;;measure,proxiedRender"],"arcgis-toolbar-stack":[()=>import("./W62VXAE7.js"),"allocatedLength,layout,relativePosition,scale,toolbarKind,tooltipAppearance"],"arcgis-unique-values-list":[()=>import("./YHD734MR.js"),"_messages:,fieldName,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:,visualizationSource;getUniqueValues,setFocus"],"arcgis-value-picker":[()=>import("./JU3KYYC3.js"),"autoDestroyDisabled,disabled,floating,hideNextButton,hidePlayButton,hidePreviousButton,icon,label,layout,loop,messages:,playRate,state:;destroy;next,pause,play,previous"],"arcgis-value-picker-collection":[()=>import("./4PE26X23.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,items:;destroy;reset,step"],"arcgis-value-picker-combobox":[()=>import("./TUFLV3CN.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,disabled,items:,messages:;destroy;reset,step"],"arcgis-value-picker-label":[()=>import("./HDOXG2TT.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue:,disabled,items:;destroy;reset,step"],"arcgis-value-picker-slider":[()=>import("./G4MYXSSQ.js"),"autoDestroyDisabled,canNext,canPlay,canPrevious,currentValue,disabled,labelFormatter:,labels:,layout,majorTicks:,max,min,minorTicks:,mirrored,steps:;destroy;reset,step"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-ckeditor5,arcgis-ckeditor5-popover,arcgis-color-input,arcgis-coordinate-system-picker,arcgis-coordinate-system-picker-tree,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-field,arcgis-slider-histogram-range,arcgis-slider-input,arcgis-ticks,arcgis-toolbar,arcgis-toolbar-action,arcgis-toolbar-group,arcgis-toolbar-item,arcgis-toolbar-more-button,arcgis-toolbar-split-button,arcgis-toolbar-stack,arcgis-unique-values-list,arcgis-value-picker,arcgis-value-picker-collection,arcgis-value-picker-combobox,arcgis-value-picker-label,arcgis-value-picker-slider){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];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,a)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { css as r, html as o } from "lit";
|
|
3
|
+
import { safeStyleMap as n } from "@arcgis/lumina";
|
|
4
|
+
const g = r`:host{--arcgis-internal-toolbar-action-kind-color: var(--calcite-action-text-color);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-action-text-color-press);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-action-text-color-press);--arcgis-internal-toolbar-action-kind-foreground-color: var(--calcite-color-text-inverse);--arcgis-internal-toolbar-action-transparent-background-color: var(--calcite-color-transparent);--arcgis-internal-toolbar-action-transparent-background-color-hover: var(--calcite-color-transparent-hover);--arcgis-internal-toolbar-action-transparent-background-color-press: var(--calcite-color-transparent-press)}calcite-action{--calcite-action-text-color: var(--arcgis-internal-toolbar-action-kind-color);--calcite-action-text-color-press: var(--arcgis-internal-toolbar-action-kind-color-press);--calcite-color-focus: var(--arcgis-internal-toolbar-action-kind-color);--calcite-action-indicator-color: var(--arcgis-internal-toolbar-action-kind-color)}calcite-action:is([data-appearance=solid]){--calcite-offset-invert-focus: 1}calcite-action[data-appearance=outline]{--calcite-action-background-color: var(--arcgis-internal-toolbar-action-transparent-background-color);--calcite-action-background-color-hover: var(--arcgis-internal-toolbar-action-transparent-background-color-hover);--calcite-action-background-color-press: var(--arcgis-internal-toolbar-action-transparent-background-color-press);--calcite-action-text-color: var(--arcgis-internal-toolbar-action-kind-color);--calcite-action-text-color-press: var(--arcgis-internal-toolbar-action-kind-color-press);box-shadow:inset 0 0 0 var(--calcite-border-width-sm, 1px) var(--arcgis-internal-toolbar-action-kind-color)}calcite-action[data-appearance=outline]:hover{box-shadow:inset 0 0 0 var(--calcite-border-width-sm, 1px) var(--arcgis-internal-toolbar-action-kind-color-hover)}calcite-action[data-appearance=outline]:active,calcite-action[data-appearance=outline][active]{--calcite-action-background-color: var(--arcgis-internal-toolbar-action-transparent-background-color-press);box-shadow:inset 0 0 0 var(--calcite-border-width-sm, 1px) var(--arcgis-internal-toolbar-action-kind-color-press)}calcite-action[data-appearance=solid]{--calcite-action-background-color: var(--arcgis-internal-toolbar-action-kind-color);--calcite-action-background-color-hover: var(--arcgis-internal-toolbar-action-kind-color-hover);--calcite-action-background-color-press: var(--arcgis-internal-toolbar-action-kind-color-press);--calcite-action-text-color: var(--arcgis-internal-toolbar-action-kind-foreground-color);--calcite-action-text-color-press: var(--arcgis-internal-toolbar-action-kind-foreground-color);--calcite-action-indicator-color: var(--arcgis-internal-toolbar-action-kind-foreground-color)}calcite-action:is([data-appearance=outline],[data-appearance=solid]):not([data-kind]){--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-inverse);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-inverse-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-inverse-press)}calcite-action:not([data-kind]){--calcite-action-indicator-color: var(--calcite-color-brand)}calcite-action[data-kind=brand]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-brand);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-brand-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-brand-press);--calcite-action-indicator-color: var(--calcite-color-text-1);&[data-appearance=solid]{--calcite-action-indicator-color: var(--calcite-color-text-inverse)}}calcite-action[data-kind=danger]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-status-danger);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-status-danger-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-status-danger-press)}calcite-action[data-kind=info]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-status-info);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-status-info-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-status-info-press)}calcite-action[data-kind=success]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-status-success);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-status-success-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-status-success-press)}calcite-action[data-kind=warning]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-status-warning);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-status-warning-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-status-warning-press)}`, v = r`:host([layout="horizontal"]){.split-anchor{min-width:24px;max-width:24px;&[scale=m]{--calcite-internal-action-spacing: .25rem}&[scale=l]{--calcite-internal-action-spacing: 0rem}}.split-host:has(.split-menu){>calcite-action{border-radius:var(--calcite-action-corner-radius, 2px);border-top-right-radius:0;border-bottom-right-radius:0}.split-anchor{border-radius:var(--calcite-action-corner-radius, 2px);border-bottom-left-radius:0;border-top-left-radius:0}>calcite-action:dir(rtl){border-radius:var(--calcite-action-corner-radius, 2px);border-top-left-radius:0;border-bottom-left-radius:0}.split-anchor:dir(rtl){border-radius:var(--calcite-action-corner-radius, 2px);border-bottom-right-radius:0;border-top-right-radius:0}.split-anchor:dir(ltr){margin-left:calc(0px - var(--calcite-internal-action-bar-gap));margin-right:calc(0px - var(--calcite-internal-action-bar-padding))}.split-anchor:dir(rtl){margin-right:calc(0px - var(--calcite-internal-action-bar-gap));margin-left:calc(0px - var(--calcite-internal-action-bar-padding))}}}:host([layout="vertical"]){.split-anchor{--calcite-internal-action-min-height: unset;min-height:24px;max-height:24px}.split-host:has(.split-menu){>calcite-action{border-radius:var(--calcite-action-corner-radius, 2px);border-bottom-left-radius:0;border-bottom-right-radius:0}.split-anchor{border-radius:var(--calcite-action-corner-radius, 2px);border-top-right-radius:0;border-top-left-radius:0;margin-top:calc(0px - var(--calcite-internal-action-bar-gap));margin-bottom:calc(0px - var(--calcite-internal-action-bar-padding))}}}.split-host:has(.split-menu):hover,.split-host:has(calcite-action-menu[open]),.split-host:has(calcite-dropdown[open]){.split-anchor,>calcite-action{background-color:var(--calcite-action-background-color-hover, var(--calcite-color-transparent-hover))}}.split-host{display:contents;cursor:pointer}`, h = r`:host{display:block;max-inline-size:100%;max-block-size:100%;min-inline-size:0;min-block-size:0;position:relative}:host([layout="horizontal"]){inline-size:100%}:host([layout="vertical"]){block-size:100%}:host([toolbar-kind="floating"][layout="horizontal"]){max-inline-size:min(100cqw - 2 * var(--calcite-space-lg),100vw - 2 * var(--calcite-space-lg))}:host([toolbar-kind="floating"][layout="vertical"]){max-block-size:min(100cqh - var(--arcgis-internal-attribution-space-top) - 2 * var(--calcite-space-lg),100vh - 2 * var(--calcite-space-lg))}calcite-action-bar{-webkit-user-select:none;user-select:none;pointer-events:auto}:host([toolbar-kind="docked"][layout="horizontal"]){calcite-action-bar{min-width:100%}.toolbar-grid-wrapper{width:100%}}:host([toolbar-kind="docked"][layout="vertical"]){min-height:100%;calcite-action-bar{min-height:100%}.toolbar-grid-wrapper{height:100%}}calcite-tooltip.calcite-mode-dark{color-scheme:dark}:host([layout="vertical"]) .toolbar-shadow-wrapper{overflow-y:auto}:host([layout="horizontal"]) .toolbar-shadow-wrapper{overflow-x:auto}.toolbar-grid-wrapper{display:grid;min-inline-size:0;min-block-size:0}:host([layout="horizontal"]) .toolbar-grid-wrapper{grid-template-columns:minmax(0,1fr)}:host([layout="vertical"]) .toolbar-grid-wrapper{grid-template-rows:minmax(0,1fr)}:host([layout="horizontal"]) .toolbar-grid-wrapper.right{margin-left:auto}:host([layout="vertical"]) .toolbar-grid-wrapper.bottom{margin-top:auto}.toolbar-shadow-wrapper{pointer-events:auto}:host([toolbar-kind="floating"]) .toolbar-shadow-wrapper{box-shadow:var(--calcite-shadow-md);background-color:var(--calcite-action-bar-background-color, var(--calcite-color-surface-2));border-radius:var(--calcite-action-bar-corner-radius, var(--calcite-corner-radius-sm));max-inline-size:100%;max-block-size:100%;min-inline-size:0;min-block-size:0}`;
|
|
5
|
+
function u(a, i, e) {
|
|
6
|
+
if (e === "vertical")
|
|
7
|
+
return o`<div class="intrinsic-size-contribution" aria-hidden=true style=${n({ height: `${i}px` })}></div>`;
|
|
8
|
+
const t = Math.max(0, i - a), c = a > 0 ? Math.ceil(t / a) : 0, l = [a, ...Array.from({ length: c }, () => t / c)];
|
|
9
|
+
return o`<div class="intrinsic-size-contribution" aria-hidden=true>${l.map((s, d) => o`${d > 0 && o`<wbr>` || ""}<span style=${n({ width: `${s}px` })}></span>`)}</div>`;
|
|
10
|
+
}
|
|
11
|
+
const k = r`:host(:not([allocated-length])){max-inline-size:100%;max-block-size:100%;.intrinsic-sizing-container{position:relative;block-size:100%;min-inline-size:0;min-block-size:0}.intrinsic-size-contribution{grid-area:1 / 1;min-inline-size:0;min-block-size:0;visibility:hidden;pointer-events:none;max-inline-size:100%;max-block-size:100%}}:host(:not([allocated-length])[layout="horizontal"]){max-inline-size:100%;calcite-action-bar{min-inline-size:100%}.intrinsic-sizing-container>.toolbar-grid-wrapper{inline-size:100%}.intrinsic-size-contribution{font-size:0;line-height:0;white-space:normal;block-size:0;span{display:inline-block;block-size:0}}}:host(:not([allocated-length])[layout="vertical"]){display:grid;grid-template-columns:minmax(min-content,1fr);grid-template-rows:minmax(0,1fr);max-block-size:100%;min-block-size:0;calcite-action-bar{min-block-size:100%}.intrinsic-sizing-container{block-size:auto;display:grid;grid-template-columns:minmax(min-content,1fr);grid-template-rows:minmax(0,1fr)}.intrinsic-sizing-container>.toolbar-grid-wrapper{grid-area:1 / 1;block-size:100%}.intrinsic-size-contribution{inline-size:0}.toolbar-shadow-wrapper{min-inline-size:min-content}}`;
|
|
12
|
+
export {
|
|
13
|
+
g as a,
|
|
14
|
+
v as b,
|
|
15
|
+
k as c,
|
|
16
|
+
u as r,
|
|
17
|
+
h as s
|
|
18
|
+
};
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "../cdn/main.css";
|
|
3
3
|
import { makeRuntime as e } from "@arcgis/lumina";
|
|
4
4
|
import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
5
|
-
const t = e({ defaultAssetPath: "https://js.arcgis.com/5.2.
|
|
5
|
+
const t = e({ defaultAssetPath: "https://js.arcgis.com/5.2.2/common-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: i, setAssetPath: d } = t;
|
|
6
6
|
t.t = s;
|
|
7
7
|
t.o = r;
|
|
8
8
|
t.c = a;
|
|
@@ -13,6 +13,14 @@ import type { ActionBar as ActionBar } from "@esri/calcite-components/components
|
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
15
|
export abstract class ArcgisToolbar extends LitElement {
|
|
16
|
+
/**
|
|
17
|
+
* Main-axis budget in pixels. Undefined (the default) enables intrinsic sizing:
|
|
18
|
+
* CSS determines the host's size, and its observed content box supplies the budget.
|
|
19
|
+
* Specifying a value, including zero, disables intrinsic sizing and directly controls
|
|
20
|
+
* the budget used to collapse groups. CSS can still constrain the host.
|
|
21
|
+
* When managed by a stack, the stack owns sizing and allocation instead.
|
|
22
|
+
*/
|
|
23
|
+
accessor allocatedLength: number | undefined;
|
|
16
24
|
get barElement(): ActionBar | undefined;
|
|
17
25
|
/** Toolbar orientation. */
|
|
18
26
|
accessor layout: "horizontal" | "vertical";
|
|
@@ -57,6 +65,18 @@ export abstract class ArcgisToolbar extends LitElement {
|
|
|
57
65
|
* @internal
|
|
58
66
|
*/
|
|
59
67
|
measure(context: MeasurementContext): number[];
|
|
68
|
+
/**
|
|
69
|
+
* Intrinsic sizing needs only the collapsed and fully allocated lengths, not
|
|
70
|
+
* every combination of intermediate group lengths. Use allocation for both
|
|
71
|
+
* endpoints so forced-collapse priorities follow the same rules as rendering.
|
|
72
|
+
*
|
|
73
|
+
* @param context
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
measureIntrinsicSize(context: MeasurementContext): {
|
|
77
|
+
minimum: number;
|
|
78
|
+
maximum: number;
|
|
79
|
+
};
|
|
60
80
|
/**
|
|
61
81
|
* Render method used when the toolbar is managed by a toolbar stack.
|
|
62
82
|
*
|
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { html as
|
|
5
|
-
import { keyed as
|
|
6
|
-
import { LitElement as
|
|
2
|
+
import { c as g } from "../../chunks/runtime.js";
|
|
3
|
+
import { ref as m } from "lit/directives/ref.js";
|
|
4
|
+
import { html as h } from "lit";
|
|
5
|
+
import { keyed as b } from "lit/directives/keyed.js";
|
|
6
|
+
import { LitElement as f, createEvent as v, safeStyleMap as c } from "@arcgis/lumina";
|
|
7
7
|
import { useDirection as y } from "@arcgis/lumina/controllers";
|
|
8
|
-
import { s as
|
|
8
|
+
import { s as _, a as $, b as R, c as z, r as B } from "../../chunks/intrinsic-sizing.js";
|
|
9
9
|
import { a as l } from "../../chunks/utils.js";
|
|
10
|
-
import { i as
|
|
11
|
-
class w extends
|
|
10
|
+
import { i as L } from "../../chunks/types.js";
|
|
11
|
+
class w extends f {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#
|
|
13
|
+
super(), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#e = new MutationObserver(() => this._syncGroups()), this.#i = y(), this._layout = "horizontal", this._setRenderedBar = (t) => {
|
|
14
14
|
t == null && (this._renderedBar = void 0, this._hydratedRenderedBar = void 0), !(t === this._renderedBar || t === this._hydratedRenderedBar) && (this._renderedBar = t, this._hydratedRenderedBar = void 0, t && t.componentOnReady().then(() => {
|
|
15
15
|
!this.isConnected || this._renderedBar !== t || (this._hydratedRenderedBar = t);
|
|
16
16
|
}));
|
|
17
|
-
}, this.
|
|
17
|
+
}, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.arcgisInternalLayoutUpdate = v(), this.listen("arcgisInternalLayoutUpdate", (t) => {
|
|
18
18
|
t.target !== this.el && this.requestUpdate(), this.el.parentElement?.localName !== "arcgis-toolbar-stack" && t.stopPropagation();
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
|
-
this.properties = { _availableLength: 16, _groups: 16, _renderedBar: 16, _hydratedRenderedBar: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, barElement: 32, effectiveRelativeDirection: 16 };
|
|
22
|
+
this.properties = { _observedSize: 16, _availableLength: 16, _groups: 16, _renderedBar: 16, _hydratedRenderedBar: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, allocatedLength: 11, barElement: 32, effectiveRelativeDirection: 16 };
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
|
-
this.styles = [
|
|
25
|
+
this.styles = [_, $, R, z];
|
|
26
26
|
}
|
|
27
27
|
#t;
|
|
28
|
+
#e;
|
|
28
29
|
#r;
|
|
29
30
|
#i;
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
get _availableLength() {
|
|
32
|
+
return this.allocatedLength ?? (this.layout === "horizontal" ? this._observedSize?.width : this._observedSize?.height) ?? 0;
|
|
33
|
+
}
|
|
32
34
|
get layout() {
|
|
33
35
|
return this._layout;
|
|
34
36
|
}
|
|
35
37
|
set layout(t) {
|
|
36
|
-
t !== this._layout && (this._layout = t
|
|
38
|
+
t !== this._layout && (this._layout = t);
|
|
37
39
|
}
|
|
38
40
|
get barElement() {
|
|
39
41
|
return this._hydratedRenderedBar;
|
|
40
42
|
}
|
|
41
43
|
get effectiveRelativeDirection() {
|
|
42
|
-
const [t, e] = this.relativePosition.split("-"), r = this.#
|
|
44
|
+
const [t, e] = this.relativePosition.split("-"), r = this.#i;
|
|
43
45
|
switch (e) {
|
|
44
46
|
case "left":
|
|
45
47
|
case "right":
|
|
@@ -54,39 +56,36 @@ class w extends b {
|
|
|
54
56
|
const e = this._groups;
|
|
55
57
|
if (!e?.length)
|
|
56
58
|
return [0];
|
|
57
|
-
const
|
|
58
|
-
return Array.from(new Set(
|
|
59
|
+
const s = e.map((i) => i.measure(t)).reduce((i, a) => i.flatMap((o) => a.map((n) => o + n)), [0]).map((i) => l(e, t, i).reduce((a, { budget: o }) => a + o, 0));
|
|
60
|
+
return Array.from(new Set(s)).sort((i, a) => i - a);
|
|
61
|
+
}
|
|
62
|
+
measureIntrinsicSize(t) {
|
|
63
|
+
const e = this._groups ?? [], r = (s) => l(e, t, s).reduce((i, { budget: a }) => i + a, 0);
|
|
64
|
+
return { minimum: r(0), maximum: r(1 / 0) };
|
|
59
65
|
}
|
|
60
66
|
allocate(t, e) {
|
|
61
67
|
const r = this._groups;
|
|
62
68
|
return r?.length ? l(r, t, e) : [];
|
|
63
69
|
}
|
|
64
|
-
proxiedRender(t, e, r = this.toolbarKind,
|
|
70
|
+
proxiedRender(t, e, r = this.toolbarKind, s = e) {
|
|
65
71
|
if (!this._groups?.length)
|
|
66
72
|
return;
|
|
67
|
-
const
|
|
68
|
-
return
|
|
73
|
+
const a = this.allocate(t, e), [o, n] = t.relativePosition.split("-"), d = t.layout === "horizontal" ? { maxWidth: `${s}px` } : { maxHeight: `${s}px` };
|
|
74
|
+
return b(this, h`<div class=${`toolbar-grid-wrapper ${n} ${o}`} style=${c(d)}><div class="toolbar-shadow-wrapper" style=${c(d)}><calcite-action-bar expand-toggle-disabled .floating=${r === "floating"} .layout=${t.layout} overflow-mode=none .scale=${t.scale} ${m(this._setRenderedBar)}>${a.map(({ group: u, budget: p }) => u.proxiedRender(t, p))}</calcite-action-bar></div></div>`);
|
|
69
75
|
}
|
|
70
76
|
connectedCallback() {
|
|
71
|
-
super.connectedCallback(), this.
|
|
77
|
+
super.connectedCallback(), this.el.parentElement?.localName !== "arcgis-toolbar-stack" && this.#t.observe(this.el), this.#e.observe(this.el, { childList: !0 }), this._syncGroups();
|
|
72
78
|
}
|
|
73
79
|
disconnectedCallback() {
|
|
74
|
-
this.#t.disconnect(), this.#
|
|
75
|
-
}
|
|
76
|
-
_setRulerEl(t) {
|
|
77
|
-
this.#e !== t && (this.#e = t, this.isConnected && this._connectMeasurement(t));
|
|
78
|
-
}
|
|
79
|
-
_connectMeasurement(t) {
|
|
80
|
-
this.#t.disconnect(), t && (this.#t.observe(t), this._updateMeasurement());
|
|
80
|
+
this.#t.disconnect(), this.#e.disconnect(), super.disconnectedCallback();
|
|
81
81
|
}
|
|
82
82
|
_updateMeasurement(t) {
|
|
83
|
-
|
|
84
|
-
e && (this._availableLength = this.layout === "horizontal" ? e.width : e.height);
|
|
83
|
+
this._observedSize = t?.at(0)?.contentRect;
|
|
85
84
|
}
|
|
86
85
|
_syncGroups() {
|
|
87
|
-
this.#
|
|
88
|
-
const t = Array.from(this.el.children).filter(
|
|
89
|
-
this.#
|
|
86
|
+
this.#r?.abort();
|
|
87
|
+
const t = Array.from(this.el.children).filter(L), e = new AbortController();
|
|
88
|
+
this.#r = e, Promise.all(t.map((r) => r.componentOnReady())).then(() => {
|
|
90
89
|
!this.isConnected || e.signal.aborted || (this._groups = t, this.arcgisInternalLayoutUpdate.emit());
|
|
91
90
|
});
|
|
92
91
|
}
|
|
@@ -99,11 +98,15 @@ class w extends b {
|
|
|
99
98
|
scale: this.scale,
|
|
100
99
|
tooltipAppearance: this.tooltipAppearance,
|
|
101
100
|
toolbarKind: this.toolbarKind
|
|
102
|
-
},
|
|
103
|
-
|
|
101
|
+
}, r = this.allocate(e, this._availableLength).reduce((s, { budget: i }) => s + i, 0);
|
|
102
|
+
if (this.allocatedLength === void 0) {
|
|
103
|
+
const { minimum: s, maximum: i } = this.measureIntrinsicSize(e);
|
|
104
|
+
return h`<div class="intrinsic-sizing-container">${B(s, i, this.layout)}${this.proxiedRender(e, r, this.toolbarKind, this._availableLength)}</div>`;
|
|
105
|
+
}
|
|
106
|
+
return this.proxiedRender(e, r, this.toolbarKind, this._availableLength);
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
|
-
|
|
109
|
+
g("arcgis-toolbar", w);
|
|
107
110
|
export {
|
|
108
111
|
w as ArcgisToolbar
|
|
109
112
|
};
|
|
@@ -7,8 +7,8 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
7
7
|
* This is intended to be relatively simple; toolbars are 'stacked' vertically and horizontally
|
|
8
8
|
* according to layout, docking behavior, and available space.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* The stack observes its own content box or accepts an external allocation, so every
|
|
11
|
+
* toolbar receives the same available length regardless of its position within the stack.
|
|
12
12
|
*
|
|
13
13
|
* The general rule is the input order of the toolbar elements determines the semantic priority. Based on that priority,
|
|
14
14
|
* higher priority elements are stuck to the outside, with smaller/lower priority elements flowing towards the center.
|
|
@@ -16,6 +16,13 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
18
|
export abstract class ArcgisToolbarStack extends LitElement {
|
|
19
|
+
/**
|
|
20
|
+
* Main-axis budget in pixels. Undefined (the default) enables intrinsic sizing:
|
|
21
|
+
* CSS determines the stack's size, and its observed content box supplies the budget.
|
|
22
|
+
* Specifying a value, including zero, disables intrinsic sizing and directly controls
|
|
23
|
+
* the budget used to arrange and collapse toolbars. CSS can still constrain the host.
|
|
24
|
+
*/
|
|
25
|
+
accessor allocatedLength: number | undefined;
|
|
19
26
|
/** Toolbar orientation */
|
|
20
27
|
accessor layout: "horizontal" | "vertical";
|
|
21
28
|
/**
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class K {
|
|
2
|
+
import { c as k } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as _, render as C, nothing as z, html as b } from "lit";
|
|
4
|
+
import { LitElement as L, nothing as P } from "@arcgis/lumina";
|
|
5
|
+
import { useDirection as T } from "@arcgis/lumina/controllers";
|
|
6
|
+
import { s as x, a as A, b as $, c as w, r as S } from "../../chunks/intrinsic-sizing.js";
|
|
7
|
+
import { AsyncDirective as R } from "lit/async-directive.js";
|
|
8
|
+
import { directive as D, PartType as K } from "lit/directive.js";
|
|
9
|
+
import { getCommittedValue as u, clearPart as V, insertPart as v, setCommittedValue as g } from "lit/directive-helpers.js";
|
|
10
|
+
const M = _`:host{--calcite-internal-animation-timing-slow: 0}.stack{block-size:100%}.toolbar-stack{display:flex;gap:8px}:host([toolbar-kind="docked"]) .toolbar-stack{gap:0}.line{display:flex;gap:8px}:host([layout="vertical"]) .line{block-size:100%;flex-direction:column}:host([layout="vertical"]) .line[data-alignment=bottom]{align-self:end}.line[data-alignment=left]{justify-content:left}.line[data-alignment=right]{justify-content:right}:host([layout="vertical"]) .toolbar-stack{block-size:100%}:host([layout="horizontal"]) .toolbar-stack{flex-direction:column}:host([toolbar-kind="docked"][layout="horizontal"]) .toolbar-stack{min-inline-size:100%}:host([toolbar-kind="docked"][layout="vertical"]) .toolbar-stack{min-block-size:100%}:host(:not([allocated-length])){.toolbar-stack{grid-area:1 / 1;min-inline-size:0;min-block-size:0}.toolbar-grid-wrapper{flex:1 1 auto}}`;
|
|
11
|
+
class E {
|
|
13
12
|
constructor(t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Set()) {
|
|
14
13
|
this.cachedParts = t, this.directives = e;
|
|
15
14
|
}
|
|
@@ -18,12 +17,12 @@ class K {
|
|
|
18
17
|
t.moveToCache();
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
|
-
class
|
|
22
|
-
#e;
|
|
20
|
+
class I extends R {
|
|
23
21
|
#i;
|
|
22
|
+
#e;
|
|
24
23
|
#t;
|
|
25
24
|
constructor(t) {
|
|
26
|
-
if (super(t), t.type !==
|
|
25
|
+
if (super(t), t.type !== K.CHILD)
|
|
27
26
|
throw new Error("sharedCache() can only be used in child expressions");
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
@@ -31,13 +30,13 @@ class S extends x {
|
|
|
31
30
|
* @param _key Uniquely identifies the element being rendered
|
|
32
31
|
* @param value The content to render
|
|
33
32
|
*/
|
|
34
|
-
render(t, e,
|
|
35
|
-
return [
|
|
33
|
+
render(t, e, i) {
|
|
34
|
+
return [i];
|
|
36
35
|
}
|
|
37
|
-
update(t, [e,
|
|
38
|
-
this.#t !== e && (this.#t && this.#t.directives.delete(this), e.directives.add(this), this.#t = e), this.#
|
|
39
|
-
const
|
|
40
|
-
return
|
|
36
|
+
update(t, [e, i, a]) {
|
|
37
|
+
this.#t !== e && (this.#t && this.#t.directives.delete(this), e.directives.add(this), this.#t = e), this.#i = t, this.#e = i;
|
|
38
|
+
const o = e.cachedParts.get(i), s = o ? u(o).pop() : void 0;
|
|
39
|
+
return s && (V(t), v(t, void 0, s), g(t, [s])), this.render(e, i, a);
|
|
41
40
|
}
|
|
42
41
|
/**
|
|
43
42
|
* During the update phase, a toolbar may need to be pulled from the cache in a situation
|
|
@@ -50,20 +49,20 @@ class S extends x {
|
|
|
50
49
|
* @returns
|
|
51
50
|
*/
|
|
52
51
|
moveToCache() {
|
|
53
|
-
const t = this.#
|
|
52
|
+
const t = this.#i, e = this.#t;
|
|
54
53
|
if (!t || !e)
|
|
55
54
|
return;
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
55
|
+
const a = u(t).pop();
|
|
56
|
+
if (!a)
|
|
58
57
|
return;
|
|
59
|
-
let
|
|
60
|
-
if (!
|
|
61
|
-
const
|
|
62
|
-
|
|
58
|
+
let o = e.cachedParts.get(this.#e);
|
|
59
|
+
if (!o) {
|
|
60
|
+
const l = document.createDocumentFragment();
|
|
61
|
+
o = C(z, l), e.cachedParts.set(this.#e, o);
|
|
63
62
|
}
|
|
64
|
-
if (u(
|
|
63
|
+
if (u(o).length > 0)
|
|
65
64
|
throw new Error("sharedCache() keys must be unique");
|
|
66
|
-
|
|
65
|
+
g(o, [a]), v(o, void 0, a);
|
|
67
66
|
}
|
|
68
67
|
disconnected() {
|
|
69
68
|
this.#t?.directives.delete(this);
|
|
@@ -72,83 +71,82 @@ class S extends x {
|
|
|
72
71
|
this.#t?.directives.add(this);
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
|
-
const O =
|
|
76
|
-
class
|
|
74
|
+
const O = D(I), p = 8;
|
|
75
|
+
class W extends L {
|
|
77
76
|
constructor() {
|
|
78
|
-
super(), this.#
|
|
77
|
+
super(), this.#i = new ResizeObserver((t) => this._updateMeasurement(t)), this.#e = new MutationObserver(() => this._syncToolbars()), this.#a = T(), this.#o = new E(), this._layout = "horizontal", this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.listen("arcgisInternalLayoutUpdate", () => this.requestUpdate());
|
|
79
78
|
}
|
|
80
79
|
static {
|
|
81
|
-
this.properties = { _availableLength: 16, _toolbars: 16, effectiveRelativeDirection: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3 };
|
|
80
|
+
this.properties = { _observedSize: 16, _availableLength: 16, _toolbars: 16, effectiveRelativeDirection: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, allocatedLength: 11 };
|
|
82
81
|
}
|
|
83
82
|
static {
|
|
84
|
-
this.styles = [
|
|
83
|
+
this.styles = [M, x, A, $, w];
|
|
85
84
|
}
|
|
86
|
-
#e;
|
|
87
85
|
#i;
|
|
86
|
+
#e;
|
|
88
87
|
#t;
|
|
89
|
-
#
|
|
90
|
-
#s;
|
|
88
|
+
#a;
|
|
91
89
|
#o;
|
|
90
|
+
get _availableLength() {
|
|
91
|
+
return this.allocatedLength ?? (this.layout === "horizontal" ? this._observedSize?.width : this._observedSize?.height) ?? 0;
|
|
92
|
+
}
|
|
92
93
|
get effectiveRelativeDirection() {
|
|
93
|
-
const [t, e] = this.relativePosition.split("-"),
|
|
94
|
+
const [t, e] = this.relativePosition.split("-"), i = this.#a;
|
|
94
95
|
switch (e) {
|
|
95
96
|
case "left":
|
|
96
97
|
case "right":
|
|
97
98
|
return `${t}-${e}`;
|
|
98
99
|
case "end":
|
|
99
|
-
return `${t}-${
|
|
100
|
+
return `${t}-${i === "ltr" ? "right" : "left"}`;
|
|
100
101
|
case "start":
|
|
101
|
-
return `${t}-${
|
|
102
|
+
return `${t}-${i === "ltr" ? "left" : "right"}`;
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
get layout() {
|
|
105
106
|
return this._layout;
|
|
106
107
|
}
|
|
107
108
|
set layout(t) {
|
|
108
|
-
t !== this._layout && (this._layout = t
|
|
109
|
+
t !== this._layout && (this._layout = t);
|
|
109
110
|
}
|
|
110
111
|
connectedCallback() {
|
|
111
|
-
super.connectedCallback(), this.
|
|
112
|
+
super.connectedCallback(), this.#i.observe(this.el), this.#e.observe(this.el, { childList: !0 }), this._syncToolbars();
|
|
112
113
|
}
|
|
113
114
|
disconnectedCallback() {
|
|
114
|
-
this.#
|
|
115
|
-
}
|
|
116
|
-
_setRulerEl(t) {
|
|
117
|
-
this.#o !== t && (this.#o = t, this.isConnected && this._connectMeasurement(t));
|
|
118
|
-
}
|
|
119
|
-
_connectMeasurement(t) {
|
|
120
|
-
this.#e.disconnect(), t && (this.#e.observe(t), this._updateMeasurement());
|
|
115
|
+
this.#i.disconnect(), this.#e.disconnect(), super.disconnectedCallback();
|
|
121
116
|
}
|
|
122
117
|
_updateMeasurement(t) {
|
|
123
|
-
|
|
124
|
-
e && (this._availableLength = this.layout === "horizontal" ? e.width : e.height);
|
|
118
|
+
this._observedSize = t?.at(0)?.contentRect;
|
|
125
119
|
}
|
|
126
120
|
_syncToolbars() {
|
|
127
121
|
this.#t?.abort();
|
|
128
|
-
const t = Array.from(this.el.children).filter(
|
|
129
|
-
this.#t = e, Promise.all(t.map((
|
|
122
|
+
const t = Array.from(this.el.children).filter(j), e = new AbortController();
|
|
123
|
+
this.#t = e, Promise.all(t.map((i) => i.componentOnReady())).then(() => {
|
|
130
124
|
!this.isConnected || e.signal.aborted || (this._toolbars = t);
|
|
131
125
|
});
|
|
132
126
|
}
|
|
133
127
|
_arrangeToolbarLines(t, e) {
|
|
134
|
-
const
|
|
128
|
+
const i = t.map((r) => {
|
|
135
129
|
const d = r.allocate(e, this._availableLength);
|
|
136
|
-
return { toolbar: r, budget: d.reduce((
|
|
137
|
-
}),
|
|
138
|
-
let
|
|
139
|
-
for (const r of
|
|
140
|
-
const d =
|
|
141
|
-
|
|
130
|
+
return { toolbar: r, budget: d.reduce((f, y) => f + y.budget, 0) };
|
|
131
|
+
}), a = [];
|
|
132
|
+
let o = [], s = 0;
|
|
133
|
+
for (const r of i) {
|
|
134
|
+
const d = s + (o.length === 0 ? 0 : p) + r.budget;
|
|
135
|
+
o.length > 0 && (this.toolbarKind === "docked" || d > this._availableLength) ? (a.push(o), o = [r], s = r.budget) : (o.push(r), s = d);
|
|
142
136
|
}
|
|
143
|
-
|
|
144
|
-
const [
|
|
145
|
-
return (
|
|
137
|
+
o.length > 0 && a.push(o);
|
|
138
|
+
const [l, h] = e.relativePosition.split("-"), c = e.layout === "vertical";
|
|
139
|
+
return (c ? h === "right" : l === "bottom") && a.reverse(), (c ? l === "bottom" : h === "right") && a.forEach((r) => r.reverse()), a;
|
|
140
|
+
}
|
|
141
|
+
#s;
|
|
142
|
+
_renderIntrinsicSizeContribution(t, e) {
|
|
143
|
+
const i = t.map((s) => s.measureIntrinsicSize(e)), a = this.toolbarKind === "docked" ? Math.max(...i.map(({ maximum: s }) => s)) : i.reduce((s, { maximum: l }) => s + l, 0) + p * (t.length - 1), o = Math.max(...i.map(({ minimum: s }) => s));
|
|
144
|
+
return S(o, a, this.layout);
|
|
146
145
|
}
|
|
147
|
-
#a;
|
|
148
146
|
render() {
|
|
149
147
|
const t = this._toolbars;
|
|
150
148
|
if (!t?.length) {
|
|
151
|
-
this.#
|
|
149
|
+
this.#s?.length && (this.#o.moveAllToCache(), this.#s = []);
|
|
152
150
|
return;
|
|
153
151
|
}
|
|
154
152
|
const e = {
|
|
@@ -157,19 +155,19 @@ class j extends P {
|
|
|
157
155
|
scale: this.scale,
|
|
158
156
|
tooltipAppearance: this.tooltipAppearance,
|
|
159
157
|
toolbarKind: this.toolbarKind
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
const [
|
|
163
|
-
return b`<div class="stack
|
|
158
|
+
}, i = this._arrangeToolbarLines(t, e);
|
|
159
|
+
q(this.#s, i) || (this.#o.moveAllToCache(), this.#s = i.map((h) => h.map(({ toolbar: c }) => c)));
|
|
160
|
+
const [a, o] = e.relativePosition.split("-"), s = this.layout === "vertical" ? a : o, l = this.#o;
|
|
161
|
+
return b`<div class="stack intrinsic-sizing-container">${this.allocatedLength === void 0 && this._renderIntrinsicSizeContribution(t, e) || ""}<div class="toolbar-stack">${i.map((h) => b`<div class="line" data-alignment=${s ?? P}>${h.map(({ toolbar: c, budget: m }) => O(l, c, c.proxiedRender(e, m, this.toolbarKind, this._availableLength)))}</div>`)}</div></div>`;
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
|
-
function
|
|
164
|
+
function j(n) {
|
|
167
165
|
return n.localName === "arcgis-toolbar";
|
|
168
166
|
}
|
|
169
|
-
function
|
|
170
|
-
return n?.length === t.length && t.every((e,
|
|
167
|
+
function q(n, t) {
|
|
168
|
+
return n?.length === t.length && t.every((e, i) => e.length === n[i].length && e.every(({ toolbar: a }, o) => a === n[i][o]));
|
|
171
169
|
}
|
|
172
|
-
|
|
170
|
+
k("arcgis-toolbar-stack", W);
|
|
173
171
|
export {
|
|
174
|
-
|
|
172
|
+
W as ArcgisToolbarStack
|
|
175
173
|
};
|