@arcgis/common-components 5.0.10 → 5.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{GDXLMK6P.js → 3DTJUKC4.js} +1 -1
- package/dist/cdn/{G2GJABBU.js → 5DWQO6V2.js} +1 -1
- package/dist/cdn/{PXWJ4MH5.js → BBZONVIO.js} +1 -1
- package/dist/cdn/{4IPPTZVD.js → BTZD6JKV.js} +1 -1
- package/dist/cdn/{TIQIAU3O.js → EEAFTTQD.js} +1 -1
- package/dist/cdn/{MKMRUZQA.js → EFAZMZWU.js} +1 -1
- package/dist/cdn/{TUDWIFTM.js → G6TWFC4V.js} +1 -1
- package/dist/cdn/{2KEQC2T3.js → HG2C7CGI.js} +1 -1
- package/dist/cdn/{BFMUHDYT.js → HMME3EZZ.js} +1 -1
- package/dist/cdn/{V7LWVAW3.js → K7YKSQ4T.js} +1 -1
- package/dist/cdn/{DDRDP5AI.js → KHJP4YRK.js} +1 -1
- package/dist/cdn/{327CFICC.js → LE3A4PAA.js} +1 -1
- package/dist/cdn/{YQWLNGD4.js → OIQTTWEV.js} +1 -1
- package/dist/cdn/{MM72P2XC.js → QNSC463B.js} +1 -1
- package/dist/cdn/{BMT7CQ4L.js → TXIGJXZQ.js} +1 -1
- package/dist/cdn/{EEAXLMIO.js → UHASKQLX.js} +1 -1
- package/dist/cdn/{YEU4IYS5.js → ULLPI7MD.js} +1 -1
- package/dist/cdn/{FCSD6O3B.js → VXNCJ7CF.js} +1 -1
- package/dist/cdn/{PKT4CZ6U.js → YJ5ZDHHC.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as Q}from"./EEAXLMIO.js";import{a as re}from"./3WYIVRKX.js";import{a as ee,b as te}from"./MM72P2XC.js";import{a as z,b as X,d as J}from"./27FRM3HV.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"./GDXLMK6P.js";export default $arcgis.t(([{on:qe,watch:ne},{createObservable:me,trackAccess:pe},{property:Xe,subclass:Je},et,xe,{property:D,subclass:ye},{watch:H}])=>{var ae=(n,e)=>t=>fe(t,n),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 a=ne(()=>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(a.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=(n,e,t,r,i)=>new Proxy(r,{get:(a,o)=>{let s=a[o];if(typeof o=="symbol"||i.has(o))return s;let l=n.M[t];return l.A=o,W(n,d=>{if(l.A=void 0,d!==void 0){let c=d.key;i.set(o,c);let h=n.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=(n,e,t,r,i,a)=>a=ne(()=>{let o=n.deref();return o===void 0||o.component.manager.destroyed?a=a.remove():o.exports[t]},(o,s)=>{if(!a)return;n.deref().component?.requestUpdate(r,i?!s:s),e.c=!1},{sync:!0}),_e=(n,e,t,r)=>{n.d.get=function(){let i=this.M[e]?.exports[t];return r?!i:i},n.d.set=function(i){let a=this.M[e];a.A!==t&&(a.exports[t]=r?!i:i)}};function*ie(n,e){if(n!==void 0){let t=0;for(let r of n)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:n,shiftKey:e},t,r){let i=ke(n);if(i==null)return null;let a=De(n)||we(n)&&e?Ee(t):1;return{direction:r?i*-1:i,count:a}}function ke(n){return n===p.increment||n===p.incrementHorizontal||n===p.pageIncrement?1:n===p.decrement||n===p.decrementHorizontal||n===p.pageDecrement?-1:null}function oe(n){return n===p.jumpToEnd||n===p.jumpToStart}function we(n){return n===p.increment||n===p.decrement||n===p.decrementHorizontal||n===p.incrementHorizontal}function De(n){return n===p.pageIncrement||n===p.pageDecrement}function Ee(n){let e=Number.isFinite(n)?Math.floor(n):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=(n,e,t,r)=>{for(var i=r>1?void 0:r?$e(e,t):e,a=n.length-1,o;a>=0;a--)(o=n[a])&&(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(n={}){super({...Ie(),properties:n}),this._entries=new Map,this.precision=4,this.ready=!1}startup(){let{precision:n}=this,{min:e,max:t,values:r}=this;t=_(t,n),e=_(e,n),r=r?.map(a=>M(_(a,n),e,t)),this._set("min",e),this._set("max",t),this._set("values",r);let i=new Map(r?.map(a=>[V(),a]));this._entries=i,H(()=>this.min,a=>{let o=this.values;a!=null&&o?.length&&o.some(s=>s<a)&&(this._entries.forEach((s,l)=>{s<a&&this._entries.set(l,a)}),this._updatesValues())},{sync:!0}),H(()=>this.max,a=>{let o=this.values;a!=null&&o?.length&&o.some(s=>s>a)&&(this._entries.forEach((s,l)=>{s>a&&this._entries.set(l,a)}),this._updatesValues())},{sync:!0}),H(()=>this.precision,a=>{let{min:o,max:s,values:l}=this;this._set("min",_(o,a)),this._set("max",_(s,a)),l?.length&&(this._entries.forEach((d,c)=>{this._entries.set(c,_(d,a))}),this._updatesValues())},{sync:!0}),this._set("ready",!0)}get entries(){return this._entries}set max(n){if(!this.ready){this._set("max",n);return}let e=this._get("max"),t=_(n,this.precision);e!==t&&this._set("max",t)}set min(n){if(!this.ready){this._set("min",n);return}let e=this._get("min"),t=_(n,this.precision);e!==t&&this._set("min",t)}set values(n){if(!this.ready){this._set("values",n);return}let e=this._get("values");if(n=n?.map(r=>M(_(r,this.precision),this.min,this.max)).sort((r,i)=>r-i),e&&n&&e.length===n.length&&e.every((r,i)=>r===n[i]))return;let t=new Map(n?.map(r=>[V(),r]));this._entries=t,this._set("values",n)}getValue(n){return this._entries.get(n)}setValue(n,e){if(this.values==null)return!1;let{min:t,max:r}=this,i=this._entries.get(n),a=M(_(e,this.precision),t,r);return i===a?!1:(this._entries.set(n,a),this._updatesValues(),!0)}setValues(n){if(this.values==null)return!1;let e=!1,{min:t,max:r}=this;for(let[i,a]of n){let o=this._entries.get(i),s=M(_(a,this.precision),t,r);o!==s&&(e=!0,this._entries.set(i,s))}return e?(this._updatesValues(),!0):!1}_updatesValues(){let n=Array.from(this._entries.values()).sort((e,t)=>e-t);this._set("values",n)}};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:n=>M(n,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(n,e,t){return Math.min(Math.max(n,e),t)}function _(n,e){return Number.parseFloat(n.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,a,o)=>Math.abs(i-e)<Math.abs(o[r]-e)?a: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(n){if(n.steps==null)return null;let e=n.steps;return Array.isArray(e)?e.length===0?null:new N(e):e<=0?null:new B(n.min,n.max,e)}function Te(n,e,t){if(n==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=n.minIndex;h<=n.maxIndex;h++){let u=n.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}}),a=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=>!a.has(d.idx));l?(a.add(l.idx),o.set(s.uuid,l.value)):o.set(s.uuid,e.get(s.uuid))}return o}function le(n,e,t,r,i){let a=e.get(t)??0;if(!n)return a+r;let o=a+r,s=new Set;if(!i)for(let[c,h]of e.entries())c!==t&&s.add(n.valueToIndex(h));let l=null,d=1/0;for(let c=n.minIndex;c<=n.maxIndex;c++){if(s.has(c))continue;let h=n.indexToValue(c),u=Math.abs(h-o);u<d&&(d=u,l=c)}return l==null?a:n.indexToValue(l)}function Fe(n,e,t,r=1){let i=he(r),a=e,o=!1;for(let s=0;s<i;s++){let l=ze(n,a,t);if(o||=l.changed,a=l.entries,!l.changed)break}return{changed:o,entries:a}}function Se(n,e,t,r,i=1){let a=he(i);if(a===1)return U(n,e,t,r);let o=new Map(e),s=o.get(t);for(let l=0;l<a;l++){let d=U(n,o,t,r);if(d===s)break;s=d,o.set(t,s)}return s}function he(n){let e=Number.isFinite(n)?Math.floor(n):1;return Math.max(1,e)}function ze(n,e,t){let r=new Map,i=t>0?Ve:ue,a=Array.from(e).sort((l,d)=>i(l[1],d[1])),o=!1,s=!0;for(let[l,d]of a)if(r.set(l,d),s){let c=U(n,r,l,t);d===c&&(s=!1),o||=s,r.set(l,c)}return{changed:o,entries:r}}function U(n,e,t,r){let{allowValuesOverlap:i,stepsProvider:a,resolution:o,min:s,max:l}=n,d=e.get(t);if(r=r>0?1:-1,!a){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=a.valueToIndex(d);if(c===-1)return d;if(i){let m=P(c+r,a.minIndex,a.maxIndex);return a.indexToValue(m)}let h=new Set;for(let[m,y]of e)m!==t&&h.add(a.valueToIndex(y));let u=c,f=!1,g=a.minIndex,v=a.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?a.indexToValue(u):d}function Le(n,e,t,r){let{allowValuesOverlap:i,stepsProvider:a,resolution:o,min:s,max:l}=n,d=e.get(t);if(r=r>0?1:-1,!a){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?a.indexToValue(a.maxIndex):a.indexToValue(a.minIndex);let c=a.valueToIndex(d);if(c===-1)return d;let h=new Set(Array.from(e).filter(([f])=>f!==t).map(([,f])=>a.valueToIndex(f))),u=r>0?a.maxIndex:a.minIndex;for(;h.has(u);)if(u-=r,r>0&&u>l||r<0&&u<s){u=c;break}return a.indexToValue(u)}function Re(n,e,t){let{stepsProvider:r,min:i,max:a}=n,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=a-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(n,e){return n-e}function Ve(n,e){return e-n}function P(n,e,t){return Math.max(e,Math.min(t,n))}var Oe=ae(x),j=class extends G{constructor(){super(...arguments),this._stepsProvider=null,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),a=this.labelFormatter;return a?a(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._activePart=null,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,a=>a.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 a of this._sliderData.entries.keys()){let o=this._activePart==="range"||this._activePart===a;if(this.valueLabelsDisplay==="always"||o){let s=Be(this,a),l=ce(this,a);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(),e.currentTarget.focus(),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,a]=this._sliderData.entries.entries().next().value,o=r*this._fullRange+this._fullMin-a,s=R(this._fullMin,this._fullMax,a)/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._focusEntry(t),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:a}=this,o=r,s=i;if(this._setActivePart(e),e==="range"){if(this.segmentsDraggingDisabled)return;o=r-a[0],s=i-a[a.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:a,maxDiff:o}}=this;if(r===e)return;let s=(e-r)*this._fullRange;if(t==="range"){s=Math.min(o,Math.max(a,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,a=!1;switch(e.stopPropagation(),i){case"min":{r<this.max?(this.min=r,a=!0):t.value=this.min;break}case"max":{r>this.min?(this.max=r,a=!0):t.value=this.max;break}}a&&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 a=Se(this._getStepsConfiguration(),this._sliderData.entries,t,i.direction,i.count);this._setValue(t,a);return}if(oe(e.key)){e.preventDefault();let a=Le(this._getStepsConfiguration(),this._sliderData.entries,t,this._getDirectionForHomeEndKey(e.key));this._setValue(t,a)}}_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:a,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 a!=="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,a=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",!a&&r==="start"?"track-fill":null])),o=t),s>e&&(l.push(this._renderSegment(e,s,[this.mirrored?"track-effective-start":"track-effective-end",!a&&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 a=[...e].sort((s,l)=>s-l);if(a.length===1)switch(t){case"start":if(r<a[0])return this._renderSegment(r,a[0],["track-range"]);break;case"end":if(i>a[0])return this._renderSegment(a[0],i,["track-range"]);break}let o=this.segmentsDraggingDisabled;return this._renderSegment(a[0],a[a.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:a,_fullMax:o,mirrored:s}=this,l=[R(a,o,de(e,a,o)),100-R(a,o,de(t,a,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,a=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:a})} 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(n){return"dataset"in n&&n.tagName==="ARCGIS-LABEL-INPUT"&&(n.dataset.type==="min"||n.dataset.type==="max")}function I(n){let e=J(n,"[data-entry]");return e&&"dataset"in e?e.dataset.entry:null}function He(n){return typeof n!=null&&n!=="range"}function Ne(n,e){return e?n.renderRoot.querySelector(`div[data-entry="${e}"]`):null}function Be(n,e){return e?n.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`):null}function ce(n,e){return e?n.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`):null}function L(n){return n.isPrimary&&n.button===0}var Ue=5;function R(n,e,t){let r=e-n,i=(t-n)/r*100;return Number.parseFloat(i.toFixed(Ue))}function de(n,e,t){return Math.max(e,Math.min(t,n))}Z("arcgis-slider",j);return j},"core/reactiveUtils","applications/Components/reactiveUtils","core/accessorSupport/decorators","core/Accessor","core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
|
|
2
|
+
import{a as Q}from"./UHASKQLX.js";import{a as re}from"./3WYIVRKX.js";import{a as ee,b as te}from"./QNSC463B.js";import{a as z,b as X,d as J}from"./27FRM3HV.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"./3DTJUKC4.js";export default $arcgis.t(([{on:qe,watch:ne},{createObservable:me,trackAccess:pe},{property:Xe,subclass:Je},et,xe,{property:D,subclass:ye},{watch:H}])=>{var ae=(n,e)=>t=>fe(t,n),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 a=ne(()=>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(a.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=(n,e,t,r,i)=>new Proxy(r,{get:(a,o)=>{let s=a[o];if(typeof o=="symbol"||i.has(o))return s;let l=n.M[t];return l.A=o,W(n,d=>{if(l.A=void 0,d!==void 0){let c=d.key;i.set(o,c);let h=n.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=(n,e,t,r,i,a)=>a=ne(()=>{let o=n.deref();return o===void 0||o.component.manager.destroyed?a=a.remove():o.exports[t]},(o,s)=>{if(!a)return;n.deref().component?.requestUpdate(r,i?!s:s),e.c=!1},{sync:!0}),_e=(n,e,t,r)=>{n.d.get=function(){let i=this.M[e]?.exports[t];return r?!i:i},n.d.set=function(i){let a=this.M[e];a.A!==t&&(a.exports[t]=r?!i:i)}};function*ie(n,e){if(n!==void 0){let t=0;for(let r of n)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:n,shiftKey:e},t,r){let i=ke(n);if(i==null)return null;let a=De(n)||we(n)&&e?Ee(t):1;return{direction:r?i*-1:i,count:a}}function ke(n){return n===p.increment||n===p.incrementHorizontal||n===p.pageIncrement?1:n===p.decrement||n===p.decrementHorizontal||n===p.pageDecrement?-1:null}function oe(n){return n===p.jumpToEnd||n===p.jumpToStart}function we(n){return n===p.increment||n===p.decrement||n===p.decrementHorizontal||n===p.incrementHorizontal}function De(n){return n===p.pageIncrement||n===p.pageDecrement}function Ee(n){let e=Number.isFinite(n)?Math.floor(n):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=(n,e,t,r)=>{for(var i=r>1?void 0:r?$e(e,t):e,a=n.length-1,o;a>=0;a--)(o=n[a])&&(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(n={}){super({...Ie(),properties:n}),this._entries=new Map,this.precision=4,this.ready=!1}startup(){let{precision:n}=this,{min:e,max:t,values:r}=this;t=_(t,n),e=_(e,n),r=r?.map(a=>M(_(a,n),e,t)),this._set("min",e),this._set("max",t),this._set("values",r);let i=new Map(r?.map(a=>[V(),a]));this._entries=i,H(()=>this.min,a=>{let o=this.values;a!=null&&o?.length&&o.some(s=>s<a)&&(this._entries.forEach((s,l)=>{s<a&&this._entries.set(l,a)}),this._updatesValues())},{sync:!0}),H(()=>this.max,a=>{let o=this.values;a!=null&&o?.length&&o.some(s=>s>a)&&(this._entries.forEach((s,l)=>{s>a&&this._entries.set(l,a)}),this._updatesValues())},{sync:!0}),H(()=>this.precision,a=>{let{min:o,max:s,values:l}=this;this._set("min",_(o,a)),this._set("max",_(s,a)),l?.length&&(this._entries.forEach((d,c)=>{this._entries.set(c,_(d,a))}),this._updatesValues())},{sync:!0}),this._set("ready",!0)}get entries(){return this._entries}set max(n){if(!this.ready){this._set("max",n);return}let e=this._get("max"),t=_(n,this.precision);e!==t&&this._set("max",t)}set min(n){if(!this.ready){this._set("min",n);return}let e=this._get("min"),t=_(n,this.precision);e!==t&&this._set("min",t)}set values(n){if(!this.ready){this._set("values",n);return}let e=this._get("values");if(n=n?.map(r=>M(_(r,this.precision),this.min,this.max)).sort((r,i)=>r-i),e&&n&&e.length===n.length&&e.every((r,i)=>r===n[i]))return;let t=new Map(n?.map(r=>[V(),r]));this._entries=t,this._set("values",n)}getValue(n){return this._entries.get(n)}setValue(n,e){if(this.values==null)return!1;let{min:t,max:r}=this,i=this._entries.get(n),a=M(_(e,this.precision),t,r);return i===a?!1:(this._entries.set(n,a),this._updatesValues(),!0)}setValues(n){if(this.values==null)return!1;let e=!1,{min:t,max:r}=this;for(let[i,a]of n){let o=this._entries.get(i),s=M(_(a,this.precision),t,r);o!==s&&(e=!0,this._entries.set(i,s))}return e?(this._updatesValues(),!0):!1}_updatesValues(){let n=Array.from(this._entries.values()).sort((e,t)=>e-t);this._set("values",n)}};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:n=>M(n,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(n,e,t){return Math.min(Math.max(n,e),t)}function _(n,e){return Number.parseFloat(n.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,a,o)=>Math.abs(i-e)<Math.abs(o[r]-e)?a: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(n){if(n.steps==null)return null;let e=n.steps;return Array.isArray(e)?e.length===0?null:new N(e):e<=0?null:new B(n.min,n.max,e)}function Te(n,e,t){if(n==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=n.minIndex;h<=n.maxIndex;h++){let u=n.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}}),a=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=>!a.has(d.idx));l?(a.add(l.idx),o.set(s.uuid,l.value)):o.set(s.uuid,e.get(s.uuid))}return o}function le(n,e,t,r,i){let a=e.get(t)??0;if(!n)return a+r;let o=a+r,s=new Set;if(!i)for(let[c,h]of e.entries())c!==t&&s.add(n.valueToIndex(h));let l=null,d=1/0;for(let c=n.minIndex;c<=n.maxIndex;c++){if(s.has(c))continue;let h=n.indexToValue(c),u=Math.abs(h-o);u<d&&(d=u,l=c)}return l==null?a:n.indexToValue(l)}function Fe(n,e,t,r=1){let i=he(r),a=e,o=!1;for(let s=0;s<i;s++){let l=ze(n,a,t);if(o||=l.changed,a=l.entries,!l.changed)break}return{changed:o,entries:a}}function Se(n,e,t,r,i=1){let a=he(i);if(a===1)return U(n,e,t,r);let o=new Map(e),s=o.get(t);for(let l=0;l<a;l++){let d=U(n,o,t,r);if(d===s)break;s=d,o.set(t,s)}return s}function he(n){let e=Number.isFinite(n)?Math.floor(n):1;return Math.max(1,e)}function ze(n,e,t){let r=new Map,i=t>0?Ve:ue,a=Array.from(e).sort((l,d)=>i(l[1],d[1])),o=!1,s=!0;for(let[l,d]of a)if(r.set(l,d),s){let c=U(n,r,l,t);d===c&&(s=!1),o||=s,r.set(l,c)}return{changed:o,entries:r}}function U(n,e,t,r){let{allowValuesOverlap:i,stepsProvider:a,resolution:o,min:s,max:l}=n,d=e.get(t);if(r=r>0?1:-1,!a){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=a.valueToIndex(d);if(c===-1)return d;if(i){let m=P(c+r,a.minIndex,a.maxIndex);return a.indexToValue(m)}let h=new Set;for(let[m,y]of e)m!==t&&h.add(a.valueToIndex(y));let u=c,f=!1,g=a.minIndex,v=a.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?a.indexToValue(u):d}function Le(n,e,t,r){let{allowValuesOverlap:i,stepsProvider:a,resolution:o,min:s,max:l}=n,d=e.get(t);if(r=r>0?1:-1,!a){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?a.indexToValue(a.maxIndex):a.indexToValue(a.minIndex);let c=a.valueToIndex(d);if(c===-1)return d;let h=new Set(Array.from(e).filter(([f])=>f!==t).map(([,f])=>a.valueToIndex(f))),u=r>0?a.maxIndex:a.minIndex;for(;h.has(u);)if(u-=r,r>0&&u>l||r<0&&u<s){u=c;break}return a.indexToValue(u)}function Re(n,e,t){let{stepsProvider:r,min:i,max:a}=n,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=a-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(n,e){return n-e}function Ve(n,e){return e-n}function P(n,e,t){return Math.max(e,Math.min(t,n))}var Oe=ae(x),j=class extends G{constructor(){super(...arguments),this._stepsProvider=null,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),a=this.labelFormatter;return a?a(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._activePart=null,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,a=>a.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 a of this._sliderData.entries.keys()){let o=this._activePart==="range"||this._activePart===a;if(this.valueLabelsDisplay==="always"||o){let s=Be(this,a),l=ce(this,a);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(),e.currentTarget.focus(),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,a]=this._sliderData.entries.entries().next().value,o=r*this._fullRange+this._fullMin-a,s=R(this._fullMin,this._fullMax,a)/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._focusEntry(t),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:a}=this,o=r,s=i;if(this._setActivePart(e),e==="range"){if(this.segmentsDraggingDisabled)return;o=r-a[0],s=i-a[a.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:a,maxDiff:o}}=this;if(r===e)return;let s=(e-r)*this._fullRange;if(t==="range"){s=Math.min(o,Math.max(a,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,a=!1;switch(e.stopPropagation(),i){case"min":{r<this.max?(this.min=r,a=!0):t.value=this.min;break}case"max":{r>this.min?(this.max=r,a=!0):t.value=this.max;break}}a&&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 a=Se(this._getStepsConfiguration(),this._sliderData.entries,t,i.direction,i.count);this._setValue(t,a);return}if(oe(e.key)){e.preventDefault();let a=Le(this._getStepsConfiguration(),this._sliderData.entries,t,this._getDirectionForHomeEndKey(e.key));this._setValue(t,a)}}_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:a,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 a!=="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,a=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",!a&&r==="start"?"track-fill":null])),o=t),s>e&&(l.push(this._renderSegment(e,s,[this.mirrored?"track-effective-start":"track-effective-end",!a&&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 a=[...e].sort((s,l)=>s-l);if(a.length===1)switch(t){case"start":if(r<a[0])return this._renderSegment(r,a[0],["track-range"]);break;case"end":if(i>a[0])return this._renderSegment(a[0],i,["track-range"]);break}let o=this.segmentsDraggingDisabled;return this._renderSegment(a[0],a[a.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:a,_fullMax:o,mirrored:s}=this,l=[R(a,o,de(e,a,o)),100-R(a,o,de(t,a,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,a=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:a})} 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(n){return"dataset"in n&&n.tagName==="ARCGIS-LABEL-INPUT"&&(n.dataset.type==="min"||n.dataset.type==="max")}function I(n){let e=J(n,"[data-entry]");return e&&"dataset"in e?e.dataset.entry:null}function He(n){return typeof n!=null&&n!=="range"}function Ne(n,e){return e?n.renderRoot.querySelector(`div[data-entry="${e}"]`):null}function Be(n,e){return e?n.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`):null}function ce(n,e){return e?n.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`):null}function L(n){return n.isPrimary&&n.button===0}var Ue=5;function R(n,e,t){let r=e-n,i=(t-n)/r*100;return Number.parseFloat(i.toFixed(Ue))}function de(n,e,t){return Math.max(e,Math.min(t,n))}Z("arcgis-slider",j);return j},"core/reactiveUtils","applications/Components/reactiveUtils","core/accessorSupport/decorators","core/Accessor","core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{A as s,B as c,C as d,H as p,g as u,i as n,q as h,z as a}from"./
|
|
2
|
+
import{A as s,B as c,C as d,H as p,g as u,i as n,q as h,z as a}from"./3DTJUKC4.js";export default $arcgis.t(([{formatNumber:m}])=>{var _=u`:host{display:block}:host([hidden]){display:none}.content{display:flex;flex-direction:column}.readOnlyLabel{display:block;font-size:var(--calcite-font-size-sm);font-variant-numeric:tabular-nums;line-height:var(--calcite-font-line-height-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:.5rem;padding-block:3px;border-color:var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px);color:var(--calcite-color-text-1)}:host(:not([read-only])) .readOnlyLabel{position:absolute;opacity:0}:host([alignment="start"]){.content{align-items:start}.readOnlyLabel{text-align:start}}:host([alignment="end"]){.content{align-items:end}.readOnlyLabel{text-align:end}}:host([alignment="center"]){.content{align-items:center}.readOnlyLabel{text-align:center}}calcite-button{inline-size:100%;--calcite-offset-invert-focus: 1;--calcite-internal-animation-timing-fast: 0}calcite-input-number{inline-size:100%;--calcite-internal-animation-timing-fast: 0}`,l=class extends c{constructor(){super(...arguments),this._buttonRef=a(),this._inputRef=a(),this._labelRef=a(),this._formatOptions={style:"decimal",useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:2},this._formatValue=t=>m(t,this._formatOptions),this._pointerDownPosition=null,this._displayedValue="",this._editing=!1,this.alignment="center",this.readOnly=!1,this.value=0,this.arcgisChange=h({cancelable:!1})}static{this.properties={_displayedValue:16,_editing:16,alignment:3,editing:39,labelFormatter:0,readOnly:7,value:11}}static{this.styles=_}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}get editing(){return this._editing}async edit(){this._enterEdit()}getLabelBoundingClientRect(){return this._labelRef.value?this._labelRef.value.getBoundingClientRect():this.el.getBoundingClientRect()}willUpdate(t){if(t.has("value")||t.has("labelFormatter")){let e=this.value;this._displayedValue=this._internalLabelFormatter(e)}}updated(t){let e=this._inputRef.value,i=this._buttonRef.value,o=this.renderRoot.querySelector(".readOnlyLabel");if(e&&i&&o){let r=o.offsetWidth;i.style.width=`${r}px`,e.style.width=`${r}px`}}_enterEdit(){this._editing||this.readOnly||(this._editing=!0,this.requestUpdate("editing",!1),this.updateComplete.then(async()=>{let t=this._inputRef.value;await t?.setFocus(),await t?.selectText()}))}_exitEdit(t,e=!1){this._editing&&(t&&this._commitValue(this._inputRef.value),this._displayedValue=this._internalLabelFormatter(this.value),this._inputRef.value&&(this._inputRef.value.value=`${this.value}`),this._editing=!1,this.requestUpdate("editing",!0),e||this.updateComplete.then(async()=>{await this._buttonRef.value?.setFocus()}))}_commitValue(t){let e=this._parseNumber(t?.value??"");e!==null&&this.value!==e&&(this.value=e,this.arcgisChange.emit())}_parseNumber(t){if(t.trim()==="")return null;let e=Number(t);return Number.isFinite(e)?e:this.value??null}_internalLabelFormatter(t){let e=this.labelFormatter;return e?e(t,this._formatValue)??this._formatValue(t):this._formatValue(t)}_onBlur(){this._exitEdit(!0,!0)}_onValueChange(t){this._commitValue(t.currentTarget)}_onKeyDown(t){t.key==="Enter"?(this._exitEdit(!0),t.stopPropagation(),t.preventDefault()):t.key==="Escape"&&(this._exitEdit(!1),t.stopPropagation(),t.preventDefault())}_onPointerDown(t){this._pointerDownPosition={x:t.clientX,y:t.clientY}}_onClick(t){if(this._pointerDownPosition){let e=t.clientX-this._pointerDownPosition.x,i=t.clientY-this._pointerDownPosition.y;if(Math.sqrt(e*e+i*i)>2)return}this._enterEdit(),this._pointerDownPosition=null}_onInput(t){let e=this._parseNumber(t.currentTarget.value??"");if(e===null){this._displayedValue="";return}this._displayedValue=this._internalLabelFormatter(e)}render(){let{alignment:t,_displayedValue:e}=this,i=[n`<span class="readOnlyLabel"><span ${s(this._labelRef)}>${e}</span></span>`];return this.readOnly||i.push(n`<calcite-button .alignment=${t} appearance=transparent .hidden=${this._editing} kind=neutral @pointerdown=${this._onPointerDown} @click=${this._onClick} scale=s width=full ${s(this._buttonRef)}>${e}</calcite-button>`,n`<calcite-input-number .alignment=${t} group-separator .hidden=${!this._editing} number-button-type=none @calciteInputNumberChange=${this._onValueChange} @keydown=${this._onKeyDown} @blur=${this._onBlur} @input=${this._onInput} scale=s status=idle .value=${`${this.value}`} ${s(this._inputRef)}></calcite-input-number>`),n`<div class=${d({content:!0})}>${i}</div>`}};p("arcgis-label-input",l);return l},"intl")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as i}from"./Y2JNAEHH.js";import{a as m}from"./2S7JKSJD.js";import{a as u}from"./
|
|
2
|
+
import{a as i}from"./Y2JNAEHH.js";import{a as m}from"./2S7JKSJD.js";import{a as u}from"./BBZONVIO.js";import{e as g}from"./27FRM3HV.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"./3DTJUKC4.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{B as x,C,E as d,H as v,g as f,i as z,j as m}from"./
|
|
2
|
+
import{B as x,C,E as d,H as v,g as f,i as z,j as m}from"./3DTJUKC4.js";export default $arcgis.t(([w])=>{var M=f`:host{display:block;block-size:30px;inline-size:100%}:host([layout="vertical"]){writing-mode:vertical-lr}.hidden{display:none!important}svg{stroke-width:var(--calcite-border-width-sm);stroke:var(--calcite-color-border-input);margin:0;display:block;block-size:100%;inline-size:100%;padding:0}svg .background{fill:#e0e0e0}`,u=class{constructor(i,s,e,a){this.color=i,this.ratio=s,this.opacity=e,this.sizeRatio=a}},D=new w([0,0,0,.5]),I=class extends x{constructor(){super(...arguments),this._minSizeRatio=.2,this._rampStops=[],this._containerDimensions=[0,0],this.layout="horizontal",this.min=0,this.max=1,this.stops=[]}static{this.properties={_containerDimensions:16,layout:3,min:9,max:9,stops:0}}static{this.styles=M}willUpdate(i){if(super.willUpdate(i),i.has("min")||i.has("max")||i.has("stops")){let{stops:s,min:e,max:a}=this,r=a-e,o=s.map(n=>n.size??0),c=Math.min(...o),l=Math.max(...o)-c,t=s.map(n=>{let{color:h,value:g,size:$}=n,y=h instanceof w?h:w.fromString(h)??D,b=(g-e)/r;return new u(y.toCss(),b,y.a,$?($-c)/l:void 0)});if(t[0].ratio!==0){let{color:n,opacity:h,sizeRatio:g}=t[0];t.unshift(new u(n,0,h,g))}if(t[t.length-1].ratio!==0){let{color:n,opacity:h,sizeRatio:g}=t[t.length-1];t.push(new u(n,1,h,g))}this._rampStops=t}}loaded(){let i=new ResizeObserver(a=>{for(let r of a){let{width:o,height:c}=r.contentRect;this._containerDimensions=[o,c]}}),{width:s,height:e}=this.el.getBoundingClientRect();this._containerDimensions=[s,e],i.observe(this.el)}render(){let i=this._rampStops,[s,e]=this._containerDimensions,a=this.layout==="horizontal",r="rampFillId",o="rampBackgroundFillId",c=R(i),l=[];if(s>0&&e>0)if(c){let t=S(this.layout,s,e,i,this._minSizeRatio);l.push(m`<path fill=${`url(#${o})`} d=${t??d} />`,m`<path fill=${`url(#${r})`} d=${t??d} />`)}else l.push(m`<rect fill=${`url(#${o})`} height=100% width=100% x=0 y=0 />`,m`<rect fill=${`url(#${r})`} height=100% width=100% x=0 y=0 />`);return z`<svg xmlns=http://www.w3.org/2000/svg>${m`<defs><linearGradient id=${r} x1=0 x2=${a?1:0} y1=${a?0:1} y2=0>${i.map(({ratio:t,color:n,opacity:h})=>m`<stop offset=${`${(t*100).toFixed(2)}%`} stop-color=${n??d} stop-opacity=${h??d} />`)}</linearGradient><pattern height=15 id=${o} patternUnits=userSpaceOnUse width=15 x=0 y=0><image height=15 href=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaGVpZ2h0PSIxNiIgd2lkdGg9IjE2Ij48cGF0aCBkPSJNMCAwIEw4IDAgTDggOCBMMCA4IFoiIGZpbGw9IiNjY2MiIC8+PHBhdGggZD0iTTAgMCBMOCAwIEw4IDggTDAgOCBaIiBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLDgpIiAvPjxwYXRoIGQ9Ik0wIDAgTDggMCBMOCA4IEwwIDggWiIgZmlsbD0iI2NjYyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOCw4KSIgLz48cGF0aCBkPSJNMCAwIEw4IDAgTDggOCBMMCA4IFoiIGZpbGw9IiNmZmYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDgsMCkiIC8+PC9zdmc+ width=15 x=0 y=0 /></pattern></defs><rect class=${C({background:!0})} height=100% width=100% x=0 y=0 />${l}`}</svg>`}};function R(p){return p.every(i=>i.sizeRatio!==void 0)}function S(p,i,s,e,a){let r=o=>(1-a)*o+a;if(p==="horizontal"){let o=e.map(({ratio:c,sizeRatio:l})=>{let t=c*i,n=s-r(l)*s;return`L ${t} ${n}`});return`M 0 ${s} ${o.join(" ")} L ${i} ${s} Z`}else{let o=e.map(({ratio:c,sizeRatio:l})=>{let t=s-c*s;return`L ${r(l)*i} ${t}`});return`M 0 ${s} ${o.join(" ")} L 0 0 Z`}}v("arcgis-ramp-color",I);return I},"Color")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as g}from"./GZUZQYY5.js";import{a as k}from"./2S7JKSJD.js";import{a as C}from"./PXWJ4MH5.js";import{a as B}from"./EEAXLMIO.js";import{b as x}from"./MM72P2XC.js";import"./27FRM3HV.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"./GDXLMK6P.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};
|
|
2
|
+
import{a as g}from"./GZUZQYY5.js";import{a as k}from"./2S7JKSJD.js";import{a as C}from"./BBZONVIO.js";import{a as B}from"./UHASKQLX.js";import{b as x}from"./QNSC463B.js";import"./27FRM3HV.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"./3DTJUKC4.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as f}from"./2S7JKSJD.js";import{a as k}from"./PXWJ4MH5.js";import{a as B}from"./EEAXLMIO.js";import{b as C}from"./MM72P2XC.js";import"./27FRM3HV.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"./GDXLMK6P.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")
|
|
2
|
+
import{a as f}from"./2S7JKSJD.js";import{a as k}from"./BBZONVIO.js";import{a as B}from"./UHASKQLX.js";import{b as C}from"./QNSC463B.js";import"./27FRM3HV.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"./3DTJUKC4.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")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{c as $,f as k}from"./27FRM3HV.js";import{I as N,a as C,b as L,c as m,d as f,e as P,f as O,m as g,p as v,r as w}from"./
|
|
2
|
+
import{c as $,f as k}from"./27FRM3HV.js";import{I as N,a as C,b as L,c as m,d as f,e as P,f as O,m as g,p as v,r as w}from"./3DTJUKC4.js";var _=t=>(...s)=>{let o=f(),e=new t(...s),r=e.exports;m(o.at(-1));let n=e.component.manager;n.W(e,r),e.watchExports(n.W.bind(n,e)),P(e);let a=[e.component,...o].reverse();return v(a,i=>i===void 0?void 0:j(e,i,r),r)},j=(t,{host:s,key:o,isReactive:e},r)=>{let n=s,a=n[o]!==t.exports,i=n[o]!==r,c=r!==t.exports;if(a&&!i&&c&&(n[o]=t.exports),s===t.component){if(e){let l=t.component.manager;i&&l.W(t,n[o]),t.onUpdate(u=>{if(u.has(o)){let x=n[o];x!==t.exports&&l.W(t,x)}})}t.O=e?void 0:o}let d=t.component.constructor.elementProperties.get(o)?.readOnly;t.watchExports(()=>{n[o]!==t.exports&&(d?O(()=>{n[o]=t.exports}):n[o]=t.exports)})};var z="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),M=new Set(z),h="en",U={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},F=async(t,s,o="")=>{let e=`${s}/${o}`,r=`${e}${t}.json`;return b[r]??(b[r]=A(t,e)),await b[r]},b={},A=async(t,s)=>{let o=`${s}${t}.json`;try{let e=await fetch(o);if(e.ok)return await e.json()}catch(e){return g("error","intl",`An unknown error occurred while fetching localization strings at ${o}`,{detail:{error:e}}),{}}return t===h?{}:await A(h,s)},y=t=>{let s=k(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:T(s)}},T=t=>{let[s,o]=t.split("-"),e=s.toLowerCase(),r=e;return o&&(r=`${e}-${o.toUpperCase()}`),r=U[r]??r,M.has(r)?r:o?T(e):h},D=(t,s,o,e)=>{let r,n=()=>K(t,s(),e).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&o(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),$(t,["lang"],n)},K=async(t,s,o=t.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:r}=y(t),n=`${s}/${o}/t9n`,i=o===null?{}:await F(r,n,"messages.");return{lang:e,t9nLocale:r,t9nStrings:i}};var W=t=>I(void 0,t);var E=class extends w{constructor(s,o){super(s);let e=this.exports;try{L(this.component);let r=o(this.component,this),n=this.exports!==e;if(C(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},I=_(E);var S=t=>(s={})=>W((o,e)=>{let r=y(o.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=o;e.onLifecycle(()=>D(o.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:p,lang:d})=>{let l={...p,_lang:d,_t9nLocale:c,_loading:!1};e.exports=l;let u=p.componentLabel;typeof u=="string"&&"label"in o&&o.label==null&&(o.label??=u),i(a.messageOverrides)},s.name));let i=c=>{let p=e.exports,d=p._original??p,l=V(d,c);c&&(l._original=d),e.exports=l};return"messageOverrides"in a&&e.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(e.setProvisionalExports(n,!1),e.ready):n}),V=(t,s)=>{if(!s)return t;let o={...t};return Object.entries(s).forEach(([e,r])=>{t[e]!==void 0&&(typeof r=="object"?o[e]=V(t[e],r):o[e]=r??t[e])}),o};var ct=S(N);export{_ as a,ct as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{A as t,B as a,D as r,H as c,g as n,i as o,q as i,z as l}from"./
|
|
2
|
+
import{A as t,B as a,D as r,H as c,g as n,i as o,q as i,z as l}from"./3DTJUKC4.js";var p=n`:host{display:flex}:host([disabled]){opacity:.25;pointer-events:none}button{overflow:hidden;background-color:transparent;align-items:center;border:none;border-radius:0;box-sizing:border-box;cursor:pointer;display:flex;font-family:inherit;gap:var(--calcite-space-sm);height:100%;justify-content:center;outline-color:transparent;outline-offset:0;padding:3px 0;padding-inline:3px var(--calcite-space-sm);position:relative;text-decoration:none;user-select:none;text-align:center;-webkit-appearance:none;width:100%;&:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}&:hover{text-decoration:none}}.preview{border:var(--calcite-border-width-sm) solid #949494;display:flex;align-items:center;flex-grow:1}.container{display:flex;gap:5px;width:100%}::slotted([slot="preview"]){flex-grow:1;display:flex}calcite-icon{color:var(--calcite-color-text-3)}`,s=class extends a{constructor(){super(),this.panelEl=l(),this.open=!1,this.disabled=!1,this.iconEnd="pencil",this.label="",this.arcgisPopoverOpen=i(),this.arcgisPopoverClose=i(),this.listenOn(document.body,"arcgisPopoverOpen",this.onPopoverOpen)}static{this.properties={open:16,disabled:7,heading:1,iconEnd:1,intlDone:1,label:1,popoverProps:0}}static{this.styles=p}async close(){this.onPopoverClose()}async setFocus(){this.buttonEl?.focus()}setPreviewContainerRef(e){this.previewContainerEl=e}setButtonRef(e){this.buttonEl=e}handlePopoverOpen(e){this.panelEl.value.closed=!1,this.arcgisPopoverOpen.emit(),e.stopPropagation()}handlePopoverKeyUp({key:e}){e==="Escape"&&this.onPopoverClose()}onPopoverOpen(e){this.open&&(e.composedPath().includes(this.el)||(this.open=!1))}onPopoverClose(){this.open=!1,this.arcgisPopoverClose.emit(),setTimeout(()=>this.buttonEl?.focus(),300)}handlePanelClose(e){e.stopPropagation(),this.onPopoverClose()}handleButtonClick(){this.open=!this.open,this.open&&setTimeout(()=>{this.panelEl.value?.setFocus()},300)}render(){let{popoverProps:e}=this;return o`<calcite-popover pointer-disabled trigger-disabled @keyup=${this.handlePopoverKeyUp} .label=${this.label} .offsetDistance=${e?.offsetDistance??0} .offsetSkidding=${e?.offsetSkidding??0} .flipDisabled=${e?.flipDisabled??!1} .open=${this.disabled?!1:this.open} .overlayPositioning=${e?.overlayPositioning??"fixed"} .placement=${e?.placement??"bottom"} @calcitePopoverOpen=${this.handlePopoverOpen} .referenceElement=${e?.refElement??this.previewContainerEl}><calcite-panel closable .heading=${this.heading} style=${r(e?.maxHeight?{maxHeight:e.maxHeight}:void 0)} @calcitePanelClose=${this.handlePanelClose} ${t(this.panelEl)}><slot name=content></slot><calcite-button appearance=solid slot=footer width=full .label=${this.intlDone} @click=${this.onPopoverClose}>${this.intlDone}</calcite-button></calcite-panel></calcite-popover><div class="container"><div class="preview" ${t(this.setPreviewContainerRef)}><button .disabled=${this.disabled} @click=${this.handleButtonClick} type=button .ariaLabel=${this.label} ${t(this.setButtonRef)}><slot name=preview></slot>${this.iconEnd?o`<calcite-icon .icon=${this.iconEnd} scale=s></calcite-icon>`:null}</button></div><slot name=content-end></slot></div>`}};c("arcgis-picker-input",s);export{s as ArcgisPickerInput};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{k as r,w as s,x as i,y as o}from"./
|
|
2
|
+
import{k as r,w as s,x as i,y as o}from"./3DTJUKC4.js";var u=s(class extends i{constructor(){super(...arguments),this.key=r}render(t,e){return this.key=t,e}update(t,[e,m]){return e!==this.key&&(o(t),this.key=e),m}});export{u as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as M}from"./3WYIVRKX.js";import{b as E}from"./
|
|
2
|
+
import{a as M}from"./3WYIVRKX.js";import{b as E}from"./QNSC463B.js";import"./27FRM3HV.js";import{B as _,C as f,D as y,E as u,H as D,g as V,i as x,j as d}from"./3DTJUKC4.js";export default $arcgis.t(([{substitute:N}])=>{var p={content:"content",svg:"svg",label:"label",dataLine:"data-line",averageDataLine:"average-data-line",dataLineSymbol:"data-line-symbol"},B=V`:host{display:flex;--arcgis-histogram-bar-color: var(--calcite-color-border-1);--arcgis-histogram-stop-color: color-mix(in srgb, var(--calcite-color-brand) 80%, transparent)}.content{display:flex;flex:1;direction:ltr}.svg{display:inline-block;flex:1;overflow:hidden}.data-line{stroke:#888;stroke-width:1px;shape-rendering:crispEdges}.average-data-line{stroke-width:1px;shape-rendering:crispEdges;stroke:#444}.label,.data-line-symbol{font-size:12px;stroke:#fff;stroke-width:2px;paint-order:stroke;unicode-bidi:plaintext}.data-line-symbol{font-family:"Georgia, serif",sans-serif;font-style:italic}`;function O(e,t,r,n,a){let[i,s]=a;if(!e||s===0||i===0||r==null||t==null)return null;let o=r-t,l=(e.length>1?e[e.length-1].maxValue-e[0].minValue:0)/o,[c,h]=n==="vertical"?[s*l,i]:[s,i*l],b=e?e.map(m=>m.count):[],g=Math.max(...b);return e.map(m=>{let[$,v]=n==="vertical"?[c/e.length,g!==0?m.count/g*h:0]:[g!==0?m.count/g*c:0,h/e.length],{maxValue:C}=m,L=r-C,[z,F]=n==="vertical"?[0,L*(s/o)]:[i-v-L*(i/o),s-$];return[z,F,v,$]})}function A(e,t,r,n,a){let i=[];return e!=null&&i.push({value:e,symbol:"x\u0304",lineClass:p.averageDataLine}),t!=null&&r!=null&&n!=null&&i.push(...U(r,n,t,e)),a&&i.push(...a),i}function P(e,t,r,n,a){if(r==null)return[0,0,0,0];let i=Math.round((a-r)/n*100)/100,[s,o]=e;if(t==="vertical"){let c=o-i*o||1;return c=Math.round(c)+.5,[0,"100%",c,c]}let l=i*s||1;return l=Math.round(l)+.5,[l,l,"100%",0]}function T(e,t,r,n,a){if(r==null)return[0,0];let i=Math.round((a-r)/n*100)/100,[s,o]=e;return t==="vertical"?[s,o-i*o]:[0,i*s]}function R(e,t,r){if(!e||e.length===0)return null;if(I(e)){let n=e.map(a=>({...a,color:S(a.color??r)}));return n.unshift({color:t,minValue:Number.NEGATIVE_INFINITY,maxValue:n[0].minValue}),n.push({color:t,minValue:n[n.length-1].maxValue,maxValue:Number.POSITIVE_INFINITY}),n}else return e.map(n=>({...n,color:S(n.color??r)}))}function G(e,t,r,n){if(!e||e.length===0)return r;if(I(e)){let a=Y(e,t);if(a.length===0)return r;if(n){let{color:i=r,weight:s}=a[0],{color:o=r,weight:l}=a[1]??a[0],c=s+l;return`color-mix(in srgb, ${i} ${s/c*100}%, ${o} ${l/c*100}%)`}return a[0].color??r}return H(e,t)}function Y(e,t){let r=[];for(let n of e){let a=Math.max(0,Math.min(t.maxValue,n.maxValue)-Math.max(t.minValue,n.minValue));a>0&&r.push({color:n.color,weight:a})}return r.sort((n,a)=>a.weight-n.weight)}function H(e,t){let r=(t.maxValue-t.minValue)/2+t.minValue;if(r>e[e.length-1].value)return e[e.length-1].color;for(let n=0;n<e.length-1;n++){let a=e[n],i=e[n+1];if(r<=a.value)return a.color;if(r<i.value){let s=(r-a.value)/(i.value-a.value)*100;return`color-mix(in srgb, ${a.color}, ${i.color} ${s}%)`}}return e[e.length-1].color}function I(e){return e[0]!=null&&"minValue"in e[0]}function S(e){if(typeof e=="string")return e;if(Array.isArray(e))return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]??1})`;let{r:t,g:r,b:n,a=1}=e;return`rgba(${t}, ${r}, ${n}, ${a})`}function U(e,t,r,n){let a=.06*(t-e);return j(r,n).filter(i=>Math.abs(n-i)>a).map((i,s,o)=>{let l=o.length/2,c=i>n?"+":"-",h=s>=l?s-l+1:l-s;return{symbol:`${c}${h===1?"":h}\u03C3`,value:i}})}function j(e,t){if(t==null||e==null)return[];let r=1,n=[];for(let a=r*-1;a<=r;a++)a!==0&&n.push(t+a*e);return n}var k="var(--arcgis-histogram-bar-color)",J="var(--arcgis-histogram-stop-color)",w=class extends _{constructor(){super(...arguments),this._messages=E(),this._normalizedStops=null,this._formatLabel=t=>M(this._messages._lang,this._numberFormatterOptions).format(t),this._numberFormatterOptions={maximumFractionDigits:2},this.containerDimensions=[0,0],this.icon="graph-histogram",this.layout="horizontal",this.colorBlendingEnabled=!1}static{this.properties={containerDimensions:16,colorStops:0,icon:3,average:11,messageOverrides:0,standardDeviation:11,bins:0,dataLines:0,label:1,layout:3,max:11,min:11,colorBlendingEnabled:5}}static{this.styles=B}loaded(){let t=new ResizeObserver(a=>{for(let i of a){let{width:s,height:o}=i.contentRect;this.containerDimensions=[s,o]}}),{width:r,height:n}=this.el.getBoundingClientRect();this.containerDimensions=[r,n],t.observe(this.el)}willUpdate(t){t.has("colorStops")&&(this._normalizedStops=R(this.colorStops,k,J))}render(){let{label:t}=this;return this.containerDimensions?x`<div role=img .ariaLabel=${t??void 0} class=${f(p.content)}>${this._renderContent()}</div>`:null}_renderContent(){let{containerDimensions:[t,r]}=this,n="bg-fill";return x`<svg class=${f(p.svg)} xmlns=http://www.w3.org/2000/svg>${d`<defs><clipPath id=${n}><rect height=${r??u} width=${t??u} x=0 y=0 /></clipPath></defs><g style=${y({clipPath:`url(#${n})`})}><g>${this._renderBars()}</g></g><g>${this._renderLines()}</g>`}</svg>`}_renderBars(){let{bins:t,_messages:r}=this,n=O(this.bins,this.min,this.max,this.layout,this.containerDimensions);return!n||!t?null:n.map((a,i)=>{let[s,o,l,c]=a,h=t[i],b=r?.barLabel?N(r.barLabel,h):"";return d`<rect style=${y({fill:G(this._normalizedStops,h,k,this.colorBlendingEnabled)})} .ariaLabel=${b} data-index=${i??u} height=${c??u} role=img shape-rendering=crispEdges stroke-width=0 width=${l??u} x=${s??u} y=${o??u} />`})}_renderLines(){return A(this.average,this.standardDeviation,this.min,this.max,this.dataLines)?.map(t=>W({dataLine:t,containerDimensions:this.containerDimensions,layout:this.layout,min:this.min,max:this.max,labelFormatter:this._formatLabel}))}},W=e=>{let{containerDimensions:t,layout:r,min:n,max:a,dataLine:i,labelFormatter:s}=e,o=a!=null&&n!=null?a-n:0,[l,c,h,b]=P(t,r,n,o,i.value),[g,m]=T(t,r,n,o,i.value),$="symbol"in i?[d`<tspan class=${f(p.dataLineSymbol)}>${i.symbol}</tspan>`,d`<tspan>${s(i.value)}</tspan>`]:i.label,v="lineClass"in i&&i.lineClass?i.lineClass:p.dataLine;return d`<g><title>${i.value}</title><line class=${f(v)} shape-rendering=crispEdges x1=${l??u} x2=${c??u} y1=${h??u} y2=${b??u} /><text class=${f(p.label)} text-anchor=end transform=${(r==="horizontal"?"rotate(270)":void 0)??u} x=${g??u} y=${m-2}>${$}</text></g>`};D("arcgis-histogram",w);return w},"intl")
|