import { CSSResultGroup, LitElement, PropertyValues, TemplateResult } from 'lit'; import { ElementLogger } from '../../base/logger'; export declare const SLIDER_ELEMENT_TAG_NAME = "vds-slider"; /** * The direction to move the thumb, associated with key symbols. */ export declare enum SliderKeyDirection { Left = -1, ArrowLeft = -1, Up = -1, ArrowUp = -1, Right = 1, ArrowRight = 1, Down = 1, ArrowDown = 1 } declare const SliderElement_base: typeof LitElement; /** * A custom built `input[type="range"]` that is cross-browser friendly, ARIA friendly, mouse/touch * friendly and easily styleable. This component allows users to input numeric values between a * minimum and maxmimum value. Generally used in the player for volume or scrubber controls. * * @see https://github.com/carbon-design-system/carbon-web-components * @tagname vds-slider * @slot Used to pass in additional content inside the slider. * @slot thumb-container - Used to pass content into the thumb container. * @slot thumb - Used to pass content inside the thumb. * @slot track - Used to pass content inside the track. * @slot track-fill - Used to pass content inside the track fill. * @csspart root - The component's root element, in this case the slider container (`
`). * @csspart thumb-container - The container for the slider's handle. * @csspart thumb - The slider's handle the user drags left/right (`
`). * @csspart track - The path in which the thumb slides along (`
`). * @csspart track-fill - The part of the track that is currently filled which fills left-to-right (`
`). * @cssprop --vds-slider-fill-rate - The ratio of the slider that is filled such as `0.3`. * @cssprop --vds-slider-fill-value - The current amount the slider is filled such as `30`. * @cssprop --vds-slider-fill-percentage - The fill rate expressed as a precetange such as `30%`. * @cssprop --vds-slider-thumb-width - The slider handle width. * @cssprop --vds-slider-thumb-height - The slider handle height. * @cssprop --vds-slider-thumb-bg - The background color of the slider handle. * @cssprop --vds-slider-thumb-border-radius - The border radius of the slider handle. * @cssprop --vds-slider-thumb-scale - The base scale of thumb when it is inactive, it'll scale to 1 when active. * @cssprop --vds-slider-thumb-transition - The CSS transitions to use for the thumb, defaults to `transform 100ms ease-out 0s`. * @cssprop --vds-slider-track-height - The height of the slider track. * @cssprop --vds-slider-track-bg - The background color of the slider track. * @cssprop --vds-slider-track-fill-bg - The background color of the slider track fill. * @cssprop --vds-slider-active-color - The slider thumb and track fill background color when focused, active or being dragged. * @cssprop --vds-slider-disabled-color - The slider thumb, track, and track fill background color when disabled. * @example * ```html * * ``` * @example * ```css * vds-slider { * --vds-slider-active-color: #ff2a5d; * } * * vds-slider::part(thumb) { * box-shadow: transparent 0px 0px 0px 1px inset; * } * * vds-slider::part(track), * vds-slider::part(track-fill) { * border-radius: 3px; * } * ``` */ export declare class SliderElement extends SliderElement_base { static get styles(): CSSResultGroup; static get parts(): string[]; protected readonly _logger: ElementLogger; /** * ♿ **ARIA:** The `aria-label` property of the slider. */ label: string | undefined; /** * The lowest slider value in the range of permitted values. */ min: number; /** * The greatest slider value in the range of permitted values. */ max: number; /** * Whether the slider should be hidden. */ hidden: boolean; /** * Whether the slider should be disabled (not-interactable). */ disabled: boolean; /** * The current slider value. */ value: number; /** * ♿ **ARIA:** Alternative value for minimum value (defaults to `min`). This can * be used when expressing slider as a percentage (0-100), and wishing to detail more * information for better accessibility. */ valueMin: string | undefined; /** * ♿ **ARIA:** Alternative value for current value (defaults to `value`). This can * be used when expressing slider as a percentage (0-100), and wishing to detail more * information for better accessibility. */ valueNow: string | undefined; /** * ♿ **ARIA:** Alternative value for maximum value (defaults to `max`). This can * be used when expressing slider as a percentage (0-100), and wishing to detail more * information for better accessibility. */ valueMax: string | undefined; /** * ♿ **ARIA:** Human-readable text alternative for the current value. Defaults to * `value:max` ratio as a percentage. */ valueText: string | undefined; /** * ♿ **ARIA:** Indicates the orientation of the slider. */ orientation: 'horizontal' | 'vertical'; /** * A number that specifies the granularity that the slider value must adhere to. */ step: number; /** * ♿ **ARIA:** A number that specifies the number of steps taken when interacting with * the slider via keyboard. */ keyboardStep: number; /** * ♿ **ARIA:** A number that will be used to multiply the `keyboardStep` when the `Shift` key * is held down and the slider value is changed by pressing `LeftArrow` or `RightArrow`. Think * of it as `keyboardStep * shiftKeyMultiplier`. */ shiftKeyMultiplier: number; protected _isDragging: boolean; /** * Whether the slider thumb is currently being dragged. * * @default false */ get isDragging(): boolean; /** * The current value to range ratio. * * @default 0.5 * @example * `min` = 0 * `max` = 10 * `value` = 5 * `range` = 10 (max - min) * `fillRate` = 0.5 (result) */ get fillRate(): number; /** * The fill rate expressed as a percentage (`fillRate * 100`). * * @default 50 */ get fillPercent(): number; protected update(changedProperties: PropertyValues): void; disconnectedCallback(): void; protected readonly _rootRef: import("lit-html/directives/ref").Ref; /** * The component's root element. */ get rootElement(): HTMLDivElement | undefined; protected render(): TemplateResult; protected _renderSlider(): TemplateResult; protected _renderSliderChildren(): TemplateResult; protected _renderDefaultSlot(): TemplateResult; protected _handleSliderPointerMove(event: PointerEvent): void; protected readonly _thumbContainerRef: import("lit-html/directives/ref").Ref; /** * The thumb container element. */ get thumbContainerElement(): HTMLDivElement | undefined; protected _renderThumbContainer(): TemplateResult; protected _getValueMin(): string; protected _getValueNow(): string; protected _getValueMax(): string; protected _getValueText(): string; protected _getValueTextFallback(): string; protected _renderThumbContainerSlot(): TemplateResult; protected _handleThumbContainerKeydown(event: KeyboardEvent): void; protected _handleThumbContainerPointerDown(event: PointerEvent): void; protected readonly _thumbRef: import("lit-html/directives/ref").Ref; /** * The thumb element. */ get thumbElement(): HTMLDivElement | undefined; protected _renderThumb(): TemplateResult; protected _renderThumbSlot(): TemplateResult; protected readonly _trackRef: import("lit-html/directives/ref").Ref; /** * The track element. */ get trackElement(): HTMLDivElement | undefined; protected _renderTrack(): TemplateResult; protected _renderTrackSlot(): TemplateResult; protected readonly _trackFillRef: import("lit-html/directives/ref").Ref; /** * The track fill element. */ get trackFillElement(): HTMLDivElement | undefined; protected _renderTrackFill(): TemplateResult; protected _renderTrackFillSlot(): TemplateResult; /** * Why? Used to emit native `input` events. */ protected _renderInput(): TemplateResult; protected _startDragging(event: PointerEvent): void; protected _stopDragging(event: PointerEvent): void; protected _handleDocumentPointerUp(event: PointerEvent): void; protected _handleDocumentPointerMove(event: PointerEvent): void; protected readonly _handlePointerMove: import("../../utils/timing").RafThrottledFunction<(event: PointerEvent) => void>; protected _updateValue(value: number): void; protected _updateValueByRate(rate: number): void; protected _updateValueBasedOnThumbPosition(event: PointerEvent): void; protected _lastDispatchedValue: number; protected readonly _dispatchValueChange: import("../../utils/timing").RafThrottledFunction<(event: Event) => void>; } export {};