@spectrum-web-components/slider 0.31.1-react.3 → 0.32.0

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["HandleController.ts"],
4
- "sourcesContent": ["/*\nCopyright 2021 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport {\n classMap,\n ifDefined,\n styleMap,\n} from '@spectrum-web-components/base/src/directives.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\nimport { Slider } from './Slider.js';\nimport {\n Controller,\n SliderHandle,\n SliderNormalization,\n} from './SliderHandle.js';\n\ninterface HandleReference {\n handle: HTMLElement;\n input: HTMLInputElement;\n}\n\ninterface HandleComponents extends HandleReference {\n model: SliderHandle;\n}\n\ninterface RangeAndClamp {\n range: { min: number; max: number };\n clamp: { min: number; max: number };\n}\ninterface ModelValue extends RangeAndClamp {\n name: string;\n value: number;\n normalizedValue: number;\n step: number;\n highlight: boolean;\n ariaLabel?: string;\n normalization: SliderNormalization;\n handle: SliderHandle;\n}\n\ninterface InputWithModel extends HTMLInputElement {\n model: ModelValue;\n}\n\ninterface DataFromPointerEvent {\n resolvedInput: boolean;\n input: InputWithModel;\n model?: ModelValue;\n}\n\nexport interface HandleValueDictionary {\n [key: string]: number;\n}\n\nexport class HandleController implements Controller {\n private host!: Slider;\n private handles: Map<string, SliderHandle> = new Map();\n private model: ModelValue[] = [];\n private handleOrder: string[] = [];\n private draggingHandle?: SliderHandle;\n private handleRefMap?: WeakMap<SliderHandle, HandleReference>;\n\n constructor(host: Slider) {\n this.host = host;\n\n new MutationController(this.host, {\n config: {\n subtree: true,\n childList: true,\n },\n callback: () => {\n this.extractModelFromLightDom();\n },\n });\n\n this.extractModelFromLightDom();\n }\n\n public get values(): HandleValueDictionary {\n const result: HandleValueDictionary = {};\n for (const model of this.handles.values()) {\n result[model.handleName] = model.value;\n }\n return result;\n }\n\n public get size(): number {\n return this.handles.size;\n }\n\n public inputForHandle(handle: SliderHandle): HTMLInputElement | undefined {\n if (this.handles.has(handle.handleName)) {\n const { input } = this.getHandleElements(handle);\n return input;\n }\n /* c8 ignore next 2 */\n throw new Error(`No input for handle \"${handle.name}\"`);\n }\n\n public requestUpdate(): void {\n if (this.host.hasUpdated) {\n this.host.requestUpdate();\n }\n }\n\n /**\n * It is possible for value attributes to be set programmatically. The <input>\n * for a particular slider needs to have an opportunity to validate any such\n * values\n *\n * @param handle Handle who's value needs validation\n */\n public setValueFromHandle(handle: SliderHandle): void {\n const elements = this.getHandleElements(handle);\n /* c8 ignore next */\n if (!elements) return;\n\n const { input } = elements;\n if (input.valueAsNumber === handle.value) {\n if (handle.dragging) {\n handle.dispatchInputEvent();\n }\n } else {\n input.valueAsNumber = handle.value;\n this.requestUpdate();\n }\n handle.value = input.valueAsNumber;\n }\n\n public handleHasChanged(handle: SliderHandle): void {\n if (handle !== this.host) {\n this.requestUpdate();\n }\n }\n\n public formattedValueForHandle(model: ModelValue): string {\n const { handle } = model;\n const numberFormat = handle.numberFormat ?? this.host.numberFormat;\n return handle.getAriaHandleText(model.value, numberFormat);\n }\n\n public get formattedValues(): Map<string, string> {\n const result = new Map<string, string>();\n for (const model of this.model) {\n result.set(model.name, this.formattedValueForHandle(model));\n }\n return result;\n }\n\n public get focusElement(): HTMLElement {\n const { input } = this.getActiveHandleElements();\n if (\n this.host.editable &&\n !(input as InputWithModel).model.handle.dragging\n ) {\n return this.host.numberField;\n }\n return input;\n }\n\n protected handleOrientation = (): void => {\n this.updateBoundingRect();\n };\n\n public hostConnected(): void {\n if ('orientation' in screen) {\n screen.orientation.addEventListener(\n 'change',\n this.handleOrientation\n );\n } else {\n window.addEventListener(\n 'orientationchange',\n this.handleOrientation\n );\n }\n }\n\n public hostDisconnected(): void {\n if ('orientation' in screen) {\n screen.orientation.removeEventListener(\n 'change',\n this.handleOrientation\n );\n } else {\n window.removeEventListener(\n 'orientationchange',\n this.handleOrientation\n );\n }\n }\n\n public hostUpdate(): void {\n this.updateModel();\n }\n\n // Since extractModelFromLightDom bails on the first un-upgraded handle,\n // a maximum of one listener will be set up per extraction attempt.\n private waitForUpgrade(handle: HTMLElement): boolean {\n if (handle instanceof SliderHandle) {\n return false;\n }\n handle.addEventListener(\n 'sp-slider-handle-ready',\n () => this.extractModelFromLightDom(),\n { once: true, passive: true }\n );\n return true;\n }\n\n private extractModelFromLightDom = (): void => {\n let handles = [\n ...this.host.querySelectorAll('[slot=\"handle\"]'),\n ] as SliderHandle[];\n if (handles.length === 0) {\n handles = [this.host as SliderHandle];\n }\n // extractModelFromLightDom depends on slotted handles already having been upgraded\n if (handles.some((h) => this.waitForUpgrade(h))) {\n return;\n }\n this.handles = new Map();\n this.handleOrder = [];\n handles.forEach((handle, index) => {\n /* c8 ignore next */\n if (!handle.handleName?.length) {\n handle.name = `handle${index + 1}`;\n }\n this.handles.set(handle.handleName, handle);\n this.handleOrder.push(handle.handleName);\n handle.handleController = this;\n });\n this.requestUpdate();\n };\n\n public get activeHandle(): string {\n return this.handleOrder[this.handleOrder.length - 1];\n }\n\n public get activeHandleInputId(): string {\n const active = this.activeHandle;\n const index = this.model.findIndex((model) => model.name === active);\n return `input-${index}`;\n }\n\n public activateHandle(name: string): void {\n const index = this.handleOrder.findIndex((item) => item === name);\n if (index >= 0) {\n this.handleOrder.splice(index, 1);\n }\n this.handleOrder.push(name);\n }\n\n private getActiveHandleElements(): HandleComponents {\n const name = this.activeHandle;\n const handleSlider = this.handles.get(name) as SliderHandle;\n const elements = this.getHandleElements(\n handleSlider\n ) as HandleReference;\n return { model: handleSlider, ...elements };\n }\n\n private getHandleElements(sliderHandle: SliderHandle): HandleReference {\n if (!this.handleRefMap) {\n this.handleRefMap = new WeakMap();\n\n const inputNodes =\n this.host.shadowRoot.querySelectorAll('.handle > input');\n for (const inputNode of inputNodes) {\n const input = inputNode as HTMLInputElement;\n const handle = input.parentElement as HTMLElement;\n const model = this.handles.get(\n handle.getAttribute('name') as string\n );\n if (model) {\n this.handleRefMap.set(model, { input, handle });\n }\n }\n }\n\n const components = this.handleRefMap.get(\n sliderHandle\n ) as HandleReference;\n return components;\n }\n\n private clearHandleComponentCache(): void {\n delete this.handleRefMap;\n }\n\n private _boundingClientRect?: DOMRect;\n\n private get boundingClientRect(): DOMRect {\n if (!this._boundingClientRect) {\n this._boundingClientRect = this.host.track.getBoundingClientRect();\n }\n return this._boundingClientRect;\n }\n\n private updateBoundingRect(): void {\n delete this._boundingClientRect;\n }\n\n /**\n * Return the `input` and `model` associated with the event and\n * whether the `input` is a `resolvedInput` meaning it was acquired\n * from the `model` rather than the event.\n */\n protected extractDataFromEvent(event: PointerEvent): DataFromPointerEvent {\n if (!this._activePointerEventData) {\n let input = (event.target as Element).querySelector(\n ':scope > .input'\n ) as InputWithModel;\n const resolvedInput = !input;\n const model = input\n ? input.model\n : this.model.find((item) => item.name === this.activeHandle);\n if (!input && !!model) {\n input = model.handle.focusElement as InputWithModel;\n }\n this._activePointerEventData = {\n input,\n model,\n resolvedInput,\n };\n }\n return this._activePointerEventData;\n }\n\n private _activePointerEventData!: DataFromPointerEvent | undefined;\n\n public handlePointerdown(event: PointerEvent): void {\n const { resolvedInput, model } = this.extractDataFromEvent(event);\n if (!model || this.host.disabled || event.button !== 0) {\n event.preventDefault();\n return;\n }\n this.host.track.setPointerCapture(event.pointerId);\n this.updateBoundingRect();\n if (event.pointerType === 'mouse') {\n this.host.labelEl.click();\n }\n this.draggingHandle = model.handle;\n model.handle.dragging = true;\n this.activateHandle(model.name);\n if (resolvedInput) {\n // When the input is resolved forward the pointer event to\n // `handlePointermove` in order to update the value/UI becuase\n // the pointer event was on the track not a handle\n this.handlePointermove(event);\n }\n this.requestUpdate();\n }\n\n public handlePointerup(event: PointerEvent): void {\n const { input, model } = this.extractDataFromEvent(event);\n delete this._activePointerEventData;\n if (!model) return;\n if (event.pointerType === 'mouse') {\n this.host.labelEl.click();\n }\n this.cancelDrag(model);\n this.requestUpdate();\n this.host.track.releasePointerCapture(event.pointerId);\n this.dispatchChangeEvent(input, model.handle);\n }\n\n public handlePointermove(event: PointerEvent): void {\n const { input, model } = this.extractDataFromEvent(event);\n if (!model) return;\n /* c8 ignore next 3 */\n if (!this.draggingHandle) {\n return;\n }\n event.stopPropagation();\n input.value = this.calculateHandlePosition(event, model).toString();\n model.handle.value = parseFloat(input.value);\n this.host.indeterminate = false;\n this.requestUpdate();\n }\n\n public cancelDrag(model?: ModelValue): void {\n model =\n model || this.model.find((item) => item.name === this.activeHandle);\n if (!model) return;\n model.handle.highlight = false;\n delete this.draggingHandle;\n model.handle.dragging = false;\n }\n\n /**\n * Keep the slider value property in sync with the input element's value\n */\n private onInputChange = (event: Event): void => {\n const input = event.target as InputWithModel;\n input.model.handle.value = input.valueAsNumber;\n\n this.requestUpdate();\n this.dispatchChangeEvent(input, input.model.handle);\n };\n\n private onInputFocus = (event: Event): void => {\n const input = event.target as InputWithModel;\n let isFocusVisible;\n try {\n isFocusVisible =\n input.matches(':focus-visible') ||\n this.host.matches('.focus-visible');\n /* c8 ignore next 3 */\n } catch (error) {\n isFocusVisible = this.host.matches('.focus-visible');\n }\n input.model.handle.highlight = isFocusVisible;\n this.requestUpdate();\n };\n\n private onInputBlur = (event: Event): void => {\n const input = event.target as InputWithModel;\n input.model.handle.highlight = false;\n this.requestUpdate();\n };\n\n private onInputKeydown = (event: Event): void => {\n const input = event.target as InputWithModel;\n input.model.handle.highlight = true;\n this.requestUpdate();\n };\n\n private dispatchChangeEvent(\n input: HTMLInputElement,\n handle: SliderHandle\n ): void {\n input.valueAsNumber = handle.value;\n\n const changeEvent = new Event('change', {\n bubbles: true,\n composed: true,\n });\n\n handle.dispatchEvent(changeEvent);\n }\n\n /**\n * Returns the value under the cursor\n * @param: PointerEvent on slider\n * @return: Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(\n event: PointerEvent | MouseEvent,\n model: ModelValue\n ): number {\n const rect = this.boundingClientRect;\n const minOffset = rect.left;\n const offset = event.clientX;\n const size = rect.width;\n\n const directionalOffset = this.host.isLTR\n ? offset - minOffset\n : size - (offset - minOffset);\n const normalized = directionalOffset / size;\n\n return model.normalization.fromNormalized(\n normalized,\n model.range.min,\n model.range.max\n );\n }\n\n public renderHandle(\n model: ModelValue,\n index: number,\n zIndex: number,\n isMultiHandle: boolean\n ): TemplateResult {\n const classes = {\n handle: true,\n dragging: this.draggingHandle?.handleName === model.name,\n 'handle-highlight': model.highlight,\n };\n const style = {\n [this.host.isLTR ? 'left' : 'right']: `${\n model.normalizedValue * 100\n }%`,\n 'z-index': zIndex.toString(),\n // Allow setting background per-handle\n 'background-color': `var(--spectrum-slider-handle-background-color-${index}, var(--spectrum-slider-handle-default-background-color))`,\n 'border-color': `var(--spectrum-slider-handle-border-color-${index}, var(-spectrum-slider-handle-default-border-color))`,\n };\n const ariaLabelledBy = isMultiHandle ? `label input-${index}` : 'label';\n return html`\n <div\n class=${classMap(classes)}\n name=${model.name}\n style=${styleMap(style)}\n role=\"presentation\"\n >\n <input\n type=\"range\"\n class=\"input\"\n id=\"input-${index}\"\n min=${model.clamp.min}\n max=${model.clamp.max}\n step=${model.step}\n value=${model.value}\n aria-disabled=${ifDefined(\n this.host.disabled ? 'true' : undefined\n )}\n tabindex=${ifDefined(this.host.editable ? -1 : undefined)}\n aria-label=${ifDefined(model.ariaLabel)}\n aria-labelledby=${ariaLabelledBy}\n aria-valuetext=${this.formattedValueForHandle(model)}\n @change=${this.onInputChange}\n @focus=${this.onInputFocus}\n @blur=${this.onInputBlur}\n @keydown=${this.onInputKeydown}\n .model=${model}\n />\n </div>\n `;\n }\n\n public render(): TemplateResult[] {\n this.clearHandleComponentCache();\n return this.model.map((model, index) => {\n const zIndex = this.handleOrder.indexOf(model.name) + 1;\n return this.renderHandle(\n model,\n index,\n zIndex,\n this.model.length > 1\n );\n });\n }\n\n /**\n * Returns a list of track segment [start, end] tuples where the values are\n * normalized to be between 0 and 1.\n * @returns A list of track segment tuples [start, end]\n */\n public trackSegments(): [number, number][] {\n const values = this.model.map((model) => model.normalizedValue);\n values.sort((a, b) => a - b);\n\n // The first segment always starts at 0\n values.unshift(0);\n return values.map((value, index, array) => [\n value,\n array[index + 1] ?? 1,\n ]);\n }\n\n private updateModel(): void {\n const handles = [...this.handles.values()];\n\n const getRangeAndClamp = (index: number): RangeAndClamp => {\n const handle = handles[index];\n const previous = handles[index - 1];\n const next = handles[index + 1];\n\n const min =\n typeof handle.min === 'number'\n ? handle.min\n : (this.host.min as number);\n const max =\n typeof handle.max === 'number'\n ? handle.max\n : (this.host.max as number);\n\n const result: RangeAndClamp = {\n range: { min: min, max: max },\n clamp: { min: min, max: max },\n };\n\n if (handle.min === 'previous') {\n if (previous) {\n for (let j = index - 1; j >= 0; j--) {\n const item = handles[j];\n if (typeof item.min === 'number') {\n result.range.min = item.min;\n break;\n }\n }\n result.clamp.min = Math.max(\n previous.value,\n result.range.min\n );\n }\n if (window.__swc.DEBUG) {\n if (!previous) {\n window.__swc.warn(\n this.host,\n '<sp-slider-handle> elements that are the first child of an <sp-slider> element cannot have attribute \"min=\\'previous\\'\"`',\n 'https://opensource.adobe.com/spectrum-web-components/components/slider-handle/#multi-handle-slider-with-ordered-handles'\n );\n }\n }\n }\n if (handle.max === 'next') {\n if (next) {\n for (let j = index + 1; j < handles.length; j++) {\n const item = handles[j];\n if (typeof item.max === 'number') {\n result.range.max = item.max;\n break;\n }\n }\n result.clamp.max = Math.min(next.value, result.range.max);\n }\n if (window.__swc.DEBUG) {\n if (!next) {\n window.__swc.warn(\n this.host,\n '<sp-slider-handle> elements that are the last child of an <sp-slider> element cannot have attribute \"max=\\'next\\'\"',\n 'https://opensource.adobe.com/spectrum-web-components/components/slider-handle/#multi-handle-slider-with-ordered-handles'\n );\n }\n }\n }\n return result;\n };\n\n const modelValues = handles.map((handle, index) => {\n const rangeAndClamp = getRangeAndClamp(index);\n const { toNormalized } = handle.normalization;\n const clampedValue = Math.max(\n Math.min(handle.value, rangeAndClamp.clamp.max),\n rangeAndClamp.clamp.min\n );\n const normalizedValue = toNormalized(\n clampedValue,\n rangeAndClamp.range.min,\n rangeAndClamp.range.max\n );\n const model = {\n name: handle.handleName,\n value: clampedValue,\n normalizedValue,\n highlight: handle.highlight,\n step: handle.step ?? this.host.step,\n normalization: handle.normalization,\n handle,\n ariaLabel:\n handle !== this.host && handle?.label.length > 0\n ? handle.label\n : undefined,\n ...rangeAndClamp,\n };\n return model;\n });\n\n this.model = modelValues;\n }\n\n public async handleUpdatesComplete(): Promise<void> {\n const updates = [...this.handles.values()]\n .filter((handle) => handle !== this.host)\n .map((handle) => handle.updateComplete);\n await Promise.all(updates);\n }\n}\n"],
5
- "mappings": "aAWA,OAAS,QAAAA,MAA4B,gCACrC,OACI,YAAAC,EACA,aAAAC,EACA,YAAAC,MACG,kDACP,OAAS,sBAAAC,MAA0B,6CAEnC,OAEI,gBAAAC,MAEG,oBAwCA,aAAM,gBAAuC,CAQhD,YAAYC,EAAc,CAN1B,KAAQ,QAAqC,IAAI,IACjD,KAAQ,MAAsB,CAAC,EAC/B,KAAQ,YAAwB,CAAC,EAsGjC,KAAU,kBAAoB,IAAY,CACtC,KAAK,mBAAmB,CAC5B,EAgDA,KAAQ,yBAA2B,IAAY,CAC3C,IAAIC,EAAU,CACV,GAAG,KAAK,KAAK,iBAAiB,iBAAiB,CACnD,EACIA,EAAQ,SAAW,IACnBA,EAAU,CAAC,KAAK,IAAoB,GAGpC,CAAAA,EAAQ,KAAMC,GAAM,KAAK,eAAeA,CAAC,CAAC,IAG9C,KAAK,QAAU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AK,IAAI5C,EAAO,MAAO0C,EAAc,MAAM,GAAG,EAC9CA,EAAc,MAAM,GACxB,EACMG,EAAkBF,EACpBC,EACAF,EAAc,MAAM,IACpBA,EAAc,MAAM,GACxB,EAeA,MAdc,CACV,KAAM1C,EAAO,WACb,MAAO4C,EACP,gBAAAC,EACA,UAAW7C,EAAO,UAClB,MAAME,EAAAF,EAAO,OAAP,KAAAE,EAAe,KAAK,KAAK,KAC/B,cAAeF,EAAO,cACtB,OAAAA,EACA,UACIA,IAAW,KAAK,OAAQA,GAAA,YAAAA,EAAQ,MAAM,QAAS,EACzCA,EAAO,MACP,OACV,GAAG0C,CACP,CAEJ,CAAC,EAED,KAAK,MAAQD,CACjB,CAEA,MAAa,uBAAuC,CAChD,MAAMK,EAAU,CAAC,GAAG,KAAK,QAAQ,OAAO,CAAC,EACpC,OAAQ9C,GAAWA,IAAW,KAAK,IAAI,EACvC,IAAKA,GAAWA,EAAO,cAAc,EAC1C,MAAM,QAAQ,IAAI8C,CAAO,CAC7B,CACJ",
4
+ "sourcesContent": ["/*\nCopyright 2021 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport {\n classMap,\n ifDefined,\n styleMap,\n} from '@spectrum-web-components/base/src/directives.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\nimport { Slider } from './Slider.js';\nimport {\n Controller,\n SliderHandle,\n SliderNormalization,\n} from './SliderHandle.js';\n\ninterface HandleReference {\n handle: HTMLElement;\n input: HTMLInputElement;\n}\n\ninterface HandleComponents extends HandleReference {\n model: SliderHandle;\n}\n\ninterface RangeAndClamp {\n range: { min: number; max: number };\n clamp: { min: number; max: number };\n}\ninterface ModelValue extends RangeAndClamp {\n name: string;\n value: number;\n normalizedValue: number;\n step: number;\n highlight: boolean;\n ariaLabel?: string;\n normalization: SliderNormalization;\n handle: SliderHandle;\n}\n\ninterface InputWithModel extends HTMLInputElement {\n model: ModelValue;\n}\n\ninterface DataFromPointerEvent {\n resolvedInput: boolean;\n input: InputWithModel;\n model?: ModelValue;\n}\n\nexport interface HandleValueDictionary {\n [key: string]: number;\n}\n\nexport class HandleController implements Controller {\n private host!: Slider;\n private handles: Map<string, SliderHandle> = new Map();\n private model: ModelValue[] = [];\n private handleOrder: string[] = [];\n private draggingHandle?: SliderHandle;\n private handleRefMap?: WeakMap<SliderHandle, HandleReference>;\n\n constructor(host: Slider) {\n this.host = host;\n\n new MutationController(this.host, {\n config: {\n subtree: true,\n childList: true,\n },\n callback: () => {\n this.extractModelFromLightDom();\n },\n });\n\n this.extractModelFromLightDom();\n }\n\n public get values(): HandleValueDictionary {\n const result: HandleValueDictionary = {};\n for (const model of this.handles.values()) {\n result[model.handleName] = model.value;\n }\n return result;\n }\n\n public get size(): number {\n return this.handles.size;\n }\n\n public inputForHandle(handle: SliderHandle): HTMLInputElement | undefined {\n if (this.handles.has(handle.handleName)) {\n const { input } = this.getHandleElements(handle);\n return input;\n }\n /* c8 ignore next 2 */\n throw new Error(`No input for handle \"${handle.name}\"`);\n }\n\n public requestUpdate(): void {\n if (this.host.hasUpdated) {\n this.host.requestUpdate();\n }\n }\n\n /**\n * It is possible for value attributes to be set programmatically. The <input>\n * for a particular slider needs to have an opportunity to validate any such\n * values\n *\n * @param handle Handle who's value needs validation\n */\n public setValueFromHandle(handle: SliderHandle): void {\n const elements = this.getHandleElements(handle);\n /* c8 ignore next */\n if (!elements) return;\n\n const { input } = elements;\n if (input.valueAsNumber === handle.value) {\n if (handle.dragging) {\n handle.dispatchInputEvent();\n }\n } else {\n input.valueAsNumber = handle.value;\n this.requestUpdate();\n }\n handle.value = input.valueAsNumber;\n }\n\n public handleHasChanged(handle: SliderHandle): void {\n if (handle !== this.host) {\n this.requestUpdate();\n }\n }\n\n public formattedValueForHandle(model: ModelValue): string {\n const { handle } = model;\n const numberFormat = handle.numberFormat ?? this.host.numberFormat;\n return handle.getAriaHandleText(model.value, numberFormat);\n }\n\n public get formattedValues(): Map<string, string> {\n const result = new Map<string, string>();\n for (const model of this.model) {\n result.set(model.name, this.formattedValueForHandle(model));\n }\n return result;\n }\n\n public get focusElement(): HTMLElement {\n const { input } = this.getActiveHandleElements();\n if (\n this.host.editable &&\n !(input as InputWithModel).model.handle.dragging\n ) {\n return this.host.numberField;\n }\n return input;\n }\n\n protected handleOrientation = (): void => {\n this.updateBoundingRect();\n };\n\n public hostConnected(): void {\n if ('orientation' in screen) {\n screen.orientation.addEventListener(\n 'change',\n this.handleOrientation\n );\n } else {\n window.addEventListener(\n 'orientationchange',\n this.handleOrientation\n );\n }\n }\n\n public hostDisconnected(): void {\n if ('orientation' in screen) {\n screen.orientation.removeEventListener(\n 'change',\n this.handleOrientation\n );\n } else {\n window.removeEventListener(\n 'orientationchange',\n this.handleOrientation\n );\n }\n }\n\n public hostUpdate(): void {\n this.updateModel();\n }\n\n // Since extractModelFromLightDom bails on the first un-upgraded handle,\n // a maximum of one listener will be set up per extraction attempt.\n private waitForUpgrade(handle: HTMLElement): boolean {\n if (handle instanceof SliderHandle) {\n return false;\n }\n handle.addEventListener(\n 'sp-slider-handle-ready',\n () => this.extractModelFromLightDom(),\n { once: true, passive: true }\n );\n return true;\n }\n\n private extractModelFromLightDom = (): void => {\n let handles = [\n ...this.host.querySelectorAll('[slot=\"handle\"]'),\n ] as SliderHandle[];\n if (handles.length === 0) {\n handles = [this.host as SliderHandle];\n }\n // extractModelFromLightDom depends on slotted handles already having been upgraded\n if (handles.some((h) => this.waitForUpgrade(h))) {\n return;\n }\n this.handles = new Map();\n this.handleOrder = [];\n handles.forEach((handle, index) => {\n /* c8 ignore next */\n if (!handle.handleName?.length) {\n handle.name = `handle${index + 1}`;\n }\n this.handles.set(handle.handleName, handle);\n this.handleOrder.push(handle.handleName);\n handle.handleController = this;\n });\n this.requestUpdate();\n };\n\n public get activeHandle(): string {\n return this.handleOrder[this.handleOrder.length - 1];\n }\n\n public get activeHandleInputId(): string {\n const active = this.activeHandle;\n const index = this.model.findIndex((model) => model.name === active);\n return `input-${index}`;\n }\n\n public activateHandle(name: string): void {\n const index = this.handleOrder.findIndex((item) => item === name);\n if (index >= 0) {\n this.handleOrder.splice(index, 1);\n }\n this.handleOrder.push(name);\n }\n\n private getActiveHandleElements(): HandleComponents {\n const name = this.activeHandle;\n const handleSlider = this.handles.get(name) as SliderHandle;\n const elements = this.getHandleElements(\n handleSlider\n ) as HandleReference;\n return { model: handleSlider, ...elements };\n }\n\n private getHandleElements(sliderHandle: SliderHandle): HandleReference {\n if (!this.handleRefMap) {\n this.handleRefMap = new WeakMap();\n\n const inputNodes =\n this.host.shadowRoot.querySelectorAll('.handle > input');\n for (const inputNode of inputNodes) {\n const input = inputNode as HTMLInputElement;\n const handle = input.parentElement as HTMLElement;\n const model = this.handles.get(\n handle.getAttribute('name') as string\n );\n if (model) {\n this.handleRefMap.set(model, { input, handle });\n }\n }\n }\n\n const components = this.handleRefMap.get(\n sliderHandle\n ) as HandleReference;\n return components;\n }\n\n private clearHandleComponentCache(): void {\n delete this.handleRefMap;\n }\n\n private _boundingClientRect?: DOMRect;\n\n private get boundingClientRect(): DOMRect {\n if (!this._boundingClientRect) {\n this._boundingClientRect = this.host.track.getBoundingClientRect();\n }\n return this._boundingClientRect;\n }\n\n private updateBoundingRect(): void {\n delete this._boundingClientRect;\n }\n\n /**\n * Return the `input` and `model` associated with the event and\n * whether the `input` is a `resolvedInput` meaning it was acquired\n * from the `model` rather than the event.\n */\n protected extractDataFromEvent(event: PointerEvent): DataFromPointerEvent {\n if (!this._activePointerEventData) {\n let input = (event.target as Element).querySelector(\n ':scope > .input'\n ) as InputWithModel;\n const resolvedInput = !input;\n const model = input\n ? input.model\n : this.model.find((item) => item.name === this.activeHandle);\n if (!input && !!model) {\n input = model.handle.focusElement as InputWithModel;\n }\n this._activePointerEventData = {\n input,\n model,\n resolvedInput,\n };\n }\n return this._activePointerEventData;\n }\n\n private _activePointerEventData!: DataFromPointerEvent | undefined;\n\n public handlePointerdown(event: PointerEvent): void {\n const { resolvedInput, model } = this.extractDataFromEvent(event);\n if (!model || this.host.disabled || event.button !== 0) {\n event.preventDefault();\n return;\n }\n this.host.track.setPointerCapture(event.pointerId);\n this.updateBoundingRect();\n if (event.pointerType === 'mouse') {\n this.host.labelEl.click();\n }\n this.draggingHandle = model.handle;\n model.handle.dragging = true;\n this.activateHandle(model.name);\n if (resolvedInput) {\n // When the input is resolved forward the pointer event to\n // `handlePointermove` in order to update the value/UI becuase\n // the pointer event was on the track not a handle\n this.handlePointermove(event);\n }\n this.requestUpdate();\n }\n\n public handlePointerup(event: PointerEvent): void {\n const { input, model } = this.extractDataFromEvent(event);\n delete this._activePointerEventData;\n if (!model) return;\n if (event.pointerType === 'mouse') {\n this.host.labelEl.click();\n }\n this.cancelDrag(model);\n this.requestUpdate();\n this.host.track.releasePointerCapture(event.pointerId);\n this.dispatchChangeEvent(input, model.handle);\n }\n\n public handlePointermove(event: PointerEvent): void {\n const { input, model } = this.extractDataFromEvent(event);\n if (!model) return;\n /* c8 ignore next 3 */\n if (!this.draggingHandle) {\n return;\n }\n event.stopPropagation();\n input.value = this.calculateHandlePosition(event, model).toString();\n model.handle.value = parseFloat(input.value);\n this.host.indeterminate = false;\n this.requestUpdate();\n }\n\n public cancelDrag(model?: ModelValue): void {\n model =\n model || this.model.find((item) => item.name === this.activeHandle);\n if (!model) return;\n model.handle.highlight = false;\n delete this.draggingHandle;\n model.handle.dragging = false;\n }\n\n /**\n * Keep the slider value property in sync with the input element's value\n */\n private onInputChange = (event: Event): void => {\n const input = event.target as InputWithModel;\n input.model.handle.value = input.valueAsNumber;\n\n this.requestUpdate();\n this.dispatchChangeEvent(input, input.model.handle);\n };\n\n private onInputFocus = (event: Event): void => {\n const input = event.target as InputWithModel;\n let isFocusVisible;\n try {\n isFocusVisible =\n input.matches(':focus-visible') ||\n this.host.matches('.focus-visible');\n /* c8 ignore next 3 */\n } catch (error) {\n isFocusVisible = this.host.matches('.focus-visible');\n }\n input.model.handle.highlight = isFocusVisible;\n this.requestUpdate();\n };\n\n private onInputBlur = (event: Event): void => {\n const input = event.target as InputWithModel;\n input.model.handle.highlight = false;\n this.requestUpdate();\n };\n\n private onInputKeydown = (event: Event): void => {\n const input = event.target as InputWithModel;\n input.model.handle.highlight = true;\n this.requestUpdate();\n };\n\n private dispatchChangeEvent(\n input: HTMLInputElement,\n handle: SliderHandle\n ): void {\n input.valueAsNumber = handle.value;\n\n const changeEvent = new Event('change', {\n bubbles: true,\n composed: true,\n });\n\n handle.dispatchEvent(changeEvent);\n }\n\n /**\n * Returns the value under the cursor\n * @param: PointerEvent on slider\n * @return: Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(\n event: PointerEvent | MouseEvent,\n model: ModelValue\n ): number {\n const rect = this.boundingClientRect;\n const minOffset = rect.left;\n const offset = event.clientX;\n const size = rect.width;\n\n const directionalOffset = this.host.isLTR\n ? offset - minOffset\n : size - (offset - minOffset);\n const normalized = directionalOffset / size;\n\n return model.normalization.fromNormalized(\n normalized,\n model.range.min,\n model.range.max\n );\n }\n\n public renderHandle(\n model: ModelValue,\n index: number,\n zIndex: number,\n isMultiHandle: boolean\n ): TemplateResult {\n const classes = {\n handle: true,\n dragging: this.draggingHandle?.handleName === model.name,\n 'handle-highlight': model.highlight,\n };\n const style = {\n [this.host.isLTR ? 'left' : 'right']: `${\n model.normalizedValue * 100\n }%`,\n 'z-index': zIndex.toString(),\n // Allow setting background per-handle\n 'background-color': `var(--spectrum-slider-handle-background-color-${index}, var(--spectrum-slider-handle-background-color))`,\n 'border-color': `var(--spectrum-slider-handle-border-color-${index}, var(--spectrum-slider-handle-border-color))`,\n };\n const ariaLabelledBy = isMultiHandle ? `label input-${index}` : 'label';\n return html`\n <div\n class=${classMap(classes)}\n name=${model.name}\n style=${styleMap(style)}\n role=\"presentation\"\n >\n <input\n type=\"range\"\n class=\"input\"\n id=\"input-${index}\"\n min=${model.clamp.min}\n max=${model.clamp.max}\n step=${model.step}\n value=${model.value}\n aria-disabled=${ifDefined(\n this.host.disabled ? 'true' : undefined\n )}\n tabindex=${ifDefined(this.host.editable ? -1 : undefined)}\n aria-label=${ifDefined(model.ariaLabel)}\n aria-labelledby=${ariaLabelledBy}\n aria-valuetext=${this.formattedValueForHandle(model)}\n @change=${this.onInputChange}\n @focus=${this.onInputFocus}\n @blur=${this.onInputBlur}\n @keydown=${this.onInputKeydown}\n .model=${model}\n />\n </div>\n `;\n }\n\n public render(): TemplateResult[] {\n this.clearHandleComponentCache();\n return this.model.map((model, index) => {\n const zIndex = this.handleOrder.indexOf(model.name) + 1;\n return this.renderHandle(\n model,\n index,\n zIndex,\n this.model.length > 1\n );\n });\n }\n\n /**\n * Returns a list of track segment [start, end] tuples where the values are\n * normalized to be between 0 and 1.\n * @returns A list of track segment tuples [start, end]\n */\n public trackSegments(): [number, number][] {\n const values = this.model.map((model) => model.normalizedValue);\n values.sort((a, b) => a - b);\n\n // The first segment always starts at 0\n values.unshift(0);\n return values.map((value, index, array) => [\n value,\n array[index + 1] ?? 1,\n ]);\n }\n\n private updateModel(): void {\n const handles = [...this.handles.values()];\n\n const getRangeAndClamp = (index: number): RangeAndClamp => {\n const handle = handles[index];\n const previous = handles[index - 1];\n const next = handles[index + 1];\n\n const min =\n typeof handle.min === 'number'\n ? handle.min\n : (this.host.min as number);\n const max =\n typeof handle.max === 'number'\n ? handle.max\n : (this.host.max as number);\n\n const result: RangeAndClamp = {\n range: { min: min, max: max },\n clamp: { min: min, max: max },\n };\n\n if (handle.min === 'previous') {\n if (previous) {\n for (let j = index - 1; j >= 0; j--) {\n const item = handles[j];\n if (typeof item.min === 'number') {\n result.range.min = item.min;\n break;\n }\n }\n result.clamp.min = Math.max(\n previous.value,\n result.range.min\n );\n }\n if (window.__swc.DEBUG) {\n if (!previous) {\n window.__swc.warn(\n this.host,\n '<sp-slider-handle> elements that are the first child of an <sp-slider> element cannot have attribute \"min=\\'previous\\'\"`',\n 'https://opensource.adobe.com/spectrum-web-components/components/slider-handle/#multi-handle-slider-with-ordered-handles'\n );\n }\n }\n }\n if (handle.max === 'next') {\n if (next) {\n for (let j = index + 1; j < handles.length; j++) {\n const item = handles[j];\n if (typeof item.max === 'number') {\n result.range.max = item.max;\n break;\n }\n }\n result.clamp.max = Math.min(next.value, result.range.max);\n }\n if (window.__swc.DEBUG) {\n if (!next) {\n window.__swc.warn(\n this.host,\n '<sp-slider-handle> elements that are the last child of an <sp-slider> element cannot have attribute \"max=\\'next\\'\"',\n 'https://opensource.adobe.com/spectrum-web-components/components/slider-handle/#multi-handle-slider-with-ordered-handles'\n );\n }\n }\n }\n return result;\n };\n\n const modelValues = handles.map((handle, index) => {\n const rangeAndClamp = getRangeAndClamp(index);\n const { toNormalized } = handle.normalization;\n const clampedValue = Math.max(\n Math.min(handle.value, rangeAndClamp.clamp.max),\n rangeAndClamp.clamp.min\n );\n const normalizedValue = toNormalized(\n clampedValue,\n rangeAndClamp.range.min,\n rangeAndClamp.range.max\n );\n const model = {\n name: handle.handleName,\n value: clampedValue,\n normalizedValue,\n highlight: handle.highlight,\n step: handle.step ?? this.host.step,\n normalization: handle.normalization,\n handle,\n ariaLabel:\n handle !== this.host && handle?.label.length > 0\n ? handle.label\n : undefined,\n ...rangeAndClamp,\n };\n return model;\n });\n\n this.model = modelValues;\n }\n\n public async handleUpdatesComplete(): Promise<void> {\n const updates = [...this.handles.values()]\n .filter((handle) => handle !== this.host)\n .map((handle) => handle.updateComplete);\n await Promise.all(updates);\n }\n}\n"],
5
+ "mappings": "aAWA,OAAS,QAAAA,MAA4B,gCACrC,OACI,YAAAC,EACA,aAAAC,EACA,YAAAC,MACG,kDACP,OAAS,sB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,QAASG,EAAIvC,EAAQ,EAAGuC,EAAI1C,EAAQ,OAAQ0C,IAAK,CAC7C,MAAM3B,EAAOf,EAAQ0C,CAAC,EACtB,GAAI,OAAO3B,EAAK,KAAQ,SAAU,CAC9BN,EAAO,MAAM,IAAMM,EAAK,IACxB,OAGRN,EAAO,MAAM,IAAM,KAAK,IAAI8B,EAAK,MAAO9B,EAAO,MAAM,GAAG,EAYhE,OAAOA,CACX,EAEMkC,EAAc3C,EAAQ,IAAI,CAACE,EAAQC,IAAU,CAtnB3D,IAAAC,EAunBY,MAAMwC,EAAgBP,EAAiBlC,CAAK,EACtC,CAAE,aAAA0C,CAAa,EAAI3C,EAAO,cAC1B4C,EAAe,KAAK,IACtB,KAAK,IAAI5C,EAAO,MAAO0C,EAAc,MAAM,GAAG,EAC9CA,EAAc,MAAM,GACxB,EACMG,EAAkBF,EACpBC,EACAF,EAAc,MAAM,IACpBA,EAAc,MAAM,GACxB,EAeA,MAdc,CACV,KAAM1C,EAAO,WACb,MAAO4C,EACP,gBAAAC,EACA,UAAW7C,EAAO,UAClB,MAAME,EAAAF,EAAO,OAAP,KAAAE,EAAe,KAAK,KAAK,KAC/B,cAAeF,EAAO,cACtB,OAAAA,EACA,UACIA,IAAW,KAAK,OAAQA,GAAA,YAAAA,EAAQ,MAAM,QAAS,EACzCA,EAAO,MACP,OACV,GAAG0C,CACP,CAEJ,CAAC,EAED,KAAK,MAAQD,CACjB,CAEA,MAAa,uBAAuC,CAChD,MAAMK,EAAU,CAAC,GAAG,KAAK,QAAQ,OAAO,CAAC,EACpC,OAAQ9C,GAAWA,IAAW,KAAK,IAAI,EACvC,IAAKA,GAAWA,EAAO,cAAc,EAC1C,MAAM,QAAQ,IAAI8C,CAAO,CAC7B,CACJ",
6
6
  "names": ["html", "classMap", "ifDefined", "styleMap", "MutationController", "SliderHandle", "host", "handles", "h", "handle", "index", "_a", "event", "input", "isFocusVisible", "error", "result", "model", "elements", "numberFormat", "active", "name", "item", "handleSlider", "sliderHandle", "inputNodes", "inputNode", "resolvedInput", "changeEvent", "rect", "minOffset", "offset", "size", "normalized", "zIndex", "isMultiHandle", "classes", "style", "ariaLabelledBy", "values", "a", "b", "value", "array", "getRangeAndClamp", "previous", "next", "min", "max", "j", "modelValues", "rangeAndClamp", "toNormalized", "clampedValue", "normalizedValue", "updates"]
7
7
  }