Skip to content

Commit 09e44f0

Browse files
authored
docs(material/slider): hide slider internals (#25953)
* docs(material/slider): hide slider internals * fixup! docs(material/slider): hide slider internals
1 parent cc9b530 commit 09e44f0

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

src/material/slider/slider-input.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
103103
this._slider._onValueChange(this);
104104
this._cdr.detectChanges();
105105
}
106+
/** Event emitted when the `value` is changed. */
106107
@Output() readonly valueChange: EventEmitter<number> = new EventEmitter<number>();
107108

108109
/** Event emitted when the slider thumb starts being dragged. */
@@ -113,7 +114,10 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
113114
@Output() readonly dragEnd: EventEmitter<MatSliderDragEvent> =
114115
new EventEmitter<MatSliderDragEvent>();
115116

116-
/** The current translateX in px of the slider visual thumb. */
117+
/**
118+
* The current translateX in px of the slider visual thumb.
119+
* @docs-private
120+
*/
117121
get translateX(): number {
118122
if (this._slider.min >= this._slider.max) {
119123
this._translateX = 0;
@@ -129,9 +133,13 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
129133
}
130134
private _translateX: number | undefined;
131135

132-
/** Indicates whether this thumb is the start or end thumb. */
136+
/**
137+
* Indicates whether this thumb is the start or end thumb.
138+
* @docs-private
139+
*/
133140
thumbPosition: _MatThumb = _MatThumb.END;
134141

142+
/** @docs-private */
135143
get min(): number {
136144
return coerceNumberProperty(this._hostElement.min);
137145
}
@@ -140,6 +148,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
140148
this._cdr.detectChanges();
141149
}
142150

151+
/** @docs-private */
143152
get max(): number {
144153
return coerceNumberProperty(this._hostElement.max);
145154
}
@@ -156,6 +165,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
156165
this._cdr.detectChanges();
157166
}
158167

168+
/** @docs-private */
159169
get disabled(): boolean {
160170
return coerceBooleanProperty(this._hostElement.disabled);
161171
}
@@ -168,13 +178,15 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
168178
}
169179
}
170180

181+
/** The percentage of the slider that coincides with the value. */
171182
get percentage(): number {
172183
if (this._slider.min >= this._slider.max) {
173184
return this._slider._isRtl ? 1 : 0;
174185
}
175186
return (this.value - this._slider.min) / (this._slider.max - this._slider.min);
176187
}
177188

