Skip to content
This repository was archived by the owner on Jun 22, 2020. It is now read-only.

Commit e28e1b7

Browse files
committed
chore: fixing bugs
1 parent 1ff1519 commit e28e1b7

File tree

8 files changed

+18
-10
lines changed

8 files changed

+18
-10
lines changed

projects/table-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-ru/ng-table-builder",
3-
"version": "1.6.0",
3+
"version": "2.0.0",
44
"license": "MIT",
55
"bugs": {
66
"url": "https://github.com/Angular-RU/ng-table-builder/issues"

projects/table-builder/src/lib/table/components/ngx-column/ngx-column.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class NgxColumnComponent extends ColumnOptions {
1919
@Input('custom-key') public customKey: boolean = false;
2020
@Input('sticky-end') public stickyRight: boolean = false;
2121
@Input('vertical-line') public verticalLine: boolean = false;
22-
@Input('overflow-tooltip') public overflowTooltip: boolean = true;
22+
@Input('overflow-tooltip') public overflowTooltip: boolean | undefined = undefined;
2323
@Input('important-template') public importantTemplate: boolean = false;
2424
@ContentChild(TemplateHeadThDirective, { static: false }) public th: TemplateHeadThDirective;
2525
@ContentChild(TemplateBodyTdDirective, { static: false }) public td: TemplateBodyTdDirective;

projects/table-builder/src/lib/table/services/template-parser/template-parser.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export class TemplateParserService {
124124
const thOptions: TableCellOptions = TemplateParserService.templateContext(key, thTemplate, this.columnOptions);
125125
const stickyLeft: boolean = getValidHtmlBooleanAttribute(column.stickyLeft);
126126
const stickyRight: boolean = getValidHtmlBooleanAttribute(column.stickyRight);
127+
const isCustomKey: boolean = getValidHtmlBooleanAttribute(column.customKey);
127128
const canBeAddDraggable: boolean = !(stickyLeft || stickyRight);
128129
const isModel: boolean = this.keyMap[key];
129130

@@ -136,7 +137,7 @@ export class TemplateParserService {
136137
td: TemplateParserService.templateContext(key, tdTemplate, this.columnOptions),
137138
stickyLeft: getValidHtmlBooleanAttribute(column.stickyLeft),
138139
stickyRight: getValidHtmlBooleanAttribute(column.stickyRight),
139-
customColumn: getValidHtmlBooleanAttribute(column.customKey),
140+
customColumn: isCustomKey,
140141
width: getValidPredicate(column.width, this.columnOptions.width),
141142
cssClass: getValidPredicate(column.cssClass, this.columnOptions.cssClass) || [],
142143
cssStyle: getValidPredicate(column.cssStyle, this.columnOptions.cssStyle) || [],
@@ -154,7 +155,10 @@ export class TemplateParserService {
154155
? getValidHtmlBooleanAttribute(getValidPredicate(column.isDraggable, this.columnOptions.isDraggable))
155156
: false,
156157
overflowTooltip: getValidHtmlBooleanAttribute(
157-
getValidPredicate(this.columnOptions.overflowTooltip, column.overflowTooltip)
158+
getValidPredicate(
159+
this.columnOptions.overflowTooltip,
160+
typeof column.overflowTooltip === 'boolean' ? column.overflowTooltip : !isCustomKey
161+
)
158162
),
159163
th: {
160164
...thOptions,

projects/table-builder/src/lib/table/styles/common.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
}
2323

2424
.table-grid {
25-
box-shadow: 0 0 10px -2px #e0e0e0;
2625
border: 1px solid #e0e0e0;
26+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0);
2727
}
2828

2929
&.table-grid__root--content-is-init {
@@ -33,6 +33,7 @@
3333
&.table-grid__root--is-rendered {
3434
opacity: 1;
3535
transition: all 0.2s;
36+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0);
3637
}
3738
}
3839

projects/table-builder/src/lib/table/table-builder.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,12 @@ export class TableBuilderComponent extends TableBuilderApiImpl
544544

545545
private listenSelectionChanges(): void {
546546
if (this.isEnableSelection) {
547-
this.selection.onChanges.pipe(takeUntil(this.destroy$)).subscribe((): void => detectChanges(this.cd));
547+
this.selection.onChanges.pipe(takeUntil(this.destroy$)).subscribe((): void => {
548+
detectChanges(this.cd);
549+
this.ngZone.runOutsideAngular((): void => {
550+
window.requestAnimationFrame((): void => this.app.tick());
551+
});
552+
});
548553
}
549554
}
550555

src/app/samples/sample-fourteen/sample-fourteen.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
</ng-template>
6161
</ngx-column>
6262

63-
<ngx-column custom-key key="action" sticky-end width="50" [overflow-tooltip]="false" empty-head>
63+
<ngx-column custom-key key="action" sticky-end width="50" empty-head>
6464
<ng-template ngx-td>
6565
<mat-icon>all_inbox</mat-icon>
6666
</ng-template>

src/app/samples/sample-sixteen/sample-sixteen.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
<ngx-column *ngFor="let key of table.modelColumnKeys" [key]="key"></ngx-column>
5454

55-
<ngx-column key="edit" custom-key width="100" vertical-line sticky-end empty-head>
55+
<ngx-column key="edit" custom-key width="60" vertical-line sticky-end empty-head>
5656
<ng-template ngx-td row>
5757
<button mat-button><mat-icon>info</mat-icon></button>
5858
</ng-template>

src/app/samples/sample-third/sample-third.component.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
</mat-toolbar>
99

1010
<ngx-table-builder #table [source]="data" enable-selection [produce-disable-fn]="disableFn">
11-
<ngx-options [overflow-tooltip]="false"></ngx-options>
12-
1311
<ngx-column key="selection" sticky width="55" custom-key>
1412
<ng-template ngx-th>
1513
<mat-checkbox

0 commit comments

Comments
 (0)