@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.
Files changed (2) hide show
  1. package/README.md +10 -4
  2. 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
- if (!data.value()) return of(undefined as unknown as IAvatarConfig);
87
+ // data.value 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: data.value().link_avatar,
90
- idGenColor: data.value().username,
91
- textAvatar: data.value().name,
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-0",
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-0",
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-0",
10
- "@libs-ui/components-buttons-sort": "0.2.357-0",
11
- "@libs-ui/components-popover": "0.2.357-0",
12
- "@libs-ui/components-avatar": "0.2.357-0",
13
- "@libs-ui/components-dropdown": "0.2.357-0",
14
- "@libs-ui/components-line-clamp": "0.2.357-0",
15
- "@libs-ui/components-list": "0.2.357-0",
16
- "@libs-ui/components-switch": "0.2.357-0",
17
- "@libs-ui/services-http-request": "0.2.357-0",
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-0",
20
- "@libs-ui/components-checkbox-single": "0.2.357-0",
21
- "@libs-ui/components-scroll-overlay": "0.2.357-0",
22
- "@libs-ui/components-spinner": "0.2.357-0",
23
- "@libs-ui/icons": "0.2.357-0",
24
- "@libs-ui/pipes-call-function-in-template": "0.2.357-0",
25
- "@libs-ui/pipes-check-selected-by-key": "0.2.357-0",
26
- "@libs-ui/utils": "0.2.357-0",
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-0",
29
- "@libs-ui/pipes-clone-object": "0.2.357-0",
30
- "@libs-ui/pipes-security-trust": "0.2.357-0",
31
- "@libs-ui/components-badge": "0.2.357-0",
32
- "@libs-ui/pipes-convert-object-to-signal": "0.2.357-0",
33
- "@libs-ui/pipes-get-value-of-object": "0.2.357-0",
34
- "@libs-ui/components-component-outlet": "0.2.357-0",
35
- "@libs-ui/components-pagination": "0.2.357-0",
36
- "@libs-ui/components-scroll-measure-items-direction-horizontal": "0.2.357-0"
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",