@libs-ui/components-buttons-sort 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.
Files changed (2) hide show
  1. package/README.md +2 -11
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -77,7 +77,6 @@ export class ExampleComponent {
77
77
  readonly sortMode = signal<TYPE_SORT_TYPE>('');
78
78
 
79
79
  handlerSortChange(sort: ISort): void {
80
- sort.stopPropagation?.();
81
80
  console.log(sort.mode, sort.fieldSort, sort.modeNumber);
82
81
  // Gọi sort.reset() để đưa mode về '' khi cần xóa sort
83
82
  }
@@ -194,7 +193,7 @@ export class ExampleArrowComponent {
194
193
  | `[disableDesc]` | `boolean` | `false` | Disable riêng chiều giảm dần (desc) | `[disableDesc]="true"` |
195
194
  | `[fieldSort]` | `string` | `''` | Tên field đang sort — được trả về nguyên vẹn trong payload `ISort.fieldSort` | `[fieldSort]="'name'"` |
196
195
  | `[(mode)]` | `TYPE_SORT_TYPE` | `''` | Two-way binding mode sort hiện tại: `'asc'` / `'desc'` / `''` (không sort) | `[(mode)]="sortMode"` |
197
- | `[onlyEmit]` | `boolean` | `false` | Khi `true`: vẫn emit event kể cả khi click lại chiều đang active (không bị chặn) | `[onlyEmit]="true"` |
196
+ | `[onlyEmit]` | `boolean` | `false` | Cấu hình dự kiến: khi `true` sẽ vẫn emit event kể cả khi click lại chiều đang active. **Lưu ý:** ở bản hiện tại, component luôn emit dù `onlyEmit` là `true` hay `false` (xem mục Lưu ý quan trọng) | `[onlyEmit]="true"` |
198
197
  | `[size]` | `number` | `10` | Kích thước icon sort theo đơn vị px | `[size]="14"` |
199
198
 
200
199
  ## @Output() — `libs_ui-components-buttons-sort`
@@ -249,16 +248,8 @@ export interface ISort {
249
248
 
250
249
  ⚠️ **Two-way binding với signal**: Khi dùng `[(mode)]` cùng Angular Signal, phải truyền giá trị signal đã gọi `()`: `[(mode)]="sortMode()"` trong inline template hoặc khai báo biến `readonly sortMode = signal<TYPE_SORT_TYPE>('')` và dùng `[(mode)]="sortMode"` trong template file riêng — Angular sẽ tự xử lý.
251
250
 
252
- ⚠️ **`onlyEmit` `disableAsc`/`disableDesc` kết hợp**: Khi `onlyEmit` `true`, logic `disableAsc`/`disableDesc` vẫn hoạt động — click vào chiều bị disable sẽ không emit dù `onlyEmit` bật.
251
+ ⚠️ **`onlyEmit` hiện luôn có hiệu lực như `true`**: Do cách kiểm tra điều kiện nội bộ, ở bản hiện tại `libs_ui-components-buttons-sort` luôn emit `(outChange)` khi click — kể cả khi click lại đúng chiều đang active và `[onlyEmit]` không được truyền (mặc định `false`). Input `[onlyEmit]` hiện chưa tạo ra khác biệt hành vi. Logic `disableAsc`/`disableDesc` vẫn hoạt động độc lập — click vào chiều bị disable sẽ không emit.
253
252
 
254
253
  ⚠️ **Arrow popover cần `ignorePopoverContent="false"`**: Mặc định `ignorePopoverContent` là `true` (bỏ qua popover). Phải đặt `[ignorePopoverContent]="false"` mới kích hoạt popover — đồng thời cần truyền `popoverContentAsc` hoặc `popoverContentDesc` để có nội dung hiển thị.
255
254
 
256
255
  ⚠️ **`reset()` trong `ISort`**: Hàm `reset()` được bind vào instance component — gọi `sort.reset()` sẽ đặt lại `mode` về `''` trực tiếp trên component gốc. Dùng khi cần reset sort từ bên ngoài (vd: clear filter).
257
-
258
- ## Demo
259
-
260
- ```bash
261
- npx nx serve core-ui
262
- ```
263
-
264
- Truy cập: http://localhost:4500/buttons/sort
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@libs-ui/components-buttons-sort",
3
- "version": "0.2.357-7",
3
+ "version": "0.2.357-9",
4
4
  "peerDependencies": {
5
5
  "@angular/core": ">=18.0.0",
6
- "@libs-ui/components-popover": "0.2.357-7"
6
+ "@libs-ui/components-popover": "0.2.357-9"
7
7
  },
8
8
  "sideEffects": false,
9
9
  "module": "fesm2022/libs-ui-components-buttons-sort.mjs",