Skip to content

Commit e9f1821

Browse files
chore(release): release 10.1.0 (#76)
Co-authored-by: huaweidevcloud <[email protected]>
1 parent d310bad commit e9f1821

File tree

360 files changed

+9327
-2702
lines changed

Some content is hidden

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

360 files changed

+9327
-2702
lines changed

commitlint.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// rule由name和配置数组组成,如:'name:[0, 'always', 72]',数组中第一位为level,可选0,1,2,0为disable,1为warning,2为error,第二位为应用与否,可选always|never
2+
13
const types = [
24
'feat',
35
'fix',

devui/accordion/accordion.component.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@import '../style/mixins/index';
22
@import '../style/theme/color';
3+
@import '../style/theme/shadow';
4+
@import '../style/theme/corner';
35

46
:host {
57
display: block;
@@ -19,11 +21,11 @@
1921
background: $devui-base-bg;
2022
width: 100%;
2123
overflow-y: auto;
22-
border-radius: 2px;
24+
border-radius: $devui-border-radius;
2325
height: 100%;
2426

2527
&.devui-accordion-menu-normal {
26-
box-shadow: 0 2px 4px 0 $devui-shadow;
28+
box-shadow: $devui-shadow-length-base $devui-shadow;
2729
}
2830

2931
& > .devui-accordion-list {

devui/accordion/demo/accordion-demo.moudule.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { DDemoNavModule } from 'src/app/component/d-demo-nav.module';
4545
ChangeKeyComponent,
4646
],
4747
providers: [],
48-
48+
4949
})
5050
export class AccordionDemoModule {
5151
}

devui/accordion/demo/template/template.component.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
display: inline-block;
99
width: 16px;
1010
height: 16px;
11-
border-radius: 8px;
11+
border-radius: (16px/2);
1212
font-size: $devui-font-size;
1313
line-height: 12px;
1414
padding: 2px;

devui/alert/alert.component.scss

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import '../style/mixins/index';
22
@import '../style/theme/color';
3-
@import '../style/theme/shadow';
4-
@import '../style/core/_font';
3+
@import '../style/theme/corner';
4+
@import '../style/theme/_font';
55

66
:host {
77
display: block;
@@ -13,13 +13,14 @@
1313
border: 1px solid transparent;
1414
padding: 10px;
1515
line-height: 20px;
16-
border-radius: 2px;
16+
border-radius: $devui-border-radius;
1717
padding-left: 16px;
18+
word-break: normal;
19+
word-wrap: break-word;
1820

1921
button.devui-close {
2022
color: $devui-text;
2123
opacity: 1;
22-
box-shadow: none;
2324

2425
& > svg path {
2526
fill: $devui-light-text;
@@ -36,7 +37,6 @@
3637
background-color: $devui-success-bg;
3738
border-color: $devui-success-line;
3839
color: $devui-text;
39-
box-shadow: $hwc-shadow-success;
4040

4141
button.devui-close {
4242
& > svg path {
@@ -49,7 +49,6 @@
4949
background-color: $devui-info-bg;
5050
border-color: $devui-info-line;
5151
color: $devui-text;
52-
box-shadow: $hwc-shadow-prompt;
5352

5453
button.devui-close {
5554
& > svg path {
@@ -62,7 +61,6 @@
6261
background-color: $devui-warning-bg;
6362
border-color: $devui-warning-line;
6463
color: $devui-text;
65-
box-shadow: $hwc-shadow-warn;
6664

6765
button.devui-close {
6866
& > svg path {
@@ -75,7 +73,6 @@
7573
background-color: $devui-danger-bg;
7674
border-color: $devui-danger-line;
7775
color: $devui-text;
78-
box-shadow: $hwc-shadow-error;
7976

8077
button.devui-close {
8178
& > svg path {

devui/alert/demo/alert-demo.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { DDemoNavModule } from 'src/app/component/d-demo-nav.module';
3434
BasicComponent,
3535
CloseComponent,
3636
],
37-
37+
3838
})
3939
export class AlertDemoModule {
4040
}

devui/anchor/anchor-box.directive.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ContentChildren, Directive, Input, QueryList, OnInit } from '@angular/core';
1+
import { ContentChildren, Directive, Input, QueryList, OnInit, OnDestroy } from '@angular/core';
22
import { Subject, Subscription} from 'rxjs';
33
import { AnchorActiveChangeSource, IAnchorBox } from './anchor.type';
44
import { AnchorDirective } from './anchor.directive';
@@ -7,7 +7,7 @@ import { filter } from 'rxjs/operators';
77
@Directive({
88
selector: '[dAnchorBox]'
99
})
10-
export class AnchorBoxDirective implements IAnchorBox {
10+
export class AnchorBoxDirective implements IAnchorBox, OnDestroy {
1111
public isScrollingToTarget = false;
1212
private activeChangeSubject = new Subject();
1313
public activeChange = this.activeChangeSubject.asObservable();
@@ -59,4 +59,10 @@ export class AnchorBoxDirective implements IAnchorBox {
5959
});
6060
}
6161
}
62+
ngOnDestroy() {
63+
this.activeChangeSubject.complete();
64+
if (this.sub) {
65+
this.sub.unsubscribe();
66+
}
67+
}
6268
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { ScrollTargetComponent } from './scroll-target/scroll-target.component';
4545
HashComponent,
4646
ScrollTargetComponent
4747
],
48-
48+
4949
})
5050
export class AnchorDemoModule {
5151
}

devui/auto-complete/auto-complete-popup.component.ts

+16-27
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
Component,
3-
ElementRef,
4-
Input,
5-
TemplateRef,
6-
ViewChild
7-
} from '@angular/core';
1+
import { Component, ElementRef, Input, TemplateRef, ViewChild } from '@angular/core';
82
import { ControlValueAccessor } from '@angular/forms';
93
import { AutoCompleteConfig } from './auto-complete-config';
104
import { fadeInOut } from 'ng-devui/utils';
@@ -15,10 +9,10 @@ import { CdkOverlayOrigin } from '@angular/cdk/overlay';
159
templateUrl: './auto-complete-popup.component.html',
1610
styleUrls: ['auto-complete-popup.component.scss'],
1711
animations: [fadeInOut],
18-
preserveWhitespaces: false
12+
preserveWhitespaces: false,
1913
})
2014
export class AutoCompletePopupComponent implements ControlValueAccessor {
21-
@Input() width;
15+
@Input() width: number;
2216
@Input() cssClass: string;
2317
@Input() maxHeight: number;
2418
@Input() disabled: boolean;
@@ -48,10 +42,7 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {
4842
private onChange = (_: any) => null;
4943
private onTouched = () => null;
5044

51-
constructor(
52-
private autoCompleteConfig: AutoCompleteConfig,
53-
public elementRef: ElementRef
54-
) {
45+
constructor(private autoCompleteConfig: AutoCompleteConfig, public elementRef: ElementRef) {
5546
this.formatter = this.autoCompleteConfig.autoComplete.formatter;
5647
this.maxHeight = 300;
5748
}
@@ -78,7 +69,8 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {
7869
event.stopPropagation();
7970
return;
8071
}
81-
if (this.overview === 'single') { // 单选场景和单行场景不需要冒泡
72+
if (this.overview === 'single') {
73+
// 单选场景和单行场景不需要冒泡
8274
event.preventDefault();
8375
event.stopPropagation();
8476
}
@@ -102,20 +94,17 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {
10294

10395
scrollToActive(): void {
10496
const that = this;
105-
setTimeout(_ => {
106-
try {
107-
const selectIndex = that.activeIndex;
108-
const scrollPane: any = that.dropdownUl.nativeElement.children[selectIndex];
109-
if (scrollPane.scrollIntoViewIfNeeded) {
110-
scrollPane.scrollIntoViewIfNeeded(false);
111-
} else {
112-
const containerInfo = that.dropdownUl.nativeElement.getBoundingClientRect();
113-
const elementInfo = scrollPane.getBoundingClientRect();
114-
if (elementInfo.bottom > containerInfo.bottom || elementInfo.top < containerInfo.top) {
115-
scrollPane.scrollIntoView(false);
116-
}
97+
setTimeout(() => {
98+
const selectIndex = that.activeIndex;
99+
const scrollPane: any = that.dropdownUl.nativeElement.children[selectIndex];
100+
if (scrollPane.scrollIntoViewIfNeeded) {
101+
scrollPane.scrollIntoViewIfNeeded(false);
102+
} else {
103+
const containerInfo = that.dropdownUl.nativeElement.getBoundingClientRect();
104+
const elementInfo = scrollPane.getBoundingClientRect();
105+
if (elementInfo.bottom > containerInfo.bottom || elementInfo.top < containerInfo.top) {
106+
scrollPane.scrollIntoView(false);
117107
}
118-
} catch (e) {
119108
}
120109
});
121110
}

0 commit comments

Comments
 (0)