UNPKG

@progress/kendo-angular-grid

Version:

Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.

94 lines (93 loc) 5.12 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Component, forwardRef } from '@angular/core'; import { ContextService } from '../../../common/provider.service'; import { CheckBoxComponent } from '@progress/kendo-angular-inputs'; import { IdService } from '../../../common/id.service'; import { ToolBarToolComponent } from '@progress/kendo-angular-toolbar'; import { SelectAllCheckboxDirective } from '../../../selection/selectall-checkbox.directive'; import { FocusableDirective } from '../../../navigation/focusable.directive'; import { LabelDirective } from '@progress/kendo-angular-label'; import * as i0 from "@angular/core"; import * as i1 from "../../../common/id.service"; import * as i2 from "../../../common/provider.service"; /** * Represents the toolbar tool for showing a select-all `kendoGridSelectAllCheckbox` checkbox. * Use this component inside a ToolbarComponent in the Grid. * * @example * ```html * <kendo-grid> * <kendo-toolbar> * <kendo-grid-select-all-tool text="Select All"></kendo-grid-select-all-tool> * </kendo-toolbar> * </kendo-grid> * ``` */ export class SelectAllToolbarToolComponent extends ToolBarToolComponent { idService; ctx; constructor(idService, ctx) { super(); this.idService = idService; this.ctx = ctx; } /** * @hidden */ selectAllCheckboxId() { return this.idService.selectAllCheckboxId(); } /** * @hidden */ get selectAllCheckboxLabel() { return this.ctx.localization.get('selectAllCheckboxLabel'); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectAllToolbarToolComponent, deps: [{ token: i1.IdService }, { token: i2.ContextService }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: SelectAllToolbarToolComponent, isStandalone: true, selector: "kendo-grid-select-all-tool", providers: [ { provide: ToolBarToolComponent, useExisting: forwardRef(() => SelectAllToolbarToolComponent) } ], usesInheritance: true, ngImport: i0, template: ` <ng-template #toolbarTemplate #sectionTemplate #popupTemplate> <kendo-checkbox #checkbox [attr.id]="selectAllCheckboxId()" size="large" [inputAttributes]="{'aria-label': selectAllCheckboxLabel}" kendoGridSelectAllCheckbox kendoGridFocusable ></kendo-checkbox> <label class="k-checkbox-label" [for]="checkbox.focusableId">{{selectAllCheckboxLabel}}</label> </ng-template> `, isInline: true, dependencies: [{ kind: "component", type: CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }, { kind: "directive", type: SelectAllCheckboxDirective, selector: "[kendoGridSelectAllCheckbox]", inputs: ["state"], outputs: ["selectAllChange"] }, { kind: "directive", type: FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { kind: "directive", type: LabelDirective, selector: "label[for]", inputs: ["for", "labelClass"] }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectAllToolbarToolComponent, decorators: [{ type: Component, args: [{ providers: [ { provide: ToolBarToolComponent, useExisting: forwardRef(() => SelectAllToolbarToolComponent) } ], selector: 'kendo-grid-select-all-tool', template: ` <ng-template #toolbarTemplate #sectionTemplate #popupTemplate> <kendo-checkbox #checkbox [attr.id]="selectAllCheckboxId()" size="large" [inputAttributes]="{'aria-label': selectAllCheckboxLabel}" kendoGridSelectAllCheckbox kendoGridFocusable ></kendo-checkbox> <label class="k-checkbox-label" [for]="checkbox.focusableId">{{selectAllCheckboxLabel}}</label> </ng-template> `, standalone: true, imports: [CheckBoxComponent, SelectAllCheckboxDirective, FocusableDirective, LabelDirective] }] }], ctorParameters: () => [{ type: i1.IdService }, { type: i2.ContextService }] });