Skip to content

Commit

Permalink
chore(release): release 12.3.0 (#171)
Browse files Browse the repository at this point in the history
Co-authored-by: huaweidevcloud <[email protected]>
  • Loading branch information
wangyaju and huaweidevcloud authored Dec 28, 2021
1 parent dc5d9ce commit 5a9057c
Show file tree
Hide file tree
Showing 594 changed files with 11,016 additions and 6,528 deletions.
145 changes: 145 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
module.exports = {
rules: {
"no-useless-constructor": "off",
"no-useless-concat":"off",
"max-params": "off",
"@typescript-eslint/no-useless-constructor": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "off",
"@angular-eslint/component-class-suffix": ["error", { suffixes: ["Component", "Directive"] }],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "d",
"style": "kebab-case"
}
],
"@angular-eslint/directive-class-suffix":["error", { suffixes: ["Component", "Directive"] }],
"@angular-eslint/directive-selector": [
"error",
{
"type": ["attribute","element"],
"prefix": "d",
"style": "camelCase"
}
],
"@angular-eslint/no-host-metadata-property": "error",
"@angular-eslint/no-input-rename": "off",
"@angular-eslint/no-inputs-metadata-property": "error",
"@angular-eslint/no-output-on-prefix": "error",
"@angular-eslint/no-output-rename": "error",
"@angular-eslint/no-outputs-metadata-property": "error",
"@angular-eslint/use-lifecycle-interface": "error",
"@angular-eslint/use-pipe-transform-interface": "error",
"complexity": [
'error',
{
max: 40,
},
],

"curly": "error",
"eol-last": "error",
"eqeqeq": [
"error",
"smart"
],
"max-len": [
"error",
{
"code": 140
}
],
"no-console": [
"error",
{
"allow": [
"log",
"warn",
"dir",
"timeLog",
"assert",
"clear",
"count",
"countReset",
"group",
"groupEnd",
"table",
"dirxml",
"error",
"groupCollapsed",
"Console",
"profile",
"profileEnd",
"timeStamp",
"context"
]
}
],

"no-multiple-empty-lines": "error",
"no-shadow": "off", // 使用@typescript-eslint/no-shadow,规避使用enum类型报错
"no-trailing-spaces": "error",
"no-unused-labels": "error",
"no-use-before-define": "error",
"no-var": "error",
"prefer-const": "error",
"semi": "error",
"space-in-parens": [
"error",
"never"
],
"spaced-comment": [
"error",
"always"
],
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/indent": [
"error",
2,
{
"FunctionDeclaration": {
"parameters": "first"
},
"FunctionExpression": {
"parameters": "first"
}
}
],
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/no-shadow":"error",
"@angular-eslint/no-output-on-prefix":"off",
"@angular-eslint/use-pipe-transform-interface":"off",

"prefer-promise-reject-errors": "off",
'max-nested-callbacks': ['error', 6],
"@typescript-eslint/no-this-alias":"off",
"accessor-pairs": "off",
"max-depth": "off",
"@typescript-eslint/member-ordering": "off",
"array-callback-return":"off"
}
};
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ testem.log
Thumbs.db
desktop.ini
debug.log

# package-lock
package-lock.json
34 changes: 10 additions & 24 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
],
"styles": [
"node_modules/highlight.js/styles/an-old-hope.css",
"src/styles.scss"
"src/styles.scss",
"devui/style/layout/devui-layout.scss"
],
"scripts": []
},
Expand Down Expand Up @@ -118,14 +119,11 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
"fix": true,
"lintFilePatterns": [
"src/**/*.ts"
]
}
}
Expand All @@ -147,15 +145,6 @@
"devServerTarget": "devui:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
},
Expand Down Expand Up @@ -194,14 +183,11 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"devui/tsconfig.lib.json",
"devui/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
"fix": true,
"lintFilePatterns": [
"devui/**/*.ts"
]
}
}
Expand Down
1 change: 0 additions & 1 deletion devui/accordion/accordion-base-component.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Directive, HostBinding, Input } from '@angular/core';
import { AccordionBase, AccordionOptions } from './accordion.type';

