diff --git a/src/material/slider/slider-input.ts b/src/material/slider/slider-input.ts index 11e5554072a4..0ccc8543cd5f 100644 --- a/src/material/slider/slider-input.ts +++ b/src/material/slider/slider-input.ts @@ -103,6 +103,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA this._slider._onValueChange(this); this._cdr.detectChanges(); } + /** Event emitted when the `value` is changed. */ @Output() readonly valueChange: EventEmitter = new EventEmitter(); /** Event emitted when the slider thumb starts being dragged. */ @@ -113,7 +114,10 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA @Output() readonly dragEnd: EventEmitter = new EventEmitter(); - /** The current translateX in px of the slider visual thumb. */ + /** + * The current translateX in px of the slider visual thumb. + * @docs-private + */ get translateX(): number { if (this._slider.min >= this._slider.max) { this._translateX = 0; @@ -129,9 +133,13 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA } private _translateX: number | undefined; - /** Indicates whether this thumb is the start or end thumb. */ + /** + * Indicates whether this thumb is the start or end thumb. + * @docs-private + */ thumbPosition: _MatThumb = _MatThumb.END; + /** @docs-private */ get min(): number { return coerceNumberProperty(this._hostElement.min); } @@ -140,6 +148,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA this._cdr.detectChanges(); } + /** @docs-private */ get max(): number { return coerceNumberProperty(this._hostElement.max); } @@ -156,6 +165,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA this._cdr.detectChanges(); } + /** @docs-private */ get disabled(): boolean { return coerceBooleanProperty(this._hostElement.disabled); } @@ -168,6 +178,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA } } + /** The percentage of the slider that coincides with the value. */ get percentage(): number { if (this._slider.min >= this._slider.max) { return this._slider._isRtl ? 1 : 0; @@ -175,6 +186,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA return (this.value - this._slider.min) / (this._slider.max - this._slider.min); } + /** @docs-private */ get fillPercentage(): number { if (!this._slider._cachedWidth) { return this._slider._isRtl ? 1 : 0; @@ -260,6 +272,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA this.dragEnd.complete(); } + /** @docs-private */ initProps(): void { this._updateWidthInactive(); this.disabled = this._slider.disabled; @@ -269,6 +282,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA this._initValue(); } + /** @docs-private */ initUI(): void { this._updateThumbUIByValue(); } @@ -530,6 +544,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA ], }) export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRangeThumb { + /** @docs-private */ getSibling(): _MatSliderRangeThumb | undefined { if (!this._sibling) { this._sibling = this._slider._getInput(this._isEndThumb ? _MatThumb.START : _MatThumb.END) as @@ -540,7 +555,10 @@ export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRan } private _sibling: MatSliderRangeThumb | undefined; - /** Returns the minimum translateX position allowed for this slider input's visual thumb. */ + /** + * Returns the minimum translateX position allowed for this slider input's visual thumb. + * @docs-private + */ getMinPos(): number { const sibling = this.getSibling(); if (!this._isLeftThumb && sibling) { @@ -549,7 +567,10 @@ export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRan return 0; } - /** Returns the maximum translateX position allowed for this slider input's visual thumb. */ + /** + * Returns the maximum translateX position allowed for this slider input's visual thumb. + * @docs-private + */ getMaxPos(): number { const sibling = this.getSibling(); if (this._isLeftThumb && sibling) { diff --git a/src/material/slider/slider.ts b/src/material/slider/slider.ts index 75ac14c726a1..043082f9326c 100644 --- a/src/material/slider/slider.ts +++ b/src/material/slider/slider.ts @@ -375,7 +375,10 @@ export class MatSlider // The value indicator tooltip text for the visual slider thumb(s). + /** @docs-private */ protected startValueIndicatorText: string = ''; + + /** @docs-private */ protected endValueIndicatorText: string = ''; // Used to control the translateX of the visual slider thumb(s). diff --git a/tools/public_api_guard/material/slider.md b/tools/public_api_guard/material/slider.md index 176c11ab5a6b..3f734c4c22d5 100644 --- a/tools/public_api_guard/material/slider.md +++ b/tools/public_api_guard/material/slider.md @@ -46,7 +46,6 @@ export class MatSlider extends _MatSliderMixinBase implements AfterViewInit, Can displayWith: (value: number) => string; // (undocumented) _endThumbTransform: string; - // (undocumented) protected endValueIndicatorText: string; _getInput(thumbPosition: _MatThumb): _MatSliderThumb | _MatSliderRangeThumb | undefined; _getThumb(thumbPosition: _MatThumb): _MatSliderVisualThumb; @@ -101,7 +100,6 @@ export class MatSlider extends _MatSliderMixinBase implements AfterViewInit, Can set showTickMarks(v: BooleanInput); // (undocumented) _startThumbTransform: string; - // (undocumented) protected startValueIndicatorText: string; get step(): number; set step(v: NumberInput); @@ -150,7 +148,6 @@ export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRan _getDefaultValue(): number; getMaxPos(): number; getMinPos(): number; - // (undocumented) getSibling(): _MatSliderRangeThumb | undefined; _isEndThumb: boolean; _isLeftThumb: boolean; @@ -195,14 +192,12 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA // (undocumented) _clamp(v: number): number; protected readonly _destroyed: Subject; - // (undocumented) get disabled(): boolean; set disabled(v: BooleanInput); readonly dragEnd: EventEmitter; readonly dragStart: EventEmitter; // (undocumented) readonly _elementRef: ElementRef; - // (undocumented) get fillPercentage(): number; _fixValue(event: PointerEvent): void; // (undocumented) @@ -211,19 +206,15 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA _getDefaultValue(): number; _hostElement: HTMLInputElement; _initialValue: string | undefined; - // (undocumented) initProps(): void; - // (undocumented) initUI(): void; // (undocumented) _initValue(): void; _isActive: boolean; _isFocused: boolean; _knobRadius: number; - // (undocumented) get max(): number; set max(v: NumberInput); - // (undocumented) get min(): number; set min(v: NumberInput); // (undocumented) @@ -246,7 +237,6 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA _onPointerMove(event: PointerEvent): void; // (undocumented) _onPointerUp(event: PointerEvent): void; - // (undocumented) get percentage(): number; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; @@ -277,7 +267,6 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA // (undocumented) get value(): number; set value(v: NumberInput); - // (undocumented) readonly valueChange: EventEmitter; _valuetext: string; writeValue(value: any): void;