@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.
Files changed (38) hide show
  1. package/README.md +148 -12
  2. package/ai/AGENTS.md +5 -4
  3. package/ai/README.md +2 -2
  4. package/ai/catalog.json +3064 -424
  5. package/ai/components/geo-alert.md +75 -21
  6. package/ai/components/geo-back-button.md +64 -18
  7. package/ai/components/geo-breadcrumb.md +71 -12
  8. package/ai/components/geo-button.md +90 -27
  9. package/ai/components/geo-checkbox.md +69 -20
  10. package/ai/components/geo-column-picker.md +91 -18
  11. package/ai/components/geo-confirm-modal.md +93 -27
  12. package/ai/components/geo-date-picker.md +103 -29
  13. package/ai/components/geo-date-range-picker.md +99 -28
  14. package/ai/components/geo-file-picker.md +97 -26
  15. package/ai/components/geo-form-modal.md +112 -44
  16. package/ai/components/geo-icon.md +70 -16
  17. package/ai/components/geo-input.md +92 -29
  18. package/ai/components/geo-page-title.md +62 -16
  19. package/ai/components/geo-pagination.md +79 -24
  20. package/ai/components/geo-radio.md +108 -27
  21. package/ai/components/geo-row-actions.md +87 -19
  22. package/ai/components/geo-select.md +106 -28
  23. package/ai/components/geo-slider.md +72 -21
  24. package/ai/components/geo-status-tag.md +67 -15
  25. package/ai/components/geo-step-form-layout.md +122 -38
  26. package/ai/components/geo-stepper.md +82 -19
  27. package/ai/components/geo-table-filter.md +91 -29
  28. package/ai/components/geo-table-pagination.md +73 -23
  29. package/ai/components/geo-table-toolbar.md +84 -29
  30. package/ai/components/geo-table.md +194 -59
  31. package/ai/components/geo-tabs.md +101 -27
  32. package/ai/components/geo-textarea.md +82 -23
  33. package/ai/components/geo-toast.md +138 -27
  34. package/ai/components/geo-tree.md +96 -22
  35. package/ai/components/geo-typography.md +70 -19
  36. package/ai/components/geo-upload.md +110 -39
  37. package/ai/recipes.md +76 -4
  38. package/package.json +1 -1
@@ -1,16 +1,23 @@
1
1
  # geo-table
2
2
 
3
- > AI quick reference for **GeoTableComponent**
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
- Standalone component — add to `imports: [GeoTableComponent]` of the consuming standalone component/module.
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
- | Input | Notes |
29
- |-------|-------|
30
- | `columns` | See component TS / Storybook Controls |
31
- | `data` | See component TS / Storybook Controls |
32
- | `loading` | See component TS / Storybook Controls |
33
- | `bordered` | See component TS / Storybook Controls |
34
- | `outerBordered` | See component TS / Storybook Controls |
35
- | `size` | See component TS / Storybook Controls |
36
- | `striped` | See component TS / Storybook Controls |
37
- | `clickable` | See component TS / Storybook Controls |
38
- | `tableLayout` | See component TS / Storybook Controls |
39
- | `showPagination` | See component TS / Storybook Controls |
40
- | `frontPagination` | See component TS / Storybook Controls |
41
- | `pageIndex` | See component TS / Storybook Controls |
42
- | `pageSize` | See component TS / Storybook Controls |
43
- | `total` | See component TS / Storybook Controls |
44
- | `pageSizeOptions` | See component TS / Storybook Controls |
45
- | `showSizeChanger` | See component TS / Storybook Controls |
46
- | `showQuickJumper` | See component TS / Storybook Controls |
47
- | `hideOnSinglePage` | See component TS / Storybook Controls |
48
- | `simplePagination` | See component TS / Storybook Controls |
49
- | `paginationPosition` | See component TS / Storybook Controls |
50
- | `scroll` | See component TS / Storybook Controls |
51
- | `scrollY` | See component TS / Storybook Controls |
52
- | `autoScroll` | See component TS / Storybook Controls |
53
- | `tableTitle` | See component TS / Storybook Controls |
54
- | `footer` | See component TS / Storybook Controls |
55
- | `emptyText` | See component TS / Storybook Controls |
56
- | `showTotalRange` | See component TS / Storybook Controls |
57
- | `selectable` | See component TS / Storybook Controls |
58
- | `rowKey` | See component TS / Storybook Controls |
59
- | `selectedKeys` | See component TS / Storybook Controls |
60
- | `mobileTitleKey` | See component TS / Storybook Controls |
61
- | `mobileCardView` | See component TS / Storybook Controls |
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 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
- | Output | Notes |
65
- |--------|-------|
66
- | `rowClick` | EventEmitter |
67
- | `rowEdit` | EventEmitter |
68
- | `rowMore` | EventEmitter |
69
- | `rowAction` | EventEmitter |
70
- | `pageIndexChange` | EventEmitter |
71
- | `pageSizeChange` | EventEmitter |
72
- | `queryParams` | EventEmitter |
73
- | `currentPageDataChange` | EventEmitter |
74
- | `selectedKeysChange` | EventEmitter |
75
- | `selectionChange` | EventEmitter |
76
-
77
- ## Example
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
- [pageIndex]="page"
84
- [pageSize]="10"
85
- (pageIndexChange)="onPage($event)"
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
- ## Storybook
93
- GEO / related story for `geo-table`
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 Storybook Controls / this doc; do not invent unsupported inputs.
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
- > AI quick reference for **GeoTabsComponent**
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
- Standalone component — add to `imports: [GeoTabsComponent]` of the consuming standalone component/module.
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
- | Input | Notes |
29
- |-------|-------|
30
- | `items` | See component TS / Storybook Controls |
31
- | `type` | See component TS / Storybook Controls |
32
- | `size` | See component TS / Storybook Controls |
33
- | `selectedIndex` | See component TS / Storybook Controls |
34
- | `selectedKey` | See component TS / Storybook Controls |
35
- | `centered` | See component TS / Storybook Controls |
36
- | `animated` | See component TS / Storybook Controls |
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
- ## Example
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 [items]="[{ key: 'a', title: 'Tab A' }, { key: 'b', title: 'Tab B' }]" [(selectedIndex)]="i">
48
- <ng-template uiTab="a">Content A</ng-template>
49
- <ng-template uiTab="b">Content B</ng-template>
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
- ## Storybook
57
- GEO / related story for `geo-tabs`
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 Storybook Controls / this doc; do not invent unsupported inputs.
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
- > AI quick reference for **GeoTextareaComponent**
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
- Standalone component — add to `imports: [GeoTextareaComponent]` of the consuming standalone component/module.
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
- | Input | Notes |
29
- |-------|-------|
30
- | `label` | See component TS / Storybook Controls |
31
- | `placeholder` | See component TS / Storybook Controls |
32
- | `rows` | See component TS / Storybook Controls |
33
- | `disabled` | See component TS / Storybook Controls |
34
- | `required` | See component TS / Storybook Controls |
35
- | `error` | See component TS / Storybook Controls |
36
- | `errorMessage` | See component TS / Storybook Controls |
37
- | `maxlength` | See component TS / Storybook Controls |
38
- | `block` | See component TS / Storybook Controls |
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
- ## Example
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
- ## Storybook
54
- GEO / related story for `geo-textarea`
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 Storybook Controls / this doc; do not invent unsupported inputs.
117
+ - Match props exactly to the Inputs table; do not invent unsupported inputs.
118
+ - Copy examples and adapt labels/bindings only.