@arcgis/common-components 5.1.0-next.2 → 5.1.0-next.21
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/23DDMSOB.js +2 -0
- package/dist/cdn/3O7GAC23.js +2 -0
- package/dist/cdn/4CW7U27R.js +2 -0
- package/dist/cdn/4DCAUWTC.js +2 -0
- package/dist/cdn/EKKJN7WZ.js +2 -0
- package/dist/cdn/GAR4QMLU.js +2 -0
- package/dist/cdn/JTRO7GRS.js +2 -0
- package/dist/cdn/ZLXAKPUH.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/commonFunctions.js +3 -13
- package/dist/components/arcgis-ckeditor5/customElement.d.ts +1 -0
- package/dist/components/arcgis-ckeditor5/types.d.ts +9 -0
- package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +1 -0
- package/dist/components/arcgis-color-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-info/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-info/customElement.js +10 -10
- package/dist/components/arcgis-field-info/utils/basic.d.ts +1 -0
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-pick-list/utils/types.d.ts +5 -1
- package/dist/components/arcgis-histogram/customElement.d.ts +46 -28
- package/dist/components/arcgis-label-input/customElement.d.ts +5 -4
- package/dist/components/arcgis-picker-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-ramp-color/customElement.d.ts +2 -0
- package/dist/components/arcgis-ramp-color-break/customElement.d.ts +2 -0
- package/dist/components/arcgis-ramp-opacity/customElement.d.ts +1 -0
- package/dist/components/arcgis-slider/customElement.d.ts +269 -73
- package/dist/components/arcgis-slider/customElement.js +318 -289
- package/dist/components/arcgis-slider-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-ticks/customElement.d.ts +101 -13
- package/dist/components/arcgis-ticks/customElement.js +27 -27
- package/dist/components/arcgis-ticks/types.d.ts +23 -0
- package/dist/components/arcgis-unique-values-list/customElement.d.ts +8 -1
- package/dist/components/arcgis-unique-values-list/customElement.js +155 -149
- package/dist/components/arcgis-unique-values-list/utils/basic.d.ts +1 -0
- 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/dist/utils/types.d.ts +24 -7
- package/package.json +3 -3
- package/dist/cdn/6MGBOM6S.js +0 -2
- package/dist/cdn/6NYYZIHB.js +0 -2
- package/dist/cdn/BAVGT3I5.js +0 -2
- package/dist/cdn/GQLKGVRX.js +0 -2
- package/dist/cdn/P45VPBNI.js +0 -2
- package/dist/cdn/S7T3XQPB.js +0 -2
- package/dist/cdn/ZP76EPVI.js +0 -2
package/README.md
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
# ArcGIS Maps SDK for JavaScript - Common Components
|
|
2
2
|
|
|
3
|
-
The ArcGIS Maps SDK for JavaScript provides a suite of ready-to-use UI components that simplify the process of creating GIS web applications. This package contains the
|
|
3
|
+
The ArcGIS Maps SDK for JavaScript provides a suite of ready-to-use UI components that simplify the process of creating GIS web applications. This package contains the [Histogram](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-histogram/), [Slider](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/), and [Ticks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/) components.
|
|
4
|
+
|
|
5
|
+
Want to get started immediately? See [Get started](https://developers.arcgis.com/javascript/latest/get-started/) or try out the [sample applications](https://developers.arcgis.com/javascript/latest/sample-code/?tagged=common-components).
|
|
6
|
+
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
- [Key Features](https://developers.arcgis.com/javascript/latest/key-features/)
|
|
10
|
+
- [Build with npm](https://developers.arcgis.com/javascript/latest/get-started/#npm)
|
|
11
|
+
- [API and component references](https://developers.arcgis.com/javascript/latest/references/)
|
|
12
|
+
- [Functionality samples](https://developers.arcgis.com/javascript/latest/sample-code/)
|
|
13
|
+
- [TypeScript setup](https://developers.arcgis.com/javascript/latest/get-started/#typescript)
|
|
14
|
+
|
|
15
|
+
## Resources
|
|
16
|
+
|
|
17
|
+
- [ArcGIS blog](https://blogs.esri.com/esri/arcgis/tag/javascript/)
|
|
18
|
+
- [System Requirements](https://developers.arcgis.com/javascript/latest/system-requirements/)
|
|
19
|
+
- [Terms of Use](https://www.esri.com/en-us/legal/terms/product-specific-scope-of-use)
|
|
20
|
+
- [Licensing](https://developers.arcgis.com/javascript/latest/licensing/)
|
|
21
|
+
- [Working with `next` versions](https://github.com/Esri/feedback-js-api-next/blob/main/README.md)
|
|
22
|
+
|
|
23
|
+
## Issues
|
|
24
|
+
|
|
25
|
+
- General questions about using this package or the ArcGIS Maps SDK for JavaScript? See the [Esri developer community](https://community.esri.com/t5/arcgis-api-for-javascript/ct-p/arcgis-api-for-javascript).
|
|
26
|
+
- [Technical support](https://support.esri.com/).
|
|
4
27
|
|
|
5
28
|
## License
|
|
6
29
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{h as o}from"./UTXWKXMT.js";var n=Symbol(),e=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??u,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t)}async run(t){let s,r;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let a=!1;try{s=await this.v(t,{signal:this.q.signal})}catch(l){a=!0,r=l}if(this.p===i){if(s===n)this.i=0;else{if(a===!1){try{this.k?.(s)}catch{}this.i=2,this.o?.(s)}else{try{this.A?.(r)}catch{}this.i=3,this.h?.(r)}this.u=s,this.l=r}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},u=(h,t)=>h===t||h.length===t.length&&h.every(((s,r)=>!o(s,t[r])));export{e as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{B as $,C as h,D as m,E as f,H as M,g as y,i as c,q as w}from"./UTXWKXMT.js";export default $arcgis.t(([{formatNumber:A}])=>{var l={container:"container",ticksContainer:"ticks-container",labelsContainer:"labels-container",tick:"tick",tickMin:"tick--min",tickMax:"tick--max",tickLabel:"tick-label",baseline:"baseline"},L=y`:host{display:flex;--arcgis-ticks-tick-length: .5rem;--arcgis-ticks-tick-color: var(--calcite-color-border-input);--arcgis-ticks-gap: 1em;--arcgis-ticks-font-size: var(--calcite-font-size--2)}.container{align-items:stretch;display:flex;color:var(--calcite-color-text-2);flex:1;font-weight:var(--calcite-font-weight-medium);font-size:var(--arcgis-ticks-font-size);line-height:1em;position:relative;user-select:none;word-wrap:normal;word-break:normal}.baseline{background-color:var(--arcgis-ticks-tick-color, var(--calcite-color-border-input))}.tick{position:absolute;background-color:var(--arcgis-ticks-tick-color, var(--calcite-color-border-input))}.tick-label{position:absolute;text-align:var(--arcgis-ticks-label-text-align, center);width:var(--arcgis-ticks-label-width, var(--labels-container-width, "auto"))}:host([layout="horizontal"]){.ticks-container{height:var(--arcgis-ticks-tick-length)}.labels-container{height:var(--labels-container-height, "auto")}.tick{width:.125rem;height:var(--arcgis-ticks-tick-length);transform:translate(-50%)}.tick-label{transform:translate(-50%)}.tick--min{transform:unset}.tick--max{transform:translate(-100%)}}:host([layout="vertical"]){.ticks-container{width:var(--arcgis-ticks-tick-length)}.labels-container{width:var(--labels-container-width)}.tick{width:var(--arcgis-ticks-tick-length);height:.125rem;transform:translateY(50%)}.tick-label{text-align:right;transform:translateY(50%)}.tick--min{transform:unset}.tick--max{transform:translateY(100%)}}:host([layout="horizontal"][mirrored]){.tick,.tick-label{transform:translate(50%)}.tick--min{transform:unset}.tick--max{transform:translate(100%)}}:host([layout="vertical"][mirrored]){.tick,.tick-label{transform:translateY(-50%)}.tick--min{transform:unset}.tick--max{transform:translateY(-100%)}}:host([layout="horizontal"][label-placement="start"]){.container{flex-direction:column;justify-content:flex-end}.labels-container{margin-bottom:var(--arcgis-ticks-gap)}}:host([layout="horizontal"][label-placement="end"]){.container{flex-direction:column-reverse;justify-content:flex-end}.labels-container{margin-top:var(--arcgis-ticks-gap)}}:host([layout="vertical"][label-placement="start"]){.container{flex-direction:row;justify-content:flex-end}:dir(ltr){.labels-container{margin-right:var(--arcgis-ticks-gap)}.tick-label{text-align:right}}:dir(rtl){.labels-container{margin-left:var(--arcgis-ticks-gap)}.tick-label{text-align:left;unicode-bidi:plaintext}}}:host([layout="vertical"][label-placement="end"]){.container{flex-direction:row-reverse;justify-content:flex-end}:dir(ltr){.labels-container{margin-left:var(--arcgis-ticks-gap)}.tick-label{text-align:left}}:dir(rtl){.labels-container{margin-right:var(--arcgis-ticks-gap)}.tick-label{text-align:right;unicode-bidi:plaintext}}}:host([interactive]){pointer-events:none;.tick,.tick-label{pointer-events:auto;cursor:pointer}.tick-label:hover{text-decoration:underline}}`,g=class extends ${constructor(){super(...arguments),this._formatValue=e=>A(e,this._formatOptions),this._formatOptions={style:"decimal",useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:2},this.interactive=!1,this.interpolationExponent=0,this.labelPlacement="end",this.layout="horizontal",this.max=100,this.min=0,this.mirrored=!1,this.mode="count",this.showLabels=!1,this.showBaseline=!1,this.values=[],this.arcgisTickClick=w({cancelable:!1})}static{this.properties={_formatOptions:16,interactive:7,interpolationExponent:9,labelFormatter:0,labelPlacement:3,layout:3,max:9,min:9,mirrored:7,mode:1,showLabels:5,showBaseline:5,values:[9,{converter:{fromAttribute(e){if(e.includes(","))return e.split(",").filter(t=>t.trim()!=="").map(parseFloat).filter(t=>Number.isFinite(t));{let t=parseFloat(e);return Number.isFinite(t)?[t]:[]}}}}]}}static{this.styles=L}updated(){let e=this.renderRoot.querySelector(`.${l.labelsContainer}`);if(e){let t=0,i=0;for(let a of this.renderRoot.querySelectorAll(`.${l.tickLabel}`)){let r=a.getBoundingClientRect();t=Math.max(t,r.width),i=Math.max(i,r.height)}t=Math.ceil(t),i=Math.ceil(i),!t||!i?(e.style.removeProperty("--labels-container-width"),e.style.removeProperty("--labels-container-height")):(e.style.setProperty("--labels-container-width",`${t}px`),e.style.setProperty("--labels-container-height",`${i}px`))}}_handleClick(e){if(!this.interactive)return;let t=e.target.dataset.value;t&&this.arcgisTickClick.emit({value:Number(t)})}_internalLabelFormatter(e){let t=this.labelFormatter;return t?t(e,this._formatValue)??this._formatValue(e):this._formatValue(e)}render(){return c`<div class=${h(l.container)} touch-action=none @click=${this._handleClick}>${this._renderContent()}${this._renderBaseline()}</div>`}_renderContent(){let{interpolationExponent:e,max:t,min:i,mode:a,values:r,layout:s,mirrored:o,showLabels:C}=this,p=[],v=[];for(let[d,k]of F(a,i,t,e,r)){let x={[s==="horizontal"?o?"right":"left":o?"top":"bottom"]:`${d}%`},z={[l.tick]:!0,[l.tickMin]:d===0,[l.tickMax]:d===100};p.push(c`<div class=${h(z)} style=${m(x)} data-value=${k??f}></div>`),C&&v.push(c`<div class=${h(l.tickLabel)} style=${m(x)} data-value=${k??f}>${this._internalLabelFormatter(k)}</div>`)}return[c`<div class=${h(l.labelsContainer)}>${v}</div>`,c`<div class=${h(l.ticksContainer)}>${p}</div>`]}_renderBaseline(){let{showBaseline:e,layout:t}=this;return e&&c`<div class=${h(l.baseline)} style=${m({[t==="horizontal"?"width":"height"]:"100%",[t==="horizontal"?"height":"width"]:"0.125rem"})}></div>`||""}};function*F(n,e,t,i,a){switch(n){case"value":{let r=Array.isArray(a)?a:[a];for(let s of r){let o=P(e,t,s,i)*100;o>=0&&o<=100&&(yield[o,s])}break}case"percent":{if(Array.isArray(a))for(let r of a)r>=0&&r<=100&&(yield[r,u(e,t,r/100,i)]);else if(a>0)for(let r=0;r<=100;r+=a)yield[r,u(e,t,r/100,i)];break}case"count":{let r=Array.isArray(a)?a[0]:a;if(r<=1)yield[50,u(e,t,.5,i)];else for(let s=0;s<r;s++){let o=s*100/(r-1);yield[o,u(e,t,o/100,i)]}break}}}function b(n,e,t){return t<n?n:t>e?e:t}function _(n,e,t){return n+(e-n)*t}function P(n,e,t,i=0){let a=(t-n)/(e-n);if(a=b(0,1,a),Math.abs(i)<1e-9)return a;let r=1+Math.expm1(i)*a;return a=Math.log(r)/i,b(0,1,a)}function u(n,e,t,i=0){if(t=b(0,1,t),Math.abs(i)<1e-9)return _(n,e,t);let a=Math.expm1(i*t)/Math.expm1(i);return _(n,e,a)}M("arcgis-ticks",g);return g},"intl")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as x}from"./23DDMSOB.js";import{a as F}from"./7Y42J3JI.js";import{b as k}from"./7PB2GGQH.js";import"./7CI55VCH.js";import{A as V,B as C,C as h,H as q,g as D,i as d,m as $,n as b,q as T}from"./UTXWKXMT.js";export default $arcgis.t(([L,w,f,I,S,Z,A,P])=>{function p(s){return s!=null}function M(s){return s.type==="scene"?s.associatedLayer?.url:s.url}var G={dateStyle:"short",timeStyle:"short"},W={timeStyle:"medium"};function H(s){let{layer:e,fieldName:t}=s,i,a=I.supportsFieldConfiguration(e),r;"popupTemplate"in e&&(r=e.popupTemplate);let n=r?r.fieldInfos:[];return R(s)?.filter(l=>l.name===t).forEach(l=>{let u=!a&&n?n.filter(m=>m.fieldName===l.name):null,c=a?e.getFieldAlias(t):u?.length?u[0].label:l.alias;/^raster.(item|service)pixelvalue/iu.test(t)&&(l.type="double");let o={layerField:l,label:c||l.name};o.codedValues=j(t,s),Q(o),o.simpleFieldType&&(i=o)}),i}function R(s){let{layer:e}=s;return e.type==="imagery-tile"||e.type==="wcs"||e.type==="imagery"&&e.rasterFields.length?e.rasterFields:e.fields}async function E(s){s.statisticsStatus="in-progress";let{layer:e,view:t}=s;if(e.type==="imagery-tile"||e.type==="wcs"||e.type==="stream"||e.type==="voxel")throw new Error("could not get feature count");try{return await B(e,t)}catch{return}}async function U(s){let{layer:e,view:t,fieldName:i,fieldInfo:a}=s;if(e.type==="imagery-tile"||e.type==="wcs"||e.type==="voxel")throw new Error("could not get statistics for ImageryTileLayer/WCSLayer/VoxelLayer");if(!a||a.layerField.type==="oid"||a.layerField.type==="guid"||a.layerField.type==="global-id")return{totalCount:await E(s),nullcount:0};try{let r=await Z({layer:e,view:t,field:i,outStatisticTypes:{exclude:["median"]}});if(!p(r.count))throw new Error("could not get statistics");let n="sourceJSON"in e&&e.sourceJSON.maxRecordCount===r.count;if(p(r.nullcount)&&!n)return{...r,totalCount:r.count+r.nullcount};{let l=await E(s);return{...r,totalCount:l}}}catch{throw new Error("could not get statistics")}}async function J(s){let{layer:e,view:t,fieldName:i}=s;if(e.type==="imagery-tile"||e.type==="wcs"||e.type==="voxel")throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer/WCSLayer/VoxelLayer");e.type==="feature"&&!e.url&&(e.outFields=["*"]);try{return await A({layer:e,view:t,field:i})}catch{throw new Error("could not get unique values")}}function Q(s){switch(s.layerField.type){case"string":s.simpleFieldType="string";break;case"date":s.simpleFieldType="date";break;case"timestamp-offset":s.simpleFieldType="timestamp-offset";break;case"date-only":s.simpleFieldType="date-only";break;case"time-only":s.simpleFieldType="time-only";break;case"oid":s.simpleFieldType="oid";break;case"guid":case"global-id":s.simpleFieldType="guid";break;case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":s.simpleFieldType="number";break}}function j(s,e){let{layer:t}=e;if(t.type==="subtype-sublayer"&&t.subtypeField===s){let u=t.parent?.subtypes?.find(c=>c.code===t.subtypeCode);if(u)return[{code:u.code,name:u.name}]}if(t.type!=="feature"&&t.type!=="imagery")return;let i=t.type==="feature"?t.typeIdField:void 0,a=t.type==="feature"?t.types:void 0,r,n=R(e)?.find(u=>u.name===s),l=n?.domain;return t.type==="feature"&&i&&a?(i===s?r=a.map(u=>({code:u.id,name:u.name})):(r=[],a.forEach(u=>{if(!u.domains[s]||u.domains[s].type==="inherited"){let c=l;c?.codedValues&&c.codedValues.forEach(async o=>{let m=!1;r.forEach(y=>{y.code===o.code&&(m=!0,`, ${y.name},`.includes(`, ${o.name},`)||(y.name+=`, ${o.name}`))}),m||r.push(S.clone(o))})}else u.domains[s].codedValues&&u.domains[s].codedValues.forEach(async c=>{let o=!1;r.forEach(m=>{m.code===c.code&&(o=!0,`, ${m.name},`.includes(`, ${c.name},`)||(m.name+=`, ${c.name}`))}),o||r.push(S.clone(c))})})),!r.length&&l?.codedValues&&(r=S.clone(l.codedValues))):l?.codedValues&&(r=n.domain.codedValues),r?.length?r:null}async function z(s){let{view:e,layer:t}=s;if(t.type==="imagery"||t.type==="imagery-tile"||t.type==="wcs")throw new Error("could not get feature");if(t.type==="feature"&&!t.url||t.type==="wfs"){let i=t.createQuery();i.start=0,i.num=5,i.outFields=["*"];let a=await t.queryFeatures(i);if(a.features.length)return a;throw new Error("could not get feature")}else{if(!e)return await N(s);let i;if(t.type==="subtype-sublayer"||t.type==="sublayer"){let a=t.parent;for(;["subtype-group","map-image"].includes(a.type);)a=a.parent;i=await e.whenLayerView(a)}else i=await e.whenLayerView(t);if(i.availableFields.length===t.fields.length||["stream","ogc-feature"].includes(t.type)&&i.availableFields.length>0){let a=t.createQuery();a.start=0,a.num=5,a.outFields=["*"];let r=await i.queryFeatures(a);return r.features?.length?r:await N(s)}else return await N(s)}}async function N(s){let{layer:e}=s;if(["imagery","imagery-tile","stream","ogc-feature"].includes(e.type))throw new Error("cannot get feature from service");let t=new P({where:"1=1",outFields:["*"],returnGeometry:!1});return"sourceJSON"in e&&e.sourceJSON?.advancedQueryCapabilities?.supportsPagination&&(t.num=1),await e.queryFeatures(t)}async function B(s,e){if(s.type==="feature"&&!s.url)return await K(s);if(s.type==="feature"||s.type==="csv"||s.type==="scene"||s.type==="wfs"||s.type==="geojson")return await s.queryFeatureCount();if(e&&(s.type==="stream"||s.type==="ogc-feature"))return await X(s,e)}async function K(s){let e=s.createQuery();e.outFields=["*"];let t=await s.queryFeatures(e);if(t.features.length)return t.features.length;throw new Error("could not get feature count")}async function X(s,e){return await(await e.whenLayerView(s)).queryFeatureCount()}var Y=D`:host{height:100%}.container{padding:var(--calcite-space-xs);background-color:var(--calcite-color-foreground-1)}.title{font-weight:700;padding:5px 0}.missing,.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:var(--calcite-space-xs) 0}.statistics-row{border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);padding:var(--calcite-space-xs) 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:var(--calcite-border-width-sm) solid var(--calctie-color-border-2);padding:20px 0 var(--calcite-space-xs) 0;display:flex;justify-content:space-between}`,_=class extends C{constructor(){super(...arguments),this._messages=k({blocking:!0}),this._propWatcherTask=new x(this,{task:async([e,t])=>{let i=p(e)&&p(t);if(p(e)||$("error",this,b("layer")),p(t)||$("error",this,b("fieldName")),!i)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName]}),this.oneFeatureResponseStatus="missing",this.statisticsStatus="missing",this.uniqueValuesStatus="missing",this.hideAlias=!1,this.hideNumericFormat=!1,this.hideStatistics=!1,this.arcgisComplete=T(),this.arcgisFieldInfoComplete=T()}static{this.properties={oneFeatureResponseStatus:16,oneFeatureResponse:16,statisticsStatus:16,statistics:16,uniqueValuesStatus:16,uniqueValues:16,view:0,layer:0,fieldName:1,hideAlias:5,hideNumericFormat:5,hideStatistics:5}}static{this.styles=Y}async refresh(){await this.processProps(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.timeZoneHandle?.remove()}async processProps(){let{view:e,layer:t,fieldName:i,hideStatistics:a}=this;if(!t||!i)return;let r;if(t.declaredClass==="esri.layers.support.Sublayer"){let n=t;e&&await w.whenOnce(()=>!e.updating),r=await n.createFeatureLayer(),await r?.load()}this.props={view:e,layer:r??t,fieldName:i,hideStatistics:a},this.props.fieldInfo=H(this.props),t.type==="scene"&&L.request.interceptors?.push({urls:`${M(t)}/${t.layerId}`,before(n){n.requestOptions.authMode="no-prompt"}}),this.oneFeatureResponseStatus="in-progress";try{let n=await z(this.props);this.oneFeatureResponse=n,this.oneFeatureResponseStatus="success"}catch{this.oneFeatureResponseStatus="failed"}if(t.type==="stream"){this.uniqueValuesStatus="failed",this.statisticsStatus="failed";return}if(a)this.uniqueValuesStatus="failed";else{this.uniqueValuesStatus="in-progress";try{let n=await J(this.props);this.uniqueValues=n,n?.uniqueValueInfos?.length?this.uniqueValuesStatus="success":this.uniqueValuesStatus="failed"}catch{this.uniqueValuesStatus="failed"}}if(a)this.statisticsStatus="failed";else{this.statisticsStatus="in-progress";try{let n=await U(this.props);if(!p(n.totalCount)&&p(n.count)&&this.uniqueValuesStatus==="success"){let l=this.uniqueValues?.uniqueValueInfos??[];for(let u=0;u<l.length;u++){let c=l[u];if(c.value===null){n.totalCount=c.count+n.count;break}}n.totalCount??=n.count}this.statistics=n,this.statisticsStatus="success"}catch{this.statisticsStatus="failed"}}this.setUpTimeZoneHandle()}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{props:e}=this,{view:t,fieldInfo:i}=e;["date","timestamp-offset"].includes(this._getStatisticsType(i))&&(this.timeZoneHandle=w.watch(()=>t?.timeZone,()=>{this.requestUpdate()}))}_getFieldTypeLabel(e){let{_messages:t}=this,i=t.fieldTypes;switch(e){case"big-integer":return i.bigInteger;case"date":return i.date;case"date-only":return i.dateOnly;case"double":return i.double;case"global-id":return i.globalId;case"guid":return i.guid;case"integer":return i.integer;case"long":return i.long;case"oid":return i.oid;case"single":return i.single;case"small-integer":return i.smallInteger;case"string":return i.string;case"time-only":return i.timeOnly;case"timestamp-offset":return i.timestampOffset;default:return i.string}}_getStatisticsType(e){switch(e.layerField.type){case"big-integer":case"double":case"integer":case"single":case"small-integer":{if(e.codedValues)return"string";switch(e.layerField.valueType){case"binary":case"description":case"location-or-place-name":case"name-or-title":case"ordered-or-ranked":case"type-or-category":return"string";default:return"number"}}case"date":return"date";case"date-only":return"date-only";case"string":return"string";case"time-only":return"time-only";case"timestamp-offset":return"timestamp-offset";default:return"string"}}_getFieldValueTypeCamelCase(e){switch(e.layerField.valueType){case"count-or-amount":return"countOrAmount";case"date-and-time":return"dateAndTime";case"location-or-place-name":return"locationOrPlaceName";case"name-or-title":return"nameOrTitle";case"ordered-or-ranked":return"orderedOrRanked";case"percentage-or-ratio":return"percentageOrRatio";case"type-or-category":return"typeOrCategory";case"unique-identifier":return"uniqueIdentifier";case"phone-number":return"phoneNumber";case"email-address":return"emailAddress";default:return e.layerField.valueType}}_getDisplayString(e,t){let{props:i}=this,{fieldInfo:a}=i;switch(a.simpleFieldType){case"date":return this._getDateString(e,t);case"date-only":return this._getDateOnlyString(e,t);case"guid":return this._getGuidString(e);case"number":return this._getNumberString(e,t);case"time-only":return this._getTimeOnlyString(e,t);case"timestamp-offset":return this._getTimestampOffsetString(e,t);default:return`${e}`}}_getDateString(e,t){let{view:i}=this.props;return i&&i.timeZone==="unknown"?f.formatDate(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:"utc"}):f.formatDate(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:i?.timeZone||"system"})}_getTimestampOffsetString(e,t){let{view:i}=this.props;return typeof e=="string"?i&&i.timeZone==="unknown"?f.formatTimestamp(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:"utc"}):f.formatTimestamp(e,{...this.getIntlDateTimeFormattingOptions("short-date-short-time",t),timeZone:i?.timeZone||"system"}):this._getDateString(e,t)}_getDateOnlyString(e,t){return f.formatDateOnly(e,this.getIntlDateTimeFormattingOptions("short-date",t))}_getTimeOnlyString(e,t){return typeof e=="string"?f.formatTimeOnly(e,this.getIntlDateTimeFormattingOptions("short-date-long-time",t)):f.formatDate(e,{...this.getIntlDateTimeFormattingOptions("long-time",{...t,isTimeOnly:!0}),timeZone:"utc"})}_getGuidString(e){return e.startsWith("{")?e:`{${e}}`}_getNumberString(e,t){let i=t?.useFieldFormatting?e:Math.round(e*100)/100;return f.formatNumber(i,this.getIntlNumberFormattingOptions(t))}_printNumValue(e,t){return p(e)?this._getNumberString(e,t):"--"}_setCompleteRef(){this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit()}getCurrentFieldFormat(){let{props:e}=this,{layer:t,fieldName:i}=e;return(this.originalLayerSupportsFieldConfigs()?t.getFieldConfiguration(i):void 0)?.fieldFormat}getIntlNumberFormattingOptions(e){let t=this.getCurrentFieldFormat();if(!e?.useFieldFormatting)return t?{useGrouping:["always","auto"].includes(t.useGrouping)}:f.convertNumberFormatToIntlOptions({digitSeparator:this.getPopupTemplateFieldInfo()?.format?.digitSeparator??!0});let i=t?{minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,useGrouping:["always","auto"].includes(t.useGrouping)}:void 0;if(i)return i;let a=this.getPopupTemplateFieldInfo();return f.convertNumberFormatToIntlOptions({digitSeparator:a?.format?.digitSeparator??!0,places:a?.format?.places??2})}getIntlDateTimeFormattingOptions(e,t){let i=this.getCurrentFieldFormat();if(!t?.useFieldFormatting)return i?t?.isTimeOnly?W:G:f.convertDateFormatToIntlOptions(e);let a=i?{dateStyle:t?.isTimeOnly?void 0:i.dateStyle??void 0,year:i.dateStyle?void 0:i.year??void 0,month:i.dateStyle?void 0:i.month??void 0,timeStyle:i.timeStyle??void 0,hourCycle:i.hour12==="never"?"h23":"h11"}:void 0;if(a)return a;let r=this.getPopupTemplateFieldInfo();return f.convertDateFormatToIntlOptions(r?.format?.dateFormat??e)}originalLayerSupportsFieldConfigs(){let{layer:e}=this;return I.supportsFieldConfiguration(e)}getPopupTemplateFieldInfo(){let{props:e}=this,{layer:t,fieldName:i}=e;return("popupTemplate"in t?t.popupTemplate:void 0)?.fieldInfos?.find(a=>a.fieldName===i)}render(){return this._propWatcherTask.render({complete:()=>{let{props:e}=this,{fieldInfo:t}=e;return t?d`<div class="container">${this.renderFieldType()}${this.renderFieldAlias()}${this.renderFieldDescription()}${this.renderFieldValueType()}${this.renderFieldSampleValue()}${this.renderFieldNumericFormat()}${this.renderFieldStatistics()}</div>`:""},error:()=>""})}renderFieldType(){let{_messages:e,props:t}=this,{fieldInfo:i}=t,a=this._getFieldTypeLabel(i.layerField.type);return d`<div class="section"><div class="title">${e.fieldType}</div><div>${a}</div></div>`}renderFieldAlias(){let{_messages:e,props:t,hideAlias:i}=this,{fieldInfo:a}=t;return i?"":d`<div class="section"><div class="title">${e.fieldAlias}</div><div>${a.label}</div></div>`}renderFieldDescription(){let{_messages:e,props:t}=this,{layer:i}=t;if(i.type!=="feature")return"";let{fieldInfo:a}=t,r=a.layerField.description;return d`<div class="section"><div class="title">${e.fieldDescription}</div><div class=${h({missing:!r})}>${r||e.fieldDescriptionNotSet}</div></div>`}renderFieldValueType(){let{_messages:e,props:t}=this,{layer:i}=t;if(i.type!=="feature")return"";let{fieldInfo:a}=t,r=this._getFieldValueTypeCamelCase(a);return d`<div class="section"><div class="title">${e.fieldValueType}</div><div class=${h(r?"":"missing")}>${r?e.fieldValueTypes[r]:e.fieldValueTypeNotSet}</div></div>`}renderFieldSampleValue(){let{oneFeatureResponse:e,oneFeatureResponseStatus:t,statisticsStatus:i,statistics:a,uniqueValuesStatus:r,uniqueValues:n,_messages:l,props:u}=this,{layer:c,fieldName:o,fieldInfo:m}=u,{statistics:y}=l,g;if(["imagery-tile","voxel"].includes(c.type)||c.type!=="stream"&&["string","oid","guid"].includes(this._getStatisticsType(m))&&r!=="failed")return"";t==="success"?e.features.forEach(v=>{(g===void 0||g===null&&v.attributes[o]!==null)&&(g=v.attributes[o])}):i==="success"?g=a?.min:r==="success"&&(g=n?.uniqueValueInfos?.[0]?.value||n?.uniqueValueInfos?.[1]?.value);let O=m.codedValues;return p(g)&&(O?g=O.find(v=>g===v.code)?.name||g:g=this._getDisplayString(g,{useFieldFormatting:!0})),d`<div class="section"><div class="title">${l.fieldSampleValue}</div><div class=${h(t==="failed"&&i==="failed"&&r==="failed"||!p(g)?"missing":"")}>${t==="success"||i==="success"||r==="success"?g?.toString()??y.allNulls:t==="failed"&&i==="failed"&&r==="failed"?l.fieldSampleNotAvailable:l.fieldSampleRetrieving}</div></div>`}renderFieldNumericFormat(){let{_messages:e,props:t,hideNumericFormat:i}=this,{fieldName:a,fieldInfo:r,layer:n}=t;if(i||!["double","long","single"].includes(r.layerField.type))return"";let l=this.originalLayerSupportsFieldConfigs()?n.getFieldConfiguration(a):void 0;if(l?.fieldFormat){let{minimumFractionDigits:c,maximumFractionDigits:o}=l.fieldFormat;return d`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}",c.toString())}</div><div>${e.fieldMaximumFractionDigits.replace("${number}",o.toString())}</div></div>`}let u="popupTemplate"in n?n.popupTemplate:void 0;if(u?.fieldInfos){let c=u.fieldInfos?.filter(o=>o.fieldName===a);if(c?.length){let o=c[0];if(p(o?.format?.places)){let m=o.format.places;return d`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}",m.toString())}</div></div>`}}}return d`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div class="missing">${e.fieldDecimalPlacesNotAvailable}</div></div>`}renderFieldStatistics(){let{statisticsStatus:e,uniqueValuesStatus:t,hideStatistics:i,_messages:a,props:r}=this,{layer:n,fieldInfo:l}=r;return i?(this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit(),""):["stream","imagery-tile","voxel"].includes(n.type)||["long"].includes(l.layerField.type)?(this.arcgisComplete.emit(),this.arcgisFieldInfoComplete.emit(),""):d`<div class="section"><div class="title">${a.fieldStatistics}</div>${!e||e==="missing"||e==="in-progress"?F("field-info-statistics-content",d`<div class="missing">${a.fieldStatisticsRetrieving}</div>`):e==="failed"&&t!=="success"?this.renderNoStatistics():F("field-info-statistics-content",d`<div ${V(this._setCompleteRef)}>${this.renderStatistics()}</div>`)}</div>`}renderNoStatistics(){let{_messages:e}=this;return F("field-info-statistics-content",d`<div class="missing" ${V(this._setCompleteRef)}>${e.fieldStatisticsNotAvailable}</div>`)}renderStatistics(){let{props:e}=this,{fieldInfo:t}=e;switch(this._getStatisticsType(t)){case"number":return this.renderNumberStatistics();case"guid":case"oid":case"string":return this.renderStringStatistics();case"date":case"date-only":case"time-only":case"timestamp-offset":return this.renderDateStatistics();default:return""}}renderNumberStatistics(){let{statistics:e,_messages:t}=this;if(!e)return this.renderNoStatistics();let{statistics:i}=t;return d`<div><div class="statistics-row"><div>${i.numberOfValues}</div><div class="data">${this._printNumValue(e.totalCount)}</div></div>${p(e.sum)?d`<div class="statistics-row"><div>${i.sumOfValues}</div><div class="data">${this._printNumValue(e.sum)}</div></div>`:null}${p(e.min)?d`<div class="statistics-row"><div>${i.minimum}</div><div class="data">${this._printNumValue(e.min)}</div></div>`:null}${p(e.max)?d`<div class="statistics-row"><div>${i.maximum}</div><div class="data">${this._printNumValue(e.max)}</div></div>`:null}${p(e.avg)?d`<div class="statistics-row"><div>${i.average}</div><div class="data">${this._printNumValue(e.avg)}</div></div>`:null}${p(e.stddev)?d`<div class="statistics-row"><div>${i.standardDeviation}</div><div class="data">${this._printNumValue(e.stddev)}</div></div>`:null}${this.renderNullValues()}</div>`}renderStringStatistics(){let{statistics:e,uniqueValuesStatus:t,_messages:i}=this,{statistics:a}=i;return d`<div><div class="statistics-row"><div>${a.numberOfValues}</div>${t!=="success"?d`<div class="missing">--</div>`:d`<div class="data">${this._printNumValue(e?.totalCount)}</div>`}</div>${this.renderNullValues()}${this.renderTopValues()}</div>`}renderDateStatistics(){let{statistics:e,view:t,props:i,_messages:a}=this,{fieldInfo:r}=i;if(!e||!p(e.max)||!p(e.min))return this.renderNoStatistics();let{statistics:n}=a,l=e.max-e.min,u=Math.floor(l/31536e6),c=Math.floor((l-u*31536e6)/2628e6),o=Math.ceil((l-c*2628e6)/864e5);o>=30&&(c+=1,o=0);let m=u===1?n.timeSpanOptions.year:u>1?n.timeSpanOptions.years.replace("${years}",u.toString()):"";m+=u>0&&(c>0||o>0)?", ":"",m+=c===1?n.timeSpanOptions.month:c>1?n.timeSpanOptions.months.replace("${months}",c.toString()):"",m+=c>0&&o>0?", ":"",m+=o===1?n.timeSpanOptions.day:o>1?n.timeSpanOptions.days.replace("${days}",o.toString()):"";let y=r.simpleFieldType!=="timestamp-offset"||!t||t.timeZone!=="unknown",g=r.simpleFieldType==="time-only";return d`<div><div class="statistics-row"><div>${n.numberOfValues}</div><div class="data">${this._printNumValue(e?.totalCount)}</div></div>${y&&p(e.min)?d`<div class="statistics-row"><div>${g?n.minimumTime:n.minimumDate}</div><div class="data">${this._getDisplayString(e.min)}</div></div>`:null}${y&&p(e.max)?d`<div class="statistics-row"><div>${g?n.maximumTime:n.maximumDate}</div><div class="data">${this._getDisplayString(e.max)}</div></div>`:null}${y&&p(e.avg)?d`<div class="statistics-row"><div>${g?n.averageTime:n.averageDate}</div><div class="data">${this._getDisplayString(e.avg)}</div></div>`:null}${y&&!g&&p(e.min)&&p(e.max)&&l>0?d`<div class="statistics-row"><div>${n.timespan}</div><div class="data">${m}</div></div>`:null}${this.renderNullValues()}</div>`}renderTopValues(){let{uniqueValues:e,uniqueValuesStatus:t,_messages:i,props:a}=this,{fieldInfo:r}=a,{statistics:n}=i;if(e?.uniqueValueInfos?.length){let l=e.uniqueValueInfos;l.sort((o,m)=>o.count<m.count?1:o.count>m.count?-1:0);let u=r.codedValues,c=l.filter(o=>o.value!==null).filter((o,m)=>o&&m<10).map(o=>{let m=o.value;return u?u.forEach(y=>{m===y.code&&(m=y.name)}):m=this._getDisplayString(m),d`<div class="statistics-row"><div class="data">${`${m}`}</div><div class="count">${this._printNumValue(o.count)}</div></div>`});return c.length?d`<div><div class="statistics-row-top-values"><div>${l.length>10?n.topTenValues:n.topValues}</div><div>${n.count}</div></div>${c}</div>`:""}else return d`<div><div class="statistics-row-top-values"><div>${n.topValues}</div><div>${n.count}</div></div><div class="statistics-row"><div class="missing">${t==="failed"?i.fieldUniqueValuesNotAvailable:i.fieldSampleRetrieving}</div></div></div>`}renderNullValues(){let{statistics:e,uniqueValues:t,_messages:i}=this,{statistics:a}=i,r=e?.nullcount;if(!p(r)&&t){let n=t.uniqueValueInfos;for(let l=0;l<n.length;l++){let u=n[l];if(u.value===null){r=u.count;break}}}return d`<div class="statistics-row"><div>${a.numberOfNulls}</div>${p(r)?d`<div class="data">${this._printNumValue(r)}</div>`:d`<div class="missing">--</div>`}</div>`}};q("arcgis-field-info",_);return _},"config","core/reactiveUtils","intl","applications/PortalApp/layerUtils","core/lang","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/support/Query")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as i}from"./WDOKXOEG.js";import{a as m}from"./EKKJN7WZ.js";import{a as u}from"./23DDMSOB.js";import{e as g}from"./7CI55VCH.js";import{A as a,B as d,C as e,E as p,H as h,g as l,i as n,q as s,t as c,z as o}from"./UTXWKXMT.js";var v=l`.arcgis-app-ckeditor-popover-footer{display:flex;justify-content:flex-end;margin-top:var(--calcite-space-sm);padding:0 var(--calcite-space-lg)}.arcgis-app-ckeditor-popover-container{margin:0 var(--calcite-space-md) 0 0;padding-bottom:var(--calcite-space-lg);box-shadow:val(--calcite-shadow-1)}`,r=class extends d{constructor(){super(),this.okButton=o(),this.popoverNode=o(),this._propWatcherTask=new u(this,{task:async([t])=>{if(!m(t)){console.error("[ckeditor5] Required properties are missing.");return}},args:()=>[this.refElement]}),this.guid=c(),this.intlOk="Ok",this.intlCancel="Cancel",this.arcgisCkeditor5PopoverClosed=s(),this.arcgisPopoverClosed=s(),this.listen("arcgisCreated",this.afterEditorCreated),this.listen("arcgisSourceEditingChanged",this.onSourceEditingStatusChanged)}static{this.properties={guid:1,refElement:0,intlOk:1,intlCancel:1,intlLabel:1}}static{this.styles=v}async reposition(){this.popoverNode.value?.reposition()}afterEditorCreated(t){this.editor=t.target,this.reposition(),this.requestUpdate()}onSourceEditingStatusChanged(t){this.okButton.value&&(this.okButton.value.disabled=t.detail)}render(){return this.el.classList.add("js-app-flyout"),this._propWatcherTask.render({complete:()=>n`<calcite-popover class=${e(i.popover)} dir=${g(this.el)??p} placement=leading-start open pointer-disabled .referenceElement=${this.refElement} .offsetDistance=${-Math.round(this.refElement.getBoundingClientRect().width)} offset-skidding=50 .label=${this.intlLabel??""} focus-trap-disabled trigger-disabled top-layer-disabled ${a(this.popoverNode)}><div class=${e(i.arcgisAppCkeditorPopoverContainer)}><slot></slot><div class=${e(i.arcgisAppCkeditorPopoverFooter)}><calcite-button .label=${this.intlOk} @click=${async t=>{this.okButton.value?.disabled||(t.stopPropagation(),this.arcgisCkeditor5PopoverClosed.emit({guid:this.guid,data:await this.editor?.getData()}),this.arcgisPopoverClosed.emit({guid:this.guid,data:await this.editor?.getData()}))}} ${a(this.okButton)}>${this.intlOk}</calcite-button><calcite-button appearance=outline-fill .label=${this.intlCancel} @click=${t=>{t.stopPropagation(),this.arcgisCkeditor5PopoverClosed.emit({guid:this.guid}),this.arcgisPopoverClosed.emit({guid:this.guid})}}>${this.intlCancel}</calcite-button></div></div></calcite-popover>`})}};h("arcgis-ckeditor5-popover",r);export{r as ArcgisCkeditor5Popover};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as f}from"./EKKJN7WZ.js";import{a as k}from"./23DDMSOB.js";import{a as B}from"./7Y42J3JI.js";import{b as C}from"./7PB2GGQH.js";import"./7CI55VCH.js";import{A as I,B as O,H as R,g as L,i as w,m as q,n as Z,q as F,z as U}from"./UTXWKXMT.js";export default $arcgis.t(([{formatDate:N,convertDateFormatToIntlOptions:v,formatDateOnly:Q,formatTimeOnly:X,formatTimestamp:_,formatNumber:Y},ee,{clone:E}])=>{function M(t){return new Date(`1970-01-01T${t}Z`).getTime()}function A(t){return new Date(`${t} 00:00:00`).getTime()}function te(t,e,s){let i;return e==="unknown"?i=N(t,{...v("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):i=N(t,{...v("short-date-short-time"),timeZone:e}),i}function ie(t){return t?Q(t,v("short-date")):""}function se(t){let e;return typeof t=="string"?e=X(t,v("short-date-long-time")):e=N(t,{...v("long-time"),timeZone:"utc"}),e}function ne(t,e){return typeof t=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?_(t,{...v("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):_(t,{...v("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?N(t,{...v("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):N(t,{...v("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function W(t,e,s){if(t.type!=="feature"&&t.type!=="subtype-group"&&t.type!=="subtype-sublayer"&&t.type!=="imagery")return;let i;return x(t,s).fields.forEach(l=>{let n=l.name,d="domain"in l?l.domain:void 0;if(t.type!=="imagery"&&t.subtypeField===n){let m;t.type==="subtype-group"||t.type==="feature"?m=t.subtypes:m=t.parent.subtypes,m.forEach(r=>{t.type==="subtype-sublayer"&&t.subtypeCode!==r.code||(e.name===n&&(i=i||[],i.push({code:r.code,name:r.name})),r.domains&&Object.keys(r.domains).forEach(a=>{if(e.name===a){let o=r.domains[a];o?.type==="coded-value"&&o?.codedValues&&o.codedValues.forEach(u=>{let c=!1;i=i||[],i.forEach(g=>{g.code===u.code&&(c=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),c||i.push({code:u.code,name:u.name})})}}))})}if(e.name===n&&(t.type==="feature"||t.type==="imagery")){let m=t.type==="feature"?t.typeIdField:void 0,r=t.type==="feature"?t.types:void 0;t.type==="feature"&&m&&r?(m===n?i=r.map(a=>({code:a.id,name:a.name})):(i=i||[],r.forEach(a=>{if(!a.domains?.[n]||a.domains[n].type==="inherited"){let o=d;o?.codedValues&&o.codedValues.forEach(u=>{let c=!1;i.forEach(g=>{g.code===u.code&&(c=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),c||i.push(E(u))})}else a.domains?.[n]?.codedValues&&a.domains[n].codedValues.forEach(o=>{let u=!1;i.forEach(c=>{c.code===o.code&&(u=!0,`| ${c.name} |`.includes(`| ${o.name} |`)||(c.name+=` | ${o.name}`))}),u||i.push(E(o))})})),!i?.length&&d?.codedValues&&(i=E(d.codedValues))):d?.codedValues&&(i=d.codedValues)}}),i}function D(t,e){let s=e;if(s){let i="";for(let l=0;l<s.length;l++){let n=s[l];n.code==t&&(i+=(i.length?" | ":"")+n.name)}return i.length||(i=`${t}`),i}return t}function P(t){return["small-integer","big-integer","integer","single","double","long"].includes(t.type)}function z(t){switch(t.type){case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":return"number";case"blob":case"geometry":case"global-id":case"guid":case"oid":case"raster":case"xml":return;default:return t.type}}function x(t,e){return e==="feature-reduction"&&"featureReduction"in t?t.featureReduction:t}var ae=L`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`,S=class extends O{constructor(){super(...arguments),this.dropdownNode=U(),this._messages=C({blocking:!0}),this._propWatcherTask=new k(this,{task:async([e,s,i])=>{let l=f(e)&&f(s)||f(i);if(!f(i)&&!f(e)&&!f(s)?q("error",this,Z("uniqueValues")):f(i)||(f(e)||q("error",this,Z("layer")),f(s)||q("error",this,Z("fieldName"))),f(e)&&f(s)){let{fieldSource:n}=this;if(!x(e,n).fields?.filter(d=>d.name===s))throw q("error",this,"Field could not be found."),new Error}if(!l)throw new Error;await this.processProps()},args:()=>[this.layer,this.fieldName,this.uniqueValues]}),this.initialRender=!0,this.multiple=!1,this.partialUniqueValues=!1,this.showFilterLength=10,this.arcgisChange=F(),this.arcgisSortByChange=F(),this.arcgisLoad=F()}static{this.properties={initialRender:16,view:0,layer:0,fieldSource:1,fieldName:1,uniqueValues:0,numberFormatOptions:0,selectedValues:0,sortBy:1,multiple:5,partialUniqueValues:5,showFilterLength:9,maxHeight:9}}static{this.styles=ae}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(f(e?.uniqueValueInfos)){let{uniqueValueInfos:s,partialUniqueValues:i}=e;return{uniqueValues:s,partialUniqueValues:i}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}async processProps(){let{layer:e,fieldName:s,view:i,fieldSource:l}=this,n=(e?x(e,l):void 0)?.fields?.filter(d=>d.name===s)?.[0];if(f(this.uniqueValues))this.fieldInfo={layerField:n,fieldDomains:e&&n?W(e,n,l):void 0,simpleType:e&&n?z(n):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&n){this.fieldInfo={layerField:n,fieldDomains:W(e,n,l),simpleType:z(n),partialUniqueValues:!1};let{fieldInfo:d}=this;try{let m=await ee({layer:e,view:i,field:s,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:!1}),r=P(n),a=m.uniqueValueInfos.filter(o=>f(o.value)?n.type==="string"&&!r||n.type==="guid"?o.value!=="<Null>"&&`${o.value}`.trim()!=="":(P(n)||n.type,o.value!=="<Null>"&&o.value!==""):!1);a.sort((o,u)=>o.count>u.count?-1:o.count<u.count?1:0),d.fieldDomains?.length&&d.fieldDomains.forEach(o=>{a.find(u=>u.value===o.code)||a.push({value:o.code,count:0})}),d.uniqueValueInfos=a,d.partialUniqueValues=m.uniqueValueInfos.length===2e3,this.arcgisLoad.emit()}catch(m){if(q("error",this,`uniqueValues() - ${m.message}`),this.hasFieldDomains(d)){let r=[];d.fieldDomains.forEach(a=>{r.find(o=>o.value===a.code)||r.push({value:a.code,count:void 0})})}}setTimeout(()=>{this.initialRender=!1,this.listNode?.setFocus()},800)}}setListRef(e){let{maxHeight:s}=this;this.listNode=e,s&&e?.setAttribute("style",`max-height: ${s||400}px`)}onSortMenuSelect(e){let s=e.currentTarget.selectedItems?.[0].getAttribute("data-value");this.sortBy=s||void 0,this.arcgisSortByChange.emit(s||void 0)}isSameLists(e,s){if(!e&&!s)return!0;if(!e||!s||e?.length!==s?.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==s[i])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:s,sortBy:i,multiple:l,initialRender:n,showFilterLength:d,_messages:m}=this,{fieldDomains:r,uniqueValueInfos:a,partialUniqueValues:o,layerField:u}=e,c=u?.type;if(!a?.length)return"";let g=c?["small-integer","big-integer","integer","single","double","long","oid"].includes(c):!1,H=c?["date","date-only","time-only"].includes(c):!1,j=y=>{y.sort((h,p)=>h.count<=p.count?1:-1)},G=y=>{let h=r?.length;y.sort((p,V)=>{if(!h&&g)return(typeof p.value=="string"?Number.parseFloat(p.value):p.value)-(typeof V.value=="string"?Number.parseFloat(V.value):V.value);{let $=h?D(p.value,r):p.value,b=h?D(V.value,r):V.value;return`${$}`.startsWith("_")?1:`${b}`.startsWith("_")?-1:`${$}`.localeCompare(`${b}`)}})},J=(y,h)=>{y.sort((p,V)=>{let $=h?.indexOf(p.value)??-1,b=h?.indexOf(V.value)??-1;return $===b||$>-1&&b>-1?0:$>b?-1:1})};G(a),!i||i==="count"?j(a):i==="selected"&&J(a,s);let K=a.map(y=>this.renderUniqueValue(y)),T;return o&&!n&&(T=w`<div class="unique-values-content-list-msg">${m.errors.tooManyUniqueValues}</div>`),w`<div class="container"><calcite-list .label=${m.values} class="popover-unique-list" .filterEnabled=${a.length>=d} .selectionMode=${l?"multiple":"single"} .filterPlaceholder=${m.searchValues} @calciteListChange=${y=>{let h=y.target.selectedItems.map(p=>p.value);!r&&c==="date-only"?h=h?.map(p=>A(p)):!r&&c==="time-only"?h=h?.map(p=>M(p)):c&&["date","oid","small-integer","big-integer","integer","long"].includes(c)?h=h?.map(p=>Number.parseInt(p)):c&&["single","double"].includes(c)&&(h=h?.map(p=>Number.parseFloat(p))),!this.isSameLists(h,this.selectedValues)&&(this.selectedValues=h,this.arcgisChange.emit(h))}} @calciteListFilter=${()=>{this.dropdownNode.value&&(this.dropdownNode.value.disabled=this.listNode.filteredItems.length<4)}} ${I(this.setListRef)}>${a.length>=d&&!n?this.renderSort(g,H):null}${K}</calcite-list>${T}</div>`},error:()=>""})}renderSort(e,s){let{sortBy:i,_messages:l}=this;return w`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${I(this.dropdownNode)}><calcite-action slot=trigger .label=${l.sortValues} text><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${i==="count"||!f(i)} data-value=count>${l.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${i==="name"} data-value=name>${e||s?l.sortAscending:l.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${i==="selected"} data-value=selected>${l.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:s,initialRender:i,view:l,fieldInfo:n,numberFormatOptions:d}=this,{fieldDomains:m,uniqueValueInfos:r,simpleType:a}=n,o=l&&"timeZone"in l&&l.timeZone||"system",u=m?.length?D(e.value,m):a==="date"?te(e.value,o):a==="date-only"?ie(e.value):a==="time-only"?se(e.value):a==="timestamp-offset"?ne(e.value,l):typeof e.value=="number"?Y(e.value,d):e.value,c=s?a==="date-only"?s.includes(m?.length?e.value:A(e.value)):a==="time-only"?s.includes(m?.length?e.value:M(e.value)):s.includes(e.value):!1;return B(`list-item_${e.value}`,w`<calcite-list-item .label=${`${u}`} .value=${`${e.value}`} .selected=${c}>${f(e.count)&&(r.length>200&&!i||r.length<=200)?w`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};R("arcgis-unique-values-list",S);return S},"intl","smartMapping/statistics/uniqueValues","core/lang")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as Q}from"./7Y42J3JI.js";import{a as re}from"./EPX7DYFW.js";import{a as ee,b as te}from"./7PB2GGQH.js";import{a as z,b as X,d as J}from"./7CI55VCH.js";import{A as F,B as G,C as $,D as S,E as w,H as Z,g as K,i as b,o as q,p as W,q as C,s as Y,t as V,z as O}from"./UTXWKXMT.js";export default $arcgis.t(([{on:qe,watch:ae},{createObservable:me,trackAccess:pe},{property:Xe,subclass:Je},et,xe,{property:D,subclass:ye},{watch:H}])=>{var ne=(a,e)=>t=>fe(t,a),A=class extends Y{constructor(e,t){super(e),this.Y=new Map,this.A=void 0,this.#r=me();let r=this;r.#e=t,r.Z(),r.setProvisionalExports(ve(e,new WeakRef(r),e.M.length-1,r.instance,r.Y),!1),q(e,i=>{if(i){let n=ae(()=>e[i],o=>{if(o===r.instance)return;let s=r.instance;r.exports=o,r.instance=o,r.Y.forEach((l,d)=>e.requestUpdate(l,s[d])),r.#t&&s.destroy(),r.#t=!1},{sync:!0});r.onDestroy(n.remove)}},r.exports)}#t;#r;#e;get exports(){return pe(this.#r),super.exports}set exports(e){super.exports=e,this.#r.notify()}Z(){let e=this;e.instance="prototype"in e.#e&&"declaredClass"in e.#e.prototype?new e.#e:e.#e(),e.#t=!0}hostConnected(){this.exports=this.instance}hostDestroy(){this.#t&&this.instance.destroy?.()}},fe=ee(A),ve=(a,e,t,r,i)=>new Proxy(r,{get:(n,o)=>{let s=n[o];if(typeof o=="symbol"||i.has(o))return s;let l=a.M[t];return l.A=o,W(a,d=>{if(l.A=void 0,d!==void 0){let c=d.key;i.set(o,c);let h=a.constructor.getPropertyOptions(c),u=o!==c&&c.toLowerCase().includes("disable");be(e,h,o,c,u),h.i===void 0&&_e(h,t,o,u)}},s)}}),be=(a,e,t,r,i,n)=>n=ae(()=>{let o=a.deref();return o===void 0||o.component.manager.destroyed?n=n.remove():o.exports[t]},(o,s)=>{if(!n)return;a.deref().component?.requestUpdate(r,i?!s:s),e.c=!1},{sync:!0}),_e=(a,e,t,r)=>{a.d.get=function(){let i=this.M[e]?.exports[t];return r?!i:i},a.d.set=function(i){let n=this.M[e];n.A!==t&&(n.exports[t]=r?!i:i)}};function*ie(a,e){if(a!==void 0){let t=0;for(let r of a)yield e(r,t++)}}var p={increment:"ArrowUp",incrementHorizontal:"ArrowRight",decrement:"ArrowDown",decrementHorizontal:"ArrowLeft",pageIncrement:"PageUp",pageDecrement:"PageDown",jumpToStart:"Home",jumpToEnd:"End",confirmEdit:"Enter"};function se({key:a,shiftKey:e},t,r){let i=ke(a);if(i==null)return null;let n=De(a)||we(a)&&e?Ee(t):1;return{direction:r?i*-1:i,count:n}}function ke(a){return a===p.increment||a===p.incrementHorizontal||a===p.pageIncrement?1:a===p.decrement||a===p.decrementHorizontal||a===p.pageDecrement?-1:null}function oe(a){return a===p.jumpToEnd||a===p.jumpToStart}function we(a){return a===p.increment||a===p.decrement||a===p.decrementHorizontal||a===p.incrementHorizontal}function De(a){return a===p.pageIncrement||a===p.pageDecrement}function Ee(a){let e=Number.isFinite(a)?Math.floor(a):1;return Math.max(1,e)}var Pe=K`:host{display:flex;width:100%;height:100%;font-family:Avenir Next,Helvetica Neue,helvetica,arial,sans-serif;font-size:var(--calcite-font-size--2);font-variant-numeric:tabular-nums;--arcgis-slider-dash-length: 5px;--arcgis-slider-handle-size: .875rem;--arcgis-slider-track-background-color: var(--calcite-color-border-2);--arcgis-slider-internal-show-range-labels: 0;--arcgis-slider-internal-show-value-labels: 0;--arcgis-slider-internal-value-labels-placement-start: 0;--arcgis-slider-internal-value-labels-placement-end: 0;--arcgis-slider-internal-range-labels-placement-center: 0;--arcgis-slider-internal-range-labels-placement-end: 0;--arcgis-slider-internal-handle-offset: calc(var(--arcgis-slider-handle-size) / 2);--arcgis-slider-internal-label-input-margin: calc(var(--arcgis-slider-internal-handle-offset) + 4px);--arcgis-slider-internal-label-input-height: var(--calcite-input-number-height, 1.5rem);--arcgis-slider-internal-track-size: 2px}:host([show-range-labels]){--arcgis-slider-internal-show-range-labels: 1}:host(:not([value-labels-display="hidden"])){--arcgis-slider-internal-show-value-labels: 1}:host([value-labels-placement="start"]){--arcgis-slider-internal-value-labels-placement-start: var(--arcgis-slider-internal-show-value-labels)}:host([value-labels-placement="end"]){--arcgis-slider-internal-value-labels-placement-end: var(--arcgis-slider-internal-show-value-labels)}:host([range-labels-placement="center"]){--arcgis-slider-internal-range-labels-placement-center: var(--arcgis-slider-internal-show-range-labels)}:host([range-labels-placement="end"]){--arcgis-slider-internal-range-labels-placement-end: var(--arcgis-slider-internal-show-range-labels)}:host([disabled]){cursor:default;opacity:var(--calcite-opacity-disabled);pointer-events:none}.content{direction:ltr;flex:1;touch-action:none;user-select:none;display:grid;word-wrap:normal;word-break:normal;padding-block:var(--arcgis-slider-internal-handle-offset)}.track-container{grid-area:track-container;position:relative;display:flex;justify-content:center;align-items:center}.track{touch-action:none;position:relative}.track-bounds{background-color:var(--calcite-color-border-2)}.track-fill{--arcgis-slider-track-background-color: var(--calcite-color-brand)}:host([layout="vertical"]){.track-effective-start{background:repeating-linear-gradient(to bottom,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to top,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}:host([layout="horizontal"]){.track-effective-start{background:repeating-linear-gradient(to right,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to left,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}.track-range{background-color:var(--calcite-color-brand);&.active{box-shadow:0 0 8px #00000029;outline:1px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)))}}:host([disabled]) .track-range{background-color:var(--calcite-color-text-3)}:host([disabled]),:host([disabled][layout="horizontal"]),:host([disabled][layout="vertical"]){.track-range.interactive:after{cursor:default;pointer-events:none}}:host([layout="horizontal"]){.track-range.interactive:after{all:initial;cursor:ew-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-slider-internal-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-top:1px}}:host([layout="vertical"]){.track-range.interactive:after{all:initial;cursor:ns-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-slider-internal-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-left:1px;writing-mode:vertical-lr}}.segment{transform-origin:0 0;inset-block-start:0px;block-size:.125rem;position:absolute;top:0;left:0}.thumb{-webkit-user-select:none;user-select:none;background-color:#4c4c4c;position:absolute}.thumb:focus,.thumb.active{.handle{background-color:var(--calcite-color-brand);box-shadow:0 0 8px #00000029;outline:2px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}}.handle{cursor:pointer;box-sizing:border-box;z-index:1;touch-action:none;background-color:var(--calcite-color-foreground-1);box-shadow:0 0 0 2px var(--calcite-color-text-3) inset;border-radius:var(--arcgis-slider-handle-size);width:var(--arcgis-slider-handle-size);height:var(--arcgis-slider-handle-size);transition:all var(--calcite-animation-timing, .125s) ease-in-out;position:absolute;top:calc(var(--arcgis-slider-internal-handle-offset) * -1);left:calc(var(--arcgis-slider-internal-handle-offset) * -1)}.handle:hover{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}.label{position:absolute;will-change:transform}.label[hidden]{display:block;opacity:0;pointer-events:none}.min{grid-area:range-start}.max{grid-area:range-end}:host([layout="horizontal"][mirrored][range-labels-placement="center"]),:host([layout="vertical"]:not([mirrored])){.min{grid-area:range-end}.max{grid-area:range-start}}.content-start{grid-area:content-start;display:flex}.content-end{grid-area:content-end;display:flex}:host([layout="vertical"]){.content{grid-template:". range-start range-start range-start ." "content-start content-start track-container content-end content-end" ". range-end range-end range-end .";grid-template-rows:auto 1fr auto;grid-template-columns:1fr auto auto auto 1fr;row-gap:var(--arcgis-slider-internal-handle-offset)}.track-container{flex-direction:column}.track{flex:1;width:var(--arcgis-slider-internal-track-size)}.segment{writing-mode:vertical-lr}.label{top:calc(var(--arcgis-slider-internal-label-input-height) * -.5)}&:host([value-labels-placement="start"]){.label{right:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{left:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="center"]){.content{--arcgis-slider-internal-content-start-min-height: calc( ((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset)) + (var(--arcgis-slider-internal-value-labels-placement-start) * var(--arcgis-slider-internal-label-input-height)) );--arcgis-slider-internal-content-end-min-height: calc( ((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset)) + (var(--arcgis-slider-internal-value-labels-placement-end) * var(--arcgis-slider-internal-label-input-height)) );column-gap:calc(var(--arcgis-slider-internal-show-range-labels) * var(--arcgis-slider-internal-handle-offset) / 2);padding-inline:calc((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset));grid-template:". content-start ." "range-start content-start range-end" "range-start track-container range-end" "range-start content-end range-end" ". content-end .";grid-template-columns:auto 1fr auto;grid-template-rows:minmax(var(--arcgis-slider-internal-content-start-min-height),auto) calc(var(--arcgis-slider-internal-show-range-labels) * calc(calc(var(--arcgis-slider-internal-label-input-height) / 2) - calc(var(--arcgis-slider-internal-track-size) / 2))) var(--arcgis-slider-internal-track-size) calc(var(--arcgis-slider-internal-show-range-labels) * calc(calc(var(--arcgis-slider-internal-label-input-height) / 2) - calc(var(--arcgis-slider-internal-track-size) / 2))) minmax(var(--arcgis-slider-internal-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-slider-internal-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="end"]){.content{--arcgis-slider-internal-content-start-min-height: calc( var(--arcgis-slider-internal-handle-offset) + var(--arcgis-slider-internal-value-labels-placement-start) * var(--arcgis-slider-internal-label-input-height) );--arcgis-slider-internal-content-end-min-height: calc( var(--arcgis-slider-internal-value-labels-placement-end) * var(--arcgis-slider-internal-label-input-height) );padding-inline:var(--arcgis-slider-internal-handle-offset);grid-template:"content-start content-start content-start" "track-container track-container track-container" "content-end content-end content-end" "content-end content-end content-end" "content-end content-end content-end";grid-template-columns:auto;grid-template-rows:minmax(var(--arcgis-slider-internal-content-start-min-height),auto) var(--arcgis-slider-internal-track-size) var(--arcgis-slider-internal-handle-offset) calc(var(--arcgis-slider-internal-range-labels-placement-end) * var(--arcgis-slider-internal-label-input-height)) minmax(var(--arcgis-slider-internal-content-end-min-height),auto);column-gap:var(--arcgis-slider-internal-handle-offset)}.track{flex:1;height:var(--arcgis-slider-internal-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:calc(var(--arcgis-slider-internal-label-input-margin) + var(--arcgis-slider-internal-range-labels-placement-end) * (var(--arcgis-slider-internal-label-input-height)))}}.min,.max{--arcgis-slider-internal-range-translation: calc(var(--arcgis-slider-internal-handle-offset) + .5rem + 1px);grid-area:unset;grid-row:-3}&:host(:not([mirrored])){.min{grid-column:1;transform:translate(calc(var(--arcgis-slider-internal-range-translation) * -1))}.max{grid-column:3;transform:translate(var(--arcgis-slider-internal-range-translation))}}&:host([mirrored]){.min{grid-column:3;transform:translate(var(--arcgis-slider-internal-range-translation))}.max{grid-column:1;transform:translate(calc(var(--arcgis-slider-internal-range-translation) * -1))}}}`,Ce=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,k=(a,e,t,r)=>{for(var i=r>1?void 0:r?$e(e,t):e,n=a.length-1,o;n>=0;n--)(o=a[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Ce(e,t,i),i};function Ie(){return{min:0,max:100,values:[]}}var x=class extends xe{constructor(a={}){super({...Ie(),properties:a}),this._entries=new Map,this.precision=4,this.ready=!1}startup(){let{precision:a}=this,{min:e,max:t,values:r}=this;t=_(t,a),e=_(e,a),r=r?.map(n=>M(_(n,a),e,t)),this._set("min",e),this._set("max",t),this._set("values",r);let i=new Map(r?.map(n=>[V(),n]));this._entries=i,H(()=>this.min,n=>{let o=this.values;n!=null&&o?.length&&o.some(s=>s<n)&&(this._entries.forEach((s,l)=>{s<n&&this._entries.set(l,n)}),this._updatesValues())},{sync:!0}),H(()=>this.max,n=>{let o=this.values;n!=null&&o?.length&&o.some(s=>s>n)&&(this._entries.forEach((s,l)=>{s>n&&this._entries.set(l,n)}),this._updatesValues())},{sync:!0}),H(()=>this.precision,n=>{let{min:o,max:s,values:l}=this;this._set("min",_(o,n)),this._set("max",_(s,n)),l?.length&&(this._entries.forEach((d,c)=>{this._entries.set(c,_(d,n))}),this._updatesValues())},{sync:!0}),this._set("ready",!0)}get entries(){return this._entries}set max(a){if(!this.ready){this._set("max",a);return}let e=this._get("max"),t=_(a,this.precision);e!==t&&this._set("max",t)}set min(a){if(!this.ready){this._set("min",a);return}let e=this._get("min"),t=_(a,this.precision);e!==t&&this._set("min",t)}set values(a){if(!this.ready){this._set("values",a);return}let e=this._get("values");if(a=a?.map(r=>M(_(r,this.precision),this.min,this.max)).sort((r,i)=>r-i),e&&a&&e.length===a.length&&e.every((r,i)=>r===a[i]))return;let t=new Map(a?.map(r=>[V(),r]));this._entries=t,this._set("values",a)}getValue(a){return this._entries.get(a)}setValue(a,e){if(this.values==null)return!1;let{min:t,max:r}=this,i=this._entries.get(a),n=M(_(e,this.precision),t,r);return i===n?!1:(this._entries.set(a,n),this._updatesValues(),!0)}setValues(a){if(this.values==null)return!1;let e=!1,{min:t,max:r}=this;for(let[i,n]of a){let o=this._entries.get(i),s=M(_(n,this.precision),t,r);o!==s&&(e=!0,this._entries.set(i,s))}return e?(this._updatesValues(),!0):!1}_updatesValues(){let a=Array.from(this._entries.values()).sort((e,t)=>e-t);this._set("values",a)}};k([D()],x.prototype,"_entries",2);k([D({readOnly:!0})],x.prototype,"entries",1);k([D()],x.prototype,"max",1);k([D()],x.prototype,"min",1);k([D({cast:a=>M(a,0,20)})],x.prototype,"precision",2);k([D({readOnly:!0})],x.prototype,"ready",2);k([D()],x.prototype,"values",1);x=k([ye("esri.widgets.Slider.SliderData")],x);function M(a,e,t){return Math.min(Math.max(a,e),t)}function _(a,e){return Number.parseFloat(a.toFixed(e))}var N=class{constructor(e){this.steps=e,this.minIndex=0,this.maxIndex=this.steps.length-1}indexToValue(e){return this.steps[P(e,this.minIndex,this.maxIndex)]}valueToIndex(e){let t=this.steps.indexOf(e);return t!==-1?t:this.steps.reduce((r,i,n,o)=>Math.abs(i-e)<Math.abs(o[r]-e)?n:r)}},B=class{constructor(e,t,r){this.min=e,this.max=t,this.stepSize=r,this.minIndex=0,this.maxIndex=Math.round((this.max-this.min)/this.stepSize)}indexToValue(e){return this.min+P(e,this.minIndex,this.maxIndex)*this.stepSize}valueToIndex(e){return e=P(e,this.min,this.max),Math.round((e-this.min)/this.stepSize)}};function Me(a){if(a.steps==null)return null;let e=a.steps;return Array.isArray(e)?e.length===0?null:new N(e):new B(a.min,a.max,e)}function Te(a,e,t){if(a==null){let s=new Map;for(let[l,d]of e.entries())s.set(l,d+t);return s}let r=e.size,i=Array.from(e.entries()).map(([s,l])=>{let d=l+t,c=[];for(let h=a.minIndex;h<=a.maxIndex;h++){let u=a.indexToValue(h),f=Math.abs(u-d),g=!1;for(let v=0;v<c.length;v++)if(f<c[v].dist){c.splice(v,0,{idx:h,value:u,dist:f}),g=!0;break}!g&&c.length<r&&c.push({idx:h,value:u,dist:f}),c.length>r&&(c.length=r)}return{uuid:s,stepDistances:c}}),n=new Set,o=new Map;i.sort((s,l)=>s.stepDistances[0].dist-l.stepDistances[0].dist);for(let s of i){let l=s.stepDistances.find(d=>!n.has(d.idx));l?(n.add(l.idx),o.set(s.uuid,l.value)):o.set(s.uuid,e.get(s.uuid))}return o}function le(a,e,t,r,i){let n=e.get(t)??0;if(!a)return n+r;let o=n+r,s=new Set;if(!i)for(let[c,h]of e.entries())c!==t&&s.add(a.valueToIndex(h));let l=null,d=1/0;for(let c=a.minIndex;c<=a.maxIndex;c++){if(s.has(c))continue;let h=a.indexToValue(c),u=Math.abs(h-o);u<d&&(d=u,l=c)}return l==null?n:a.indexToValue(l)}function Fe(a,e,t,r=1){let i=he(r),n=e,o=!1;for(let s=0;s<i;s++){let l=ze(a,n,t);if(o||=l.changed,n=l.entries,!l.changed)break}return{changed:o,entries:n}}function Se(a,e,t,r,i=1){let n=he(i);if(n===1)return U(a,e,t,r);let o=new Map(e),s=o.get(t);for(let l=0;l<n;l++){let d=U(a,o,t,r);if(d===s)break;s=d,o.set(t,s)}return s}function he(a){let e=Number.isFinite(a)?Math.floor(a):1;return Math.max(1,e)}function ze(a,e,t){let r=new Map,i=t>0?Ve:ue,n=Array.from(e).sort((l,d)=>i(l[1],d[1])),o=!1,s=!0;for(let[l,d]of n)if(r.set(l,d),s){let c=U(a,r,l,t);d===c&&(s=!1),o||=s,r.set(l,c)}return{changed:o,entries:r}}function U(a,e,t,r){let{allowValuesOverlap:i,stepsProvider:n,resolution:o,min:s,max:l}=a,d=e.get(t);if(r=r>0?1:-1,!n){let m=P(d+r*o,s,l);if(i)return m;let y=new Set;for(let[T,ge]of e)T!==t&&y.add(ge);for(;y.has(m)&&m<=l&&m>=s;)m=P(m+r*o,s,l);return y.has(m)||m>l||m<s?d:m}let c=n.valueToIndex(d);if(c===-1)return d;if(i){let m=P(c+r,n.minIndex,n.maxIndex);return n.indexToValue(m)}let h=new Set;for(let[m,y]of e)m!==t&&h.add(n.valueToIndex(y));let u=c,f=!1,g=n.minIndex,v=n.maxIndex,E=0;for(;E<Math.abs(v-g)&&(u+=r,!(u<g||u>v));){if(!h.has(u)){f=!0;break}E++}return f?n.indexToValue(u):d}function Le(a,e,t,r){let{allowValuesOverlap:i,stepsProvider:n,resolution:o,min:s,max:l}=a,d=e.get(t);if(r=r>0?1:-1,!n){let f=new Set(Array.from(e).filter(([v])=>v!==t).map(([,v])=>v)),g=r>0?l:s;if(i)return g;for(;f.has(g);)if(g-=r*o,r>0&&g>l||r<0&&g<s){g=d;break}return g}if(i)return r>0?n.indexToValue(n.maxIndex):n.indexToValue(n.minIndex);let c=n.valueToIndex(d);if(c===-1)return d;let h=new Set(Array.from(e).filter(([f])=>f!==t).map(([,f])=>n.valueToIndex(f))),u=r>0?n.maxIndex:n.minIndex;for(;h.has(u);)if(u-=r,r>0&&u>l||r<0&&u<s){u=c;break}return n.indexToValue(u)}function Re(a,e,t){let{stepsProvider:r,min:i,max:n}=a,o=new Map,s=Array.from(e).sort((d,c)=>ue(d[1],c[1]));if(r){let d=0;if(t>0){let c=s[s.length-1],h=r.valueToIndex(c[1]);d=r.maxIndex-h}else{let c=s[0],h=r.valueToIndex(c[1]);d=r.minIndex-h}if(d===0)for(let[c,h]of s)o.set(c,h);for(let[c,h]of s){let u=r.indexToValue(r.valueToIndex(h)+d);o.set(c,u)}return o}let l=0;if(t>0){let d=s[s.length-1];l=n-d[1]}else{let d=s[0];l=i-d[1]}for(let[d,c]of s)o.set(d,c+l);return o}function ue(a,e){return a-e}function Ve(a,e){return e-a}function P(a,e,t){return Math.max(e,Math.min(t,a))}var Oe=ne(x),j=class extends G{constructor(){super(...arguments),this._popoverElement=O(),this._trackElement=O(),this.messages=te({}),this._onPointerMoveDragUpdate=e=>{this._updateDrag(this._mapEventToRange(e))},this._onPointerUpDragEnd=e=>{L(e)&&this._endDrag()},this._onPointerCancelDragEnd=()=>{this._endDrag()},this._formatLabel=(e,t,r)=>{let i=re(this.messages._lang,t),n=this.labelFormatter;return n?n(r,e,s=>i.format(s))??i.format(r):i.format(r)},this._numberFormatOptions={},this._createFormatter=(e,t)=>this._formatLabel.bind(this,e,t),this._minFormatter=this._createFormatter("min",this._numberFormatOptions),this._maxFormatter=this._createFormatter("max",this._numberFormatOptions),this._valueFormatter=this._createFormatter("value",this._numberFormatOptions),this._resizeObserver=new ResizeObserver(()=>{this._layoutLabelInputs()}),this._labelInputsUpdateComplete=null,this._dragInfo=null,this._hasPopoverContent=!1,this._hasContentStart=!1,this._hasContentEnd=!1,this._sliderData=Oe(this),this.allowValuesOverlap=!1,this.autoDestroyDisabled=!1,this.disabled=!1,this.fillPlacement="start",this.layout="horizontal",this.max=this._sliderData.max,this.min=this._sliderData.min,this.mirrored=!1,this.popoverLabel="",this.popoverPlacement="start",this.precision=this._sliderData.precision,this.rangeLabelsEditingEnabled=!1,this.rangeLabelsPlacement="center",this.segmentsDraggingDisabled=!1,this.showRangeLabels=!1,this.valueLabelsDisplay="hidden",this.valueLabelsPlacement="start",this.valueLabelsEditingEnabled=!1,this.keyboardLargeStep=10,this.values=this._sliderData.values,this.arcgisActiveValueChange=C({cancelable:!1}),this.arcgisChange=C({cancelable:!1}),this.arcgisInput=C({cancelable:!1}),this.arcgisRangeChange=C({cancelable:!1})}static{this.properties={_dragInfo:16,_hasPopoverContent:16,_hasContentStart:16,_hasContentEnd:16,_activePart:16,_sliderData:16,activeValue:32,allowValuesOverlap:5,autoDestroyDisabled:5,disabled:7,fullRangeMax:11,fullRangeMin:11,fillPlacement:1,labelFormatter:0,layout:3,max:11,min:11,mirrored:7,popoverLabel:1,popoverPlacement:3,precision:11,rangeLabelsEditingEnabled:5,rangeLabelsPlacement:3,segmentsDraggingDisabled:5,showRangeLabels:7,steps:[9,{converter:{fromAttribute(e){if(e.includes(","))return e.split(",").filter(r=>r.trim()!=="").map(parseFloat).filter(r=>Number.isFinite(r));let t=parseFloat(e);return Number.isFinite(t)?t:void 0}}}],valueLabelsDisplay:3,valueLabelsPlacement:3,valueLabelsEditingEnabled:5,keyboardLargeStep:9,values:[1,{converter:{fromAttribute(e){return e.includes(",")?e.split(",").filter(t=>t.trim()!=="").map(parseFloat).filter(t=>Number.isFinite(t)):[parseFloat(e)].filter(t=>Number.isFinite(t))}}}],messageOverrides:0}}static{this.styles=Pe}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}get _fullMin(){return this.fullRangeMin??this.min}get _fullMax(){return this.fullRangeMax??this.max}get _fullRange(){return this._fullMax-this._fullMin}get isHorizontal(){return this.layout==="horizontal"}get _trackWidthOrHeight(){let e=this._trackElement.value?.getBoundingClientRect();return e?this.isHorizontal?e.width:e.height:0}get _disabledOrInvalid(){return this.disabled||this.values.length===0||this._invalid}get _invalid(){let e=this.fullRangeMin==null||this.fullRangeMax==null||this.fullRangeMin<this.fullRangeMax,t=this.fullRangeMin==null||this.fullRangeMin<=this.min,r=this.fullRangeMax==null||this.fullRangeMax>=this.max;return this.min>=this.max||!e||!t||!r}get resolution(){let e=(this._sliderData.max-this._sliderData.min)/this._trackWidthOrHeight;return Math.max(e,1/Math.pow(10,this.precision))}get activeValue(){if(this._activePart)return this._activePart==="range"?"all":this._sliderData.getValue(this._activePart)}async destroy(){await this.manager.destroy()}load(){this._sliderData.startup()}willUpdate(e){if((e.has("steps")||e.has("min")||e.has("max"))&&(this._stepsProvider=Me(this)),e.has("messages")||e.has("min")||e.has("max")||e.has("precision")||e.has("labelFormatter")){let t=this.max!=null&&this.min!=null&&this.max-this.min>10?2:this.precision;this._numberFormatOptions={maximumFractionDigits:t},this._minFormatter=this._createFormatter("min",this._numberFormatOptions),this._maxFormatter=this._createFormatter("max",this._numberFormatOptions),this._valueFormatter=this._createFormatter("value",this._numberFormatOptions)}}updated(e){this._layoutLabelInputs();let t=this._popoverElement.value;t&&(e.has("values")||e.has("min")||e.has("max"))&&t.reposition()}loaded(){this._resizeObserver.observe(this.el)}disconnectedCallback(){super.disconnectedCallback(),this._removeDragListeners()}_makeResizeRef(){let e=null;return t=>{t?(e=t,this._resizeObserver.observe(t)):e&&(this._resizeObserver.unobserve(e),e=null)}}async _layoutLabelInputs(){if(this.layout!=="horizontal"||!this._trackElement.value||this.valueLabelsDisplay==="hidden")return;let e=this.renderRoot.querySelectorAll("arcgis-label-input"),t=this.componentOnReady().then(()=>Promise.all(Array.from(e,n=>n.updateComplete)));if(this._labelInputsUpdateComplete=t,await t,t!==this._labelInputsUpdateComplete)return;this._labelInputsUpdateComplete=null;let r=this._trackElement.value;if(!r)return;let i=r.getBoundingClientRect();for(let n of this._sliderData.entries.keys()){let o=this._activePart==="range"||this._activePart===n;if(this.valueLabelsDisplay==="always"||o){let s=Be(this,n),l=ce(this,n);if(!s||!l)continue;let d=s.getBoundingClientRect(),c=l.getBoundingClientRect(),h=l.getLabelBoundingClientRect(),u=d.width/2,f=Math.round(d.left+u),g=Math.round(h.width/2),v=c.width/2,E=i.left-u,m=i.right+u,y=f-g,T=f+g;y<E?v+=y-E:T>m&&(v+=T-m),l.style.transform=`translateX(${-Math.round(v)}px)`}}}_onTrackFocus(){this._setActivePart("range")}_onTrackBlur(){this._setActivePart(null)}_onTrackRangePointerDown(e){this._disabledOrInvalid||!L(e)||(e.preventDefault(),this._startDrag("range",this._mapEventToRange(e)))}async _onPointerDown(e){if(this._disabledOrInvalid||!L(e))return;let t=this.renderRoot.querySelector("arcgis-label-input[editing]");if(e.target===t)return;if(t){t.blur(),this._focusEntry(I(t));return}if(Ae(e.target)||this.values?.length>1)return;let r=this._mapEventToRange(e),[i,n]=this._sliderData.entries.entries().next().value,o=r*this._fullRange+this._fullMin-n,s=R(this._fullMin,this._fullMax,n)/100;this._startDrag(i,s);let l=le(this._stepsProvider,this._sliderData.entries,i,o,this.allowValuesOverlap);this._setValue(i,l),this._focusEntry(i)}_onThumbPointerDown(e){let t=I(e.currentTarget);if(!L(e)||this._disabledOrInvalid||!t)return;let r=ce(this,t);e.target===r&&r?.editing||(e.stopPropagation(),e.preventDefault(),this._startDrag(t,this._mapEventToRange(e)))}_endDrag(){if(this._disabledOrInvalid)return;this._removeDragListeners();let e=!1;if(this._dragInfo){let{entries:t}=this._dragInfo;for(let[r,i]of t)if(this._sliderData.getValue(r)!==i){e=!0;break}}this._dragInfo=null,e&&this.arcgisChange.emit()}_startDrag(e,t){if(this._disabledOrInvalid)return;let{min:r,max:i,values:n}=this,o=r,s=i;if(this._setActivePart(e),e==="range"){if(this.segmentsDraggingDisabled)return;o=r-n[0],s=i-n[n.length-1]}this._dragInfo={position:t,entries:new Map(this._sliderData.entries.entries()),minDiff:o,maxDiff:s},this._addDragListeners()}_updateDrag(e){if(!this._dragInfo||!this._activePart)return;let{_activePart:t,_dragInfo:{position:r,entries:i,minDiff:n,maxDiff:o}}=this;if(r===e)return;let s=(e-r)*this._fullRange;if(t==="range"){s=Math.min(o,Math.max(n,s));let l=Te(this._stepsProvider,i,s);this._setValues(l)}else{let l=le(this._stepsProvider,i,t,s,this.allowValuesOverlap);this._setValue(t,l)}}_focusEntry(e){e&&Ne(this,e)?.focus()}_addDragListeners(){document.addEventListener("pointerup",this._onPointerUpDragEnd),document.addEventListener("pointermove",this._onPointerMoveDragUpdate),document.addEventListener("pointercancel",this._onPointerCancelDragEnd)}_removeDragListeners(){document.removeEventListener("pointerup",this._onPointerUpDragEnd),document.removeEventListener("pointermove",this._onPointerMoveDragUpdate),document.removeEventListener("pointercancel",this._onPointerCancelDragEnd)}_setValues(e){this._sliderData.setValues(e)&&(this._dragInfo||this.arcgisChange.emit(),this.arcgisInput.emit())}_setValue(e,t){this._sliderData.setValue(e,t)&&(this._dragInfo||this.arcgisChange.emit(),this.arcgisInput.emit())}_onThumbFocus(e){let t=I(e.currentTarget);this._setActivePart(t)}_onThumbBlur(){this._setActivePart(null)}_onRangeInputChange(e){let t=e.currentTarget,r=t.value,i=t.dataset.type,n=!1;switch(e.stopPropagation(),i){case"min":{r<this.max?(this.min=r,n=!0):t.value=this.min;break}case"max":{r>this.min?(this.max=r,n=!0):t.value=this.max;break}}n&&this.arcgisRangeChange.emit()}_onValueInputChange(e){let t=e.currentTarget,r=I(t),i=t.value;r&&(e.stopPropagation(),this._setValue(r,i),t.value=this._sliderData.getValue(r))}_mapEventToRange(e){let t=this._trackElement.value?.getBoundingClientRect();if(!t)return 0;let r=this.isHorizontal?(e.clientX-t.left)/t.width:1-(e.clientY-t.top)/t.height;return this.mirrored?1-r:r}_getPositionStyleForElement(e){let t=R(this._fullMin,this._fullMax,e);return{[this.isHorizontal?this.mirrored?"right":"left":this.mirrored?"top":"bottom"]:`${t}%`}}_popoverSlotChange(e){this._hasPopoverContent=z(e)}_onContentStartSlotChange(e){this._hasContentStart=z(e)}_onContentEndSlotChange(e){this._hasContentEnd=z(e)}_onThumbKeyDown(e){let t=I(e.currentTarget);if(!t)return;let r=e.currentTarget.querySelector("arcgis-label-input");if(!r||r.editing)return;if(e.key===p.confirmEdit){r.edit();return}let i=se(e,this.keyboardLargeStep,this.mirrored);if(i){e.preventDefault();let n=Se(this._getStepsConfiguration(),this._sliderData.entries,t,i.direction,i.count);this._setValue(t,n);return}if(oe(e.key)){e.preventDefault();let n=Le(this._getStepsConfiguration(),this._sliderData.entries,t,this._getDirectionForHomeEndKey(e.key));this._setValue(t,n)}}_onTrackRangeKeyDown(e){if(this._disabledOrInvalid)return;let t=se(e,this.keyboardLargeStep,this.mirrored);if(t){e.preventDefault();let{entries:r}=Fe(this._getStepsConfiguration(),this._sliderData.entries,t.direction,t.count);this._setValues(r);return}if(oe(e.key)){e.preventDefault();let r=Re(this._getStepsConfiguration(),this._sliderData.entries,this._getDirectionForHomeEndKey(e.key));this._setValues(r)}}_getStepsConfiguration(){return{allowValuesOverlap:this.allowValuesOverlap,stepsProvider:this._stepsProvider,resolution:this.resolution,min:this.min,max:this.max}}_getDirectionForHomeEndKey(e){return this.isHorizontal&&this.mirrored||this.layout==="vertical"?e===p.jumpToEnd?-1:1:e===p.jumpToStart?-1:1}_setActivePart(e){this._activePart!==e&&(this._activePart=e,this.arcgisActiveValueChange.emit())}render(){return b`<div class=${$({content:!0,disabled:this._disabledOrInvalid})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`}_renderPopover(){let{_activePart:e,layout:t,popoverPlacement:r,valueLabelsPlacement:i,valueLabelsDisplay:n,popoverLabel:o}=this,s=e?He(e)?e:"track-range":"",l=this._hasPopoverContent&&!!s,d=t==="horizontal"?r==="start"?"top":"bottom":r==="start"?"left":"right",c=14;return n!=="hidden"&&r===i&&(c+=24),b`<calcite-popover flip-disabled focus-trap-disabled .label=${o} .open=${l} .offsetDistance=${c} .placement=${d} pointer-disabled .referenceElement=${s} scale=s trigger-disabled ${F(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`}_renderContentStart(){return b`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`}_renderContentEnd(){return b`<div class="content-end" .hidden=${!this._hasContentEnd}><slot name=content-end @slotchange=${this._onContentEndSlotChange}></slot></div>`}_renderTrackRange(){return b`<div class="track-container">${this._renderTrack()}${this._renderThumbs()}</div>`}_renderTrack(){return b`<div class="track" ${F(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`}_renderTrackBackground(){let{max:e,min:t,fillPlacement:r,values:i}=this,n=i.length>1,o=this._fullMin,s=this._fullMax,l=[];return this._invalid?b`<div class="segment track-bounds" style=${S({left:"0%",right:"0%",top:"0%",bottom:"0%"})}></div>`:(o<t&&(l.push(this._renderSegment(o,t,[this.mirrored?"track-effective-end":"track-effective-start",!n&&r==="start"?"track-fill":null])),o=t),s>e&&(l.push(this._renderSegment(e,s,[this.mirrored?"track-effective-start":"track-effective-end",!n&&r==="end"?"track-fill":null])),s=e),l.push(this._renderSegment(o,s,["track-bounds"])),l)}_renderFillSegment(){let{values:e,fillPlacement:t,min:r,max:i}=this;if(!e?.length||this._invalid)return;let n=[...e].sort((s,l)=>s-l);if(n.length===1)switch(t){case"start":if(r<n[0])return this._renderSegment(r,n[0],["track-range"]);break;case"end":if(i>n[0])return this._renderSegment(n[0],i,["track-range"]);break}let o=this.segmentsDraggingDisabled;return this._renderSegment(n[0],n[n.length-1],["track-range",o?null:"interactive",this._activePart==="range"?"active":null],{id:"track-range",onFocus:o?void 0:this._onTrackFocus,onBlur:o?void 0:this._onTrackBlur,onPointerDown:o?void 0:this._onTrackRangePointerDown,onKeyDown:o?void 0:this._onTrackRangeKeyDown})}_renderSegment(e,t,r,i){let{_fullMin:n,_fullMax:o,mirrored:s}=this,l=[R(n,o,de(e,n,o)),100-R(n,o,de(t,n,o))];s&&l.reverse();let d=this.isHorizontal?{left:`${l[0]}%`,right:`${l[1]}%`}:{top:`${l[1]}%`,bottom:`${l[0]}%`},c=X("segment",...r);return b`<div id=${i?.id??w} class=${$(c)} style=${S(d)} .tabIndex=${i?.onPointerDown?0:-1} @focus=${i?.onFocus} @blur=${i?.onBlur} @pointerdown=${i?.onPointerDown} @keydown=${i?.onKeyDown}></div>`}_renderThumbs(){let{_sliderData:e}=this,t=Array.from(e.entries).filter(([,r])=>r>=this._fullMin&&r<=this._fullMax);return ie(t,([r,i])=>this._renderThumb(r,i))}_renderThumb(e,t){let{valueLabelsDisplay:r}=this,i=this._disabledOrInvalid,n=this._activePart===e||this._activePart==="range",o=this._activePart==="range"||this._activePart===e,s=r==="always"||r==="auto"&&o,l=this.isHorizontal,d=l?"horizontal":"vertical",c=`label-${e}`,h=l?"center":this.valueLabelsPlacement==="start"?"end":"start";return Q(e,b`<div id=${e??w} .ariaLabel=${this.messages.sliderValue} aria-labelledby=${(r?c:void 0)??w} .ariaOrientation=${d} .ariaValueMin=${this._minFormatter(this.min)} .ariaValueMax=${this._maxFormatter(this.max)} .ariaValueNow=${t} .ariaValueText=${this._valueFormatter(t)} class=${$({thumb:!0,active:n})} data-entry=${e??w} @pointerdown=${this._onThumbPointerDown} @focus=${this._onThumbFocus} @blur=${this._onThumbBlur} @keydown=${this._onThumbKeyDown} role=slider style=${S({...this._getPositionStyleForElement(t),"z-index":this._activePart===e?1:0})} .tabIndex=${i?-1:0}><span class="handle"></span><arcgis-label-input .alignment=${h} class="label" .hidden=${!s} id=${c??w} .labelFormatter=${this._valueFormatter} @focus=${i?void 0:this._onThumbFocus} @blur=${i?void 0:this._onThumbBlur} @arcgisChange=${this._onValueInputChange} .readOnly=${!this.valueLabelsEditingEnabled} tabindex=-1 .value=${t} ${F(this._makeResizeRef())}></arcgis-label-input></div>`)}_renderRangeLabel(e){let t="center";return this.isHorizontal&&(t=e==="min"?"end":"start",this.rangeLabelsPlacement==="end"&&(t=t==="end"?"start":"end"),this.mirrored&&(t=t==="end"?"start":"end")),b`<arcgis-label-input .alignment=${t} class=${$(e)} data-type=${e??w} .hidden=${!this.showRangeLabels} .labelFormatter=${this[`_${e}Formatter`]} @arcgisChange=${this._onRangeInputChange} .readOnly=${!this.rangeLabelsEditingEnabled} .value=${this[e]}></arcgis-label-input>`}};function Ae(a){return"dataset"in a&&a.tagName==="ARCGIS-LABEL-INPUT"&&(a.dataset.type==="min"||a.dataset.type==="max")}function I(a){let e=J(a,"[data-entry]");return e&&"dataset"in e?e.dataset.entry:null}function He(a){return typeof a!=null&&a!=="range"}function Ne(a,e){return e?a.renderRoot.querySelector(`div[data-entry="${e}"]`):null}function Be(a,e){return e?a.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`):null}function ce(a,e){return e?a.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`):null}function L(a){return a.isPrimary&&a.button===0}var Ue=5;function R(a,e,t){let r=e-a,i=(t-a)/r*100;return Number.parseFloat(i.toFixed(Ue))}function de(a,e,t){return Math.max(e,Math.min(t,a))}Z("arcgis-slider",j);return j},"core/reactiveUtils","applications/Components/reactiveUtils","core/accessorSupport/decorators","core/Accessor","core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as g}from"./CSDKXC4T.js";import{a as k}from"./EKKJN7WZ.js";import{a as C}from"./23DDMSOB.js";import{a as B}from"./7Y42J3JI.js";import{b as x}from"./7PB2GGQH.js";import"./7CI55VCH.js";import{A as h,B as w,C as $,D as m,E as c,F as v,H as S,g as y,i as s,m as p,n as F,q as n,z as r}from"./UTXWKXMT.js";var o=new Map;o.set("oid","key");o.set("guid","key");o.set("global-id","key");o.set("blob","binary");o.set("integer","integer");o.set("small-integer","integer");o.set("big-integer","integer");o.set("single","number");o.set("double","number");o.set("long","number");o.set("number","number");o.set("date","date-time");o.set("date-only","calendar");o.set("time-only","clock");o.set("timestamp-offset","time-zone");o.set("string","string");var L=({fieldType:u})=>s`<calcite-icon scale=s .icon=${o.get(u)}></calcite-icon>`,E=y`.panel{min-height:250px}.content{max-height:50vh}.field-icons{display:flex;align-items:center;padding:0 var(--calcite-space-sm)}.selection-button-div{padding:var(--calcite-space-2xs) var(--calcite-space-sm-plus)}.no-match-text{padding:var(--calcite-space-md)}.footer{width:100%}.add-cancel-buttons{display:flex;align-content:space-between}`,f=class extends w{constructor(){super(...arguments),this._messages=x({blocking:!0}),this.popoverNode=r(),this.listNode=r(),this.flowElement=r(),this.panelElement=r(),this.dropdownNode=r(),this.fieldInfoFlowItemEl=r(),this.allLists=[],this.filterText="",this.panelCutOffHeight=0,this._propWatcherTask=new C(this,{task:async([e])=>{if(!this.listOnly&&!k(e?.refElement))throw p("error",this,F("popoverProps")),new Error;this._propWatcherTask.autoRun=!1},args:()=>[this.popoverProps]}),this.fields=[],this.selectedFields=[],this.listOnly=!1,this.showFieldInfo=!1,this.showFieldTypeIcon=!1,this.showFieldName=!1,this.showDescription=!1,this.showSelectionAll=!1,this.showCancel=!0,this.hideCancel=!1,this.showSort=!0,this.hideSort=!1,this.showFilterLength=10,this.multiple=!1,this.sortBy="default",this.groupFieldsAndExpressions=!1,this.arcgisChange=n(),this.arcgisClose=n(),this.arcgisFieldPickListChange=n(),this.arcgisFieldPickListDismissed=n(),this.arcgisFieldPickListSortByChange=n(),this.arcgisSortByChange=n(),this.arcgisEditField=n(),this.arcgisDeleteField=n()}static{this.properties={lastSortBy:16,filterFields:16,mapView:0,view:0,layer:0,fields:0,selectedFields:0,listOnly:5,popoverProps:0,showFieldInfo:5,showFieldTypeIcon:5,showFieldName:5,showDescription:5,showSelectionAll:5,showCancel:5,hideCancel:5,showSort:5,hideSort:5,showFilterLength:9,multiple:5,heading:1,okBtnText:1,filterPlaceholderText:1,filterNoResultsText:1,sortBy:1,groupFieldsAndExpressions:5,fieldsGroupHeading:1,expressionsGroupHeading:1,customExpressionCheck:0}}static{this.styles=E}async reposition(){await this.popoverNode.value?.reposition()}async setFocus(){setTimeout(()=>requestAnimationFrame(()=>{this.listOnly?this.listNode.value?.setFocus():this.panelElement.value?.setFocus()}),1)}async setDisabled(e){this.panelElement.value&&(this.panelElement.value.disabled=e)}load(){!this.view&&this.mapView&&(this.view=this.mapView),!this.showCancel&&!this.hideCancel&&(this.hideCancel=!0),!this.showSort&&!this.hideSort&&(this.hideSort=!0),this.listOnly&&this.showFieldInfo&&(this.showFieldInfo=!1,p("info",this,"showFieldInfo is not supported if listOnly is true.")),!this.multiple&&this.selectedFields.length>1&&(this.selectedFields=[this.selectedFields[0]]),this.lastSortBy=this.sortBy??this.lastSortBy,this.updateGroupedLists()}willUpdate(e){(e.has("fields")||e.has("lastSortBy")||e.has("customExpressionCheck"))&&this.updateGroupedLists()}loaded(){this.setUpObserver(),this.listOnly?this.listNode.value?.setFocus():(this.flowElement.value?.setFocus(),this.checkMaxHeight())}disconnectedCallback(){super.disconnectedCallback(),this.observer?.disconnect()}setUpObserver(){this.observer=new MutationObserver(e=>{for(let t of e)t.attributeName==="style"&&this.popoverNode.value&&this.dropdownNode.value&&this.popoverNode.value.style.visibility==="hidden"&&(this.dropdownNode.value.open=!1)})}checkMaxHeight(){setTimeout(()=>this.checkPanelMaxHeight(),200),setTimeout(()=>this.checkPanelMaxHeight(),500),setTimeout(()=>this.checkPanelMaxHeight(),1e3),setTimeout(()=>this.checkPanelMaxHeight(),1500)}checkPanelMaxHeight(){if(this.panelCutOffHeight===0){let e=this.panelElement.value?.getBoundingClientRect();if(e&&e.bottom>window.innerHeight){this.panelCutOffHeight=e.height-(e.bottom-window.innerHeight)-5;let t=this.listNode.value?.getBoundingClientRect();t&&(this.listNode.value.style.maxHeight=`${t.height-(e.bottom-window.innerHeight)-5}px`)}}}getSortedList(e){let t=[...e],i=t.filter(l=>l.type==="none");return t=t.filter(l=>l.type!=="none"),this.lastSortBy==="display"?t.sort((l,a)=>l.alias.localeCompare(a.alias)):this.lastSortBy==="field"?t.sort((l,a)=>l.name.localeCompare(a.name)):this.lastSortBy==="type"&&t.sort((l,a)=>l.type.localeCompare(a.type)),t=t.concat(i),t}isExpression(e){return this.customExpressionCheck?this.customExpressionCheck(e):e.name.includes(g.expression)}canDeselectAll(){let e=this.getAllFields();return this.filterFields?.length?this.filterContainsAll():this.selectedFields.length===e.length}filterContainsAll(){return!!this.filterFields?.every(e=>this.selectedFields.some(t=>t===e))}showFieldInfoCheck(e){let{layer:t}=this;return this.showFieldInfo?!(!t||this.isExpression(e)||e.name.includes(g.relationship)||e.type==="none"):!1}updateGroupedLists(){if(this.fields)if(this.allLists=[],this.usingCustomGroups())for(let e of this.fields)this.allLists.push({title:e.title,fields:[...this.getSortedList(e.fields)]});else this.allLists=this.groupFieldsAndExpressions?[{title:this.expressionsGroupHeading,fields:[...this.getSortedList(this.fields)].filter(e=>this.isExpression(e))},{title:this.fieldsGroupHeading,fields:[...this.getSortedList(this.fields)].filter(e=>!this.isExpression(e))}]:[{title:void 0,fields:[...this.getSortedList(this.fields)]}]}addFieldInfoFlowItem(e,t){let i=this.flowElement.value,l=v(s`<calcite-flow-item selected .heading=${e.alias??e.name} .description=${e.name} class="panel" style=${m(this.panelCutOffHeight>0?`max-height: ${this.panelCutOffHeight}px`:"max-height: 50vh")} @calciteFlowItemBack=${a=>{a.currentTarget.remove(),this.fieldInfoFlowItemEl.value.selected=!1,this.panelElement.value.selected=!0,setTimeout(()=>{t.setFocus()},300)}} ${h(this.fieldInfoFlowItemEl)}><arcgis-field-info lang=${this._messages._lang??c} .fieldName=${e.name} .layer=${this.layer} .view=${this.view} class="content"></arcgis-field-info></calcite-flow-item>`);i.appendChild(l),this.panelElement.value.selected=!1,this.fieldInfoFlowItemEl?.value.setFocus()}usingCustomGroups(){return!!this.fields.length&&"fields"in this.fields[0]}getAllFields(){return this.allLists.map(e=>e.fields).flat()}render(){return this._propWatcherTask.render({complete:()=>{if(this.listOnly)return this.renderList();let e=this.heading||(this.multiple?this._messages.headerSelect:this._messages.header),t=this.popoverProps;return this.el.classList.add("js-app-flyout"),s`<calcite-popover .placement=${t.placement??"leading-start"} open pointer-disabled .referenceElement=${t.refElement} .offsetDistance=${t.offsetDistance??-Math.round(t.refElement.getBoundingClientRect().width)} .offsetSkidding=${t.offsetSkidding??0} .overlayPositioning=${t.overlayPositioning} trigger-disabled .autoClose=${t.autoClose} .label=${this.heading??(this.multiple?this._messages.headerSelect:this._messages.header)??""} @calcitePopoverClose=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}} ${h(this.popoverNode)}><calcite-flow style=${m({width:`${t.popoverWidth??t.refElement.getBoundingClientRect().width}px`,...t.maxHeight&&{maxHeight:t.maxHeight}})} ${h(this.flowElement)}><calcite-flow-item class="panel" .heading=${e} closable @calciteFlowItemClose=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}} ${h(this.panelElement)}><slot slot=content-top name=content-top></slot>${this.renderList()}<slot slot=content-bottom name=content-bottom></slot>${(this.multiple||!this.hideCancel)&&s`<div slot=footer class="footer"><slot name=content-footer></slot>${this.multiple&&!this.hideCancel?s`<div class="add-cancel-buttons">${this.renderAddButton()}${this.renderCancelButton()}</div>`:s`${this.renderAddButton()}${this.renderCancelButton()}`}</div>`||""}</calcite-flow-item></calcite-flow></calcite-popover>`},error:()=>""})}renderList(){let e=this.heading||(this.multiple?this._messages.headerSelect:this._messages.header),t=this.getAllFields(),i=t.length>=this.showFilterLength;return s`${t.length?s`<calcite-list .label=${e} .selectionMode=${this.multiple?"multiple":"single"} class=${$(this.listOnly?"":"content")} .filterEnabled=${i} .filterPlaceholder=${this.filterPlaceholderText??this._messages.filter} @calciteListChange=${()=>{let l=this.listNode.value.selectedItems.map(d=>d.value),a=this.selectedFields.filter(d=>l.includes(d)),b=l.filter(d=>!this.selectedFields.includes(d));this.selectedFields=[...new Set([...a,...b])],this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields}),this.multiple||(this.arcgisClose.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields}))}} @calciteListFilter=${l=>{l.stopPropagation(),this.filterFields=this.listNode.value.filteredItems?.map(a=>a.value),this.filterText=this.listNode.value.filterText}} ${h(this.listNode)}>${this.renderSortButton()}<slot name=content-center></slot>${this.multiple&&this.showSelectionAll&&(!i||!this.filterText||this.filterFields?.length)?this.renderSelectionButton():null}${this.renderListItems()}</calcite-list>`:s`<slot name=no-fields></slot>`}${this.filterFields&&!this.filterFields.length&&this.listNode.value&&this.filterNoResultsText?.length!==0?s`<div class="no-match-text">${this.filterNoResultsText??this._messages.noMatches}</div>`:null}`}renderSortButton(){let e=this.getAllFields();if(!(e.length>=this.showFilterLength&&!this.hideSort))return"";let t=e.every(i=>!!i.type);return s`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed .disabled=${this.filterFields?this.filterFields.length<4:!1} @calciteDropdownOpen=${()=>{this.observer?.disconnect(),this.popoverNode.value&&this.observer?.observe(this.popoverNode.value,{attributes:!0})}} @calciteDropdownClose=${()=>this.observer?.disconnect()} ${h(this.dropdownNode)}><calcite-action slot=trigger .text=${this._messages.sort??""} title=${this._messages.sort??c}><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${this.lastSortBy==="default"} @click=${()=>{this.lastSortBy="default",this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy)}} @keydown=${i=>{i.stopPropagation(),(i.key===" "||i.key==="Enter")&&(this.lastSortBy="default",this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy))}}>${this._messages.default}</calcite-dropdown-item><calcite-dropdown-item .selected=${this.lastSortBy==="display"} @click=${()=>{this.lastSortBy="display",this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy)}} @keydown=${i=>{i.stopPropagation(),(i.key===" "||i.key==="Enter")&&(this.lastSortBy="display",this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy))}}>${this._messages.displayName}</calcite-dropdown-item>${t&&s`<calcite-dropdown-item .selected=${this.lastSortBy==="type"} @click=${()=>{this.lastSortBy="type",this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy)}} @keydown=${i=>{i.stopPropagation(),(i.key===" "||i.key==="Enter")&&(this.lastSortBy="type",this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy))}}>${this._messages.type}</calcite-dropdown-item>`||""}<calcite-dropdown-item .selected=${this.lastSortBy==="field"} @click=${()=>{this.lastSortBy="field",this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy)}} @keydown=${i=>{i.stopPropagation(),(i.key===" "||i.key==="Enter")&&(this.lastSortBy="field",this.arcgisSortByChange.emit(this.lastSortBy),this.arcgisFieldPickListSortByChange.emit(this.lastSortBy))}}>${this._messages.fieldName}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderSelectionButton(){return s`<div class="selection-button-div"><calcite-button appearance=transparent scale=s width=full @click=${()=>{if(this.canDeselectAll())this.selectedFields=this.filterFields?.length?this.selectedFields.filter(e=>!this.filterFields?.includes(e)):[];else if(this.filterFields?.length)this.selectedFields=[...new Set([...this.selectedFields,...this.filterFields])];else{let e=this.getAllFields();this.selectedFields=e.map(t=>t.name)}this.arcgisChange.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListChange.emit({selectedFields:this.selectedFields})}}>${this.canDeselectAll()?this._messages.deselectAll:this._messages.selectAll}</calcite-button></div>`}renderListItems(){let e=this.allLists.filter(t=>!!t.fields.length);return e.length===1&&!e[0].title?e[0].fields.map(t=>this.renderCalciteListItem(t)):e.map(t=>s`<calcite-list-item-group .heading=${t.title}>${t.fields.map(i=>this.renderCalciteListItem(i))}</calcite-list-item-group>`)}renderCalciteListItem(e){let t=this.showFieldInfoCheck(e),i=this.showFieldTypeIcon&&!!e.type;return B(e.name,s`<calcite-list-item .label=${e.alias||e.name} .description=${(()=>{if(this.showFieldName&&e.hideFieldName!==!0)return`{${e.name}}`;if(this.showDescription&&e.hideDescription!==!0&&e.description)return e.description})()} .value=${e.name} .selected=${!this.multiple&&e.name===this.selectedFields[0]||this.multiple&&this.selectedFields.includes(e.name)} .metadata=${{label:e.alias,fieldName:e.name}}>${i&&s`<div slot=actions-end class="field-icons">${L({fieldType:e.type})}</div>`||""}${this.renderInfoAction(e,t)}${this.renderEditAction(e)}${this.renderDeleteAction(e)}</calcite-list-item>`)}renderInfoAction(e,t){let{_messages:i}=this;return t?s`<calcite-action slot=actions-end .text=${i.info} title=${i.info??c} scale=s icon=information @click=${l=>{l.stopPropagation();let a=l.currentTarget;this.addFieldInfoFlowItem(e,a)}}></calcite-action>`:""}renderEditAction(e){let{_messages:t}=this;return e.showEditAction?s`<calcite-action slot=actions-end .text=${t.edit} title=${t.edit??c} scale=s icon=pencil @click=${i=>{i.stopPropagation(),this.arcgisEditField.emit({fieldName:e.name})}}></calcite-action>`:""}renderDeleteAction(e){let{_messages:t}=this;return e.showDeleteAction?s`<calcite-action slot=actions-end .text=${t.delete} title=${t.delete??c} scale=s icon=trash @click=${i=>{i.stopPropagation(),this.arcgisDeleteField.emit({fieldName:e.name})}}></calcite-action>`:""}renderAddButton(){return this.multiple?s`<calcite-button .appearance=${this.hideCancel?"outline-fill":"solid"} .width=${this.hideCancel?"full":"half"} @click=${()=>{this.arcgisClose.emit({selectedFields:this.selectedFields}),this.arcgisFieldPickListDismissed.emit({selectedFields:this.selectedFields})}}>${this.okBtnText||(this.multiple?this._messages.done:this._messages.ok)}</calcite-button>`:""}renderCancelButton(){return this.hideCancel?"":s`<calcite-button appearance=outline-fill .width=${this.multiple?"half":"full"} @click=${()=>{this.arcgisClose.emit(),this.arcgisFieldPickListDismissed.emit()}}>${this._messages.cancel}</calcite-button>`}};S("arcgis-field-pick-list",f);export{f as ArcgisFieldPickList};
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{G as i,v as e}from"./UTXWKXMT.js";var s=e(i,{"arcgis-ckeditor5":[()=>import("./AXTSUI2Q.js"),"canResizeVertically,currentLanguage,customConfig,customExpressionCheck:,editorType,groupFieldsAndExpressions,intlExpressionsGroupHeading,intlFieldsGroupHeading,intlTextPlaceHolder,mentionFields:,readOnly,textData;getData,setFocus"],"arcgis-ckeditor5-popover":[()=>import("./
|
|
2
|
+
import{G as i,v as e}from"./UTXWKXMT.js";var s=e(i,{"arcgis-ckeditor5":[()=>import("./AXTSUI2Q.js"),"canResizeVertically,currentLanguage,customConfig,customExpressionCheck:,editorType,groupFieldsAndExpressions,intlExpressionsGroupHeading,intlFieldsGroupHeading,intlTextPlaceHolder,mentionFields:,readOnly,textData;getData,setFocus"],"arcgis-ckeditor5-popover":[()=>import("./4DCAUWTC.js"),"guid,intlCancel,intlLabel,intlOk,refElement:;reposition"],"arcgis-color-input":[()=>import("./C6JAR4IN.js"),"_messages:,clearable,color,compact,disabled,hideRecentColors,messageOverrides:,placement,popoverProps:,showTransparency,storageId;close,setFocus"],"arcgis-field-info":[()=>import("./4CW7U27R.js"),"_messages:,fieldName,hideAlias,hideNumericFormat,hideStatistics,layer:,view:;refresh"],"arcgis-field-pick-list":[()=>import("./ZLXAKPUH.js"),"_messages:,customExpressionCheck:,expressionsGroupHeading,fields:,fieldsGroupHeading,filterNoResultsText,filterPlaceholderText,groupFieldsAndExpressions,heading,hideCancel,hideSort,layer:,listOnly,mapView:,multiple,okBtnText,popoverProps:,selectedFields:,showCancel,showDescription,showFieldInfo,showFieldName,showFieldTypeIcon,showFilterLength,showSelectionAll,showSort,sortBy,view:;reposition,setDisabled,setFocus"],"arcgis-histogram":[()=>import("./6DQVLQL6.js"),"_messages:,average,bins:,colorBlendingEnabled,colorStops:,dataLines:,icon,label,layout,max,messageOverrides:,min,standardDeviation"],"arcgis-label-input":[()=>import("./ZL3E4ZGE.js"),"alignment,editing,labelFormatter:,readOnly,value;edit;getLabelBoundingClientRect"],"arcgis-picker-input":[()=>import("./J5X5TNVW.js"),"disabled,heading,iconEnd,intlDone,label,popoverProps:;close,setFocus"],"arcgis-ramp-color":[()=>import("./YVSTPEPS.js"),"layout,max,min,stops:"],"arcgis-ramp-color-break":[()=>import("./7HQMPKZO.js"),"layout,max,min,stops:"],"arcgis-ramp-opacity":[()=>import("./ZOWIFVL3.js"),"fillColor,layout,max,min,stops:"],"arcgis-slider":[()=>import("./JTRO7GRS.js"),"activeValue:,allowValuesOverlap,autoDestroyDisabled,disabled,fillPlacement,fullRangeMax,fullRangeMin,keyboardLargeStep,labelFormatter:,layout,max,messageOverrides:,messages:,min,mirrored,popoverLabel,popoverPlacement,precision,rangeLabelsEditingEnabled,rangeLabelsPlacement,segmentsDraggingDisabled,showRangeLabels,steps,valueLabelsDisplay,valueLabelsEditingEnabled,valueLabelsPlacement,values;destroy"],"arcgis-slider-input":[()=>import("./XEB2RUND.js"),"disabled,flipLabels,label,max,min,step,unitsLabel,value,withSteppers"],"arcgis-ticks":[()=>import("./3O7GAC23.js"),"interactive,interpolationExponent,labelFormatter:,labelPlacement,layout,max,min,mirrored,mode,showBaseline,showLabels,values"],"arcgis-unique-values-list":[()=>import("./GAR4QMLU.js"),"_messages:,fieldName,fieldSource,layer:,maxHeight,multiple,numberFormatOptions:,partialUniqueValues,selectedValues:,showFilterLength,sortBy,uniqueValues:,view:;getUniqueValues,setFocus"]});s({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-ckeditor5,arcgis-ckeditor5-popover,arcgis-color-input,arcgis-field-info,arcgis-field-pick-list,arcgis-histogram,arcgis-label-input,arcgis-picker-input,arcgis-ramp-color,arcgis-ramp-color-break,arcgis-ramp-opacity,arcgis-slider,arcgis-slider-input,arcgis-ticks,arcgis-unique-values-list){visibility:hidden}:root{--arcgis-ckeditor5-initial-height: 30vh;--arcgis-ckeditor5-max-width: 35vw;--arcgis-ckeditor5-mentions-max-width: 33vw;--arcgis-common-ckeditor5-initial-height: 30vh;--arcgis-common-ckeditor5-max-width: 35vw;--arcgis-common-ckeditor5-mentions-max-width: 33vw}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,i)
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
}
|
|
5
|
-
function r(e) {
|
|
6
|
-
return t(e) && n(e);
|
|
7
|
-
}
|
|
8
|
-
function t(e) {
|
|
9
|
-
return e != null && typeof e == "object" && "type" in e && e.type === "feature";
|
|
10
|
-
}
|
|
11
|
-
function n(e) {
|
|
12
|
-
return e?.type === "feature" && e.source?.type === "feature-layer";
|
|
2
|
+
function n(i) {
|
|
3
|
+
return i != null;
|
|
13
4
|
}
|
|
14
5
|
export {
|
|
15
|
-
|
|
16
|
-
r as s
|
|
6
|
+
n as i
|
|
17
7
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
import type { EditorType, InputMentionField } from "./types.js";
|
|
4
4
|
|
|
5
|
+
/** @internal */
|
|
5
6
|
export abstract class ArcgisCkeditor5 extends LitElement {
|
|
6
7
|
/**
|
|
7
8
|
* The editor's text area will have a vertical resize handle if set to true
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/** @internal */
|
|
1
2
|
export type InputMentionField = {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
4
5
|
};
|
|
5
6
|
|
|
7
|
+
/** @internal */
|
|
8
|
+
export type DisplayMentionField = InputMentionField
|
|
9
|
+
& {
|
|
10
|
+
isFirstExpression: boolean;
|
|
11
|
+
isFirstField: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
6
15
|
export type EditorType = "html" | "markdown";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
|
|
4
|
+
/** @internal */
|
|
4
5
|
export abstract class ArcgisCkeditor5Popover extends LitElement {
|
|
5
6
|
/** Guid for ckeditor popover instance. */
|
|
6
7
|
accessor guid: `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -4,6 +4,7 @@ import type { IPopoverProps } from "../../utils/types.js";
|
|
|
4
4
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
5
5
|
import type { Popover as Popover } from "@esri/calcite-components/components/calcite-popover";
|
|
6
6
|
|
|
7
|
+
/** @internal */
|
|
7
8
|
export abstract class ArcgisColorInput extends LitElement {
|
|
8
9
|
/** @internal */
|
|
9
10
|
protected _messages: Partial<{
|
|
@@ -4,6 +4,7 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
4
4
|
import type { FieldInfoLayer } from "./utils/basic.js";
|
|
5
5
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
6
6
|
|
|
7
|
+
/** @internal */
|
|
7
8
|
export abstract class ArcgisFieldInfo extends LitElement {
|
|
8
9
|
/** @internal */
|
|
9
10
|
protected _messages: {
|
|
@@ -9,10 +9,10 @@ import { log as V, composeMissingPropertyMessage as I } from "@arcgis/toolkit/lo
|
|
|
9
9
|
import E from "@arcgis/core/config.js";
|
|
10
10
|
import * as _ from "@arcgis/core/core/reactiveUtils.js";
|
|
11
11
|
import * as y from "@arcgis/core/intl.js";
|
|
12
|
+
import * as N from "@arcgis/core/applications/PortalApp/layerUtils.js";
|
|
12
13
|
import * as S from "@arcgis/core/core/lang.js";
|
|
13
14
|
import R from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
14
15
|
import A from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
15
|
-
import { s as N } from "../../chunks/commonFunctions.js";
|
|
16
16
|
import L from "@arcgis/core/rest/support/Query.js";
|
|
17
17
|
import { u as Z } from "../../chunks/useT9n.js";
|
|
18
18
|
function p(a) {
|
|
@@ -24,13 +24,13 @@ function P(a) {
|
|
|
24
24
|
const M = {
|
|
25
25
|
dateStyle: "short",
|
|
26
26
|
timeStyle: "short"
|
|
27
|
-
},
|
|
27
|
+
}, U = {
|
|
28
28
|
timeStyle: "medium"
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function G(a) {
|
|
31
31
|
const { layer: e, fieldName: t } = a;
|
|
32
32
|
let i;
|
|
33
|
-
const n = N(e);
|
|
33
|
+
const n = N.supportsFieldConfiguration(e);
|
|
34
34
|
let s;
|
|
35
35
|
"popupTemplate" in e && (s = e.popupTemplate);
|
|
36
36
|
const r = s ? s.fieldInfos : [];
|
|
@@ -271,7 +271,7 @@ class Y extends x {
|
|
|
271
271
|
layer: s ?? t,
|
|
272
272
|
fieldName: i,
|
|
273
273
|
hideStatistics: n
|
|
274
|
-
}, this.props.fieldInfo =
|
|
274
|
+
}, this.props.fieldInfo = G(this.props), t.type === "scene" && E.request.interceptors?.push({
|
|
275
275
|
urls: `${P(t)}/${t.layerId}`,
|
|
276
276
|
before(r) {
|
|
277
277
|
r.requestOptions.authMode = "no-prompt";
|
|
@@ -491,7 +491,7 @@ class Y extends x {
|
|
|
491
491
|
}
|
|
492
492
|
getCurrentFieldFormat() {
|
|
493
493
|
const { props: e } = this, { layer: t, fieldName: i } = e;
|
|
494
|
-
return (this.
|
|
494
|
+
return (this.originalLayerSupportsFieldConfigs() ? t.getFieldConfiguration(i) : void 0)?.fieldFormat;
|
|
495
495
|
}
|
|
496
496
|
getIntlNumberFormattingOptions(e) {
|
|
497
497
|
const t = this.getCurrentFieldFormat();
|
|
@@ -517,7 +517,7 @@ class Y extends x {
|
|
|
517
517
|
getIntlDateTimeFormattingOptions(e, t) {
|
|
518
518
|
const i = this.getCurrentFieldFormat();
|
|
519
519
|
if (!t?.useFieldFormatting)
|
|
520
|
-
return i ? t?.isTimeOnly ?
|
|
520
|
+
return i ? t?.isTimeOnly ? U : M : y.convertDateFormatToIntlOptions(e);
|
|
521
521
|
const n = i ? {
|
|
522
522
|
dateStyle: t?.isTimeOnly ? void 0 : i.dateStyle ?? void 0,
|
|
523
523
|
// year/month is overridden if dateStyle is set
|
|
@@ -531,9 +531,9 @@ class Y extends x {
|
|
|
531
531
|
const s = this.getPopupTemplateFieldInfo();
|
|
532
532
|
return y.convertDateFormatToIntlOptions(s?.format?.dateFormat ?? e);
|
|
533
533
|
}
|
|
534
|
-
|
|
534
|
+
originalLayerSupportsFieldConfigs() {
|
|
535
535
|
const { layer: e } = this;
|
|
536
|
-
return N(e);
|
|
536
|
+
return N.supportsFieldConfiguration(e);
|
|
537
537
|
}
|
|
538
538
|
getPopupTemplateFieldInfo() {
|
|
539
539
|
const { props: e } = this, { layer: t, fieldName: i } = e;
|
|
@@ -587,7 +587,7 @@ class Y extends x {
|
|
|
587
587
|
const { _messages: e, props: t, hideNumericFormat: i } = this, { fieldName: n, fieldInfo: s, layer: r } = t;
|
|
588
588
|
if (i || !["double", "long", "single"].includes(s.layerField.type))
|
|
589
589
|
return "";
|
|
590
|
-
const m = this.
|
|
590
|
+
const m = this.originalLayerSupportsFieldConfigs() ? r.getFieldConfiguration(n) : void 0;
|
|
591
591
|
if (m?.fieldFormat) {
|
|
592
592
|
const { minimumFractionDigits: l, maximumFractionDigits: o } = m.fieldFormat;
|
|
593
593
|
return d`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}", l.toString())}</div><div>${e.fieldMaximumFractionDigits.replace("${number}", o.toString())}</div></div>`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
2
2
|
|
|
3
|
+
/** @internal */
|
|
3
4
|
export type FieldInfoLayer = __esri.CatalogFootprintLayer | __esri.CatalogLayer | __esri.CSVLayer | __esri.FeatureLayer | __esri.GeoJSONLayer | __esri.ImageryLayer | __esri.ImageryTileLayer | __esri.KnowledgeGraphSublayer | __esri.OGCFeatureLayer | __esri.OrientedImageryLayer | __esri.ParquetLayer | __esri.SceneLayer | __esri.StreamLayer | __esri.Sublayer | __esri.SubtypeGroupLayer | __esri.SubtypeSublayer | __esri.VoxelLayer | __esri.WCSLayer | __esri.WFSLayer;
|
|
@@ -13,6 +13,7 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
13
13
|
* @slot [content-bottom] - A slot for content below the list, non-scrollable. Valid only if listOnly is not set to true.
|
|
14
14
|
* @slot [content-footer] - A slot for content below the list inside the panel's footer, non-scrollable. Valid only if listOnly is not set to true.
|
|
15
15
|
* @slot [no-fields] - A slot for content, e.g. a message, that displays if the list of fields is empty.
|
|
16
|
+
* @internal
|
|
16
17
|
*/
|
|
17
18
|
export abstract class ArcgisFieldPickList extends LitElement {
|
|
18
19
|
/** @internal */
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* All supported layer types
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
4
8
|
export type FieldPickListLayer = __esri.CatalogFootprintLayer | __esri.CatalogLayer | __esri.CSVLayer | __esri.FeatureLayer | __esri.GeoJSONLayer | __esri.ImageryLayer | __esri.ImageryTileLayer | __esri.KnowledgeGraphSublayer | __esri.OGCFeatureLayer | __esri.OrientedImageryLayer | __esri.ParquetLayer | __esri.SceneLayer | __esri.StreamLayer | __esri.Sublayer | __esri.SubtypeGroupLayer | __esri.SubtypeSublayer | __esri.VoxelLayer | __esri.WCSLayer | __esri.WFSLayer;
|