@libs-ui/components-buttons-sort 0.2.355-0 → 0.2.355-10

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/package.json +2 -2
  2. package/README.md +0 -139
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@libs-ui/components-buttons-sort",
3
- "version": "0.2.355-0",
3
+ "version": "0.2.355-10",
4
4
  "peerDependencies": {
5
5
  "@angular/core": ">=18.0.0",
6
- "@libs-ui/components-popover": "0.2.355-0"
6
+ "@libs-ui/components-popover": "0.2.355-10"
7
7
  },
8
8
  "sideEffects": false,
9
9
  "module": "fesm2022/libs-ui-components-buttons-sort.mjs",
package/README.md DELETED
@@ -1,139 +0,0 @@
1
- # Sort
2
-
3
- ## Giới thiệu
4
-
5
- `@libs-ui/components-buttons-sort` là một component Sort Button cho Angular, hiển thị hai biểu tượng sắp xếp tăng dần và giảm dần, hỗ trợ binding trạng thái và emit event khi thay đổi.
6
-
7
- ## Tính năng
8
-
9
- - Hiển thị icon `asc` và `desc` với kích thước tuỳ chỉnh
10
- - Two-way binding cho chế độ sort (`mode`)
11
- - Tuỳ chọn fieldSort để gắn tên trường sắp xếp
12
- - Hỗ trợ disable toàn bộ sort hoặc riêng `asc` / `desc`
13
- - `onlyEmit` để chỉ emit sự kiện mà không tự thay đổi chế độ
14
- - Emit `ISort` bao gồm `mode`, `modeNumber`, `fieldSort` và hàm `reset()`
15
-
16
- ## Cài đặt
17
-
18
- ```bash
19
- npm install @libs-ui/components-buttons-sort
20
- ```
21
-
22
- hoặc
23
-
24
- ```bash
25
- yarn add @libs-ui/components-buttons-sort
26
- ```
27
-
28
- ## Sử dụng
29
-
30
- ### Inline Template
31
-
32
- ```typescript
33
- import { Component } from '@angular/core';
34
- import { LibsUiComponentsButtonsSortComponent } from '@libs-ui/components-buttons-sort';
35
- import { TYPE_SORT_TYPE } from '@libs-ui/components-buttons-sort';
36
-
37
- @Component({
38
- selector: 'app-example',
39
- standalone: true,
40
- imports: [LibsUiComponentsButtonsSortComponent],
41
- template: `
42
- <libs_ui-components-buttons-sort
43
- [size]="20"
44
- [(mode)]="demoMode"
45
- [fieldSort]="'name'"
46
- (outChange)="onSort($event)"></libs_ui-components-buttons-sort>
47
- `,
48
- })
49
- export class ExampleComponent {
50
- demoMode: TYPE_SORT_TYPE = '';
51
- onSort(event: any) {
52
- console.log('Sorted:', event);
53
- }
54
- }
55
- ```
56
-
57
- ### File HTML riêng
58
-
59
- ```typescript
60
- import { Component } from '@angular/core';
61
- import { LibsUiComponentsButtonsSortComponent } from '@libs-ui/components-buttons-sort';
62
- import { TYPE_SORT_TYPE } from '@libs-ui/components-buttons-sort';
63
-
64
- @Component({
65
- selector: 'app-example',
66
- standalone: true,
67
- imports: [LibsUiComponentsButtonsSortComponent],
68
- templateUrl: './example.component.html',
69
- })
70
- export class ExampleComponent {
71
- demoMode: TYPE_SORT_TYPE = '';
72
- onSort(event: any) {}
73
- }
74
- ```
75
-
76
- ```html
77
- <libs_ui-components-buttons-sort
78
- [size]="20"
79
- [(mode)]="demoMode"
80
- [fieldSort]="'name'"
81
- (outChange)="onSort($event)"></libs_ui-components-buttons-sort>
82
- ```
83
-
84
- ## Công nghệ sử dụng
85
-
86
- - **Angular 18** với standalone components và Signals
87
- - **Tailwind CSS** 3.x (phong cách demo)
88
-
89
- ## API Reference
90
-
91
- ### Inputs
92
-
93
- | Tên | Kiểu | Mặc định | Mô tả |
94
- | ----------- | ---------------- | -------- | ----------------------------------------------------- |
95
- | size | `number` | `10` | Độ lớn của icon sắp xếp (px). |
96
- | mode | `TYPE_SORT_TYPE` | `''` | Thứ tự hiện tại ('asc', 'desc' hoặc không sắp xếp). |
97
- | fieldSort | `string` | `''` | Trường dữ liệu dùng để sắp xếp. |
98
- | disable | `boolean` | `false` | Nếu true: tắt chức năng sắp xếp. |
99
- | disableAsc | `boolean` | `false` | Nếu true: vô hiệu hóa chế độ sắp xếp tăng dần. |
100
- | disableDesc | `boolean` | `false` | Nếu true: vô hiệu hóa chế độ sắp xếp giảm dần. |
101
- | onlyEmit | `boolean` | `false` | Nếu true: chỉ phát sự kiện, không tự thay đổi chế độ. |
102
-
103
- ### Outputs
104
-
105
- | Tên | Kiểu | Mô tả |
106
- | --------- | ------------------------ | ------------------------------------------------------- |
107
- | outChange | `(event: ISort) => void` | Trả về đối tượng ISort khi trạng thái sắp xếp thay đổi. |
108
-
109
- ### Interfaces
110
-
111
- #### `ISort`
112
-
113
- ```typescript
114
- export interface ISort {
115
- mode: TYPE_SORT_TYPE;
116
- modeNumber: 1 | 2;
117
- fieldSort: string;
118
- reset: () => void;
119
- }
120
- ```
121
-
122
- Mô tả:
123
-
124
- - `mode`: `'asc'`, `'desc'` hoặc `''` (không sắp xếp).
125
- - `modeNumber`: số tương ứng (1 = `'asc'`, 2 = `'desc'`).
126
- - `fieldSort`: tên trường dữ liệu dùng để sắp xếp.
127
- - `reset()`: hàm đặt lại về trạng thái không sắp xếp.
128
-
129
- #### `TYPE_SORT_TYPE`
130
-
131
- ```typescript
132
- export type TYPE_SORT_TYPE = 'asc' | 'desc' | '';
133
- ```
134
-
135
- Mô tả:
136
-
137
- - `'asc'`: sắp xếp tăng dần.
138
- - `'desc'`: sắp xếp giảm dần.
139
- - `''`: không sắp xếp.