@libs-ui/icons 0.2.357-7 → 0.2.357-9
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 +7 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -229,7 +229,7 @@ Tất cả icon component đều kế thừa `LibsUiIconsComponentAbstract` và
|
|
|
229
229
|
|---|---|---|---|---|
|
|
230
230
|
| `size` | `number` | `16` (xem bảng riêng) | Kích thước icon theo px (áp dụng cho cả width và height của SVG) | `[size]="24"` |
|
|
231
231
|
| `color` | `string` | `'#e6e7ea'` (xem bảng riêng) | Màu fill mặc định của icon khi không active | `[color]="'#333333'"` |
|
|
232
|
-
| `colorActive` | `string` | `'#
|
|
232
|
+
| `colorActive` | `string` | `'#9CA2AD'` | Màu fill của icon khi `active` là `true` | `[colorActive]="'#0050CC'"` |
|
|
233
233
|
| `active` | `boolean` | `undefined` | Khi `true`, icon hiển thị với màu `colorActive` thay vì `color` | `[active]="isSelected()"` |
|
|
234
234
|
|
|
235
235
|
### Default size và color theo từng component
|
|
@@ -240,8 +240,8 @@ Tất cả icon component đều kế thừa `LibsUiIconsComponentAbstract` và
|
|
|
240
240
|
| `LibsUiIconsAiInteractionComponent` | `libs_ui-icons-ai-interaction` | `32` | `#e6e7ea` |
|
|
241
241
|
| `LibsIconsImageDefaultComponent` | `libs_ui-icons-image_default` | `64` | `#e6e7ea` |
|
|
242
242
|
| `LibsIconsJsonComponent` | `libs_ui-icons-json` | `32` | `#e6e7ea` |
|
|
243
|
-
| `LibsUiIconsNoDataComponent` | `libs_ui-icons-no_data` | `
|
|
244
|
-
| `LibsUiIconsNoResultComponent` | `libs_ui-icons-no_result` | `
|
|
243
|
+
| `LibsUiIconsNoDataComponent` | `libs_ui-icons-no_data` | `16`* | `#e6e7ea` |
|
|
244
|
+
| `LibsUiIconsNoResultComponent` | `libs_ui-icons-no_result` | `16`* | `#e6e7ea` |
|
|
245
245
|
| `LibsUiIconsPdfComponent` | `libs_ui-icons-pdf` | `32` | `#e6e7ea` |
|
|
246
246
|
| `LibsUiIconsPptxComponent` | `libs_ui-icons-pptx` | `32` | `#e6e7ea` |
|
|
247
247
|
| `LibsUiIconsReloadComponent` | `libs_ui-icons-reload` | `32` | `#6A7383` |
|
|
@@ -252,6 +252,8 @@ Tất cả icon component đều kế thừa `LibsUiIconsComponentAbstract` và
|
|
|
252
252
|
| `LibsUiIconsXlsxComponent` | `libs_ui-icons-xlsx` | `32` | `#e6e7ea` |
|
|
253
253
|
| `LibsUiIconsXmlComponent` | `libs_ui-icons-xml` | `32` | `#e6e7ea` |
|
|
254
254
|
|
|
255
|
+
\* `no-data`/`no-result` khai báo `input(16, { transform: (v) => v ?? 65 })` — theo cơ chế `input()` của Angular, `transform` chỉ chạy khi có giá trị được binding từ template (kể cả `undefined`), KHÔNG áp dụng cho giá trị khởi tạo khi hoàn toàn không binding `[size]`. Do đó nếu bỏ trống `[size]` hoàn toàn, giá trị thực tế là `16`; chỉ khi binding rõ `[size]="undefined"` mới ra `65`. Luôn truyền `[size]` tường minh (ví dụ `[size]="65"`) để tránh phụ thuộc vào chi tiết này.
|
|
256
|
+
|
|
255
257
|
## Pipe — LibsUiIconsGetIconComponentPipe
|
|
256
258
|
|
|
257
259
|
Pipe async lazy-load icon component theo key string. Trả về `Promise<Type<any> | null>`, dùng kết hợp với `AsyncPipe` và `NgComponentOutlet`.
|
|
@@ -332,7 +334,7 @@ export class CustomIconComponent extends LibsUiIconsComponentAbstract {
|
|
|
332
334
|
|---|---|---|
|
|
333
335
|
| `size` | `input<number>` (default: `16`) | Kích thước px |
|
|
334
336
|
| `color` | `input<string>` (default: `'#e6e7ea'`) | Màu mặc định |
|
|
335
|
-
| `colorActive` | `input<string>` (default: `'#
|
|
337
|
+
| `colorActive` | `input<string>` (default: `'#9CA2AD'`) | Màu khi active |
|
|
336
338
|
| `active` | `input<boolean>` | Trạng thái active |
|
|
337
339
|
| `colorBind` | `computed` (protected) | Trả về `colorActive()` khi `active()` là `true`, ngược lại trả về `color()` |
|
|
338
340
|
|
|
@@ -344,14 +346,6 @@ export class CustomIconComponent extends LibsUiIconsComponentAbstract {
|
|
|
344
346
|
|
|
345
347
|
⚠️ **Icon AI (`libs_ui-icons-ai`) dùng SVG gradient**: Màu của icon AI được định nghĩa trực tiếp trong SVG path qua `linearGradient`, input `color` không ảnh hưởng đến màu gradient này.
|
|
346
348
|
|
|
347
|
-
⚠️ **`colorActive` default là `'#
|
|
349
|
+
⚠️ **`colorActive` default là `'#9CA2AD'`**: Trong abstract base, giá trị mặc định của `colorActive` khi không truyền vào là `'#9CA2AD'` (xám). Không có icon component nào trong lib hiện override giá trị này — tất cả 15 icon dùng chung default `colorActive` từ abstract (chỉ `size` và `color` được override riêng, ví dụ: `reload` dùng `color: '#6A7383'`, `send-solid`/`sparkles-ai-solid`/`stop-solid` dùng `color: '#226FF5'`). Kiểm tra bảng default ở trên trước khi dùng.
|
|
348
350
|
|
|
349
351
|
⚠️ **Không có @Output()**: Tất cả icon component chỉ là SVG display thuần, không emit event. Nếu cần xử lý click, bọc bên ngoài bằng `<button>` hoặc element có `(click)` handler.
|
|
350
|
-
|
|
351
|
-
## Demo
|
|
352
|
-
|
|
353
|
-
```bash
|
|
354
|
-
npx nx serve core-ui
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
Truy cập: http://localhost:4500/icons
|