Skip to content

Commit 00a022b

Browse files
chore(release): release 9.1.0 (#55)
Co-authored-by: huaweidevcloud <[email protected]>
1 parent 7dfd431 commit 00a022b

File tree

363 files changed

+11229
-2123
lines changed

Some content is hidden

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

363 files changed

+11229
-2123
lines changed

devui/accordion/AccordionBaseComponent.ts

-25
This file was deleted.
+8-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
<d-accordion-list class="devui-accordion-menu devui-scrollbar" [data]="data" [deepth]="0" [parent]="null"> </d-accordion-list>
1+
<d-accordion-list
2+
class="devui-accordion-menu devui-scrollbar"
3+
[ngClass]="{ 'devui-accordion-menu-normal': accordionType === 'normal' }"
4+
[data]="data"
5+
[deepth]="0"
6+
[parent]="null"
7+
>
8+
</d-accordion-list>

devui/accordion/accordion.component.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
:host ::ng-deep .devui-accordion-menu {
1818
display: block;
1919
background: $bg-white;
20-
box-shadow: 0 2px 4px 0 $dark-1-boxshadow;
2120
width: 100%;
2221
overflow-y: auto;
2322
border-radius: 2px;
2423
height: 100%;
2524

25+
&.devui-accordion-menu-normal {
26+
box-shadow: 0 2px 4px 0 $dark-1-boxshadow;
27+
}
28+
2629
& > .devui-accordion-list {
2730
padding: 10px 0;
2831
}

devui/accordion/accordion.component.ts

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export class AccordionComponent implements AccordionOptions, OnChanges, OnInit,
4141
@Input() linkTargetKey = 'target'; // 链接目标窗口的key
4242
@Input() linkDefaultTarget = '_self'; // 不设置target的时候target默认值
4343

44+
@Input() accordionType: 'normal' | 'embed' = 'normal';
45+
4446
activeItem; // 记录用户点击的激活菜单项
4547
i18nCommonText: I18nInterface['common'];
4648
i18nSubscription: Subscription;

devui/accordion/demo/basic/basic.component.html

+3
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
[restrictOneOpen]="restrictOneOpen"
55
(itemClick)="itemClick($event)"
66
(menuToggle)="menuToggle($event)"
7+
(activeItemChange)="log($event)"
8+
[accordionType]="accordionTypeEmbed ? 'embed' : 'normal'"
79
></d-accordion>
810
<div class="option"><d-toggle [(ngModel)]="restrictOneOpen"></d-toggle> 限制只能展开一个一级菜单</div>
11+
<div class="option"><d-toggle [(ngModel)]="accordionTypeEmbed"></d-toggle> 内嵌菜单形式(无阴影)</div>

devui/accordion/demo/basic/basic.component.ts

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Component } from '@angular/core';
77
})
88
export class BasicComponent {
99
restrictOneOpen = false;
10+
accordionTypeEmbed = false;
1011
menu = [{
1112
title: '内容一',
1213
children: [
@@ -63,5 +64,8 @@ export class BasicComponent {
6364
}, 1000);
6465
}
6566
}
67+
log(...v) {
68+
console.log(...v);
69+
}
6670

6771
}

devui/accordion/demo/link/link.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</div>
55
<div class="menu-wrapper">
66
<div>原生超链接(涉及跨站场景使用)</div>
7-
<d-accordion [data]="menu2" class="menu" [linkType]="'hrefLink'"></d-accordion>
7+
<d-accordion [data]="menu2" class="menu" [linkType]="'hrefLink'" [linkDefaultTarget]="'_self'"></d-accordion>
88
</div>
99
<div class="menu-wrapper">
1010
<div>混合链接(部分涉及跨站场景使用)</div>

devui/accordion/doc/api.md

+26-25
Large diffs are not rendered by default.

devui/alert/alert.component.html

