Browse Source
Merge pull request #16173 from abpframework/fix/16171
fix card component lint errors
pull/16189/head
Masum ULU
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with
57 additions and
70 deletions
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-footer.component.ts
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-header.component.ts
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-header.directive.ts
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-img-top.directive.ts
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-subtitle.directive.ts
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.directive.ts
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts
-
npm/ng-packs/packages/theme-shared/src/lib/components/card/card.module.ts
-
npm/ng-packs/packages/theme-shared/src/lib/tests/card-header.directive.spec.ts
-
npm/ng-packs/packages/theme-shared/src/lib/tests/card-img-top.directive.spec.ts
-
npm/ng-packs/packages/theme-shared/src/lib/tests/card-subtitle.directive.spec.ts
-
npm/ng-packs/packages/theme-shared/src/lib/tests/card-title.directive.spec.ts
-
npm/ng-packs/packages/theme-shared/src/lib/tests/card.component.spec.ts
|
|
|
@ -1,16 +1,13 @@ |
|
|
|
import { Component, Input } from '@angular/core'; |
|
|
|
import { Component, HostBinding, Input } from '@angular/core'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'abp-card-body', |
|
|
|
template: ` |
|
|
|
<div [ngClass]="cardBodyClass" [ngStyle]="cardBodyStyle" > |
|
|
|
<ng-content></ng-content> |
|
|
|
</div>`,
|
|
|
|
host: { |
|
|
|
class: 'card-body', |
|
|
|
} |
|
|
|
template: ` <div [ngClass]="cardBodyClass" [ngStyle]="cardBodyStyle">
|
|
|
|
<ng-content></ng-content> |
|
|
|
</div>`,
|
|
|
|
}) |
|
|
|
export class CardBodyComponent { |
|
|
|
@HostBinding('class') componentClass = 'card-body'; |
|
|
|
@Input() cardBodyClass: string; |
|
|
|
@Input() cardBodyStyle: string; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,19 +1,16 @@ |
|
|
|
import { Component, Input } from '@angular/core'; |
|
|
|
import { Component, HostBinding, Input } from '@angular/core'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'abp-card-footer', |
|
|
|
template: ` |
|
|
|
<div [ngStyle]="cardFooterStyle" [ngClass]="cardFooterClass" > |
|
|
|
<ng-content ></ng-content> |
|
|
|
<div [ngStyle]="cardFooterStyle" [ngClass]="cardFooterClass"> |
|
|
|
<ng-content></ng-content> |
|
|
|
</div> |
|
|
|
`,
|
|
|
|
styles: [], |
|
|
|
host: { |
|
|
|
class: 'card-footer', |
|
|
|
} |
|
|
|
}) |
|
|
|
export class CardFooterComponent { |
|
|
|
@HostBinding('class') componentClass = 'card-footer'; |
|
|
|
@Input() cardFooterStyle: string; |
|
|
|
@Input() cardFooterClass: string; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -1,18 +1,16 @@ |
|
|
|
import { Component, Input } from '@angular/core'; |
|
|
|
import { Component, HostBinding, Input } from '@angular/core'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'abp-card-header', |
|
|
|
template: ` |
|
|
|
<div [ngClass]="cardHeaderClass" [ngStyle]="cardHeaderStyle"> |
|
|
|
<ng-content ></ng-content> |
|
|
|
<ng-content></ng-content> |
|
|
|
</div> |
|
|
|
`,
|
|
|
|
styles: [], |
|
|
|
host: { |
|
|
|
class: 'card-header', |
|
|
|
} |
|
|
|
}) |
|
|
|
export class CardHeaderComponent { |
|
|
|
@HostBinding('class') componentClass = 'card-header'; |
|
|
|
@Input() cardHeaderClass: string; |
|
|
|
@Input() cardHeaderStyle: string; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,9 +1,8 @@ |
|
|
|
import { Directive } from "@angular/core"; |
|
|
|
import { Directive, HostBinding } from '@angular/core'; |
|
|
|
|
|
|
|
@Directive({ |
|
|
|
selector: `abp-card-header, [abp-card-header], [abpCardHeader]`, |
|
|
|
host: { |
|
|
|
class: 'card-header', |
|
|
|
}, |
|
|
|
}) |
|
|
|
export class CardHeader {} |
|
|
|
export class CardHeaderDirective { |
|
|
|
@HostBinding('class') directiveClass = 'card-header'; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,9 +1,8 @@ |
|
|
|
import { Directive } from "@angular/core"; |
|
|
|
import { Directive, HostBinding } from '@angular/core'; |
|
|
|
|
|
|
|
@Directive({ |
|
|
|
selector: `abp-card-img-top, [abp-card-img-top], [abpCardImgTop]`, |
|
|
|
host: { |
|
|
|
class: 'card-img-top', |
|
|
|
}, |
|
|
|
}) |
|
|
|
export class CardImgTop {} |
|
|
|
export class CardImgTopDirective { |
|
|
|
@HostBinding('class') directiveClass = 'card-img-top'; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,9 +1,8 @@ |
|
|
|
import { Directive } from "@angular/core"; |
|
|
|
import { Directive, HostBinding } from '@angular/core'; |
|
|
|
|
|
|
|
@Directive({ |
|
|
|
selector: `abp-card-subtitle, [abp-card-subtitle], [abpCardSubtitle]`, |
|
|
|
host: { |
|
|
|
class: 'card-subtitle', |
|
|
|
}, |
|
|
|
}) |
|
|
|
export class CardSubtitle {} |
|
|
|
export class CardSubtitleDirective { |
|
|
|
@HostBinding('class') directiveClass = 'card-subtitle'; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,9 +1,8 @@ |
|
|
|
import { Directive } from "@angular/core"; |
|
|
|
import { Directive, HostBinding } from '@angular/core'; |
|
|
|
|
|
|
|
@Directive({ |
|
|
|
selector: `abp-card-title, [abp-card-title], [abpCardTitle]`, |
|
|
|
host: { |
|
|
|
class: 'card-title', |
|
|
|
}, |
|
|
|
}) |
|
|
|
export class CardTitle {} |
|
|
|
export class CardTitleDirective { |
|
|
|
@HostBinding('class') directiveClass = 'card-title'; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,5 +1,4 @@ |
|
|
|
import { Component, Directive, Input } from '@angular/core'; |
|
|
|
|
|
|
|
import { Component, Input } from '@angular/core'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'abp-card', |
|
|
|
|
|
|
|
@ -4,20 +4,20 @@ import { CardBodyComponent } from './card-body.component'; |
|
|
|
import { CardComponent } from './card.component'; |
|
|
|
import { CardHeaderComponent } from './card-header.component'; |
|
|
|
import { CardFooterComponent } from './card-footer.component'; |
|
|
|
import { CardTitle } from './card-title.directive'; |
|
|
|
import { CardSubtitle } from './card-subtitle.directive'; |
|
|
|
import { CardImgTop } from './card-img-top.directive'; |
|
|
|
import { CardHeader } from './card-header.directive'; |
|
|
|
import { CardTitleDirective } from './card-title.directive'; |
|
|
|
import { CardSubtitleDirective } from './card-subtitle.directive'; |
|
|
|
import { CardImgTopDirective } from './card-img-top.directive'; |
|
|
|
import { CardHeaderDirective } from './card-header.directive'; |
|
|
|
|
|
|
|
const declarationsWithExports = [ |
|
|
|
CardComponent, |
|
|
|
CardBodyComponent, |
|
|
|
CardHeaderComponent, |
|
|
|
CardFooterComponent, |
|
|
|
CardTitle, |
|
|
|
CardSubtitle, |
|
|
|
CardImgTop, |
|
|
|
CardHeader, |
|
|
|
CardTitleDirective, |
|
|
|
CardSubtitleDirective, |
|
|
|
CardImgTopDirective, |
|
|
|
CardHeaderDirective, |
|
|
|
]; |
|
|
|
|
|
|
|
@NgModule({ |
|
|
|
@ -25,4 +25,4 @@ const declarationsWithExports = [ |
|
|
|
imports: [CommonModule], |
|
|
|
exports: [...declarationsWithExports], |
|
|
|
}) |
|
|
|
export class CardModule { } |
|
|
|
export class CardModule {} |
|
|
|
|
|
|
|
@ -1,10 +1,10 @@ |
|
|
|
import { createHostFactory, SpectatorHost } from '@ngneat/spectator'; |
|
|
|
import { CardHeader } from '../components'; |
|
|
|
import { CardHeaderDirective } from '../components'; |
|
|
|
|
|
|
|
describe('AbpCardHeaderDirective', () => { |
|
|
|
let spectator: SpectatorHost<CardHeader>; |
|
|
|
let spectator: SpectatorHost<CardHeaderDirective>; |
|
|
|
|
|
|
|
const createHost = createHostFactory(CardHeader); |
|
|
|
const createHost = createHostFactory(CardHeaderDirective); |
|
|
|
|
|
|
|
beforeEach( |
|
|
|
() => |
|
|
|
|
|
|
|
@ -1,10 +1,10 @@ |
|
|
|
import { createHostFactory, SpectatorHost } from '@ngneat/spectator'; |
|
|
|
import { CardImgTop } from '../components'; |
|
|
|
import { CardImgTopDirective } from '../components'; |
|
|
|
|
|
|
|
describe('AbpCardImgTopDirective', () => { |
|
|
|
let spectator: SpectatorHost<CardImgTop>; |
|
|
|
let spectator: SpectatorHost<CardImgTopDirective>; |
|
|
|
|
|
|
|
const createHost = createHostFactory(CardImgTop); |
|
|
|
const createHost = createHostFactory(CardImgTopDirective); |
|
|
|
|
|
|
|
beforeEach( |
|
|
|
() => |
|
|
|
|
|
|
|
@ -1,10 +1,10 @@ |
|
|
|
import { createHostFactory, SpectatorHost } from '@ngneat/spectator'; |
|
|
|
import { CardSubtitle } from '../components'; |
|
|
|
import { CardSubtitleDirective } from '../components'; |
|
|
|
|
|
|
|
describe('AbpCardSubtitleDirective', () => { |
|
|
|
let spectator: SpectatorHost<CardSubtitle>; |
|
|
|
let spectator: SpectatorHost<CardSubtitleDirective>; |
|
|
|
|
|
|
|
const createHost = createHostFactory(CardSubtitle); |
|
|
|
const createHost = createHostFactory(CardSubtitleDirective); |
|
|
|
|
|
|
|
beforeEach(() => (spectator = createHost(`<p abpCardSubtitle>CardSubtitle</p>`))); |
|
|
|
|
|
|
|
|
|
|
|
@ -1,10 +1,10 @@ |
|
|
|
import { createHostFactory, SpectatorHost } from '@ngneat/spectator'; |
|
|
|
import { CardTitle } from '../components'; |
|
|
|
import { CardTitleDirective } from '../components'; |
|
|
|
|
|
|
|
describe('AbpCardTitleDirective', () => { |
|
|
|
let spectator: SpectatorHost<CardTitle>; |
|
|
|
let spectator: SpectatorHost<CardTitleDirective>; |
|
|
|
|
|
|
|
const createHost = createHostFactory(CardTitle); |
|
|
|
const createHost = createHostFactory(CardTitleDirective); |
|
|
|
|
|
|
|
beforeEach(() => (spectator = createHost(`<h5 abpCardTitle>CardTitle</h5>`))); |
|
|
|
|
|
|
|
|
|
|
|
@ -4,10 +4,10 @@ import { |
|
|
|
CardBodyComponent, |
|
|
|
CardFooterComponent, |
|
|
|
CardHeaderComponent, |
|
|
|
CardHeader, |
|
|
|
CardTitle, |
|
|
|
CardImgTop, |
|
|
|
CardSubtitle, |
|
|
|
CardHeaderDirective, |
|
|
|
CardTitleDirective, |
|
|
|
CardImgTopDirective, |
|
|
|
CardSubtitleDirective, |
|
|
|
} from '../components/card'; |
|
|
|
|
|
|
|
describe('CardComponent', () => { |
|
|
|
@ -17,10 +17,10 @@ describe('CardComponent', () => { |
|
|
|
component: CardComponent, |
|
|
|
declarations: [ |
|
|
|
CardHeaderComponent, |
|
|
|
CardTitle, |
|
|
|
CardSubtitle, |
|
|
|
CardTitleDirective, |
|
|
|
CardSubtitleDirective, |
|
|
|
CardBodyComponent, |
|
|
|
CardImgTop, |
|
|
|
CardImgTopDirective, |
|
|
|
CardFooterComponent, |
|
|
|
], |
|
|
|
}); |
|
|
|
|