Skip to content

Commit 4ea94be

Browse files
authored
fix(abc:st): fixed columns not aligned (#1877)
1 parent 26e93cc commit 4ea94be

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

packages/abc/st/st.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@
5858
@for (row of _headers; track row) {
5959
<tr>
6060
@if ($first && expand) {
61-
<th nzWidth="50px" [rowSpan]="_headers.length" [nzLeft]="row[0].column._left! ? true : false"></th>
61+
<th nzWidth="50px" [rowSpan]="_headers.length" [nzLeft]="row[0].column._left ? true : false"></th>
6262
}
6363
@for (h of row; track h; let index = $index; let last = $last) {
6464
@let _c = h.column;
6565
<th
6666
[colSpan]="h.colSpan"
6767
[rowSpan]="h.rowSpan"
6868
[nzWidth]="$any(_c).width"
69-
[nzLeft]="_c._left!"
70-
[nzRight]="_c._right!"
69+
[nzLeft]="_c._left"
70+
[nzRight]="_c._right"
7171
[class]="_c._className"
7272
[attr.data-col]="_c.indexKey"
7373
[attr.data-col-index]="index"
@@ -173,7 +173,7 @@
173173
(nzExpandChange)="_expandChange(i, $event)"
174174
(click)="_stopPropagation($event)"
175175
nzWidth="50px"
176-
[nzLeft]="_columns[0]._left! ? true : false"
176+
[nzLeft]="_columns[0]._left ? true : false"
177177
></td>
178178
<ng-template #wrapExpandIcon>
179179
<span (click)="_expandChange(i, !i.expand)">
@@ -185,8 +185,8 @@
185185
@let props = i._values[cIdx].props;
186186
@if (props?.colSpan > 0 && props?.rowSpan > 0) {
187187
<td
188-
[nzLeft]="!!c._left"
189-
[nzRight]="!!c._right"
188+
[nzLeft]="c._left"
189+
[nzRight]="c._right"
190190
[attr.data-col-index]="cIdx"
191191
[class]="c._className"
192192
[attr.colspan]="props?.colSpan === 1 ? null : props?.colSpan"

packages/abc/st/st.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export interface _STColumn extends STColumn {
4747
_className?: string | string[] | Set<string> | { [klass: string]: any } | null;
4848
_sort: STSortMap;
4949
_width?: number;
50-
_left?: string | boolean;
51-
_right?: string | boolean;
50+
_left: string | boolean;
51+
_right: string | boolean;
5252
__renderTitle?: TemplateRef<any>;
5353
__render?: TemplateRef<any>;
5454
}

packages/abc/st/test/st-data-source.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,12 +515,16 @@ describe('abc: table: data-souce', () => {
515515
{
516516
title: '',
517517
index: 'id1',
518-
_sort: { enabled: true, default: 'descend', key: 'id1' }
518+
_sort: { enabled: true, default: 'descend', key: 'id1' },
519+
_left: false,
520+
_right: false
519521
},
520522
{
521523
title: '',
522524
index: 'id2',
523-
_sort: { enabled: true, default: 'ascend', key: 'id2' }
525+
_sort: { enabled: true, default: 'ascend', key: 'id2' },
526+
_left: false,
527+
_right: false
524528
}
525529
];
526530
options.headers = [

0 commit comments

Comments
 (0)