ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
70 lines • 7.39 kB
JavaScript
/**
* 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
*/
import { NgForOf } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
export class NzTreeIndentComponent {
constructor() {
this.nzTreeLevel = 0;
this.nzIsStart = [];
this.nzIsEnd = [];
this.nzSelectMode = false;
this.listOfUnit = [];
}
ngOnChanges(changes) {
const { nzTreeLevel } = changes;
if (nzTreeLevel) {
this.listOfUnit = [...new Array(nzTreeLevel.currentValue || 0)];
}
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzTreeIndentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: NzTreeIndentComponent, isStandalone: true, selector: "nz-tree-indent", inputs: { nzTreeLevel: "nzTreeLevel", nzIsStart: "nzIsStart", nzIsEnd: "nzIsEnd", nzSelectMode: "nzSelectMode" }, host: { properties: { "attr.aria-hidden": "true", "class.ant-tree-indent": "!nzSelectMode", "class.ant-select-tree-indent": "nzSelectMode" } }, exportAs: ["nzTreeIndent"], usesOnChanges: true, ngImport: i0, template: `
<span
[class.ant-tree-indent-unit]="!nzSelectMode"
[class.ant-select-tree-indent-unit]="nzSelectMode"
[class.ant-select-tree-indent-unit-start]="nzSelectMode && nzIsStart[i]"
[class.ant-tree-indent-unit-start]="!nzSelectMode && nzIsStart[i]"
[class.ant-select-tree-indent-unit-end]="nzSelectMode && nzIsEnd[i]"
[class.ant-tree-indent-unit-end]="!nzSelectMode && nzIsEnd[i]"
*ngFor="let _ of listOfUnit; let i = index"
></span>
`, isInline: true, dependencies: [{ kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzTreeIndentComponent, decorators: [{
type: Component,
args: [{
selector: 'nz-tree-indent',
exportAs: 'nzTreeIndent',
template: `
<span
[class.ant-tree-indent-unit]="!nzSelectMode"
[class.ant-select-tree-indent-unit]="nzSelectMode"
[class.ant-select-tree-indent-unit-start]="nzSelectMode && nzIsStart[i]"
[class.ant-tree-indent-unit-start]="!nzSelectMode && nzIsStart[i]"
[class.ant-select-tree-indent-unit-end]="nzSelectMode && nzIsEnd[i]"
[class.ant-tree-indent-unit-end]="!nzSelectMode && nzIsEnd[i]"
*ngFor="let _ of listOfUnit; let i = index"
></span>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false,
host: {
'[attr.aria-hidden]': 'true',
'[class.ant-tree-indent]': '!nzSelectMode',
'[class.ant-select-tree-indent]': 'nzSelectMode'
},
imports: [NgForOf],
standalone: true
}]
}], propDecorators: { nzTreeLevel: [{
type: Input
}], nzIsStart: [{
type: Input
}], nzIsEnd: [{
type: Input
}], nzSelectMode: [{
type: Input
}] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJlZS1pbmRlbnQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vY29tcG9uZW50cy90cmVlL3RyZWUtaW5kZW50LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFFSCxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDMUMsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQTRCLE1BQU0sZUFBZSxDQUFDOztBQTBCcEcsTUFBTSxPQUFPLHFCQU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