Skip to content

Commit 998b910

Browse files
chore(release): release 8.1.0 (#35)
Co-authored-by: huaweidevcloud <devcloudmobile@huawei.com>
1 parent cf3db10 commit 998b910

File tree

205 files changed

+1654
-1431
lines changed

Some content is hidden

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

205 files changed

+1654
-1431
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center"><a href="https://devui.design/home" target="_blank" rel="noopener noreferrer"><img alt="DevUI Logo" src="logo.svg" width="180" style="max-width:100%;">
1+
<p align="center"><a href="https://devui.design/home" target="_blank" rel="noopener noreferrer"><img alt="DevUI Logo" src="logo.svg?sanitize=true" width="180" style="max-width:100%;">
22
</p>
33
<p align="center">
44
<a href="https://github.com/DevCloudFE/ng-devui"><img src="https://img.shields.io/github/stars/DevCloudFE/ng-devui.svg?label=github%20stars" alt="Github Star"></a>
@@ -11,7 +11,6 @@
1111
<a href="https://gitter.im/devui-design/devui-design"><img src="https://img.shields.io/gitter/room/devui-design/devui-design" alt="Chat"></a>
1212
</p>
1313

14-
1514
<h1 align="center">DevUI for Angular</h1>
1615
The DevUI Design Design system contains a combination of DevUI rules, Design languages, and best practices. DevUI Design allows developers to focus more on application logic, while designers focus on user experience, interactions, and processes.
1716

@@ -23,6 +22,7 @@ The DevUI Design Design system contains a combination of DevUI rules, Design lan
2322
To see more in [devui.design](https://devui.design/home).
2423

2524
## Angular Support
25+
2626
Now supports Angular <font color=red>`^8.0.0`</font>
2727

2828
## Getting Started
@@ -41,6 +41,7 @@ $ npm i ng-devui
4141
# font icon library
4242
# $ npm i @devui-design/icons
4343
```
44+
4445
3. Usage:
4546

4647
```typescript
@@ -91,6 +92,7 @@ Please make sure you read the [contributing](./CONTRIBUTING.md) guide before mak
9192
We appreciate all contributors who helped us build DevUI.
9293

9394
## Support
95+
9496
Modern browsers and Internet Explorer 11+.
9597

9698
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |

README_zh_CN.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center"><a href="https://devui.design/home" target="_blank" rel="noopener noreferrer"><img alt="DevUI Logo" src="logo.svg" width="180" style="max-width:100%;">
1+
<p align="center"><a href="https://devui.design/home" target="_blank" rel="noopener noreferrer"><img alt="DevUI Logo" src="logo.svg?sanitize=true" width="180" style="max-width:100%;">
22
</p>
33
<p align="center">
44
<a href="https://github.com/DevCloudFE/ng-devui"><img src="https://img.shields.io/github/stars/DevCloudFE/ng-devui.svg?label=github%20stars" alt="Github Star"></a>
@@ -11,8 +11,6 @@
1111
<a href="https://gitter.im/devui-design/devui-design"><img src="https://img.shields.io/gitter/room/devui-design/devui-design" alt="Chat"></a>
1212
</p>
1313

14-
15-
1614
<h1 align="center">DevUI for Angular</h1>
1715
DevUI Design设计系统包含了DevUI规则、设计语言和最佳实践的资源组合。DevUI Design可以让开发人员更加专注于应用逻辑的思考,而设计人员专注于用户体验、交互和流程
1816

commitlint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = {
2020
'type-empty': [2, 'never'],
2121
'type-enum': [2, 'always', types],
2222
'scope-case': [0, 'always'],
23-
'subject-empty': [2, 'never']
23+
'subject-empty': [2, 'never'],
24+
'subject-case': [0, 'never']
2425
}
2526
};

devui/alert/alert.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class AlertComponent {
1717
@Input() closeable = true;
1818
@Input() content: HTMLElement | string;
1919
@Input() showIcon = true;
20-
@Output() closeEvent: EventEmitter<any> = new EventEmitter;
20+
@Output() closeEvent: EventEmitter<any> = new EventEmitter<any>();
2121
@Input() set dismissTime(time) {
2222
setTimeout(() => {
2323
this.close();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Injectable } from '@angular/core';
2+
3+
@Injectable({ providedIn: 'root' })
4+
export class AutoCompleteConfig {
5+
autoComplete = {
6+
delay: 300,
7+
minLength: 1,
8+
itemTemplate: null,
9+
noResultItemTemplate: null,
10+
formatter: (item) => item ? (item.label || item.toString()) : '',
11+
valueParser: (item) => item
12+
};
13+
}

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ViewChild
77
} from '@angular/core';
88
import { ControlValueAccessor } from '@angular/forms';
9+
import { AutoCompleteConfig } from './auto-complete-config';
910
import { fadeInOut } from 'ng-devui/utils';
1011

1112
@Component({
@@ -39,28 +40,28 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {
3940
private onChange = (_: any) => null;
4041
private onTouched = () => null;
4142

42-
constructor() {
43-
this.formatter = (item: any) => item ? (item.label || item.toString()) : '';
43+
constructor(private autoCompleteConfig: AutoCompleteConfig) {
44+
this.formatter = this.autoCompleteConfig.autoComplete.formatter;
4445
this.maxHeight = 300;
4546
}
4647

47-
writeValue(obj: any): void {
48+
writeValue(obj): void {
4849
this.value = obj;
4950
}
5051

5152
setDisabledState(isDisabled: boolean): void {
5253
this.disabled = isDisabled;
5354
}
5455

55-
registerOnChange(fn: any): void {
56+
registerOnChange(fn): void {
5657
this.onChange = fn;
5758
}
5859

59-
registerOnTouched(fn: any): void {
60+
registerOnTouched(fn): void {
6061
this.onTouched = fn;
6162
}
6263

63-
onSelect(event: any, item: any) {
64+
onSelect(event, item) {
6465
if (this.disabledKey && item[this.disabledKey]) {
6566
event.preventDefault();
6667
event.stopPropagation();
@@ -76,11 +77,11 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {
7677
this.onChange({ type: 'select', value: this.value });
7778
}
7879

79-
selectCurrentItem(event: any) {
80+
selectCurrentItem(event) {
8081
this.onSelect(event, this.source[this.activeIndex]);
8182
}
8283

83-
onActiveIndexChange(index: any) {
84+
onActiveIndexChange(index) {
8485
this.activeIndex = index;
8586
}
8687

@@ -108,23 +109,23 @@ export class AutoCompletePopupComponent implements ControlValueAccessor {
108109
}
109110
}
110111

111-
trackByFn(index: any, item: any) {
112+
trackByFn(index, item) {
112113
return index;
113114
}
114115

115-
animationEnd($event: any) {
116+
animationEnd($event) {
116117
if (!this.isOpen) {
117118
const targetElement = this.selectMenuElement.nativeElement;
118119
targetElement.style.display = 'none';
119120
}
120121
}
121122

122-
loadMoreEvent($event: any) {
123+
loadMoreEvent($event) {
123124
this.showLoading = true;
124125
this.onChange({ type: 'loadMore', value: this });
125126
}
126127

127-
loadFinish($event: any) {
128+
loadFinish($event) {
128129
this.showLoading = false;
129130
}
130131
}

devui/auto-complete/auto-complete.directive.ts

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { fromEvent, Observable, Subscription, of } from 'rxjs';
2424
import { map, filter, debounceTime, switchMap, tap } from 'rxjs/operators';
2525
import { PositionService } from 'ng-devui/position';
2626
import { AutoCompletePopupComponent } from './auto-complete-popup.component';
27+
import { AutoCompleteConfig } from './auto-complete-config';
2728

2829
@Directive({
2930
selector: '[dAutoComplete]',
@@ -80,20 +81,22 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
8081
private onChange = (_: any) => null;
8182
private onTouched = () => null;
8283

83-
constructor(private elementRef: ElementRef,
84+
constructor(
85+
private autoCompleteConfig: AutoCompleteConfig,
86+
private elementRef: ElementRef,
8487
private viewContainerRef: ViewContainerRef,
8588
private componentFactoryResolver: ComponentFactoryResolver,
8689
private renderer: Renderer2,
8790
private injector: Injector,
8891
private positionService: PositionService,
8992
private changeDetectorRef: ChangeDetectorRef) {
90-
this.delay = 300;
93+
this.delay = this.autoCompleteConfig.autoComplete.delay;
9194
this.valueChanges = this.registerInputEvent(elementRef);
92-
this.minLength = 1;
93-
this.itemTemplate = null;
94-
this.noResultItemTemplate = null;
95-
this.formatter = (item: any) => item ? (item.label || item.toString()) : '';
96-
this.valueParser = (item: any) => item;
95+
this.minLength = this.autoCompleteConfig.autoComplete.minLength;
96+
this.itemTemplate = this.autoCompleteConfig.autoComplete.itemTemplate;
97+
this.noResultItemTemplate = this.autoCompleteConfig.autoComplete.noResultItemTemplate;
98+
this.formatter = this.autoCompleteConfig.autoComplete.formatter;
99+
this.valueParser = this.autoCompleteConfig.autoComplete.valueParser;
97100
}
98101

99102
ngOnInit() {
@@ -147,7 +150,7 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
147150
}
148151

149152
// 调用时机:input keyup
150-
onSourceChange(source: any) {
153+
onSourceChange(source) {
151154
if (!this.elementRef.nativeElement.value) {
152155
if (this.sceneType !== 'select') { // 下拉场景不展示最近输入
153156
this.showLatestSource();
@@ -186,7 +189,7 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
186189
}
187190
}
188191

189-
private showSource(source: any, setOpen: any, isReset: any) {
192+
private showSource(source, setOpen, isReset) {
190193
if ((source && source.length) || this.noResultItemTemplate) {
191194
const pop = this.popupRef.instance;
192195
if (isReset) {
@@ -203,16 +206,16 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
203206
}
204207
}
205208

206-
writeValue(obj: any): void {
209+
writeValue(obj): void {
207210
this.value = this.formatter(obj) || '';
208211
this.writeInputValue(this.value);
209212
}
210213

211-
registerOnChange(fn: any): void {
214+
registerOnChange(fn): void {
212215
this.onChange = fn;
213216
}
214217

215-
registerOnTouched(fn: any): void {
218+
registerOnTouched(fn): void {
216219
this.onTouched = fn;
217220
}
218221

@@ -229,7 +232,7 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
229232
}
230233

231234
@HostListener('focus', ['$event'])
232-
onFocus($event: any) {
235+
onFocus($event) {
233236
this.focus = true;
234237
this.transInputFocusEmit.emit({
235238
focus: true,
@@ -252,18 +255,18 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
252255
}
253256

254257
@HostListener('blur', ['$event'])
255-
onBlur($event: any) {
258+
onBlur($event) {
256259
this.focus = false;
257260
this.onTouched();
258261
}
259262

260263
@HostListener('keydown.esc', ['$event'])
261-
onEscKeyup($event: any) {
264+
onEscKeyup($event) {
262265
this.hidePopup();
263266
}
264267

265268
@HostListener('keydown.Enter', ['$event'])
266-
onEnterKeyDown($event: any) {
269+
onEnterKeyDown($event) {
267270
if (!this.popupRef.instance.source || !this.popupRef.instance.isOpen) {
268271
return;
269272
}
@@ -273,7 +276,7 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
273276
}
274277

275278
@HostListener('keydown.ArrowUp', ['$event'])
276-
onArrowUpKeyDown($event: any) {
279+
onArrowUpKeyDown($event) {
277280
if (this.popupRef) {
278281
$event.preventDefault();
279282
$event.stopPropagation();
@@ -282,7 +285,7 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
282285
}
283286

284287
@HostListener('keydown.ArrowDown', ['$event'])
285-
onArrowDownKeyDown($event: any) {
288+
onArrowDownKeyDown($event) {
286289
if (this.popupRef) {
287290
$event.preventDefault();
288291
$event.stopPropagation();
@@ -318,7 +321,7 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
318321
}
319322
}
320323

321-
private fillPopup(source?: any, term?: string) {
324+
private fillPopup(source?, term?: string) {
322325
this.position = this.positionService.position(this.elementRef.nativeElement);
323326
const pop = this.popupRef.instance;
324327
pop.source = source;
@@ -334,7 +337,7 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
334337
});
335338
}
336339

337-
private writeInputValue(value: any) {
340+
private writeInputValue(value) {
338341
this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
339342
}
340343

@@ -349,7 +352,7 @@ export class AutoCompleteDirective implements OnInit, OnDestroy, OnChanges, Cont
349352
}
350353
}
351354

352-
onTermChange(term: any) {
355+
onTermChange(term) {
353356
this.value = term;
354357
if (this.popupRef) {
355358
this.popupRef.instance.term = term;

devui/auto-complete/auto-complete.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { FormsModule } from '@angular/forms';
44

5+
import { AutoCompleteConfig } from './auto-complete-config';
56
import { AutoCompleteDirective } from './auto-complete.directive';
67
import { AutoCompletePopupComponent } from './auto-complete-popup.component';
78
import { HighlightComponent } from './highlight.component';
@@ -15,8 +16,7 @@ import { LoadingModule } from 'ng-devui/loading';
1516
imports: [CommonModule, FormsModule, LazyLoadModule, LoadingModule],
1617
exports: [AutoCompleteDirective, AutoCompletePopupComponent, HighlightComponent],
1718
declarations: [AutoCompleteDirective, AutoCompletePopupComponent, HighlightComponent],
18-
providers: [DocumentRef, WindowRef, PositionService],
19+
providers: [DocumentRef, WindowRef, PositionService, AutoCompleteConfig],
1920
entryComponents: [AutoCompletePopupComponent]
2021
})
21-
export class AutoCompleteModule {
22-
}
22+
export class AutoCompleteModule { }

devui/auto-complete/demo/array/auto-complete-demo-array.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export class AutoDemoArrayComponent {
1010
languages = ['C#', 'C', 'C++', 'CPython', 'Java', 'JavaScript', 'Go', 'Python', 'Ruby', 'F#', 'TypeScript', 'SQL',
1111
'LiveScript', 'CoffeeScript'];
1212

13-
onSearchLocal(term: any) {
13+
onSearchLocal(term) {
1414
return of(this.languages.filter(lang => lang.toLowerCase().indexOf(term.toLowerCase()) !== -1));
1515
}
1616

17-
selectValue(value: any) {
17+
selectValue(value) {
1818
// tslint:disable-next-line:no-console
1919
console.info(value);
2020
}

devui/auto-complete/demo/custom/auto-complete-demo-custom.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export class AutoDemoCustomComponent {
1111
languages = ['C#', 'C', 'C++', 'CPython', 'Java', 'JavaScript', 'Go', 'Python', 'Ruby', 'F#', 'TypeScript', 'SQL',
1212
'LiveScript', 'CoffeeScript'];
1313

14-
onSearchLocal(term: any) {
14+
onSearchLocal(term) {
1515
return of(this.languages.filter(lang => lang.toLowerCase().indexOf(term.toLowerCase()) !== -1));
1616
}
1717

18-
getIcon(index: any) {
18+
getIcon(index) {
1919
return this.icons[index % this.icons.length];
2020
}
2121
}

0 commit comments

Comments
 (0)