+6-39
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,18 @@
2525
version="1.1"
2626
xmlns="http://www.w3.org/2000/svg"
2727
xmlns:xlink="http://www.w3.org/1999/xlink"
28-
*ngIf="type === 'success'"
29-
class="devui-icon devui-icon-success"
28+
class="devui-icon"
29+
[ngClass]="type === 'danger'? 'devui-icon-error': 'devui-icon-' + type"
3030
>
31-
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
31+
<g *ngIf="type === 'success'" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
3232
<path fill-rule="nonzero" d="M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z"></path>
3333
<polygon
3434
stroke-width="0.3"
3535
fill-rule="nonzero"
3636
points="6.82767602 11.5282799 3 7.24668779 3.89864233 6.37912367 6.82767602 9.04910002 12.2964408 4 13 4.64144383"
3737
></polygon>
3838
</g>
39-
</svg>
40-
<svg
41-
width="16px"
42-
height="16px"
43-
viewBox="0 0 16 16"
44-
version="1.1"
45-
xmlns="http://www.w3.org/2000/svg"
46-
xmlns:xlink="http://www.w3.org/1999/xlink"
47-
*ngIf="type === 'warning'"
48-
class="devui-icon devui-icon-warning"
49-
>
50-
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
39+
<g *ngIf="type === 'warning'" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5140
<path
5241
class="devui-icon-warning-outer"
5342
d="M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
@@ -59,18 +48,7 @@
5948
d="M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"
6049
></path>
6150
</g>
62-
</svg>
63-
<svg
64-
width="16px"
65-
height="16px"
66-
viewBox="0 0 16 16"
67-
version="1.1"
68-
xmlns="http://www.w3.org/2000/svg"
69-
xmlns:xlink="http://www.w3.org/1999/xlink"
70-
*ngIf="type === 'info'"
71-
class="devui-icon devui-icon-info"
72-
>
73-
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
51+
<g *ngIf="type === 'info'" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7452
<g fill-rule="nonzero">
7553
<path
7654
class="devui-icon-info-outer"
@@ -83,18 +61,7 @@
8361
></path>
8462
</g>
8563
</g>
86-
</svg>
87-
<svg
88-
width="16px"
89-
height="16px"
90-
viewBox="0 0 16 16"
91-
version="1.1"
92-
xmlns="http://www.w3.org/2000/svg"
93-
xmlns:xlink="http://www.w3.org/1999/xlink"
94-
*ngIf="type === 'danger'"
95-
class="devui-icon devui-icon-error"
96-
>
97-
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
64+
<g *ngIf="type === 'danger'" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
9865
<g fill-rule="nonzero">
9966
<path
10067
class="devui-icon-error-outer"

devui/alert/alert.component.ts

