@zywave/zui-slider 4.3.2 → 4.4.0-pre.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.
- package/dist/css/zui-slider.fouc.css +1 -1
- package/dist/custom-elements.json +567 -40
- package/dist/zui-slider-css.js +1 -1
- package/dist/zui-slider-css.js.map +1 -1
- package/dist/zui-slider.d.ts +43 -17
- package/dist/zui-slider.js +510 -80
- package/dist/zui-slider.js.map +1 -1
- package/docs/demo.html +130 -9
- package/lab.html +45 -1
- package/package.json +5 -2
- package/src/css/zui-slider.fouc.scss +75 -1
- package/src/zui-slider-css.js +1 -1
- package/src/zui-slider.scss +239 -29
- package/src/zui-slider.ts +557 -75
- package/test/zui-slider.test.ts +1224 -4
package/dist/zui-slider.js.map
CHANGED
|
@@ -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,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,SAAU,SAAQ,wBAAwB;IAAvD;;QAaE,kBAAa,GAAG,GAAG,WAAW,GAAG,CAAC,EAAE,CAAC;QAErC,WAAM,GAAG,GAAG,WAAW,GAAG,CAAC,EAAE,CAAC;QAmB9B;;WAEG;QACyB,QAAG,GAAG,CAAC,CAAC;QAEpC;;WAEG;QAC2C,QAAG,GAAG,GAAG,CAAC;QAExD;;WAEG;QACyB,SAAI,GAAG,CAAC,CAAC;QAEr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C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sCAAW;AAK5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAU;AAKc;IAAlD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;yCAAgB;AAwFpE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { ZuiFormAssociatedElement } from '@zywave/zui-base';\nimport { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { style } from './zui-slider-css.js';\n\nconst DEFAULT_MAX = 100;\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. Can be set to a default value, and will reflect the value provided by the user when interactive with the control\n *\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 of the element, interpreted as one of the following, in order: A number, NaN if conversion is impossible\n * @prop {string} [value='50'] - Represents the value of the input. 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\n *\n * @cssprop [--zui-slider-thumb-size=1.875rem (30px)] - Point of contact to grab and slide to change value\n *\n * @event {CustomEvent} change - Fires when value changes, details contain `value`\n */\nexport class ZuiSlider extends ZuiFormAssociatedElement {\n protected get _focusControlSelector() {\n return 'input';\n }\n\n protected get _formValue() {\n return this.value;\n }\n\n protected formResetCallback() {\n this.value = this.#defaultValue;\n }\n\n #defaultValue = `${DEFAULT_MAX / 2}`;\n\n #value = `${DEFAULT_MAX / 2}`;\n\n @property()\n get value() {\n return this.#value;\n }\n\n set value(val) {\n const oldVal = this.#value;\n val = this._ensureValidValue(val);\n this.#value = val;\n this._setFormValue(this.#value);\n this.requestUpdate('value', oldVal);\n }\n\n get valueAsNumber() {\n return parseFloat(this.#value);\n }\n\n /**\n * Represents the maximum permitted value\n */\n @property({ type: Number }) min = 0;\n\n /**\n * Represents the maximum permitted value\n */\n @property({ type: Number, attribute: 'max' }) max = 100;\n\n /**\n * Represents the stepping interval, used both for user interface and validation purposes\n */\n @property({ type: Number }) step = 0;\n\n /**\n * Represents that this control must be filled in for form submission\n */\n @property({ type: Boolean, attribute: 'no-text' }) noText = false;\n\n get progress() {\n return ((this.valueAsNumber - this.min) / (this.max - this.min)) * 100;\n }\n\n static get styles() {\n return [super.styles, style];\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // we want to go a little faster than LitElement and behave more like native HTML Form Associated Elements\n let value = this.getAttribute('value') ?? this.value;\n const max = this.getAttribute('max') ?? this.max;\n const min = this.getAttribute('min') ?? this.min;\n\n value = this._ensureValidValue(value, min, max);\n\n this.#defaultValue = value;\n this._setFormValue(value.toString());\n }\n\n render() {\n const progressColor = this.disabled ? 'var(--zui-gray)' : 'var(--zui-blue)';\n const styles = {\n background: `linear-gradient(to right, ${progressColor} 0%, ${progressColor} ${this.progress}%, var(--zui-gray-200) ${this.progress}%, var(--zui-gray-200) 100%)`,\n };\n return html`<input\n style=${styleMap(styles)}\n type=\"range\"\n .value=\"${this.value}\"\n .min=\"${this.min}\"\n .max=\"${this.max}\"\n .step=\"${this.step}\"\n ?disabled=\"${this.disabled}\"\n @input=\"${this._onInput}\"\n @change=\"${this._onChange}\"\n />${this._renderText()}`;\n }\n\n private _renderText() {\n if (this.noText) {\n return html``;\n }\n const thumbOffset = `var(--zui-slider-thumb-size) * ${this.progress / 100}`;\n const styles = {\n left: `calc(${this.progress}% - ${thumbOffset} + 0.125rem)`,\n };\n return html`<span style=${styleMap(styles)}>${this.value}</span>`;\n }\n\n private _onInput(e: Event) {\n this.value = (e.target as HTMLInputElement).value;\n }\n\n private _onChange() {\n this.dispatchEvent(new CustomEvent('change', { detail: this.value, bubbles: true }));\n }\n\n private _ensureValidValue(value: string | number, min?: number | string | null, max?: number | string | null) {\n if (value === '') {\n return value;\n }\n min = min ?? this.min;\n max = max ?? this.max;\n\n if (typeof value === 'string') {\n value = parseFloat(value);\n }\n if (typeof min === 'string') {\n min = parseFloat(min);\n }\n if (typeof max === 'string') {\n max = parseFloat(max);\n }\n\n if (value < min) {\n value = min;\n } else if (value > max) {\n value = max;\n }\n\n return value.toString();\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,EAAkB,MAAM,KAAK,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAA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import { ZuiFormAssociatedElement } from '@zywave/zui-base';\nimport { html, nothing, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.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/**\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 {boolean} [show-min-max=false] - Shows the min and max values beneath the slider\n *\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 {boolean} [showMinMax=false] - Shows the min and max values beneath the slider\n *\n * @cssprop [--zui-slider-thumb-size=0.875rem (14px)] - Controls the visual dot size and thumb hit-area (hit area is 3× this value)\n * @cssprop [--zui-slider-input-width=7ch] - Width of the floating value input above each 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 #thumbInputState = new Map<\n ThumbFlag,\n {\n visible: boolean;\n focused: boolean;\n timer?: ReturnType<typeof setTimeout>;\n debounceTimer?: ReturnType<typeof setTimeout>;\n }\n >([\n ['thumb', { visible: false, focused: false }],\n ['startThumb', { visible: false, focused: false }],\n ['endThumb', { visible: false, focused: false }],\n ]);\n\n // Pre-bound floating input handlers cached to avoid new function references on every render\n #onThumbFloatingInput = this.#onFloatingInput('thumb', (v) => (this.value = v));\n #onStartThumbFloatingInput = this.#onFloatingInput('startThumb', (v) => (this.valueStart = v));\n #onEndThumbFloatingInput = this.#onFloatingInput('endThumb', (v) => (this.valueEnd = v));\n\n // Cached floating input change handlers — flush debounce and dispatch immediately on commit (Enter/blur)\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 range drag input handlers\n #onRangeStartInput = this.#onRangeInput('start');\n #onRangeEndInput = this.#onRangeInput('end');\n\n // Cached pointer/focus handlers per thumb — prevents new closures on every render\n #h: Record<ThumbFlag, { show: () => void; hide: () => void; focus: () => void; blur: () => void }> = {\n thumb: {\n show: () => this.#showThumbInput('thumb'),\n hide: () => this.#scheduleHideThumbInput('thumb'),\n focus: () => this.#focusFloatingInput('thumb'),\n blur: () => this.#blurFloatingInput('thumb'),\n },\n startThumb: {\n show: () => this.#showThumbInput('startThumb'),\n hide: () => this.#scheduleHideThumbInput('startThumb'),\n focus: () => this.#focusFloatingInput('startThumb'),\n blur: () => this.#blurFloatingInput('startThumb'),\n },\n endThumb: {\n show: () => this.#showThumbInput('endThumb'),\n hide: () => this.#scheduleHideThumbInput('endThumb'),\n focus: () => this.#focusFloatingInput('endThumb'),\n blur: () => this.#blurFloatingInput('endThumb'),\n },\n };\n\n static get styles() {\n return [super.styles, style];\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.updateComplete.then(() => {\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 // Schedule a re-render so the cleared visibility state is reflected in the DOM.\n // Lit defers this render until the element reconnects if it is currently disconnected.\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('min') || changed.has('max')) {\n // The native inputs have already clamped (and step-snapped) their values to the new bounds.\n // Read them back and sync internal state + form value. If the value changed, request a\n // re-render so the floating input (which binds to #value/#valueStart/#valueEnd) stays in sync.\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 // Always request a re-render so the cleared thumb visibility is reflected even when the\n // reset value equals the current value (the named setter requestUpdate would be 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 clearTimeout(entry.debounceTimer);\n entry.timer = undefined;\n entry.debounceTimer = undefined;\n entry.visible = false;\n entry.focused = false;\n }\n }\n\n /**\n * Clamps a raw string value to the current [min, max] range.\n * Empty string is passed through unchanged (represents an in-progress floating input edit).\n * Non-numeric strings are passed through unchanged.\n */\n #clampToRange(rawVal: string): string {\n if (rawVal === '') {\n return rawVal;\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 /**\n * Enables range mode with two thumbs for selecting a value range\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 /**\n * Represents the minimum permitted value\n */\n @property({ type: Number }) min = 0;\n\n /**\n * Represents the maximum permitted value\n */\n @property({ type: Number }) max = 100;\n\n /**\n * Represents the stepping interval, used both for user interface and validation purposes\n */\n @property({ type: Number }) step = 0;\n\n /**\n * Shows the min and max values beneath the slider\n */\n @property({ type: Boolean, attribute: 'show-min-max' }) showMinMax = 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 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.#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 return html`${this.range ? this.#renderRange() : this.#renderSingle()}${this.#renderMinMaxLabels()}`;\n }\n\n #renderSingle() {\n const progress = this.progress;\n return html`\n <div class=\"single-wrapper\">\n <input\n aria-label=\"Slider value\"\n style=${styleMap({ background: this.#singleTrackBackground(progress) })}\n type=\"range\"\n .min=\"${String(this.min)}\"\n .max=\"${String(this.max)}\"\n .step=\"${this.step > 0 ? String(this.step) : '1'}\"\n .value=\"${this.#value}\"\n ?disabled=\"${this.disabled}\"\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.#renderStepDots()}\n ${this.#renderFloatingInput(\n this.#value,\n this.#onThumbFloatingInput,\n this.#onThumbFloatingChange,\n 'thumb',\n this.#isVisible('thumb'),\n progress\n )}\n </div>\n `;\n }\n\n #renderRange() {\n const progressStart = this.progressStart;\n const progressEnd = this.progressEnd;\n return html`\n <div\n class=\"range-wrapper\"\n style=${styleMap({ background: this.#rangeTrackBackground(progressStart, progressEnd) })}\n >\n ${this.#renderStepDots()}${this.#renderRangeInput('start')}\n ${this.#renderFloatingInput(\n this.#valueStart,\n this.#onStartThumbFloatingInput,\n this.#onStartThumbFloatingChange,\n 'startThumb',\n this.#isVisible('startThumb'),\n progressStart\n )}\n ${this.#renderRangeInput('end')}\n ${this.#renderFloatingInput(\n this.#valueEnd,\n this.#onEndThumbFloatingInput,\n this.#onEndThumbFloatingChange,\n 'endThumb',\n this.#isVisible('endThumb'),\n progressEnd\n )}\n </div>\n `;\n }\n\n #renderRangeInput(which: 'start' | 'end') {\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 // live() is required: when #onRangeInput snaps the DOM value back via direct input.value\n // assignment (drag past the other thumb), there is no state change → no re-render. live()\n // forces Lit to re-read the current DOM value and re-sync it on every render.\n return html`\n <input\n aria-label=\"${which === 'start' ? 'Range start' : 'Range end'}\"\n class=\"range-${which}\"\n type=\"range\"\n .min=\"${String(this.min)}\"\n .max=\"${String(this.max)}\"\n .step=\"${this.step > 0 ? String(this.step) : '1'}\"\n .value=\"${live(val)}\"\n ?disabled=\"${this.disabled}\"\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 onInput: (e: Event) => void,\n onFloatingChange: (e: Event) => void,\n flag: ThumbFlag,\n visible: boolean,\n progress: number\n ) {\n const h = this.#h[flag];\n // live() is required on the number input: when the debounced setter clamps a value to the\n // same string it already holds (e.g. typing 150 when max=100 clamps back to '100'), no\n // reactive property change occurs and Lit skips the DOM update. live() forces a re-read.\n return html`\n <div\n class=${classMap({ 'thumb-input': true, 'thumb-input--visible': visible })}\n style=${styleMap({ left: ZuiSlider.#thumbPositionCSS(progress) })}\n @pointerenter=\"${h.show}\"\n @pointerleave=\"${h.hide}\"\n >\n <input\n aria-label=\"${flag === 'startThumb'\n ? 'Range start value'\n : flag === 'endThumb'\n ? 'Range end value'\n : 'Slider value'}\"\n type=\"number\"\n .value=\"${live(val)}\"\n .min=\"${String(this.min)}\"\n .max=\"${String(this.max)}\"\n .step=\"${this.step > 0 ? String(this.step) : '1'}\"\n ?disabled=\"${this.disabled}\"\n ?readonly=\"${this.readOnly}\"\n @input=\"${onInput}\"\n @change=\"${onFloatingChange}\"\n @focus=\"${h.focus}\"\n @blur=\"${h.blur}\"\n />\n </div>\n `;\n }\n\n #renderStepDots() {\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: TemplateResult[] = [];\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 if (!this.showMinMax) {\n return nothing;\n }\n return html`\n <div class=\"min-max-labels\">\n <span class=\"min-max-label\">${this.min}</span>\n <span class=\"min-max-label\">${this.max}</span>\n </div>\n `;\n }\n\n #onInput(e: Event) {\n if (this.readOnly) {\n return;\n }\n this.value = (e.target as HTMLInputElement).value;\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 #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 return;\n }\n const entry = this.#thumbInputState.get(flag)!;\n clearTimeout(entry.debounceTimer);\n entry.debounceTimer = undefined;\n setter(this.#processFloatingValue(parseFloat(input.value)));\n dispatch();\n };\n }\n\n #onFloatingInput(flag: ThumbFlag, setter: (val: string) => void) {\n return (e: Event) => {\n if (this.readOnly) {\n return;\n }\n const input = e.target as HTMLInputElement;\n if (input.value === '') {\n return;\n }\n const raw = parseFloat(input.value);\n const entry = this.#thumbInputState.get(flag)!;\n clearTimeout(entry.debounceTimer);\n entry.debounceTimer = setTimeout(() => setter(this.#processFloatingValue(raw)), 300);\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 (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 #onRangeChange() {\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: { valueStart: this.#valueStart, valueEnd: this.#valueEnd },\n bubbles: true,\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 this.#thumbInputState.get(flag)!.focused = true;\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 a 0–100 progress value to a CSS multiplier for --zui-slider-thumb-size so that\n // `progress% + thumbSize * offset` lands on the thumb center within the inset wrapper.\n // At 0%: offset=1.5 → thumbSize*1.5 (thumb center at min). At 100%: offset=-1.5 → -thumbSize*1.5 (thumb center at max).\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/docs/demo.html
CHANGED
|
@@ -11,37 +11,158 @@
|
|
|
11
11
|
import("../../../../scripts/demo/demo.js");
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
|
+
<!-- ─── Single mode ──────────────────────────────────────────────────── -->
|
|
15
|
+
|
|
14
16
|
<section component="zui-slider" heading="Basic slider">
|
|
15
17
|
<zui-slider></zui-slider>
|
|
16
18
|
</section>
|
|
17
19
|
|
|
18
|
-
<section component="zui-slider" heading="Stepped slider">
|
|
20
|
+
<section component="zui-slider" heading="Stepped slider (step=10)">
|
|
19
21
|
<zui-slider step="10"></zui-slider>
|
|
20
22
|
</section>
|
|
21
23
|
|
|
22
|
-
<section component="zui-slider" heading="Stepped slider
|
|
24
|
+
<section component="zui-slider" heading="Stepped slider with decimal increments (step=0.01)">
|
|
23
25
|
<zui-slider step="0.01" value="50.01"></zui-slider>
|
|
24
26
|
</section>
|
|
25
27
|
|
|
26
|
-
<section component="zui-slider" heading="Bounded slider">
|
|
28
|
+
<section component="zui-slider" heading="Bounded slider (min=25, max=75)">
|
|
27
29
|
<zui-slider min="25" max="75"></zui-slider>
|
|
28
30
|
</section>
|
|
29
31
|
|
|
30
|
-
<section component="zui-slider" heading="Bounded slider with negative values">
|
|
32
|
+
<section component="zui-slider" heading="Bounded slider with negative values (min=-50, max=50)">
|
|
31
33
|
<zui-slider value="0" min="-50" max="50"></zui-slider>
|
|
32
34
|
</section>
|
|
33
35
|
|
|
34
|
-
<section component="zui-slider" heading="
|
|
35
|
-
<zui-slider
|
|
36
|
+
<section component="zui-slider" heading="Min/max labels">
|
|
37
|
+
<zui-slider show-min-max></zui-slider>
|
|
38
|
+
</section>
|
|
39
|
+
|
|
40
|
+
<section component="zui-slider" heading="Min/max labels with custom bounds">
|
|
41
|
+
<zui-slider show-min-max min="0" max="1000" value="300" step="100"></zui-slider>
|
|
42
|
+
</section>
|
|
43
|
+
|
|
44
|
+
<section component="zui-slider" heading="Disabled slider">
|
|
45
|
+
<zui-slider disabled value="35"></zui-slider>
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
<section component="zui-slider" heading="Read-only slider">
|
|
49
|
+
<zui-slider readonly value="65"></zui-slider>
|
|
36
50
|
</section>
|
|
37
51
|
|
|
38
|
-
<section component="zui-slider" heading="
|
|
52
|
+
<section component="zui-slider" heading="Programmatically set slider value">
|
|
39
53
|
<zui-slider id="zuiSliderDemoProgrammatic"></zui-slider>
|
|
40
|
-
<zui-button id="zuiSliderDemoButton">
|
|
54
|
+
<zui-button id="zuiSliderDemoButton">Randomise</zui-button>
|
|
41
55
|
|
|
42
56
|
<script>
|
|
43
|
-
document.getElementById("zuiSliderDemoButton").addEventListener("click", (
|
|
57
|
+
document.getElementById("zuiSliderDemoButton").addEventListener("click", () => {
|
|
44
58
|
document.getElementById("zuiSliderDemoProgrammatic").value = Math.floor(Math.random() * 100);
|
|
45
59
|
});
|
|
46
60
|
</script>
|
|
47
61
|
</section>
|
|
62
|
+
|
|
63
|
+
<section component="zui-slider" heading="Change event (single mode)">
|
|
64
|
+
<zui-slider id="zuiSliderDemoChange"></zui-slider>
|
|
65
|
+
<p>Last change: <strong id="zuiSliderDemoChangeOutput">—</strong></p>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
document.getElementById("zuiSliderDemoChange").addEventListener("change", (e) => {
|
|
69
|
+
document.getElementById("zuiSliderDemoChangeOutput").textContent = e.detail;
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
72
|
+
</section>
|
|
73
|
+
|
|
74
|
+
<!-- ─── Range mode ──────────────────────────────────────────────────── -->
|
|
75
|
+
|
|
76
|
+
<section component="zui-slider" heading="Range slider">
|
|
77
|
+
<zui-slider range></zui-slider>
|
|
78
|
+
</section>
|
|
79
|
+
|
|
80
|
+
<section component="zui-slider" heading="Range slider with initial values (value-start=20, value-end=80)">
|
|
81
|
+
<zui-slider range value-start="20" value-end="80"></zui-slider>
|
|
82
|
+
</section>
|
|
83
|
+
|
|
84
|
+
<section component="zui-slider" heading="Range slider with step and min/max labels">
|
|
85
|
+
<zui-slider range step="10" show-min-max></zui-slider>
|
|
86
|
+
</section>
|
|
87
|
+
|
|
88
|
+
<section component="zui-slider" heading="Range slider with custom bounds (min=0, max=500, step=50)">
|
|
89
|
+
<zui-slider range min="0" max="500" step="50" value-start="100" value-end="400" show-min-max></zui-slider>
|
|
90
|
+
</section>
|
|
91
|
+
|
|
92
|
+
<section component="zui-slider" heading="Range slider with decimal step (step=0.5)">
|
|
93
|
+
<zui-slider range step="0.5" value-start="1.5" value-end="3.5" min="0" max="5" show-min-max></zui-slider>
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
<section component="zui-slider" heading="Disabled range slider">
|
|
97
|
+
<zui-slider range disabled value-start="20" value-end="70"></zui-slider>
|
|
98
|
+
</section>
|
|
99
|
+
|
|
100
|
+
<section component="zui-slider" heading="Read-only range slider">
|
|
101
|
+
<zui-slider range readonly value-start="30" value-end="60"></zui-slider>
|
|
102
|
+
</section>
|
|
103
|
+
|
|
104
|
+
<section component="zui-slider" heading="Change event (range mode)">
|
|
105
|
+
<zui-slider range id="zuiSliderDemoRangeChange" value-start="25" value-end="75"></zui-slider>
|
|
106
|
+
<p>Last change: <strong id="zuiSliderDemoRangeChangeOutput">—</strong></p>
|
|
107
|
+
|
|
108
|
+
<script>
|
|
109
|
+
document.getElementById("zuiSliderDemoRangeChange").addEventListener("change", (e) => {
|
|
110
|
+
const { valueStart, valueEnd } = e.detail;
|
|
111
|
+
document.getElementById("zuiSliderDemoRangeChangeOutput").textContent =
|
|
112
|
+
`valueStart=${valueStart}, valueEnd=${valueEnd}`;
|
|
113
|
+
});
|
|
114
|
+
</script>
|
|
115
|
+
</section>
|
|
116
|
+
|
|
117
|
+
<section component="zui-slider" heading="Programmatically set range values">
|
|
118
|
+
<zui-slider range id="zuiSliderDemoRangeProgrammatic" value-start="20" value-end="80"></zui-slider>
|
|
119
|
+
<zui-button id="zuiSliderDemoRangeButton">Randomise</zui-button>
|
|
120
|
+
|
|
121
|
+
<script>
|
|
122
|
+
document.getElementById("zuiSliderDemoRangeButton").addEventListener("click", () => {
|
|
123
|
+
const el = document.getElementById("zuiSliderDemoRangeProgrammatic");
|
|
124
|
+
const a = Math.floor(Math.random() * 50);
|
|
125
|
+
const b = Math.floor(Math.random() * 50) + 50;
|
|
126
|
+
el.valueStart = String(a);
|
|
127
|
+
el.valueEnd = String(b);
|
|
128
|
+
});
|
|
129
|
+
</script>
|
|
130
|
+
</section>
|
|
131
|
+
|
|
132
|
+
<!-- ─── Form integration ─────────────────────────────────────────────── -->
|
|
133
|
+
|
|
134
|
+
<section component="zui-slider" heading="Form integration (single mode)">
|
|
135
|
+
<form id="zuiSliderDemoForm">
|
|
136
|
+
<zui-slider name="rating" value="50" show-min-max></zui-slider>
|
|
137
|
+
<br />
|
|
138
|
+
<zui-button><button type="submit">Submit</button></zui-button>
|
|
139
|
+
<zui-button><button type="reset">Reset</button></zui-button>
|
|
140
|
+
</form>
|
|
141
|
+
<p>Submitted value: <strong id="zuiSliderDemoFormOutput">—</strong></p>
|
|
142
|
+
|
|
143
|
+
<script>
|
|
144
|
+
document.getElementById("zuiSliderDemoForm").addEventListener("submit", (e) => {
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
const data = new FormData(e.target);
|
|
147
|
+
document.getElementById("zuiSliderDemoFormOutput").textContent = data.get("rating");
|
|
148
|
+
});
|
|
149
|
+
</script>
|
|
150
|
+
</section>
|
|
151
|
+
|
|
152
|
+
<section component="zui-slider" heading="Form integration (range mode)">
|
|
153
|
+
<form id="zuiSliderDemoRangeForm">
|
|
154
|
+
<zui-slider range name="priceRange" value-start="20" value-end="80" show-min-max></zui-slider>
|
|
155
|
+
<br />
|
|
156
|
+
<zui-button><button type="submit">Submit</button></zui-button>
|
|
157
|
+
<zui-button><button type="reset">Reset</button></zui-button>
|
|
158
|
+
</form>
|
|
159
|
+
<p>Submitted value: <strong id="zuiSliderDemoRangeFormOutput">—</strong></p>
|
|
160
|
+
|
|
161
|
+
<script>
|
|
162
|
+
document.getElementById("zuiSliderDemoRangeForm").addEventListener("submit", (e) => {
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
const data = new FormData(e.target);
|
|
165
|
+
document.getElementById("zuiSliderDemoRangeFormOutput").textContent = data.get("priceRange");
|
|
166
|
+
});
|
|
167
|
+
</script>
|
|
168
|
+
</section>
|
package/lab.html
CHANGED
|
@@ -52,10 +52,44 @@
|
|
|
52
52
|
<h3>zui slider no text</h3>
|
|
53
53
|
<zui-slider id="text" no-text></zui-slider>
|
|
54
54
|
|
|
55
|
+
<h3>zui slider show min/max</h3>
|
|
56
|
+
<zui-slider id="show-min-max" show-min-max></zui-slider>
|
|
57
|
+
|
|
58
|
+
<h3>zui slider stepped + show min/max</h3>
|
|
59
|
+
<zui-slider id="stepped-min-max" step="10" show-min-max></zui-slider>
|
|
60
|
+
|
|
55
61
|
<h3>set zui slider programmatically</h3>
|
|
56
62
|
<button id="clickme">Click me</button>
|
|
57
63
|
<zui-slider id="programmatic"></zui-slider>
|
|
58
64
|
|
|
65
|
+
<h3>range slider (basic)</h3>
|
|
66
|
+
<zui-slider id="range-basic" range></zui-slider>
|
|
67
|
+
|
|
68
|
+
<h3>range slider with initial values</h3>
|
|
69
|
+
<zui-slider id="range-values" range value-start="20" value-end="80"></zui-slider>
|
|
70
|
+
|
|
71
|
+
<h3>range slider with min and max</h3>
|
|
72
|
+
<zui-slider id="range-min-max" range min="25" max="75" value-start="30" value-end="60"></zui-slider>
|
|
73
|
+
|
|
74
|
+
<h3>range slider stepped</h3>
|
|
75
|
+
<zui-slider id="range-stepped" range step="10" value-start="20" value-end="60"></zui-slider>
|
|
76
|
+
|
|
77
|
+
<h3>range slider no text</h3>
|
|
78
|
+
<zui-slider id="range-no-text" range no-text></zui-slider>
|
|
79
|
+
|
|
80
|
+
<h3>range slider disabled</h3>
|
|
81
|
+
<zui-slider id="range-disabled" range disabled value-start="30" value-end="70"></zui-slider>
|
|
82
|
+
|
|
83
|
+
<h3>range slider show min/max</h3>
|
|
84
|
+
<zui-slider id="range-show-min-max" range show-min-max></zui-slider>
|
|
85
|
+
|
|
86
|
+
<h3>range slider stepped + show min/max</h3>
|
|
87
|
+
<zui-slider id="range-stepped-min-max" range step="10" value-start="20" value-end="60" show-min-max></zui-slider>
|
|
88
|
+
|
|
89
|
+
<h3>set range slider programmatically</h3>
|
|
90
|
+
<button id="clickme-range">Reset range</button>
|
|
91
|
+
<zui-slider id="range-programmatic" range value-start="10" value-end="90"></zui-slider>
|
|
92
|
+
|
|
59
93
|
<script>
|
|
60
94
|
// zui-base-styles needs this for dumb IE11 if you add rel="zui-stylesheet"
|
|
61
95
|
// window.zui.importCustomStyles();
|
|
@@ -64,13 +98,23 @@
|
|
|
64
98
|
// customElements.define = function () { };
|
|
65
99
|
|
|
66
100
|
document.querySelectorAll('zui-slider').forEach(el => el.addEventListener('change', (e) => {
|
|
67
|
-
|
|
101
|
+
if (e.target.range) {
|
|
102
|
+
console.log(`id: ${e.target.id}, valueStart: ${e.detail.valueStart}, valueEnd: ${e.detail.valueEnd}`);
|
|
103
|
+
} else {
|
|
104
|
+
console.log(`id: ${e.target.id}, value: ${e.target.value}`);
|
|
105
|
+
}
|
|
68
106
|
}));
|
|
69
107
|
|
|
70
108
|
document.getElementById("clickme").addEventListener("click", (e) => {
|
|
71
109
|
document.getElementById("programmatic").value = "20";
|
|
72
110
|
});
|
|
73
111
|
|
|
112
|
+
document.getElementById("clickme-range").addEventListener("click", () => {
|
|
113
|
+
const el = document.getElementById("range-programmatic");
|
|
114
|
+
el.valueStart = "10";
|
|
115
|
+
el.valueEnd = "90";
|
|
116
|
+
});
|
|
117
|
+
|
|
74
118
|
</script>
|
|
75
119
|
</body>
|
|
76
120
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zywave/zui-slider",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-pre.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -24,5 +24,8 @@
|
|
|
24
24
|
"@zywave/zui-base": "^4.6.1"
|
|
25
25
|
},
|
|
26
26
|
"customElements": "dist/custom-elements.json",
|
|
27
|
-
"
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@zywave/zui-input": "^4.2.3"
|
|
29
|
+
},
|
|
30
|
+
"gitHead": "bfb39a7f1add66395af991389c24b1774bf8b97c"
|
|
28
31
|
}
|
|
@@ -2,6 +2,80 @@
|
|
|
2
2
|
|
|
3
3
|
zui-slider {
|
|
4
4
|
@include undefined-element {
|
|
5
|
-
|
|
5
|
+
--zui-slider-thumb-size: #{rem(14)};
|
|
6
|
+
|
|
7
|
+
position: relative;
|
|
8
|
+
display: block;
|
|
9
|
+
padding: calc(var(--zui-slider-thumb-size) / 2) 0;
|
|
10
|
+
|
|
11
|
+
// Track — filled to default 50% (CSS cannot read the value attribute for positioning)
|
|
12
|
+
&::before {
|
|
13
|
+
display: block;
|
|
14
|
+
content: '';
|
|
15
|
+
height: rem(4);
|
|
16
|
+
background: linear-gradient(to right,
|
|
17
|
+
transparent var(--zui-slider-thumb-size),
|
|
18
|
+
var(--zui-blue) var(--zui-slider-thumb-size),
|
|
19
|
+
var(--zui-blue) 50%,
|
|
20
|
+
var(--zui-gray-200) 50%,
|
|
21
|
+
var(--zui-gray-200) calc(100% - var(--zui-slider-thumb-size)),
|
|
22
|
+
transparent calc(100% - var(--zui-slider-thumb-size)));
|
|
23
|
+
border-radius: rem(3);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Thumb at default 50% position
|
|
27
|
+
&::after {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 50%;
|
|
30
|
+
left: 50%;
|
|
31
|
+
content: '';
|
|
32
|
+
width: var(--zui-slider-thumb-size);
|
|
33
|
+
height: var(--zui-slider-thumb-size);
|
|
34
|
+
background-color: var(--zui-blue);
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
transform: translate(-50%, -50%);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
zui-slider[range] {
|
|
43
|
+
@include undefined-element {
|
|
44
|
+
// Track — default range covers full width (valueStart=0, valueEnd=100), with transparent insets
|
|
45
|
+
&::before {
|
|
46
|
+
background: linear-gradient(to right,
|
|
47
|
+
transparent var(--zui-slider-thumb-size),
|
|
48
|
+
var(--zui-blue) var(--zui-slider-thumb-size),
|
|
49
|
+
var(--zui-blue) calc(100% - var(--zui-slider-thumb-size)),
|
|
50
|
+
transparent calc(100% - var(--zui-slider-thumb-size)));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Range has two thumbs at 0% and 100%; suppress the single thumb pseudo-element
|
|
54
|
+
&::after {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
zui-slider[disabled] {
|
|
61
|
+
@include undefined-element {
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
|
|
64
|
+
&::before {
|
|
65
|
+
background: var(--zui-gray-200);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&::after {
|
|
69
|
+
background-color: var(--zui-gray);
|
|
70
|
+
cursor: not-allowed;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
zui-slider[range][disabled] {
|
|
76
|
+
@include undefined-element {
|
|
77
|
+
&::before {
|
|
78
|
+
background: var(--zui-gray-200);
|
|
79
|
+
}
|
|
6
80
|
}
|
|
7
81
|
}
|
package/src/zui-slider-css.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
|
|
3
|
-
export const style = css`:host{--zui-slider-thumb-size:
|
|
3
|
+
export const style = css`:host .thumb-input input[type=number]{display:inline-block;width:100%;min-height:2.625rem;vertical-align:middle;padding:0 .625rem;background-color:#fff;border:.0625rem solid var(--zui-gray-200);border-radius:.25rem;font:inherit;color:inherit;transition:border 100ms ease-in-out,box-shadow 100ms ease-in-out;box-sizing:border-box;appearance:textfield}:host .thumb-input input[type=number]::-webkit-input-placeholder{color:var(--zui-gray-200)}:host .thumb-input input[type=number]::-moz-placeholder{opacity:1;color:var(--zui-gray-200)}:host .thumb-input input[type=number]:-moz-placeholder{opacity:1;color:var(--zui-gray-200)}:host .thumb-input input[type=number]:-ms-input-placeholder{color:var(--zui-gray-200)}:host .thumb-input input[type=number]:not(output):-moz-ui-invalid{box-shadow:none}:host .thumb-input input[type=number]:hover{border-color:var(--zui-gray-400)}:host .thumb-input input[type=number]:focus{border-color:var(--zui-blue-400);box-shadow:0 0 0 .0625rem var(--zui-blue-400);outline:none}:host .thumb-input input[disabled][type=number]{background-color:var(--zui-gray-100);cursor:not-allowed;color:var(--zui-gray-300)}:host .thumb-input input[disabled][type=number]:hover{border:.0625rem solid var(--zui-gray-200)}:host .thumb-input input[readonly][type=number]{outline:none}:host{--zui-slider-thumb-size: 0.875rem;--zui-slider-input-width: 8ch;position:relative;display:block;padding:calc(var(--zui-slider-thumb-size)/2) 0}:host .single-wrapper{position:relative;display:flex;height:var(--zui-slider-thumb-size);align-items:center;margin:0 calc(var(--zui-slider-thumb-size)*-1)}:host input[type=range]{width:100%;height:.25rem;margin:0;background:var(--zui-gray-200);border-radius:.1875rem;outline:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host input[type=range]::-webkit-slider-thumb{width:calc(var(--zui-slider-thumb-size)*3);height:calc(var(--zui-slider-thumb-size)*3);background:radial-gradient(circle, var(--zui-blue) calc(var(--zui-slider-thumb-size) / 2 - 0.0625rem), transparent calc(var(--zui-slider-thumb-size) / 2));border-radius:50%;box-shadow:none;transition:background 100ms ease-out,box-shadow 100ms ease-out;-webkit-appearance:none;appearance:none}:host input[type=range]::-webkit-slider-thumb:hover{box-shadow:inset 0 0 0 var(--zui-slider-thumb-size) rgba(120,120,140,.16)}:host input[type=range]::-moz-range-thumb{width:calc(var(--zui-slider-thumb-size)*3);height:calc(var(--zui-slider-thumb-size)*3);background:radial-gradient(circle, var(--zui-blue) calc(var(--zui-slider-thumb-size) / 2 - 0.0625rem), transparent calc(var(--zui-slider-thumb-size) / 2));border:0;border-radius:50%;box-shadow:none;transition:background 100ms ease-out,box-shadow 100ms ease-out}:host input[type=range]::-moz-range-thumb:hover{box-shadow:inset 0 0 0 var(--zui-slider-thumb-size) rgba(120,120,140,.16)}:host input[type=range]:hover::-webkit-slider-thumb{background:radial-gradient(circle, var(--zui-blue-400) calc(var(--zui-slider-thumb-size) / 2 - 0.0625rem), transparent calc(var(--zui-slider-thumb-size) / 2))}:host input[type=range]:hover::-moz-range-thumb{background:radial-gradient(circle, var(--zui-blue-400) calc(var(--zui-slider-thumb-size) / 2 - 0.0625rem), transparent calc(var(--zui-slider-thumb-size) / 2))}:host input[type=range]:focus::-webkit-slider-thumb{box-shadow:inset 0 0 0 var(--zui-slider-thumb-size) rgba(120,120,140,.16)}:host input[type=range]:focus::-moz-range-thumb{box-shadow:inset 0 0 0 var(--zui-slider-thumb-size) rgba(120,120,140,.16)}:host input[type=range]:active::-webkit-slider-thumb{background:radial-gradient(circle, var(--zui-blue-600) calc(var(--zui-slider-thumb-size) / 2 - 0.0625rem), transparent calc(var(--zui-slider-thumb-size) / 2));box-shadow:inset 0 0 0 var(--zui-slider-thumb-size) rgba(120,120,140,.16)}:host input[type=range]:active::-moz-range-thumb{background:radial-gradient(circle, var(--zui-blue-600) calc(var(--zui-slider-thumb-size) / 2 - 0.0625rem), transparent calc(var(--zui-slider-thumb-size) / 2));box-shadow:inset 0 0 0 var(--zui-slider-thumb-size) rgba(120,120,140,.16)}:host input[type=range]:disabled{cursor:not-allowed}:host input[type=range]:disabled::-webkit-slider-thumb{background:radial-gradient(circle, var(--zui-gray) calc(var(--zui-slider-thumb-size) / 2 - 0.0625rem), transparent calc(var(--zui-slider-thumb-size) / 2))}:host input[type=range]:disabled::-webkit-slider-thumb:hover{box-shadow:none}:host input[type=range]:disabled::-moz-range-thumb{background:radial-gradient(circle, var(--zui-gray) calc(var(--zui-slider-thumb-size) / 2 - 0.0625rem), transparent calc(var(--zui-slider-thumb-size) / 2))}:host input[type=range]:disabled::-moz-range-thumb:hover{box-shadow:none}:host .thumb-input{position:absolute;bottom:calc(var(--zui-slider-thumb-size)*2 + 0.25rem);opacity:0;z-index:10;transform:translateX(-50%);transition:opacity 100ms ease-out;pointer-events:none}:host .thumb-input--visible,:host .thumb-input:focus-within{opacity:1;pointer-events:all}:host .thumb-input input[type=number]{width:var(--zui-slider-input-width);text-align:center}:host .thumb-input input[type=number]::-webkit-inner-spin-button,:host .thumb-input input[type=number]::-webkit-outer-spin-button{appearance:none}:host .step-dots{position:absolute;top:50%;left:0;width:100%;height:0;pointer-events:none}:host .step-dots .step-dot{position:absolute;width:.375rem;height:.375rem;background-color:var(--zui-blue);border-radius:50%;transform:translate(-50%, -50%)}:host .step-dots .step-dot:first-child,:host .step-dots .step-dot:last-child{width:.125rem;height:1rem;border-radius:.125rem}:host .range-wrapper{position:relative;display:flex;height:.25rem;align-items:center;overflow:visible;margin:.3125rem calc(var(--zui-slider-thumb-size)*-1)}:host .range-wrapper input[type=range]{position:absolute;width:100%;height:var(--zui-slider-thumb-size);background:rgba(0,0,0,0);transform:translateY(-50%);pointer-events:none}@supports(-moz-appearance: none){:host .range-wrapper input[type=range]{top:50%;left:0}}:host .range-wrapper input[type=range]::-webkit-slider-runnable-track{height:.25rem;background:rgba(0,0,0,0)}:host .range-wrapper input[type=range]::-webkit-slider-thumb{margin-top:.125rem;cursor:pointer;pointer-events:all}:host .range-wrapper input[type=range]::-moz-range-track{height:.25rem;background:rgba(0,0,0,0)}:host .range-wrapper input[type=range]::-moz-range-progress{background:rgba(0,0,0,0)}:host .range-wrapper input[type=range]::-moz-range-thumb{cursor:pointer;pointer-events:all}:host .range-wrapper input[type=range]:disabled::-webkit-slider-thumb{cursor:not-allowed;pointer-events:all}:host .range-wrapper input[type=range]:disabled::-moz-range-thumb{cursor:not-allowed;pointer-events:all}:host .range-wrapper .thumb-input{bottom:calc(var(--zui-slider-thumb-size)*2 - 0.0625rem)}:host .min-max-labels{display:flex;justify-content:space-between}:host .min-max-labels .min-max-label{font-weight:600;color:var(--zui-gray-600)}:host([range]) .min-max-labels{margin-top:.3125rem}:host([disabled]){cursor:not-allowed}:host([disabled]) .range-wrapper{cursor:not-allowed}:host([disabled]) .step-dot{background-color:var(--zui-gray)}`;
|