@zywave/zui-slider 4.4.0-pre.6 → 4.4.0-pre.7

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.
@@ -691,6 +691,54 @@
691
691
  }
692
692
  ]
693
693
  },
694
+ {
695
+ "kind": "method",
696
+ "name": "#nudgeStepsValue",
697
+ "privacy": "private",
698
+ "return": {
699
+ "type": {
700
+ "text": "string"
701
+ }
702
+ },
703
+ "parameters": [
704
+ {
705
+ "name": "flag",
706
+ "type": {
707
+ "text": "ThumbFlag"
708
+ }
709
+ },
710
+ {
711
+ "name": "resolved",
712
+ "type": {
713
+ "text": "string"
714
+ }
715
+ }
716
+ ]
717
+ },
718
+ {
719
+ "kind": "method",
720
+ "name": "#nudgeNumericValue",
721
+ "privacy": "private",
722
+ "return": {
723
+ "type": {
724
+ "text": "string"
725
+ }
726
+ },
727
+ "parameters": [
728
+ {
729
+ "name": "flag",
730
+ "type": {
731
+ "text": "ThumbFlag"
732
+ }
733
+ },
734
+ {
735
+ "name": "processed",
736
+ "type": {
737
+ "text": "string"
738
+ }
739
+ }
740
+ ]
741
+ },
694
742
  {
695
743
  "kind": "method",
696
744
  "name": "#makeFloatingChange",
@@ -665,6 +665,44 @@ export class ZuiSlider extends ZuiFormAssociatedElement {
665
665
  },
666
666
  };
667
667
  }
