This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

40
node_modules/ng-zorro-antd/schematics/README.md generated vendored Normal file
View File

@@ -0,0 +1,40 @@
# ng-zorro-antd Schematics
## Schematics
### ng-add
添加 ng-zorro-antd 与它的依赖,并根据需要自动配置。
- 添加 ng-zorro-antd 到 `package.json`
- 替换 `app.html` 引导内容
- 在根模块导入必要的模块
- 进行国际化配置
- 将用于自定义的 `theme.less` 或编译后的 css 导入 `angular.json`
```bash
$ ng add ng-zorro-antd [--locale=zh-CN] [--theme] [--skipPackageJson]
```
## 开发
### 首次运行
`npm run build:schematic` 编译到 publish 文件夹,创建一个新的 ng 项目。
1. `cd publish && npm link`
2. `ng new schematic-debug`
3. `cd schematic-debug && npm link ng-zorro-antd`
### 调试
1. `schematic:build` 修改代码后编译
2. `cd schematic-debug` 切换到 ng 项目
3. `git checkout . && git clean -fd` 还原更改
4. `ng g ng-zorro-antd:[schematic]` 运行 schematic
比如,你可以运行 `ng g ng-zorro-antd:ng-add` 来测试 `ng-add`
## 发布
原有发布流程不变,但是 `schematics/utils/custom-theme.ts``schematics/utils/lib-versions.ts` 内容为动态生成,不提交到版本管理。

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
<nz-affix [nzOffsetTop]="offsetTop">
<button nz-button nzType="primary" (click)="setOffsetTop()">
<span>Affix top</span>
</button>
</nz-affix>
<br />
<nz-affix [nzOffsetBottom]="nzOffsetBottom" (click)="setOffsetBottom()">
<button nz-button nzType="primary">
<span>Affix bottom</span>
</button>
</nz-affix>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,34 @@
import { Component } from '@angular/core';
import { NzAffixModule } from 'ng-zorro-antd/affix';
import { NzButtonModule } from 'ng-zorro-antd/button';
@Component({
selector: '<%= selector %>',
imports: [NzAffixModule, NzButtonModule],
<% if(inlineTemplate) { %>template: `
<nz-affix [nzOffsetTop]="offsetTop">
<button nz-button nzType="primary" (click)="setOffsetTop()">
<span>Affix top</span>
</button>
</nz-affix>
<br />
<nz-affix [nzOffsetBottom]="nzOffsetBottom" (click)="setOffsetBottom()">
<button nz-button nzType="primary">
<span>Affix bottom</span>
</button>
</nz-affix>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
offsetTop = 10;
nzOffsetBottom = 10;
setOffsetTop(): void {
this.offsetTop += 10;
}
setOffsetBottom(): void {
this.nzOffsetBottom += 10;
}
}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/affix-basic/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/affix-basic/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"basic-affix","title":"NG-ZORRO basic affix","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1,7 @@
<nz-affix [nzOffsetTop]="120" (nzChange)="onChange($event)">
<button nz-button>
<span>120px to affix top</span>
</button>
</nz-affix>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,21 @@
import { Component } from '@angular/core';
import { NzAffixModule } from 'ng-zorro-antd/affix';
import { NzButtonModule } from 'ng-zorro-antd/button';
@Component({
selector: '<%= selector %>',
imports: [NzAffixModule, NzButtonModule],
<% if(inlineTemplate) { %>template: `
<nz-affix [nzOffsetTop]="120" (nzChange)="onChange($event)">
<button nz-button>
<span>120px to affix top</span>
</button>
</nz-affix>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
onChange(status: boolean): void {
console.log(status);
}
}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/affix-on-change/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/affix-on-change/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"on-change-affix","title":"NG-ZORRO on-change affix","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1,12 @@
.scrollable-container {
height: 100px;
overflow-y: scroll;
}
.background {
padding-top: 60px;
height: 300px;
background-image: url(//zos.alipayobjects.com/rmsportal/RmjwQiJorKyobvI.jpg);
}

View File

@@ -0,0 +1,11 @@
<div class="scrollable-container" #target>
<div class="background">
<nz-affix [nzTarget]="target" id="affix-container-target">
<button nz-button [nzType]="'primary'">
<span>Fixed at the top of container</span>
</button>
</nz-affix>
</div>
</div>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,33 @@
import { Component } from '@angular/core';
import { NzAffixModule } from 'ng-zorro-antd/affix';
import { NzButtonModule } from 'ng-zorro-antd/button';
@Component({
selector: '<%= selector %>',
imports: [NzAffixModule, NzButtonModule],
<% if(inlineTemplate) { %>template: `
<div class="scrollable-container" #target>
<div class="background">
<nz-affix [nzTarget]="target" id="affix-container-target">
<button nz-button [nzType]="'primary'">
<span>Fixed at the top of container</span>
</button>
</nz-affix>
</div>
</div>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
<% if(inlineStyle) { %>styles: [`
.scrollable-container {
height: 100px;
overflow-y: scroll;
}
.background {
padding-top: 60px;
height: 300px;
background-image: url(//zos.alipayobjects.com/rmsportal/RmjwQiJorKyobvI.jpg);
}
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component {}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/affix-target/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/affix-target/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"target-affix","title":"NG-ZORRO target affix","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1,44 @@
<nz-alert nzShowIcon nzType="success" nzMessage="Success Text" [nzAction]="actionTemplate1"></nz-alert>
<ng-template #actionTemplate1>
<button nz-button nzSize="small" nzType="text" (click)="doAction('undo')">Undo</button></ng-template
>
<br />
<nz-alert
nzShowIcon
nzType="error"
nzMessage="Error Text"
[nzDescription]="descriptionTemplate1"
[nzAction]="actionTemplate2"
></nz-alert>
<ng-template #descriptionTemplate1>
<p>Error Description Error Description Error Description Error Description</p>
</ng-template>
<ng-template #actionTemplate2>
<button nz-button nzSize="small" nzType="default" nzDanger (click)="doAction('detail')">Detail</button>
</ng-template>
<br />
<nz-alert nzCloseable nzType="warning" nzMessage="Warning Text" [nzAction]="actionTemplate3"></nz-alert>
<ng-template #actionTemplate3>
<button nz-button nzSize="small" nzType="primary" nzGhost (click)="doAction('ignore')">Ignore</button>
</ng-template>
<br />
<nz-alert
nzShowIcon
nzType="info"
nzMessage="Info Text"
[nzDescription]="descriptionTemplate2"
[nzAction]="actionTemplate4"
></nz-alert>
<ng-template #descriptionTemplate2>
<p>Info Description Info Description Info Description Info Description</p>
</ng-template>
<ng-template #actionTemplate4>
<nz-space nzDirection="vertical">
<button *nzSpaceItem nz-button nzSize="small" nzType="primary" (click)="doAction('accept')">Accept</button>
<button *nzSpaceItem nz-button nzSize="small" nzType="default" nzDanger (click)="doAction('decline')"
>Decline</button
>
</nz-space>
</ng-template>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,59 @@
import { Component } from '@angular/core';
import { NzAlertModule } from 'ng-zorro-antd/alert';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzSpaceModule } from 'ng-zorro-antd/space';
@Component({
selector: '<%= selector %>',
imports: [NzAlertModule, NzButtonModule, NzSpaceModule],
<% if(inlineTemplate) { %>template: `
<nz-alert nzShowIcon nzType="success" nzMessage="Success Text" [nzAction]="actionTemplate1"></nz-alert>
<ng-template #actionTemplate1>
<button nz-button nzSize="small" nzType="text" (click)="doAction('undo')">Undo</button></ng-template
>
<br />
<nz-alert
nzShowIcon
nzType="error"
nzMessage="Error Text"
[nzDescription]="descriptionTemplate1"
[nzAction]="actionTemplate2"
></nz-alert>
<ng-template #descriptionTemplate1>
<p>Error Description Error Description Error Description Error Description</p>
</ng-template>
<ng-template #actionTemplate2>
<button nz-button nzSize="small" nzType="default" nzDanger (click)="doAction('detail')">Detail</button>
</ng-template>
<br />
<nz-alert nzCloseable nzType="warning" nzMessage="Warning Text" [nzAction]="actionTemplate3"></nz-alert>
<ng-template #actionTemplate3>
<button nz-button nzSize="small" nzType="primary" nzGhost (click)="doAction('ignore')">Ignore</button>
</ng-template>
<br />
<nz-alert
nzShowIcon
nzType="info"
nzMessage="Info Text"
[nzDescription]="descriptionTemplate2"
[nzAction]="actionTemplate4"
></nz-alert>
<ng-template #descriptionTemplate2>
<p>Info Description Info Description Info Description Info Description</p>
</ng-template>
<ng-template #actionTemplate4>
<nz-space nzDirection="vertical">
<button *nzSpaceItem nz-button nzSize="small" nzType="primary" (click)="doAction('accept')">Accept</button>
<button *nzSpaceItem nz-button nzSize="small" nzType="default" nzDanger (click)="doAction('decline')"
>Decline</button
>
</nz-space>
</ng-template>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
doAction(action: string): void {
console.log(`Do alert's action: ${action}`);
}
}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-action/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-action/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"action-alert","title":"NG-ZORRO action alert","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1,10 @@
<nz-alert nzBanner nzMessage="Warning text"></nz-alert>
<nz-alert
nzBanner
nzMessage="Very long warning text warning text text text text text text text"
nzCloseable
></nz-alert>
<nz-alert nzBanner nzMessage="Warning text without icon" [nzShowIcon]="false"></nz-alert>
<nz-alert nzBanner nzType="error" nzMessage="Error text"></nz-alert>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,24 @@
import { Component } from '@angular/core';
import { NzAlertModule } from 'ng-zorro-antd/alert';
@Component({
selector: '<%= selector %>',
imports: [NzAlertModule],
<% if(inlineTemplate) { %>template: `
<nz-alert nzBanner nzMessage="Warning text"></nz-alert>
<nz-alert
nzBanner
nzMessage="Very long warning text warning text text text text text text text"
nzCloseable
></nz-alert>
<nz-alert nzBanner nzMessage="Warning text without icon" [nzShowIcon]="false"></nz-alert>
<nz-alert nzBanner nzType="error" nzMessage="Error text"></nz-alert>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
<% if(inlineStyle) { %>styles: [`
nz-alert {
margin-bottom: 12px;
}
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component {}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-banner/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-banner/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"banner-alert","title":"NG-ZORRO banner alert","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1 @@
<nz-alert nzType="success" nzMessage="Success Text"></nz-alert>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import { NzAlertModule } from 'ng-zorro-antd/alert';
@Component({
selector: '<%= selector %>',
imports: [NzAlertModule],
<% if(inlineTemplate) { %>template: `<nz-alert nzType="success" nzMessage="Success Text"></nz-alert>`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-basic/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-basic/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"basic-alert","title":"NG-ZORRO basic alert","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1,15 @@
<nz-alert
nzType="warning"
nzCloseable
nzMessage="Warning Text Warning Text Warning Text Warning Text Warning Text Warning Text Warning Text"
(nzOnClose)="afterClose()"
></nz-alert>
<nz-alert
nzType="error"
nzCloseable
nzMessage="Error Text"
nzDescription="Error Description Error Description Error Description Error Description Error Description Error Description"
(nzOnClose)="afterClose()"
></nz-alert>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,33 @@
import { Component } from '@angular/core';
import { NzAlertModule } from 'ng-zorro-antd/alert';
@Component({
selector: '<%= selector %>',
imports: [NzAlertModule],
<% if(inlineTemplate) { %>template: `
<nz-alert
nzType="warning"
nzCloseable
nzMessage="Warning Text Warning Text Warning Text Warning Text Warning Text Warning Text Warning Text"
(nzOnClose)="afterClose()"
></nz-alert>
<nz-alert
nzType="error"
nzCloseable
nzMessage="Error Text"
nzDescription="Error Description Error Description Error Description Error Description Error Description Error Description"
(nzOnClose)="afterClose()"
></nz-alert>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
<% if(inlineStyle) { %>styles: [`
nz-alert {
margin-bottom: 16px;
}
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component {
afterClose(): void {
console.log('close');
}
}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-closable/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-closable/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"closable-alert","title":"NG-ZORRO closable alert","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1 @@
<nz-alert nzType="info" nzMessage="Info Text" nzCloseText="Close Now"></nz-alert>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import { NzAlertModule } from 'ng-zorro-antd/alert';
@Component({
selector: '<%= selector %>',
imports: [NzAlertModule],
<% if(inlineTemplate) { %>template: `<nz-alert nzType="info" nzMessage="Info Text" nzCloseText="Close Now"></nz-alert>`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-close-text/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-close-text/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"close-text-alert","title":"NG-ZORRO close-text alert","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1,13 @@
<nz-alert
nzType="success"
nzMessage="Success Tips"
nzDescription="Detailed description and advices about successful copywriting."
[nzIcon]="customIconTemplate"
nzShowIcon
></nz-alert>
<ng-template #customIconTemplate>
<div> S </div>
</ng-template>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,22 @@
import { Component } from '@angular/core';
import { NzAlertModule } from 'ng-zorro-antd/alert';
@Component({
selector: '<%= selector %>',
imports: [NzAlertModule],
<% if(inlineTemplate) { %>template: `
<nz-alert
nzType="success"
nzMessage="Success Tips"
nzDescription="Detailed description and advices about successful copywriting."
[nzIcon]="customIconTemplate"
nzShowIcon
></nz-alert>
<ng-template #customIconTemplate>
<div> S </div>
</ng-template>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-custom-icon/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-custom-icon/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"custom-icon-alert","title":"NG-ZORRO custom-icon alert","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1,22 @@
<nz-alert
nzType="success"
nzMessage="Success Text"
nzDescription="Success Description Success Description Success Description"
></nz-alert>
<nz-alert
nzType="info"
nzMessage="Info Text"
nzDescription="Info Description Info Description Info Description Info Description"
></nz-alert>
<nz-alert
nzType="warning"
nzMessage="Warning Text"
nzDescription="Warning Description Warning Description Warning Description Warning Description"
></nz-alert>
<nz-alert
nzType="error"
nzMessage="Error Text"
nzDescription="Error Description Error Description Error Description Error Description"
></nz-alert>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,36 @@
import { Component } from '@angular/core';
import { NzAlertModule } from 'ng-zorro-antd/alert';
@Component({
selector: '<%= selector %>',
imports: [NzAlertModule],
<% if(inlineTemplate) { %>template: `
<nz-alert
nzType="success"
nzMessage="Success Text"
nzDescription="Success Description Success Description Success Description"
></nz-alert>
<nz-alert
nzType="info"
nzMessage="Info Text"
nzDescription="Info Description Info Description Info Description Info Description"
></nz-alert>
<nz-alert
nzType="warning"
nzMessage="Warning Text"
nzDescription="Warning Description Warning Description Warning Description Warning Description"
></nz-alert>
<nz-alert
nzType="error"
nzMessage="Error Text"
nzDescription="Error Description Error Description Error Description Error Description"
></nz-alert>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
<% if(inlineStyle) { %>styles: [`
nz-alert {
margin-bottom: 16px;
}
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component {}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-description/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-description/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"description-alert","title":"NG-ZORRO description alert","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}

View File

@@ -0,0 +1,5 @@
nz-alert {
margin-bottom: 16px;
}

View File

@@ -0,0 +1,30 @@
<nz-alert nzType="success" nzMessage="Success Tips" nzShowIcon></nz-alert>
<nz-alert nzType="info" nzMessage="Informational Notes" nzShowIcon></nz-alert>
<nz-alert nzType="warning" nzMessage="Warning" nzShowIcon></nz-alert>
<nz-alert nzType="error" nzMessage="Error" nzShowIcon></nz-alert>
<nz-alert
nzType="success"
nzMessage="Success Tips"
nzDescription="Detailed description and advices about successful copywriting."
nzShowIcon
></nz-alert>
<nz-alert
nzType="info"
nzMessage="Informational Notes"
nzDescription="Additional description and informations about copywriting."
nzShowIcon
></nz-alert>
<nz-alert
nzType="warning"
nzMessage="Warning"
nzDescription="This is a warning notice about copywriting."
nzShowIcon
></nz-alert>
<nz-alert
nzType="error"
nzMessage="Error"
nzDescription="This is an error message about copywriting."
nzShowIcon
></nz-alert>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,44 @@
import { Component } from '@angular/core';
import { NzAlertModule } from 'ng-zorro-antd/alert';
@Component({
selector: '<%= selector %>',
imports: [NzAlertModule],
<% if(inlineTemplate) { %>template: `
<nz-alert nzType="success" nzMessage="Success Tips" nzShowIcon></nz-alert>
<nz-alert nzType="info" nzMessage="Informational Notes" nzShowIcon></nz-alert>
<nz-alert nzType="warning" nzMessage="Warning" nzShowIcon></nz-alert>
<nz-alert nzType="error" nzMessage="Error" nzShowIcon></nz-alert>
<nz-alert
nzType="success"
nzMessage="Success Tips"
nzDescription="Detailed description and advices about successful copywriting."
nzShowIcon
></nz-alert>
<nz-alert
nzType="info"
nzMessage="Informational Notes"
nzDescription="Additional description and informations about copywriting."
nzShowIcon
></nz-alert>
<nz-alert
nzType="warning"
nzMessage="Warning"
nzDescription="This is a warning notice about copywriting."
nzShowIcon
></nz-alert>
<nz-alert
nzType="error"
nzMessage="Error"
nzDescription="This is an error message about copywriting."
nzShowIcon
></nz-alert>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
<% if(inlineStyle) { %>styles: [`
nz-alert {
margin-bottom: 16px;
}
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component {}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-icon/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/alert-icon/schema.ts"],"names":[],"mappings":""}

Some files were not shown because too many files have changed in this diff Show More