@geoit/ui 0.0.2 → 0.0.4
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 +148 -12
- package/ai/AGENTS.md +5 -4
- package/ai/README.md +2 -2
- package/ai/catalog.json +3064 -424
- package/ai/components/geo-alert.md +75 -21
- package/ai/components/geo-back-button.md +64 -18
- package/ai/components/geo-breadcrumb.md +71 -12
- package/ai/components/geo-button.md +90 -27
- package/ai/components/geo-checkbox.md +69 -20
- package/ai/components/geo-column-picker.md +91 -18
- package/ai/components/geo-confirm-modal.md +93 -27
- package/ai/components/geo-date-picker.md +103 -29
- package/ai/components/geo-date-range-picker.md +99 -28
- package/ai/components/geo-file-picker.md +97 -26
- package/ai/components/geo-form-modal.md +112 -44
- package/ai/components/geo-icon.md +70 -16
- package/ai/components/geo-input.md +92 -29
- package/ai/components/geo-page-title.md +62 -16
- package/ai/components/geo-pagination.md +79 -24
- package/ai/components/geo-radio.md +108 -27
- package/ai/components/geo-row-actions.md +87 -19
- package/ai/components/geo-select.md +106 -28
- package/ai/components/geo-slider.md +72 -21
- package/ai/components/geo-status-tag.md +67 -15
- package/ai/components/geo-step-form-layout.md +122 -38
- package/ai/components/geo-stepper.md +82 -19
- package/ai/components/geo-table-filter.md +91 -29
- package/ai/components/geo-table-pagination.md +73 -23
- package/ai/components/geo-table-toolbar.md +84 -29
- package/ai/components/geo-table.md +194 -59
- package/ai/components/geo-tabs.md +101 -27
- package/ai/components/geo-textarea.md +82 -23
- package/ai/components/geo-toast.md +138 -27
- package/ai/components/geo-tree.md +96 -22
- package/ai/components/geo-typography.md +70 -19
- package/ai/components/geo-upload.md +110 -39
- package/ai/recipes.md +76 -4
- package/package.json +1 -1
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# geo-table
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoTableComponent** (`@geoit/ui`)
|
|
4
|
+
>
|
|
5
|
+
> Read this file before using the component. Use **only** the Inputs/Outputs listed here.
|
|
4
6
|
|
|
5
7
|
## Summary
|
|
6
8
|
Data table with pagination, selection, row actions, mobile card mode.
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoTableComponent } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoTableComponent]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-table`
|
|
@@ -24,75 +31,203 @@ List/index screens with structured rows.
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Simple key-value detail — use typography/grid.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
Bảng dữ liệu: [columns] GeoTableColumn[] + [data]. Hỗ trợ renderAs index|status|actions, phân trang, selection, mobile card.
|
|
37
|
+
|
|
38
|
+
## Binding
|
|
39
|
+
|
|
40
|
+
Standalone presentational / container component — drive via Inputs and Outputs (no `ngModel` unless documented).
|
|
41
|
+
|
|
27
42
|
## Inputs
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
43
|
+
|
|
44
|
+
Every supported Input (do not invent others):
|
|
45
|
+
|
|
46
|
+
| Input | Type | Default | Description |
|
|
47
|
+
|-------|------|---------|-------------|
|
|
48
|
+
| `columns` | `GeoTableColumn[]` | `[]` | — |
|
|
49
|
+
| `data` | `Record<string, unknown>[]` | `[]` | — |
|
|
50
|
+
| `loading` | `boolean` | `false` | — |
|
|
51
|
+
| `bordered` | `boolean` | `true` | — |
|
|
52
|
+
| `outerBordered` | `boolean` | `false` | — |
|
|
53
|
+
| `size` | `NzTableSize` | `'middle'` | — |
|
|
54
|
+
| `striped` | `boolean` | `true` | — |
|
|
55
|
+
| `clickable` | `boolean` | `true` | — |
|
|
56
|
+
| `tableLayout` | `'auto' \| 'fixed'` | `'auto'` | — |
|
|
57
|
+
| `showPagination` | `boolean` | `true` | — |
|
|
58
|
+
| `frontPagination` | `boolean` | `true` | — |
|
|
59
|
+
| `pageIndex` | `number` | `1` | — |
|
|
60
|
+
| `pageSize` | `number` | `10` | — |
|
|
61
|
+
| `total` | `number` | — | — |
|
|
62
|
+
| `pageSizeOptions` | `number[]` | `DEFAULT_UI_TABLE_PAGE_SIZE_OPTIONS` | — |
|
|
63
|
+
| `showSizeChanger` | `boolean` | `false` | — |
|
|
64
|
+
| `showQuickJumper` | `boolean` | `false` | — |
|
|
65
|
+
| `hideOnSinglePage` | `boolean` | `false` | — |
|
|
66
|
+
| `simplePagination` | `boolean` | `false` | — |
|
|
67
|
+
| `paginationPosition` | `'top' \| 'bottom' \| 'both'` | `'bottom'` | — |
|
|
68
|
+
| `scroll` | `{ x?: string; y?: string }` | `{}` | — |
|
|
69
|
+
| `scrollY` | `string` | — | — |
|
|
70
|
+
| `autoScroll` | `boolean` | `false` | Tự bật scroll ngang theo tổng width cột. Khi có cột `fixed`, scroll.x luôn được tính (bắt buộc với nz-table fixed). |
|
|
71
|
+
| `tableTitle` | `string` | — | — |
|
|
72
|
+
| `footer` | `string` | — | — |
|
|
73
|
+
| `emptyText` | `string` | `'Không có dữ liệu'` | — |
|
|
74
|
+
| `showTotalRange` | `boolean` | `false` | — |
|
|
75
|
+
| `selectable` | `boolean` | `false` | — |
|
|
76
|
+
| `rowKey` | `string` | `'id'` | — |
|
|
77
|
+
| `selectedKeys` | `string[]` | `[]` | — |
|
|
78
|
+
| `mobileTitleKey` | `string` | — | Mobile card: key cột làm tiêu đề. Ưu tiên hơn `column.mobileTitle`; nếu không set thì lấy cột dữ liệu đầu tiên. |
|
|
79
|
+
| `mobileCardView` | `boolean` | `true` | Bật/tắt chuyển card trên mobile (mặc định bật). |
|
|
62
80
|
|
|
63
81
|
## Outputs
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
|
|
83
|
+
| Output | Payload | Description |
|
|
84
|
+
|--------|---------|-------------|
|
|
85
|
+
| `rowClick` | `EventEmitter<Record<string, unknown>>` | — |
|
|
86
|
+
| `rowEdit` | `EventEmitter<Record<string, unknown>>` | — |
|
|
87
|
+
| `rowMore` | `EventEmitter<Record<string, unknown>>` | — |
|
|
88
|
+
| `rowAction` | `EventEmitter<{ row: Record<string, unknown>; action: string }>` | — |
|
|
89
|
+
| `pageIndexChange` | `EventEmitter<number>` | — |
|
|
90
|
+
| `pageSizeChange` | `EventEmitter<number>` | — |
|
|
91
|
+
| `queryParams` | `EventEmitter<NzTableQueryParams>` | — |
|
|
92
|
+
| `currentPageDataChange` | `EventEmitter<readonly Record<string, unknown>[]>` | — |
|
|
93
|
+
| `selectedKeysChange` | `EventEmitter<string[]>` | — |
|
|
94
|
+
| `selectionChange` | `EventEmitter<Record<string, unknown>[]>` | — |
|
|
95
|
+
|
|
96
|
+
## Related types
|
|
97
|
+
|
|
98
|
+
From `figma/geo-table/geo-table.types.ts`:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
export interface GeoTableFilter {
|
|
102
|
+
text: string;
|
|
103
|
+
value: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface GeoTableColumn {
|
|
107
|
+
key: string;
|
|
108
|
+
title: string;
|
|
109
|
+
width?: string;
|
|
110
|
+
/** Căn lề ô dữ liệu — nếu không set sẽ suy ra từ `dataType` / `renderAs` */
|
|
111
|
+
align?: 'left' | 'center' | 'right';
|
|
112
|
+
/** Kiểu dữ liệu để áp dụng quy tắc căn lề mặc định */
|
|
113
|
+
dataType?: GeoTableColumnDataType;
|
|
114
|
+
sortable?: boolean;
|
|
115
|
+
sortOrder?: 'ascend' | 'descend' | null;
|
|
116
|
+
sortFn?: (a: Record<string, unknown>, b: Record<string, unknown>) => number;
|
|
117
|
+
filters?: GeoTableFilter[];
|
|
118
|
+
filterMultiple?: boolean;
|
|
119
|
+
fixed?: 'left' | 'right';
|
|
120
|
+
ellipsis?: boolean;
|
|
121
|
+
wrap?: boolean;
|
|
122
|
+
renderAs?: GeoTableCellRender;
|
|
123
|
+
statusLabelKey?: string;
|
|
124
|
+
actions?: GeoRowAction[];
|
|
125
|
+
/**
|
|
126
|
+
* Resolve actions theo từng dòng (vd. ẩn/hiện theo trạng thái).
|
|
127
|
+
* Nếu có thì ưu tiên hơn `actions`.
|
|
128
|
+
*/
|
|
129
|
+
resolveActions?: (row: Record<string, unknown>) => GeoRowAction[];
|
|
130
|
+
/** Action key ưu tiên hiển thị khi có > 2 thao tác (mặc định: edit) */
|
|
131
|
+
primaryActionKey?: string;
|
|
132
|
+
visible?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Mobile card: dùng cột này làm tiêu đề card.
|
|
135
|
+
* Nếu không cột nào set, lấy cột dữ liệu đầu tiên (không phải index/actions).
|
|
136
|
+
*/
|
|
137
|
+
mobileTitle?: boolean;
|
|
138
|
+
/** Mobile card: ẩn cột khỏi body card. */
|
|
139
|
+
mobileHidden?: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type GeoTableCellRender = 'text' | 'index' | 'status' | 'actions';
|
|
143
|
+
|
|
144
|
+
export type GeoTableColumnDataType = 'text' | 'number' | 'date';
|
|
145
|
+
|
|
146
|
+
export type GeoTablePaginationPosition = 'top' | 'bottom' | 'both';
|
|
147
|
+
|
|
148
|
+
export const UI_TABLE_MOBILE_BREAKPOINT = 767.98;
|
|
149
|
+
|
|
150
|
+
export const DEFAULT_UI_TABLE_PAGE_SIZE_OPTIONS = [10, 20, 50, 100];
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Examples
|
|
154
|
+
|
|
155
|
+
### Columns TS
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
import { GeoTableColumn } from '@geoit/ui';
|
|
159
|
+
|
|
160
|
+
columns: GeoTableColumn[] = [
|
|
161
|
+
{ key: 'index', title: 'STT', width: '72px', align: 'center', renderAs: 'index' },
|
|
162
|
+
{ key: 'code', title: 'Mã', width: '120px', dataType: 'text' },
|
|
163
|
+
{ key: 'name', title: 'Tên hồ sơ', dataType: 'text' },
|
|
164
|
+
{ key: 'status', title: 'Trạng thái', width: '150px', renderAs: 'status', statusLabelKey: 'statusLabel' },
|
|
165
|
+
{
|
|
166
|
+
key: 'actions',
|
|
167
|
+
title: 'Thao tác',
|
|
168
|
+
width: '110px',
|
|
169
|
+
align: 'center',
|
|
170
|
+
renderAs: 'actions',
|
|
171
|
+
actions: [
|
|
172
|
+
{ key: 'edit', icon: 'edit', title: 'Chỉnh sửa' },
|
|
173
|
+
{ key: 'delete', icon: 'delete', title: 'Xóa', danger: true },
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
|
|
178
|
+
rows = [
|
|
179
|
+
{ id: '1', code: 'HS-001', name: 'Hồ sơ A', status: 'success', statusLabel: 'Đã duyệt' },
|
|
180
|
+
{ id: '2', code: 'HS-002', name: 'Hồ sơ B', status: 'warning', statusLabel: 'Chờ xử lý' },
|
|
181
|
+
];
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Template
|
|
185
|
+
|
|
78
186
|
```html
|
|
79
187
|
<geo-table
|
|
80
188
|
[columns]="columns"
|
|
81
189
|
[data]="rows"
|
|
190
|
+
[loading]="loading"
|
|
191
|
+
[bordered]="true"
|
|
192
|
+
[striped]="true"
|
|
193
|
+
[showPagination]="true"
|
|
194
|
+
[frontPagination]="false"
|
|
195
|
+
[pageIndex]="pageIndex"
|
|
196
|
+
[pageSize]="pageSize"
|
|
82
197
|
[total]="total"
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
|
|
198
|
+
[showSizeChanger]="true"
|
|
199
|
+
[selectable]="true"
|
|
200
|
+
rowKey="id"
|
|
201
|
+
[(selectedKeys)]="selectedKeys"
|
|
202
|
+
emptyText="Không có dữ liệu"
|
|
203
|
+
(pageIndexChange)="pageIndex = $event; load()"
|
|
204
|
+
(pageSizeChange)="pageSize = $event; load()"
|
|
205
|
+
(rowAction)="onRowAction($event)"
|
|
206
|
+
(rowClick)="onRowClick($event)"
|
|
86
207
|
></geo-table>
|
|
87
208
|
```
|
|
88
209
|
|
|
210
|
+
## Tips
|
|
211
|
+
|
|
212
|
+
- Khai báo columns TS với renderAs cho STT / trạng thái / thao tác.
|
|
213
|
+
- Ghép geo-table-toolbar + geo-table-filter phía trên.
|
|
214
|
+
- frontPagination=false khi phân trang server (set total).
|
|
215
|
+
## Related components
|
|
216
|
+
|
|
217
|
+
- [`geo-table-toolbar`](./geo-table-toolbar.md)
|
|
218
|
+
- [`geo-table-filter`](./geo-table-filter.md)
|
|
219
|
+
- [`geo-table-pagination`](./geo-table-pagination.md)
|
|
220
|
+
- [`geo-row-actions`](./geo-row-actions.md)
|
|
221
|
+
- [`geo-status-tag`](./geo-status-tag.md)
|
|
222
|
+
- [`geo-column-picker`](./geo-column-picker.md)
|
|
223
|
+
## Package path
|
|
224
|
+
`node_modules/@geoit/ui/ai/components/geo-table.md`
|
|
225
|
+
|
|
89
226
|
## Source
|
|
90
227
|
`projects/geo-ui/src/lib/figma/geo-table/geo-table.component.ts`
|
|
91
228
|
|
|
92
|
-
##
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## Rules for AI
|
|
96
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
229
|
+
## Rules for AI / consumers
|
|
230
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
97
231
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
98
|
-
- Match props to
|
|
232
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
233
|
+
- Copy examples and adapt labels/bindings only.
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# geo-tabs
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoTabsComponent** (`@geoit/ui`)
|
|
4
|
+
>
|
|
5
|
+
> Read this file before using the component. Use **only** the Inputs/Outputs listed here.
|
|
4
6
|
|
|
5
7
|
## Summary
|
|
6
8
|
Tab set with brand ink bar; content via ng-template uiTab.
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
|
-
import { GeoTabsComponent } from '@geoit/ui';
|
|
13
|
+
import { GeoTabsComponent, GeoTabDirective } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoTabsComponent, GeoTabDirective]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-tabs`
|
|
@@ -24,39 +31,106 @@ Peer sections on one page (info / history / files).
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Ordered wizard steps — use geo-stepper.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
Tab ngang brand ink. [items] {key,title}[]; nội dung qua <ng-template uiTab="key">. Import GeoTabsComponent + GeoTabDirective.
|
|
37
|
+
|
|
38
|
+
## Binding
|
|
39
|
+
|
|
40
|
+
Standalone presentational / container component — drive via Inputs and Outputs (no `ngModel` unless documented).
|
|
41
|
+
|
|
27
42
|
## Inputs
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
43
|
+
|
|
44
|
+
Every supported Input (do not invent others):
|
|
45
|
+
|
|
46
|
+
| Input | Type | Default | Description |
|
|
47
|
+
|-------|------|---------|-------------|
|
|
48
|
+
| `items` | `GeoTabItem[]` | `[]` | — |
|
|
49
|
+
| `type` | `'line' \| 'card'` | `'line'` | — |
|
|
50
|
+
| `size` | `'default' \| 'large' \| 'small'` | `'default'` | — |
|
|
51
|
+
| `selectedIndex` | `number` | `0` | — |
|
|
52
|
+
| `selectedKey` | `string` | — | — |
|
|
53
|
+
| `centered` | `boolean` | `false` | — |
|
|
54
|
+
| `animated` | `boolean` | `true` | — |
|
|
37
55
|
|
|
38
56
|
## Outputs
|
|
39
|
-
| Output | Notes |
|
|
40
|
-
|--------|-------|
|
|
41
|
-
| `selectedIndexChange` | EventEmitter |
|
|
42
|
-
| `selectedKeyChange` | EventEmitter |
|
|
43
|
-
| `tabChange` | EventEmitter |
|
|
44
57
|
|
|
45
|
-
|
|
58
|
+
| Output | Payload | Description |
|
|
59
|
+
|--------|---------|-------------|
|
|
60
|
+
| `selectedIndexChange` | `EventEmitter<number>` | — |
|
|
61
|
+
| `selectedKeyChange` | `EventEmitter<string>` | — |
|
|
62
|
+
| `tabChange` | `EventEmitter<{ index: number; key: string }>` | — |
|
|
63
|
+
|
|
64
|
+
## Related types
|
|
65
|
+
|
|
66
|
+
From `figma/geo-tabs/geo-tabs.types.ts`:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
export interface GeoTabItem {
|
|
70
|
+
key: string;
|
|
71
|
+
title: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type GeoTabsType = 'line' | 'card';
|
|
76
|
+
|
|
77
|
+
export type GeoTabsSize = 'default' | 'large' | 'small';
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Examples
|
|
81
|
+
|
|
82
|
+
### Basic
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<geo-tabs
|
|
86
|
+
[items]="[{ key: 'info', title: 'Thông tin' }, { key: 'files', title: 'Tệp đính kèm' }]"
|
|
87
|
+
[(selectedKey)]="tab"
|
|
88
|
+
>
|
|
89
|
+
<ng-template uiTab="info">Nội dung thông tin</ng-template>
|
|
90
|
+
<ng-template uiTab="files">Danh sách tệp</ng-template>
|
|
91
|
+
</geo-tabs>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Full options
|
|
95
|
+
|
|
46
96
|
```html
|
|
47
|
-
<geo-tabs
|
|
48
|
-
|
|
49
|
-
|
|
97
|
+
<geo-tabs
|
|
98
|
+
[items]="[
|
|
99
|
+
{ key: 'info', title: 'Thông tin' },
|
|
100
|
+
{ key: 'history', title: 'Lịch sử' },
|
|
101
|
+
{ key: 'files', title: 'Tệp đính kèm' }
|
|
102
|
+
]"
|
|
103
|
+
type="line"
|
|
104
|
+
size="default"
|
|
105
|
+
[selectedIndex]="0"
|
|
106
|
+
[centered]="false"
|
|
107
|
+
[animated]="true"
|
|
108
|
+
(selectedKeyChange)="onTab($event)"
|
|
109
|
+
(tabChange)="onTabChange($event)"
|
|
110
|
+
>
|
|
111
|
+
<ng-template uiTab="info">…</ng-template>
|
|
112
|
+
<ng-template uiTab="history">…</ng-template>
|
|
113
|
+
<ng-template uiTab="files">…</ng-template>
|
|
50
114
|
</geo-tabs>
|
|
51
115
|
```
|
|
52
116
|
|
|
117
|
+
## Tips
|
|
118
|
+
|
|
119
|
+
- Wizard tuần tự → geo-stepper, không tabs.
|
|
120
|
+
- [(selectedIndex)] hoặc [(selectedKey)].
|
|
121
|
+
- Bắt buộc import GeoTabDirective cho uiTab.
|
|
122
|
+
## Related components
|
|
123
|
+
|
|
124
|
+
- [`geo-stepper`](./geo-stepper.md)
|
|
125
|
+
- [`geo-typography`](./geo-typography.md)
|
|
126
|
+
## Package path
|
|
127
|
+
`node_modules/@geoit/ui/ai/components/geo-tabs.md`
|
|
128
|
+
|
|
53
129
|
## Source
|
|
54
130
|
`projects/geo-ui/src/lib/figma/geo-tabs/geo-tabs.component.ts`
|
|
55
131
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
## Rules for AI
|
|
60
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
132
|
+
## Rules for AI / consumers
|
|
133
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
61
134
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
62
|
-
- Match props to
|
|
135
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
136
|
+
- Copy examples and adapt labels/bindings only.
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
# geo-textarea
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoTextareaComponent** (`@geoit/ui`)
|
|
4
|
+
>
|
|
5
|
+
> Read this file before using the component. Use **only** the Inputs/Outputs listed here.
|
|
4
6
|
|
|
5
7
|
## Summary
|
|
6
8
|
Multi-line text field with label/validation.
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoTextareaComponent } from '@geoit/ui';
|
|
14
|
+
import { FormsModule } from '@angular/forms'; // when using [(ngModel)]
|
|
11
15
|
```
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
Add to the consuming standalone component:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
imports: [GeoTextareaComponent, FormsModule]
|
|
21
|
+
```
|
|
14
22
|
|
|
15
23
|
## Selector
|
|
16
24
|
`geo-textarea`
|
|
@@ -24,36 +32,87 @@ Notes, descriptions, long text.
|
|
|
24
32
|
## Do not use when
|
|
25
33
|
Single-line — use geo-input.
|
|
26
34
|
|
|
35
|
+
## How to use
|
|
36
|
+
|
|
37
|
+
Ô đa dòng (CVA). label + [(ngModel)]; rows; [block] mặc định true; maxlength + errorMessage khi validate.
|
|
38
|
+
|
|
39
|
+
## Binding
|
|
40
|
+
|
|
41
|
+
Supports **ControlValueAccessor**.
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<geo-textarea [(ngModel)]="value"></geo-textarea>
|
|
45
|
+
<!-- or -->
|
|
46
|
+
<geo-textarea formControlName="field"></geo-textarea>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Also import `FormsModule` (template-driven) or `ReactiveFormsModule`.
|
|
50
|
+
|
|
27
51
|
## Inputs
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
52
|
+
|
|
53
|
+
Every supported Input (do not invent others):
|
|
54
|
+
|
|
55
|
+
| Input | Type | Default | Description |
|
|
56
|
+
|-------|------|---------|-------------|
|
|
57
|
+
| `label` | `string` | `''` | — |
|
|
58
|
+
| `placeholder` | `string` | `''` | — |
|
|
59
|
+
| `rows` | `number` | `3` | — |
|
|
60
|
+
| `disabled` | `boolean` | `false` | — |
|
|
61
|
+
| `required` | `boolean` | `false` | — |
|
|
62
|
+
| `error` | `boolean` | `false` | — |
|
|
63
|
+
| `errorMessage` | `string` | `''` | — |
|
|
64
|
+
| `maxlength` | `number` | — | — |
|
|
65
|
+
| `block` | `boolean` | `true` | — |
|
|
39
66
|
|
|
40
67
|
## Outputs
|
|
41
|
-
| Output | Notes |
|
|
42
|
-
|--------|-------|
|
|
43
|
-
| `valueChange` | EventEmitter |
|
|
44
68
|
|
|
45
|
-
|
|
69
|
+
| Output | Payload | Description |
|
|
70
|
+
|--------|---------|-------------|
|
|
71
|
+
| `valueChange` | `EventEmitter<string>` | — |
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
### Basic
|
|
77
|
+
|
|
46
78
|
```html
|
|
47
79
|
<geo-textarea label="Ghi chú" [rows]="4" [block]="true" [(ngModel)]="note"></geo-textarea>
|
|
48
80
|
```
|
|
49
81
|
|
|
82
|
+
### Full options
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<geo-textarea
|
|
86
|
+
label="Mô tả"
|
|
87
|
+
placeholder="Nhập mô tả chi tiết"
|
|
88
|
+
[rows]="5"
|
|
89
|
+
[required]="true"
|
|
90
|
+
[maxlength]="500"
|
|
91
|
+
[block]="true"
|
|
92
|
+
[error]="descError"
|
|
93
|
+
errorMessage="Vui lòng nhập mô tả"
|
|
94
|
+
[(ngModel)]="description"
|
|
95
|
+
(valueChange)="onDesc($event)"
|
|
96
|
+
></geo-textarea>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Tips
|
|
100
|
+
|
|
101
|
+
- Một dòng → geo-input.
|
|
102
|
+
- Đặt [required] + error khi submit.
|
|
103
|
+
- block=true full width trong modal.
|
|
104
|
+
## Related components
|
|
105
|
+
|
|
106
|
+
- [`geo-input`](./geo-input.md)
|
|
107
|
+
- [`geo-form-modal`](./geo-form-modal.md)
|
|
108
|
+
## Package path
|
|
109
|
+
`node_modules/@geoit/ui/ai/components/geo-textarea.md`
|
|
110
|
+
|
|
50
111
|
## Source
|
|
51
112
|
`projects/geo-ui/src/lib/figma/geo-textarea/geo-textarea.component.ts`
|
|
52
113
|
|
|
53
|
-
##
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## Rules for AI
|
|
57
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
114
|
+
## Rules for AI / consumers
|
|
115
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
58
116
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
59
|
-
- Match props to
|
|
117
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
118
|
+
- Copy examples and adapt labels/bindings only.
|