@aseansc/ui 4.0.0 → 4.1.0
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/CHANGELOG.md +31 -0
- package/README.md +24 -4
- package/fesm2022/aseansc-ui.mjs +75 -21
- package/fesm2022/aseansc-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/tokens/layout/_menu.scss +1 -0
- package/tokens/preset.css +1 -0
- package/types/aseansc-ui.d.ts +16 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,37 @@ All notable changes to `@aseansc/ui` (trước đây `@asc/ui`) are documented h
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [4.1.0] — 2026-09-23
|
|
8
|
+
|
|
9
|
+
Port các thay đổi từ `@aseansc-admin/ui` 2.11.1 → 2.12.0.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **`AscMenuItem` — `iconSize` / `iconWidth` / `iconHeight`**: cấu hình kích thước icon của menu item trong `AscLayout`. `iconSize` áp cho cả width lẫn height (icon SVG) hoặc `font-size` (icon PrimeIcons); `iconWidth` / `iconHeight` ghi đè riêng từng chiều, dùng cho icon không vuông. `AscMenuItem.items` giờ được type là `AscMenuItem[]`.
|
|
14
|
+
- **`AscIconComponent` — input `width` / `height`**: ghi đè riêng chiều rộng/cao, ưu tiên hơn `size`.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- `AscTableComponent`: `showFirstLastIcon` (nút về trang đầu/cuối trên paginator) đổi default từ `false` sang `true` — trước đây phải opt-in từng bảng dù đa số muốn có sẵn.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **`AscTableComponent`**: bỏ `overflow: hidden` ở `.asc-table-wrapper` và bỏ `margin-left` của nút prev trong pagination.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## [4.0.1] — 2026-09-10
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
Phát hiện khi cài `@aseansc/ui@4.0.0` thật vào 1 project Angular 22 sạch (test riêng, không qua monorepo) — README hướng dẫn thiếu/sai 3 chỗ:
|
|
31
|
+
|
|
32
|
+
- **Thiếu hướng dẫn `.npmrc`**: PrimeNG 21 tự khai peer dep `@angular/cdk@^21`, cài trên Angular 22 sẽ bị `ERESOLVE` nếu không có `legacy-peer-deps=true`. Thêm hướng dẫn rõ ràng vào mục Peer dependencies.
|
|
33
|
+
- **`provideAnimations()`/`@angular/animations` không cần thiết** — verify PrimeNG 21 không đụng tới `@angular/animations`/`BrowserAnimationsModule` ở đâu (dùng `@primeuix/motion` riêng). Bỏ khỏi setup example — trước đây bắt cài thêm 1 package đã bị Angular 22 đánh dấu deprecated mà không có tác dụng gì.
|
|
34
|
+
- **`provideZoneChangeDetection()` → `provideZonelessChangeDetection()`** — `ng new` ở Angular 22 mặc định không còn cài `zone.js`; dùng API cũ khiến app mới tạo theo hướng dẫn bị lỗi runtime đòi Zone. Toàn bộ component đã dùng signal + `OnPush` nên chạy zoneless bình thường.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
7
38
|
## [4.0.0] — 2026-09-10
|
|
8
39
|
|
|
9
40
|
### Changed
|
package/README.md
CHANGED
|
@@ -45,6 +45,16 @@ npm install @aseansc/ui
|
|
|
45
45
|
npm install @angular/core@^22 @angular/cdk@^22 primeng@^21
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
**Bắt buộc — `.npmrc` ở root project:**
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
legacy-peer-deps=true
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Lý do: PrimeNG 21 tự khai `peerDependencies` là `@angular/core@^21`/`@angular/cdk@^21` (chưa
|
|
55
|
+
chính thức support Angular 22 — xem ghi chú ở đầu file). Không có dòng này, `npm install` sẽ
|
|
56
|
+
báo lỗi `ERESOLVE` vì thấy `@angular/cdk@22` trong project xung đột với peer dep PrimeNG khai.
|
|
57
|
+
|
|
48
58
|
---
|
|
49
59
|
|
|
50
60
|
## Setup
|
|
@@ -52,11 +62,10 @@ npm install @angular/core@^22 @angular/cdk@^22 primeng@^21
|
|
|
52
62
|
### 1. `app.config.ts`
|
|
53
63
|
|
|
54
64
|
```ts
|
|
55
|
-
import { ApplicationConfig,
|
|
65
|
+
import { ApplicationConfig, provideZonelessChangeDetection,
|
|
56
66
|
provideBrowserGlobalErrorListeners } from '@angular/core';
|
|
57
67
|
import { provideRouter } from '@angular/router';
|
|
58
68
|
import { provideHttpClient } from '@angular/common/http';
|
|
59
|
-
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
60
69
|
import { provideAscUI } from '@aseansc/ui';
|
|
61
70
|
import { appRoutes } from './app.routes';
|
|
62
71
|
|
|
@@ -68,14 +77,25 @@ export const appConfig: ApplicationConfig = {
|
|
|
68
77
|
locale: 'vi-VN', // 'vi-VN' | 'en-US'
|
|
69
78
|
table: { rows: 20 },
|
|
70
79
|
}),
|
|
71
|
-
|
|
72
|
-
provideZoneChangeDetection({ eventCoalescing: true }),
|
|
80
|
+
provideZonelessChangeDetection(),
|
|
73
81
|
provideRouter(appRoutes),
|
|
74
82
|
provideHttpClient(),
|
|
75
83
|
],
|
|
76
84
|
};
|
|
77
85
|
```
|
|
78
86
|
|
|
87
|
+
> **`provideZonelessChangeDetection()` chứ không phải `provideZoneChangeDetection()`** —
|
|
88
|
+
> `ng new` ở Angular 22 mặc định tạo project **không có `zone.js`** nữa (không còn trong
|
|
89
|
+
> `polyfills`). Nếu dùng `provideZoneChangeDetection()` (API cũ, cần `zone.js` patch global)
|
|
90
|
+
> mà project không cài `zone.js`, app sẽ lỗi/cảnh báo runtime đòi Zone. Toàn bộ component
|
|
91
|
+
> của `@aseansc/ui` đã dùng signal (`input()`/`computed()`/`signal()`) + `OnPush` nên chạy
|
|
92
|
+
> zoneless bình thường, không cần zone.js.
|
|
93
|
+
|
|
94
|
+
> **Không cần `provideAnimations()`/`@angular/animations`** — PrimeNG 21 dùng hệ animation
|
|
95
|
+
> riêng (`@primeuix/motion`), không phụ thuộc `BrowserAnimationsModule` của Angular. Thêm
|
|
96
|
+
> `provideAnimations()` chỉ kéo theo 1 package đã bị Angular 22 đánh dấu deprecated mà
|
|
97
|
+
> không có tác dụng gì.
|
|
98
|
+
|
|
79
99
|
### 2. `styles.scss`
|
|
80
100
|
|
|
81
101
|
```scss
|