-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ export class AlertComponent {
2626

2727
hide = false;
2828

29-
constructor() {
30-
}
31-
3229
close() {
3330
this.closeEvent.emit(this);
3431
this.hide = true;

devui/alert/alert.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { doesNotThrow } from 'assert';
77
@Component({
88
template: `
99
<d-alert [type]="type" [showIcon]= "showIcon" (closeEvent)="handleClose($event)" [cssClass]="cssClass">
10-
<span>成功。</span>
10+
<span>成功。devcloud一站式云端DevOps平台。</span>
1111
</d-alert>
1212
`
1313
})
@@ -59,7 +59,7 @@ describe('alert', () => {
5959
});
6060

6161
it('Alert should have content', () => {
62-
expect(alertElement.querySelector('.devui-alert').textContent).toBe('成功。');
62+
expect(alertElement.querySelector('.devui-alert').textContent).toBe('成功。devcloud一站式云端DevOps平台。');
6363
});
6464
});
6565
describe('alert type', () => {

devui/anchor/anchor-link.directive.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,17 @@ export class AnchorLinkDirective implements OnInit, OnDestroy {
7272
};
7373
((container: Element, anchor: Element) => {
7474
let containerScrollTop = container.scrollTop;
75+
let containerOffsetTop = container.getBoundingClientRect().top;
7576
if (container === document.documentElement) {
76-
containerScrollTop += document.body.scrollTop;
77+
containerScrollTop += document.body.scrollTop; // scrollTop兼容性问题
78+
containerOffsetTop = 0; // offsettop抵消
7779
}
7880
this.scrollAnimate(
7981
container,
8082
containerScrollTop,
81-
(containerScrollTop + anchor.getBoundingClientRect().top - (this.boxElement.view && this.boxElement.view.top || 0)),
83+
(containerScrollTop + anchor.getBoundingClientRect().top
84+
- containerOffsetTop
85+
- (this.boxElement.view && this.boxElement.view.top || 0)),
8286
undefined, undefined, callback
8387
);
8488
})( this.boxElement.scrollTarget || document.documentElement, this.anchorBlock.element);

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

+11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@
1919
<d-anchor-async demo></d-anchor-async>
2020
</d-codebox>
2121
</div>
22+
23+
<div class="demo-example" [dAnchor]="'scroll-target'">
24+
<div class="demo-title">更换滚动容器</div>
25+
<div class="demo-text">
26+
通过scrollTarget更换滚动容器
27+
</div>
28+
<d-codebox id="components-tabs-scroll-target" [sourceData]="ScrollTargetSource">
29+
<d-anchor-scroll-target demo></d-anchor-scroll-target>
30+
</d-codebox>
31+
</div>
32+
2233
<div class="demo-example" [dAnchor]="'support-hash'">
2334
<div class="demo-title">支持url锚点</div>
2435
<div class="demo-text">

devui/anchor/demo/anchor-demo.component.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ export class AnchorDemoComponent {
2323
{title: 'CSS', language: 'css', code: require('!!raw-loader!./hash/hash.component.css')}
2424
];
2525

26+
ScrollTargetSource: Array<DevuiSourceData> = [
27+
{title: 'HTML', language: 'xml', code: require('!!raw-loader!./scroll-target/scroll-target.component.html')},
28+
{title: 'TS', language: 'typescript', code: require('!!raw-loader!./scroll-target/scroll-target.component.ts')},
29+
{title: 'CSS', language: 'css', code: require('!!raw-loader!./scroll-target/scroll-target.component.css')}
30+
];
31+
32+
2633
navItems = [
2734
{ dAnchorLink: 'basic-usage', value: '基本用法'},
2835
{ dAnchorLink: 'asynchronous-loading', value: '异步加载'},
36+
{ dAnchorLink: 'scroll-target', value: '更换滚动容器'},
2937
{ dAnchorLink: 'support-hash', value: '支持url锚点'}
3038
];
3139

32-
constructor() {
33-
34-
}
3540
}

devui/anchor/demo/anchor-demo.module.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ import { ButtonModule } from 'ng-devui/button';
1515
import { StickyModule } from 'ng-devui/sticky';
1616
import { DDemoNavModule } from 'src/app/component/d-demo-nav.module';
1717
import { HashComponent } from './hash/hash.component';
18+
import { ToggleModule } from 'ng-devui/toggle';
19+
import { ScrollTargetComponent } from './scroll-target/scroll-target.component';
1820

1921
@NgModule({
2022
imports: [
2123
CommonModule,
2224
FormsModule,
2325
ButtonModule,
26+
ToggleModule,
2427
StickyModule,
2528
AnchorModule,
2629
DevUICodeboxModule,
@@ -39,7 +42,8 @@ import { HashComponent } from './hash/hash.component';
3942
AnchorDemoComponent,
4043
BasicComponent,
4144
AsyncComponent,
42-
HashComponent
45+
HashComponent,
46+
ScrollTargetComponent
4347
],
4448
entryComponents: [
4549
AnchorDemoComponent,

devui/anchor/demo/async/async.component.ts

-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@ import { Component} from '@angular/core';
88
export class AsyncComponent {
99
loadMenu = false;
1010
loadContent = false;
11-
constructor() { }
12-
1311
}

devui/anchor/demo/basic/basic.component.ts

-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,4 @@ import { Component } from '@angular/core';
66
styleUrls: ['./basic.component.css']
77
})
88
export class BasicComponent {
9-
constructor() {
10-
11-
}
129
}

devui/anchor/demo/hash/hash.component.css

+29-21
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,56 @@
66

77
.step-nav > li {
88
list-style: none;
9-
counter-increment: stepli;
109
padding: 0;
1110
cursor: pointer;
1211
height: 30px;
13-
line-height: 30px;
14-
font-size: 14px;
12+
line-height: 1.5;
13+
font-size: 12px;
1514
color: #5e6678;
1615
position: relative;
16+
display: flex;
17+
align-items: center;
1718
}
1819

1920
.step-nav > li:hover {
20-
color: #405dff;
21+
color: #526ecc;
2122
}
2223

2324
.step-nav > li.active {
24-
color: #5170ff;
25+
color: #526ecc;
26+
}
27+
28+
.step-nav > li.active::before {
29+
border-color: #526ecc;
2530
}
2631

2732
.step-nav > li::before {
28-
content: counter(stepli);
33+
content: '';
2934
display: inline-block;
30-
width: 30px;
31-
height: 30px;
35+
width: 12px;
36+
height: 12px;
3237
text-align: center;
3338
line-height: 26px;
3439
border-radius: 50%;
3540
background-color: #ffffff;
36-
color: #5170ff;
37-
margin-right: 10px;
38-
border: 2px solid #5170ff;
39-
}
40-
41-
.step-nav > li.active::before {
42-
background-color: #5170ff;
43-
color: #ffffff;
41+
margin-right: 18px;
42+
border: 2px solid #dfe1e6;
4443
}
4544

4645
/* 左侧线 */
4746
.step-nav > li:not(:first-of-type) {
48-
margin-top: 30px;
47+
margin-top: 32px;
4948
}
5049

5150
.step-nav > li:not(:first-of-type)::after {
5251
content: '';
5352
display: block;
5453
position: absolute;
55-
top: -30px;
56-
left: 15px;
54+
top: -32px;
55+
left: 5px;
5756
width: 1px;
58-
height: 30px;
59-
border-left: 1px solid #5170ff;
57+
height: 32px;
58+
border-left: 2px solid #dfe1e6;
6059
}
6160

6261
.mymain {
@@ -116,3 +115,12 @@
116115
outline: invert none medium;
117116
}
118117
}
118+
119+
.option {
120+
height: 40px;
121+
}
122+
123+
.option > d-toggle {
124+
display: inline-block;
125+
vertical-align: middle;
126+
}

0 commit comments

Comments
 (0)