Skip to content

Commit b37298b

Browse files
committed
chore: lint fix
Signed-off-by: Akshat Patel <[email protected]>
1 parent 385661a commit b37298b

File tree

7 files changed

+38
-54
lines changed

7 files changed

+38
-54
lines changed

src/file-uploader/file-uploader.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class FileUploader implements ControlValueAccessor {
169169
/**
170170
* Custom template used to render the file name of uploaded files
171171
*/
172-
@Input() fileNameTpl: TemplateRef<unknown>
172+
@Input() fileNameTpl: TemplateRef<unknown>;
173173
/**
174174
* Custom template used to render the file actions of uploaded files
175175
*/

src/file-uploader/file.component.ts

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Input,
66
OnDestroy,
77
Output,
8-
TemplateRef,
8+
TemplateRef
99
} from "@angular/core";
1010

1111
import { I18n } from "carbon-components-angular/i18n";
@@ -18,25 +18,20 @@ import { FileItem } from "./file-item.interface";
1818
<ng-template
1919
*ngIf="isTemplate(nameTpl); else defaultName"
2020
[ngTemplateOutlet]="nameTpl"
21-
[ngTemplateOutletContext]="{ $implicit: fileItem }"
22-
>
21+
[ngTemplateOutletContext]="{ $implicit: fileItem }">
2322
</ng-template>
2423
<ng-template #defaultName>{{ fileItem.file.name }}</ng-template>
2524
</p>
26-
<span
27-
*ngIf="fileItem.state === 'edit'"
28-
class="cds--file__state-container"
29-
>
25+
<span *ngIf="fileItem.state === 'edit'" class="cds--file__state-container">
3026
<svg
3127
*ngIf="isInvalidText"
3228
cdsIcon="warning--filled"
3329
class="cds--file--invalid"
34-
size="16"
35-
></svg>
30+
size="16">
31+
</svg>
3632
<ng-template
3733
*ngIf="isTemplate(actionsTpl); else defaultActions"
38-
[ngTemplateOutlet]="actionsTpl"
39-
>
34+
[ngTemplateOutlet]="actionsTpl">
4035
</ng-template>
4136
<ng-template #defaultActions>
4237
<button
@@ -47,8 +42,7 @@ import { FileItem } from "./file-item.interface";
4742
[attr.aria-label]="translations.REMOVE_BUTTON"
4843
(click)="remove.emit()"
4944
(keyup.enter)="remove.emit()"
50-
(keyup.space)="remove.emit()"
51-
>
45+
(keyup.space)="remove.emit()">
5246
<svg cdsIcon="trash-can" size="16"></svg>
5347
</button>
5448
</ng-template>
@@ -60,28 +54,26 @@ import { FileItem } from "./file-item.interface";
6054
</span>
6155
<span
6256
*ngIf="fileItem.state === 'complete'"
63-
class="cds--file__state-container"
64-
>
57+
class="cds--file__state-container">
6558
<svg
6659
cdsIcon="checkmark--filled"
6760
size="16"
6861
class="cds--file-complete"
69-
[ariaLabel]="translations.CHECKMARK"
70-
></svg>
62+
[ariaLabel]="translations.CHECKMARK">
63+
</svg>
7164
</span>
7265
<div
7366
class="cds--form-requirement"
7467
role="alert"
75-
*ngIf="fileItem.invalid"
76-
>
68+
*ngIf="fileItem.invalid">
7769
<div class="cds--form-requirement__title">
7870
{{ fileItem.invalidTitle }}
7971
</div>
8072
<p class="cds--form-requirement__supplement">
8173
{{ fileItem.invalidText }}
8274
</p>
8375
</div>
84-
`,
76+
`
8577
})
8678
export class FileComponent implements OnDestroy {
8779
/**
@@ -109,8 +101,7 @@ export class FileComponent implements OnDestroy {
109101

110102
@HostBinding("class.cds--file__selected-file") selectedFile = true;
111103

112-
@HostBinding("class.cds--file__selected-file--invalid")
113-
get isInvalidText() {
104+
@HostBinding("class.cds--file__selected-file--invalid") get isInvalidText() {
114105
return this.fileItem.invalidText;
115106
}
116107

src/file-uploader/file.stories.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@ export default {
1515
CustomFileIconsModule,
1616
FileUploaderModule,
1717
IconModule
18-
],
19-
}),
18+
]
19+
})
2020
],
2121
args: {
22-
size: "md",
22+
size: "md"
2323
},
2424
argTypes: {
2525
size: {
2626
options: ["sm", "md", "lg"],
27-
control: "radio",
28-
},
27+
control: "radio"
28+
}
2929
},
30-
component: FileComponent,
30+
component: FileComponent
3131
} as Meta;
3232

3333
const BasicFileTemplate = (args) => ({
3434
props: args,
3535
size: {
3636
options: ["sm", "md", "lg"],
37-
control: "radio",
37+
control: "radio"
3838
},
3939
template: `
4040
<!--
@@ -43,15 +43,15 @@ const BasicFileTemplate = (args) => ({
4343
https://github.com/IBM/carbon-components-angular/tree/master/src/file-uploader/stories/basic-file.component.ts
4444
-->
4545
<app-basic-file [size]="size"></app-basic-file>
46-
`,
46+
`
4747
});
4848
export const BasicFile = BasicFileTemplate.bind({});
4949

5050
const CustomFileTemplate = (args) => ({
5151
props: args,
5252
size: {
5353
options: ["sm", "md", "lg"],
54-
control: "radio",
54+
control: "radio"
5555
},
5656
template: `
5757
<!--
@@ -60,6 +60,6 @@ const CustomFileTemplate = (args) => ({
6060
https://github.com/IBM/carbon-components-angular/tree/master/src/file-uploader/stories/custom-file.component.ts
6161
-->
6262
<app-custom-file [size]="size"></app-custom-file>
63-
`,
63+
`
6464
});
6565
export const CustomFile = CustomFileTemplate.bind({});

src/file-uploader/stories/basic-file.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { Component, Input } from "@angular/core";
22

33
@Component({
44
selector: "app-basic-file",
5-
template: `<cds-file [size]="size" [fileItem]="fileItem"></cds-file>`,
5+
template: `<cds-file [size]="size" [fileItem]="fileItem"></cds-file>`
66
})
77
export class BasicFileStory {
88
@Input() size = "sm";
99

1010
fileItem = {
1111
file: new File(["foo"], "Lorem ipsum dolor sit amet.txt", { type: "text/plain" }),
12-
state: "edit",
12+
state: "edit"
1313
};
1414
}

src/file-uploader/stories/custom-file-icons.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import View16 from "@carbon/icons/es/view/16";
66
import { IconModule, IconService } from "../../icon";
77

88
@NgModule({
9-
imports: [CommonModule, IconModule],
9+
imports: [CommonModule, IconModule]
1010
})
1111
export class CustomFileIconsModule {
1212
constructor(private iconService: IconService) {

src/file-uploader/stories/custom-file.component.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import { Component, Input } from "@angular/core";
77
[size]="size"
88
[fileItem]="fileItem"
99
[nameTpl]="nameTpl"
10-
[actionsTpl]="actionsTpl"
11-
>
10+
[actionsTpl]="actionsTpl">
1211
</cds-file>
1312
1413
<ng-template #nameTpl let-fileItem>
@@ -20,29 +19,27 @@ import { Component, Input } from "@angular/core";
2019
ibmButton="ghost"
2120
iconOnly="true"
2221
aria-label="View"
23-
[size]="size"
24-
>
22+
[size]="size">
2523
<svg ibmIcon="view" size="16"></svg>
2624
</button>
2725
<button
2826
ibmButton="ghost"
2927
iconOnly="true"
3028
aria-label="Download"
31-
[size]="size"
32-
>
29+
[size]="size">
3330
<svg ibmIcon="download" size="16"></svg>
3431
</button>
3532
</ng-template>
3633
`,
37-
styles: [],
34+
styles: []
3835
})
3936
export class CustomFileStory {
4037
@Input() size = "sm";
4138

4239
fileItem = {
4340
file: new File(["foo"], "Lorem ipsum dolor sit amet.txt", {
44-
type: "text/plain",
41+
type: "text/plain"
4542
}),
46-
state: "edit",
43+
state: "edit"
4744
};
4845
}

src/file-uploader/stories/uploader-custom-file.component.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ import { FileItem } from "../";
1818
[fileItemSize]="fileItemSize"
1919
[disabled]="disabled"
2020
[fileNameTpl]="nameTpl"
21-
[fileActionsTpl]="actionsTpl"
22-
>
21+
[fileActionsTpl]="actionsTpl">
2322
</cds-file-uploader>
2423
<button
2524
cdsButton
2625
*ngIf="files && files.size > 0"
2726
(click)="onUpload()"
28-
style="margin-top:20px"
29-
>
27+
style="margin-top:20px">
3028
Upload
3129
</button>
3230
@@ -39,20 +37,18 @@ import { FileItem } from "../";
3937
ibmButton="ghost"
4038
iconOnly="true"
4139
aria-label="View"
42-
[size]="fileItemSize"
43-
>
40+
[size]="fileItemSize">
4441
<svg ibmIcon="view" size="16"></svg>
4542
</button>
4643
<button
4744
ibmButton="ghost"
4845
iconOnly="true"
4946
aria-label="Download"
50-
[size]="fileItemSize"
51-
>
47+
[size]="fileItemSize">
5248
<svg ibmIcon="download" size="16"></svg>
5349
</button>
5450
</ng-template>
55-
`,
51+
`
5652
})
5753
export class FileUploaderWithCustomFileStory {
5854
@Input() files = new Set<FileItem>();

0 commit comments

Comments
 (0)