1/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified. 2See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details. 3v3.0.3 */ 4import{a as y,b as x}from"./6NJ2XB5D.js";import{a as f}from"./6NCXFBVI.js";import{a as k}from"./HHWADIGN.js";import{a as g,b as m}from"./SZONZQBZ.js";import{b as v}from"./H6E5FODU.js";import{J as p,e as r,f as h,j as i,v as l,w as b,x as u}from"./74XIV7EB.js";var H={handle:"handle",handleSelected:"handle--selected"},C={drag:"drag"},s={itemLabel:"{itemLabel}",position:"{position}",total:"{total}"},w=r`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.handle{display:flex;align-items:center;justify-content:center;align-self:stretch;border-style:none;outline-color:transparent;color:var(--calcite-handle-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-handle-background-color, transparent);padding-block:.75rem;padding-inline:.25rem;line-height:0}.handle calcite-icon{color:inherit}:host(:not([disabled])) .handle{cursor:move}:host(:not([disabled])) .handle:hover{color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2))}:host(:not([disabled])) .handle:focus{outline:2px solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(-2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))));color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1))}:host(:not([disabled])) .handle--selected{color:var(--calcite-handle-icon-color-selected, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-selected, var(--calcite-color-foreground-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,o=class extends b{constructor(){super(...arguments),this.handleButton=g(),this.blurUnselectDisabled=!1,this.disabled=!1,this.messages=k({blocking:!0}),this.selected=!1,this.calciteHandleChange=l({cancelable:!1}),this.calciteHandleNudge=l({cancelable:!1}),this.calciteInternalAssistiveTextChange=l({cancelable:!1})}static{this.properties={blurUnselectDisabled:5,disabled:7,dragHandle:3,label:1,messageOverrides:0,selected:7,setPosition:9,setSize:9}}static{this.styles=w}async setFocus(){await v(this),this.handleButton.value?.focus()}async load(){}willUpdate(e){(e.has("messages")||e.has("label")||e.has("selected")&&(this.hasUpdated||this.selected!==!1)||e.has("setPosition")||e.has("setSize"))&&this.handleAriaTextChange()}updated(){y(this)}loaded(){f.deprecated("component",{name:"handle",removalVersion:4,suggested:"sort-handle"})}handleAriaTextChange(){let e=this.getAriaText("live");e&&this.calciteInternalAssistiveTextChange.emit({message:e})}getTooltip(){let{label:e,messages:t}=this;return t?e?t.dragHandle.replace(s.itemLabel,e):t.dragHandleUntitled:""}getAriaText(e){let{setPosition:t,setSize:c,label:d,messages:a,selected:n}=this;return!a||!d||typeof c!="number"||typeof t!="number"?null:(e==="label"?n?a.dragHandleChange:a.dragHandleIdle:n?a.dragHandleActive:a.dragHandleCommit).replace(s.position,t.toString()).replace(s.itemLabel,d).replace(s.total,c.toString())}handleKeyDown(e){if(!this.disabled)switch(e.key){case" ":this.selected=!this.selected,this.calciteHandleChange.emit(),e.preventDefault();break;case"ArrowUp":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"up"});break;case"ArrowDown":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"down"});break}}handleBlur(){this.blurUnselectDisabled||this.disabled||this.selected&&(this.selected=!1,this.calciteHandleChange.emit())}render(){return x({disabled:this.disabled,children:h`<span .ariaChecked=${this.disabled?null:this.selected} .ariaDisabled=${this.disabled?this.disabled:null} .ariaLabel=${this.disabled?null:this.getAriaText("label")} class=${u({[H.handle]:!0,[H.handleSelected]:!this.disabled&&this.selected})} @blur=${this.handleBlur} @keydown=${this.handleKeyDown} role=radio tabindex=${(this.disabled?null:0)??i} title=${this.getTooltip()??i} ${m(this.handleButton)}><calcite-icon .icon=${C.drag} scale=s></calcite-icon></span>`})}};p("calcite-handle",o);export{o as Handle};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.