Skip to content

Commit 5a9057c

Browse files
chore(release): release 12.3.0 (#171)
Co-authored-by: huaweidevcloud <[email protected]>
1 parent dc5d9ce commit 5a9057c

File tree

594 files changed

+11016
-6528
lines changed

Some content is hidden

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

594 files changed

+11016
-6528
lines changed

.eslintrc.js

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
module.exports = {
2+
rules: {
3+
"no-useless-constructor": "off",
4+
"no-useless-concat":"off",
5+
"max-params": "off",
6+
"@typescript-eslint/no-useless-constructor": "off",
7+
"@typescript-eslint/no-parameter-properties": "off",
8+
"@typescript-eslint/no-require-imports": "off",
9+
"@typescript-eslint/no-var-requires": "off",
10+
"@angular-eslint/component-class-suffix": ["error", { suffixes: ["Component", "Directive"] }],
11+
"@angular-eslint/component-selector": [
12+
"error",
13+
{
14+
"type": "element",
15+
"prefix": "d",
16+
"style": "kebab-case"
17+
}
18+
],
19+
"@angular-eslint/directive-class-suffix":["error", { suffixes: ["Component", "Directive"] }],
20+
"@angular-eslint/directive-selector": [
21+
"error",
22+
{
23+
"type": ["attribute","element"],
24+
"prefix": "d",
25+
"style": "camelCase"
26+
}
27+
],
28+
"@angular-eslint/no-host-metadata-property": "error",
29+
"@angular-eslint/no-input-rename": "off",
30+
"@angular-eslint/no-inputs-metadata-property": "error",
31+
"@angular-eslint/no-output-on-prefix": "error",
32+
"@angular-eslint/no-output-rename": "error",
33+
"@angular-eslint/no-outputs-metadata-property": "error",
34+
"@angular-eslint/use-lifecycle-interface": "error",
35+
"@angular-eslint/use-pipe-transform-interface": "error",
36+
"complexity": [
37+
'error',
38+
{
39+
max: 40,
40+
},
41+
],
42+
43+
"curly": "error",
44+
"eol-last": "error",
45+
"eqeqeq": [
46+
"error",
47+
"smart"
48+
],
49+
"max-len": [
50+
"error",
51+
{
52+
"code": 140
53+
}
54+
],
55+
"no-console": [
56+
"error",
57+
{
58+
"allow": [
59+
"log",
60+
"warn",
61+
"dir",
62+
"timeLog",
63+
"assert",
64+
"clear",
65+
"count",
66+
"countReset",
67+
"group",
68+
"groupEnd",
69+
"table",
70+
"dirxml",
71+
"error",
72+
"groupCollapsed",
73+
"Console",
74+
"profile",
75+
"profileEnd",
76+
"timeStamp",
77+
"context"
78+
]
79+
}
80+
],
81+
82+
"no-multiple-empty-lines": "error",
83+
"no-shadow": "off", // 使用@typescript-eslint/no-shadow,规避使用enum类型报错
84+
"no-trailing-spaces": "error",
85+
"no-unused-labels": "error",
86+
"no-use-before-define": "error",
87+
"no-var": "error",
88+
"prefer-const": "error",
89+
"semi": "error",
90+
"space-in-parens": [
91+
"error",
92+
"never"
93+
],
94+
"spaced-comment": [
95+
"error",
96+
"always"
97+
],
98+
"@typescript-eslint/dot-notation": "off",
99+
"@typescript-eslint/indent": [
100+
"error",
101+
2,
102+
{
103+
"FunctionDeclaration": {
104+
"parameters": "first"
105+
},
106+
"FunctionExpression": {
107+
"parameters": "first"
108+
}
109+
}
110+
],
111+
"@typescript-eslint/member-delimiter-style": [
112+
"error",
113+
{
114+
"multiline": {
115+
"delimiter": "semi",
116+
"requireLast": true
117+
},
118+
"singleline": {
119+
"delimiter": "semi",
120+
"requireLast": false
121+
}
122+
}
123+
],
124+
"@typescript-eslint/no-misused-new": "error",
125+
"@typescript-eslint/no-non-null-assertion": "error",
126+
"@typescript-eslint/prefer-function-type": "error",
127+
"@typescript-eslint/semi": [
128+
"error",
129+
"always"
130+
],
131+
"@typescript-eslint/type-annotation-spacing": "error",
132+
"@typescript-eslint/unified-signatures": "error",
133+
"@typescript-eslint/no-shadow":"error",
134+
"@angular-eslint/no-output-on-prefix":"off",
135+
"@angular-eslint/use-pipe-transform-interface":"off",
136+
137+
"prefer-promise-reject-errors": "off",
138+
'max-nested-callbacks': ['error', 6],
139+
"@typescript-eslint/no-this-alias":"off",
140+
"accessor-pairs": "off",
141+
"max-depth": "off",
142+
"@typescript-eslint/member-ordering": "off",
143+
"array-callback-return":"off"
144+
}
145+
};

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ testem.log
4141
Thumbs.db
4242
desktop.ini
4343
debug.log
44-
4544
# package-lock
4645
package-lock.json

angular.json

+10-24
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
],
3737
"styles": [
3838
"node_modules/highlight.js/styles/an-old-hope.css",
39-
"src/styles.scss"
39+
"src/styles.scss",
40+
"devui/style/layout/devui-layout.scss"
4041
],
4142
"scripts": []
4243
},
@@ -118,14 +119,11 @@
118119
}
119120
},
120121
"lint": {
121-
"builder": "@angular-devkit/build-angular:tslint",
122+
"builder": "@angular-eslint/builder:lint",
122123
"options": {
123-
"tsConfig": [
124-
"src/tsconfig.app.json",
125-
"src/tsconfig.spec.json"
126-
],
127-
"exclude": [
128-
"**/node_modules/**"
124+
"fix": true,
125+
"lintFilePatterns": [
126+
"src/**/*.ts"
129127
]
130128
}
131129
}
@@ -147,15 +145,6 @@
147145
"devServerTarget": "devui:serve:production"
148146
}
149147
}
150-
},
151-
"lint": {
152-
"builder": "@angular-devkit/build-angular:tslint",
153-
"options": {
154-
"tsConfig": "e2e/tsconfig.e2e.json",
155-
"exclude": [
156-
"**/node_modules/**"
157-
]
158-
}
159148
}
160149
}
161150
},
@@ -194,14 +183,11 @@
194183
}
195184
},
196185
"lint": {
197-
"builder": "@angular-devkit/build-angular:tslint",
186+
"builder": "@angular-eslint/builder:lint",
198187
"options": {
199-
"tsConfig": [
200-
"devui/tsconfig.lib.json",
201-
"devui/tsconfig.spec.json"
202-
],
203-
"exclude": [
204-
"**/node_modules/**"
188+
"fix": true,
189+
"lintFilePatterns": [
190+
"devui/**/*.ts"
205191
]
206192
}
207193
}

devui/accordion/accordion-base-component.class.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Directive, HostBinding, Input } from '@angular/core';
22
import { AccordionBase, AccordionOptions } from './accordion.type';
33

