Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions src/cdk/collections/selection-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ export class SelectionModel<T> {
* Selects a value or an array of values.
* @param values The values to select
* @return Whether the selection changed as a result of this call
* @breaking-change 16.0.0 make return type boolean
*/
select(...values: T[]): boolean | void {
select(...values: T[]): boolean {
this._verifyValueAssignment(values);
values.forEach(value => this._markSelected(value));
const changed = this._hasQueuedChanges();
Expand All @@ -72,9 +71,8 @@ export class SelectionModel<T> {
* Deselects a value or an array of values.
* @param values The values to deselect
* @return Whether the selection changed as a result of this call
* @breaking-change 16.0.0 make return type boolean
*/
deselect(...values: T[]): boolean | void {
deselect(...values: T[]): boolean {
this._verifyValueAssignment(values);
values.forEach(value => this._unmarkSelected(value));
const changed = this._hasQueuedChanges();
Expand All @@ -86,9 +84,8 @@ export class SelectionModel<T> {
* Sets the selected values
* @param values The new selected values
* @return Whether the selection changed as a result of this call
* @breaking-change 16.0.0 make return type boolean
*/
setSelection(...values: T[]): boolean | void {
setSelection(...values: T[]): boolean {
this._verifyValueAssignment(values);
const oldValues = this.selected;
const newSelectedSet = new Set(values.map(value => this._getConcreteValue(value)));
Expand All @@ -105,9 +102,8 @@ export class SelectionModel<T> {
* Toggles a value between selected and deselected.
* @param value The value to toggle
* @return Whether the selection changed as a result of this call
* @breaking-change 16.0.0 make return type boolean
*/
toggle(value: T): boolean | void {
toggle(value: T): boolean {
return this.isSelected(value) ? this.deselect(value) : this.select(value);
}

Expand All @@ -116,9 +112,8 @@ export class SelectionModel<T> {
* @param flushEvent Whether to flush the changes in an event.
* If false, the changes to the selection will be flushed along with the next event.
* @return Whether the selection changed as a result of this call
* @breaking-change 16.0.0 make return type boolean
*/
clear(flushEvent = true): boolean | void {
clear(flushEvent = true): boolean {
this._unmarkAll();
const changed = this._hasQueuedChanges();
if (flushEvent) {
Expand Down
20 changes: 0 additions & 20 deletions src/cdk/dialog/dialog-injectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,3 @@ export const DIALOG_DATA = new InjectionToken<any>('DialogData');

/** Injection token that can be used to provide default options for the dialog module. */
export const DEFAULT_DIALOG_CONFIG = new InjectionToken<DialogConfig>('DefaultDialogConfig');

/**
* @docs-private
* @deprecated No longer used. To be removed.
* @breaking-change 19.0.0
*/
export function DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay): () => ScrollStrategy {
return () => overlay.scrollStrategies.block();
}

/**
* @docs-private
* @deprecated No longer used. To be removed.
* @breaking-change 19.0.0
*/
export const DIALOG_SCROLL_STRATEGY_PROVIDER = {
provide: DIALOG_SCROLL_STRATEGY,
deps: [Overlay],
useFactory: DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
};
15 changes: 4 additions & 11 deletions src/cdk/drag-drop/drag-drop-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ const activeCapturingEventOptions = {
})
export class _ResetsLoader {}

// TODO(crisbeto): remove generics when making breaking changes.
/**
* Service that keeps track of all the drag item and drop container
* instances, and manages global event listeners on the `document`.
* @docs-private
*/
@Injectable({providedIn: 'root'})
export class DragDropRegistry<_ = unknown, __ = unknown> implements OnDestroy {
export class DragDropRegistry implements OnDestroy {
private _ngZone = inject(NgZone);
private _document = inject(DOCUMENT);
private _styleLoader = inject(_CdkPrivateStyleLoader);
private _renderer = inject(RendererFactory2).createRenderer(null, null);
private _cleanupDocumentTouchmove: (() => void) | undefined;
private _scroll: Subject<Event> = new Subject<Event>();

/** Registered drop container instances. */
private _dropInstances = new Set<DropListRef>();
Expand Down Expand Up @@ -101,13 +101,6 @@ export class DragDropRegistry<_ = unknown, __ = unknown> implements OnDestroy {
*/
readonly pointerUp: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();

/**
* Emits when the viewport has been scrolled while the user is dragging an item.
* @deprecated To be turned into a private member. Use the `scrolled` method instead.
* @breaking-change 13.0.0
*/
readonly scroll: Subject<Event> = new Subject<Event>();

constructor(...args: unknown[]);
constructor() {}

Expand Down Expand Up @@ -180,7 +173,7 @@ export class DragDropRegistry<_ = unknown, __ = unknown> implements OnDestroy {
const toBind: [name: string, handler: (event: Event) => void, options: _ListenerOptions][] = [
// Use capturing so that we pick up scroll changes in any scrollable nodes that aren't
// the document. See https://github.com/angular/components/issues/17144.
['scroll', (e: Event) => this.scroll.next(e), capturingEventOptions],
['scroll', (e: Event) => this._scroll.next(e), capturingEventOptions],

// Preventing the default action on `mousemove` isn't enough to disable text selection
// on Safari so we need to prevent the selection event as well. Alternatively this can
Expand Down Expand Up @@ -245,7 +238,7 @@ export class DragDropRegistry<_ = unknown, __ = unknown> implements OnDestroy {
* be used to include an additional top-level listener at the shadow root level.
*/
scrolled(shadowRoot?: DocumentOrShadowRoot | null): Observable<Event> {
const streams: Observable<Event>[] = [this.scroll];
const streams: Observable<Event>[] = [this._scroll];

if (shadowRoot && shadowRoot !== this._document) {
// Note that this is basically the same as `fromEvent` from rxjs, but we do it ourselves,
Expand Down
50 changes: 0 additions & 50 deletions src/cdk/table/can-stick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';

/** @docs-private */
export type Constructor<T> = new (...args: any[]) => T;

/**
* Interface for a mixin to provide a directive with a function that checks if the sticky input has
* been changed since the last time the function was called. Essentially adds a dirty-check to the
Expand All @@ -27,48 +22,3 @@ export interface CanStick {
/** Resets the dirty check for cases where the sticky state has been used without checking. */
resetStickyChanged(): void;
}

/** @docs-private */
export type CanStickCtor = Constructor<CanStick>;

/**
* Mixin to provide a directive with a function that checks if the sticky input has been
* changed since the last time the function was called. Essentially adds a dirty-check to the
* sticky value.
* @docs-private
* @deprecated Implement the `CanStick` interface instead.
* @breaking-change 19.0.0
*/
export function mixinHasStickyInput<T extends Constructor<{}>>(base: T): CanStickCtor & T {
return class extends base {
/** Whether sticky positioning should be applied. */
get sticky(): boolean {
return this._sticky;
}
set sticky(v: BooleanInput) {
const prevValue = this._sticky;
this._sticky = coerceBooleanProperty(v);
this._hasStickyChanged = prevValue !== this._sticky;
}
_sticky: boolean = false;

/** Whether the sticky input has changed since it was last checked. */
_hasStickyChanged: boolean = false;

/** Whether the sticky value has changed since this was last called. */
hasStickyChanged(): boolean {
const hasStickyChanged = this._hasStickyChanged;
this._hasStickyChanged = false;
return hasStickyChanged;
}

/** Resets the dirty check for cases where the sticky state has been used without checking. */
resetStickyChanged() {
this._hasStickyChanged = false;
}

constructor(...args: any[]) {
super(...args);
}
};
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import {Component, inject} from '@angular/core';
import {FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule} from '@angular/forms';
import {MatButtonModule} from '@angular/material/button';
import {
MatSlideToggleModule,
_MatSlideToggleRequiredValidatorModule,
} from '@angular/material/slide-toggle';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';

/**
* @title Slide-toggle with forms
Expand All @@ -13,13 +10,7 @@ import {
selector: 'slide-toggle-forms-example',
templateUrl: './slide-toggle-forms-example.html',
styleUrl: './slide-toggle-forms-example.css',
imports: [
MatSlideToggleModule,
FormsModule,
_MatSlideToggleRequiredValidatorModule,
MatButtonModule,
ReactiveFormsModule,
],
imports: [MatSlideToggleModule, FormsModule, MatButtonModule, ReactiveFormsModule],
})
export class SlideToggleFormsExample {
private _formBuilder = inject(FormBuilder);
Expand Down
35 changes: 0 additions & 35 deletions src/material/checkbox/checkbox-required-validator.ts

This file was deleted.

16 changes: 5 additions & 11 deletions src/material/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ export enum TransitionCheckState {
Indeterminate,
}

/**
* @deprecated Will stop being exported.
* @breaking-change 19.0.0
*/
export const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => MatCheckbox),
multi: true,
};

/** Change event object emitted by checkbox. */
export class MatCheckboxChange {
/** The source checkbox of the event. */
Expand Down Expand Up @@ -99,7 +89,11 @@ const defaults = MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY();
'[class]': 'color ? "mat-" + color : "mat-accent"',
},
providers: [
MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR,
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => MatCheckbox),
multi: true,
},
{
provide: NG_VALIDATORS,
useExisting: MatCheckbox,
Expand Down
11 changes: 0 additions & 11 deletions src/material/checkbox/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@
import {NgModule} from '@angular/core';
import {MatCommonModule} from '@angular/material/core';
import {MatCheckbox} from './checkbox';
import {MatCheckboxRequiredValidator} from './checkbox-required-validator';

/**
* @deprecated No longer used, `MatCheckbox` implements required validation directly.
* @breaking-change 19.0.0
*/
@NgModule({
imports: [MatCheckboxRequiredValidator],
exports: [MatCheckboxRequiredValidator],
})
export class _MatCheckboxRequiredValidatorModule {}

@NgModule({
imports: [MatCheckbox, MatCommonModule],
Expand Down
1 change: 0 additions & 1 deletion src/material/checkbox/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
export * from './checkbox';
export * from './checkbox-config';
export * from './module';
export * from './checkbox-required-validator';
22 changes: 0 additions & 22 deletions src/material/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,6 @@ export const MAT_DIALOG_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrateg
},
);

/**
* @docs-private
* @deprecated No longer used. To be removed.
* @breaking-change 19.0.0
*/
export function MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(
overlay: Overlay,
): () => ScrollStrategy {
return () => overlay.scrollStrategies.block();
}

/**
* @docs-private
* @deprecated No longer used. To be removed.
* @breaking-change 19.0.0
*/
export const MAT_DIALOG_SCROLL_STRATEGY_PROVIDER = {
provide: MAT_DIALOG_SCROLL_STRATEGY,
deps: [Overlay],
useFactory: MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
};

/**
* Service to open Material Design modal dialogs.
*/
Expand Down
34 changes: 0 additions & 34 deletions src/material/select/select-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,8 @@
* @breaking-change 21.0.0
*/
export const matSelectAnimations: {
/**
* @deprecated No longer being used. To be removed.
* @breaking-change 12.0.0
*/
readonly transformPanelWrap: any;
readonly transformPanel: any;
} = {
// Represents
// trigger('transformPanelWrap', [
// transition('* => void', query('@transformPanel', [animateChild()], {optional: true})),
// ])

/**
* This animation ensures the select's overlay panel animation (transformPanel) is called when
* closing the select.
* This is needed due to https://github.com/angular/angular/issues/23302
*/
transformPanelWrap: {
type: 7,
name: 'transformPanelWrap',
definitions: [
{
type: 1,
expr: '* => void',
animation: {
type: 11,
selector: '@transformPanel',
animation: [{type: 9, options: null}],
options: {optional: true},
},
options: null,
},
],
options: {},
},

// Represents
// trigger('transformPanel', [
// state(
Expand Down
11 changes: 0 additions & 11 deletions src/material/slide-toggle/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@
import {NgModule} from '@angular/core';
import {MatCommonModule} from '@angular/material/core';
import {MatSlideToggle} from './slide-toggle';
import {MatSlideToggleRequiredValidator} from './slide-toggle-required-validator';

/**
* @deprecated No longer used, `MatSlideToggle` implements required validation directly.
* @breaking-change 19.0.0
*/
@NgModule({
imports: [MatSlideToggleRequiredValidator],
exports: [MatSlideToggleRequiredValidator],
})
export class _MatSlideToggleRequiredValidatorModule {}

@NgModule({
imports: [MatSlideToggle, MatCommonModule],
Expand Down
Loading
Loading