import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';
import * as i1 from 'ng-zorro-antd/icon';
import { NzIconModule } from 'ng-zorro-antd/icon';
/**
* 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
*/
class NzHashCodeComponent {
cdr;
nzValue = '';
nzTitle = 'HashCode';
nzLogo = '';
nzMode = 'double';
nzType = 'default';
nzOnCopy = new EventEmitter();
hashDataList = [];
copyHandle() {
this.nzOnCopy.emit(this.nzValue);
}
constructor(cdr) {
this.cdr = cdr;
}
ngOnChanges(changes) {
const { nzValue } = changes;
if (nzValue) {
this.setData(this.nzValue);
}
}
setData(value) {
if (this.nzMode !== 'single') {
this.hashDataList = value.match(/.{1,4}/g);
}
else {
this.hashDataList = value.match(/.{1,8}/g);
}
this.cdr.markForCheck();
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzHashCodeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzHashCodeComponent, isStandalone: true, selector: "nz-hash-code", inputs: { nzValue: "nzValue", nzTitle: "nzTitle", nzLogo: "nzLogo", nzMode: "nzMode", nzType: "nzType" }, outputs: { nzOnCopy: "nzOnCopy" }, host: { properties: { "class.ant-hash-code-default": "nzType === 'default'", "class.ant-hash-code-primary": "nzType === 'primary'", "class.ant-hash-code-double": "nzMode === 'double'", "class.ant-hash-code-single": "nzMode === 'single'", "class.ant-hash-code-strip": "nzMode === 'strip'", "class.ant-hash-code-rect": "nzMode === 'rect'" }, classAttribute: "ant-hash-code" }, exportAs: ["nzHashCode"], usesOnChanges: true, ngImport: i0, template: `
@if (nzMode !== 'single' && nzMode !== 'rect') {
}
@if (nzMode === 'single' || nzMode === 'rect') {
}
@if (nzMode === 'double') {
@if (hashDataList.length > 8) {
@for (v of hashDataList.slice(0, 6); track v) {
{{ v }}
}
····
{{ hashDataList[hashDataList.length - 1] }}
} @else {
@for (v of hashDataList; track v) {
{{ v }}
}
}
}
@if (nzMode === 'single') {
{{ hashDataList[0] }}
····
{{ hashDataList[hashDataList.length - 1] }}
}
@if (nzMode === 'rect' || nzMode === 'strip') {
@if (hashDataList.length > 16) {
@for (v of hashDataList.slice(0, 14); track v) {
{{ v }}
}
····
{{ hashDataList[hashDataList.length - 1] }}
} @else {
@for (v of hashDataList; track v) {
{{ v }}
}
}
}
`, isInline: true, dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzHashCodeComponent, decorators: [{
type: Component,
args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [NzIconModule, NzStringTemplateOutletDirective],
selector: 'nz-hash-code',
exportAs: 'nzHashCode',
template: `
@if (nzMode !== 'single' && nzMode !== 'rect') {
}
@if (nzMode === 'single' || nzMode === 'rect') {
}
@if (nzMode === 'double') {
@if (hashDataList.length > 8) {
@for (v of hashDataList.slice(0, 6); track v) {
{{ v }}
}
····
{{ hashDataList[hashDataList.length - 1] }}
} @else {
@for (v of hashDataList; track v) {
{{ v }}
}
}
}
@if (nzMode === 'single') {
{{ hashDataList[0] }}
····
{{ hashDataList[hashDataList.length - 1] }}
}
@if (nzMode === 'rect' || nzMode === 'strip') {
@if (hashDataList.length > 16) {
@for (v of hashDataList.slice(0, 14); track v) {
{{ v }}
}
····
{{ hashDataList[hashDataList.length - 1] }}
} @else {
@for (v of hashDataList; track v) {
{{ v }}
}
}
}
`,
host: {
class: 'ant-hash-code',
'[class.ant-hash-code-default]': `nzType === 'default'`,
'[class.ant-hash-code-primary]': `nzType === 'primary'`,
'[class.ant-hash-code-double]': `nzMode === 'double'`,
'[class.ant-hash-code-single]': `nzMode === 'single'`,
'[class.ant-hash-code-strip]': `nzMode === 'strip'`,
'[class.ant-hash-code-rect]': `nzMode === 'rect'`
}
}]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { nzValue: [{
type: Input
}], nzTitle: [{
type: Input
}], nzLogo: [{
type: Input
}], nzMode: [{
type: Input
}], nzType: [{
type: Input
}], nzOnCopy: [{
type: Output
}] } });
/**
* 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
*/
class NzHashCodeModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzHashCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: NzHashCodeModule, imports: [NzHashCodeComponent], exports: [NzHashCodeComponent] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzHashCodeModule, imports: [NzHashCodeComponent] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzHashCodeModule, decorators: [{
type: NgModule,
args: [{
exports: [NzHashCodeComponent],
imports: [NzHashCodeComponent]
}]
}] });
/**
* 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
*/
/**
* 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
*/
/**
* Generated bundle index. Do not edit.
*/
export { NzHashCodeComponent, NzHashCodeModule };
//# sourceMappingURL=ng-zorro-antd-hash-code.mjs.map