189+
/** @docs-private */
178190
get fillPercentage(): number {
179191
if (!this._slider._cachedWidth) {
180192
return this._slider._isRtl ? 1 : 0;
@@ -260,6 +272,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
260272
this.dragEnd.complete();
261273
}
262274

275+
/** @docs-private */
263276
initProps(): void {
264277
this._updateWidthInactive();
265278
this.disabled = this._slider.disabled;
@@ -269,6 +282,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
269282
this._initValue();
270283
}
271284

285+
/** @docs-private */
272286
initUI(): void {
273287
this._updateThumbUIByValue();
274288
}
@@ -530,6 +544,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
530544
],
531545
})
532546
export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRangeThumb {
547+
/** @docs-private */
533548
getSibling(): _MatSliderRangeThumb | undefined {
534549
if (!this._sibling) {
535550
this._sibling = this._slider._getInput(this._isEndThumb ? _MatThumb.START : _MatThumb.END) as
@@ -540,7 +555,10 @@ export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRan
540555
}
541556
private _sibling: MatSliderRangeThumb | undefined;
542557

543-
/** Returns the minimum translateX position allowed for this slider input's visual thumb. */
558+
/**
559+
* Returns the minimum translateX position allowed for this slider input's visual thumb.
560+
* @docs-private
561+
*/
544562
getMinPos(): number {
545563
const sibling = this.getSibling();
546564
if (!this._isLeftThumb && sibling) {
@@ -549,7 +567,10 @@ export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRan
549567
return 0;
550568
}
551569

552-
/** Returns the maximum translateX position allowed for this slider input's visual thumb. */
570+
/**
571+
* Returns the maximum translateX position allowed for this slider input's visual thumb.
572+
* @docs-private
573+
*/
553574
getMaxPos(): number {
554575
const sibling = this.getSibling();
555576
if (this._isLeftThumb && sibling) {

src/material/slider/slider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,10 @@ export class MatSlider
376376

377377
// The value indicator tooltip text for the visual slider thumb(s).
378378

379+
/** @docs-private */
379380
protected startValueIndicatorText: string = '';
381+
382+
/** @docs-private */
380383
protected endValueIndicatorText: string = '';
381384

382385
// Used to control the translateX of the visual slider thumb(s).

tools/public_api_guard/material/slider.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export class MatSlider extends _MatSliderMixinBase implements AfterViewInit, Can
4646
displayWith: (value: number) => string;
4747
// (undocumented)
4848
_endThumbTransform: string;
49-
// (undocumented)
5049
protected endValueIndicatorText: string;
5150
_getInput(thumbPosition: _MatThumb): _MatSliderThumb | _MatSliderRangeThumb | undefined;
5251
_getThumb(thumbPosition: _MatThumb): _MatSliderVisualThumb;
@@ -101,7 +100,6 @@ export class MatSlider extends _MatSliderMixinBase implements AfterViewInit, Can
101100
set showTickMarks(v: BooleanInput);
102101
// (undocumented)
103102
_startThumbTransform: string;
104-
// (undocumented)
105103
protected startValueIndicatorText: string;
106104
get step(): number;
107105
set step(v: NumberInput);
@@ -157,7 +155,6 @@ export class MatSliderRangeThumb extends MatSliderThumb implements _MatSliderRan
157155
_getDefaultValue(): number;
158156
getMaxPos(): number;
159157
getMinPos(): number;
160-
// (undocumented)
161158
getSibling(): _MatSliderRangeThumb | undefined;
162159
_isEndThumb: boolean;
163160
_isLeftThumb: boolean;
@@ -202,14 +199,12 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
202199
// (undocumented)
203200
_clamp(v: number): number;
204201
protected readonly _destroyed: Subject<void>;
205-
// (undocumented)
206202
get disabled(): boolean;
207203
set disabled(v: BooleanInput);
208204
readonly dragEnd: EventEmitter<MatSliderDragEvent>;
209205
readonly dragStart: EventEmitter<MatSliderDragEvent>;
210206
// (undocumented)
211207
readonly _elementRef: ElementRef<HTMLInputElement>;
212-
// (undocumented)
213208
get fillPercentage(): number;
214209
_fixValue(event: PointerEvent): void;
215210
// (undocumented)
@@ -218,19 +213,15 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
218213
_getDefaultValue(): number;
219214
_hostElement: HTMLInputElement;
220215
_initialValue: string | undefined;
221-
// (undocumented)
222216
initProps(): void;
223-
// (undocumented)
224217
initUI(): void;
225218
// (undocumented)
226219
_initValue(): void;
227220
_isActive: boolean;
228221
_isFocused: boolean;
229222
_knobRadius: number;
230-
// (undocumented)
231223
get max(): number;
232224
set max(v: NumberInput);
233-
// (undocumented)
234225
get min(): number;
235226
set min(v: NumberInput);
236227
// (undocumented)
@@ -253,7 +244,6 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
253244
_onPointerMove(event: PointerEvent): void;
254245
// (undocumented)
255246
_onPointerUp(event: PointerEvent): void;
256-
// (undocumented)
257247
get percentage(): number;
258248
registerOnChange(fn: any): void;
259249
registerOnTouched(fn: any): void;
@@ -284,7 +274,6 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
284274
// (undocumented)
285275
get value(): number;
286276
set value(v: NumberInput);
287-
// (undocumented)
288277
readonly valueChange: EventEmitter<number>;
289278
_valuetext: string;
290279
writeValue(value: any): void;

0 commit comments

Comments
 (0)