Skip to content

Commit f35d506

Browse files
chore(release): release 14.0.0 (#259)
Co-authored-by: huaweidevcloud <[email protected]>
1 parent 576100b commit f35d506

File tree

480 files changed

+3490
-2133
lines changed

Some content is hidden

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

480 files changed

+3490
-2133
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To see more in [devui.design](https://devui.design/home).
2323

2424
## Angular Support
2525

26-
Now supports Angular <font color=red>`^13.0.0`</font>
26+
Now supports Angular <font color=red>`^14.0.0`</font>
2727

2828
## Getting Started
2929

README_zh_CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ DevUI Design设计系统包含了DevUI规则、设计语言和最佳实践的资
2323

2424
## Angular版本
2525

26-
当前支持的angular版本<font color=red>`^13.0.0`</font>
26+
当前支持的angular版本<font color=red>`^14.0.0`</font>
2727

2828
## 快速开始
2929

angular.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@
6767
}
6868
]
6969
},
70+
"development": {
71+
"buildOptimizer": false,
72+
"optimization": false,
73+
"vendorChunk": true,
74+
"extractLicenses": false,
75+
"sourceMap": true,
76+
"namedChunks": true
77+
},
7078
"es5": {
7179
"tsConfig": "src/tsconfig.app.es5.json"
7280
},
@@ -84,13 +92,17 @@
8492
"production": {
8593
"browserTarget": "devui:build:production"
8694
},
95+
"development": {
96+
"browserTarget": "devui:build:development"
97+
},
8798
"es5": {
8899
"browserTarget": "devui:build:es5"
89100
},
90101
"separate": {
91102
"browserTarget": "devui:build:separate"
92103
}
93-
}
104+
},
105+
"defaultConfiguration": "development"
94106
},
95107
"extract-i18n": {
96108
"builder": "@angular-devkit/build-angular:extract-i18n",

devui-commons/src/codecopy/codecopy.directive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ReadTipOption, StrCopySVG } from './codecopy.types';
99
})
1010
export class CodeCopyDirective implements OnInit, AfterViewInit, OnDestroy {
1111
@Output('copied') copied: EventEmitter<any> = new EventEmitter<any>();
12-
private destroy$ = new Subject();
12+
private destroy$ = new Subject<void>();
1313
timer: any;
1414
optionsSuccess = ReadTipOption.optionSuccessData['zh-cn'];
1515
options = ReadTipOption.optionData['zh-cn'];

devui-commons/src/demo-nav/d-demo-nav.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="devui-content-nav">
22
<d-sticky [container]="demoDocViewerMain">
33
<div>
4-
<div class="devui-fast-forward">{{ goToText }}</div>
4+
<!-- <div class="devui-fast-forward">{{ goToText }}</div> -->
55
<ul class="devui-step-nav">
66
<li *ngFor="let navitem of navItems" dAnchorLink="{{ navitem.dAnchorLink }}" anchorActive="active">
77
{{ navitem.value }}

devui-commons/src/devui-commons.scss

+10-11
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
.devui-content-layout {
1717
top: 60px;
1818
position: absolute;
19-
padding: 0 20% 32px 13%;
20-
margin-left: 260px;
21-
width: calc(100% - 260px);
22-
background-color: $devui-base-bg;
19+
padding: 0 15vw 0 25vw;
20+
width: calc(100vw - 20px);
21+
background-color: $devui-global-bg;
2322
}
2423

2524
//内容区文档头样式
@@ -48,7 +47,11 @@
4847
}
4948

5049
.devui-demo-example {
51-
margin-bottom: 48px;
50+
margin-bottom: 20px;
51+
padding: 20px;
52+
background-color: $devui-base-bg;
53+
box-shadow: $devui-shadow-length-base $devui-light-shadow;
54+
border-radius: 8px;
5255
}
5356

