@arcgis/common-components 5.2.0-next.110 → 5.2.0-next.111

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.
Files changed (101) hide show
  1. package/dist/cdn/{KOQXEMEM.js → 3UH3ZOZB.js} +2 -2
  2. package/dist/cdn/{24BY6E4U.js → 475SP47T.js} +2 -2
  3. package/dist/cdn/{SHMWZ2AY.js → 4JMH3KRC.js} +2 -2
  4. package/dist/cdn/{6YKEQTXQ.js → 4LO2YSUJ.js} +2 -2
  5. package/dist/cdn/{LE43VGSR.js → 4TZVXSQZ.js} +2 -2
  6. package/dist/cdn/{VIUFXHPL.js → 56HK5TL6.js} +2 -2
  7. package/dist/cdn/{B2QFPLR5.js → 5IM4X2GT.js} +1 -1
  8. package/dist/cdn/{H4MYODDU.js → 6HBX6QDQ.js} +2 -2
  9. package/dist/cdn/{IUQEF23H.js → 73ETIJP2.js} +2 -2
  10. package/dist/cdn/{EZH7L65E.js → 7EP7KDAN.js} +2 -2
  11. package/dist/cdn/{NXUTEL5Q.js → 7YNFXAZI.js} +2 -2
  12. package/dist/cdn/{EY5CL247.js → AWK4HGJV.js} +2 -2
  13. package/dist/cdn/{BQD6UQIB.js → DG5IVKVO.js} +2 -2
  14. package/dist/cdn/{D2YGEFGL.js → DRV7OKQT.js} +2 -2
  15. package/dist/cdn/{P6IUT6XO.js → EA5M73N4.js} +2 -2
  16. package/dist/cdn/{F7ZMTKDL.js → EPTZSQ77.js} +2 -2
  17. package/dist/cdn/{ST5VEH7P.js → G2LLGGQQ.js} +2 -2
  18. package/dist/cdn/{ZBSOCWIQ.js → GQ2PO4L4.js} +2 -2
  19. package/dist/cdn/{U2K7ABGL.js → GSQIARZL.js} +2 -2
  20. package/dist/cdn/{CT3ZUD4C.js → HJZA4ZUL.js} +2 -2
  21. package/dist/cdn/{746MUQGB.js → I7CTLPWD.js} +2 -2
  22. package/dist/cdn/{F2XLHROQ.js → ICJXMKTL.js} +2 -2
  23. package/dist/cdn/{73AR55J2.js → J6ZKTXN7.js} +2 -2
  24. package/dist/cdn/{2P3QKSBJ.js → KMYFQIQ7.js} +2 -2
  25. package/dist/cdn/{3YTGG7RF.js → L7XGWJZF.js} +2 -2
  26. package/dist/cdn/{ALOLCOFN.js → LAQNGXPG.js} +2 -2
  27. package/dist/cdn/{KMWJCWRS.js → ND7AQ3X6.js} +2 -2
  28. package/dist/cdn/{3ENYIWMV.js → NNNE4T7L.js} +2 -2
  29. package/dist/cdn/{AHWD5KV4.js → O4H2JR53.js} +1 -1
  30. package/dist/cdn/{ZZGYCYHP.js → OSOV6LK3.js} +2 -2
  31. package/dist/cdn/{NMDESY3T.js → PMV2N3L3.js} +1 -1
  32. package/dist/cdn/{26TPKYHY.js → PQG3COJ4.js} +2 -2
  33. package/dist/cdn/{Q7STPO4U.js → PSVNG2MS.js} +2 -2
  34. package/dist/cdn/{GAXWOAWM.js → PUNWW4GY.js} +2 -2
  35. package/dist/cdn/{KIWPQY6T.js → PWYFUIF6.js} +1 -1
  36. package/dist/cdn/{DICEO27I.js → Q3AMPMQV.js} +2 -2
  37. package/dist/cdn/{B6QUU35R.js → QWRE6ILV.js} +2 -2
  38. package/dist/cdn/{F3UPNSY4.js → RC2HNFFD.js} +2 -2
  39. package/dist/cdn/{BSSCT4Z5.js → SKLYKTDC.js} +2 -2
  40. package/dist/cdn/{P7I4EXSU.js → TKCEZXLC.js} +2 -2
  41. package/dist/cdn/{QJJFF4PI.js → TWW63D32.js} +1 -1
  42. package/dist/cdn/{YJTI6KPW.js → UGWLCTVM.js} +1 -1
  43. package/dist/cdn/{E4NVOXNZ.js → XEK22IDA.js} +1 -1
  44. package/dist/cdn/{D2RCMLMS.js → XMGOCO2S.js} +2 -2
  45. package/dist/cdn/{74MDECVO.js → Y5Y7IXOV.js} +1 -1
  46. package/dist/cdn/{P3DCEHGK.js → Z5QBBHLD.js} +1 -1
  47. package/dist/cdn/Z5SIZJN5.js +2 -0
  48. package/dist/cdn/{GV62Q7D7.js → ZMZH3Z5A.js} +2 -2
  49. package/dist/cdn/index.js +2 -2
  50. package/dist/chunks/element-reference-controller.js +1 -1
  51. package/dist/chunks/general.js +1 -1
  52. package/dist/chunks/internal-types.js +1 -1
  53. package/dist/chunks/layer-utils.js +1 -1
  54. package/dist/chunks/locale.js +1 -1
  55. package/dist/chunks/resources.js +1 -1
  56. package/dist/chunks/runtime.js +1 -1
  57. package/dist/chunks/strategies.js +1 -1
  58. package/dist/chunks/toolbar.js +1 -1
  59. package/dist/chunks/types.js +1 -1
  60. package/dist/chunks/useT9n.js +1 -1
  61. package/dist/chunks/utils.js +1 -1
  62. package/dist/chunks/utils2.js +1 -1
  63. package/dist/chunks/utils3.js +1 -1
  64. package/dist/components/arcgis-ckeditor5/customElement.js +1 -1
  65. package/dist/components/arcgis-ckeditor5-popover/customElement.js +1 -1
  66. package/dist/components/arcgis-color-input/customElement.js +1 -1
  67. package/dist/components/arcgis-coordinate-system-picker/customElement.js +1 -1
  68. package/dist/components/arcgis-coordinate-system-picker-tree/customElement.js +1 -1
  69. package/dist/components/arcgis-field-info/customElement.js +1 -1
  70. package/dist/components/arcgis-field-pick-list/customElement.js +1 -1
  71. package/dist/components/arcgis-histogram/customElement.js +1 -1
  72. package/dist/components/arcgis-label-input/customElement.js +1 -1
  73. package/dist/components/arcgis-picker-input/customElement.js +1 -1
  74. package/dist/components/arcgis-ramp-color/customElement.js +1 -1
  75. package/dist/components/arcgis-ramp-color-break/customElement.js +1 -1
  76. package/dist/components/arcgis-ramp-opacity/customElement.js +1 -1
  77. package/dist/components/arcgis-slider/customElement.js +1 -1
  78. package/dist/components/arcgis-slider-field/customElement.js +1 -1
  79. package/dist/components/arcgis-slider-histogram-range/customElement.js +1 -1
  80. package/dist/components/arcgis-slider-input/customElement.js +1 -1
  81. package/dist/components/arcgis-ticks/customElement.js +1 -1
  82. package/dist/components/arcgis-toolbar/customElement.js +1 -1
  83. package/dist/components/arcgis-toolbar-action/customElement.js +1 -1
  84. package/dist/components/arcgis-toolbar-group/customElement.js +1 -1
  85. package/dist/components/arcgis-toolbar-item/customElement.js +1 -1
  86. package/dist/components/arcgis-toolbar-more-button/customElement.js +1 -1
  87. package/dist/components/arcgis-toolbar-split-button/customElement.js +1 -1
  88. package/dist/components/arcgis-toolbar-stack/customElement.js +1 -1
  89. package/dist/components/arcgis-unique-values-list/customElement.js +1 -1
  90. package/dist/components/arcgis-value-picker/customElement.js +1 -1
  91. package/dist/components/arcgis-value-picker-collection/customElement.js +1 -1
  92. package/dist/components/arcgis-value-picker-combobox/customElement.js +1 -1
  93. package/dist/components/arcgis-value-picker-label/customElement.js +1 -1
  94. package/dist/components/arcgis-value-picker-slider/customElement.js +1 -1
  95. package/dist/docs/api.json +1 -1
  96. package/dist/docs/docs.json +1 -1
  97. package/dist/docs/web-types.json +1 -1
  98. package/dist/index.js +1 -1
  99. package/dist/loader.js +1 -1
  100. package/package.json +4 -4
  101. package/dist/cdn/BGN6KRHS.js +0 -2
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
- import{a as o}from"./BGN6KRHS.js";import{e as n}from"./ALOLCOFN.js";import"./QJJFF4PI.js";import{L as r,R as l,h as c,j as i}from"./KIWPQY6T.js";var h=c`:host{align-items:center;display:flex;flex:auto;min-width:300px;padding-inline:var(--calcite-space-sm);--calcite-color-border-input: var(--calcite-color-border-3)}calcite-combobox{flex:auto;width:var(--calcite-space-none)}`,a=class extends r{constructor(){super(...arguments),this.messages=o({blocking:!0}),this.autoDestroyDisabled=!1,this.disabled=!1,this.canNext=!1,this.canPlay=!1,this.canPrevious=!1,this.arcgisPropertyChange=n()("canNext","canPlay","canPrevious","currentValue")}static{this.properties={autoDestroyDisabled:5,disabled:5,items:0,currentValue:0,canNext:5,canPlay:5,canPrevious:5}}static{this.styles=h}async destroy(){await this.manager.destroy()}reset(){this.currentValue=this.items?.[0]}step(e){if(!this.items||!this.currentValue)return;let t=this.items.findIndex(({value:s})=>s===this.currentValue?.value)+(e==="next"?1:-1);t>=this.items.length||t<0||(this.currentValue=this.items[t],this._checkState())}connectedCallback(){super.connectedCallback(),this.el.hidden=!0}willUpdate(e){(e.has("currentValue")||e.has("items"))&&this.items?.length&&(this.currentValue??=this.items[0]),this.el.hidden=!this.items?.length,this._checkState()}_checkState(){if(!this.items?.length){this.canPlay=!1,this.canNext=!1,this.canPrevious=!1;return}this.canPlay=!0;let e=this.items.findIndex(({value:t})=>t===this.currentValue?.value);this.canNext=e<this.items.length-1,this.canPrevious=e>0}render(){return i`<calcite-combobox .disabled=${this.disabled} selection-mode=single .label=${this.messages.comboboxLabel} @calciteComboboxChange=${({currentTarget:e})=>{let t=e.selectedItems[0]?.value;this.currentValue=this.items?.find(({value:s})=>s===t),this._checkState()}}>${this.items?.map(e=>i`<calcite-combobox-item .value=${e.value} .heading=${e.label} .selected=${e.value===this.currentValue?.value}></calcite-combobox-item>`)}</calcite-combobox>`}};l("arcgis-value-picker-combobox",a);export{a as ArcgisValuePickerCombobox};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as o}from"./Z5SIZJN5.js";import{e as n}from"./LAQNGXPG.js";import"./TWW63D32.js";import{L as r,R as l,h as c,j as i}from"./PWYFUIF6.js";var h=c`:host{align-items:center;display:flex;flex:auto;min-width:300px;padding-inline:var(--calcite-space-sm);--calcite-color-border-input: var(--calcite-color-border-3)}calcite-combobox{flex:auto;width:var(--calcite-space-none)}`,a=class extends r{constructor(){super(...arguments),this.messages=o({blocking:!0}),this.autoDestroyDisabled=!1,this.disabled=!1,this.canNext=!1,this.canPlay=!1,this.canPrevious=!1,this.arcgisPropertyChange=n()("canNext","canPlay","canPrevious","currentValue")}static{this.properties={autoDestroyDisabled:5,disabled:5,items:0,currentValue:0,canNext:5,canPlay:5,canPrevious:5}}static{this.styles=h}async destroy(){await this.manager.destroy()}reset(){this.currentValue=this.items?.[0]}step(e){if(!this.items||!this.currentValue)return;let t=this.items.findIndex(({value:s})=>s===this.currentValue?.value)+(e==="next"?1:-1);t>=this.items.length||t<0||(this.currentValue=this.items[t],this._checkState())}connectedCallback(){super.connectedCallback(),this.el.hidden=!0}willUpdate(e){(e.has("currentValue")||e.has("items"))&&this.items?.length&&(this.currentValue??=this.items[0]),this.el.hidden=!this.items?.length,this._checkState()}_checkState(){if(!this.items?.length){this.canPlay=!1,this.canNext=!1,this.canPrevious=!1;return}this.canPlay=!0;let e=this.items.findIndex(({value:t})=>t===this.currentValue?.value);this.canNext=e<this.items.length-1,this.canPrevious=e>0}render(){return i`<calcite-combobox .disabled=${this.disabled} selection-mode=single .label=${this.messages.comboboxLabel} @calciteComboboxChange=${({currentTarget:e})=>{let t=e.selectedItems[0]?.value;this.currentValue=this.items?.find(({value:s})=>s===t),this._checkState()}}>${this.items?.map(e=>i`<calcite-combobox-item .value=${e.value} .heading=${e.label} .selected=${e.value===this.currentValue?.value}></calcite-combobox-item>`)}</calcite-combobox>`}};l("arcgis-value-picker-combobox",a);export{a as ArcgisValuePickerCombobox};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
- import{e as w,g as x,o as E,p as D}from"./P3DCEHGK.js";import{a as B,b as f,c as T}from"./BSSCT4Z5.js";import{a as A}from"./BGN6KRHS.js";import"./ALOLCOFN.js";import"./QJJFF4PI.js";import{a as C}from"./D2YGEFGL.js";import{J as R,K as U,L as H,R as _,h as O,j as Z,o as $,p as F,t as I}from"./KIWPQY6T.js";export default $arcgis.t(([{formatDate:N,convertDateFormatToIntlOptions:y,formatDateOnly:ie,formatTimeOnly:se,formatTimestamp:M,formatNumber:ae},ne,K,{clone:S}])=>{function W(i){return new Date(`1970-01-01T${i}Z`).getTime()}function P(i){return new Date(`${i} 00:00:00`).getTime()}function oe(i,e,s){let t;return e==="unknown"?t=N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):t=N(i,{...y("short-date-short-time"),timeZone:e}),t}function le(i){return i?ie(i,y("short-date")):""}function re(i){let e;return typeof i=="string"?e=se(i,y("short-date-long-time")):e=N(i,{...y("long-time"),timeZone:"utc"}),e}function ue(i,e){return typeof i=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?M(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):M(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):N(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function j(i,e,s){if(!w(i)&&!D(i)&&!E(i)&&!x(i))return;let t;return T(i,s).fields.forEach(l=>{let a=l.name,c="domain"in l?l.domain:void 0;if(!x(i)&&i.subtypeField===a){let m;E(i)||w(i)?m=i.subtypes:m=i.parent.subtypes,m.forEach(r=>{D(i)&&i.subtypeCode!==r.code||(e.name===a&&(t=t||[],t.push({code:r.code,name:r.name})),r.domains&&Object.keys(r.domains).forEach(n=>{if(e.name===n){let o=r.domains[n];o?.type==="coded-value"&&o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t=t||[],t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push({code:u.code,name:u.name})})}}))})}if(e.name===a&&(w(i)||x(i))){let m=w(i)?i.typeIdField:void 0,r=w(i)?i.types:void 0;w(i)&&m&&r?(m===a?t=r.map(n=>({code:n.id,name:n.name})):(t=t||[],r.forEach(n=>{if(!n.domains?.[a]||n.domains[a].type==="inherited"){let o=c;o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push(S(u))})}else n.domains?.[a]?.codedValues&&n.domains[a].codedValues.forEach(o=>{let u=!1;t.forEach(d=>{d.code===o.code&&(u=!0,`| ${d.name} |`.includes(`| ${o.name} |`)||(d.name+=` | ${o.name}`))}),u||t.push(S(o))})})),!t?.length&&c?.codedValues&&(t=S(c.codedValues))):c?.codedValues&&(t=c.codedValues)}}),t}function L(i,e){let s=e;if(s){let t="";for(let l=0;l<s.length;l++){let a=s[l];a.code==i&&(t+=(t.length?" | ":"")+a.name)}return t.length||(t=`${i}`),t}return i}function G(i){return["small-integer","big-integer","integer","single","double","long"].includes(i.type)}function J(i){switch(i.type){case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":return"number";case"blob":case"geometry":case"global-id":case"guid":case"oid":case"raster":case"xml":return;default:return i.type}}var de=O`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`,k=class extends H{constructor(){super(...arguments),this.dropdownNode=R(),this.initialized=!1,this._messages=A({blocking:!0}),this._propWatcherTask=new B(this,{task:async([e,s,t])=>{let l=f(e)&&f(s)||f(t);if(!f(t)&&!f(e)&&!f(s)?$("error",this,F("uniqueValues")):f(t)||(f(e)||$("error",this,F("layer")),f(s)||$("error",this,F("fieldName"))),f(e)&&f(s)){let{visualizationSource:a}=this;if(!T(e,a).fields?.filter(c=>c.name===s))throw $("error",this,"Field could not be found."),new Error}if(!l)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName,this.uniqueValues]}),this.initialRender=!0,this.multiple=!1,this.partialUniqueValues=!1,this.showFilterLength=10,this.arcgisChange=I(),this.arcgisSortByChange=I(),this.arcgisLoad=I()}static{this.properties={initialRender:16,view:0,layer:0,visualizationSource:1,fieldName:1,uniqueValues:0,numberFormatOptions:0,selectedValues:0,sortBy:1,multiple:5,partialUniqueValues:5,showFilterLength:9,maxHeight:9}}static{this.styles=de}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(f(e?.uniqueValueInfos)){let{uniqueValueInfos:s,partialUniqueValues:t}=e;return{uniqueValues:s,partialUniqueValues:t}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}willUpdate(e){this.initialized&&(e.has("layer")||e.has("visualizationSource")||e.has("fieldName")||e.has("uniqueValues"))&&this.processProps().then(()=>this.requestUpdate()),e.has("maxHeight")&&this.maxHeight&&this.listNode?.setAttribute("style",`max-height: ${this.maxHeight||400}px`)}async processProps(){let{layer:e,fieldName:s,view:t,visualizationSource:l}=this,a=(e?T(e,l):void 0)?.fields?.filter(c=>c.name===s)?.[0];if(!a){$("error",this,`Field '${s}' not found in layer`),this.fieldInfo={layerField:a,fieldDomains:void 0,simpleType:void 0,partialUniqueValues:!1,uniqueValueInfos:[]};return}if(f(this.uniqueValues))this.fieldInfo={layerField:a,fieldDomains:e&&a?j(e,a,l):void 0,simpleType:e&&a?J(a):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&a){this.fieldInfo={layerField:a,fieldDomains:j(e,a,l),simpleType:J(a),partialUniqueValues:!1};let{fieldInfo:c}=this;try{let m=await ne({layer:e,view:t,field:s,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:l==="feature-reduction"}),r=G(a),n=m.uniqueValueInfos.filter(o=>f(o.value)?a.type==="string"&&!r||a.type==="guid"?o.value!=="<Null>"&&`${o.value}`.trim()!=="":(G(a)||a.type,o.value!=="<Null>"&&o.value!==""):!1);n.sort((o,u)=>o.count>u.count?-1:o.count<u.count?1:0),c.fieldDomains?.length&&c.fieldDomains.forEach(o=>{n.find(u=>u.value===o.code)||n.push({value:o.code,count:0})}),c.uniqueValueInfos=n,c.partialUniqueValues=m.uniqueValueInfos.length===2e3,this.initialized||this.arcgisLoad.emit(),this.setUpTimeZoneHandle(),this.initialized=!0}catch(m){if($("error",this,`uniqueValues() - ${m.message}`),this.hasFieldDomains(c)){let r=[];c.fieldDomains.forEach(n=>{r.find(o=>o.value===n.code)||r.push({value:n.code,count:void 0})})}this.initialized=!0}setTimeout(()=>{this.initialRender=!1,this.listNode?.setFocus()},800)}}setListRef(e){let{maxHeight:s}=this;this.listNode=e,s&&e?.setAttribute("style",`max-height: ${s||400}px`)}onSortMenuSelect(e){let s=e.currentTarget.selectedItems?.[0].getAttribute("data-value");this.sortBy=s||void 0,this.arcgisSortByChange.emit(s||void 0)}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{view:e,fieldInfo:s}=this;s.simpleType&&["date","timestamp-offset"].includes(s.simpleType)&&(this.timeZoneHandle=K.watch(()=>e?.timeZone,()=>this.requestUpdate()))}isSameLists(e,s){if(!e&&!s)return!0;if(!e||!s||e?.length!==s?.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==s[t])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:s,sortBy:t,multiple:l,initialRender:a,showFilterLength:c,_messages:m}=this,{fieldDomains:r,uniqueValueInfos:n,partialUniqueValues:o,layerField:u}=e,d=u?.type;if(!n?.length)return"";let g=d?["small-integer","big-integer","integer","single","double","long","oid"].includes(d):!1,Q=d?["date","date-only","time-only"].includes(d):!1,X=v=>{v.sort((h,p)=>h.count<=p.count?1:-1)},Y=v=>{let h=r?.length;v.sort((p,V)=>{if(!h&&g)return(typeof p.value=="string"?Number.parseFloat(p.value):p.value)-(typeof V.value=="string"?Number.parseFloat(V.value):V.value);{let q=h?L(p.value,r):p.label??p.value,b=h?L(V.value,r):V.label??V.value;return`${q}`.startsWith("_")?1:`${b}`.startsWith("_")?-1:`${q}`.localeCompare(`${b}`)}})},ee=(v,h)=>{v.sort((p,V)=>{let q=h?.indexOf(p.value)??-1,b=h?.indexOf(V.value)??-1;return q===b||q>-1&&b>-1?0:q>b?-1:1})};Y(n),!t||t==="count"?X(n):t==="selected"&&ee(n,s);let te=n.map(v=>this.renderUniqueValue(v)),z;return o&&!a&&(z=Z`<div class="unique-values-content-list-msg">${m.errors.tooManyUniqueValues}</div>`),Z`<div class="container"><calcite-list .label=${m.values} class="popover-unique-list" .filterEnabled=${n.length>=c} .selectionMode=${l?"multiple":"single"} .filterPlaceholder=${m.searchValues} @calciteListChange=${v=>{let h=v.currentTarget.selectedItems.map(p=>p.value);!r&&d==="date-only"?h=h?.map(p=>P(p)):!r&&d==="time-only"?h=h?.map(p=>W(p)):d&&["date","oid","small-integer","big-integer","integer","long"].includes(d)?h=h?.map(p=>Number.parseInt(p)):d&&["single","double"].includes(d)&&(h=h?.map(p=>Number.parseFloat(p))),!this.isSameLists(h,this.selectedValues)&&(this.selectedValues=h,this.arcgisChange.emit(h))}} @calciteListFilter=${()=>{this.dropdownNode.value&&(this.dropdownNode.value.disabled=this.listNode.filteredItems.length<4)}} ${U(this.setListRef)}>${n.length>=c&&!a?this.renderSort(g,Q):null}${te}</calcite-list>${z}</div>`},error:()=>""})}renderSort(e,s){let{sortBy:t,_messages:l}=this;return Z`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${U(this.dropdownNode)}><calcite-action slot=trigger .label=${l.sortValues} text><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${t==="count"||!f(t)} data-value=count>${l.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="name"} data-value=name>${e||s?l.sortAscending:l.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="selected"} data-value=selected>${l.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:s,initialRender:t,view:l,fieldInfo:a,numberFormatOptions:c}=this,{fieldDomains:m,uniqueValueInfos:r,simpleType:n}=a,o=l&&"timeZone"in l&&l.timeZone||"system",u=m?.length?L(e.value,m):n==="date"?oe(e.value,o):n==="date-only"?le(e.value):n==="time-only"?re(e.value):n==="timestamp-offset"?ue(e.value,l):typeof e.value=="number"?ae(e.value,c):e.label??e.value,d=s?n==="date-only"?s.includes(m?.length?e.value:P(e.value)):n==="time-only"?s.includes(m?.length?e.value:W(e.value)):s.includes(e.value):!1;return C(`list-item_${e.value}`,Z`<calcite-list-item .label=${`${u}`} .value=${`${e.value}`} .selected=${d}>${f(e.count)&&(r.length>200&&!t||r.length<=200)?Z`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};_("arcgis-unique-values-list",k);return k},"intl","smartMapping/statistics/uniqueValues","core/reactiveUtils","core/lang")
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{e as w,g as x,o as E,p as D}from"./Z5QBBHLD.js";import{a as B,b as f,c as T}from"./SKLYKTDC.js";import{a as A}from"./Z5SIZJN5.js";import"./LAQNGXPG.js";import"./TWW63D32.js";import{a as C}from"./DRV7OKQT.js";import{J as R,K as U,L as H,R as _,h as O,j as Z,o as $,p as F,t as I}from"./PWYFUIF6.js";export default $arcgis.t(([{formatDate:N,convertDateFormatToIntlOptions:y,formatDateOnly:ie,formatTimeOnly:se,formatTimestamp:M,formatNumber:ae},ne,K,{clone:S}])=>{function W(i){return new Date(`1970-01-01T${i}Z`).getTime()}function P(i){return new Date(`${i} 00:00:00`).getTime()}function oe(i,e,s){let t;return e==="unknown"?t=N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):t=N(i,{...y("short-date-short-time"),timeZone:e}),t}function le(i){return i?ie(i,y("short-date")):""}function re(i){let e;return typeof i=="string"?e=se(i,y("short-date-long-time")):e=N(i,{...y("long-time"),timeZone:"utc"}),e}function ue(i,e){return typeof i=="string"?e&&"timeZone"in e&&e.timeZone==="unknown"?M(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):M(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"}):e&&"timeZone"in e&&e.timeZone==="unknown"?N(i,{...y("short-date-short-time"),timeZone:"utc",timeZoneName:"shortOffset"}):N(i,{...y("short-date-short-time"),timeZone:e&&"timeZone"in e&&e.timeZone?e.timeZone:"system"})}function j(i,e,s){if(!w(i)&&!D(i)&&!E(i)&&!x(i))return;let t;return T(i,s).fields.forEach(l=>{let a=l.name,c="domain"in l?l.domain:void 0;if(!x(i)&&i.subtypeField===a){let m;E(i)||w(i)?m=i.subtypes:m=i.parent.subtypes,m.forEach(r=>{D(i)&&i.subtypeCode!==r.code||(e.name===a&&(t=t||[],t.push({code:r.code,name:r.name})),r.domains&&Object.keys(r.domains).forEach(n=>{if(e.name===n){let o=r.domains[n];o?.type==="coded-value"&&o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t=t||[],t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push({code:u.code,name:u.name})})}}))})}if(e.name===a&&(w(i)||x(i))){let m=w(i)?i.typeIdField:void 0,r=w(i)?i.types:void 0;w(i)&&m&&r?(m===a?t=r.map(n=>({code:n.id,name:n.name})):(t=t||[],r.forEach(n=>{if(!n.domains?.[a]||n.domains[a].type==="inherited"){let o=c;o?.codedValues&&o.codedValues.forEach(u=>{let d=!1;t.forEach(g=>{g.code===u.code&&(d=!0,`| ${g.name} |`.includes(`| ${u.name} |`)||(g.name+=` | ${u.name}`))}),d||t.push(S(u))})}else n.domains?.[a]?.codedValues&&n.domains[a].codedValues.forEach(o=>{let u=!1;t.forEach(d=>{d.code===o.code&&(u=!0,`| ${d.name} |`.includes(`| ${o.name} |`)||(d.name+=` | ${o.name}`))}),u||t.push(S(o))})})),!t?.length&&c?.codedValues&&(t=S(c.codedValues))):c?.codedValues&&(t=c.codedValues)}}),t}function L(i,e){let s=e;if(s){let t="";for(let l=0;l<s.length;l++){let a=s[l];a.code==i&&(t+=(t.length?" | ":"")+a.name)}return t.length||(t=`${i}`),t}return i}function G(i){return["small-integer","big-integer","integer","single","double","long"].includes(i.type)}function J(i){switch(i.type){case"small-integer":case"big-integer":case"integer":case"single":case"double":case"long":return"number";case"blob":case"geometry":case"global-id":case"guid":case"oid":case"raster":case"xml":return;default:return i.type}}var de=O`:host{width:100%}.container{min-height:30px}.popover-unique-list{width:100%;overflow-y:auto}.unique-values-content-list-msg{font-size:75%;margin:5px}.count{padding:0 6px;font-size:smaller;white-space:nowrap}`,k=class extends H{constructor(){super(...arguments),this.dropdownNode=R(),this.initialized=!1,this._messages=A({blocking:!0}),this._propWatcherTask=new B(this,{task:async([e,s,t])=>{let l=f(e)&&f(s)||f(t);if(!f(t)&&!f(e)&&!f(s)?$("error",this,F("uniqueValues")):f(t)||(f(e)||$("error",this,F("layer")),f(s)||$("error",this,F("fieldName"))),f(e)&&f(s)){let{visualizationSource:a}=this;if(!T(e,a).fields?.filter(c=>c.name===s))throw $("error",this,"Field could not be found."),new Error}if(!l)throw new Error;await this.processProps(),this._propWatcherTask.autoRun=!1},args:()=>[this.layer,this.fieldName,this.uniqueValues]}),this.initialRender=!0,this.multiple=!1,this.partialUniqueValues=!1,this.showFilterLength=10,this.arcgisChange=I(),this.arcgisSortByChange=I(),this.arcgisLoad=I()}static{this.properties={initialRender:16,view:0,layer:0,visualizationSource:1,fieldName:1,uniqueValues:0,numberFormatOptions:0,selectedValues:0,sortBy:1,multiple:5,partialUniqueValues:5,showFilterLength:9,maxHeight:9}}static{this.styles=de}async setFocus(){this.listNode?.setFocus()}async getUniqueValues(){let{fieldInfo:e}=this;if(f(e?.uniqueValueInfos)){let{uniqueValueInfos:s,partialUniqueValues:t}=e;return{uniqueValues:s,partialUniqueValues:t}}}loaded(){this.layer&&this.fieldInfo&&(setTimeout(()=>this.initialRender=!1,800),this.listNode?.setFocus())}willUpdate(e){this.initialized&&(e.has("layer")||e.has("visualizationSource")||e.has("fieldName")||e.has("uniqueValues"))&&this.processProps().then(()=>this.requestUpdate()),e.has("maxHeight")&&this.maxHeight&&this.listNode?.setAttribute("style",`max-height: ${this.maxHeight||400}px`)}async processProps(){let{layer:e,fieldName:s,view:t,visualizationSource:l}=this,a=(e?T(e,l):void 0)?.fields?.filter(c=>c.name===s)?.[0];if(!a){$("error",this,`Field '${s}' not found in layer`),this.fieldInfo={layerField:a,fieldDomains:void 0,simpleType:void 0,partialUniqueValues:!1,uniqueValueInfos:[]};return}if(f(this.uniqueValues))this.fieldInfo={layerField:a,fieldDomains:e&&a?j(e,a,l):void 0,simpleType:e&&a?J(a):void 0,partialUniqueValues:this.partialUniqueValues??!1,uniqueValueInfos:this.uniqueValues},this.arcgisLoad.emit();else if(e&&a){this.fieldInfo={layerField:a,fieldDomains:j(e,a,l),simpleType:J(a),partialUniqueValues:!1};let{fieldInfo:c}=this;try{let m=await ne({layer:e,view:t,field:s,sqlWhere:"definitionExpression"in e?e.definitionExpression??void 0:void 0,forBinning:l==="feature-reduction"}),r=G(a),n=m.uniqueValueInfos.filter(o=>f(o.value)?a.type==="string"&&!r||a.type==="guid"?o.value!=="<Null>"&&`${o.value}`.trim()!=="":(G(a)||a.type,o.value!=="<Null>"&&o.value!==""):!1);n.sort((o,u)=>o.count>u.count?-1:o.count<u.count?1:0),c.fieldDomains?.length&&c.fieldDomains.forEach(o=>{n.find(u=>u.value===o.code)||n.push({value:o.code,count:0})}),c.uniqueValueInfos=n,c.partialUniqueValues=m.uniqueValueInfos.length===2e3,this.initialized||this.arcgisLoad.emit(),this.setUpTimeZoneHandle(),this.initialized=!0}catch(m){if($("error",this,`uniqueValues() - ${m.message}`),this.hasFieldDomains(c)){let r=[];c.fieldDomains.forEach(n=>{r.find(o=>o.value===n.code)||r.push({value:n.code,count:void 0})})}this.initialized=!0}setTimeout(()=>{this.initialRender=!1,this.listNode?.setFocus()},800)}}setListRef(e){let{maxHeight:s}=this;this.listNode=e,s&&e?.setAttribute("style",`max-height: ${s||400}px`)}onSortMenuSelect(e){let s=e.currentTarget.selectedItems?.[0].getAttribute("data-value");this.sortBy=s||void 0,this.arcgisSortByChange.emit(s||void 0)}setUpTimeZoneHandle(){this.timeZoneHandle?.remove();let{view:e,fieldInfo:s}=this;s.simpleType&&["date","timestamp-offset"].includes(s.simpleType)&&(this.timeZoneHandle=K.watch(()=>e?.timeZone,()=>this.requestUpdate()))}isSameLists(e,s){if(!e&&!s)return!0;if(!e||!s||e?.length!==s?.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==s[t])return!1;return!0}hasFieldDomains(e){return!!e.fieldDomains?.length}render(){return this._propWatcherTask.render({complete:()=>{let{fieldInfo:e,selectedValues:s,sortBy:t,multiple:l,initialRender:a,showFilterLength:c,_messages:m}=this,{fieldDomains:r,uniqueValueInfos:n,partialUniqueValues:o,layerField:u}=e,d=u?.type;if(!n?.length)return"";let g=d?["small-integer","big-integer","integer","single","double","long","oid"].includes(d):!1,Q=d?["date","date-only","time-only"].includes(d):!1,X=v=>{v.sort((h,p)=>h.count<=p.count?1:-1)},Y=v=>{let h=r?.length;v.sort((p,V)=>{if(!h&&g)return(typeof p.value=="string"?Number.parseFloat(p.value):p.value)-(typeof V.value=="string"?Number.parseFloat(V.value):V.value);{let q=h?L(p.value,r):p.label??p.value,b=h?L(V.value,r):V.label??V.value;return`${q}`.startsWith("_")?1:`${b}`.startsWith("_")?-1:`${q}`.localeCompare(`${b}`)}})},ee=(v,h)=>{v.sort((p,V)=>{let q=h?.indexOf(p.value)??-1,b=h?.indexOf(V.value)??-1;return q===b||q>-1&&b>-1?0:q>b?-1:1})};Y(n),!t||t==="count"?X(n):t==="selected"&&ee(n,s);let te=n.map(v=>this.renderUniqueValue(v)),z;return o&&!a&&(z=Z`<div class="unique-values-content-list-msg">${m.errors.tooManyUniqueValues}</div>`),Z`<div class="container"><calcite-list .label=${m.values} class="popover-unique-list" .filterEnabled=${n.length>=c} .selectionMode=${l?"multiple":"single"} .filterPlaceholder=${m.searchValues} @calciteListChange=${v=>{let h=v.currentTarget.selectedItems.map(p=>p.value);!r&&d==="date-only"?h=h?.map(p=>P(p)):!r&&d==="time-only"?h=h?.map(p=>W(p)):d&&["date","oid","small-integer","big-integer","integer","long"].includes(d)?h=h?.map(p=>Number.parseInt(p)):d&&["single","double"].includes(d)&&(h=h?.map(p=>Number.parseFloat(p))),!this.isSameLists(h,this.selectedValues)&&(this.selectedValues=h,this.arcgisChange.emit(h))}} @calciteListFilter=${()=>{this.dropdownNode.value&&(this.dropdownNode.value.disabled=this.listNode.filteredItems.length<4)}} ${U(this.setListRef)}>${n.length>=c&&!a?this.renderSort(g,Q):null}${te}</calcite-list>${z}</div>`},error:()=>""})}renderSort(e,s){let{sortBy:t,_messages:l}=this;return Z`<calcite-dropdown slot=filter-actions-end placement=bottom-end overlay-positioning=fixed @calciteDropdownSelect=${this.onSortMenuSelect} ${U(this.dropdownNode)}><calcite-action slot=trigger .label=${l.sortValues} text><calcite-icon scale=s icon=sortDescending flip-rtl></calcite-icon></calcite-action><calcite-dropdown-group><calcite-dropdown-item .selected=${t==="count"||!f(t)} data-value=count>${l.sortByCount}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="name"} data-value=name>${e||s?l.sortAscending:l.sortAlphabetical}</calcite-dropdown-item><calcite-dropdown-item .selected=${t==="selected"} data-value=selected>${l.sortSelected}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}renderUniqueValue(e){let{selectedValues:s,initialRender:t,view:l,fieldInfo:a,numberFormatOptions:c}=this,{fieldDomains:m,uniqueValueInfos:r,simpleType:n}=a,o=l&&"timeZone"in l&&l.timeZone||"system",u=m?.length?L(e.value,m):n==="date"?oe(e.value,o):n==="date-only"?le(e.value):n==="time-only"?re(e.value):n==="timestamp-offset"?ue(e.value,l):typeof e.value=="number"?ae(e.value,c):e.label??e.value,d=s?n==="date-only"?s.includes(m?.length?e.value:P(e.value)):n==="time-only"?s.includes(m?.length?e.value:W(e.value)):s.includes(e.value):!1;return C(`list-item_${e.value}`,Z`<calcite-list-item .label=${`${u}`} .value=${`${e.value}`} .selected=${d}>${f(e.count)&&(r.length>200&&!t||r.length<=200)?Z`<div class="count" slot=actions-end>${`${e.count}`}</div>`:null}</calcite-list-item>`)}};_("arcgis-unique-values-list",k);return k},"intl","smartMapping/statistics/uniqueValues","core/reactiveUtils","core/lang")
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
- import{a as m}from"./BGN6KRHS.js";import{e as d}from"./ALOLCOFN.js";import{b as r}from"./QJJFF4PI.js";import{L as o,M as h,O as a,R as c,h as n,j as s,t as i}from"./KIWPQY6T.js";var u=n`:host{display:inline-flex;max-inline-size:100%}:host([layout="horizontal"]) slot{min-inline-size:300px;min-block-size:48px}:host([layout="vertical"]) slot{min-inline-size:300px;min-block-size:144px}slot{display:flex}slot.empty{display:none}.container{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1)}.root{display:flex;flex-direction:row;align-items:stretch}calcite-action{width:var(--calcite-font-line-height-fixed-4xl);height:var(--calcite-font-line-height-fixed-4xl)}calcite-action-bar{--calcite-action-bar-items-space: var(--calcite-space-none);--calcite-spacing-sm: var(--calcite-space-none);background-color:var(--calcite-color-foreground-1)}.separator{border-inline-end:solid 1px var(--calcite-color-border-3);width:1px}`,l=class extends o{constructor(){super(),this.messages=m({blocking:!0}),this._isPlaying=!1,this.autoDestroyDisabled=!1,this.disabled=!1,this.hideNextButton=!1,this.hidePlayButton=!1,this.hidePreviousButton=!1,this.icon="list-rectangle",this.label="",this.layout="horizontal",this.loop=!1,this.playRate=1e3,this.arcgisAnimate=i(),this.arcgisNext=i(),this.arcgisPause=i(),this.arcgisPlay=i(),this.arcgisPrevious=i(),this.arcgisPropertyChange=d()("layout","loop","playRate","state"),this.arcgisSlottedElementChange=i(),this.listen("arcgisPropertyChange",()=>this.requestUpdate())}static{this.properties={_isPlaying:16,_slottedElement:16,autoDestroyDisabled:5,disabled:5,hideNextButton:5,hidePlayButton:5,hidePreviousButton:5,icon:1,label:1,layout:3,loop:5,playRate:9,state:32}}static{this.styles=u}get state(){return this._isPlaying?"playing":"ready"}async destroy(){await this.manager.destroy()}next(){this.arcgisNext.emit(),this._slottedElement?.canNext&&this._slottedElement.step("next")}pause(){this._isPlaying=!1,this.arcgisPause.emit()}play(){this._isPlaying||(this._isPlaying=!0,this.arcgisPlay.emit(),this._startPlayRate(!0))}previous(){this.arcgisPrevious.emit(),this._slottedElement?.canPrevious&&this._slottedElement.step("previous")}willUpdate(t){t.has("layout")&&this._isElementWithLayout(this._slottedElement)&&(this._slottedElement.layout=this.layout),t.has("disabled")&&this._isElementWithDisabled(this._slottedElement)&&(this._slottedElement.disabled=this.disabled)}disconnectedCallback(){super.disconnectedCallback(),this._isPlaying&&this.pause()}_handleSlotChange(t){let[e]=r(t);this._slottedElement=e,this.arcgisSlottedElementChange.emit({slottedElement:e}),!e&&this._isPlaying&&this.pause(),this._isElementWithLayout(e)&&(e.layout=this.layout),this._isElementWithDisabled(e)&&(e.disabled=this.disabled),this._isElementWithComponentOnReady(e)&&e.componentOnReady().then(()=>{this._slottedElement===e&&this.requestUpdate()})}_isElementWithComponentOnReady(t){return!!t&&"componentOnReady"in t}_isElementWithLayout(t){return!!t&&"layout"in t}_isElementWithDisabled(t){return!!t&&"disabled"in t}_startPlayRate(t){setTimeout(()=>{if(this._isPlaying){if(!this._slottedElement?.canNext&&this.loop)this._slottedElement?.reset();else if(this._slottedElement?.step("next"),this._slottedElement&&!this._slottedElement?.canNext&&!this.loop){this.pause();return}this.arcgisAnimate.emit({first:t}),this._startPlayRate(!1)}},this.playRate)}render(){let t=!!this._slottedElement&&!this._slottedElement.hidden,e=this.state==="playing";return s`<div class="container"><div class="root"><calcite-action-bar expand-disabled .layout=${this.layout}>${!this.hidePlayButton&&s`<calcite-action alignment=center .disabled=${this.disabled||this._slottedElement&&!this._slottedElement.canPlay} .icon=${e?"pause":"play"} .text=${e?this.messages.pause:this.messages.play} title=${(e?this.messages.pause:this.messages.play)??a} @click=${()=>{if(this._slottedElement&&!this._slottedElement.canNext&&!this.loop){this._slottedElement.reset(),this.play();return}e?this.pause():this.play()}}></calcite-action>`||""}${!this.hidePreviousButton&&s`<calcite-action alignment=center .disabled=${this.disabled||e||this._slottedElement&&!this._slottedElement.canPrevious} .icon=${this.layout==="horizontal"?"chevron-left":"chevron-up"} .text=${this.messages.previous} title=${this.messages.previous??a} @click=${this.previous}></calcite-action>`||""}${!this.hideNextButton&&s`<calcite-action alignment=center .disabled=${this.disabled||e||this._slottedElement&&!this._slottedElement.canNext} .icon=${this.layout==="horizontal"?"chevron-right":"chevron-down"} .text=${this.messages.next} title=${this.messages.next??a} @click=${this.next}></calcite-action>`||""}</calcite-action-bar>${t&&s`<div class="separator"></div>`||""}<slot @slotchange=${({currentTarget:p})=>{this._handleSlotChange(p)}} class=${h(t?"component-slot":"empty")}></slot></div></div>`}};c("arcgis-value-picker",l);export{l as ArcgisValuePicker};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as m}from"./Z5SIZJN5.js";import{e as d}from"./LAQNGXPG.js";import{b as r}from"./TWW63D32.js";import{L as o,M as h,O as a,R as c,h as n,j as s,t as i}from"./PWYFUIF6.js";var u=n`:host{display:inline-flex;max-inline-size:100%}:host([layout="horizontal"]) slot{min-inline-size:300px;min-block-size:48px}:host([layout="vertical"]) slot{min-inline-size:300px;min-block-size:144px}slot{display:flex}slot.empty{display:none}.container{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1)}.root{display:flex;flex-direction:row;align-items:stretch}calcite-action{width:var(--calcite-font-line-height-fixed-4xl);height:var(--calcite-font-line-height-fixed-4xl)}calcite-action-bar{--calcite-action-bar-items-space: var(--calcite-space-none);--calcite-spacing-sm: var(--calcite-space-none);background-color:var(--calcite-color-foreground-1)}.separator{border-inline-end:solid 1px var(--calcite-color-border-3);width:1px}`,l=class extends o{constructor(){super(),this.messages=m({blocking:!0}),this._isPlaying=!1,this.autoDestroyDisabled=!1,this.disabled=!1,this.hideNextButton=!1,this.hidePlayButton=!1,this.hidePreviousButton=!1,this.icon="list-rectangle",this.label="",this.layout="horizontal",this.loop=!1,this.playRate=1e3,this.arcgisAnimate=i(),this.arcgisNext=i(),this.arcgisPause=i(),this.arcgisPlay=i(),this.arcgisPrevious=i(),this.arcgisPropertyChange=d()("layout","loop","playRate","state"),this.arcgisSlottedElementChange=i(),this.listen("arcgisPropertyChange",()=>this.requestUpdate())}static{this.properties={_isPlaying:16,_slottedElement:16,autoDestroyDisabled:5,disabled:5,hideNextButton:5,hidePlayButton:5,hidePreviousButton:5,icon:1,label:1,layout:3,loop:5,playRate:9,state:32}}static{this.styles=u}get state(){return this._isPlaying?"playing":"ready"}async destroy(){await this.manager.destroy()}next(){this.arcgisNext.emit(),this._slottedElement?.canNext&&this._slottedElement.step("next")}pause(){this._isPlaying=!1,this.arcgisPause.emit()}play(){this._isPlaying||(this._isPlaying=!0,this.arcgisPlay.emit(),this._startPlayRate(!0))}previous(){this.arcgisPrevious.emit(),this._slottedElement?.canPrevious&&this._slottedElement.step("previous")}willUpdate(t){t.has("layout")&&this._isElementWithLayout(this._slottedElement)&&(this._slottedElement.layout=this.layout),t.has("disabled")&&this._isElementWithDisabled(this._slottedElement)&&(this._slottedElement.disabled=this.disabled)}disconnectedCallback(){super.disconnectedCallback(),this._isPlaying&&this.pause()}_handleSlotChange(t){let[e]=r(t);this._slottedElement=e,this.arcgisSlottedElementChange.emit({slottedElement:e}),!e&&this._isPlaying&&this.pause(),this._isElementWithLayout(e)&&(e.layout=this.layout),this._isElementWithDisabled(e)&&(e.disabled=this.disabled),this._isElementWithComponentOnReady(e)&&e.componentOnReady().then(()=>{this._slottedElement===e&&this.requestUpdate()})}_isElementWithComponentOnReady(t){return!!t&&"componentOnReady"in t}_isElementWithLayout(t){return!!t&&"layout"in t}_isElementWithDisabled(t){return!!t&&"disabled"in t}_startPlayRate(t){setTimeout(()=>{if(this._isPlaying){if(!this._slottedElement?.canNext&&this.loop)this._slottedElement?.reset();else if(this._slottedElement?.step("next"),this._slottedElement&&!this._slottedElement?.canNext&&!this.loop){this.pause();return}this.arcgisAnimate.emit({first:t}),this._startPlayRate(!1)}},this.playRate)}render(){let t=!!this._slottedElement&&!this._slottedElement.hidden,e=this.state==="playing";return s`<div class="container"><div class="root"><calcite-action-bar expand-disabled .layout=${this.layout}>${!this.hidePlayButton&&s`<calcite-action alignment=center .disabled=${this.disabled||this._slottedElement&&!this._slottedElement.canPlay} .icon=${e?"pause":"play"} .text=${e?this.messages.pause:this.messages.play} title=${(e?this.messages.pause:this.messages.play)??a} @click=${()=>{if(this._slottedElement&&!this._slottedElement.canNext&&!this.loop){this._slottedElement.reset(),this.play();return}e?this.pause():this.play()}}></calcite-action>`||""}${!this.hidePreviousButton&&s`<calcite-action alignment=center .disabled=${this.disabled||e||this._slottedElement&&!this._slottedElement.canPrevious} .icon=${this.layout==="horizontal"?"chevron-left":"chevron-up"} .text=${this.messages.previous} title=${this.messages.previous??a} @click=${this.previous}></calcite-action>`||""}${!this.hideNextButton&&s`<calcite-action alignment=center .disabled=${this.disabled||e||this._slottedElement&&!this._slottedElement.canNext} .icon=${this.layout==="horizontal"?"chevron-right":"chevron-down"} .text=${this.messages.next} title=${this.messages.next??a} @click=${this.next}></calcite-action>`||""}</calcite-action-bar>${t&&s`<div class="separator"></div>`||""}<slot @slotchange=${({currentTarget:p})=>{this._handleSlotChange(p)}} class=${h(t?"component-slot":"empty")}></slot></div></div>`}};c("arcgis-value-picker",l);export{l as ArcgisValuePicker};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
- import{L as l,R as e,h as r,j as a}from"./KIWPQY6T.js";var h=r`:host{display:block;block-size:30px;inline-size:100%}:host([layout="vertical"]){writing-mode:vertical-lr}arcgis-ramp-color{block-size:inherit;inline-size:inherit}`,s=class extends l{constructor(){super(...arguments),this._rampStops=[],this.layout="horizontal",this.min=0,this.max=1,this.stops=[]}static{this.properties={layout:1,min:9,max:9,stops:0}}static{this.styles=h}willUpdate(t){if(super.willUpdate(t),t.has("stops")){let{stops:p}=this,i=[];p.forEach(c=>{let{color:o,max:m,min:n}=c;i.push({value:n,color:o},{value:m,color:o})}),this._rampStops=i}}render(){return a`<arcgis-ramp-color .layout=${this.layout} .min=${this.min} .max=${this.max} .stops=${this._rampStops}></arcgis-ramp-color>`}};e("arcgis-ramp-color-break",s);export{s as ArcgisRampColorBreak};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{L as l,R as e,h as r,j as a}from"./PWYFUIF6.js";var h=r`:host{display:block;block-size:30px;inline-size:100%}:host([layout="vertical"]){writing-mode:vertical-lr}arcgis-ramp-color{block-size:inherit;inline-size:inherit}`,s=class extends l{constructor(){super(...arguments),this._rampStops=[],this.layout="horizontal",this.min=0,this.max=1,this.stops=[]}static{this.properties={layout:1,min:9,max:9,stops:0}}static{this.styles=h}willUpdate(t){if(super.willUpdate(t),t.has("stops")){let{stops:p}=this,i=[];p.forEach(c=>{let{color:o,max:m,min:n}=c;i.push({value:n,color:o},{value:m,color:o})}),this._rampStops=i}}render(){return a`<arcgis-ramp-color .layout=${this.layout} .min=${this.min} .max=${this.max} .stops=${this._rampStops}></arcgis-ramp-color>`}};e("arcgis-ramp-color-break",s);export{s as ArcgisRampColorBreak};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
- import{b as p}from"./NMDESY3T.js";var l=1440*60*1e3,T=/^(\d{4})-(\d{2})-(\d{2})$/u,F=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/u,o=class{constructor({type:e,editable:t,precision:r,steps:i}){this.type=e,this.editable=t,this.precision=r,this.steps=i}toDateOnly(e){return null}toTimeOnly(e){return null}toTimestampOffset(e){return null}toFieldType(e){return e}},a=class extends o{constructor({type:e,precision:t,integer:r=!1,minimum:i,maximum:m}){super({type:e,editable:!0,precision:t}),this._integer=r,this._minimum=i,this._maximum=m}resolveRange(e,t,r){return{min:t??Math.min(0,...e),max:r??Math.max(100,...e)}}parse(e){let t=Number.parseFloat(e.trim());if(!Number.isFinite(t))return;let r=this._integer?Math.trunc(t):t;return Math.min(this._maximum,Math.max(this._minimum,r))}serialize(e){return this._integer?`${Math.trunc(e)}`:`${e}`}format(e,t,r,i){return i(t)}},h=class extends o{constructor(){super({type:"date",editable:!1,precision:0,steps:1e3}),this._dateTimeFormatOptions={dateStyle:"short"}}resolveRange(e,t,r){return f(e,t,r,Date.now())}parse(e){let t=Number.parseFloat(e.trim());return Number.isFinite(t)?Math.trunc(t):void 0}serialize(e){return`${Math.trunc(e)}`}toDateOnly(e){return new Date(e).toISOString().slice(0,10)}toTimeOnly(e){return new Date(e).toISOString().slice(11,19)}toTimestampOffset(e){return new Date(e).toISOString()}format(e,t){return p(e,this._dateTimeFormatOptions).format(new Date(t))}},g=class extends o{constructor(){super({type:"timestamp-offset",editable:!1,precision:0,steps:1e3}),this._dateTimeFormatOptions={dateStyle:"short"}}resolveRange(e,t,r){return f(e,t,r,Date.now())}parse(e){let t=Date.parse(e.trim());return Number.isFinite(t)?t:void 0}serialize(e){return new Date(e).toISOString()}toDateOnly(e){return new Date(e).toISOString().slice(0,10)}toTimeOnly(e){return new Date(e).toISOString().slice(11,19)}toTimestampOffset(e){return new Date(e).toISOString()}toFieldType(e){return this.serialize(e)}format(e,t){return p(e,this._dateTimeFormatOptions).format(new Date(t))}},x=class extends o{constructor(){super({type:"date-only",editable:!1,precision:0,steps:l}),this._dateFormatOptions={dateStyle:"short",timeZone:"UTC"}}resolveRange(e,t,r){return f(e,t,r,Math.trunc(Date.now()/l)*l)}parse(e){let t=T.exec(e.trim());if(!t)return;let r=Number.parseInt(t[1],10),i=Number.parseInt(t[2],10),m=Number.parseInt(t[3],10),s=Date.UTC(r,i-1,m),u=new Date(s);if(!(u.getUTCFullYear()!==r||u.getUTCMonth()!==i-1||u.getUTCDate()!==m))return s}serialize(e){return new Date(e).toISOString().slice(0,10)}toDateOnly(e){return this.serialize(e)}toTimestampOffset(e){return new Date(e).toISOString()}toFieldType(e){return this.serialize(e)}format(e,t){return p(e,this._dateFormatOptions).format(new Date(t))}},y=class extends o{constructor(){super({type:"time-only",editable:!1,precision:0,steps:1e3}),this._timeFormatOptions={timeStyle:"medium",timeZone:"UTC"}}resolveRange(e,t,r){return{min:t??0,max:r??l-1}}parse(e){let t=F.exec(e.trim());if(!t)return;let r=Number.parseInt(t[1],10),i=Number.parseInt(t[2],10),m=t[3]?Number.parseInt(t[3],10):0,s=t[4]?Number.parseInt(t[4].padEnd(3,"0").slice(0,3),10):0;if(!(r>23||i>59||m>59))return((r*60+i)*60+m)*1e3+s}serialize(e){let t=Math.max(0,Math.min(l-1,Math.floor(e))),r=Math.floor(t/36e5),i=Math.floor(t%36e5/6e4),m=Math.floor(t%6e4/1e3),s=t%1e3,u=`${d(r)}:${d(i)}:${d(m)}`;return s>0?`${u}.${s.toString().padStart(3,"0")}`:u}toTimeOnly(e){return this.serialize(e)}toFieldType(e){return this.serialize(e)}format(e,t){return p(e,this._timeFormatOptions).format(new Date(t))}};function d(n){return n.toString().padStart(2,"0")}function f(n,e,t,r){let i=t??(n.length>0?Math.max(...n):r);return{min:e??Math.min(i-30*l,...n),max:i}}var O={min:-32768,max:32767},c={min:-2147483648,max:2147483647},S={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},b=(2-2**-23)*2**127,w={min:-b,max:b},D={min:-Number.MAX_VALUE,max:Number.MAX_VALUE},M={min:0,max:c.max},_={"small-integer":()=>new a({type:"small-integer",precision:0,integer:!0,minimum:O.min,maximum:O.max}),integer:()=>new a({type:"integer",precision:0,integer:!0,minimum:c.min,maximum:c.max}),"big-integer":()=>new a({type:"big-integer",precision:0,integer:!0,minimum:S.min,maximum:S.max}),single:()=>new a({type:"single",precision:4,minimum:w.min,maximum:w.max}),double:()=>new a({type:"double",precision:4,minimum:D.min,maximum:D.max}),long:()=>new a({type:"long",precision:0,integer:!0,minimum:c.min,maximum:c.max}),oid:()=>new a({type:"oid",precision:0,integer:!0,minimum:M.min,maximum:M.max}),date:()=>new h,"date-only":()=>new x,"time-only":()=>new y,"timestamp-offset":()=>new g};function I(n){return _[n]()}export{I as a};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{b as p}from"./PMV2N3L3.js";var l=1440*60*1e3,T=/^(\d{4})-(\d{2})-(\d{2})$/u,F=/^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/u,o=class{constructor({type:e,editable:t,precision:r,steps:i}){this.type=e,this.editable=t,this.precision=r,this.steps=i}toDateOnly(e){return null}toTimeOnly(e){return null}toTimestampOffset(e){return null}toFieldType(e){return e}},a=class extends o{constructor({type:e,precision:t,integer:r=!1,minimum:i,maximum:m}){super({type:e,editable:!0,precision:t}),this._integer=r,this._minimum=i,this._maximum=m}resolveRange(e,t,r){return{min:t??Math.min(0,...e),max:r??Math.max(100,...e)}}parse(e){let t=Number.parseFloat(e.trim());if(!Number.isFinite(t))return;let r=this._integer?Math.trunc(t):t;return Math.min(this._maximum,Math.max(this._minimum,r))}serialize(e){return this._integer?`${Math.trunc(e)}`:`${e}`}format(e,t,r,i){return i(t)}},h=class extends o{constructor(){super({type:"date",editable:!1,precision:0,steps:1e3}),this._dateTimeFormatOptions={dateStyle:"short"}}resolveRange(e,t,r){return f(e,t,r,Date.now())}parse(e){let t=Number.parseFloat(e.trim());return Number.isFinite(t)?Math.trunc(t):void 0}serialize(e){return`${Math.trunc(e)}`}toDateOnly(e){return new Date(e).toISOString().slice(0,10)}toTimeOnly(e){return new Date(e).toISOString().slice(11,19)}toTimestampOffset(e){return new Date(e).toISOString()}format(e,t){return p(e,this._dateTimeFormatOptions).format(new Date(t))}},g=class extends o{constructor(){super({type:"timestamp-offset",editable:!1,precision:0,steps:1e3}),this._dateTimeFormatOptions={dateStyle:"short"}}resolveRange(e,t,r){return f(e,t,r,Date.now())}parse(e){let t=Date.parse(e.trim());return Number.isFinite(t)?t:void 0}serialize(e){return new Date(e).toISOString()}toDateOnly(e){return new Date(e).toISOString().slice(0,10)}toTimeOnly(e){return new Date(e).toISOString().slice(11,19)}toTimestampOffset(e){return new Date(e).toISOString()}toFieldType(e){return this.serialize(e)}format(e,t){return p(e,this._dateTimeFormatOptions).format(new Date(t))}},x=class extends o{constructor(){super({type:"date-only",editable:!1,precision:0,steps:l}),this._dateFormatOptions={dateStyle:"short",timeZone:"UTC"}}resolveRange(e,t,r){return f(e,t,r,Math.trunc(Date.now()/l)*l)}parse(e){let t=T.exec(e.trim());if(!t)return;let r=Number.parseInt(t[1],10),i=Number.parseInt(t[2],10),m=Number.parseInt(t[3],10),s=Date.UTC(r,i-1,m),u=new Date(s);if(!(u.getUTCFullYear()!==r||u.getUTCMonth()!==i-1||u.getUTCDate()!==m))return s}serialize(e){return new Date(e).toISOString().slice(0,10)}toDateOnly(e){return this.serialize(e)}toTimestampOffset(e){return new Date(e).toISOString()}toFieldType(e){return this.serialize(e)}format(e,t){return p(e,this._dateFormatOptions).format(new Date(t))}},y=class extends o{constructor(){super({type:"time-only",editable:!1,precision:0,steps:1e3}),this._timeFormatOptions={timeStyle:"medium",timeZone:"UTC"}}resolveRange(e,t,r){return{min:t??0,max:r??l-1}}parse(e){let t=F.exec(e.trim());if(!t)return;let r=Number.parseInt(t[1],10),i=Number.parseInt(t[2],10),m=t[3]?Number.parseInt(t[3],10):0,s=t[4]?Number.parseInt(t[4].padEnd(3,"0").slice(0,3),10):0;if(!(r>23||i>59||m>59))return((r*60+i)*60+m)*1e3+s}serialize(e){let t=Math.max(0,Math.min(l-1,Math.floor(e))),r=Math.floor(t/36e5),i=Math.floor(t%36e5/6e4),m=Math.floor(t%6e4/1e3),s=t%1e3,u=`${d(r)}:${d(i)}:${d(m)}`;return s>0?`${u}.${s.toString().padStart(3,"0")}`:u}toTimeOnly(e){return this.serialize(e)}toFieldType(e){return this.serialize(e)}format(e,t){return p(e,this._timeFormatOptions).format(new Date(t))}};function d(n){return n.toString().padStart(2,"0")}function f(n,e,t,r){let i=t??(n.length>0?Math.max(...n):r);return{min:e??Math.min(i-30*l,...n),max:i}}var O={min:-32768,max:32767},c={min:-2147483648,max:2147483647},S={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},b=(2-2**-23)*2**127,w={min:-b,max:b},D={min:-Number.MAX_VALUE,max:Number.MAX_VALUE},M={min:0,max:c.max},_={"small-integer":()=>new a({type:"small-integer",precision:0,integer:!0,minimum:O.min,maximum:O.max}),integer:()=>new a({type:"integer",precision:0,integer:!0,minimum:c.min,maximum:c.max}),"big-integer":()=>new a({type:"big-integer",precision:0,integer:!0,minimum:S.min,maximum:S.max}),single:()=>new a({type:"single",precision:4,minimum:w.min,maximum:w.max}),double:()=>new a({type:"double",precision:4,minimum:D.min,maximum:D.max}),long:()=>new a({type:"long",precision:0,integer:!0,minimum:c.min,maximum:c.max}),oid:()=>new a({type:"oid",precision:0,integer:!0,minimum:M.min,maximum:M.max}),date:()=>new h,"date-only":()=>new x,"time-only":()=>new y,"timestamp-offset":()=>new g};function I(n){return _[n]()}export{I as a};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
- import{a as E}from"./E4NVOXNZ.js";import{a as k}from"./BGN6KRHS.js";import"./ALOLCOFN.js";import{f}from"./QJJFF4PI.js";import{a as n}from"./D2YGEFGL.js";import{J as g,K as l,L as w,R as v,h as C,j as i,k as u,n as m,t as r}from"./KIWPQY6T.js";function y(a,e,t){window.localStorage.setItem(a,JSON.stringify(e))}function S(a,e){let t=window.localStorage.getItem(a);return t&&e?JSON.parse(t):t}var R=C`:host,arcgis-picker-input{display:block}.color-picker-container{display:flex;flex-direction:column}.color-picker{--calcite-color-border-1: transparent;overflow-x:hidden}.preview-swatch{width:100%;height:24px}.recent-colors-container{align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-input);display:flex;gap:var(--calcite-space-sm);height:32px;padding:0 var(--calcite-space-xs);transition:outline-offset .1s ease-in-out,outline-color .1s ease-in-out}.preview-recent-swatch{cursor:pointer}.recent-colors-container:focus,.preview-recent-swatch:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}.empty-swatch{cursor:default}.end-action{display:flex}`,h=class extends w{constructor(){super(),this._messages=k(),this.actionEl=g(),this.open=!1,this.setRecentColorElement=e=>t=>{switch(e){case 1:this.recentColor1El=t;break;case 2:this.recentColor2El=t;break;default:this.recentColor3El=t}},this.recentColors=[],this.clearable=!1,this.compact=!1,this.disabled=!1,this.placement="auto",this.storageId="arcgis-color-input-storage-colors",this.hideRecentColors=!1,this.showTransparency=!1,this.arcgisChange=r(),this.arcgisColorInputChange=r(),this.arcgisColorInputPopoverClose=r(),this.arcgisColorInputPopoverOpen=r(),this.arcgisColorInputSwatchUpdate=r(),this.arcgisInternalStoredColor=r(),this.arcgisPickerClose=r(),this.arcgisPickerOpen=r(),this.arcgisSwatchUpdate=r(),this.listenOn(document,"arcgisInternalStoredColor",this.handleUpdateRecentColors),this.listenOn(document,"arcgisRecentColorsUpdate",this.handleStoreNewRecentColor)}static{this.properties={recentColors:16,clearable:5,color:1,compact:5,disabled:5,messageOverrides:0,placement:1,popoverProps:0,storageId:1,hideRecentColors:5,showTransparency:5}}static{this.styles=R}async close(){await this.inlineInputEl?.close({focus:!1})}async setFocus(){await this.inlineInputEl?.setFocus()}isOpen(){return this.open}load(){this.setRecentColorsFromStorage()}disconnectedCallback(){super.disconnectedCallback(),this.removeTooltip()}async handleOpen(){await this.colorPickerEl?.setFocus(),this.open=!0,this.arcgisPickerOpen.emit(),this.arcgisColorInputPopoverOpen.emit()}setInlineInputRef(e){this.inlineInputEl=e}setColorPickerRef(e){e&&(this.colorPickerEl=e)}getRecentColorElement(e){switch(e){case 1:return this.recentColor1El;case 2:return this.recentColor2El;default:return this.recentColor3El}}setRecentColorsFromStorage(){let e=S(this.storageId,!0);e&&(this.recentColors=[...e])}handleSwatchClickOrKeyUp(e){if("key"in e&&e.key!=="Enter"&&e.key!=="Space")return;let t=e.currentTarget.color||void 0;this.updateColor(t),this.arcgisSwatchUpdate.emit(t),this.arcgisColorInputSwatchUpdate.emit(t),setTimeout(()=>this.recentColor1El?.focus(),200)}handleRecentColorsKeyDown(e){if(this.recentColors.length===1)return;let t=e.key,o;this.activeColorSwatchEl===this.recentColor1El?o=1:this.activeColorSwatchEl===this.recentColor2El?o=2:this.activeColorSwatchEl===this.recentColor3El&&(o=3),t==="ArrowLeft"&&(!o||o===1?this.getRecentColorElement(this.recentColors.length)?.focus():this.getRecentColorElement(o-1)?.focus()),t==="ArrowRight"&&(!o||o===this.recentColors.length?this.recentColor1El?.focus():this.getRecentColorElement(o+1)?.focus())}handleUpdateActiveSwatch(e){this.activeColorSwatchEl=e.currentTarget}handleStoreNewRecentColor(e){this.storeRecentColorToStorage(e.detail)}handleUpdateRecentColors(e){e.composedPath().includes(this.el)||this.setRecentColorsFromStorage()}handleClearColor(){this.updateColor(void 0)}updateColor(e,t=!0){e!==this.color&&(this.color=e,this.arcgisChange.emit(),this.arcgisColorInputChange.emit(),t&&this.storeRecentColorToStorage(e))}storeRecentColorToStorage(e){if(!e)return;e.length>7&&(e=e.slice(0,7));let t=[e,...this.recentColors.filter(o=>o!==e)].slice(0,3);y(this.storageId,t),this.recentColors=t,this.arcgisInternalStoredColor.emit()}handleClose(e){e.stopPropagation(),this.storeRecentColorToStorage(this.colorPickerEl?.value),this.open=!1,this.arcgisPickerClose.emit(this.colorPickerEl?.value),this.arcgisColorInputPopoverClose.emit(this.colorPickerEl?.value)}addTooltip(e){this.removeTooltip(),this.tooltipContainerEl=document.createElement("div"),m(i`<calcite-tooltip .placement=${e.placement??"auto"} .referenceElement=${e.referenceElement} overlay-positioning=fixed open>${e.innerHTML}</calcite-tooltip>`,this.tooltipContainerEl),document.body.append(this.tooltipContainerEl)}removeTooltip(){this.tooltipContainerEl?.parentNode&&(this.tooltipContainerEl.remove(),this.tooltipContainerEl=void 0)}render(){let{compact:e,disabled:t,recentColors:o,_messages:s}=this,p=[o[0],o[1]],$=f(this.el)==="rtl";return e||p.push(o[2]),i`<arcgis-picker-input .disabled=${t} .intlDone=${s.commitColor} .heading=${s.selectColor} .label=${s.selectColor} @arcgisPopoverOpen=${this.handleOpen} @arcgisPopoverClose=${this.handleClose} .popoverProps=${this.popoverProps} ${l(this.setInlineInputRef)}><div class="color-picker-container" slot=content>${n(`color-picker${e?"--compact":""}`,i`<calcite-color-picker .clearable=${this.clearable} class="color-picker" @calciteColorPickerInput=${E(c=>{c.stopPropagation(),this.updateColor(this.colorPickerEl.value,!1)},500)} .scale=${e?"s":"m"} .storageId=${this.storageId} .alphaChannel=${this.showTransparency} .value=${this.color} ${l(this.setColorPickerRef)}></calcite-color-picker>`)}</div><div slot=preview><calcite-color-picker-swatch class="preview-swatch" .color=${this.color} scale=s></calcite-color-picker-swatch></div>${!this.hideRecentColors&&i`<div slot=content-end class="recent-colors-container" @keydown=${this.handleRecentColorsKeyDown} tabindex=-1>${p.map((c,d)=>c?n(c,i`<calcite-color-picker-swatch class="preview-recent-swatch" role=button scale=s tabindex=0 .active=${c===this.color} .color=${c} @click=${this.handleSwatchClickOrKeyUp} @keyup=${this.handleSwatchClickOrKeyUp} @focus=${this.handleUpdateActiveSwatch} ${l(this.setRecentColorElement(d+1))}></calcite-color-picker-swatch>`):this.renderEmptySwatch(`empty-swatch-${d}`))}</div>`||""}${this.clearable&&i`<div slot=content-end class="end-action"><calcite-action icon=circle-disallowed scale=s .label=${s.clearColor} .text=${s.clearColor??""} @click=${this.handleClearColor} @mouseover=${()=>this.addTooltip({referenceElement:this.actionEl.value,placement:$?"right-start":"left-start",innerHTML:s.noColor??""})} @mouseout=${()=>this.removeTooltip()} ${l(this.actionEl)}></calcite-action></div>`||""}</arcgis-picker-input>`}renderEmptySwatch(e){return n(e,i`<svg class="empty-swatch" viewBox="0 0 20 20" xmlns=http://www.w3.org/2000/svg width=20>${u`<rect width=20 height=20 fill=#f8f8f8 stroke=#000 stroke-dasharray=2 />`}</svg>`)}};v("arcgis-color-input",h);export{h as ArcgisColorInput};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as E}from"./XEK22IDA.js";import{a as k}from"./Z5SIZJN5.js";import"./LAQNGXPG.js";import{f}from"./TWW63D32.js";import{a as n}from"./DRV7OKQT.js";import{J as g,K as l,L as w,R as v,h as C,j as i,k as u,n as m,t as r}from"./PWYFUIF6.js";function y(a,e,t){window.localStorage.setItem(a,JSON.stringify(e))}function S(a,e){let t=window.localStorage.getItem(a);return t&&e?JSON.parse(t):t}var R=C`:host,arcgis-picker-input{display:block}.color-picker-container{display:flex;flex-direction:column}.color-picker{--calcite-color-border-1: transparent;overflow-x:hidden}.preview-swatch{width:100%;height:24px}.recent-colors-container{align-items:center;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-input);display:flex;gap:var(--calcite-space-sm);height:32px;padding:0 var(--calcite-space-xs);transition:outline-offset .1s ease-in-out,outline-color .1s ease-in-out}.preview-recent-swatch{cursor:pointer}.recent-colors-container:focus,.preview-recent-swatch:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}.empty-swatch{cursor:default}.end-action{display:flex}`,h=class extends w{constructor(){super(),this._messages=k(),this.actionEl=g(),this.open=!1,this.setRecentColorElement=e=>t=>{switch(e){case 1:this.recentColor1El=t;break;case 2:this.recentColor2El=t;break;default:this.recentColor3El=t}},this.recentColors=[],this.clearable=!1,this.compact=!1,this.disabled=!1,this.placement="auto",this.storageId="arcgis-color-input-storage-colors",this.hideRecentColors=!1,this.showTransparency=!1,this.arcgisChange=r(),this.arcgisColorInputChange=r(),this.arcgisColorInputPopoverClose=r(),this.arcgisColorInputPopoverOpen=r(),this.arcgisColorInputSwatchUpdate=r(),this.arcgisInternalStoredColor=r(),this.arcgisPickerClose=r(),this.arcgisPickerOpen=r(),this.arcgisSwatchUpdate=r(),this.listenOn(document,"arcgisInternalStoredColor",this.handleUpdateRecentColors),this.listenOn(document,"arcgisRecentColorsUpdate",this.handleStoreNewRecentColor)}static{this.properties={recentColors:16,clearable:5,color:1,compact:5,disabled:5,messageOverrides:0,placement:1,popoverProps:0,storageId:1,hideRecentColors:5,showTransparency:5}}static{this.styles=R}async close(){await this.inlineInputEl?.close({focus:!1})}async setFocus(){await this.inlineInputEl?.setFocus()}isOpen(){return this.open}load(){this.setRecentColorsFromStorage()}disconnectedCallback(){super.disconnectedCallback(),this.removeTooltip()}async handleOpen(){await this.colorPickerEl?.setFocus(),this.open=!0,this.arcgisPickerOpen.emit(),this.arcgisColorInputPopoverOpen.emit()}setInlineInputRef(e){this.inlineInputEl=e}setColorPickerRef(e){e&&(this.colorPickerEl=e)}getRecentColorElement(e){switch(e){case 1:return this.recentColor1El;case 2:return this.recentColor2El;default:return this.recentColor3El}}setRecentColorsFromStorage(){let e=S(this.storageId,!0);e&&(this.recentColors=[...e])}handleSwatchClickOrKeyUp(e){if("key"in e&&e.key!=="Enter"&&e.key!=="Space")return;let t=e.currentTarget.color||void 0;this.updateColor(t),this.arcgisSwatchUpdate.emit(t),this.arcgisColorInputSwatchUpdate.emit(t),setTimeout(()=>this.recentColor1El?.focus(),200)}handleRecentColorsKeyDown(e){if(this.recentColors.length===1)return;let t=e.key,o;this.activeColorSwatchEl===this.recentColor1El?o=1:this.activeColorSwatchEl===this.recentColor2El?o=2:this.activeColorSwatchEl===this.recentColor3El&&(o=3),t==="ArrowLeft"&&(!o||o===1?this.getRecentColorElement(this.recentColors.length)?.focus():this.getRecentColorElement(o-1)?.focus()),t==="ArrowRight"&&(!o||o===this.recentColors.length?this.recentColor1El?.focus():this.getRecentColorElement(o+1)?.focus())}handleUpdateActiveSwatch(e){this.activeColorSwatchEl=e.currentTarget}handleStoreNewRecentColor(e){this.storeRecentColorToStorage(e.detail)}handleUpdateRecentColors(e){e.composedPath().includes(this.el)||this.setRecentColorsFromStorage()}handleClearColor(){this.updateColor(void 0)}updateColor(e,t=!0){e!==this.color&&(this.color=e,this.arcgisChange.emit(),this.arcgisColorInputChange.emit(),t&&this.storeRecentColorToStorage(e))}storeRecentColorToStorage(e){if(!e)return;e.length>7&&(e=e.slice(0,7));let t=[e,...this.recentColors.filter(o=>o!==e)].slice(0,3);y(this.storageId,t),this.recentColors=t,this.arcgisInternalStoredColor.emit()}handleClose(e){e.stopPropagation(),this.storeRecentColorToStorage(this.colorPickerEl?.value),this.open=!1,this.arcgisPickerClose.emit(this.colorPickerEl?.value),this.arcgisColorInputPopoverClose.emit(this.colorPickerEl?.value)}addTooltip(e){this.removeTooltip(),this.tooltipContainerEl=document.createElement("div"),m(i`<calcite-tooltip .placement=${e.placement??"auto"} .referenceElement=${e.referenceElement} overlay-positioning=fixed open>${e.innerHTML}</calcite-tooltip>`,this.tooltipContainerEl),document.body.append(this.tooltipContainerEl)}removeTooltip(){this.tooltipContainerEl?.parentNode&&(this.tooltipContainerEl.remove(),this.tooltipContainerEl=void 0)}render(){let{compact:e,disabled:t,recentColors:o,_messages:s}=this,p=[o[0],o[1]],$=f(this.el)==="rtl";return e||p.push(o[2]),i`<arcgis-picker-input .disabled=${t} .intlDone=${s.commitColor} .heading=${s.selectColor} .label=${s.selectColor} @arcgisPopoverOpen=${this.handleOpen} @arcgisPopoverClose=${this.handleClose} .popoverProps=${this.popoverProps} ${l(this.setInlineInputRef)}><div class="color-picker-container" slot=content>${n(`color-picker${e?"--compact":""}`,i`<calcite-color-picker .clearable=${this.clearable} class="color-picker" @calciteColorPickerInput=${E(c=>{c.stopPropagation(),this.updateColor(this.colorPickerEl.value,!1)},500)} .scale=${e?"s":"m"} .storageId=${this.storageId} .alphaChannel=${this.showTransparency} .value=${this.color} ${l(this.setColorPickerRef)}></calcite-color-picker>`)}</div><div slot=preview><calcite-color-picker-swatch class="preview-swatch" .color=${this.color} scale=s></calcite-color-picker-swatch></div>${!this.hideRecentColors&&i`<div slot=content-end class="recent-colors-container" @keydown=${this.handleRecentColorsKeyDown} tabindex=-1>${p.map((c,d)=>c?n(c,i`<calcite-color-picker-swatch class="preview-recent-swatch" role=button scale=s tabindex=0 .active=${c===this.color} .color=${c} @click=${this.handleSwatchClickOrKeyUp} @keyup=${this.handleSwatchClickOrKeyUp} @focus=${this.handleUpdateActiveSwatch} ${l(this.setRecentColorElement(d+1))}></calcite-color-picker-swatch>`):this.renderEmptySwatch(`empty-swatch-${d}`))}</div>`||""}${this.clearable&&i`<div slot=content-end class="end-action"><calcite-action icon=circle-disallowed scale=s .label=${s.clearColor} .text=${s.clearColor??""} @click=${this.handleClearColor} @mouseover=${()=>this.addTooltip({referenceElement:this.actionEl.value,placement:$?"right-start":"left-start",innerHTML:s.noColor??""})} @mouseout=${()=>this.removeTooltip()} ${l(this.actionEl)}></calcite-action></div>`||""}</arcgis-picker-input>`}renderEmptySwatch(e){return n(e,i`<svg class="empty-swatch" viewBox="0 0 20 20" xmlns=http://www.w3.org/2000/svg width=20>${u`<rect width=20 height=20 fill=#f8f8f8 stroke=#000 stroke-dasharray=2 />`}</svg>`)}};v("arcgis-color-input",h);export{h as ArcgisColorInput};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  function e(t,d){return t.disabled!==d.disabled?t.disabled?1:-1:(d.lastActivated?.getTime()??0)-(t.lastActivated?.getTime()??0)}export{e as a};