Skip to content

Commit 41fbae0

Browse files
authoredNov 27, 2022
fix(abc:st): fix miss built-in style in head (#1560)
1 parent c74c992 commit 41fbae0

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed
 

‎packages/abc/st/st-column-source.ts

+12-10
Original file line numberDiff line numberDiff line change
@@ -372,16 +372,18 @@ export class STColumnSource {
372372
}
373373
const rawClassName = item.className;
374374
if (!rawClassName) {
375-
builtInClassNames.push(
376-
(
377-
{
378-
number: 'text-right',
379-
currency: 'text-right',
380-
date: 'text-center'
381-
} as NzSafeAny
382-
)[item.type!]
383-
);
384-
item._className = builtInClassNames.filter(w => !!w);
375+
const typeClass = (
376+
{
377+
number: 'text-right',
378+
currency: 'text-right',
379+
date: 'text-center'
380+
} as NzSafeAny
381+
)[item.type!];
382+
if (typeClass) {
383+
builtInClassNames.push(typeClass);
384+
}
385+
item._className = builtInClassNames;
386+
item._classNameInHeader = builtInClassNames;
385387
return;
386388
}
387389

‎packages/abc/st/st.component.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
[nzWidth]="$any(_c).width"
6868
[nzLeft]="_c._left!"
6969
[nzRight]="_c._right!"
70-
[ngClass]="_c.className!"
71-
[class.text-truncate]="_c._isTruncate"
70+
[ngClass]="_c._classNameInHeader"
7271
[attr.data-col]="_c.indexKey"
7372
[attr.data-col-index]="index"
7473
[nzShowSort]="_c._sort.enabled"

‎packages/abc/st/st.types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export interface _STColumn extends STColumn {
3434
* 校验需要未自定义 `className` 时应检查 `_isTruncate` 是否需要截短行为
3535
*/
3636
_className?: string | string[] | Set<string> | { [klass: string]: any } | null;
37+
_classNameInHeader?: string | string[] | Set<string> | { [klass: string]: any } | null | undefined;
3738
_sort: STSortMap;
3839
_width?: number;
3940
_left?: string | boolean;

0 commit comments

Comments
 (0)
Please sign in to comment.