@Directive()
// tslint:disable-next-line: directive-class-suffix
export abstract class AccordionBaseComponent<T extends AccordionBase> {
@Input() item: any | T;
@Input() deepth = 0;
Expand Down
1 change: 0 additions & 1 deletion devui/accordion/accordion-base-item-component.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { AccordionBaseComponent } from './accordion-base-component.class';
import { AccordionBaseItem, AccordionOptions } from './accordion.type';

@Directive()
// tslint:disable-next-line: directive-class-suffix
export abstract class AccordionBaseItemComponent<T extends AccordionBaseItem> extends AccordionBaseComponent<T> {
get itemTemplate() {
return this.accordion.itemTemplate;
Expand Down
1 change: 0 additions & 1 deletion devui/accordion/accordion-base-link-component.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { AccordionBaseItemComponent } from './accordion-base-item-component.clas
import { AccordionLinkableItem, AccordionOptions } from './accordion.type';

@Directive()
// tslint:disable-next-line: directive-class-suffix
export abstract class AccordionBaseLinkComponent extends AccordionBaseItemComponent<AccordionLinkableItem> {
get link() {
return this.item && this.item[this.accordion.linkKey];
Expand Down
12 changes: 6 additions & 6 deletions devui/accordion/accordion-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ export class AccordionListComponent implements OnInit, OnDestroy {
get routerLinkActived(): boolean {
return (!!this.accordionItemRouterlinkQueryList
&& this.accordionItemRouterlinkQueryList.some(airlc => this.isLinkRouterActive(airlc))
) || (
!!this.accordionMenuQueryList
) || (
!!this.accordionMenuQueryList
&& this.accordionMenuQueryList.some(amc => this.isMenuRouterActive(amc))
);
);
}
get hasActiveChildren(): boolean {
return (!!this.accordionMenuQueryList
&& this.accordionMenuQueryList.some(amc => this.isMenuDataActive(amc)))
|| (!!this.data && !!this.data.length
&& this.data.some(item => this.isItemData(item) && this.isItemDataActive(item))
);
);
}
menuToggleItemFn = (item: any , event?: any) => {
this.accordion.menuToggleFn({
Expand All @@ -118,12 +118,12 @@ export class AccordionListComponent implements OnInit, OnDestroy {
parent: this.parent.parent,
event: event
});
}
};
itemClickItemFn = (item: any, event?: any) => {
this.accordion.itemClickFn({
item: item,
parent: this.parent,
event: event
});
}
};
}
10 changes: 5 additions & 5 deletions devui/accordion/accordion.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class AccordionComponent implements AccordionOptions, OnChanges, OnInit,

ngOnChanges(changes: SimpleChanges) {
if (changes['data']) {
this.initActiveItem();
this.initActiveItem();
}
if (changes['autoOpenActiveMenu']) {
if (this.autoOpenActiveMenu && changes['autoOpenActiveMenu'].previousValue === false) {
Expand Down Expand Up @@ -99,7 +99,7 @@ export class AccordionComponent implements AccordionOptions, OnChanges, OnInit,

private cleanOpenData() {
this.flatten(this.data, this.childrenKey, true, false).forEach(
item => item[this.openKey] = undefined
item => {item[this.openKey] = undefined;}
);
}
// 默认激活
Expand All @@ -120,19 +120,19 @@ export class AccordionComponent implements AccordionOptions, OnChanges, OnInit,
const prevActiveItem = this.activeItem;
this.activeItemFn(itemEvent.item);
this.itemClick.emit({...itemEvent, prevActiveItem: prevActiveItem});
}
};

linkItemClickFn = (itemEvent: AccordionItemClickEvent) => {
const prevActiveItem = this.activeItem;
this.activeItem = itemEvent.item;
this.itemClick.emit({...itemEvent, prevActiveItem: prevActiveItem});
}
};

// 打开或关闭可折叠菜单
public menuToggleFn = (menuEvent: AccordionMenuToggleEvent) => {
this.openMenuFn(menuEvent.item, menuEvent.open);
this.menuToggle.emit(menuEvent);
}
};

// 激活子菜单项并去掉其他子菜单的激活
activeItemFn(item) {
Expand Down
8 changes: 4 additions & 4 deletions devui/accordion/accordion.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface IAccordionLinkable {
}
export interface AccordionBaseItem
extends AccordionBase,
IAccordionActiveable {
IAccordionActiveable {
}
export interface AccordionBaseMenu<T>
extends AccordionBase,
Expand All @@ -37,9 +37,9 @@ export interface AccordionLinkableItem
}
export interface AccordionMenuItem
extends AccordionBase,
IAccordionActiveable,
IAccordionFoldable<AccordionMenuItem>,
IAccordionLinkable {
IAccordionActiveable,
IAccordionFoldable<AccordionMenuItem>,
IAccordionLinkable {
}

export type AccordionMenuType = Array<AccordionMenuItem>;
Expand Down
2 changes: 1 addition & 1 deletion devui/accordion/demo/accordion-demo.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { TranslateService, TranslationChangeEvent } from '@ngx-translate/core';
import { DevuiSourceData } from 'ng-devui/shared/devui-codebox/devui-source-data';
import { TranslateService, TranslationChangeEvent } from '@ngx-translate/core';
import { Subscription } from 'rxjs';
@Component({
selector: 'd-accordion-demo',
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 @@ -51,6 +51,6 @@ import { TemplateComponent } from './template/template.component';
ChangeKeyComponent,
],
providers: [],

})
export class AccordionDemoModule {}
Loading

0 comments on commit 5a9057c

Please sign in to comment.