diff --git a/.travis.yml b/.travis.yml index 6a101c812..6406e44bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ jobs: - env: "MODE=site" - env: "DEPLOY_MODE=build" - env: "DEPLOY_MODE=build_artifacts" + if: branch = master matrix: allow_failures: - env: "DEPLOY_MODE=build_artifacts" diff --git a/angular.json b/angular.json index 605a72cb8..98a6cea7d 100644 --- a/angular.json +++ b/angular.json @@ -16,7 +16,9 @@ "main": "src/main.ts", "tsConfig": "src/tsconfig.json", "polyfills": "src/polyfills.ts", - "assets": ["src/assets"], + "assets": [ + "src/assets" + ], "styles": [ "node_modules/ngx-simplemde/src/index.css", "src/styles.less" @@ -28,7 +30,10 @@ "node_modules/@antv/data-set/dist/data-set.min.js", "node_modules/@antv/g2-plugin-slider/dist/g2-plugin-slider.min.js", "node_modules/ajv/dist/ajv.bundle.js", - "node_modules/qrious/dist/qrious.min.js" + "node_modules/qrious/dist/qrious.min.js", + "node_modules/ace-builds/src-min/ace.js", + "node_modules/ace-builds/src-min/theme-github.js", + "node_modules/ace-builds/src-min/mode-json.js" ] }, "configurations": { diff --git a/package.json b/package.json index 1c8bb7617..754719ad0 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "file-saver": "^1.3.8", "marked": "^0.3.19", "ng-github-button": "^1.0.0", - "ng-zorro-antd": "^1.6.0", + "ng-zorro-antd": "^1.7.0", "ng2-ace-editor": "^0.3.8", "ngx-color": "^1.3.1", "ngx-countdown": "^3.0.0", diff --git a/packages/abc/edit/edit.component.html b/packages/abc/edit/edit.component.html index 5a563c73e..7266f4de5 100644 --- a/packages/abc/edit/edit.component.html +++ b/packages/abc/edit/edit.component.html @@ -5,7 +5,7 @@ {{ optional }} - + diff --git a/packages/abc/error-collect/error-collect.component.ts b/packages/abc/error-collect/error-collect.component.ts index 34d411715..ad7387265 100644 --- a/packages/abc/error-collect/error-collect.component.ts +++ b/packages/abc/error-collect/error-collect.component.ts @@ -22,7 +22,7 @@ import { ErrorCollectConfig } from './error-collect.config'; @Component({ selector: 'error-collect, [error-collect]', template: ` - + {{count}}`, host: { '[class.error-collect]': 'true' }, changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/packages/abc/global-footer/demo/basic.md b/packages/abc/global-footer/demo/basic.md index 9709c3087..89ee1c5b6 100644 --- a/packages/abc/global-footer/demo/basic.md +++ b/packages/abc/global-footer/demo/basic.md @@ -15,7 +15,7 @@ import { Component } from '@angular/core';
- Copyright 2018卡色出品 + Copyright2018卡色出品
`, diff --git a/packages/abc/global-footer/demo/custom.md b/packages/abc/global-footer/demo/custom.md index bca202e77..dd22f7908 100644 --- a/packages/abc/global-footer/demo/custom.md +++ b/packages/abc/global-footer/demo/custom.md @@ -17,10 +17,10 @@ import { Component } from '@angular/core'; 帮助 - + 预览 - Copyright 2018卡色出品 + Copyright2018卡色出品 `, diff --git a/packages/abc/notice-icon/notice-icon.component.ts b/packages/abc/notice-icon/notice-icon.component.ts index 1b9a2cce6..1d00a51b2 100644 --- a/packages/abc/notice-icon/notice-icon.component.ts +++ b/packages/abc/notice-icon/notice-icon.component.ts @@ -15,7 +15,7 @@ import { NoticeItem, NoticeIconSelect } from './notice-icon.types'; selector: 'notice-icon', template: ` - +
- +
diff --git a/packages/abc/page-header/demo/standard.md b/packages/abc/page-header/demo/standard.md index baac503ee..2d397d1cf 100644 --- a/packages/abc/page-header/demo/standard.md +++ b/packages/abc/page-header/demo/standard.md @@ -25,19 +25,19 @@ import { Component } from '@angular/core'; - - - - - - -
    -
  • 选项一
  • -
  • 选项二
  • -
  • 选项三
  • -
-
- + + + + + + +
    +
  • 选项一
  • +
  • 选项二
  • +
  • 选项三
  • +
+
+
diff --git a/packages/abc/qr/demo/design.md b/packages/abc/qr/demo/design.md index ee17973c0..c9a3111fb 100644 --- a/packages/abc/qr/demo/design.md +++ b/packages/abc/qr/demo/design.md @@ -102,9 +102,9 @@ import { Component } from '@angular/core'; }) export class DemoComponent { value = 'https://ng-alain.com/'; - background = 'white'; + background = '#fff'; backgroundAlpha = 1.0; - foreground = 'black'; + foreground = '#000'; foregroundAlpha = 1.0; level = 'L'; mime = 'image/png'; diff --git a/packages/abc/quick-menu/index.md b/packages/abc/quick-menu/index.md index 0de064342..379ee0926 100644 --- a/packages/abc/quick-menu/index.md +++ b/packages/abc/quick-menu/index.md @@ -12,7 +12,7 @@ module: QuickMenuModule 参数 | 说明 | 类型 | 默认值 ----|------|-----|------ -`[icon]` | 图标 | `string` | `anticon anticon-question-circle-o` +`[icon]` | 图标 | `string | TemplateRef` | `question-circle` `[top]` | 距离顶部 | `number` | `120` `[width]` | 打开后宽度 | `number` | `200` `[bgColor]` | 背景 | `string` | `#fff` diff --git a/packages/abc/quick-menu/quick-menu.component.html b/packages/abc/quick-menu/quick-menu.component.html new file mode 100644 index 000000000..fe3a87e0e --- /dev/null +++ b/packages/abc/quick-menu/quick-menu.component.html @@ -0,0 +1,10 @@ +
+
+
+ + + +
+
+ +
diff --git a/packages/abc/quick-menu/quick-menu.component.ts b/packages/abc/quick-menu/quick-menu.component.ts index a795a196c..74f956468 100644 --- a/packages/abc/quick-menu/quick-menu.component.ts +++ b/packages/abc/quick-menu/quick-menu.component.ts @@ -8,20 +8,14 @@ import { ChangeDetectorRef, Renderer2, ElementRef, + TemplateRef, } from '@angular/core'; import { InputNumber } from '@delon/util'; @Component({ selector: 'quick-menu', - template: ` -
-
- -
- -
- `, + templateUrl: './quick-menu.component.html', host: { '[class.quick-menu]': 'true' }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, @@ -29,11 +23,17 @@ import { InputNumber } from '@delon/util'; export class QuickMenuComponent implements OnInit, OnChanges { // #region fields + _icon = 'question-circle'; + _iconTpl: TemplateRef; @Input() - icon: - | string - | string[] - | { [key: string]: string } = 'anticon anticon-question-circle-o'; + set icon(value: string | TemplateRef) { + if (value instanceof TemplateRef) { + this._icon = null; + this._iconTpl = value; + } else { + this._icon = value; + } + } @Input() @InputNumber() top = 120; diff --git a/packages/abc/quick-menu/quick-menu.module.ts b/packages/abc/quick-menu/quick-menu.module.ts index b67b5fe7e..b2105fdd0 100644 --- a/packages/abc/quick-menu/quick-menu.module.ts +++ b/packages/abc/quick-menu/quick-menu.module.ts @@ -1,5 +1,6 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgZorroAntdModule } from 'ng-zorro-antd'; import { DelonUtilModule } from '@delon/util'; import { QuickMenuComponent } from './quick-menu.component'; @@ -7,7 +8,7 @@ import { QuickMenuComponent } from './quick-menu.component'; const COMPONENTS = [QuickMenuComponent]; @NgModule({ - imports: [CommonModule, DelonUtilModule], + imports: [CommonModule, NgZorroAntdModule, DelonUtilModule], declarations: [...COMPONENTS], exports: [...COMPONENTS], }) diff --git a/packages/abc/result/demo/classic.md b/packages/abc/result/demo/classic.md index 8f2366583..8d3c96f1d 100644 --- a/packages/abc/result/demo/classic.md +++ b/packages/abc/result/demo/classic.md @@ -37,7 +37,7 @@ import { NzMessageService } from 'ng-zorro-antd';
- 曲丽丽 + 曲丽丽
2016-12-12 12:32
@@ -47,7 +47,7 @@ import { NzMessageService } from 'ng-zorro-antd';
- 周毛毛 + 周毛毛
催一下 diff --git a/packages/abc/result/demo/fail.md b/packages/abc/result/demo/fail.md index 85353f3af..63918b400 100644 --- a/packages/abc/result/demo/fail.md +++ b/packages/abc/result/demo/fail.md @@ -19,12 +19,12 @@ import { Component } from '@angular/core';
您提交的内容有如下错误:
- 您的账户已被冻结 - 立即解冻 + 您的账户已被冻结 + 立即解冻
- 您的账户还不具备申请资格 - 立即升级 + 您的账户还不具备申请资格 + 立即升级
diff --git a/packages/abc/result/result.component.ts b/packages/abc/result/result.component.ts index 61f11ee9b..8762166a3 100644 --- a/packages/abc/result/result.component.ts +++ b/packages/abc/result/result.component.ts @@ -3,7 +3,7 @@ import { Component, Input, TemplateRef } from '@angular/core'; @Component({ selector: 'result', template: ` -
+
{{_title}}
{{_description}}
diff --git a/packages/abc/result/result.module.ts b/packages/abc/result/result.module.ts index 10f48a08c..c1ec4b5db 100644 --- a/packages/abc/result/result.module.ts +++ b/packages/abc/result/result.module.ts @@ -1,12 +1,13 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgZorroAntdModule } from 'ng-zorro-antd'; import { ResultComponent } from './result.component'; const COMPONENTS = [ResultComponent]; @NgModule({ - imports: [CommonModule], + imports: [CommonModule, NgZorroAntdModule], declarations: [...COMPONENTS], exports: [...COMPONENTS], }) diff --git a/packages/abc/result/result.spec.ts b/packages/abc/result/result.spec.ts index c594702f1..30ad17a2d 100644 --- a/packages/abc/result/result.spec.ts +++ b/packages/abc/result/result.spec.ts @@ -6,88 +6,90 @@ import { ResultModule } from './result.module'; import { ResultComponent } from './result.component'; describe('abc: result', () => { - let fixture: ComponentFixture; - let dl: DebugElement; - let context: TestComponent; + let fixture: ComponentFixture; + let dl: DebugElement; + let context: TestComponent; - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ ResultModule.forRoot() ], - declarations: [ TestComponent ] - }); - fixture = TestBed.createComponent(TestComponent); - dl = fixture.debugElement; - context = fixture.componentInstance; - fixture.detectChanges(); + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [ResultModule.forRoot()], + declarations: [TestComponent], }); + fixture = TestBed.createComponent(TestComponent); + dl = fixture.debugElement; + context = fixture.componentInstance; + fixture.detectChanges(); + }); - function isText(cls: string, value: any) { - const el = dl.query(By.css(cls)).nativeElement as HTMLElement; - if (el) return el.innerText.trim(); - return ''; - } + function isText(cls: string, value: any) { + const el = dl.query(By.css(cls)).nativeElement as HTMLElement; + if (el) return el.innerText.trim(); + return ''; + } - function isExists(cls: string, stauts: boolean = true) { - if (stauts) - expect(dl.query(By.css(cls))).not.toBeNull(); - else - expect(dl.query(By.css(cls))).toBeNull(); + function isExists(cls: string, stauts: boolean = true) { + const res = dl.query(By.css(cls)); + if (stauts) { + expect(res).not.toBeNull(); + } else { + expect(res).toBeNull(); } + } - describe('#type', () => { - it('width success', () => { - context.type = 'success'; - fixture.detectChanges(); - isExists('.anticon-check-circle'); - }); - it('width error', () => { - context.type = 'error'; - fixture.detectChanges(); - isExists('.anticon-close-circle'); - }); - it('width custom', () => { - context.type = 'custom'; - fixture.detectChanges(); - isExists('.anticon-custom'); - }); + describe('#type', () => { + it('width success', () => { + context.type = 'success'; + fixture.detectChanges(); + isExists('.anticon-check-circle'); + }); + it('width error', () => { + context.type = 'error'; + fixture.detectChanges(); + isExists('.anticon-close-circle'); + }); + it('width custom', () => { + context.type = 'custom'; + fixture.detectChanges(); + isExists('.anticon-custom'); }); + }); - describe('#title', () => { - it('with string', () => { - isText('.result__title', context.title); - }); - it('with template', () => { - context.title = context.titleTpl; - fixture.detectChanges(); - isExists('#titleTpl'); - }); + describe('#title', () => { + it('with string', () => { + isText('.result__title', context.title); }); + it('with template', () => { + context.title = context.titleTpl; + fixture.detectChanges(); + isExists('#titleTpl'); + }); + }); - describe('#description', () => { - it('with string', () => { - isText('.result__desc', context.description); - }); - it('with template', () => { - context.description = context.descriptionTpl; - fixture.detectChanges(); - isExists('#descriptionTpl'); - }); + describe('#description', () => { + it('with string', () => { + isText('.result__desc', context.description); + }); + it('with template', () => { + context.description = context.descriptionTpl; + fixture.detectChanges(); + isExists('#descriptionTpl'); }); + }); - describe('#extra', () => { - it('with string', () => { - isText('.result__extra', context.extra); - }); - it('with template', () => { - context.extra = context.extraTpl; - fixture.detectChanges(); - isExists('#extraTpl'); - }); + describe('#extra', () => { + it('with string', () => { + isText('.result__extra', context.extra); + }); + it('with template', () => { + context.extra = context.extraTpl; + fixture.detectChanges(); + isExists('#extraTpl'); }); + }); }); @Component({ - template: ` + template: ` {

titleTpl

descriptionTpl

extraTpl

- ` + `, }) class TestComponent { - @ViewChild('comp') comp: ResultComponent; - type = 'custom'; - @ViewChild('titleTpl') titleTpl: TemplateRef; - @ViewChild('descriptionTpl') descriptionTpl: TemplateRef; - @ViewChild('extraTpl') extraTpl: TemplateRef; - title: string | TemplateRef = 'title'; - description: string | TemplateRef = 'description'; - extra: string | TemplateRef = 'extra'; + @ViewChild('comp') + comp: ResultComponent; + type = 'custom'; + @ViewChild('titleTpl') + titleTpl: TemplateRef; + @ViewChild('descriptionTpl') + descriptionTpl: TemplateRef; + @ViewChild('extraTpl') + extraTpl: TemplateRef; + title: string | TemplateRef = 'title'; + description: string | TemplateRef = 'description'; + extra: string | TemplateRef = 'extra'; } diff --git a/packages/abc/reuse-tab/reuse-tab.component.html b/packages/abc/reuse-tab/reuse-tab.component.html index c93b947f9..e1564af1f 100644 --- a/packages/abc/reuse-tab/reuse-tab.component.html +++ b/packages/abc/reuse-tab/reuse-tab.component.html @@ -2,7 +2,7 @@ {{i.title}} - + diff --git a/packages/abc/reuse-tab/reuse-tab.component.spec.ts b/packages/abc/reuse-tab/reuse-tab.component.spec.ts index 3ecff7696..e469c2be6 100644 --- a/packages/abc/reuse-tab/reuse-tab.component.spec.ts +++ b/packages/abc/reuse-tab/reuse-tab.component.spec.ts @@ -280,17 +280,17 @@ describe('abc: reuse-tab', () => { layoutComp.allowClose = true; fixture.detectChanges(); page.to('#b'); - expect(dl.queryAll(By.css('.op')).length).toBe(2); + expect(dl.queryAll(By.css('.reuse-tab__op')).length).toBe(2); page.to('#c'); - expect(dl.queryAll(By.css('.op')).length).toBe(3); + expect(dl.queryAll(By.css('.reuse-tab__op')).length).toBe(3); })); it('with false', fakeAsync(() => { layoutComp.allowClose = false; fixture.detectChanges(); page.to('#b'); - expect(dl.queryAll(By.css('.op')).length).toBe(0); + expect(dl.queryAll(By.css('.reuse-tab__op')).length).toBe(0); page.to('#c'); - expect(dl.queryAll(By.css('.op')).length).toBe(0); + expect(dl.queryAll(By.css('.reuse-tab__op')).length).toBe(0); })); }); }); diff --git a/packages/abc/reuse-tab/style/index.less b/packages/abc/reuse-tab/style/index.less index ac70a4f13..a30b86cab 100644 --- a/packages/abc/reuse-tab/style/index.less +++ b/packages/abc/reuse-tab/style/index.less @@ -23,7 +23,7 @@ display: inline-block; padding: 8px 20px; } - .op { + @{reuse-tab-prefix}__op { display: none; position: absolute; top: 14px; @@ -32,7 +32,7 @@ font-size: 12px; } &:hover { - .op { + @{reuse-tab-prefix}__op { display: block; } } diff --git a/packages/abc/sidebar-nav/sidebar-nav.component.html b/packages/abc/sidebar-nav/sidebar-nav.component.html index b027e433b..38caa7771 100644 --- a/packages/abc/sidebar-nav/sidebar-nav.component.html +++ b/packages/abc/sidebar-nav/sidebar-nav.component.html @@ -1,86 +1,94 @@ + + + + + + + @@ -49,7 +49,7 @@
  • - +
    diff --git a/packages/schematics/ng-update/test-cases/v2/MOCK_LAYOUT.ts b/packages/schematics/ng-update/test-cases/v2/MOCK_LAYOUT.ts index c67f20f43..9825d5442 100644 --- a/packages/schematics/ng-update/test-cases/v2/MOCK_LAYOUT.ts +++ b/packages/schematics/ng-update/test-cases/v2/MOCK_LAYOUT.ts @@ -97,25 +97,25 @@ export class LayoutDefaultComponent {
  • - +
  • - +
  • - +
  • @@ -137,7 +137,7 @@ export class LayoutDefaultComponent {