Skip to content

Commit

Permalink
chore(release): release 10.1.0 (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: huaweidevcloud <devcloudmobile@huawei.com>
  • Loading branch information
wangyaju and huaweidevcloud authored Dec 10, 2020
1 parent d310bad commit e9f1821
Show file tree
Hide file tree
Showing 360 changed files with 9,327 additions and 2,702 deletions.
2 changes: 2 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// rule由name和配置数组组成,如:'name:[0, 'always', 72]',数组中第一位为level,可选0,1,2,0为disable,1为warning,2为error,第二位为应用与否,可选always|never

const types = [
'feat',
'fix',
Expand Down
6 changes: 4 additions & 2 deletions devui/accordion/accordion.component.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@import '../style/mixins/index';
@import '../style/theme/color';
@import '../style/theme/shadow';
@import '../style/theme/corner';

:host {
display: block;
Expand All @@ -19,11 +21,11 @@
background: $devui-base-bg;
width: 100%;
overflow-y: auto;
border-radius: 2px;
border-radius: $devui-border-radius;
height: 100%;

&.devui-accordion-menu-normal {
box-shadow: 0 2px 4px 0 $devui-shadow;
box-shadow: $devui-shadow-length-base $devui-shadow;
}

& > .devui-accordion-list {
Expand Down
2 changes: 1 addition & 1 deletion devui/accordion/demo/accordion-demo.moudule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { DDemoNavModule } from 'src/app/component/d-demo-nav.module';
ChangeKeyComponent,
],
providers: [],

})
export class AccordionDemoModule {
}
2 changes: 1 addition & 1 deletion devui/accordion/demo/template/template.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
display: inline-block;
width: 16px;
height: 16px;
border-radius: 8px;
border-radius: (16px/2);
font-size: $devui-font-size;
line-height: 12px;
padding: 2px;
Expand Down
13 changes: 5 additions & 8 deletions devui/alert/alert.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../style/mixins/index';
@import '../style/theme/color';
@import '../style/theme/shadow';
@import '../style/core/_font';
@import '../style/theme/corner';
@import '../style/theme/_font';

:host {
display: block;
Expand All @@ -13,13 +13,14 @@
border: 1px solid transparent;
padding: 10px;
line-height: 20px;
border-radius: 2px;
border-radius: $devui-border-radius;
padding-left: 16px;
word-break: normal;
word-wrap: break-word;

button.devui-close {
color: $devui-text;
opacity: 1;
box-shadow: none;

& > svg path {
fill: $devui-light-text;
Expand All @@ -36,7 +37,6 @@
background-color: $devui-success-bg;
border-color: $devui-success-line;
color: $devui-text;
box-shadow: $hwc-shadow-success;

button.devui-close {
& > svg path {
Expand All @@ -49,7 +49,6 @@
background-color: $devui-info-bg;
border-color: $devui-info-line;
color: $devui-text;
box-shadow: $hwc-shadow-prompt;

button.devui-close {
& > svg path {
Expand All @@ -62,7 +61,6 @@
background-color: $devui-warning-bg;
border-color: $devui-warning-line;
color: $devui-text;
box-shadow: $hwc-shadow-warn;

button.devui-close {
& > svg path {
Expand All @@ -75,7 +73,6 @@
background-color: $devui-danger-bg;
border-color: $devui-danger-line;
color: $devui-text;
box-shadow: $hwc-shadow-error;

button.devui-close {
& > svg path {
Expand Down
2 changes: 1 addition & 1 deletion devui/alert/demo/alert-demo.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { DDemoNavModule } from 'src/app/component/d-demo-nav.module';
BasicComponent,
CloseComponent,
],

})
export class AlertDemoModule {
}
Expand Down
10 changes: 8 additions & 2 deletions devui/anchor/anchor-box.directive.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentChildren, Directive, Input, QueryList, OnInit } from '@angular/core';
import { ContentChildren, Directive, Input, QueryList, OnInit, OnDestroy } from '@angular/core';
import { Subject, Subscription} from 'rxjs';
import { AnchorActiveChangeSource, IAnchorBox } from './anchor.type';
import { AnchorDirective } from './anchor.directive';
Expand All @@ -7,7 +7,7 @@ import { filter } from 'rxjs/operators';
@Directive({
selector: '[dAnchorBox]'
})
export class AnchorBoxDirective implements IAnchorBox {
export class AnchorBoxDirective implements IAnchorBox, OnDestroy {
public isScrollingToTarget = false;
private activeChangeSubject = new Subject();
public activeChange = this.activeChangeSubject.asObservable();
Expand Down Expand Up @@ -59,4 +59,10 @@ export class AnchorBoxDirective implements IAnchorBox {
});
}
}
ngOnDestroy() {
this.activeChangeSubject.complete();
if (this.sub) {
this.sub.unsubscribe();
}
}
}
2 changes: 1 addition & 1 deletion devui/anchor/demo/anchor-demo.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { ScrollTargetComponent } from './scroll-target/scroll-target.component';
HashComponent,
ScrollTargetComponent
],

})
export class AnchorDemoModule {
}
Expand Down
43 changes: 16 additions & 27 deletions devui/auto-complete/auto-complete-popup.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
Component,
ElementRef,
Input,
TemplateRef,
ViewChild
} from '@angular/core';
import { Component, ElementRef, Input, TemplateRef, ViewChild } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { AutoCompleteConfig } from './auto-complete-config';
import { fadeInOut } from 'ng-devui/utils';
Expand All @@ -15,10 +9,10 @@ import { CdkOverlayOrigin } from '@angular/cdk/overlay';
templateUrl: './auto-complete-popup.component.html',
styleUrls: ['auto-complete-popup.component.scss'],
animations: [fadeInOut],
preserveWhitespaces: false
preserveWhitespaces: false,
})
export class AutoCompletePopupComponent implements ControlValueAccessor {
@Input() width;
@Input() width: number;
@Input() cssClass: string;
@Input() maxHeight: number;
@Input() disabled: boolean;
Expand Down Expand Up @@ -48,10 +42,7 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {
private onChange = (_: any) => null;
private onTouched = () => null;

constructor(
private autoCompleteConfig: AutoCompleteConfig,
public elementRef: ElementRef
) {
constructor(private autoCompleteConfig: AutoCompleteConfig, public elementRef: ElementRef) {
this.formatter = this.autoCompleteConfig.autoComplete.formatter;
this.maxHeight = 300;
}
Expand All @@ -78,7 +69,8 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {
event.stopPropagation();
return;
}
if (this.overview === 'single') { // 单选场景和单行场景不需要冒泡
if (this.overview === 'single') {
// 单选场景和单行场景不需要冒泡
event.preventDefault();
event.stopPropagation();
}
Expand All @@ -102,20 +94,17 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {

scrollToActive(): void {
const that = this;
setTimeout(_ => {
try {
const selectIndex = that.activeIndex;
const scrollPane: any = that.dropdownUl.nativeElement.children[selectIndex];
if (scrollPane.scrollIntoViewIfNeeded) {
scrollPane.scrollIntoViewIfNeeded(false);
} else {
const containerInfo = that.dropdownUl.nativeElement.getBoundingClientRect();
const elementInfo = scrollPane.getBoundingClientRect();
if (elementInfo.bottom > containerInfo.bottom || elementInfo.top < containerInfo.top) {
scrollPane.scrollIntoView(false);
}
setTimeout(() => {
const selectIndex = that.activeIndex;
const scrollPane: any = that.dropdownUl.nativeElement.children[selectIndex];
if (scrollPane.scrollIntoViewIfNeeded) {
scrollPane.scrollIntoViewIfNeeded(false);
} else {
const containerInfo = that.dropdownUl.nativeElement.getBoundingClientRect();
const elementInfo = scrollPane.getBoundingClientRect();
if (elementInfo.bottom > containerInfo.bottom || elementInfo.top < containerInfo.top) {
scrollPane.scrollIntoView(false);
}
} catch (e) {
}
});
}
Expand Down
Loading

0 comments on commit e9f1821

Please sign in to comment.