Skip to content

Commit 7a14d77

Browse files
authored
Merge pull request #2592 from Akshat55/issue.2591
fix: Align search icon to be in center
2 parents 2daf5a7 + f9e2c1b commit 7a14d77

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

src/table/stories/app-function-override-filter-table.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import { TableModel } from "../table-model.class";
77
import { TableHeaderItem } from "../table-header-item.class";
88
import { TableItem } from "../table-item.class";
99

10+
import { IconService } from "../../icon/icon.service";
11+
import Add16 from "@carbon/icons/es/add/16";
12+
import Filter16 from "@carbon/icons/es/filter/16";
13+
1014
@Component({
1115
selector: "app-function-override-filter-table",
1216
template: `
@@ -139,6 +143,12 @@ export class FilterByFunctionOverrideStory implements OnInit {
139143
]
140144
];
141145

146+
constructor(protected iconService: IconService) {
147+
this.iconService.registerAll([
148+
Add16, Filter16
149+
]);
150+
}
151+
142152
filterNodeNames(searchString: string) {
143153
this.searchValue = searchString;
144154
}

src/table/stories/app-model-filter-table.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import { TableModel } from "../table-model.class";
77
import { TableHeaderItem } from "../table-header-item.class";
88
import { TableItem } from "../table-item.class";
99

10+
import { IconService } from "../../icon/icon.service";
11+
import Add16 from "@carbon/icons/es/add/16";
12+
import Filter16 from "@carbon/icons/es/filter/16";
13+
1014
@Component({
1115
selector: "app-model-filter-table",
1216
template: `
@@ -138,6 +142,12 @@ export class FilterWithModelStory implements OnInit {
138142
]
139143
];
140144

145+
constructor(protected iconService: IconService) {
146+
this.iconService.registerAll([
147+
Add16, Filter16
148+
]);
149+
}
150+
141151
filterNodeNames(searchString: string) {
142152
this.model.data = this.dataset
143153
.filter((row: TableItem[]) => row[1].data.toLowerCase().includes(searchString.toLowerCase()));

src/table/table.stories.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* tslint:disable variable-name */
22

33
import { moduleMetadata, Meta, Story } from "@storybook/angular";
4+
import { FormsModule } from "@angular/forms";
45
import { NFormsModule } from "../forms";
56
import { ButtonModule } from "../button";
67
import { IconModule } from "../icon/icon.module";
@@ -82,6 +83,7 @@ export default {
8283
moduleMetadata({
8384
imports: [
8485
NFormsModule,
86+
FormsModule,
8587
TableModule,
8688
PaginationModule,
8789
DialogModule,
@@ -596,7 +598,7 @@ WithPagination.args = {
596598
const FromComponentsTemplate: Story = (args) => ({
597599
props: args,
598600
template: `
599-
<table cdsTable [sortable]="false" style="width: 650px;">
601+
<table cdsTable [sortable]="false">
600602
<thead cdsTableHead>
601603
<tr>
602604
<th

src/table/toolbar/table-toolbar-search.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { NG_VALUE_ACCESSOR } from "@angular/forms";
2222
export class TableToolbarSearch extends Search implements AfterViewInit {
2323
tableSearch = true;
2424

25+
size: "sm" | "md" | "lg" = "lg";
26+
2527
@HostBinding("class.cds--toolbar-content") hostClass = true;
2628

2729
ngAfterViewInit() {

0 commit comments

Comments
 (0)