index.d.ts 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. import { Directionality } from '@angular/cdk/bidi';
  2. import * as i0 from '@angular/core';
  3. import { ChangeDetectorRef, WritableSignal, AfterViewInit, OnDestroy, NgZone, ElementRef, QueryList, EventEmitter } from '@angular/core';
  4. import { T as ThemePalette } from '../palette.d-BSSFKjO6.js';
  5. import { R as RippleGlobalOptions, M as MatRipple } from '../ripple.d-BxTUZJt7.js';
  6. import { ControlValueAccessor } from '@angular/forms';
  7. import { Subject } from 'rxjs';
  8. import { M as MatCommonModule } from '../common-module.d-C8xzHJDr.js';
  9. import { M as MatRippleModule } from '../index.d-DG9eDM2-.js';
  10. import '@angular/cdk/platform';
  11. /**
  12. * Thumb types: range slider has two thumbs (START, END) whereas single point
  13. * slider only has one thumb (END).
  14. */
  15. declare enum _MatThumb {
  16. START = 1,
  17. END = 2
  18. }
  19. /** Tick mark enum, for discrete sliders. */
  20. declare enum _MatTickMark {
  21. ACTIVE = 0,
  22. INACTIVE = 1
  23. }
  24. /** Represents a drag event emitted by the MatSlider component. */
  25. interface MatSliderDragEvent {
  26. /** The MatSliderThumb that was interacted with. */
  27. source: _MatSliderThumb;
  28. /** The MatSlider that was interacted with. */
  29. parent: _MatSlider;
  30. /** The current value of the slider. */
  31. value: number;
  32. }
  33. /**
  34. * A simple change event emitted by the MatSlider component.
  35. * @deprecated Use event bindings directly on the MatSliderThumbs for `change` and `input` events. See https://v17.material.angular.dev/guide/mdc-migration for information about migrating.
  36. * @breaking-change 17.0.0
  37. */
  38. declare class MatSliderChange {
  39. /** The MatSliderThumb that was interacted with. */
  40. source: _MatSliderThumb;
  41. /** The MatSlider that was interacted with. */
  42. parent: _MatSlider;
  43. /** The new value of the source slider. */
  44. value: number;
  45. }
  46. interface _MatSlider {
  47. /** Whether the given pointer event occurred within the bounds of the slider pointer's DOM Rect. */
  48. _isCursorOnSliderThumb(event: PointerEvent, rect: DOMRect): boolean;
  49. /** Gets the slider thumb input of the given thumb position. */
  50. _getInput(thumbPosition: _MatThumb): _MatSliderThumb | _MatSliderRangeThumb | undefined;
  51. /** Gets the slider thumb HTML input element of the given thumb position. */
  52. _getThumb(thumbPosition: _MatThumb): _MatSliderVisualThumb;
  53. /** The minimum value that the slider can have. */
  54. min: number;
  55. /** The maximum value that the slider can have. */
  56. max: number;
  57. /** The amount that slider values can increment or decrement by. */
  58. step: number;
  59. /** Whether the slider is disabled. */
  60. disabled: boolean;
  61. /** Whether the slider is a range slider. */
  62. _isRange: boolean;
  63. /** Whether the slider is rtl. */
  64. _isRtl: boolean;
  65. /** The stored width of the host element's bounding client rect. */
  66. _cachedWidth: number;
  67. /** The stored width of the host element's bounding client rect. */
  68. _cachedLeft: number;
  69. /**
  70. * The padding of the native slider input. This is added in order to make the region where the
  71. * thumb ripple extends past the end of the slider track clickable.
  72. */
  73. _inputPadding: number;
  74. /** The radius of the visual slider's ripple. */
  75. _rippleRadius: number;
  76. /** The global configuration for `matRipple` instances. */
  77. readonly _globalRippleOptions: RippleGlobalOptions | null;
  78. /** Whether animations have been disabled. */
  79. _noopAnimations: boolean;
  80. /** Whether or not the slider should use animations. */
  81. _hasAnimation: boolean;
  82. /** Triggers UI updates that are needed after a slider input value has changed. */
  83. _onValueChange: (source: _MatSliderThumb) => void;
  84. /** Triggers UI updates that are needed after the slider thumb position has changed. */
  85. _onTranslateXChange: (source: _MatSliderThumb) => void;
  86. /** Updates the stored slider dimensions using the current bounding client rect. */
  87. _updateDimensions: () => void;
  88. /** Updates the scale on the active portion of the track. */
  89. _updateTrackUI: (source: _MatSliderThumb) => void;
  90. /** Used to set the transition duration for thumb and track animations. */
  91. _setTransition: (withAnimation: boolean) => void;
  92. _cdr: ChangeDetectorRef;
  93. }
  94. interface _MatSliderThumb {
  95. /** The minimum value that the slider can have. */
  96. min: number;
  97. /** The maximum value that the slider can have. */
  98. max: number;
  99. /** The amount that slider values can increment or decrement by. */
  100. step: number;
  101. /** The current value of this slider input. */
  102. value: number;
  103. /** The current translateX in px of the slider visual thumb. */
  104. translateX: number;
  105. /** Indicates whether this thumb is the start or end thumb. */
  106. thumbPosition: _MatThumb;
  107. /** Similar to percentage but calcualted using translateX relative to the total track width. */
  108. fillPercentage: number;
  109. /** Whether the slider is disabled. */
  110. disabled: boolean;
  111. /** The host native HTML input element. */
  112. _hostElement: HTMLInputElement;
  113. /** Whether the input is currently focused (either by tab or after clicking). */
  114. _isFocused: boolean;
  115. /** The aria-valuetext string representation of the input's value. */
  116. _valuetext: WritableSignal<string>;
  117. /**
  118. * Indicates whether UI updates should be skipped.
  119. *
  120. * This flag is used to avoid flickering
  121. * when correcting values on pointer up/down.
  122. */
  123. _skipUIUpdate: boolean;
  124. /** Handles the initialization of properties for the slider input. */
  125. initProps: () => void;
  126. /** Handles UI initialization controlled by this slider input. */
  127. initUI: () => void;
  128. /** Calculates the visual thumb's translateX based on the slider input's current value. */
  129. _calcTranslateXByValue: () => number;
  130. /** Updates the visual thumb based on the slider input's current value. */
  131. _updateThumbUIByValue: () => void;
  132. /**
  133. * Sets the slider input to disproportionate dimensions to allow for touch
  134. * events to be captured on touch devices.
  135. */
  136. _updateWidthInactive: () => void;
  137. /**
  138. * Used to set the slider width to the correct
  139. * dimensions while the user is dragging.
  140. */
  141. _updateWidthActive: () => void;
  142. }
  143. interface _MatSliderRangeThumb extends _MatSliderThumb {
  144. /** Whether this slider corresponds to the input on the left hand side. */
  145. _isLeftThumb: boolean;
  146. /**
  147. * Gets the sibling MatSliderRangeThumb.
  148. * Returns undefined if it is too early in Angular's life cycle.
  149. */
  150. getSibling: () => _MatSliderRangeThumb | undefined;
  151. /** Used to cache whether this slider input corresponds to the visual left thumb. */
  152. _setIsLeftThumb: () => void;
  153. /** Updates the input styles to control whether it is pinned to the start or end of the mat-slider. */
  154. _updateStaticStyles: () => void;
  155. /** Updates the min and max properties of this slider input according to it's sibling. */
  156. _updateMinMax: () => void;
  157. }
  158. interface _MatSliderVisualThumb {
  159. /** The MatRipple for this slider thumb. */
  160. _ripple: MatRipple;
  161. /** Whether the slider thumb is currently being pressed. */
  162. _isActive: boolean;
  163. /** The host native HTML input element. */
  164. _hostElement: HTMLElement;
  165. /** Shows the value indicator ui. */
  166. _showValueIndicator: () => void;
  167. /** Hides the value indicator ui. */
  168. _hideValueIndicator: () => void;
  169. /** Whether the slider visual thumb is currently showing any ripple. */
  170. _isShowingAnyRipple: () => boolean;
  171. }
  172. /**
  173. * Allows users to select from a range of values by moving the slider thumb. It is similar in
  174. * behavior to the native `<input type="range">` element.
  175. */
  176. declare class MatSlider implements AfterViewInit, OnDestroy, _MatSlider {
  177. readonly _ngZone: NgZone;
  178. readonly _cdr: ChangeDetectorRef;
  179. readonly _elementRef: ElementRef<HTMLElement>;
  180. readonly _dir: Directionality | null;
  181. readonly _globalRippleOptions: RippleGlobalOptions | null;
  182. /** The active portion of the slider track. */
  183. _trackActive: ElementRef<HTMLElement>;
  184. /** The slider thumb(s). */
  185. _thumbs: QueryList<_MatSliderVisualThumb>;
  186. /** The sliders hidden range input(s). */
  187. _input: _MatSliderThumb;
  188. /** The sliders hidden range input(s). */
  189. _inputs: QueryList<_MatSliderRangeThumb>;
  190. /** Whether the slider is disabled. */
  191. get disabled(): boolean;
  192. set disabled(v: boolean);
  193. private _disabled;
  194. /** Whether the slider displays a numeric value label upon pressing the thumb. */
  195. get discrete(): boolean;
  196. set discrete(v: boolean);
  197. private _discrete;
  198. /** Whether the slider displays tick marks along the slider track. */
  199. showTickMarks: boolean;
  200. /** The minimum value that the slider can have. */
  201. get min(): number;
  202. set min(v: number);
  203. private _min;
  204. /**
  205. * Theme color of the slider. This API is supported in M2 themes only, it
  206. * has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/slider/styling.
  207. *
  208. * For information on applying color variants in M3, see
  209. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  210. */
  211. color: ThemePalette;
  212. /** Whether ripples are disabled in the slider. */
  213. disableRipple: boolean;
  214. private _updateMin;
  215. private _updateMinRange;
  216. private _updateMinNonRange;
  217. /** The maximum value that the slider can have. */
  218. get max(): number;
  219. set max(v: number);
  220. private _max;
  221. private _updateMax;
  222. private _updateMaxRange;
  223. private _updateMaxNonRange;
  224. /** The values at which the thumb will snap. */
  225. get step(): number;
  226. set step(v: number);
  227. private _step;
  228. private _updateStep;
  229. private _updateStepRange;
  230. private _updateStepNonRange;
  231. /**
  232. * Function that will be used to format the value before it is displayed
  233. * in the thumb label. Can be used to format very large number in order
  234. * for them to fit into the slider thumb.
  235. */
  236. displayWith: (value: number) => string;
  237. /** Used to keep track of & render the active & inactive tick marks on the slider track. */
  238. _tickMarks: _MatTickMark[];
  239. /** Whether animations have been disabled. */
  240. _noopAnimations: boolean;
  241. /** Subscription to changes to the directionality (LTR / RTL) context for the application. */
  242. private _dirChangeSubscription;
  243. /** Observer used to monitor size changes in the slider. */
  244. private _resizeObserver;
  245. _cachedWidth: number;
  246. _cachedLeft: number;
  247. _rippleRadius: number;
  248. /** @docs-private */
  249. protected startValueIndicatorText: string;
  250. /** @docs-private */
  251. protected endValueIndicatorText: string;
  252. _endThumbTransform: string;
  253. _startThumbTransform: string;
  254. _isRange: boolean;
  255. /** Whether the slider is rtl. */
  256. _isRtl: boolean;
  257. private _hasViewInitialized;
  258. /**
  259. * The width of the tick mark track.
  260. * The tick mark track width is different from full track width
  261. */
  262. _tickMarkTrackWidth: number;
  263. _hasAnimation: boolean;
  264. private _resizeTimer;
  265. private _platform;
  266. constructor(...args: unknown[]);
  267. /** The radius of the native slider's knob. AFAIK there is no way to avoid hardcoding this. */
  268. _knobRadius: number;
  269. _inputPadding: number;
  270. ngAfterViewInit(): void;
  271. private _initUINonRange;
  272. private _initUIRange;
  273. ngOnDestroy(): void;
  274. /** Handles updating the slider ui after a dir change. */
  275. private _onDirChange;
  276. private _onDirChangeRange;
  277. private _onDirChangeNonRange;
  278. /** Starts observing and updating the slider if the host changes its size. */
  279. private _observeHostResize;
  280. /** Whether any of the thumbs are currently active. */
  281. private _isActive;
  282. private _getValue;
  283. private _skipUpdate;
  284. /** Stores the slider dimensions. */
  285. _updateDimensions(): void;
  286. /** Sets the styles for the active portion of the track. */
  287. _setTrackActiveStyles(styles: {
  288. left: string;
  289. right: string;
  290. transform: string;
  291. transformOrigin: string;
  292. }): void;
  293. /** Returns the translateX positioning for a tick mark based on it's index. */
  294. _calcTickMarkTransform(index: number): string;
  295. _onTranslateXChange(source: _MatSliderThumb): void;
  296. _onTranslateXChangeBySideEffect(input1: _MatSliderRangeThumb, input2: _MatSliderRangeThumb): void;
  297. _onValueChange(source: _MatSliderThumb): void;
  298. _onMinMaxOrStepChange(): void;
  299. _onResize(): void;
  300. /** Whether or not the slider thumbs overlap. */
  301. private _thumbsOverlap;
  302. /** Returns true if the slider knobs are overlapping one another. */
  303. private _areThumbsOverlapping;
  304. /**
  305. * Updates the class names of overlapping slider thumbs so
  306. * that the current active thumb is styled to be on "top".
  307. */
  308. private _updateOverlappingThumbClassNames;
  309. /** Updates the UI of slider thumbs when they begin or stop overlapping. */
  310. private _updateOverlappingThumbUI;
  311. /** Updates the translateX of the given thumb. */
  312. _updateThumbUI(source: _MatSliderThumb): void;
  313. /** Updates the value indicator tooltip ui for the given thumb. */
  314. _updateValueIndicatorUI(source: _MatSliderThumb): void;
  315. /** Updates all value indicator UIs in the slider. */
  316. private _updateValueIndicatorUIs;
  317. /** Updates the width of the tick mark track. */
  318. private _updateTickMarkTrackUI;
  319. /** Updates the scale on the active portion of the track. */
  320. _updateTrackUI(source: _MatSliderThumb): void;
  321. private _updateTrackUIRange;
  322. private _updateTrackUINonRange;
  323. /** Updates the dots along the slider track. */
  324. _updateTickMarkUI(): void;
  325. private _updateTickMarkUINonRange;
  326. private _updateTickMarkUIRange;
  327. /** Gets the slider thumb input of the given thumb position. */
  328. _getInput(thumbPosition: _MatThumb): _MatSliderThumb | _MatSliderRangeThumb | undefined;
  329. /** Gets the slider thumb HTML input element of the given thumb position. */
  330. _getThumb(thumbPosition: _MatThumb): _MatSliderVisualThumb;
  331. _setTransition(withAnimation: boolean): void;
  332. /** Whether the given pointer event occurred within the bounds of the slider pointer's DOM Rect. */
  333. _isCursorOnSliderThumb(event: PointerEvent, rect: DOMRect): boolean;
  334. static ɵfac: i0.ɵɵFactoryDeclaration<MatSlider, never>;
  335. static ɵcmp: i0.ɵɵComponentDeclaration<MatSlider, "mat-slider", ["matSlider"], { "disabled": { "alias": "disabled"; "required": false; }; "discrete": { "alias": "discrete"; "required": false; }; "showTickMarks": { "alias": "showTickMarks"; "required": false; }; "min": { "alias": "min"; "required": false; }; "color": { "alias": "color"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "max": { "alias": "max"; "required": false; }; "step": { "alias": "step"; "required": false; }; "displayWith": { "alias": "displayWith"; "required": false; }; }, {}, ["_input", "_inputs"], ["*"], true, never>;
  336. static ngAcceptInputType_disabled: unknown;
  337. static ngAcceptInputType_discrete: unknown;
  338. static ngAcceptInputType_showTickMarks: unknown;
  339. static ngAcceptInputType_min: unknown;
  340. static ngAcceptInputType_disableRipple: unknown;
  341. static ngAcceptInputType_max: unknown;
  342. static ngAcceptInputType_step: unknown;
  343. }
  344. /**
  345. * The visual slider thumb.
  346. *
  347. * Handles the slider thumb ripple states (hover, focus, and active),
  348. * and displaying the value tooltip on discrete sliders.
  349. * @docs-private
  350. */
  351. declare class MatSliderVisualThumb implements _MatSliderVisualThumb, AfterViewInit, OnDestroy {
  352. readonly _cdr: ChangeDetectorRef;
  353. private readonly _ngZone;
  354. private _slider;
  355. private _renderer;
  356. private _listenerCleanups;
  357. /** Whether the slider displays a numeric value label upon pressing the thumb. */
  358. discrete: boolean;
  359. /** Indicates which slider thumb this input corresponds to. */
  360. thumbPosition: _MatThumb;
  361. /** The display value of the slider thumb. */
  362. valueIndicatorText: string;
  363. /** The MatRipple for this slider thumb. */
  364. readonly _ripple: MatRipple;
  365. /** The slider thumb knob. */
  366. _knob: ElementRef<HTMLElement>;
  367. /** The slider thumb value indicator container. */
  368. _valueIndicatorContainer: ElementRef<HTMLElement>;
  369. /** The slider input corresponding to this slider thumb. */
  370. private _sliderInput;
  371. /** The native html element of the slider input corresponding to this thumb. */
  372. private _sliderInputEl;
  373. /** The RippleRef for the slider thumbs hover state. */
  374. private _hoverRippleRef;
  375. /** The RippleRef for the slider thumbs focus state. */
  376. private _focusRippleRef;
  377. /** The RippleRef for the slider thumbs active state. */
  378. private _activeRippleRef;
  379. /** Whether the slider thumb is currently being hovered. */
  380. private _isHovered;
  381. /** Whether the slider thumb is currently being pressed. */
  382. _isActive: boolean;
  383. /** Whether the value indicator tooltip is visible. */
  384. _isValueIndicatorVisible: boolean;
  385. /** The host native HTML input element. */
  386. _hostElement: HTMLElement;
  387. private _platform;
  388. constructor(...args: unknown[]);
  389. ngAfterViewInit(): void;
  390. ngOnDestroy(): void;
  391. private _onPointerMove;
  392. private _onMouseLeave;
  393. private _onFocus;
  394. private _onBlur;
  395. private _onDragStart;
  396. private _onDragEnd;
  397. /** Handles displaying the hover ripple. */
  398. private _showHoverRipple;
  399. /** Handles displaying the focus ripple. */
  400. private _showFocusRipple;
  401. /** Handles displaying the active ripple. */
  402. private _showActiveRipple;
  403. /** Whether the given rippleRef is currently fading in or visible. */
  404. private _isShowingRipple;
  405. /** Manually launches the slider thumb ripple using the specified ripple animation config. */
  406. private _showRipple;
  407. /**
  408. * Fades out the given ripple.
  409. * Also hides the value indicator if no ripple is showing.
  410. */
  411. private _hideRipple;
  412. /** Shows the value indicator ui. */
  413. _showValueIndicator(): void;
  414. /** Hides the value indicator ui. */
  415. _hideValueIndicator(): void;
  416. _getSibling(): _MatSliderVisualThumb;
  417. /** Gets the value indicator container's native HTML element. */
  418. _getValueIndicatorContainer(): HTMLElement | undefined;
  419. /** Gets the native HTML element of the slider thumb knob. */
  420. _getKnob(): HTMLElement;
  421. _isShowingAnyRipple(): boolean;
  422. static ɵfac: i0.ɵɵFactoryDeclaration<MatSliderVisualThumb, never>;
  423. static ɵcmp: i0.ɵɵComponentDeclaration<MatSliderVisualThumb, "mat-slider-visual-thumb", never, { "discrete": { "alias": "discrete"; "required": false; }; "thumbPosition": { "alias": "thumbPosition"; "required": false; }; "valueIndicatorText": { "alias": "valueIndicatorText"; "required": false; }; }, {}, never, never, true, never>;
  424. }
  425. /**
  426. * Directive that adds slider-specific behaviors to an input element inside `<mat-slider>`.
  427. * Up to two may be placed inside of a `<mat-slider>`.
  428. *
  429. * If one is used, the selector `matSliderThumb` must be used, and the outcome will be a normal
  430. * slider. If two are used, the selectors `matSliderStartThumb` and `matSliderEndThumb` must be
  431. * used, and the outcome will be a range slider with two slider thumbs.
  432. */
  433. declare class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueAccessor {
  434. readonly _ngZone: NgZone;
  435. readonly _elementRef: ElementRef<HTMLInputElement>;
  436. readonly _cdr: ChangeDetectorRef;
  437. protected _slider: _MatSlider;
  438. private _platform;
  439. private _listenerCleanups;
  440. get value(): number;
  441. set value(value: number);
  442. /**
  443. * Handles programmatic value setting. This has been split out to
  444. * allow the range thumb to override it and add additional necessary logic.
  445. */
  446. protected _setValue(value: string): void;
  447. /** Event emitted when the `value` is changed. */
  448. readonly valueChange: EventEmitter<number>;
  449. /** Event emitted when the slider thumb starts being dragged. */
  450. readonly dragStart: EventEmitter<MatSliderDragEvent>;
  451. /** Event emitted when the slider thumb stops being dragged. */
  452. readonly dragEnd: EventEmitter<MatSliderDragEvent>;
  453. /**
  454. * The current translateX in px of the slider visual thumb.
  455. * @docs-private
  456. */
  457. get translateX(): number;
  458. set translateX(v: number);
  459. private _translateX;
  460. /**
  461. * Indicates whether this thumb is the start or end thumb.
  462. * @docs-private
  463. */
  464. thumbPosition: _MatThumb;
  465. /** @docs-private */
  466. get min(): number;
  467. set min(v: number);
  468. /** @docs-private */
  469. get max(): number;
  470. set max(v: number);
  471. get step(): number;
  472. set step(v: number);
  473. /** @docs-private */
  474. get disabled(): boolean;
  475. set disabled(v: boolean);
  476. /** The percentage of the slider that coincides with the value. */
  477. get percentage(): number;
  478. /** @docs-private */
  479. get fillPercentage(): number;
  480. /** The host native HTML input element. */
  481. _hostElement: HTMLInputElement;
  482. /** The aria-valuetext string representation of the input's value. */
  483. _valuetext: i0.WritableSignal<string>;
  484. /** The radius of a native html slider's knob. */
  485. _knobRadius: number;
  486. /** The distance in px from the start of the slider track to the first tick mark. */
  487. _tickMarkOffset: number;
  488. /** Whether user's cursor is currently in a mouse down state on the input. */
  489. _isActive: boolean;
  490. /** Whether the input is currently focused (either by tab or after clicking). */
  491. _isFocused: boolean;
  492. /** Used to relay updates to _isFocused to the slider visual thumbs. */
  493. private _setIsFocused;
  494. /**
  495. * Whether the initial value has been set.
  496. * This exists because the initial value cannot be immediately set because the min and max
  497. * must first be relayed from the parent MatSlider component, which can only happen later
  498. * in the component lifecycle.
  499. */
  500. private _hasSetInitialValue;
  501. /** The stored initial value. */
  502. _initialValue: string | undefined;
  503. /** Defined when a user is using a form control to manage slider value & validation. */
  504. private _formControl;
  505. /** Emits when the component is destroyed. */
  506. protected readonly _destroyed: Subject<void>;
  507. /**
  508. * Indicates whether UI updates should be skipped.
  509. *
  510. * This flag is used to avoid flickering
  511. * when correcting values on pointer up/down.
  512. */
  513. _skipUIUpdate: boolean;
  514. /** Callback called when the slider input value changes. */
  515. protected _onChangeFn: ((value: any) => void) | undefined;
  516. /** Callback called when the slider input has been touched. */
  517. private _onTouchedFn;
  518. /**
  519. * Whether the NgModel has been initialized.
  520. *
  521. * This flag is used to ignore ghost null calls to
  522. * writeValue which can break slider initialization.
  523. *
  524. * See https://github.com/angular/angular/issues/14988.
  525. */
  526. protected _isControlInitialized: boolean;
  527. constructor(...args: unknown[]);
  528. ngOnDestroy(): void;
  529. /** @docs-private */
  530. initProps(): void;
  531. /** @docs-private */
  532. initUI(): void;
  533. _initValue(): void;
  534. _getDefaultValue(): number;
  535. _onBlur(): void;
  536. _onFocus(): void;
  537. _onChange(): void;
  538. _onInput(): void;
  539. _onNgControlValueChange(): void;
  540. _onPointerDown(event: PointerEvent): void;
  541. /**
  542. * Corrects the value of the slider on pointer up/down.
  543. *
  544. * Called on pointer down and up because the value is set based
  545. * on the inactive width instead of the active width.
  546. */
  547. private _handleValueCorrection;
  548. /** Corrects the value of the slider based on the pointer event's position. */
  549. _fixValue(event: PointerEvent): void;
  550. _onPointerMove(event: PointerEvent): void;
  551. _onPointerUp(): void;
  552. _clamp(v: number): number;
  553. _calcTranslateXByValue(): number;
  554. _calcTranslateXByPointerEvent(event: PointerEvent): number;
  555. /**
  556. * Used to set the slider width to the correct
  557. * dimensions while the user is dragging.
  558. */
  559. _updateWidthActive(): void;
  560. /**
  561. * Sets the slider input to disproportionate dimensions to allow for touch
  562. * events to be captured on touch devices.
  563. */
  564. _updateWidthInactive(): void;
  565. _updateThumbUIByValue(options?: {
  566. withAnimation: boolean;
  567. }): void;
  568. _updateThumbUIByPointerEvent(event: PointerEvent, options?: {
  569. withAnimation: boolean;
  570. }): void;
  571. _updateThumbUI(options?: {
  572. withAnimation: boolean;
  573. }): void;
  574. /**
  575. * Sets the input's value.
  576. * @param value The new value of the input
  577. * @docs-private
  578. */
  579. writeValue(value: any): void;
  580. /**
  581. * Registers a callback to be invoked when the input's value changes from user input.
  582. * @param fn The callback to register
  583. * @docs-private
  584. */
  585. registerOnChange(fn: any): void;
  586. /**
  587. * Registers a callback to be invoked when the input is blurred by the user.
  588. * @param fn The callback to register
  589. * @docs-private
  590. */
  591. registerOnTouched(fn: any): void;
  592. /**
  593. * Sets the disabled state of the slider.
  594. * @param isDisabled The new disabled state
  595. * @docs-private
  596. */
  597. setDisabledState(isDisabled: boolean): void;
  598. focus(): void;
  599. blur(): void;
  600. static ɵfac: i0.ɵɵFactoryDeclaration<MatSliderThumb, never>;
  601. static ɵdir: i0.ɵɵDirectiveDeclaration<MatSliderThumb, "input[matSliderThumb]", ["matSliderThumb"], { "value": { "alias": "value"; "required": false; }; }, { "valueChange": "valueChange"; "dragStart": "dragStart"; "dragEnd": "dragEnd"; }, never, never, true, never>;
  602. static ngAcceptInputType_value: unknown;
  603. }
  604. declare class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRangeThumb {
  605. readonly _cdr: ChangeDetectorRef;
  606. /** @docs-private */
  607. getSibling(): _MatSliderRangeThumb | undefined;
  608. private _sibling;
  609. /**
  610. * Returns the minimum translateX position allowed for this slider input's visual thumb.
  611. * @docs-private
  612. */
  613. getMinPos(): number;
  614. /**
  615. * Returns the maximum translateX position allowed for this slider input's visual thumb.
  616. * @docs-private
  617. */
  618. getMaxPos(): number;
  619. _setIsLeftThumb(): void;
  620. /** Whether this slider corresponds to the input on the left hand side. */
  621. _isLeftThumb: boolean;
  622. /** Whether this slider corresponds to the input with greater value. */
  623. _isEndThumb: boolean;
  624. constructor(...args: unknown[]);
  625. _getDefaultValue(): number;
  626. _onInput(): void;
  627. _onNgControlValueChange(): void;
  628. _onPointerDown(event: PointerEvent): void;
  629. _onPointerUp(): void;
  630. _onPointerMove(event: PointerEvent): void;
  631. _fixValue(event: PointerEvent): void;
  632. _clamp(v: number): number;
  633. _updateMinMax(): void;
  634. _updateWidthActive(): void;
  635. _updateWidthInactive(): void;
  636. _updateStaticStyles(): void;
  637. private _updateSibling;
  638. /**
  639. * Sets the input's value.
  640. * @param value The new value of the input
  641. * @docs-private
  642. */
  643. writeValue(value: any): void;
  644. _setValue(value: string): void;
  645. static ɵfac: i0.ɵɵFactoryDeclaration<MatSliderRangeThumb, never>;
  646. static ɵdir: i0.ɵɵDirectiveDeclaration<MatSliderRangeThumb, "input[matSliderStartThumb], input[matSliderEndThumb]", ["matSliderRangeThumb"], {}, {}, never, never, true, never>;
  647. }
  648. declare class MatSliderModule {
  649. static ɵfac: i0.ɵɵFactoryDeclaration<MatSliderModule, never>;
  650. static ɵmod: i0.ɵɵNgModuleDeclaration<MatSliderModule, never, [typeof MatCommonModule, typeof MatRippleModule, typeof MatSlider, typeof MatSliderThumb, typeof MatSliderRangeThumb, typeof MatSliderVisualThumb], [typeof MatSlider, typeof MatSliderThumb, typeof MatSliderRangeThumb]>;
  651. static ɵinj: i0.ɵɵInjectorDeclaration<MatSliderModule>;
  652. }
  653. export { MatSlider, MatSliderChange, MatSliderModule, MatSliderRangeThumb, MatSliderThumb, MatSliderVisualThumb };
  654. export type { MatSliderDragEvent };