@libs-ui/components-table 0.2.357-0 → 0.2.357-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/package.json +28 -28
package/README.md
CHANGED
|
@@ -84,11 +84,17 @@ readonly headerStandard: Array<ITableHeaderConfig> = [
|
|
|
84
84
|
field: 'staff_info',
|
|
85
85
|
instance: 'avatar',
|
|
86
86
|
getAvatarConfig: (data) => {
|
|
87
|
-
|
|
87
|
+
// data.value có thể là Signal (data wrap qua convertObjectToSignal / httpRequestData)
|
|
88
|
+
// hoặc object thường → unwrap an toàn; fallback lấy từ row (data.item).
|
|
89
|
+
const unwrap = (v: unknown) => (typeof v === 'function' ? (v as () => unknown)() : v);
|
|
90
|
+
const staffInfo = unwrap((unwrap(data.item) as Record<string, unknown>)?.['staff_info']) ?? unwrap(data.value);
|
|
91
|
+
// Không có dữ liệu avatar → trả false để ẩn HẲN ô (trả undefined sẽ bị render thành icon rỗng).
|
|
92
|
+
if (!staffInfo) return of(false as unknown as IAvatarConfig);
|
|
93
|
+
// link_avatar rỗng/sai → avatar tự fallback sang chữ initials nhờ idGenColor + textAvatar.
|
|
88
94
|
return of({
|
|
89
|
-
linkAvatar:
|
|
90
|
-
idGenColor:
|
|
91
|
-
textAvatar:
|
|
95
|
+
linkAvatar: (staffInfo as { link_avatar?: string }).link_avatar,
|
|
96
|
+
idGenColor: (staffInfo as { username?: string }).username,
|
|
97
|
+
textAvatar: (staffInfo as { name?: string }).name,
|
|
92
98
|
size: 32,
|
|
93
99
|
});
|
|
94
100
|
},
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libs-ui/components-table",
|
|
3
|
-
"version": "0.2.357-
|
|
3
|
+
"version": "0.2.357-2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": ">=18.0.0",
|
|
6
6
|
"@angular/core": ">=18.0.0",
|
|
7
|
-
"@libs-ui/components-buttons-button": "0.2.357-
|
|
7
|
+
"@libs-ui/components-buttons-button": "0.2.357-2",
|
|
8
8
|
"@iharbeck/ngx-virtual-scroller": "15.2.0",
|
|
9
|
-
"@libs-ui/interfaces-types": "0.2.357-
|
|
10
|
-
"@libs-ui/components-buttons-sort": "0.2.357-
|
|
11
|
-
"@libs-ui/components-popover": "0.2.357-
|
|
12
|
-
"@libs-ui/components-avatar": "0.2.357-
|
|
13
|
-
"@libs-ui/components-dropdown": "0.2.357-
|
|
14
|
-
"@libs-ui/components-line-clamp": "0.2.357-
|
|
15
|
-
"@libs-ui/components-list": "0.2.357-
|
|
16
|
-
"@libs-ui/components-switch": "0.2.357-
|
|
17
|
-
"@libs-ui/services-http-request": "0.2.357-
|
|
9
|
+
"@libs-ui/interfaces-types": "0.2.357-2",
|
|
10
|
+
"@libs-ui/components-buttons-sort": "0.2.357-2",
|
|
11
|
+
"@libs-ui/components-popover": "0.2.357-2",
|
|
12
|
+
"@libs-ui/components-avatar": "0.2.357-2",
|
|
13
|
+
"@libs-ui/components-dropdown": "0.2.357-2",
|
|
14
|
+
"@libs-ui/components-line-clamp": "0.2.357-2",
|
|
15
|
+
"@libs-ui/components-list": "0.2.357-2",
|
|
16
|
+
"@libs-ui/components-switch": "0.2.357-2",
|
|
17
|
+
"@libs-ui/services-http-request": "0.2.357-2",
|
|
18
18
|
"rxjs": "~7.8.0",
|
|
19
|
-
"@libs-ui/components-checkbox-group": "0.2.357-
|
|
20
|
-
"@libs-ui/components-checkbox-single": "0.2.357-
|
|
21
|
-
"@libs-ui/components-scroll-overlay": "0.2.357-
|
|
22
|
-
"@libs-ui/components-spinner": "0.2.357-
|
|
23
|
-
"@libs-ui/icons": "0.2.357-
|
|
24
|
-
"@libs-ui/pipes-call-function-in-template": "0.2.357-
|
|
25
|
-
"@libs-ui/pipes-check-selected-by-key": "0.2.357-
|
|
26
|
-
"@libs-ui/utils": "0.2.357-
|
|
19
|
+
"@libs-ui/components-checkbox-group": "0.2.357-2",
|
|
20
|
+
"@libs-ui/components-checkbox-single": "0.2.357-2",
|
|
21
|
+
"@libs-ui/components-scroll-overlay": "0.2.357-2",
|
|
22
|
+
"@libs-ui/components-spinner": "0.2.357-2",
|
|
23
|
+
"@libs-ui/icons": "0.2.357-2",
|
|
24
|
+
"@libs-ui/pipes-call-function-in-template": "0.2.357-2",
|
|
25
|
+
"@libs-ui/pipes-check-selected-by-key": "0.2.357-2",
|
|
26
|
+
"@libs-ui/utils": "0.2.357-2",
|
|
27
27
|
"@ngx-translate/core": "^15.0.0",
|
|
28
|
-
"@libs-ui/components-buttons-status": "0.2.357-
|
|
29
|
-
"@libs-ui/pipes-clone-object": "0.2.357-
|
|
30
|
-
"@libs-ui/pipes-security-trust": "0.2.357-
|
|
31
|
-
"@libs-ui/components-badge": "0.2.357-
|
|
32
|
-
"@libs-ui/pipes-convert-object-to-signal": "0.2.357-
|
|
33
|
-
"@libs-ui/pipes-get-value-of-object": "0.2.357-
|
|
34
|
-
"@libs-ui/components-component-outlet": "0.2.357-
|
|
35
|
-
"@libs-ui/components-pagination": "0.2.357-
|
|
36
|
-
"@libs-ui/components-scroll-measure-items-direction-horizontal": "0.2.357-
|
|
28
|
+
"@libs-ui/components-buttons-status": "0.2.357-2",
|
|
29
|
+
"@libs-ui/pipes-clone-object": "0.2.357-2",
|
|
30
|
+
"@libs-ui/pipes-security-trust": "0.2.357-2",
|
|
31
|
+
"@libs-ui/components-badge": "0.2.357-2",
|
|
32
|
+
"@libs-ui/pipes-convert-object-to-signal": "0.2.357-2",
|
|
33
|
+
"@libs-ui/pipes-get-value-of-object": "0.2.357-2",
|
|
34
|
+
"@libs-ui/components-component-outlet": "0.2.357-2",
|
|
35
|
+
"@libs-ui/components-pagination": "0.2.357-2",
|
|
36
|
+
"@libs-ui/components-scroll-measure-items-direction-horizontal": "0.2.357-2"
|
|
37
37
|
},
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"module": "fesm2022/libs-ui-components-table.mjs",
|