44
@Directive()
5-
// tslint:disable-next-line: directive-class-suffix
65
export abstract class AccordionBaseComponent<T extends AccordionBase> {
76
@Input() item: any | T;
87
@Input() deepth = 0;

devui/accordion/accordion-base-item-component.class.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { AccordionBaseComponent } from './accordion-base-component.class';
33
import { AccordionBaseItem, AccordionOptions } from './accordion.type';
44

55
@Directive()
6-
// tslint:disable-next-line: directive-class-suffix
76
export abstract class AccordionBaseItemComponent<T extends AccordionBaseItem> extends AccordionBaseComponent<T> {
87
get itemTemplate() {
98
return this.accordion.itemTemplate;

devui/accordion/accordion-base-link-component.class.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { AccordionBaseItemComponent } from './accordion-base-item-component.clas
33
import { AccordionLinkableItem, AccordionOptions } from './accordion.type';
44

55
@Directive()
6-
// tslint:disable-next-line: directive-class-suffix
76
export abstract class AccordionBaseLinkComponent extends AccordionBaseItemComponent<AccordionLinkableItem> {
87
get link() {
98
return this.item && this.item[this.accordion.linkKey];

devui/accordion/accordion-list.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ export class AccordionListComponent implements OnInit, OnDestroy {
9999
get routerLinkActived(): boolean {
100100
return (!!this.accordionItemRouterlinkQueryList
101101
&& this.accordionItemRouterlinkQueryList.some(airlc => this.isLinkRouterActive(airlc))
102-
) || (
103-
!!this.accordionMenuQueryList
102+
) || (
103+
!!this.accordionMenuQueryList
104104
&& this.accordionMenuQueryList.some(amc => this.isMenuRouterActive(amc))
105-
);
105+
);
106106
}
107107
get hasActiveChildren(): boolean {
108108
return (!!this.accordionMenuQueryList
109109
&& this.accordionMenuQueryList.some(amc => this.isMenuDataActive(amc)))
110110
|| (!!this.data && !!this.data.length
111111
&& this.data.some(item => this.isItemData(item) && this.isItemDataActive(item))
112-
);
112+
);
113113
}
114114
menuToggleItemFn = (item: any , event?: any) => {
115115
this.accordion.menuToggleFn({
@@ -118,12 +118,12 @@ export class AccordionListComponent implements OnInit, OnDestroy {
118118
parent: this.parent.parent,
119119
event: event
120120
});
121-
}
121+
};
122122
itemClickItemFn = (item: any, event?: any) => {
123123
this.accordion.itemClickFn({
124124
item: item,
125125
parent: this.parent,
126126
event: event
127127
});
128-
}
128+
};
129129
}

devui/accordion/accordion.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class AccordionComponent implements AccordionOptions, OnChanges, OnInit,
5353

5454
ngOnChanges(changes: SimpleChanges) {
5555
if (changes['data']) {
56-
this.initActiveItem();
56+
this.initActiveItem();
5757
}
5858
if (changes['autoOpenActiveMenu']) {
5959
if (this.autoOpenActiveMenu && changes['autoOpenActiveMenu'].previousValue === false) {
@@ -99,7 +99,7 @@ export class AccordionComponent implements AccordionOptions, OnChanges, OnInit,
9999

100100
private cleanOpenData() {
101101
this.flatten(this.data, this.childrenKey, true, false).forEach(
102-
item => item[this.openKey] = undefined
102+
item => {item[this.openKey] = undefined;}
103103
);
104104
}
105105
// 默认激活
@@ -120,19 +120,19 @@ export class AccordionComponent implements AccordionOptions, OnChanges, OnInit,
120120
const prevActiveItem = this.activeItem;
121121
this.activeItemFn(itemEvent.item);
122122
this.itemClick.emit({...itemEvent, prevActiveItem: prevActiveItem});
123-
}
123+
};
124124

125125
linkItemClickFn = (itemEvent: AccordionItemClickEvent) => {
126126
const prevActiveItem = this.activeItem;
127127
this.activeItem = itemEvent.item;
128128
this.itemClick.emit({...itemEvent, prevActiveItem: prevActiveItem});
129-
}
129+
};
130130

131131
// 打开或关闭可折叠菜单
132132
public menuToggleFn = (menuEvent: AccordionMenuToggleEvent) => {
133133
this.openMenuFn(menuEvent.item, menuEvent.open);
134134
this.menuToggle.emit(menuEvent);
135-
}
135+
};
136136

137137
// 激活子菜单项并去掉其他子菜单的激活
138138
activeItemFn(item) {

devui/accordion/accordion.type.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface IAccordionLinkable {
2323
}
2424
export interface AccordionBaseItem
2525
extends AccordionBase,
26-
IAccordionActiveable {
26+
IAccordionActiveable {
2727
}
2828
export interface AccordionBaseMenu<T>
2929
extends AccordionBase,
@@ -37,9 +37,9 @@ export interface AccordionLinkableItem
3737
}
3838
export interface AccordionMenuItem
3939
extends AccordionBase,
40-
IAccordionActiveable,
41-
IAccordionFoldable<AccordionMenuItem>,
42-
IAccordionLinkable {
40+
IAccordionActiveable,
41+
IAccordionFoldable<AccordionMenuItem>,
42+
IAccordionLinkable {
4343
}
4444

4545
export type AccordionMenuType = Array<AccordionMenuItem>;

devui/accordion/demo/accordion-demo.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnDestroy, OnInit } from '@angular/core';
2-
import { TranslateService, TranslationChangeEvent } from '@ngx-translate/core';
32
import { DevuiSourceData } from 'ng-devui/shared/devui-codebox/devui-source-data';
3+
import { TranslateService, TranslationChangeEvent } from '@ngx-translate/core';
44
import { Subscription } from 'rxjs';
55
@Component({
66
selector: 'd-accordion-demo',

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ import { TemplateComponent } from './template/template.component';
5151
ChangeKeyComponent,
5252
],
5353
providers: [],
54-
54+
5555
})
5656
export class AccordionDemoModule {}

0 commit comments

Comments
 (0)