5457
.devui-demo-title {
@@ -154,10 +157,10 @@
154157
.devui-content-nav {
155158
width: 240px;
156159
position: fixed;
157-
top: 90px;
160+
top: 170px;
158161
right: 0;
159162
height: 100%;
160-
z-index: 1;
163+
z-index: calc(#{$devui-z-index-framework} + 1);
161164

162165
.devui-fast-forward {
163166
width: 130px;
@@ -218,10 +221,6 @@
218221
.devui-content-nav {
219222
width: 150px;
220223
}
221-
222-
.devui-content-layout {
223-
padding: 0 15% 0 8%;
224-
}
225224
}
226225

227226
@media (max-width: 1250px) {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class HeaderComponent implements OnInit {
3333

3434
@HostListener('window:resize')
3535
resize(): void {
36-
this.showSlideMenu = document.body.clientWidth < 1024 ? false : true;
36+
this.showSlideMenu = document.body.clientWidth < 1280 ? false : true;
3737
this.setSlideBarStyle();
3838
}
3939

@@ -69,7 +69,7 @@ export class HeaderComponent implements OnInit {
6969
setSlideBarStyle(): void {
7070
const ele = document.querySelector('.sidebar-wrapper');
7171
if (ele) {
72-
ele.setAttribute('style', `max-width: ${ this.showSlideMenu ? '260px' : '0'}`);
72+
ele.setAttribute('style', `max-width: ${ this.showSlideMenu ? '320px' : '0'}`);
7373
}
7474
}
7575

devui-commons/src/header/version-switch/version-switch.component.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.header-version-switch {
2-
width: 80px;
2+
width: 100px;
33
margin: 0 12px;
44
}
55

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
.sidebar-wrapper {
44
position: fixed;
5-
top: 70px;
6-
width: 260px;
7-
max-width: 260px;
5+
top: 60px;
6+
width: 320px;
7+
max-width: 320px;
88
height: 100%;
99
overflow-y: hidden;
10+
scroll-behavior: smooth;
1011
z-index: 1000;
1112
border-right: 1px solid $devui-dividing-line;
1213
background-color: $devui-base-bg;
@@ -19,12 +20,12 @@
1920
}
2021

2122
.sidebar-nav {
22-
width: 260px;
23+
width: 100%;
2324
padding-bottom: 80px;
2425
}
2526

2627
.sidebar-menu {
27-
width: 260px;
28+
width: 320px;
2829

2930
outline: none;
3031
margin-bottom: 0;

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

+34-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
import { Component, Input, OnInit } from '@angular/core';
1+
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
2+
import { NavigationEnd, Router } from '@angular/router';
23
import { cloneDeep } from 'lodash-es';
4+
import { Subject } from 'rxjs';
5+
import { filter, takeUntil } from 'rxjs/operators';
36
import { DevuiCommonsService } from '../devui-commons.service';
47

58
@Component({
69
selector: 'd-sidebar',
710
templateUrl: './sidebar.component.html',
811
styleUrls: ['./sidebar.component.scss']
912
})
10-
export class SidebarComponent implements OnInit {
13+
export class SidebarComponent implements OnInit, AfterViewInit, OnDestroy {
1114
@Input() sideMenuList;
1215
@Input() linkType = 'routerLink';
1316
@Input() text = {
1417
new: 'New',
1518
sunset: 'Sunset'
1619
};
1720
_navData;
21+
private _currentUrl: string = '';
22+
private destroy$: Subject<void> = new Subject();
1823
componentsDataDisplay;
1924

2025
@Input() set navData(data) {
@@ -26,14 +31,40 @@ export class SidebarComponent implements OnInit {
2631
return this._navData;
2732
}
2833

29-
constructor(private commonsService: DevuiCommonsService) { }
34+
constructor(private commonsService: DevuiCommonsService, private router: Router, private ele: ElementRef) { }
3035

3136
ngOnInit(): void {
37+
this._currentUrl = this.router.url;
3238
this.commonsService.on<any>('searchEvent').subscribe(term => {
3339
this.filterData(term);
3440
});
3541
}
3642

43+
ngAfterViewInit(): void {
44+
this.router.events
45+
.pipe(
46+
filter((event) => event instanceof NavigationEnd),
47+
takeUntil(this.destroy$)
48+
)
49+
.subscribe((event) => {
50+
const destUrl = (event as NavigationEnd).urlAfterRedirects;
51+
if (this._currentUrl.endsWith('overview')) {
52+
setTimeout(() => {
53+
const activeItem: HTMLElement = this.ele.nativeElement.querySelector('.devui-router-active');
54+
if (activeItem) {
55+
activeItem.scrollIntoView({ block: 'center' });
56+
}
57+
});
58+
}
59+
this._currentUrl = destUrl;
60+
});
61+
}
62+
63+
ngOnDestroy(): void {
64+
this.destroy$.next();
65+
this.destroy$.complete();
66+
}
67+
3768
filterData(event): void {
3869
this.componentsDataDisplay = cloneDeep(this.navData).filter(catalog => {
3970
catalog.children = catalog.children.filter(item => {

devui/accordion/accordion-item-routerlink.component.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import { ACCORDION } from './accordion-token';
1212
export class AccordionItemRouterlinkComponent extends AccordionBaseLinkComponent implements OnChanges {
1313
@ViewChild(RouterLinkActive) routerLinkActiveDirective: RouterLinkActive;
1414
@HostBinding('class.devui-router-active')
15-
get routerLinkActived(): boolean {
15+
get routerLinkActivated(): boolean {
1616
return !!(this.routerLinkActiveDirective && this.routerLinkActiveDirective.isActive);
1717
}
18+
1819
private set urlTree(urlTree: UrlTree) {
1920
if (urlTree) {
2021
this.queryParams = urlTree.queryParams;
@@ -25,25 +26,25 @@ export class AccordionItemRouterlinkComponent extends AccordionBaseLinkComponent
2526
}
2627
}
2728

28-
public path: string;
29-
public queryParams: Params;
30-
public fragment: string;
31-
32-
constructor(@Inject(ACCORDION) protected accordion: any, private router: Router) {
33-
super(accordion);
34-
}
35-
3629
@HostListener('click', ['$event'])
3730
onClick(event: MouseEvent) {
3831
if (!this.disabled) {
3932
this.accordion.linkItemClickFn({
4033
item: this.item,
4134
parent: this.parent,
42-
event: event
35+
event: event,
4336
});
4437
}
4538
}
4639

40+
path: string;
41+
queryParams: Params;
42+
fragment: string;
43+
44+
constructor(@Inject(ACCORDION) protected accordion: any, private router: Router) {
45+
super(accordion);
46+
}
47+
4748
ngOnChanges(changes: SimpleChanges): void {
4849
if (changes['item']) {
4950
if (this.link) {

devui/accordion/accordion-list-token.ts

-3
This file was deleted.

devui/accordion/accordion-list.component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
<d-accordion-menu *ngIf="item[childrenKey] !== undefined" [item]="item" [deepth]="deepth" [parent]="parent"></d-accordion-menu>
55
<!--非菜单类型-->
66
<d-accordion-list
7+
#listInstance
78
*ngIf="item[childrenKey] !== undefined"
89
class="devui-accordion-submenu"
910
[deepth]="deepth + 1"
1011
[data]="item[childrenKey]"
1112
[parent]="item"
12-
[@collapse]="item.open ? 'expanded' : 'collapsed'"
13+
[@collapse]="getOpenState(item, listInstance)"
1314
[@.disabled]="!animateState"
1415
>
1516
</d-accordion-list>

0 commit comments

Comments
 (0)