Skip to content

Commit 1c17f09

Browse files
chore(release): release 11.4.0 (#125)
Co-authored-by: huaweidevcloud <[email protected]>
1 parent cc77ca4 commit 1c17f09

File tree

358 files changed

+7533
-1320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

358 files changed

+7533
-1320
lines changed

angular.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"assets": [
3232
"src/favicon.ico",
3333
"src/assets",
34-
"src/assets/i18n"
34+
"src/assets/i18n",
35+
"src/assets/overview/**/*"
3536
],
3637
"styles": [
3738
"node_modules/highlight.js/styles/an-old-hope.css",

devui-commons/src/sidebar/sidebar.component.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
</li>
1515
</ul>
1616
<nav class="sidebar-nav">
17-
<d-accordion [data]="componentsDataDisplay" [linkType]="linkType"></d-accordion>
17+
<d-accordion [data]="componentsDataDisplay" [linkType]="linkType" [itemTemplate]="itemtemplate"></d-accordion>
18+
19+
<ng-template #itemtemplate let-item="item">
20+
{{ item.title }}
21+
<d-tag *ngIf="item.newChange" [tag]="text.new" [labelStyle]="'orange-w98'"></d-tag>
22+
<d-tag *ngIf="item.sunset" [tag]="text.sunset" [labelStyle]="'yellow-w98'"></d-tag>
23+
</ng-template>
1824
</nav>
1925
</div>

devui-commons/src/sidebar/sidebar.component.scss

+8
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,12 @@
7474

7575
d-accordion ::ng-deep .devui-accordion-menu {
7676
box-shadow: none !important;
77+
}
78+
79+
d-tag {
80+
text-indent: 0;
81+
82+
& + d-tag {
83+
margin-left: 4px;
84+
}
7785
}

devui-commons/src/sidebar/sidebar.component.ts

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import { DevuiCommonsService } from '../devui-commons.service';
1010
export class SidebarComponent implements OnInit {
1111
@Input() sideMenuList;
1212
@Input() linkType = 'routerLink';
13+
@Input() text = {
14+
new: 'New',
15+
sunset: 'Sunset'
16+
};
1317
_navData;
1418
componentsDataDisplay;
1519

devui/alert/alert.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</g>
1818
</svg>
1919
</button>
20-
<span class="devui-alert-icon" *ngIf="showIcon !== false">
20+
<span class="devui-alert-icon" *ngIf="showIcon !== false && type !== 'simple'">
2121
<svg
2222
width="16px"
2323
height="16px"

devui/alert/alert.component.scss

+11
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@
8282
}
8383
}
8484

85+
&.devui-alert-simple {
86+
border-color: $devui-line;
87+
color: $devui-text;
88+
89+
button.devui-close {
90+
& > svg path {
91+
fill: $devui-text-weak;
92+
}
93+
}
94+
}
95+
8596
svg.devui-icon {
8697
width: 16px;
8798
height: 16px;

devui/alert/alert.types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type AlertType = 'success' | 'danger' | 'warning' | 'info';
1+
export type AlertType = 'success' | 'danger' | 'warning' | 'info' | 'simple';

devui/alert/demo/basic/basic.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
<d-alert [type]="'danger'" [closeable]="false"> danger </d-alert>
33
<d-alert [type]="'warning'" [closeable]="false"> warning </d-alert>
44
<d-alert [type]="'info'" [closeable]="false"> info </d-alert>
5+
<d-alert [type]="'simple'" [closeable]="false"> simple </d-alert>

devui/alert/demo/close/close.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
<d-alert [type]="'danger'" (closeEvent)="handleClose($event)"> danger </d-alert>
33
<d-alert [type]="'warning'" (closeEvent)="handleClose($event)"> warning </d-alert>
44
<d-alert [type]="'info'" (closeEvent)="handleClose($event)"> info </d-alert>
5+
<d-alert [type]="'simple'" (closeEvent)="handleClose($event)"> simple </d-alert>

devui/alert/demo/withoutIcon/withoutIcon.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
<d-alert [type]="'danger'" [showIcon]="false"> danger</d-alert>
33
<d-alert [type]="'warning'" [showIcon]="false"> warning</d-alert>
44
<d-alert [type]="'info'" [showIcon]="false"> info</d-alert>
5+
<d-alert [type]="'simple'" [showIcon]="false"> simple</d-alert>

devui/alert/doc/api-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ import { AlertModule } from 'ng-devui/alert';
3434
默认值为'info', 指定alert警告提示的类型
3535

3636
```ts
37-
export type AlertType = 'success' | 'danger' | 'warning' | 'info';
37+
export type AlertType = 'success' | 'danger' | 'warning' | 'info' | 'simple';
3838
```

devui/alert/doc/api-en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ In the page:
3434
The default value is 'info', which specifies the type of alert warning.
3535

3636
```ts
37-
export type AlertType = 'success' | 'danger' | 'warning' | 'info';
37+
export type AlertType = 'success' | 'danger' | 'warning' | 'info' | 'simple';
3838
```

devui/anchor/anchor-link.directive.ts

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export class AnchorLinkDirective implements OnInit, OnDestroy {
6666

6767
@HostListener('click')
6868
scrollToAnchor(activeChangeBy?: AnchorActiveChangeSource) {
69+
if (typeof document === 'undefined') {
70+
return;
71+
}
6972
if (!this.anchorBlock) {
7073
return;
7174
}

devui/anchor/anchor.directive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class AnchorDirective implements AfterViewInit, OnDestroy {
122122
if (this.scrollListenTarget) {
123123
return;
124124
}
125-
if (this.boxElement) {
125+
if (this.boxElement && typeof window !== 'undefined') {
126126
this.scrollListenTarget = this.boxElement.scrollTarget || window; // window有scroll事件,document.documentElement没有scroll事件
127127
}
128128
this.scrollListenTarget.addEventListener('scroll', this.throttle, { passive: true });

devui/anchor/demo/async/async.component.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
</div>
2121
<div class="mycontent" *ngIf="loadContent">
2222
<div [dAnchor]="'base-info'" class="section-block">
23-
<h3>Basic Infomation</h3>
23+
<h3 class="devui-h3-title">Basic Infomation</h3>
2424
Show basic infomation here.
2525
</div>
2626
<div [dAnchor]="'issue-list'" class="section-block">
27-
<h3>Demand List</h3>
27+
<h3 class="devui-h3-title">Demand List</h3>
2828
Show demand list here.
2929
</div>
3030
<div [dAnchor]="'case-list'" class="section-block">
31-
<h3>Case List</h3>
31+
<h3 class="devui-h3-title">Case List</h3>
3232
Show case list here.
3333
</div>
3434
<div [dAnchor]="'quarlity-result'" class="section-block">
35-
<h3>Quality Assessment</h3>
35+
<h3 class="devui-h3-title">Quality Assessment</h3>
3636
Show quality assessment here.
3737
</div>
3838
</div>

devui/anchor/demo/basic/basic.component.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
</div>
1313
<div class="mycontent">
1414
<div [dAnchor]="'base-info'" class="section-block">
15-
<h3>Basic Infomation</h3>
15+
<h3 class="devui-h3-title">Basic Infomation</h3>
1616
Show basic infomation here.
1717
</div>
1818
<div [dAnchor]="'issue-list'" class="section-block">
19-
<h3>Demand List</h3>
19+
<h3 class="devui-h3-title">Demand List</h3>
2020
Show demand list here.
2121
</div>
2222
<div [dAnchor]="'case-list'" class="section-block">
23-
<h3>Case List</h3>
23+
<h3 class="devui-h3-title">Case List</h3>
2424
Show case list here.
2525
</div>
2626
<div [dAnchor]="'quarlity-result'" class="section-block">
27-
<h3>Quality Assessment</h3>
27+
<h3 class="devui-h3-title">Quality Assessment</h3>
2828
Show quality assessment here.
2929
</div>
3030
</div>

devui/anchor/demo/hash/hash.component.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
</div>
2121
<div class="mycontent">
2222
<div [dAnchor]="'base-info'" class="section-block">
23-
<h3>Basic Infomation</h3>
23+
<h3 class="devui-h3-title">Basic Infomation</h3>
2424
Show basic infomation here.
2525
</div>
2626
<div [dAnchor]="'issue-list'" class="section-block">
27-
<h3>Demand List</h3>
27+
<h3 class="devui-h3-title">Demand List</h3>
2828
Show demand list here.
2929
</div>
3030
<div [dAnchor]="'case-list'" class="section-block">
31-
<h3>Case List</h3>
31+
<h3 class="devui-h3-title">Case List</h3>
3232
Show case list here.
3333
</div>
3434
<div [dAnchor]="'quality-result'" class="section-block" id="quality_result">
35-
<h3>Quality Assessment</h3>
35+
<h3 class="devui-h3-title">Quality Assessment</h3>
3636
Show quality assessment here.
3737
</div>
3838
</div>

devui/anchor/demo/scroll-target/scroll-target.component.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
</div>
2020
<div class="mycontent">
2121
<div [dAnchor]="'base-info'" class="section-block">
22-
<h3>Basic Infomation</h3>
22+
<h3 class="devui-h3-title">Basic Infomation</h3>
2323
Show basic infomation here.
2424
</div>
2525
<div [dAnchor]="'issue-list'" class="section-block">
26-
<h3>Demand List</h3>
26+
<h3 class="devui-h3-title">Demand List</h3>
2727
Show demand list here.
2828
</div>
2929
<div [dAnchor]="'case-list'" class="section-block">
30-
<h3>Case List</h3>
30+
<h3 class="devui-h3-title">Case List</h3>
3131
Show case list here.
3232
</div>
3333
<div [dAnchor]="'quality-result'" class="section-block">
34-
<h3>Quality Assessment</h3>
34+
<h3 class="devui-h3-title">Quality Assessment</h3>
3535
Show quality assessment here.
3636
</div>
3737
</div>

devui/back-top/back-top.component.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { DOCUMENT } from '@angular/common';
12
import {
23
ChangeDetectionStrategy, ChangeDetectorRef, Component,
3-
ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, TemplateRef
4+
ElementRef, EventEmitter, Inject, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, TemplateRef
45
} from '@angular/core';
56
import { fromEvent, Subscription } from 'rxjs';
67
import { debounceTime } from 'rxjs/operators';
@@ -25,7 +26,10 @@ export class BackTopComponent implements OnInit, OnChanges, OnDestroy {
2526
SCROLL_REFRESH_INTERVAL = 100;
2627
target: HTMLElement | Window;
2728
subs: Subscription = new Subscription();
28-
constructor(private cdr: ChangeDetectorRef, private el: ElementRef) {}
29+
document: Document;
30+
constructor(private cdr: ChangeDetectorRef, private el: ElementRef, @Inject(DOCUMENT) private doc: any) {
31+
this.document = this.doc;
32+
}
2933

3034
ngOnInit() {
3135
this.addScrollEvent();
@@ -64,16 +68,16 @@ export class BackTopComponent implements OnInit, OnChanges, OnDestroy {
6468

6569
showButton() {
6670
this.currScrollTop = this.target === window ?
67-
(window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop) : this.scrollTarget.scrollTop;
71+
(window.pageYOffset || this.document.documentElement.scrollTop || this.document.body.scrollTop) : this.scrollTarget.scrollTop;
6872
if (this.isVisible !== (this.currScrollTop >= this.visibleHeight)) {
6973
this.isVisible = !this.isVisible;
7074
}
7175
}
7276

7377
goTop() {
7478
if (this.target === window) {
75-
document.documentElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' });
76-
document.body.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' });
79+
this.document.documentElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' });
80+
this.document.body.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' });
7781
} else {
7882
this.scrollTarget.style.scrollBehavior = 'smooth';
7983
this.scrollTarget.scrollTop = 0;

devui/back-top/demo/scroll-container/scroll-container.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { DOCUMENT } from '@angular/common';
2+
import { Component, Inject, OnInit } from '@angular/core';
23

34
@Component({
45
selector: 'd-back-top-scroll-container',
@@ -10,13 +11,13 @@ export class ScrollContainerComponent implements OnInit {
1011
scrollElement;
1112
list = [];
1213
sentence = 'You know some birds are not meant to be caged, their feathers are just too bright.';
13-
constructor() {}
14+
constructor(@Inject(DOCUMENT) private doc: any) {}
1415

1516
ngOnInit() {
1617
for (let i = 0; i < 20; i++) {
1718
this.list.push(this.sentence);
1819
}
19-
this.scrollElement = document.querySelector('.devui-scroll-content');
20+
this.scrollElement = this.doc.querySelector('.devui-scroll-content');
2021
}
2122

2223
backTop(event) {

devui/button/button.component.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ $devui-btn-pseudo-config: (
265265
&.devui-btn-danger {
266266
border-color: $devui-danger;
267267
color: $devui-danger;
268-
background-color: $devui-block;
268+
background-color: $devui-danger;
269269
}
270270
}
271271

devui/button/button.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Input,
1010
Output,
1111
TemplateRef,
12-
ViewChild,
12+
ViewChild
1313
} from '@angular/core';
1414
export type IButtonType = 'button' | 'submit' | 'reset';
1515
export type IButtonStyle = 'common' | 'primary' | 'text' | 'text-dark' | 'danger';
@@ -47,7 +47,8 @@ export class ButtonComponent implements AfterContentChecked {
4747
}
4848
}
4949

50-
constructor(private cd: ChangeDetectorRef) {}
50+
constructor(private cd: ChangeDetectorRef) {
51+
}
5152

5253
// 新增click事件,解决直接在host上使用click,在disabled状态下还能触发事件
5354
onClick(event) {
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<d-button bsStyle="primary" bordered="true" [autofocus]="true" style="margin-right: 4px"> Confirm </d-button>
1+
<d-button bsStyle="primary" bordered="true" [autofocus]="true" style="margin-right: 8px"> Confirm </d-button>
22
<d-button bsStyle="common"> Cancel </d-button>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
d-button:not(:last-child) {
2-
margin-right: 4px;
2+
margin-right: 8px;
33
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<d-button bsStyle="common" style="margin-right: 4px">Common</d-button> <d-button bsStyle="common" [disabled]="true">Disabled</d-button>
1+
<d-button bsStyle="common" style="margin-right: 8px">Common</d-button> <d-button bsStyle="common" [disabled]="true">Disabled</d-button>

devui/button/demo/groups/groups.component.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</d-button-group>
77
<d-button-group size="sm">
88
<d-button bsStyle="primary">Left</d-button>
9-
<d-button bsStyle="primary">Middle</d-button>
10-
<d-button bsStyle="primary">Right</d-button>
9+
<d-button bsStyle="common">Middle</d-button>
10+
<d-button bsStyle="common">Right</d-button>
1111
</d-button-group>
1212
<d-button-group>
1313
<d-button bsStyle="primary" icon="icon-filter">Filter</d-button>
@@ -21,7 +21,7 @@
2121
<div class="btn-group">
2222
<d-button-group size="">
2323
<d-button bsStyle="primary" icon="icon-add">New</d-button>
24-
<d-button bsStyle="primary">Delete</d-button>
24+
<d-button bsStyle="common">Delete</d-button>
2525
<div dDropDown [closeScope]="'blank'">
2626
<d-button bsStyle="common" dDropDownToggle class="devui-dropdown-origin border-remove">
2727
Click me

devui/button/demo/icon/icon.component.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66

77
.btn-group d-button {
8-
margin-right: 4px;
8+
margin-right: 8px;
99
}
1010

1111
.icon-chevron-down {
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<d-button bsStyle="primary" bsPosition="left">Left</d-button>
2-
<d-button bsStyle="primary" bsPosition="right">Right</d-button>
2+
<d-button bsStyle="common" bsPosition="right">Right</d-button>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<d-button id="primaryBtn" style="margin-right: 4px">Primary</d-button>
1+
<d-button id="primaryBtn" style="margin-right: 8px">Primary</d-button>
22
<d-button [disabled]="true">Disabled</d-button>
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<d-button bsStyle="common" bsSize="xs" style="margin-right: 4px"> Extra small</d-button>
2-
<d-button bsStyle="common" bsSize="sm" style="margin-right: 4px"> Small </d-button>
3-
<d-button bsStyle="common" style="margin-right: 4px"> Middle </d-button>
1+
<d-button bsStyle="primary" bsSize="xs" style="margin-right: 8px"> Extra small</d-button>
2+
<d-button bsStyle="common" bsSize="sm" style="margin-right: 8px"> Small </d-button>
3+
<d-button bsStyle="common" style="margin-right: 8px"> Middle </d-button>
44
<d-button bsStyle="common" bsSize="lg"> Large </d-button>

devui/card/demo/basic/basic.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<d-card style="width: 350px">
1+
<d-card class="card-container">
22
<d-card-header>
33
<d-avatar dCardAvatar [name]="'DevUI'"></d-avatar>
44
<d-card-title>DEVUI Course</d-card-title>

devui/card/demo/basic/basic.component.scss

+10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@
1616
}
1717

1818
d-card {
19+
cursor: pointer;
20+
transition:
21+
box-shadow $devui-animation-duration-slow $devui-animation-ease-in-smooth,
22+
transform $devui-animation-duration-slow $devui-animation-ease-in-smooth;
23+
1924
&:hover {
2025
box-shadow: $devui-shadow-length-hover $devui-light-shadow;
26+
transform: translateY(-5px);
2127
}
2228
}
29+
30+
.card-container {
31+
width: 350px;
32+
}

0 commit comments

Comments
 (0)