import * as _angular_core from '@angular/core'; import { Signal, WritableSignal, ElementRef } from '@angular/core'; import * as ng_primitives_state from 'ng-primitives/state'; import { SetterOptions } from 'ng-primitives/state'; import { FocusOrigin } from '@angular/cdk/a11y'; import * as ng_primitives_slider from 'ng-primitives/slider'; import { NumberInput, BooleanInput } from '@angular/cdk/coercion'; import { NgpOrientation } from 'ng-primitives/common'; import { Observable } from 'rxjs'; /** * Apply the `ngpSliderRange` directive to an element that represents the range of the slider. */ declare class NgpSliderRange { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the Slider Range primitive. */ interface NgpSliderRangeState { } /** * Inputs for configuring the Slider Range primitive. */ interface NgpSliderRangeProps { } declare const ngpSliderRange: ({}: NgpSliderRangeProps) => NgpSliderRangeState; declare const injectSliderRangeState: { (): _angular_core.Signal; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal | _angular_core.Signal; }; declare const provideSliderRangeState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpSliderThumb` directive to an element that represents the thumb of the slider. */ declare class NgpSliderThumb { /** * Emits when the thumb drag starts. */ readonly dragStart: _angular_core.OutputEmitterRef; /** * Emits when the thumb drag ends. */ readonly dragEnd: _angular_core.OutputEmitterRef; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the Slider Thumb primitive. */ interface NgpSliderThumbState { /** * Whether the thumb is currently dragging. */ readonly dragging: Signal; /** * Focus the thumb element. */ focus(origin?: FocusOrigin): void; } /** * Inputs for configuring the Slider Thumb primitive. */ interface NgpSliderThumbProps { /** * Callback fired when dragging starts. */ readonly onDragStart?: () => void; /** * Callback fired when dragging ends. */ readonly onDragEnd?: () => void; } declare const ngpSliderThumb: ({ onDragStart, onDragEnd }: NgpSliderThumbProps) => NgpSliderThumbState; declare const injectSliderThumbState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideSliderThumbState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpSliderTrack` directive to an element that represents the track of the slider. */ declare class NgpSliderTrack { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the Slider Track primitive. */ interface NgpSliderTrackState { } /** * Inputs for configuring the Slider Track primitive. */ interface NgpSliderTrackProps { } declare const ngpSliderTrack: ({}: NgpSliderTrackProps) => NgpSliderTrackState; declare const injectSliderTrackState: { (): _angular_core.Signal; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal | _angular_core.Signal; }; declare const provideSliderTrackState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpSlider` directive to an element that represents the slider and contains the track, range, and thumb. */ declare class NgpSlider { /** * The id of the slider. If not provided, a unique id will be generated. */ readonly id: _angular_core.InputSignal; /** * The value of the slider. */ readonly value: _angular_core.InputSignalWithTransform; /** * The default value of the slider for uncontrolled usage. * @default 0 */ readonly defaultValue: _angular_core.InputSignalWithTransform; /** * Emits when the value changes. */ readonly valueChange: _angular_core.OutputEmitterRef; /** * The minimum value of the slider. */ readonly min: _angular_core.InputSignalWithTransform; /** * The maximum value of the slider. */ readonly max: _angular_core.InputSignalWithTransform; /** * The step value of the slider. */ readonly step: _angular_core.InputSignalWithTransform; /** * The orientation of the slider. */ readonly orientation: _angular_core.InputSignal; /** * The disabled state of the slider. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * The state of the slider. We use this for the slider state rather than relying on the inputs. * @internal */ protected readonly state: ng_primitives_slider.NgpSliderState; /** * Set the value of the slider. */ setValue(value: number, options?: SetterOptions): void; /** * Set the disabled state. */ setDisabled(disabled: boolean): void; /** * Set the orientation. */ setOrientation(orientation: NgpOrientation): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the Slider primitive. */ interface NgpSliderState { /** * The id of the slider. */ readonly id: Signal; /** * The slider value. */ readonly value: WritableSignal; /** * The slider orientation. */ readonly orientation: WritableSignal; /** * Whether the slider is disabled (includes form control state). */ readonly disabled: WritableSignal; /** * The percentage position of the thumb. */ readonly percentage: Signal; /** * The minimum value of the slider. */ readonly min: Signal; /** * The maximum value of the slider. */ readonly max: Signal; /** * The step value of the slider. */ readonly step: Signal; /** * @internal The track element reference. */ readonly track: Signal | undefined>; /** * @internal The thumb element reference. */ readonly thumb: Signal | undefined>; /** * Emit when the value changes. */ readonly valueChange: Observable; /** * Set the current value (clamped). */ setValue(value: number, options?: SetterOptions): void; /** * Set the default value used in uncontrolled mode. */ setDefaultValue(value: number): void; /** * Register the track element. */ setTrack(track: ElementRef | undefined): void; /** * Register the thumb element. */ setThumb(thumb: ElementRef | undefined): void; /** * Focus the thumb element. */ focusThumb(origin: FocusOrigin): void; /** * Set the disabled state. */ setDisabled(disabled: boolean): void; /** * Set the orientation. */ setOrientation(orientation: NgpOrientation): void; } /** * Inputs for configuring the Slider primitive. */ interface NgpSliderProps { /** * The id of the slider. */ readonly id?: Signal; /** * The slider value. When defined the slider is controlled. */ readonly value?: Signal; /** * The default value for uncontrolled usage. */ readonly defaultValue?: Signal; /** * The minimum value. */ readonly min?: Signal; /** * The maximum value. */ readonly max?: Signal; /** * The step value. */ readonly step?: Signal; /** * The slider orientation. */ readonly orientation?: Signal; /** * Whether the slider is disabled. */ readonly disabled?: Signal; /** * Callback fired when the value changes. */ readonly onValueChange?: (value: number) => void; } declare const ngpSlider: ({ id, value: _value, defaultValue: _defaultValue, min, max, step, orientation: _orientation, disabled: _disabled, onValueChange, }: NgpSliderProps) => NgpSliderState; declare const injectSliderState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideSliderState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpRangeSliderRange` directive to an element that represents the range between the low and high values. */ declare class NgpRangeSliderRange { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the RangeSliderRange primitive. */ interface NgpRangeSliderRangeState { } /** * Inputs for configuring the RangeSliderRange primitive. */ interface NgpRangeSliderRangeProps { } declare const ngpRangeSliderRange: ({}: NgpRangeSliderRangeProps) => {}; declare const injectRangeSliderRangeState: { (): _angular_core.Signal<{}>; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{} | null>; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{}> | _angular_core.Signal<{} | null>; }; declare const provideRangeSliderRangeState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpRangeSliderThumb` directive to an element that represents a thumb of the range slider. * Each thumb can be configured to control either the 'low' or 'high' value. */ declare class NgpRangeSliderThumb { /** * Emits when the thumb drag starts. */ readonly dragStart: _angular_core.OutputEmitterRef; /** * Emits when the thumb drag ends. */ readonly dragEnd: _angular_core.OutputEmitterRef; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the RangeSliderThumb primitive. */ interface NgpRangeSliderThumbState { /** * Which value this thumb controls ('low' or 'high'). */ readonly thumb: Signal<'low' | 'high'>; /** * The current value for this thumb. */ readonly value: Signal; /** * The current percentage for this thumb. */ readonly percentage: Signal; } /** * Inputs for configuring the RangeSliderThumb primitive. */ interface NgpRangeSliderThumbProps { /** * Callback fired when dragging starts. */ readonly onDragStart?: () => void; /** * Callback fired when dragging ends. */ readonly onDragEnd?: () => void; } declare const ngpRangeSliderThumb: ({ onDragStart, onDragEnd }: NgpRangeSliderThumbProps) => { thumb: Signal<"low" | "high">; value: Signal; percentage: Signal; }; declare const injectRangeSliderThumbState: { (): Signal<{ thumb: Signal<"low" | "high">; value: Signal; percentage: Signal; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ thumb: Signal<"low" | "high">; value: Signal; percentage: Signal; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ thumb: Signal<"low" | "high">; value: Signal; percentage: Signal; }> | Signal<{ thumb: Signal<"low" | "high">; value: Signal; percentage: Signal; } | null>; }; declare const provideRangeSliderThumbState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpRangeSliderTrack` directive to an element that represents the track of the range slider. */ declare class NgpRangeSliderTrack { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the RangeSliderTrack primitive. */ interface NgpRangeSliderTrackState { } /** * Inputs for configuring the RangeSliderTrack primitive. */ interface NgpRangeSliderTrackProps { } declare const ngpRangeSliderTrack: ({}: NgpRangeSliderTrackProps) => {}; declare const injectRangeSliderTrackState: { (): _angular_core.Signal<{}>; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{} | null>; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{}> | _angular_core.Signal<{} | null>; }; declare const provideRangeSliderTrackState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpRangeSlider` directive to an element that represents the range slider and contains the track, range, and thumbs. */ declare class NgpRangeSlider { /** * The id of the range slider. If not provided, a unique id will be generated. */ readonly id: _angular_core.InputSignal; /** * The low value of the range slider. When defined the low thumb is controlled. */ readonly low: _angular_core.InputSignalWithTransform; /** * The default low value for uncontrolled usage. * @default 0 */ readonly defaultLow: _angular_core.InputSignalWithTransform; /** * Emits when the low value changes. */ readonly lowChange: _angular_core.OutputEmitterRef; /** * The high value of the range slider. When defined the high thumb is controlled. */ readonly high: _angular_core.InputSignalWithTransform; /** * The default high value for uncontrolled usage. * @default 100 */ readonly defaultHigh: _angular_core.InputSignalWithTransform; /** * Emits when the high value changes. */ readonly highChange: _angular_core.OutputEmitterRef; /** * The minimum value of the range slider. */ readonly min: _angular_core.InputSignalWithTransform; /** * The maximum value of the range slider. */ readonly max: _angular_core.InputSignalWithTransform; /** * The step value of the range slider. */ readonly step: _angular_core.InputSignalWithTransform; /** * The orientation of the range slider. */ readonly orientation: _angular_core.InputSignal; /** * The disabled state of the range slider. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * The state of the range slider. */ private readonly state; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Inputs for configuring the RangeSlider primitive. */ interface NgpRangeSliderProps { /** * The id of the range slider. */ readonly id?: Signal; /** * The low value of the range slider. When defined the low thumb is controlled. */ readonly low?: Signal; /** * The default low value for uncontrolled usage. */ readonly defaultLow?: Signal; /** * The high value of the range slider. When defined the high thumb is controlled. */ readonly high?: Signal; /** * The default high value for uncontrolled usage. */ readonly defaultHigh?: Signal; /** * The minimum value. */ readonly min?: Signal; /** * The maximum value. */ readonly max?: Signal; /** * The step value. */ readonly step?: Signal; /** * The range slider orientation. */ readonly orientation?: Signal; /** * Whether the range slider is disabled. */ readonly disabled?: Signal; /** * Callback fired when the low value changes. */ readonly onLowChange?: (value: number) => void; /** * Callback fired when the high value changes. */ readonly onHighChange?: (value: number) => void; } /** * Public state surface for the RangeSlider primitive. */ interface NgpRangeSliderState { /** * The id of the range slider. */ readonly id: Signal; /** * The low value of the range slider. */ readonly low: WritableSignal; /** * The high value of the range slider. */ readonly high: WritableSignal; /** * The minimum value of the range slider. */ readonly min: Signal; /** * The maximum value of the range slider. */ readonly max: Signal; /** * The step value of the range slider. */ readonly step: Signal; /** * The orientation of the range slider. */ readonly orientation: WritableSignal; /** * Whether the range slider is disabled. */ readonly disabled: WritableSignal; /** * The low value as a percentage based on the min and max values. * @internal */ readonly lowPercentage: Signal; /** * The high value as a percentage based on the min and max values. * @internal */ readonly highPercentage: Signal; /** * The range between low and high values as a percentage. * @internal */ readonly rangePercentage: Signal; /** * @internal The track element reference. */ readonly track: Signal | undefined>; /** * @internal The thumbs array. */ readonly thumbs: Signal[]>; /** * Emit when the low value changes. */ readonly lowChange: Observable; /** * Emit when the high value changes. */ readonly highChange: Observable; /** * Updates the low value, ensuring it doesn't exceed the high value. */ setLowValue(value: number, options?: SetterOptions): void; /** * Updates the high value, ensuring it doesn't go below the low value. */ setHighValue(value: number, options?: SetterOptions): void; /** * Set the default low value used in uncontrolled mode. */ setDefaultLow(value: number): void; /** * Set the default high value used in uncontrolled mode. */ setDefaultHigh(value: number): void; /** * Determines which thumb should be moved based on the position clicked. */ getClosestThumb(percentage: number): 'low' | 'high'; /** * Updates the thumbs array when a new thumb is added. */ addThumb(thumb: ElementRef): void; /** * Removes a thumb from the thumbs array. */ removeThumb(thumb: ElementRef): void; /** * Focus the specified thumb element. */ focusThumb(thumb: 'low' | 'high', origin: FocusOrigin): void; /** * Set the track element reference. */ setTrack(track: ElementRef): void; /** * Set the disabled state. */ setDisabled(disabled: boolean): void; /** * Set the orientation. */ setOrientation(orientation: NgpOrientation): void; } declare const ngpRangeSlider: ({ id, low: _low, defaultLow: _defaultLow, high: _high, defaultHigh: _defaultHigh, min, max, step, orientation: _orientation, disabled: _disabled, onLowChange, onHighChange, }: NgpRangeSliderProps) => NgpRangeSliderState; declare const injectRangeSliderState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideRangeSliderState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; export { NgpRangeSlider, NgpRangeSliderRange, NgpRangeSliderThumb, NgpRangeSliderTrack, NgpSlider, NgpSliderRange, NgpSliderThumb, NgpSliderTrack, injectRangeSliderRangeState, injectRangeSliderState, injectRangeSliderThumbState, injectRangeSliderTrackState, injectSliderRangeState, injectSliderState, injectSliderThumbState, injectSliderTrackState, ngpRangeSlider, ngpRangeSliderRange, ngpRangeSliderThumb, ngpRangeSliderTrack, ngpSlider, ngpSliderRange, ngpSliderThumb, ngpSliderTrack, provideRangeSliderRangeState, provideRangeSliderState, provideRangeSliderThumbState, provideRangeSliderTrackState, provideSliderRangeState, provideSliderState, provideSliderThumbState, provideSliderTrackState }; export type { NgpRangeSliderProps, NgpRangeSliderRangeProps, NgpRangeSliderRangeState, NgpRangeSliderState, NgpRangeSliderThumbProps, NgpRangeSliderThumbState, NgpRangeSliderTrackProps, NgpRangeSliderTrackState, NgpSliderProps, NgpSliderRangeProps, NgpSliderRangeState, NgpSliderState, NgpSliderThumbProps, NgpSliderThumbState, NgpSliderTrackProps, NgpSliderTrackState };