@arcgis/common-components 5.2.0-next.104 → 5.2.0-next.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/common-components",
3
- "version": "5.2.0-next.104",
3
+ "version": "5.2.0-next.106",
4
4
  "description": "ArcGIS Maps SDK for JavaScript common components",
5
5
  "keywords": [
6
6
  "2D",
@@ -45,15 +45,15 @@
45
45
  ],
46
46
  "license": "SEE LICENSE IN LICENSE.md",
47
47
  "dependencies": {
48
- "@arcgis/lumina": "5.2.0-next.104",
49
- "@arcgis/toolkit": "5.2.0-next.104",
48
+ "@arcgis/lumina": "5.2.0-next.106",
49
+ "@arcgis/toolkit": "5.2.0-next.106",
50
50
  "@esri/arcgis-html-sanitizer": "~4.1.0",
51
51
  "@lit/task": "^1.0.3",
52
52
  "lit": "^3.3.0",
53
53
  "tslib": "^2.8.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@arcgis/core": "5.2.0-next.104",
56
+ "@arcgis/core": "5.2.0-next.106",
57
57
  "@esri/calcite-components": "^5.2.0-next.65"
58
58
  },
59
59
  "css.customData": [
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{H as a,I as s,J as c,K as d,P as p,h as u,j as n,t as h}from"./WJZHHIWO.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 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{d as h,g as f}from"./TWW63D32.js";import{a as L,b as P,c as O,d as g,e as v,f as w,g as $,o as b,r as E,s as A,u as N}from"./WJZHHIWO.js";var _=t=>(...s)=>{let e=v(),o=new t(...s),r=o.exports;g(e.at(-1));let n=o.component.manager;n.W(o,r),o.watchExports(n.W.bind(n,o)),w(o);let a=[o.component,...e].reverse();return E(a,i=>i===void 0?void 0:T(o,i,r),r)},T=(t,{host:s,key:e,isReactive:o},r)=>{let n=s,a=n[e]!==t.exports,i=n[e]!==r,c=r!==t.exports;if(a&&!i&&c&&(n[e]=t.exports),s===t.component){if(o){let l=t.component.manager;i&&l.W(t,n[e]),t.onUpdate(u=>{if(u.has(e)){let C=n[e];C!==t.exports&&l.W(t,C)}})}t.O=o?void 0:e}let d=t.component.constructor.elementProperties.get(e)?.readOnly;t.watchExports(()=>{n[e]!==t.exports&&(d?$(()=>{n[e]=t.exports}):n[e]=t.exports)})};var y=t=>{let s=f(t,"lang",globalThis.navigator?.language||m);return{lang:s,t9nLocale:k(s)}},D=(t,s,e,o)=>{let r,n=()=>U(t,s(),o).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&e(a),r=a}).catch(a=>{b("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),h(t,["lang"],n)},U=async(t,s,e=t.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:r}=y(t),n=`${s}/${e}/t9n`,i=e===null?{}:await q(r,n,"messages.");return{lang:o,t9nLocale:r,t9nStrings:i}};var F="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(","),W=new Set(F),m="en",K={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},q=async(t,s,e="")=>{let o=`${s}/${e}`,r=`${o}${t}.json`;return j[r]??=V(t,o),await j[r]},j={},V=async(t,s)=>{let e=`${s}${t}.json`;try{let o=await fetch(e);if(o.ok)return await o.json()}catch(o){return b("error","intl",`An unknown error occurred while fetching localization strings at ${e}`,{detail:{error:o}}),{}}return t===m?{}:await V(m,s)},k=t=>{let[s,e]=t.split("-"),o=s.toLowerCase(),r=o;return e&&(r=`${o}-${e.toUpperCase()}`),r=K[r]??r,W.has(r)?r:e?k(o):m};var M=t=>R(void 0,t);var x=class extends N{constructor(s,e){super(s);let o=this.exports;try{P(this.component);let r=e(this.component,this),n=this.exports!==o;if(L(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(){}},R=_(x);var z="ltr",it=()=>M((t,s)=>{s.exports=z,s.onLifecycle(()=>{let e=()=>{let o=f(t.el,"dir",z);s.exports=o==="rtl"?"rtl":"ltr"};return e(),h(t.el,["dir"],e)})}),ct=t=>(s={})=>M((e,o)=>{let r=y(e.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=e;o.onLifecycle(()=>D(e.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:p,lang:d})=>{let l={...p,_lang:d,_t9nLocale:c,_loading:!1};o.exports=l;let u=p.componentLabel;typeof u=="string"&&"label"in e&&e.label==null&&(e.label??=u),i(a.messageOverrides)},s.name));let i=c=>{let p=o.exports,d=p._original??p,l=S(d,c);c&&(l._original=d),o.exports=l};return"messageOverrides"in a&&o.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(o.setProvisionalExports(n,!1),o.ready):n}),S=(t,s)=>{if(!s)return t;let e={...t};return Object.entries(s).forEach(([o,r])=>{t[o]!==void 0&&(typeof r=="object"?e[o]=S(t[o],r):e[o]=r??t[o])}),e},lt=t=>B,I="arcgisPropertyChange",B=(...t)=>{let s=O(),e=A(I,void 0,s),o=!0;return s.manager.onUpdated(r=>{if(o||!s.el.isConnected){o=!1;return}for(let n of t)r.has(n)&&e.emit({name:n})}),e};export{_ as a,it as b,ct as c,lt as d};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as m}from"./XWGTFIHC.js";import{d}from"./BOMP3AYJ.js";import{b as r}from"./TWW63D32.js";import{J as o,K as h,M as a,P as c,h as n,j as s,t as i}from"./WJZHHIWO.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};