@arcgis/common-components 5.2.0-next.71 → 5.2.0-next.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/common-components",
3
- "version": "5.2.0-next.71",
3
+ "version": "5.2.0-next.73",
4
4
  "description": "ArcGIS Maps SDK for JavaScript common components",
5
5
  "keywords": [
6
6
  "2D",
@@ -49,8 +49,8 @@
49
49
  "@lit/task": "^1.0.3",
50
50
  "lit": "^3.3.0",
51
51
  "tslib": "^2.8.1",
52
- "@arcgis/lumina": "5.2.0-next.71",
53
- "@arcgis/toolkit": "5.2.0-next.71"
52
+ "@arcgis/lumina": "5.2.0-next.73",
53
+ "@arcgis/toolkit": "5.2.0-next.73"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@arcgis/core": "^5.2.0-next",
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as k}from"./PMV2N3L3.js";import{a as C}from"./PWYX2MLC.js";import"./L6PNCJWB.js";import"./TWW63D32.js";import{D as V,E as _,F as $,G as u,J as D,h as w,j as v,k as g}from"./4XUU4OUP.js";export default $arcgis.t(([{substitute:z}])=>{var N=w`:host{display:block;--arcgis-histogram-bar-color: var(--calcite-color-border-1);--arcgis-histogram-stop-color: color-mix(in srgb, var(--calcite-color-brand) 80%, transparent)}.content{display:block;direction:ltr;width:100%;height:100%}.svg{display:block;width:100%;height:100%}.data-line{stroke:#888;stroke-width:1px;shape-rendering:crispEdges}.average-data-line{stroke-width:1px;shape-rendering:crispEdges;stroke:#444}.label,.data-line-symbol{font-size:12px;stroke:#fff;stroke-width:2px;paint-order:stroke;unicode-bidi:plaintext}.data-line-symbol{font-family:"Georgia, serif",sans-serif;font-style:italic}`;function B(t,n,r,e,a){let[i,s]=a;if(!t||s===0||i===0||r==null||n==null)return null;let o=r-n,c=(t.length>1?t[t.length-1].maxValue-t[0].minValue:0)/o,[l,h]=e==="vertical"?[s*c,i]:[s,i*c],m=t?t.map(d=>d.count):[],p=Math.max(...m);return t.map(d=>{let[f,b]=e==="vertical"?[l/t.length,p!==0?d.count/p*h:0]:[p!==0?d.count/p*l:0,h/t.length],{maxValue:F}=d,y=r-F,[I,S]=e==="vertical"?[0,y*(s/o)]:[i-b-y*(i/o),s-f];return[I,S,b,f]})}function O(t,n,r,e,a,i){let s=[];return t!=null&&s.push({value:t,symbol:"x\u0304",lineClass:"average-data-line"}),n!=null&&e!=null&&a!=null&&s.push(...H(e,a,n,r,t)),i&&s.push(...i),s}function A(t,n,r,e,a){if(r==null)return[0,0,0,0];let i=Math.round((a-r)/e*100)/100,[s,o]=t;if(n==="vertical"){let l=o-i*o||1;return l=Math.round(l)+.5,[0,"100%",l,l]}let c=i*s||1;return c=Math.round(c)+.5,[c,c,"100%",0]}function P(t,n,r,e,a){if(r==null)return[0,0];let i=Math.round((a-r)/e*100)/100,[s,o]=t;return n==="vertical"?[s,o-i*o]:[0,i*s]}function T(t,n,r){if(!t||t.length===0)return null;if(M(t)){let e=t.map(a=>({...a,color:E(a.color??r)}));return e.unshift({color:n,minValue:Number.NEGATIVE_INFINITY,maxValue:e[0].minValue}),e.push({color:n,minValue:e[e.length-1].maxValue,maxValue:Number.POSITIVE_INFINITY}),e}else return t.map(e=>({...e,color:E(e.color??r)}))}function R(t,n,r,e){if(!t||t.length===0)return r;if(M(t)){let a=G(t,n);if(a.length===0)return r;if(e){let{color:i=r,weight:s}=a[0],{color:o=r,weight:c}=a[1]??a[0],l=s+c;return`color-mix(in srgb, ${i} ${s/l*100}%, ${o} ${c/l*100}%)`}return a[0].color??r}return Y(t,n)}function G(t,n){let r=[];for(let e of t){let a=Math.max(0,Math.min(n.maxValue,e.maxValue)-Math.max(n.minValue,e.minValue));a>0&&r.push({color:e.color,weight:a})}return r.sort((e,a)=>a.weight-e.weight)}function Y(t,n){let r=(n.maxValue-n.minValue)/2+n.minValue;if(r>t[t.length-1].value)return t[t.length-1].color;for(let e=0;e<t.length-1;e++){let a=t[e],i=t[e+1];if(r<=a.value)return a.color;if(r<i.value){let s=(r-a.value)/(i.value-a.value)*100;return`color-mix(in srgb, ${a.color}, ${i.color} ${s}%)`}}return t[t.length-1].color}function M(t){return t[0]!=null&&"minValue"in t[0]}function E(t){if(typeof t=="string")return t;if(Array.isArray(t))return`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]??1})`;let{r:n,g:r,b:e,a=1}=t;return`rgba(${n}, ${r}, ${e}, ${a})`}function H(t,n,r,e,a){let i=.06*(n-t);return U(r,e,a).map((s,o,c)=>{let l=c.length/2,h=s>a?"+":"-",m=o>=l?o-l+1:l-o;return{symbol:`${h}${m===1?"":m}\u03C3`,value:s}}).filter(({value:s})=>Math.abs(a-s)>i)}function U(t,n,r){if(r==null||t==null)return[];let e=n,a=[];for(let i=e*-1;i<=e;i++)i!==0&&a.push(r+i*t);return a}var L="var(--arcgis-histogram-bar-color)",q="var(--arcgis-histogram-stop-color)",x=class extends V{constructor(){super(...arguments),this._messages=C(),this._normalizedStops=null,this.#t=(n,r)=>{let e=a=>k(this._messages._lang,this._numberFormatterOptions).format(a);return this.labelFormatter?.(n,r,e)??e(n)},this._numberFormatterOptions={maximumFractionDigits:2},this.containerDimensions=[0,0],this.icon="graph-histogram",this.layout="horizontal",this.colorBlendingEnabled=!1,this.standardDeviationCount=1}static{this.properties={containerDimensions:16,colorStops:0,icon:3,labelFormatter:0,average:11,messageOverrides:0,standardDeviation:11,bins:0,dataLines:0,label:1,layout:3,max:11,min:11,colorBlendingEnabled:5,standardDeviationCount:9}}static{this.styles=N}#t;loaded(){let n=new ResizeObserver(a=>{for(let i of a){let{width:s,height:o}=i.contentRect;this.containerDimensions=[s,o]}}),{width:r,height:e}=this.el.getBoundingClientRect();this.containerDimensions=[r,e],n.observe(this.el)}willUpdate(n){n.has("colorStops")&&(this._normalizedStops=T(this.colorStops,L,q))}render(){let{label:n}=this;return v`<div role=img .ariaLabel=${n??void 0} class="content">${this._renderContent()}</div>`}_renderContent(){let{containerDimensions:[n,r]}=this,e="bg-fill",a=n?[g`<defs><clipPath id=${e}><rect height=${r??u} width=${n??u} x=0 y=0 /></clipPath></defs>`,g`<g style=${$({clipPath:`url(#${e})`})}><g>${this._renderBars()}</g></g>`,g`<g>${this._renderLines()}</g>`]:[];return v`<svg class="svg" xmlns=http://www.w3.org/2000/svg>${a}</svg>`}_renderBars(){let{bins:n,_messages:r}=this,e=B(this.bins,this.min,this.max,this.layout,this.containerDimensions);return!e||!n?null:e.map((a,i)=>{let[s,o,c,l]=a,h=n[i],m=r?.barLabel?z(r.barLabel,h):"";return g`<rect style=${$({fill:R(this._normalizedStops,h,L,this.colorBlendingEnabled)})} .ariaLabel=${m} data-index=${i??u} height=${l??u} role=img shape-rendering=crispEdges stroke-width=0 width=${c??u} x=${s??u} y=${o??u} />`})}_renderLines(){return O(this.average,this.standardDeviation,this.standardDeviationCount,this.min,this.max,this.dataLines)?.map(n=>W({dataLine:n,containerDimensions:this.containerDimensions,layout:this.layout,min:this.min,max:this.max,labelFormatter:this.#t}))}},W=t=>{let{containerDimensions:n,layout:r,min:e,max:a,dataLine:i,labelFormatter:s}=t,o=a!=null&&e!=null?a-e:0,[c,l,h,m]=A(n,r,e,o,i.value),[p,d]=P(n,r,e,o,i.value),f="symbol"in i?[g`<tspan class="data-line-symbol">${i.symbol}</tspan>`,g`<tspan>${s(i.value,i.lineClass==="average-data-line"?"average":"standard-deviation")}</tspan>`]:i.label,b="lineClass"in i&&i.lineClass?i.lineClass:"data-line";return g`<g><title>${i.value}</title><line class=${_(b)} shape-rendering=crispEdges x1=${c??u} x2=${l??u} y1=${h??u} y2=${m??u} /><text class="label" text-anchor=end transform=${(r==="horizontal"?"rotate(270)":void 0)??u} x=${p??u} y=${d-2}>${f}</text></g>`};D("arcgis-histogram",x);return x},"intl")