UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

157 lines 17.2 kB
import { __decorate } from "tslib"; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ /* eslint-disable @angular-eslint/component-selector */ import { NgIf, NgTemplateOutlet } from '@angular/common'; import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { NzCheckboxModule } from 'ng-zorro-antd/checkbox'; import { InputBoolean } from 'ng-zorro-antd/core/util'; import { NzRowExpandButtonDirective } from '../addon/row-expand-button.directive'; import { NzRowIndentDirective } from '../addon/row-indent.directive'; import * as i0 from "@angular/core"; import * as i1 from "ng-zorro-antd/checkbox"; import * as i2 from "@angular/forms"; export class NzTdAddOnComponent { constructor() { this.nzChecked = false; this.nzDisabled = false; this.nzIndeterminate = false; this.nzLabel = null; this.nzIndentSize = 0; this.nzShowExpand = false; this.nzShowCheckbox = false; this.nzExpand = false; this.nzExpandIcon = null; this.nzCheckedChange = new EventEmitter(); this.nzExpandChange = new EventEmitter(); this.isNzShowExpandChanged = false; this.isNzShowCheckboxChanged = false; } onCheckedChange(checked) { this.nzChecked = checked; this.nzCheckedChange.emit(checked); } onExpandChange(expand) { this.nzExpand = expand; this.nzExpandChange.emit(expand); } ngOnChanges(changes) { const isFirstChange = (value) => value && value.firstChange && value.currentValue !== undefined; const { nzExpand, nzChecked, nzShowExpand, nzShowCheckbox } = changes; if (nzShowExpand) { this.isNzShowExpandChanged = true; } if (nzShowCheckbox) { this.isNzShowCheckboxChanged = true; } if (isFirstChange(nzExpand) && !this.isNzShowExpandChanged) { this.nzShowExpand = true; } if (isFirstChange(nzChecked) && !this.isNzShowCheckboxChanged) { this.nzShowCheckbox = true; } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzTdAddOnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: NzTdAddOnComponent, isStandalone: true, selector: "td[nzChecked], td[nzDisabled], td[nzIndeterminate], td[nzIndentSize], td[nzExpand], td[nzShowExpand], td[nzShowCheckbox]", inputs: { nzChecked: "nzChecked", nzDisabled: "nzDisabled", nzIndeterminate: "nzIndeterminate", nzLabel: "nzLabel", nzIndentSize: "nzIndentSize", nzShowExpand: "nzShowExpand", nzShowCheckbox: "nzShowCheckbox", nzExpand: "nzExpand", nzExpandIcon: "nzExpandIcon" }, outputs: { nzCheckedChange: "nzCheckedChange", nzExpandChange: "nzExpandChange" }, host: { properties: { "class.ant-table-cell-with-append": "nzShowExpand || nzIndentSize > 0", "class.ant-table-selection-column": "nzShowCheckbox" } }, usesOnChanges: true, ngImport: i0, template: ` <ng-container *ngIf="nzShowExpand || nzIndentSize > 0"> <nz-row-indent [indentSize]="nzIndentSize"></nz-row-indent> <ng-template #rowExpand> <button nz-row-expand-button [expand]="nzExpand" (expandChange)="onExpandChange($event)" [spaceMode]="!nzShowExpand" ></button> </ng-template> <ng-container *ngIf="nzExpandIcon; else rowExpand"> <ng-template [ngTemplateOutlet]="nzExpandIcon"></ng-template> </ng-container> </ng-container> <label nz-checkbox *ngIf="nzShowCheckbox" [nzDisabled]="nzDisabled" [ngModel]="nzChecked" [nzIndeterminate]="nzIndeterminate" [attr.aria-label]="nzLabel" (ngModelChange)="onCheckedChange($event)" ></label> <ng-content></ng-content> `, isInline: true, dependencies: [{ kind: "directive", type: NzRowIndentDirective, selector: "nz-row-indent", inputs: ["indentSize"] }, { kind: "directive", type: NzRowExpandButtonDirective, selector: "button[nz-row-expand-button]", inputs: ["expand", "spaceMode"], outputs: ["expandChange"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: NzCheckboxModule }, { kind: "component", type: i1.NzCheckboxComponent, selector: "[nz-checkbox]", inputs: ["nzValue", "nzAutoFocus", "nzDisabled", "nzIndeterminate", "nzChecked", "nzId"], outputs: ["nzCheckedChange"], exportAs: ["nzCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); } } __decorate([ InputBoolean() ], NzTdAddOnComponent.prototype, "nzShowExpand", void 0); __decorate([ InputBoolean() ], NzTdAddOnComponent.prototype, "nzShowCheckbox", void 0); __decorate([ InputBoolean() ], NzTdAddOnComponent.prototype, "nzExpand", void 0); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzTdAddOnComponent, decorators: [{ type: Component, args: [{ selector: 'td[nzChecked], td[nzDisabled], td[nzIndeterminate], td[nzIndentSize], td[nzExpand], td[nzShowExpand], td[nzShowCheckbox]', changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, encapsulation: ViewEncapsulation.None, template: ` <ng-container *ngIf="nzShowExpand || nzIndentSize > 0"> <nz-row-indent [indentSize]="nzIndentSize"></nz-row-indent> <ng-template #rowExpand> <button nz-row-expand-button [expand]="nzExpand" (expandChange)="onExpandChange($event)" [spaceMode]="!nzShowExpand" ></button> </ng-template> <ng-container *ngIf="nzExpandIcon; else rowExpand"> <ng-template [ngTemplateOutlet]="nzExpandIcon"></ng-template> </ng-container> </ng-container> <label nz-checkbox *ngIf="nzShowCheckbox" [nzDisabled]="nzDisabled" [ngModel]="nzChecked" [nzIndeterminate]="nzIndeterminate" [attr.aria-label]="nzLabel" (ngModelChange)="onCheckedChange($event)" ></label> <ng-content></ng-content> `, host: { '[class.ant-table-cell-with-append]': `nzShowExpand || nzIndentSize > 0`, '[class.ant-table-selection-column]': `nzShowCheckbox` }, imports: [NzRowIndentDirective, NzRowExpandButtonDirective, NgIf, NgTemplateOutlet, NzCheckboxModule, FormsModule], standalone: true }] }], propDecorators: { nzChecked: [{ type: Input }], nzDisabled: [{ type: Input }], nzIndeterminate: [{ type: Input }], nzLabel: [{ type: Input }], nzIndentSize: [{ type: Input }], nzShowExpand: [{ type: Input }], nzShowCheckbox: [{ type: Input }], nzExpand: [{ type: Input }], nzExpandIcon: [{ type: Input }], nzCheckedChange: [{ type: Output }], nzExpandChange: [{ type: Output }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGQtYWRkb24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vY29tcG9uZW50cy90YWJsZS9zcmMvY2VsbC90ZC1hZGRvbi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7R0FHRztBQUVILHVEQUF1RDtBQUV2RCxPQUFPLEVBQUUsSUFBSSxFQUFFLGdCQUFnQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDekQsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsWUFBWSxFQUNaLEtBQUssRUFFTCxNQUFNLEVBSU4saUJBQWlCLEVBQ2xCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUU3QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUUxRCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0seUJBQXlCLENBQ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