sass-references/angular-material/material/stepper/stepper-intl.ts

42 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-12-06 10:42:08 +08:00
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {Injectable, Optional, SkipSelf} from '@angular/core';
import {Subject} from 'rxjs';
/** Stepper data that is required for internationalization. */
@Injectable({providedIn: 'root'})
export class MatStepperIntl {
/**
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
readonly changes: Subject<void> = new Subject<void>();
/** Label that is rendered below optional steps. */
optionalLabel: string = 'Optional';
/** Label that is used to indicate step as completed to screen readers. */
completedLabel: string = 'Completed';
/** Label that is used to indicate step as editable to screen readers. */
editableLabel: string = 'Editable';
}
/** @docs-private */
export function MAT_STEPPER_INTL_PROVIDER_FACTORY(parentIntl: MatStepperIntl) {
return parentIntl || new MatStepperIntl();
}
/** @docs-private */
export const MAT_STEPPER_INTL_PROVIDER = {
provide: MatStepperIntl,
deps: [[new Optional(), new SkipSelf(), MatStepperIntl]],
useFactory: MAT_STEPPER_INTL_PROVIDER_FACTORY,
};