668
+ #nudgeStepsValue(flag, resolved) {
669
+ if (flag === 'thumb') {
670
+ return resolved;
671
+ }
672
+ const resolvedIdx = this.#stepsIndexOf(resolved);
673
+ const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));
674
+ const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));
675
+ if (flag === 'startThumb' && resolvedIdx >= endIdx) {
676
+ const nudgedIdx = endIdx - 1;
677
+ return nudgedIdx >= 0 ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);
678
+ }
679
+ if (flag === 'endThumb' && resolvedIdx <= startIdx) {
680
+ const nudgedIdx = startIdx + 1;
681
+ return nudgedIdx < this.#normalizedSteps.length ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);
682
+ }
683
+ return resolved;
684
+ }
685
+ #nudgeNumericValue(flag, processed) {
686
+ if (flag === 'thumb') {
687
+ return processed;
688
+ }
689
+ const effectiveStep = this.step > 0 ? this.step : 1;
690
+ if (flag === 'startThumb') {
691
+ const endNum = parseFloat(this.#valueEnd);
692
+ if (parseFloat(processed) >= endNum) {
693
+ const nudged = this.#processFloatingValue(endNum - effectiveStep);
694
+ return parseFloat(nudged) < endNum ? nudged : this.#currentValueForFlag(flag);
695
+ }
696
+ }
697
+ else {
698
+ const startNum = parseFloat(this.#valueStart);
699
+ if (parseFloat(processed) <= startNum) {
700
+ const nudged = this.#processFloatingValue(startNum + effectiveStep);
701
+ return parseFloat(nudged) > startNum ? nudged : this.#currentValueForFlag(flag);
702
+ }
703
+ }
704
+ return processed;
705
+ }
668
706
  #makeFloatingChange(flag, setter, dispatch) {
669
707
  return (e) => {
670
708
  if (this.readOnly) {
@@ -682,51 +720,19 @@ export class ZuiSlider extends ZuiFormAssociatedElement {
682
720
  if (this.#currentValueForFlag(flag) !== before) {
683
721
  dispatch();
684
722
  }
723
+ // Force re-render so live() corrects the DOM when the nudged/clamped value equals the stored value and the setter no-ops.
724
+ this.requestUpdate();
685
725
  };
686
726
  if (this.#stepsMode) {
687
727
  const resolved = this.#resolveFloatingInput(input.value);
688
- if (resolved !== null) {
689
- let finalResolved = resolved;
690
- if (flag !== 'thumb') {
691
- const resolvedIdx = this.#stepsIndexOf(resolved);
692
- const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));
693
- const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));
694
- if (flag === 'startThumb' && resolvedIdx >= endIdx) {
695
- const nudgedIdx = endIdx - 1;
696
- finalResolved = nudgedIdx >= 0 ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);
697
- }
698
- else if (flag === 'endThumb' && resolvedIdx <= startIdx) {
699
- const nudgedIdx = startIdx + 1;
700
- finalResolved =
701
- nudgedIdx < this.#normalizedSteps.length ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);
702
- }
703
- }
704
- commit(finalResolved);
705
- }
706
- else {
728
+ if (resolved === null) {
707
729
  input.value = this.#currentValueForFlag(flag);
730
+ return;
708
731
  }
732
+ commit(this.#nudgeStepsValue(flag, resolved));
709
733
  }
710
734
  else {
711
- let processed = this.#processFloatingValue(parseFloat(input.value));
712
- if (flag !== 'thumb') {
713
- const effectiveStep = this.step > 0 ? this.step : 1;
714
- if (flag === 'startThumb') {
715
- const endNum = parseFloat(this.#valueEnd);
716
- if (parseFloat(processed) >= endNum) {
717
- const nudged = this.#processFloatingValue(endNum - effectiveStep);
718
- processed = parseFloat(nudged) < endNum ? nudged : this.#currentValueForFlag(flag);
719
- }
720
- }
721
- else {
722
- const startNum = parseFloat(this.#valueStart);
723
- if (parseFloat(processed) <= startNum) {
724
- const nudged = this.#processFloatingValue(startNum + effectiveStep);
725
- processed = parseFloat(nudged) > startNum ? nudged : this.#currentValueForFlag(flag);
726
- }
727
- }
728
- }
729
- commit(processed);
735
+ commit(this.#nudgeNumericValue(flag, this.#processFloatingValue(parseFloat(input.value))));
730
736
  }
731
737
  };
732
738
  }
@@ -1 +1 @@
1
- {"version":3,"file":"zui-slider.js","sourceRoot":"","sources":["../src/zui-slider.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,M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CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;SAC/F;KACF,CAAC;wCACsB;AAEQ;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6CAAuE;AAsKtG;IADC,QAAQ,EAAE;sCAGV;AAc4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAe;AAG3C;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;2CAGtC;AAWD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;yCAGpC;AAU2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAAS;AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAAW;AAEV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAU;AAGuB;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;iDAAwB;AAmoBrF,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { ZuiFormAssociatedElement } from '@zywave/zui-base';\nimport { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { style } from './zui-slider-css.js';\n\ntype ThumbFlag = 'thumb' | 'startThumb' | 'endThumb';\n\n/** Number, string, or `{ value, label? }` object. `label` is the display value; `value` drives snapping. */\ntype StepInput = number | string | { value: number | string; label?: string };\n\n/**\n * A range form control for choosing values along a slider.\n * @element zui-slider\n *\n * @attr {string | null} [name=null] - The name of this element that is associated with form submission\n * @attr {boolean} [disabled=false] - Represents whether a user can make changes to this element; if true, the value of this element will be excluded from the form submission\n * @attr {boolean} [readonly=false] - Represents whether a user can make changes to this element; the value of this element will still be included in the form submission\n * @attr {boolean} [autofocus=false] - If true, this element will be focused when connected to the document\n * @attr {number} [value=50] - Represents the value of the input (single mode). Can be set to a default value, and will reflect the value provided by the user when interactive with the control\n * @attr {boolean} [range=false] - Enables range mode with two thumbs for selecting a range\n * @attr {number} [value-start=0] - Represents the start (lower) value in range mode\n * @attr {number} [value-end=100] - Represents the end (upper) value in range mode\n * @attr {number} [min=0] - Represents the minimum permitted value\n * @attr {number} [max=100] - Represents the maximum permitted value\n * @attr {number} [step=0] - Represents the stepping interval; 0 means any value is allowed\n * @attr {string} [steps=''] - Comma-separated step labels; overrides min/max/step. Labels containing commas must be set via the property instead.\n * @attr {boolean} [show-step-labels=false] - When set, displays each step's label beneath its dot on the track\n * @prop {string | null} [name=null] - The name of this element that is associated with form submission\n * @prop {boolean} [disabled=false] - Represents whether a user can make changes to this element; if true, the value of this element will be excluded from the form submission\n * @prop {boolean} [readOnly=false] - Represents whether a user can make changes to this element; the value of this element will still be included in the form submission\n * @prop {boolean} [autofocus=false] - If true, this element will be focused when connected to the document\n * @prop {number} [valueAsNumber=50] - Returns the value as a number. Invalid or non-numeric values are clamped to min; empty string (representing an in-progress edit) returns NaN\n * @prop {string} [value='50'] - Represents the value of the input (single mode). Can be set to a default value, and will reflect the value provided by the user when interactive with the control\n * @prop {number} [progress=50] - Determines visual placement of the slider thumb along the line (single mode)\n * @prop {boolean} [range=false] - Enables range mode with two thumbs for selecting a range\n * @prop {string} [valueStart='0'] - Represents the start (lower) value in range mode\n * @prop {string} [valueEnd='100'] - Represents the end (upper) value in range mode\n * @prop {number} [progressStart=0] - Determines visual placement of the start thumb in range mode\n * @prop {number} [progressEnd=100] - Determines visual placement of the end thumb in range mode\n * @prop {number} [min=0] - Represents the minimum permitted value\n * @prop {number} [max=100] - Represents the maximum permitted value\n * @prop {number} [step=0] - Represents the stepping interval; 0 means any value is allowed\n * @prop {StepInput[]} [steps=[]] - Custom step values; overrides min/max/step. Thumbs at equal visual intervals. Accepts number, string, or { value, label? }. Use { value: Infinity, label: '...' } for an unbounded overflow step. Labels with commas must be set via the property.\n * @prop {((input: string) => number | string | null) | null} [stepParser=null] - Resolves user-typed strings to a step value; returns a number (snap to nearest), a valid step label, or null to reject. Must be set via the property.\n * @prop {boolean} [showStepLabels=false] - When true, displays each step's label (or its value if no label was provided) beneath the corresponding dot on the track\n *\n * @cssprop [--zui-slider-input-width=7ch] - Width of the floating value input above each slider thumb\n *\n * @event {CustomEvent} change - Fires when value changes; in single mode detail is the value string; in range mode detail is { valueStart, valueEnd }\n */\nexport class ZuiSlider extends ZuiFormAssociatedElement {\n #defaultValue: string = '50';\n #defaultValueStart: string = '0';\n #defaultValueEnd: string = '100';\n\n #value: string = '50';\n #valueStart: string = '0';\n #valueEnd: string = '100';\n\n #cachedNormalizedSteps: { value: number | string; label: string }[] | null = null;\n #cachedNumericValues: number[] | null = null;\n\n #thumbInputState = new Map<\n ThumbFlag,\n {\n visible: boolean;\n focused: boolean;\n committed: boolean;\n timer?: ReturnType<typeof setTimeout>;\n }\n >([\n ['thumb', { visible: false, focused: false, committed: false }],\n ['startThumb', { visible: false, focused: false, committed: false }],\n ['endThumb', { visible: false, focused: false, committed: false }],\n ]);\n\n #onThumbFloatingChange = this.#makeFloatingChange(\n 'thumb',\n (v) => (this.value = v),\n () => this.#onChange()\n );\n #onStartThumbFloatingChange = this.#makeFloatingChange(\n 'startThumb',\n (v) => (this.valueStart = v),\n () => this.#onRangeChange()\n );\n #onEndThumbFloatingChange = this.#makeFloatingChange(\n 'endThumb',\n (v) => (this.valueEnd = v),\n () => this.#onRangeChange()\n );\n\n // Cached keydown handler: Enter commits the floating input value in both number and text modes.\n #onFloatingInputKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n const input = e.target as HTMLInputElement;\n input.dispatchEvent(new Event('change'));\n }\n };\n\n #onRangeStartInput = this.#onRangeInput('start');\n #onRangeEndInput = this.#onRangeInput('end');\n #stopClickPropagation = (e: Event) => e.stopPropagation();\n\n // Cached pointer/focus handlers per thumb; prevents new closures on every render\n #h: Record<\n ThumbFlag,\n { show: () => void; hide: () => void; focus: () => void; input: () => void; blurCommit: (e: FocusEvent) => void }\n > = {\n thumb: this.#makeThumbHandlers('thumb'),\n startThumb: this.#makeThumbHandlers('startThumb'),\n endThumb: this.#makeThumbHandlers('endThumb'),\n };\n\n static get styles() {\n return [super.styles, style];\n }\n\n @property({\n converter: {\n fromAttribute: (value: string | null) => (value ? value.split(',').map((s) => s.trim()) : []),\n toAttribute: (value: StepInput[]) =>\n value.map((s) => (typeof s === 'object' ? s.label ?? String(s.value) : String(s))).join(','),\n },\n })\n steps: StepInput[] = [];\n\n @property({ attribute: false }) stepParser: ((input: string) => number | string | null) | null = null;\n\n connectedCallback() {\n super.connectedCallback();\n this.updateComplete.then(() => {\n if (this.#stepsMode) {\n this.#syncValuesToSteps();\n if (this.range) {\n this.#defaultValueStart = this.#valueStart;\n this.#defaultValueEnd = this.#valueEnd;\n } else {\n this.#defaultValue = this.#value;\n }\n return;\n }\n if (this.range) {\n const [startInput, endInput] = this.#rangeInputs();\n this.#valueStart = startInput.value;\n this.#valueEnd = endInput.value;\n this.#defaultValueStart = startInput.value;\n this.#defaultValueEnd = endInput.value;\n this._setFormValue(`${startInput.value},${endInput.value}`);\n } else {\n const input = this.#singleInput();\n this.#value = input.value;\n this.#defaultValue = input.value;\n this._setFormValue(input.value);\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#clearAllThumbInputState();\n // Re-render to reflect cleared visibility state; Lit defers this until reconnect.\n this.requestUpdate();\n }\n\n protected updated(changed: Map<PropertyKey, unknown>) {\n if (changed.has('disabled') && this.disabled) {\n this.#clearAllThumbInputState();\n }\n if (changed.has('steps')) {\n this.#cachedNormalizedSteps = null;\n this.#cachedNumericValues = null;\n if (this.#stepsMode) {\n this.#syncValuesToSteps();\n }\n }\n if (!this.#stepsMode && (changed.has('min') || changed.has('max'))) {\n // Native inputs clamp/snap to new bounds; read back and sync state. Re-render if value changed.\n if (this.range) {\n const [startInput, endInput] = this.#rangeInputs();\n const newStart = startInput.value;\n const newEnd = endInput.value;\n if (newStart !== this.#valueStart || newEnd !== this.#valueEnd) {\n this.#valueStart = newStart;\n this.#valueEnd = newEnd;\n this.requestUpdate();\n }\n this._setFormValue(`${this.#valueStart},${this.#valueEnd}`);\n } else {\n const newValue = this.#singleInput().value;\n if (newValue !== this.#value) {\n this.#value = newValue;\n this.requestUpdate();\n }\n this._setFormValue(this.#value);\n }\n }\n }\n\n #singleInput(): HTMLInputElement {\n return this.shadowRoot!.querySelector<HTMLInputElement>('input[type=\"range\"]')!;\n }\n\n #rangeInputs(): [HTMLInputElement, HTMLInputElement] {\n const inputs = this.shadowRoot!.querySelectorAll<HTMLInputElement>('input[type=\"range\"]');\n return [inputs[0], inputs[1]];\n }\n\n protected get _focusControlSelector() {\n return 'input';\n }\n\n protected get _formValue() {\n return this.range ? `${this.#valueStart},${this.#valueEnd}` : this.#value;\n }\n\n protected formResetCallback() {\n this.#clearAllThumbInputState();\n // Force re-render: if the reset value equals the current value, the setter's requestUpdate is a no-op.\n this.requestUpdate();\n if (this.range) {\n this.valueStart = this.#defaultValueStart;\n this.valueEnd = this.#defaultValueEnd;\n } else {\n this.value = this.#defaultValue;\n }\n }\n\n #clearAllThumbInputState() {\n for (const entry of this.#thumbInputState.values()) {\n clearTimeout(entry.timer);\n entry.timer = undefined;\n entry.visible = false;\n entry.focused = false;\n entry.committed = false;\n }\n }\n\n #syncValuesToSteps() {\n const lastIdx = this.#normalizedSteps.length - 1;\n if (this.range) {\n if (this.#stepsIndexOf(this.#valueStart) < 0) {\n this.#valueStart = this.#stepAt(0);\n this.requestUpdate();\n }\n if (this.#stepsIndexOf(this.#valueEnd) < 0) {\n this.#valueEnd = this.#stepAt(lastIdx);\n this.requestUpdate();\n }\n this._setFormValue(`${this.#valueStart},${this.#valueEnd}`);\n } else {\n if (this.#stepsIndexOf(this.#value) < 0) {\n this.#value = this.#stepAt(0);\n this.requestUpdate();\n }\n this._setFormValue(this.#value);\n }\n }\n\n /** Steps mode: snaps to nearest step. Normal mode: clamps to [min, max]. Empty string passes through. */\n #clampToRange(rawVal: string): string {\n if (rawVal === '') {\n return rawVal;\n }\n if (this.#stepsMode) {\n if (this.#stepsIndexOf(rawVal) >= 0) {\n return rawVal;\n }\n let n: number | null = null;\n if (this.stepParser) {\n const result = this.stepParser(rawVal);\n if (typeof result === 'number') {\n n = result;\n } else if (typeof result === 'string' && this.#stepsIndexOf(result) >= 0) {\n return result;\n }\n }\n if (n === null) {\n n = parseFloat(rawVal);\n }\n if (!isNaN(n)) {\n return this.#snapToSteps(n);\n }\n return this.#stepAt(0);\n }\n const num = parseFloat(rawVal);\n if (isNaN(num)) {\n return rawVal;\n }\n return String(Math.min(this.max, Math.max(this.min, num)));\n }\n\n @property()\n get value() {\n return this.#value;\n }\n\n set value(rawVal: string) {\n rawVal = this.#clampToRange(rawVal);\n const oldVal = this.#value;\n this.#value = rawVal;\n this._setFormValue(rawVal);\n this.requestUpdate('value', oldVal);\n }\n\n get valueAsNumber() {\n return parseFloat(this.#value);\n }\n\n @property({ type: Boolean }) range = false;\n\n @property({ attribute: 'value-start' })\n get valueStart() {\n return this.#valueStart;\n }\n\n set valueStart(rawVal: string) {\n rawVal = this.#clampToRange(rawVal);\n const oldVal = this.#valueStart;\n this.#valueStart = rawVal;\n this._setFormValue(`${rawVal},${this.#valueEnd}`);\n this.requestUpdate('valueStart', oldVal);\n }\n\n @property({ attribute: 'value-end' })\n get valueEnd() {\n return this.#valueEnd;\n }\n\n set valueEnd(rawVal: string) {\n rawVal = this.#clampToRange(rawVal);\n const oldVal = this.#valueEnd;\n this.#valueEnd = rawVal;\n this._setFormValue(`${this.#valueStart},${rawVal}`);\n this.requestUpdate('valueEnd', oldVal);\n }\n\n @property({ type: Number }) min = 0;\n\n @property({ type: Number }) max = 100;\n\n @property({ type: Number }) step = 0;\n\n /** Displays each step's label beneath its dot on the track. Requires `steps` to be set. */\n @property({ type: Boolean, attribute: 'show-step-labels' }) showStepLabels = false;\n\n get #range() {\n return this.max - this.min;\n }\n\n get #progressColor() {\n return this.disabled ? 'var(--zui-gray)' : 'var(--zui-blue)';\n }\n\n #isVisible(flag: ThumbFlag): boolean {\n return this.#thumbInputState.get(flag)!.visible && !this.disabled;\n }\n\n // ─── Steps helpers ───────────────────────────────────────────────────────────\n\n get #stepsMode(): boolean {\n return this.steps.length > 0;\n }\n\n get #nativeRangeAttrs(): { nativeMin: string; nativeMax: string; nativeStep: string } {\n return {\n nativeMin: this.#stepsMode ? '0' : String(this.min),\n nativeMax: this.#stepsMode ? String(this.#normalizedSteps.length - 1) : String(this.max),\n nativeStep: this.#stepsMode ? '1' : this.step > 0 ? String(this.step) : '1',\n };\n }\n\n /** Normalizes each StepInput to `{ value, label }`. Cached after first access. */\n get #normalizedSteps(): { value: number | string; label: string }[] {\n if (!this.#cachedNormalizedSteps) {\n this.#cachedNormalizedSteps = this.steps.map((s) => {\n if (typeof s === 'number') {\n return { value: s, label: String(s) };\n }\n if (typeof s === 'string') {\n return { value: s, label: s };\n }\n return { value: s.value, label: s.label ?? String(s.value) };\n });\n }\n return this.#cachedNormalizedSteps;\n }\n\n #stepsIndexOf(val: string): number {\n return this.#normalizedSteps.findIndex((s) => s.label === val);\n }\n\n #stepAt(index: number): string {\n const normalized = this.#normalizedSteps;\n return normalized[Math.max(0, Math.min(normalized.length - 1, index))].label;\n }\n\n /** Numeric value per step for #snapToSteps. Strings parsed via parseFloat; unparseable strings map to Infinity. */\n get #stepsNumericValues(): number[] {\n if (!this.#cachedNumericValues) {\n this.#cachedNumericValues = this.#normalizedSteps.map((step) => {\n if (typeof step.value === 'number') {\n return step.value;\n }\n const sv = step.value as string;\n const n = parseFloat(sv);\n return isNaN(n) ? Infinity : n;\n });\n }\n return this.#cachedNumericValues;\n }\n\n /** Snaps n to the nearest step by numeric value; overflow steps win only past the last finite value. */\n #snapToSteps(n: number): string {\n const numericValues = this.#stepsNumericValues;\n let lastFiniteValue = -Infinity;\n for (const v of numericValues) {\n if (isFinite(v) && v > lastFiniteValue) {\n lastFiniteValue = v;\n }\n }\n let bestIdx = 0;\n let bestDist = Infinity;\n for (let i = 0; i < numericValues.length; i++) {\n const v = numericValues[i];\n const dist = v === Infinity ? (n > lastFiniteValue ? 0 : Math.abs(n - lastFiniteValue) + 1) : Math.abs(n - v);\n if (dist < bestDist) {\n bestDist = dist;\n bestIdx = i;\n }\n }\n return this.#stepAt(bestIdx);\n }\n\n /** Resolves a user-typed string to a step label; returns null if unresolvable. Steps mode only. */\n #resolveFloatingInput(raw: string): string | null {\n // Exact label match wins; a valid label is never rejected by a stepParser that doesn't recognize it.\n const exactIdx = this.#stepsIndexOf(raw);\n if (exactIdx >= 0) {\n return this.#stepAt(exactIdx);\n }\n if (this.stepParser) {\n const result = this.stepParser(raw);\n if (result === null) {\n return null;\n }\n if (typeof result === 'number') {\n return this.#snapToSteps(result);\n }\n // String result must be a valid step label\n return this.#stepsIndexOf(result) >= 0 ? result : null;\n }\n const n = parseFloat(raw);\n if (isNaN(n)) {\n return null;\n }\n return this.#snapToSteps(n);\n }\n\n // ─── Progress ────────────────────────────────────────────────────────────────\n\n get progress() {\n return this.#computeProgress(this.#value);\n }\n\n get progressStart() {\n return this.#computeProgress(this.#valueStart);\n }\n\n get progressEnd() {\n return this.#computeProgress(this.#valueEnd);\n }\n\n #computeProgress(rawValue: string): number {\n if (this.#stepsMode) {\n const total = this.#normalizedSteps.length - 1;\n if (total <= 0) {\n return 0;\n }\n const idx = this.#stepsIndexOf(rawValue);\n return idx < 0 ? 0 : parseFloat(((idx / total) * 100).toFixed(4));\n }\n if (this.#range === 0) {\n return 0;\n }\n const num = parseFloat(rawValue);\n return isNaN(num) ? 0 : parseFloat((((num - this.min) / this.#range) * 100).toFixed(4));\n }\n\n #singleTrackBackground(progress: number): string {\n const c = this.#progressColor;\n const stop = ZuiSlider.#thumbPositionCSS(progress);\n return `linear-gradient(to right, transparent var(--zui-slider-thumb-size), ${c} var(--zui-slider-thumb-size), ${c} ${stop}, var(--zui-gray-200) ${stop}, var(--zui-gray-200) calc(100% - var(--zui-slider-thumb-size)), transparent calc(100% - var(--zui-slider-thumb-size)))`;\n }\n\n #rangeTrackBackground(progressStart: number, progressEnd: number): string {\n const c = this.#progressColor;\n const startStop = ZuiSlider.#thumbPositionCSS(progressStart);\n const endStop = ZuiSlider.#thumbPositionCSS(progressEnd);\n return `linear-gradient(to right, transparent var(--zui-slider-thumb-size), var(--zui-gray-200) var(--zui-slider-thumb-size), var(--zui-gray-200) ${startStop}, ${c} ${startStop}, ${c} ${endStop}, var(--zui-gray-200) ${endStop}, var(--zui-gray-200) calc(100% - var(--zui-slider-thumb-size)), transparent calc(100% - var(--zui-slider-thumb-size)))`;\n }\n\n // ─── Render ──────────────────────────────────────────────────────────────────\n\n render() {\n return html`${this.range ? this.#renderRange() : this.#renderSingle()}${this.#renderMinMaxLabels()}`;\n }\n\n #renderSingle() {\n const progress = this.progress;\n const { nativeMin, nativeMax, nativeStep } = this.#nativeRangeAttrs;\n // live() required: direct DOM writes during drag don't trigger a state change, so Lit won't re-sync without it.\n const nativeValue = this.#stepsMode ? String(Math.max(0, this.#stepsIndexOf(this.#value))) : this.#value;\n return html`\n <div class=\"single-wrapper\">\n <input\n aria-label=\"Slider value\"\n style=${styleMap({ '--zui-slider-track-bg': this.#singleTrackBackground(progress) })}\n type=\"range\"\n .min=\"${nativeMin}\"\n .max=\"${nativeMax}\"\n .step=\"${nativeStep}\"\n .value=\"${live(nativeValue)}\"\n ?disabled=\"${this.disabled || this.readOnly}\"\n @input=\"${this.#onInput}\"\n @change=\"${this.#onChange}\"\n @pointerenter=\"${this.#h.thumb.show}\"\n @pointerleave=\"${this.#h.thumb.hide}\"\n @focus=\"${this.#h.thumb.show}\"\n @blur=\"${this.#h.thumb.hide}\"\n />\n ${this.#renderFloatingInput(\n this.#value,\n this.#onThumbFloatingChange,\n 'thumb',\n this.#isVisible('thumb'),\n progress\n )}\n ${this.#renderStepDots()}\n </div>\n `;\n }\n\n #renderRange() {\n const progressStart = this.progressStart;\n const progressEnd = this.progressEnd;\n return html`\n <div class=\"range-wrapper\" @click=\"${this.#onTrackClick}\">\n ${this.#renderRangeInput('start', this.#rangeTrackBackground(progressStart, progressEnd))}\n ${this.#renderFloatingInput(\n this.#valueStart,\n this.#onStartThumbFloatingChange,\n 'startThumb',\n this.#isVisible('startThumb'),\n progressStart\n )}\n ${this.#renderRangeInput('end')}\n ${this.#renderFloatingInput(\n this.#valueEnd,\n this.#onEndThumbFloatingChange,\n 'endThumb',\n this.#isVisible('endThumb'),\n progressEnd\n )}\n ${this.#renderStepDots()}\n </div>\n `;\n }\n\n #renderRangeInput(which: 'start' | 'end', trackBg?: string) {\n const flag: ThumbFlag = which === 'start' ? 'startThumb' : 'endThumb';\n const val = which === 'start' ? this.#valueStart : this.#valueEnd;\n const onInput = which === 'start' ? this.#onRangeStartInput : this.#onRangeEndInput;\n const h = this.#h[flag];\n const { nativeMin, nativeMax, nativeStep } = this.#nativeRangeAttrs;\n const nativeValue = this.#stepsMode ? String(Math.max(0, this.#stepsIndexOf(val))) : val;\n // live() required: direct DOM writes during drag don't trigger a state change, so Lit won't re-sync without it.\n return html`\n <input\n aria-label=\"${which === 'start' ? 'Range start' : 'Range end'}\"\n class=\"range-${which}\"\n type=\"range\"\n style=${trackBg ? styleMap({ '--zui-slider-track-bg': trackBg }) : nothing}\n .min=\"${nativeMin}\"\n .max=\"${nativeMax}\"\n .step=\"${nativeStep}\"\n .value=\"${live(nativeValue)}\"\n ?disabled=\"${this.disabled || this.readOnly}\"\n @click=\"${this.#stopClickPropagation}\"\n @input=\"${onInput}\"\n @change=\"${this.#onRangeChange}\"\n @pointerenter=\"${h.show}\"\n @pointerleave=\"${h.hide}\"\n @focus=\"${h.show}\"\n @blur=\"${h.hide}\"\n />\n `;\n }\n\n #renderFloatingInput(\n val: string,\n onFloatingChange: (e: Event) => void,\n flag: ThumbFlag,\n visible: boolean,\n progress: number\n ) {\n const h = this.#h[flag];\n // type=\"text\" in steps mode to allow label and stepParser input.\n // live() required: commits that snap/clamp to the current value skip reactive updates, so Lit won't re-sync without it.\n const ariaLabel =\n flag === 'startThumb' ? 'Range start value' : flag === 'endThumb' ? 'Range end value' : 'Slider value';\n return html`\n <div\n class=${classMap({ 'thumb-input': true, 'thumb-input--visible': visible })}\n style=${styleMap({ left: ZuiSlider.#thumbPositionCSS(progress) })}\n @click=\"${this.#stopClickPropagation}\"\n @pointerenter=\"${h.show}\"\n @pointerleave=\"${h.hide}\"\n >\n <input\n aria-label=\"${ariaLabel}\"\n type=\"${this.#stepsMode ? 'text' : 'number'}\"\n .value=\"${live(val)}\"\n .min=\"${this.#stepsMode ? '' : String(this.min)}\"\n .max=\"${this.#stepsMode ? '' : String(this.max)}\"\n .step=\"${this.#stepsMode ? '' : this.step > 0 ? String(this.step) : '1'}\"\n ?disabled=\"${this.disabled}\"\n ?readonly=\"${this.readOnly}\"\n @keydown=\"${this.#onFloatingInputKeydown}\"\n @input=\"${h.input}\"\n @change=\"${onFloatingChange}\"\n @focus=\"${h.focus}\"\n @blur=\"${h.blurCommit}\"\n />\n </div>\n `;\n }\n\n #renderStepDots() {\n if (this.#stepsMode) {\n const normalized = this.#normalizedSteps;\n const total = normalized.length - 1;\n if (total <= 0 || normalized.length > 100) {\n return nothing;\n }\n const stepDots = normalized.map((step, i) => {\n const left =\n i === 0\n ? 'var(--zui-slider-thumb-size)'\n : i === total\n ? 'calc(100% - var(--zui-slider-thumb-size))'\n : ZuiSlider.#thumbPositionCSS((i / total) * 100);\n return html`<span\n class=${classMap({ 'step-dot': true, 'step-dot--last': i === total && this.showStepLabels })}\n style=\"left: ${left}\"\n ></span>\n ${this.showStepLabels\n ? html`<span class=\"step-dot-label\" style=\"left: ${left}\">${step.label}</span>`\n : nothing}`;\n });\n return html`<div class=\"step-dots\">${stepDots}</div>`;\n }\n if (this.step <= 0 || this.#range === 0) {\n return nothing;\n }\n const count = Math.round(this.#range / this.step);\n if (count > 100) {\n return nothing;\n }\n const dots = [];\n for (let i = 0; i <= count; i++) {\n let left: string;\n if (i === 0) {\n left = 'var(--zui-slider-thumb-size)';\n } else if (i === count) {\n left = 'calc(100% - var(--zui-slider-thumb-size))';\n } else {\n const pos = parseFloat((((i * this.step) / this.#range) * 100).toFixed(4));\n left = ZuiSlider.#thumbPositionCSS(pos);\n }\n dots.push(html`<span class=\"step-dot\" style=\"left: ${left}\"></span>`);\n }\n return html`<div class=\"step-dots\">${dots}</div>`;\n }\n\n #renderMinMaxLabels() {\n const normalized = this.#normalizedSteps;\n const minLabel = this.#stepsMode ? normalized[0]?.label ?? '' : String(this.min);\n const maxLabel = this.#stepsMode ? normalized[normalized.length - 1]?.label ?? '' : String(this.max);\n const hidden = this.showStepLabels;\n return html`\n <div\n class=\"min-max-labels\"\n aria-hidden=\"${ifDefined(hidden ? 'true' : undefined)}\"\n style=${hidden ? styleMap({ visibility: 'hidden' }) : nothing}\n >\n <span class=\"min-max-label\">${minLabel}</span>\n <span class=\"min-max-label\">${maxLabel}</span>\n </div>\n `;\n }\n\n // ─── Event handlers ──────────────────────────────────────────────────────────\n\n #onInput(e: Event) {\n if (this.readOnly) {\n return;\n }\n const input = e.target as HTMLInputElement;\n if (this.#stepsMode) {\n this.value = this.#stepAt(parseInt(input.value, 10));\n } else {\n this.value = input.value;\n }\n }\n\n #onChange() {\n this.dispatchEvent(new CustomEvent('change', { detail: this.#value, bubbles: true }));\n }\n\n #processFloatingValue(raw: number): string {\n const stepDecimals = this.step > 0 ? (String(this.step).split('.')[1] ?? '').length : 0;\n const stepped = this.step > 0 ? Math.round((raw - this.min) / this.step) * this.step + this.min : raw;\n const clamped = Math.min(this.max, Math.max(this.min, stepped));\n return stepDecimals > 0 ? clamped.toFixed(stepDecimals) : String(Math.round(clamped));\n }\n\n #currentValueForFlag(flag: ThumbFlag): string {\n if (flag === 'startThumb') {\n return this.#valueStart;\n }\n if (flag === 'endThumb') {\n return this.#valueEnd;\n }\n return this.#value;\n }\n\n #makeThumbHandlers(flag: ThumbFlag) {\n return {\n show: () => this.#showThumbInput(flag),\n hide: () => this.#scheduleHideThumbInput(flag),\n focus: () => this.#focusFloatingInput(flag),\n input: () => {\n this.#thumbInputState.get(flag)!.committed = false;\n },\n blurCommit: (e: FocusEvent) => {\n const entry = this.#thumbInputState.get(flag)!;\n if (!entry.committed) {\n (e.target as HTMLInputElement).dispatchEvent(new Event('change'));\n }\n entry.committed = false;\n this.#blurFloatingInput(flag);\n },\n };\n }\n\n #makeFloatingChange(flag: ThumbFlag, setter: (val: string) => void, dispatch: () => void) {\n return (e: Event) => {\n if (this.readOnly) {\n return;\n }\n const input = e.target as HTMLInputElement;\n if (input.value === '') {\n input.value = this.#currentValueForFlag(flag);\n return;\n }\n const before = this.#currentValueForFlag(flag);\n const commit = (value: string) => {\n setter(value);\n this.#thumbInputState.get(flag)!.committed = true;\n if (this.#currentValueForFlag(flag) !== before) {\n dispatch();\n }\n };\n if (this.#stepsMode) {\n const resolved = this.#resolveFloatingInput(input.value);\n if (resolved !== null) {\n let finalResolved = resolved;\n if (flag !== 'thumb') {\n const resolvedIdx = this.#stepsIndexOf(resolved);\n const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));\n const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));\n if (flag === 'startThumb' && resolvedIdx >= endIdx) {\n const nudgedIdx = endIdx - 1;\n finalResolved = nudgedIdx >= 0 ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);\n } else if (flag === 'endThumb' && resolvedIdx <= startIdx) {\n const nudgedIdx = startIdx + 1;\n finalResolved =\n nudgedIdx < this.#normalizedSteps.length ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);\n }\n }\n commit(finalResolved);\n } else {\n input.value = this.#currentValueForFlag(flag);\n }\n } else {\n let processed = this.#processFloatingValue(parseFloat(input.value));\n if (flag !== 'thumb') {\n const effectiveStep = this.step > 0 ? this.step : 1;\n if (flag === 'startThumb') {\n const endNum = parseFloat(this.#valueEnd);\n if (parseFloat(processed) >= endNum) {\n const nudged = this.#processFloatingValue(endNum - effectiveStep);\n processed = parseFloat(nudged) < endNum ? nudged : this.#currentValueForFlag(flag);\n }\n } else {\n const startNum = parseFloat(this.#valueStart);\n if (parseFloat(processed) <= startNum) {\n const nudged = this.#processFloatingValue(startNum + effectiveStep);\n processed = parseFloat(nudged) > startNum ? nudged : this.#currentValueForFlag(flag);\n }\n }\n }\n commit(processed);\n }\n };\n }\n\n #onRangeInput(which: 'start' | 'end') {\n return (e: Event) => {\n if (this.readOnly) {\n return;\n }\n const input = e.target as HTMLInputElement;\n if (this.#stepsMode) {\n const idx = parseInt(input.value, 10);\n const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));\n const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));\n if (which === 'start') {\n if (idx >= endIdx) {\n input.value = String(startIdx);\n return;\n }\n this.valueStart = this.#stepAt(idx);\n } else {\n if (idx <= startIdx) {\n input.value = String(endIdx);\n return;\n }\n this.valueEnd = this.#stepAt(idx);\n }\n } else {\n if (which === 'start') {\n if (parseFloat(input.value) >= parseFloat(this.#valueEnd)) {\n input.value = this.#valueStart;\n return;\n }\n this.valueStart = input.value;\n } else {\n if (parseFloat(input.value) <= parseFloat(this.#valueStart)) {\n input.value = this.#valueEnd;\n return;\n }\n this.valueEnd = input.value;\n }\n }\n };\n }\n\n #onRangeChange() {\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: { valueStart: this.#valueStart, valueEnd: this.#valueEnd },\n bubbles: true,\n })\n );\n }\n\n #onTrackClick(e: MouseEvent) {\n if (this.disabled || this.readOnly) {\n return;\n }\n const wrapper = e.currentTarget as HTMLElement;\n const rect = wrapper.getBoundingClientRect();\n // Thumb diameter is 3× the custom property; radius is 1.5×. Track is inset by one radius each side.\n const thumbRadius = 1.5 * parseFloat(getComputedStyle(this).getPropertyValue('--zui-slider-thumb-size'));\n const trackLeft = rect.left + thumbRadius;\n const effectiveWidth = rect.width - 2 * thumbRadius;\n const fraction = Math.max(0, Math.min(1, (e.clientX - trackLeft) / effectiveWidth));\n\n if (this.#stepsMode) {\n const total = this.#normalizedSteps.length - 1;\n if (total <= 0) {\n return;\n }\n const clickedIdx = Math.round(fraction * total);\n const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));\n const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));\n\n // Ignore clicks within a thumb's hit area\n const startX = trackLeft + (startIdx / total) * effectiveWidth;\n const endX = trackLeft + (endIdx / total) * effectiveWidth;\n if (Math.abs(e.clientX - startX) <= thumbRadius || Math.abs(e.clientX - endX) <= thumbRadius) {\n return;\n }\n\n // Move whichever thumb is closer by index distance; prefer start on a tie\n if (Math.abs(clickedIdx - startIdx) <= Math.abs(clickedIdx - endIdx)) {\n if (clickedIdx < endIdx) {\n this.valueStart = this.#stepAt(clickedIdx);\n this.#onRangeChange();\n }\n } else {\n if (clickedIdx > startIdx) {\n this.valueEnd = this.#stepAt(clickedIdx);\n this.#onRangeChange();\n }\n }\n return;\n }\n\n const rawValue = this.min + fraction * (this.max - this.min);\n\n // Ignore clicks within a thumb's hit area; those are native input interactions, not track clicks.\n const startX = trackLeft + (this.progressStart / 100) * effectiveWidth;\n const endX = trackLeft + (this.progressEnd / 100) * effectiveWidth;\n if (Math.abs(e.clientX - startX) <= thumbRadius || Math.abs(e.clientX - endX) <= thumbRadius) {\n return;\n }\n\n const snappedStr = this.#processFloatingValue(rawValue);\n const snapped = parseFloat(snappedStr);\n const startNum = parseFloat(this.#valueStart);\n const endNum = parseFloat(this.#valueEnd);\n\n // Move whichever thumb is closer to the click; prefer start on a tie\n if (Math.abs(rawValue - startNum) <= Math.abs(rawValue - endNum)) {\n if (snapped < endNum) {\n this.valueStart = snappedStr;\n this.#onRangeChange();\n }\n } else {\n if (snapped > startNum) {\n this.valueEnd = snappedStr;\n this.#onRangeChange();\n }\n }\n }\n\n #showThumbInput(flag: ThumbFlag) {\n if (this.disabled) {\n return;\n }\n const entry = this.#thumbInputState.get(flag)!;\n clearTimeout(entry.timer);\n entry.timer = undefined;\n entry.visible = true;\n this.requestUpdate();\n }\n\n #scheduleHideThumbInput(flag: ThumbFlag) {\n const entry = this.#thumbInputState.get(flag)!;\n clearTimeout(entry.timer);\n entry.timer = setTimeout(() => {\n if (!entry.focused) {\n entry.visible = false;\n this.requestUpdate();\n }\n }, 100);\n }\n\n #focusFloatingInput(flag: ThumbFlag) {\n if (this.disabled) {\n return;\n }\n this.#showThumbInput(flag);\n const entry = this.#thumbInputState.get(flag)!;\n entry.focused = true;\n entry.committed = false;\n }\n\n #blurFloatingInput(flag: ThumbFlag) {\n const entry = this.#thumbInputState.get(flag)!;\n entry.focused = false;\n this.#scheduleHideThumbInput(flag);\n }\n\n // Maps progress 0-100 to a --zui-slider-thumb-size multiplier (1.5 at 0%, -1.5 at 100%) that centers the thumb on the track.\n static #thumbCenterOffset(progress: number): number {\n return 1.5 - (3 * progress) / 100;\n }\n\n static #thumbPositionCSS(progress: number): string {\n return `calc(${progress}% + var(--zui-slider-thumb-size) * ${ZuiSlider.#thumbCenterOffset(progress)})`;\n }\n}\n\nwindow.customElements.define('zui-slider', ZuiSlider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'zui-slider': ZuiSlider;\n }\n}\n"]}
1
+ {"version":3,"file":"zui-slider.js","sourceRoot":"","sources":["../src/zui-slider.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,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';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { style } from './zui-slider-css.js';\n\ntype ThumbFlag = 'thumb' | 'startThumb' | 'endThumb';\n\n/** Number, string, or `{ value, label? }` object. `label` is the display value; `value` drives snapping. */\ntype StepInput = number | string | { value: number | string; label?: string };\n\n/**\n * A range form control for choosing values along a slider.\n * @element zui-slider\n *\n * @attr {string | null} [name=null] - The name of this element that is associated with form submission\n * @attr {boolean} [disabled=false] - Represents whether a user can make changes to this element; if true, the value of this element will be excluded from the form submission\n * @attr {boolean} [readonly=false] - Represents whether a user can make changes to this element; the value of this element will still be included in the form submission\n * @attr {boolean} [autofocus=false] - If true, this element will be focused when connected to the document\n * @attr {number} [value=50] - Represents the value of the input (single mode). Can be set to a default value, and will reflect the value provided by the user when interactive with the control\n * @attr {boolean} [range=false] - Enables range mode with two thumbs for selecting a range\n * @attr {number} [value-start=0] - Represents the start (lower) value in range mode\n * @attr {number} [value-end=100] - Represents the end (upper) value in range mode\n * @attr {number} [min=0] - Represents the minimum permitted value\n * @attr {number} [max=100] - Represents the maximum permitted value\n * @attr {number} [step=0] - Represents the stepping interval; 0 means any value is allowed\n * @attr {string} [steps=''] - Comma-separated step labels; overrides min/max/step. Labels containing commas must be set via the property instead.\n * @attr {boolean} [show-step-labels=false] - When set, displays each step's label beneath its dot on the track\n * @prop {string | null} [name=null] - The name of this element that is associated with form submission\n * @prop {boolean} [disabled=false] - Represents whether a user can make changes to this element; if true, the value of this element will be excluded from the form submission\n * @prop {boolean} [readOnly=false] - Represents whether a user can make changes to this element; the value of this element will still be included in the form submission\n * @prop {boolean} [autofocus=false] - If true, this element will be focused when connected to the document\n * @prop {number} [valueAsNumber=50] - Returns the value as a number. Invalid or non-numeric values are clamped to min; empty string (representing an in-progress edit) returns NaN\n * @prop {string} [value='50'] - Represents the value of the input (single mode). Can be set to a default value, and will reflect the value provided by the user when interactive with the control\n * @prop {number} [progress=50] - Determines visual placement of the slider thumb along the line (single mode)\n * @prop {boolean} [range=false] - Enables range mode with two thumbs for selecting a range\n * @prop {string} [valueStart='0'] - Represents the start (lower) value in range mode\n * @prop {string} [valueEnd='100'] - Represents the end (upper) value in range mode\n * @prop {number} [progressStart=0] - Determines visual placement of the start thumb in range mode\n * @prop {number} [progressEnd=100] - Determines visual placement of the end thumb in range mode\n * @prop {number} [min=0] - Represents the minimum permitted value\n * @prop {number} [max=100] - Represents the maximum permitted value\n * @prop {number} [step=0] - Represents the stepping interval; 0 means any value is allowed\n * @prop {StepInput[]} [steps=[]] - Custom step values; overrides min/max/step. Thumbs at equal visual intervals. Accepts number, string, or { value, label? }. Use { value: Infinity, label: '...' } for an unbounded overflow step. Labels with commas must be set via the property.\n * @prop {((input: string) => number | string | null) | null} [stepParser=null] - Resolves user-typed strings to a step value; returns a number (snap to nearest), a valid step label, or null to reject. Must be set via the property.\n * @prop {boolean} [showStepLabels=false] - When true, displays each step's label (or its value if no label was provided) beneath the corresponding dot on the track\n *\n * @cssprop [--zui-slider-input-width=7ch] - Width of the floating value input above each slider thumb\n *\n * @event {CustomEvent} change - Fires when value changes; in single mode detail is the value string; in range mode detail is { valueStart, valueEnd }\n */\nexport class ZuiSlider extends ZuiFormAssociatedElement {\n #defaultValue: string = '50';\n #defaultValueStart: string = '0';\n #defaultValueEnd: string = '100';\n\n #value: string = '50';\n #valueStart: string = '0';\n #valueEnd: string = '100';\n\n #cachedNormalizedSteps: { value: number | string; label: string }[] | null = null;\n #cachedNumericValues: number[] | null = null;\n\n #thumbInputState = new Map<\n ThumbFlag,\n {\n visible: boolean;\n focused: boolean;\n committed: boolean;\n timer?: ReturnType<typeof setTimeout>;\n }\n >([\n ['thumb', { visible: false, focused: false, committed: false }],\n ['startThumb', { visible: false, focused: false, committed: false }],\n ['endThumb', { visible: false, focused: false, committed: false }],\n ]);\n\n #onThumbFloatingChange = this.#makeFloatingChange(\n 'thumb',\n (v) => (this.value = v),\n () => this.#onChange()\n );\n #onStartThumbFloatingChange = this.#makeFloatingChange(\n 'startThumb',\n (v) => (this.valueStart = v),\n () => this.#onRangeChange()\n );\n #onEndThumbFloatingChange = this.#makeFloatingChange(\n 'endThumb',\n (v) => (this.valueEnd = v),\n () => this.#onRangeChange()\n );\n\n // Cached keydown handler: Enter commits the floating input value in both number and text modes.\n #onFloatingInputKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n const input = e.target as HTMLInputElement;\n input.dispatchEvent(new Event('change'));\n }\n };\n\n #onRangeStartInput = this.#onRangeInput('start');\n #onRangeEndInput = this.#onRangeInput('end');\n #stopClickPropagation = (e: Event) => e.stopPropagation();\n\n // Cached pointer/focus handlers per thumb; prevents new closures on every render\n #h: Record<\n ThumbFlag,\n { show: () => void; hide: () => void; focus: () => void; input: () => void; blurCommit: (e: FocusEvent) => void }\n > = {\n thumb: this.#makeThumbHandlers('thumb'),\n startThumb: this.#makeThumbHandlers('startThumb'),\n endThumb: this.#makeThumbHandlers('endThumb'),\n };\n\n static get styles() {\n return [super.styles, style];\n }\n\n @property({\n converter: {\n fromAttribute: (value: string | null) => (value ? value.split(',').map((s) => s.trim()) : []),\n toAttribute: (value: StepInput[]) =>\n value.map((s) => (typeof s === 'object' ? s.label ?? String(s.value) : String(s))).join(','),\n },\n })\n steps: StepInput[] = [];\n\n @property({ attribute: false }) stepParser: ((input: string) => number | string | null) | null = null;\n\n connectedCallback() {\n super.connectedCallback();\n this.updateComplete.then(() => {\n if (this.#stepsMode) {\n this.#syncValuesToSteps();\n if (this.range) {\n this.#defaultValueStart = this.#valueStart;\n this.#defaultValueEnd = this.#valueEnd;\n } else {\n this.#defaultValue = this.#value;\n }\n return;\n }\n if (this.range) {\n const [startInput, endInput] = this.#rangeInputs();\n this.#valueStart = startInput.value;\n this.#valueEnd = endInput.value;\n this.#defaultValueStart = startInput.value;\n this.#defaultValueEnd = endInput.value;\n this._setFormValue(`${startInput.value},${endInput.value}`);\n } else {\n const input = this.#singleInput();\n this.#value = input.value;\n this.#defaultValue = input.value;\n this._setFormValue(input.value);\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#clearAllThumbInputState();\n // Re-render to reflect cleared visibility state; Lit defers this until reconnect.\n this.requestUpdate();\n }\n\n protected updated(changed: Map<PropertyKey, unknown>) {\n if (changed.has('disabled') && this.disabled) {\n this.#clearAllThumbInputState();\n }\n if (changed.has('steps')) {\n this.#cachedNormalizedSteps = null;\n this.#cachedNumericValues = null;\n if (this.#stepsMode) {\n this.#syncValuesToSteps();\n }\n }\n if (!this.#stepsMode && (changed.has('min') || changed.has('max'))) {\n // Native inputs clamp/snap to new bounds; read back and sync state. Re-render if value changed.\n if (this.range) {\n const [startInput, endInput] = this.#rangeInputs();\n const newStart = startInput.value;\n const newEnd = endInput.value;\n if (newStart !== this.#valueStart || newEnd !== this.#valueEnd) {\n this.#valueStart = newStart;\n this.#valueEnd = newEnd;\n this.requestUpdate();\n }\n this._setFormValue(`${this.#valueStart},${this.#valueEnd}`);\n } else {\n const newValue = this.#singleInput().value;\n if (newValue !== this.#value) {\n this.#value = newValue;\n this.requestUpdate();\n }\n this._setFormValue(this.#value);\n }\n }\n }\n\n #singleInput(): HTMLInputElement {\n return this.shadowRoot!.querySelector<HTMLInputElement>('input[type=\"range\"]')!;\n }\n\n #rangeInputs(): [HTMLInputElement, HTMLInputElement] {\n const inputs = this.shadowRoot!.querySelectorAll<HTMLInputElement>('input[type=\"range\"]');\n return [inputs[0], inputs[1]];\n }\n\n protected get _focusControlSelector() {\n return 'input';\n }\n\n protected get _formValue() {\n return this.range ? `${this.#valueStart},${this.#valueEnd}` : this.#value;\n }\n\n protected formResetCallback() {\n this.#clearAllThumbInputState();\n // Force re-render: if the reset value equals the current value, the setter's requestUpdate is a no-op.\n this.requestUpdate();\n if (this.range) {\n this.valueStart = this.#defaultValueStart;\n this.valueEnd = this.#defaultValueEnd;\n } else {\n this.value = this.#defaultValue;\n }\n }\n\n #clearAllThumbInputState() {\n for (const entry of this.#thumbInputState.values()) {\n clearTimeout(entry.timer);\n entry.timer = undefined;\n entry.visible = false;\n entry.focused = false;\n entry.committed = false;\n }\n }\n\n #syncValuesToSteps() {\n const lastIdx = this.#normalizedSteps.length - 1;\n if (this.range) {\n if (this.#stepsIndexOf(this.#valueStart) < 0) {\n this.#valueStart = this.#stepAt(0);\n this.requestUpdate();\n }\n if (this.#stepsIndexOf(this.#valueEnd) < 0) {\n this.#valueEnd = this.#stepAt(lastIdx);\n this.requestUpdate();\n }\n this._setFormValue(`${this.#valueStart},${this.#valueEnd}`);\n } else {\n if (this.#stepsIndexOf(this.#value) < 0) {\n this.#value = this.#stepAt(0);\n this.requestUpdate();\n }\n this._setFormValue(this.#value);\n }\n }\n\n /** Steps mode: snaps to nearest step. Normal mode: clamps to [min, max]. Empty string passes through. */\n #clampToRange(rawVal: string): string {\n if (rawVal === '') {\n return rawVal;\n }\n if (this.#stepsMode) {\n if (this.#stepsIndexOf(rawVal) >= 0) {\n return rawVal;\n }\n let n: number | null = null;\n if (this.stepParser) {\n const result = this.stepParser(rawVal);\n if (typeof result === 'number') {\n n = result;\n } else if (typeof result === 'string' && this.#stepsIndexOf(result) >= 0) {\n return result;\n }\n }\n if (n === null) {\n n = parseFloat(rawVal);\n }\n if (!isNaN(n)) {\n return this.#snapToSteps(n);\n }\n return this.#stepAt(0);\n }\n const num = parseFloat(rawVal);\n if (isNaN(num)) {\n return rawVal;\n }\n return String(Math.min(this.max, Math.max(this.min, num)));\n }\n\n @property()\n get value() {\n return this.#value;\n }\n\n set value(rawVal: string) {\n rawVal = this.#clampToRange(rawVal);\n const oldVal = this.#value;\n this.#value = rawVal;\n this._setFormValue(rawVal);\n this.requestUpdate('value', oldVal);\n }\n\n get valueAsNumber() {\n return parseFloat(this.#value);\n }\n\n @property({ type: Boolean }) range = false;\n\n @property({ attribute: 'value-start' })\n get valueStart() {\n return this.#valueStart;\n }\n\n set valueStart(rawVal: string) {\n rawVal = this.#clampToRange(rawVal);\n const oldVal = this.#valueStart;\n this.#valueStart = rawVal;\n this._setFormValue(`${rawVal},${this.#valueEnd}`);\n this.requestUpdate('valueStart', oldVal);\n }\n\n @property({ attribute: 'value-end' })\n get valueEnd() {\n return this.#valueEnd;\n }\n\n set valueEnd(rawVal: string) {\n rawVal = this.#clampToRange(rawVal);\n const oldVal = this.#valueEnd;\n this.#valueEnd = rawVal;\n this._setFormValue(`${this.#valueStart},${rawVal}`);\n this.requestUpdate('valueEnd', oldVal);\n }\n\n @property({ type: Number }) min = 0;\n\n @property({ type: Number }) max = 100;\n\n @property({ type: Number }) step = 0;\n\n /** Displays each step's label beneath its dot on the track. Requires `steps` to be set. */\n @property({ type: Boolean, attribute: 'show-step-labels' }) showStepLabels = false;\n\n get #range() {\n return this.max - this.min;\n }\n\n get #progressColor() {\n return this.disabled ? 'var(--zui-gray)' : 'var(--zui-blue)';\n }\n\n #isVisible(flag: ThumbFlag): boolean {\n return this.#thumbInputState.get(flag)!.visible && !this.disabled;\n }\n\n // ─── Steps helpers ───────────────────────────────────────────────────────────\n\n get #stepsMode(): boolean {\n return this.steps.length > 0;\n }\n\n get #nativeRangeAttrs(): { nativeMin: string; nativeMax: string; nativeStep: string } {\n return {\n nativeMin: this.#stepsMode ? '0' : String(this.min),\n nativeMax: this.#stepsMode ? String(this.#normalizedSteps.length - 1) : String(this.max),\n nativeStep: this.#stepsMode ? '1' : this.step > 0 ? String(this.step) : '1',\n };\n }\n\n /** Normalizes each StepInput to `{ value, label }`. Cached after first access. */\n get #normalizedSteps(): { value: number | string; label: string }[] {\n if (!this.#cachedNormalizedSteps) {\n this.#cachedNormalizedSteps = this.steps.map((s) => {\n if (typeof s === 'number') {\n return { value: s, label: String(s) };\n }\n if (typeof s === 'string') {\n return { value: s, label: s };\n }\n return { value: s.value, label: s.label ?? String(s.value) };\n });\n }\n return this.#cachedNormalizedSteps;\n }\n\n #stepsIndexOf(val: string): number {\n return this.#normalizedSteps.findIndex((s) => s.label === val);\n }\n\n #stepAt(index: number): string {\n const normalized = this.#normalizedSteps;\n return normalized[Math.max(0, Math.min(normalized.length - 1, index))].label;\n }\n\n /** Numeric value per step for #snapToSteps. Strings parsed via parseFloat; unparseable strings map to Infinity. */\n get #stepsNumericValues(): number[] {\n if (!this.#cachedNumericValues) {\n this.#cachedNumericValues = this.#normalizedSteps.map((step) => {\n if (typeof step.value === 'number') {\n return step.value;\n }\n const sv = step.value as string;\n const n = parseFloat(sv);\n return isNaN(n) ? Infinity : n;\n });\n }\n return this.#cachedNumericValues;\n }\n\n /** Snaps n to the nearest step by numeric value; overflow steps win only past the last finite value. */\n #snapToSteps(n: number): string {\n const numericValues = this.#stepsNumericValues;\n let lastFiniteValue = -Infinity;\n for (const v of numericValues) {\n if (isFinite(v) && v > lastFiniteValue) {\n lastFiniteValue = v;\n }\n }\n let bestIdx = 0;\n let bestDist = Infinity;\n for (let i = 0; i < numericValues.length; i++) {\n const v = numericValues[i];\n const dist = v === Infinity ? (n > lastFiniteValue ? 0 : Math.abs(n - lastFiniteValue) + 1) : Math.abs(n - v);\n if (dist < bestDist) {\n bestDist = dist;\n bestIdx = i;\n }\n }\n return this.#stepAt(bestIdx);\n }\n\n /** Resolves a user-typed string to a step label; returns null if unresolvable. Steps mode only. */\n #resolveFloatingInput(raw: string): string | null {\n // Exact label match wins; a valid label is never rejected by a stepParser that doesn't recognize it.\n const exactIdx = this.#stepsIndexOf(raw);\n if (exactIdx >= 0) {\n return this.#stepAt(exactIdx);\n }\n if (this.stepParser) {\n const result = this.stepParser(raw);\n if (result === null) {\n return null;\n }\n if (typeof result === 'number') {\n return this.#snapToSteps(result);\n }\n // String result must be a valid step label\n return this.#stepsIndexOf(result) >= 0 ? result : null;\n }\n const n = parseFloat(raw);\n if (isNaN(n)) {\n return null;\n }\n return this.#snapToSteps(n);\n }\n\n // ─── Progress ────────────────────────────────────────────────────────────────\n\n get progress() {\n return this.#computeProgress(this.#value);\n }\n\n get progressStart() {\n return this.#computeProgress(this.#valueStart);\n }\n\n get progressEnd() {\n return this.#computeProgress(this.#valueEnd);\n }\n\n #computeProgress(rawValue: string): number {\n if (this.#stepsMode) {\n const total = this.#normalizedSteps.length - 1;\n if (total <= 0) {\n return 0;\n }\n const idx = this.#stepsIndexOf(rawValue);\n return idx < 0 ? 0 : parseFloat(((idx / total) * 100).toFixed(4));\n }\n if (this.#range === 0) {\n return 0;\n }\n const num = parseFloat(rawValue);\n return isNaN(num) ? 0 : parseFloat((((num - this.min) / this.#range) * 100).toFixed(4));\n }\n\n #singleTrackBackground(progress: number): string {\n const c = this.#progressColor;\n const stop = ZuiSlider.#thumbPositionCSS(progress);\n return `linear-gradient(to right, transparent var(--zui-slider-thumb-size), ${c} var(--zui-slider-thumb-size), ${c} ${stop}, var(--zui-gray-200) ${stop}, var(--zui-gray-200) calc(100% - var(--zui-slider-thumb-size)), transparent calc(100% - var(--zui-slider-thumb-size)))`;\n }\n\n #rangeTrackBackground(progressStart: number, progressEnd: number): string {\n const c = this.#progressColor;\n const startStop = ZuiSlider.#thumbPositionCSS(progressStart);\n const endStop = ZuiSlider.#thumbPositionCSS(progressEnd);\n return `linear-gradient(to right, transparent var(--zui-slider-thumb-size), var(--zui-gray-200) var(--zui-slider-thumb-size), var(--zui-gray-200) ${startStop}, ${c} ${startStop}, ${c} ${endStop}, var(--zui-gray-200) ${endStop}, var(--zui-gray-200) calc(100% - var(--zui-slider-thumb-size)), transparent calc(100% - var(--zui-slider-thumb-size)))`;\n }\n\n // ─── Render ──────────────────────────────────────────────────────────────────\n\n render() {\n return html`${this.range ? this.#renderRange() : this.#renderSingle()}${this.#renderMinMaxLabels()}`;\n }\n\n #renderSingle() {\n const progress = this.progress;\n const { nativeMin, nativeMax, nativeStep } = this.#nativeRangeAttrs;\n // live() required: direct DOM writes during drag don't trigger a state change, so Lit won't re-sync without it.\n const nativeValue = this.#stepsMode ? String(Math.max(0, this.#stepsIndexOf(this.#value))) : this.#value;\n return html`\n <div class=\"single-wrapper\">\n <input\n aria-label=\"Slider value\"\n style=${styleMap({ '--zui-slider-track-bg': this.#singleTrackBackground(progress) })}\n type=\"range\"\n .min=\"${nativeMin}\"\n .max=\"${nativeMax}\"\n .step=\"${nativeStep}\"\n .value=\"${live(nativeValue)}\"\n ?disabled=\"${this.disabled || this.readOnly}\"\n @input=\"${this.#onInput}\"\n @change=\"${this.#onChange}\"\n @pointerenter=\"${this.#h.thumb.show}\"\n @pointerleave=\"${this.#h.thumb.hide}\"\n @focus=\"${this.#h.thumb.show}\"\n @blur=\"${this.#h.thumb.hide}\"\n />\n ${this.#renderFloatingInput(\n this.#value,\n this.#onThumbFloatingChange,\n 'thumb',\n this.#isVisible('thumb'),\n progress\n )}\n ${this.#renderStepDots()}\n </div>\n `;\n }\n\n #renderRange() {\n const progressStart = this.progressStart;\n const progressEnd = this.progressEnd;\n return html`\n <div class=\"range-wrapper\" @click=\"${this.#onTrackClick}\">\n ${this.#renderRangeInput('start', this.#rangeTrackBackground(progressStart, progressEnd))}\n ${this.#renderFloatingInput(\n this.#valueStart,\n this.#onStartThumbFloatingChange,\n 'startThumb',\n this.#isVisible('startThumb'),\n progressStart\n )}\n ${this.#renderRangeInput('end')}\n ${this.#renderFloatingInput(\n this.#valueEnd,\n this.#onEndThumbFloatingChange,\n 'endThumb',\n this.#isVisible('endThumb'),\n progressEnd\n )}\n ${this.#renderStepDots()}\n </div>\n `;\n }\n\n #renderRangeInput(which: 'start' | 'end', trackBg?: string) {\n const flag: ThumbFlag = which === 'start' ? 'startThumb' : 'endThumb';\n const val = which === 'start' ? this.#valueStart : this.#valueEnd;\n const onInput = which === 'start' ? this.#onRangeStartInput : this.#onRangeEndInput;\n const h = this.#h[flag];\n const { nativeMin, nativeMax, nativeStep } = this.#nativeRangeAttrs;\n const nativeValue = this.#stepsMode ? String(Math.max(0, this.#stepsIndexOf(val))) : val;\n // live() required: direct DOM writes during drag don't trigger a state change, so Lit won't re-sync without it.\n return html`\n <input\n aria-label=\"${which === 'start' ? 'Range start' : 'Range end'}\"\n class=\"range-${which}\"\n type=\"range\"\n style=${trackBg ? styleMap({ '--zui-slider-track-bg': trackBg }) : nothing}\n .min=\"${nativeMin}\"\n .max=\"${nativeMax}\"\n .step=\"${nativeStep}\"\n .value=\"${live(nativeValue)}\"\n ?disabled=\"${this.disabled || this.readOnly}\"\n @click=\"${this.#stopClickPropagation}\"\n @input=\"${onInput}\"\n @change=\"${this.#onRangeChange}\"\n @pointerenter=\"${h.show}\"\n @pointerleave=\"${h.hide}\"\n @focus=\"${h.show}\"\n @blur=\"${h.hide}\"\n />\n `;\n }\n\n #renderFloatingInput(\n val: string,\n onFloatingChange: (e: Event) => void,\n flag: ThumbFlag,\n visible: boolean,\n progress: number\n ) {\n const h = this.#h[flag];\n // type=\"text\" in steps mode to allow label and stepParser input.\n // live() required: commits that snap/clamp to the current value skip reactive updates, so Lit won't re-sync without it.\n const ariaLabel =\n flag === 'startThumb' ? 'Range start value' : flag === 'endThumb' ? 'Range end value' : 'Slider value';\n return html`\n <div\n class=${classMap({ 'thumb-input': true, 'thumb-input--visible': visible })}\n style=${styleMap({ left: ZuiSlider.#thumbPositionCSS(progress) })}\n @click=\"${this.#stopClickPropagation}\"\n @pointerenter=\"${h.show}\"\n @pointerleave=\"${h.hide}\"\n >\n <input\n aria-label=\"${ariaLabel}\"\n type=\"${this.#stepsMode ? 'text' : 'number'}\"\n .value=\"${live(val)}\"\n .min=\"${this.#stepsMode ? '' : String(this.min)}\"\n .max=\"${this.#stepsMode ? '' : String(this.max)}\"\n .step=\"${this.#stepsMode ? '' : this.step > 0 ? String(this.step) : '1'}\"\n ?disabled=\"${this.disabled}\"\n ?readonly=\"${this.readOnly}\"\n @keydown=\"${this.#onFloatingInputKeydown}\"\n @input=\"${h.input}\"\n @change=\"${onFloatingChange}\"\n @focus=\"${h.focus}\"\n @blur=\"${h.blurCommit}\"\n />\n </div>\n `;\n }\n\n #renderStepDots() {\n if (this.#stepsMode) {\n const normalized = this.#normalizedSteps;\n const total = normalized.length - 1;\n if (total <= 0 || normalized.length > 100) {\n return nothing;\n }\n const stepDots = normalized.map((step, i) => {\n const left =\n i === 0\n ? 'var(--zui-slider-thumb-size)'\n : i === total\n ? 'calc(100% - var(--zui-slider-thumb-size))'\n : ZuiSlider.#thumbPositionCSS((i / total) * 100);\n return html`<span\n class=${classMap({ 'step-dot': true, 'step-dot--last': i === total && this.showStepLabels })}\n style=\"left: ${left}\"\n ></span>\n ${this.showStepLabels\n ? html`<span class=\"step-dot-label\" style=\"left: ${left}\">${step.label}</span>`\n : nothing}`;\n });\n return html`<div class=\"step-dots\">${stepDots}</div>`;\n }\n if (this.step <= 0 || this.#range === 0) {\n return nothing;\n }\n const count = Math.round(this.#range / this.step);\n if (count > 100) {\n return nothing;\n }\n const dots = [];\n for (let i = 0; i <= count; i++) {\n let left: string;\n if (i === 0) {\n left = 'var(--zui-slider-thumb-size)';\n } else if (i === count) {\n left = 'calc(100% - var(--zui-slider-thumb-size))';\n } else {\n const pos = parseFloat((((i * this.step) / this.#range) * 100).toFixed(4));\n left = ZuiSlider.#thumbPositionCSS(pos);\n }\n dots.push(html`<span class=\"step-dot\" style=\"left: ${left}\"></span>`);\n }\n return html`<div class=\"step-dots\">${dots}</div>`;\n }\n\n #renderMinMaxLabels() {\n const normalized = this.#normalizedSteps;\n const minLabel = this.#stepsMode ? normalized[0]?.label ?? '' : String(this.min);\n const maxLabel = this.#stepsMode ? normalized[normalized.length - 1]?.label ?? '' : String(this.max);\n const hidden = this.showStepLabels;\n return html`\n <div\n class=\"min-max-labels\"\n aria-hidden=\"${ifDefined(hidden ? 'true' : undefined)}\"\n style=${hidden ? styleMap({ visibility: 'hidden' }) : nothing}\n >\n <span class=\"min-max-label\">${minLabel}</span>\n <span class=\"min-max-label\">${maxLabel}</span>\n </div>\n `;\n }\n\n // ─── Event handlers ──────────────────────────────────────────────────────────\n\n #onInput(e: Event) {\n if (this.readOnly) {\n return;\n }\n const input = e.target as HTMLInputElement;\n if (this.#stepsMode) {\n this.value = this.#stepAt(parseInt(input.value, 10));\n } else {\n this.value = input.value;\n }\n }\n\n #onChange() {\n this.dispatchEvent(new CustomEvent('change', { detail: this.#value, bubbles: true }));\n }\n\n #processFloatingValue(raw: number): string {\n const stepDecimals = this.step > 0 ? (String(this.step).split('.')[1] ?? '').length : 0;\n const stepped = this.step > 0 ? Math.round((raw - this.min) / this.step) * this.step + this.min : raw;\n const clamped = Math.min(this.max, Math.max(this.min, stepped));\n return stepDecimals > 0 ? clamped.toFixed(stepDecimals) : String(Math.round(clamped));\n }\n\n #currentValueForFlag(flag: ThumbFlag): string {\n if (flag === 'startThumb') {\n return this.#valueStart;\n }\n if (flag === 'endThumb') {\n return this.#valueEnd;\n }\n return this.#value;\n }\n\n #makeThumbHandlers(flag: ThumbFlag) {\n return {\n show: () => this.#showThumbInput(flag),\n hide: () => this.#scheduleHideThumbInput(flag),\n focus: () => this.#focusFloatingInput(flag),\n input: () => {\n this.#thumbInputState.get(flag)!.committed = false;\n },\n blurCommit: (e: FocusEvent) => {\n const entry = this.#thumbInputState.get(flag)!;\n if (!entry.committed) {\n (e.target as HTMLInputElement).dispatchEvent(new Event('change'));\n }\n entry.committed = false;\n this.#blurFloatingInput(flag);\n },\n };\n }\n\n #nudgeStepsValue(flag: ThumbFlag, resolved: string): string {\n if (flag === 'thumb') {\n return resolved;\n }\n const resolvedIdx = this.#stepsIndexOf(resolved);\n const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));\n const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));\n if (flag === 'startThumb' && resolvedIdx >= endIdx) {\n const nudgedIdx = endIdx - 1;\n return nudgedIdx >= 0 ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);\n }\n if (flag === 'endThumb' && resolvedIdx <= startIdx) {\n const nudgedIdx = startIdx + 1;\n return nudgedIdx < this.#normalizedSteps.length ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);\n }\n return resolved;\n }\n\n #nudgeNumericValue(flag: ThumbFlag, processed: string): string {\n if (flag === 'thumb') {\n return processed;\n }\n const effectiveStep = this.step > 0 ? this.step : 1;\n if (flag === 'startThumb') {\n const endNum = parseFloat(this.#valueEnd);\n if (parseFloat(processed) >= endNum) {\n const nudged = this.#processFloatingValue(endNum - effectiveStep);\n return parseFloat(nudged) < endNum ? nudged : this.#currentValueForFlag(flag);\n }\n } else {\n const startNum = parseFloat(this.#valueStart);\n if (parseFloat(processed) <= startNum) {\n const nudged = this.#processFloatingValue(startNum + effectiveStep);\n return parseFloat(nudged) > startNum ? nudged : this.#currentValueForFlag(flag);\n }\n }\n return processed;\n }\n\n #makeFloatingChange(flag: ThumbFlag, setter: (val: string) => void, dispatch: () => void) {\n return (e: Event) => {\n if (this.readOnly) {\n return;\n }\n const input = e.target as HTMLInputElement;\n if (input.value === '') {\n input.value = this.#currentValueForFlag(flag);\n return;\n }\n const before = this.#currentValueForFlag(flag);\n const commit = (value: string) => {\n setter(value);\n this.#thumbInputState.get(flag)!.committed = true;\n if (this.#currentValueForFlag(flag) !== before) {\n dispatch();\n }\n // Force re-render so live() corrects the DOM when the nudged/clamped value equals the stored value and the setter no-ops.\n this.requestUpdate();\n };\n if (this.#stepsMode) {\n const resolved = this.#resolveFloatingInput(input.value);\n if (resolved === null) {\n input.value = this.#currentValueForFlag(flag);\n return;\n }\n commit(this.#nudgeStepsValue(flag, resolved));\n } else {\n commit(this.#nudgeNumericValue(flag, this.#processFloatingValue(parseFloat(input.value))));\n }\n };\n }\n\n #onRangeInput(which: 'start' | 'end') {\n return (e: Event) => {\n if (this.readOnly) {\n return;\n }\n const input = e.target as HTMLInputElement;\n if (this.#stepsMode) {\n const idx = parseInt(input.value, 10);\n const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));\n const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));\n if (which === 'start') {\n if (idx >= endIdx) {\n input.value = String(startIdx);\n return;\n }\n this.valueStart = this.#stepAt(idx);\n } else {\n if (idx <= startIdx) {\n input.value = String(endIdx);\n return;\n }\n this.valueEnd = this.#stepAt(idx);\n }\n } else {\n if (which === 'start') {\n if (parseFloat(input.value) >= parseFloat(this.#valueEnd)) {\n input.value = this.#valueStart;\n return;\n }\n this.valueStart = input.value;\n } else {\n if (parseFloat(input.value) <= parseFloat(this.#valueStart)) {\n input.value = this.#valueEnd;\n return;\n }\n this.valueEnd = input.value;\n }\n }\n };\n }\n\n #onRangeChange() {\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: { valueStart: this.#valueStart, valueEnd: this.#valueEnd },\n bubbles: true,\n })\n );\n }\n\n #onTrackClick(e: MouseEvent) {\n if (this.disabled || this.readOnly) {\n return;\n }\n const wrapper = e.currentTarget as HTMLElement;\n const rect = wrapper.getBoundingClientRect();\n // Thumb diameter is 3× the custom property; radius is 1.5×. Track is inset by one radius each side.\n const thumbRadius = 1.5 * parseFloat(getComputedStyle(this).getPropertyValue('--zui-slider-thumb-size'));\n const trackLeft = rect.left + thumbRadius;\n const effectiveWidth = rect.width - 2 * thumbRadius;\n const fraction = Math.max(0, Math.min(1, (e.clientX - trackLeft) / effectiveWidth));\n\n if (this.#stepsMode) {\n const total = this.#normalizedSteps.length - 1;\n if (total <= 0) {\n return;\n }\n const clickedIdx = Math.round(fraction * total);\n const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));\n const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));\n\n // Ignore clicks within a thumb's hit area\n const startX = trackLeft + (startIdx / total) * effectiveWidth;\n const endX = trackLeft + (endIdx / total) * effectiveWidth;\n if (Math.abs(e.clientX - startX) <= thumbRadius || Math.abs(e.clientX - endX) <= thumbRadius) {\n return;\n }\n\n // Move whichever thumb is closer by index distance; prefer start on a tie\n if (Math.abs(clickedIdx - startIdx) <= Math.abs(clickedIdx - endIdx)) {\n if (clickedIdx < endIdx) {\n this.valueStart = this.#stepAt(clickedIdx);\n this.#onRangeChange();\n }\n } else {\n if (clickedIdx > startIdx) {\n this.valueEnd = this.#stepAt(clickedIdx);\n this.#onRangeChange();\n }\n }\n return;\n }\n\n const rawValue = this.min + fraction * (this.max - this.min);\n\n // Ignore clicks within a thumb's hit area; those are native input interactions, not track clicks.\n const startX = trackLeft + (this.progressStart / 100) * effectiveWidth;\n const endX = trackLeft + (this.progressEnd / 100) * effectiveWidth;\n if (Math.abs(e.clientX - startX) <= thumbRadius || Math.abs(e.clientX - endX) <= thumbRadius) {\n return;\n }\n\n const snappedStr = this.#processFloatingValue(rawValue);\n const snapped = parseFloat(snappedStr);\n const startNum = parseFloat(this.#valueStart);\n const endNum = parseFloat(this.#valueEnd);\n\n // Move whichever thumb is closer to the click; prefer start on a tie\n if (Math.abs(rawValue - startNum) <= Math.abs(rawValue - endNum)) {\n if (snapped < endNum) {\n this.valueStart = snappedStr;\n this.#onRangeChange();\n }\n } else {\n if (snapped > startNum) {\n this.valueEnd = snappedStr;\n this.#onRangeChange();\n }\n }\n }\n\n #showThumbInput(flag: ThumbFlag) {\n if (this.disabled) {\n return;\n }\n const entry = this.#thumbInputState.get(flag)!;\n clearTimeout(entry.timer);\n entry.timer = undefined;\n entry.visible = true;\n this.requestUpdate();\n }\n\n #scheduleHideThumbInput(flag: ThumbFlag) {\n const entry = this.#thumbInputState.get(flag)!;\n clearTimeout(entry.timer);\n entry.timer = setTimeout(() => {\n if (!entry.focused) {\n entry.visible = false;\n this.requestUpdate();\n }\n }, 100);\n }\n\n #focusFloatingInput(flag: ThumbFlag) {\n if (this.disabled) {\n return;\n }\n this.#showThumbInput(flag);\n const entry = this.#thumbInputState.get(flag)!;\n entry.focused = true;\n entry.committed = false;\n }\n\n #blurFloatingInput(flag: ThumbFlag) {\n const entry = this.#thumbInputState.get(flag)!;\n entry.focused = false;\n this.#scheduleHideThumbInput(flag);\n }\n\n // Maps progress 0-100 to a --zui-slider-thumb-size multiplier (1.5 at 0%, -1.5 at 100%) that centers the thumb on the track.\n static #thumbCenterOffset(progress: number): number {\n return 1.5 - (3 * progress) / 100;\n }\n\n static #thumbPositionCSS(progress: number): string {\n return `calc(${progress}% + var(--zui-slider-thumb-size) * ${ZuiSlider.#thumbCenterOffset(progress)})`;\n }\n}\n\nwindow.customElements.define('zui-slider', ZuiSlider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'zui-slider': ZuiSlider;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zywave/zui-slider",
3
- "version": "4.4.0-pre.6",
3
+ "version": "4.4.0-pre.7",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "license": "UNLICENSED",
@@ -27,5 +27,5 @@
27
27
  "devDependencies": {
28
28
  "@zywave/zui-input": "^4.2.3"
29
29
  },
30
- "gitHead": "aa5d64cceb0d19d6e79afb2063662f1c999e3fe6"
30
+ "gitHead": "91001130115e975d6e51c42c53bad51e6569c280"
31
31
  }
package/src/zui-slider.ts CHANGED
@@ -759,6 +759,45 @@ export class ZuiSlider extends ZuiFormAssociatedElement {
759
759
  };
760
760
  }
761
761
 
762
+ #nudgeStepsValue(flag: ThumbFlag, resolved: string): string {
763
+ if (flag === 'thumb') {
764
+ return resolved;
765
+ }
766
+ const resolvedIdx = this.#stepsIndexOf(resolved);
767
+ const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));
768
+ const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));
769
+ if (flag === 'startThumb' && resolvedIdx >= endIdx) {
770
+ const nudgedIdx = endIdx - 1;
771
+ return nudgedIdx >= 0 ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);
772
+ }
773
+ if (flag === 'endThumb' && resolvedIdx <= startIdx) {
774
+ const nudgedIdx = startIdx + 1;
775
+ return nudgedIdx < this.#normalizedSteps.length ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);
776
+ }
777
+ return resolved;
778
+ }
779
+
780
+ #nudgeNumericValue(flag: ThumbFlag, processed: string): string {
781
+ if (flag === 'thumb') {
782
+ return processed;
783
+ }
784
+ const effectiveStep = this.step > 0 ? this.step : 1;
785
+ if (flag === 'startThumb') {
786
+ const endNum = parseFloat(this.#valueEnd);
787
+ if (parseFloat(processed) >= endNum) {
788
+ const nudged = this.#processFloatingValue(endNum - effectiveStep);
789
+ return parseFloat(nudged) < endNum ? nudged : this.#currentValueForFlag(flag);
790
+ }
791
+ } else {
792
+ const startNum = parseFloat(this.#valueStart);
793
+ if (parseFloat(processed) <= startNum) {
794
+ const nudged = this.#processFloatingValue(startNum + effectiveStep);
795
+ return parseFloat(nudged) > startNum ? nudged : this.#currentValueForFlag(flag);
796
+ }
797
+ }
798
+ return processed;
799
+ }
800
+
762
801
  #makeFloatingChange(flag: ThumbFlag, setter: (val: string) => void, dispatch: () => void) {
763
802
  return (e: Event) => {
764
803
  if (this.readOnly) {
@@ -776,47 +815,18 @@ export class ZuiSlider extends ZuiFormAssociatedElement {
776
815
  if (this.#currentValueForFlag(flag) !== before) {
777
816
  dispatch();
778
817
  }
818
+ // Force re-render so live() corrects the DOM when the nudged/clamped value equals the stored value and the setter no-ops.
819
+ this.requestUpdate();
779
820
  };
780
821
  if (this.#stepsMode) {
781
822
  const resolved = this.#resolveFloatingInput(input.value);
782
- if (resolved !== null) {
783
- let finalResolved = resolved;
784
- if (flag !== 'thumb') {
785
- const resolvedIdx = this.#stepsIndexOf(resolved);
786
- const endIdx = Math.max(0, this.#stepsIndexOf(this.#valueEnd));
787
- const startIdx = Math.max(0, this.#stepsIndexOf(this.#valueStart));
788
- if (flag === 'startThumb' && resolvedIdx >= endIdx) {
789
- const nudgedIdx = endIdx - 1;
790
- finalResolved = nudgedIdx >= 0 ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);
791
- } else if (flag === 'endThumb' && resolvedIdx <= startIdx) {
792
- const nudgedIdx = startIdx + 1;
793
- finalResolved =
794
- nudgedIdx < this.#normalizedSteps.length ? this.#stepAt(nudgedIdx) : this.#currentValueForFlag(flag);
795
- }
796
- }
797
- commit(finalResolved);
798
- } else {
823
+ if (resolved === null) {
799
824
  input.value = this.#currentValueForFlag(flag);
825
+ return;
800
826
  }
827
+ commit(this.#nudgeStepsValue(flag, resolved));
801
828
  } else {
802
- let processed = this.#processFloatingValue(parseFloat(input.value));
803
- if (flag !== 'thumb') {
804
- const effectiveStep = this.step > 0 ? this.step : 1;
805
- if (flag === 'startThumb') {
806
- const endNum = parseFloat(this.#valueEnd);
807
- if (parseFloat(processed) >= endNum) {
808
- const nudged = this.#processFloatingValue(endNum - effectiveStep);
809
- processed = parseFloat(nudged) < endNum ? nudged : this.#currentValueForFlag(flag);
810
- }
811
- } else {
812
- const startNum = parseFloat(this.#valueStart);
813
- if (parseFloat(processed) <= startNum) {
814
- const nudged = this.#processFloatingValue(startNum + effectiveStep);
815
- processed = parseFloat(nudged) > startNum ? nudged : this.#currentValueForFlag(flag);
816
- }
817
- }
818
- }
819
- commit(processed);
829
+ commit(this.#nudgeNumericValue(flag, this.#processFloatingValue(parseFloat(input.value))));
820
830
  }
821
831
  };
822
832
  }
@@ -335,6 +335,18 @@ suite('zui-slider', () => {
335
335
  assert.equal(element.value, '20');
336
336
  });
337
337
 
338
+ test('floating input DOM value resets after commit when clamped value equals current value', async () => {
339
+ element.value = '100';
340
+ await element.updateComplete;
341
+ const floatInput = element.shadowRoot!.querySelector<HTMLInputElement>('.thumb-input input[type="number"]')!;
342
+ // setter no-ops when clamped result matches stored value, so live() needs a forced render to correct the DOM
343
+ floatInput.value = '150';
344
+ floatInput.dispatchEvent(new Event('change'));
345
+ await element.updateComplete;
346
+ assert.equal(element.value, '100');
347
+ assert.equal(floatInput.value, '100');
348
+ });
349
+
338
350
  test('floating input snaps typed value to nearest step on commit', async () => {
339
351
  await element.updateComplete;
340
352
  element.step = 10;
@@ -1146,6 +1158,20 @@ suite('zui-slider range', () => {
1146
1158
  assert.equal(element.valueStart, '1');
1147
1159
  });
1148
1160
 
1161
+ test('range end floating input DOM value resets after commit when nudged value equals current valueEnd', async () => {
1162
+ element.step = 10;
1163
+ element.valueStart = '40';
1164
+ element.valueEnd = '50';
1165
+ await element.updateComplete;
1166
+ const floatInputs = element.shadowRoot!.querySelectorAll<HTMLInputElement>('.thumb-input input[type="number"]');
1167
+ // setter no-ops when nudged result matches stored valueEnd, so live() needs a forced render to correct the DOM
1168
+ floatInputs[1].value = '40';
1169
+ floatInputs[1].dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }));
1170
+ await element.updateComplete;
1171
+ assert.equal(element.valueEnd, '50');
1172
+ assert.equal(floatInputs[1].value, '50');
1173
+ });
1174
+
1149
1175
  test('blurring range floating input commits typed value', async () => {
1150
1176
  await element.updateComplete;
1151
1177
  const floatInputs = element.shadowRoot!.querySelectorAll<HTMLInputElement>('.thumb-input input[type="number"]');