@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,24 @@
1
1
  # geo-file-picker
2
2
 
3
- > AI quick reference for **GeoFilePickerComponent**
3
+ > Complete usage reference for **GeoFilePickerComponent** (`@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
  Compact file input for forms (button + filename).
7
9
 
8
10
  ## Import
11
+
9
12
  ```ts
10
13
  import { GeoFilePickerComponent } from '@geoit/ui';
14
+ import { FormsModule } from '@angular/forms'; // when using [(ngModel)]
11
15
  ```
12
16
 
13
- Standalone component — add to `imports: [GeoFilePickerComponent]` of the consuming standalone component/module.
17
+ Add to the consuming standalone component:
18
+
19
+ ```ts
20
+ imports: [GeoFilePickerComponent, FormsModule]
21
+ ```
14
22
 
15
23
  ## Selector
16
24
  `geo-file-picker`
@@ -24,39 +32,102 @@ Single/small file field inside a form row.
24
32
  ## Do not use when
25
33
  Drag-drop multi upload with progress — use geo-upload.
26
34
 
35
+ ## How to use
36
+
37
+ Ô chọn file gọn trong form (nút + tên file). CVA; (fileChange) nhận File | FileList; accept để giới hạn loại.
38
+
39
+ ## Binding
40
+
41
+ Supports **ControlValueAccessor**.
42
+
43
+ ```html
44
+ <geo-file-picker [(ngModel)]="value"></geo-file-picker>
45
+ <!-- or -->
46
+ <geo-file-picker formControlName="field"></geo-file-picker>
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
- | `buttonText` | See component TS / Storybook Controls |
33
- | `required` | See component TS / Storybook Controls |
34
- | `disabled` | See component TS / Storybook Controls |
35
- | `accept` | See component TS / Storybook Controls |
36
- | `multiple` | See component TS / Storybook Controls |
37
- | `error` | See component TS / Storybook Controls |
38
- | `errorMessage` | See component TS / Storybook Controls |
39
- | `block` | See component TS / Storybook Controls |
40
- | `width` | See component TS / Storybook Controls |
41
- | `selectedName` | See component TS / Storybook Controls |
52
+
53
+ Every supported Input (do not invent others):
54
+
55
+ | Input | Type | Default | Description |
56
+ |-------|------|---------|-------------|
57
+ | `label` | `string` | `'Tải file'` | |
58
+ | `placeholder` | `string` | `'Chọn giá trị'` | |
59
+ | `buttonText` | `string` | `'Chọn file'` | |
60
+ | `required` | `boolean` | `false` | |
61
+ | `disabled` | `boolean` | `false` | |
62
+ | `accept` | `string` | `''` | |
63
+ | `multiple` | `boolean` | `false` | |
64
+ | `error` | `boolean` | `false` | |
65
+ | `errorMessage` | `string` | `''` | |
66
+ | `block` | `boolean` | `false` | — |
67
+ | `width` | `number \| string` | — | — |
68
+ | `selectedName` | `string` | `''` | Tên file đã upload (server) — hiện khi chưa có File local trong CVA. Dùng cho flow: chọn file → upload → giữ tên từ API. |
42
69
 
43
70
  ## Outputs
44
- | Output | Notes |
45
- |--------|-------|
46
- | `fileChange` | EventEmitter |
47
71
 
48
- ## Example
72
+ | Output | Payload | Description |
73
+ |--------|---------|-------------|
74
+ | `fileChange` | `EventEmitter<File \| File[] \| null>` | — |
75
+
76
+ ## Related types
77
+
78
+ From `figma/geo-file-picker/geo-file-picker.types.ts`:
79
+
80
+ ```ts
81
+ export interface GeoFilePickerValue {
82
+ file: File;
83
+ name: string;
84
+ }
85
+ ```
86
+
87
+ ## Examples
88
+
89
+ ### Basic
90
+
49
91
  ```html
50
92
  <geo-file-picker label="Đính kèm" accept=".pdf,.png" (fileChange)="onFile($event)" [block]="true"></geo-file-picker>
51
93
  ```
52
94
 
95
+ ### Full options
96
+
97
+ ```html
98
+ <geo-file-picker
99
+ label="Tải file"
100
+ placeholder="Chọn giá trị"
101
+ buttonText="Chọn file"
102
+ accept=".pdf,.doc,.docx"
103
+ [multiple]="false"
104
+ [required]="true"
105
+ [block]="true"
106
+ [error]="fileError"
107
+ errorMessage="Vui lòng chọn file"
108
+ [(ngModel)]="file"
109
+ (fileChange)="onFile($event)"
110
+ ></geo-file-picker>
111
+ ```
112
+
113
+ ## Tips
114
+
115
+ - Upload kéo-thả nhiều file + progress → geo-upload.
116
+ - selectedName hiển thị tên đã chọn khi không bind CVA file object.
117
+ - [block]="true" trong modal form.
118
+ ## Related components
119
+
120
+ - [`geo-upload`](./geo-upload.md)
121
+ - [`geo-form-modal`](./geo-form-modal.md)
122
+ - [`geo-input`](./geo-input.md)
123
+ ## Package path
124
+ `node_modules/@geoit/ui/ai/components/geo-file-picker.md`
125
+
53
126
  ## Source
54
127
  `projects/geo-ui/src/lib/figma/geo-file-picker/geo-file-picker.component.ts`
55
128
 
56
- ## Storybook
57
- GEO / related story for `geo-file-picker`
58
-
59
- ## Rules for AI
60
- - Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
129
+ ## Rules for AI / consumers
130
+ - Prefer this component over raw ng-zorro / HTML for the same UI role.
61
131
  - Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
62
- - Match props to Storybook Controls / this doc; do not invent unsupported inputs.
132
+ - Match props exactly to the Inputs table; do not invent unsupported inputs.
133
+ - Copy examples and adapt labels/bindings only.
@@ -1,16 +1,24 @@
1
1
  # geo-form-modal
2
2
 
3
- > AI quick reference for **GeoFormModalComponent**
3
+ > Complete usage reference for **GeoFormModalComponent** (`@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
  Form modal: fixed header/footer, scrollable body via ng-content.
7
9
 
8
10
  ## Import
11
+
9
12
  ```ts
10
13
  import { GeoFormModalComponent } from '@geoit/ui';
14
+ import { FormsModule } from '@angular/forms'; // when using [(ngModel)]
11
15
  ```
12
16
 
13
- Standalone component — add to `imports: [GeoFormModalComponent]` of the consuming standalone component/module.
17
+ Add to the consuming standalone component:
18
+
19
+ ```ts
20
+ imports: [GeoFormModalComponent, FormsModule]
21
+ ```
14
22
 
15
23
  ## Selector
16
24
  `geo-form-modal`
@@ -24,45 +32,61 @@ Create/edit dialogs; compose geo-stepper inside body for multi-step.
24
32
  ## Do not use when
25
33
  Full-page wizards — use geo-step-form-layout.
26
34
 
35
+ ## How to use
36
+
37
+ Modal form: header/footer cố định, body scroll qua ng-content. [open] + (openChange); (ok)/(cancel). Ghép geo-stepper trong body cho multi-step dialog.
38
+
39
+ ## Binding
40
+
41
+ Standalone presentational / container component — drive via Inputs and Outputs (no `ngModel` unless documented).
42
+
27
43
  ## Inputs
28
- | Input | Notes |
29
- |-------|-------|
30
- | `open` | See component TS / Storybook Controls |
31
- | `title` | See component TS / Storybook Controls |
32
- | `titleUppercase` | See component TS / Storybook Controls |
33
- | `okText` | See component TS / Storybook Controls |
34
- | `cancelText` | See component TS / Storybook Controls |
35
- | `cancelIcon` | See component TS / Storybook Controls |
36
- | `cancelIconPlacement` | See component TS / Storybook Controls |
37
- | `okIcon` | See component TS / Storybook Controls |
38
- | `okIconPlacement` | See component TS / Storybook Controls |
39
- | `secondaryOkText` | See component TS / Storybook Controls |
40
- | `confirmLoading` | See component TS / Storybook Controls |
41
- | `okDisabled` | See component TS / Storybook Controls |
42
- | `readonly` | See component TS / Storybook Controls |
43
- | `width` | See component TS / Storybook Controls |
44
- | `closable` | See component TS / Storybook Controls |
45
- | `mask` | See component TS / Storybook Controls |
46
- | `maskClosable` | See component TS / Storybook Controls |
47
- | `keyboard` | See component TS / Storybook Controls |
48
- | `centered` | See component TS / Storybook Controls |
49
- | `zIndex` | See component TS / Storybook Controls |
50
- | `className` | See component TS / Storybook Controls |
51
- | `wrapClassName` | See component TS / Storybook Controls |
52
- | `bodyScroll` | See component TS / Storybook Controls |
53
- | `bodyMaxHeight` | See component TS / Storybook Controls |
44
+
45
+ Every supported Input (do not invent others):
46
+
47
+ | Input | Type | Default | Description |
48
+ |-------|------|---------|-------------|
49
+ | `open` | `boolean` | `false` | Tương đương `open` (antd) / `nzVisible` (ng-zorro). |
50
+ | `title` | `string` | `''` | |
51
+ | `titleUppercase` | `boolean` | `true` | Title chữ in hoa. Default `true` theo design. |
52
+ | `okText` | `string` | `'Lưu'` | |
53
+ | `cancelText` | `string` | `'Hủy'` | |
54
+ | `cancelIcon` | `string` | | Icon nút cancel (vd. `left` cho Quay lại). |
55
+ | `cancelIconPlacement` | `'start' \| 'end'` | `'start'` | |
56
+ | `okIcon` | `string` | | Icon nút OK (vd. `right` cho Tiếp theo). |
57
+ | `okIconPlacement` | `'start' \| 'end'` | `'end'` | |
58
+ | `secondaryOkText` | `string` | `''` | Nút phụ (vd. Lưu và khởi tạo lại). Chỉ hiện khi có text và không readonly. |
59
+ | `confirmLoading` | `boolean` | `false` | Loading trên nút OK — giống antd `confirmLoading` / nz `nzOkLoading`. |
60
+ | `okDisabled` | `boolean` | `false` | Disable nút OK — giống antd `okButtonProps.disabled` / nz `nzOkDisabled`. |
61
+ | `readonly` | `boolean` | `false` | Ẩn nút OK (xem chi tiết). |
62
+ | `width` | `number \| string` | `720` | |
63
+ | `closable` | `boolean` | `true` | |
64
+ | `mask` | `boolean` | `true` | |
65
+ | `maskClosable` | `boolean` | `false` | |
66
+ | `keyboard` | `boolean` | `true` | |
67
+ | `centered` | `boolean` | `true` | |
68
+ | `zIndex` | `number` | `1000` | |
69
+ | `className` | `string` | `''` | |
70
+ | `wrapClassName` | `string` | `''` | — |
71
+ | `bodyScroll` | `boolean` | `true` | Body cuộn, header/footer cố định. |
72
+ | `bodyMaxHeight` | `string \| number` | `'60vh'` | Max-height của vùng body khi `bodyScroll` (vd `'60vh'`, `400`). |
54
73
 
55
74
  ## Outputs
56
- | Output | Notes |
57
- |--------|-------|
58
- | `openChange` | EventEmitter |
59
- | `ok` | EventEmitter |
60
- | `secondaryOk` | EventEmitter |
61
- | `cancel` | EventEmitter |
62
- | `afterOpen` | EventEmitter |
63
- | `afterClose` | EventEmitter |
64
-
65
- ## Example
75
+
76
+ | Output | Payload | Description |
77
+ |--------|---------|-------------|
78
+ | `openChange` | `EventEmitter<boolean>` | — |
79
+ | `ok` | `EventEmitter<void>` | — |
80
+ | `secondaryOk` | `EventEmitter<void>` | — |
81
+ | `cancel` | `EventEmitter<void>` | — |
82
+ | `afterOpen` | `EventEmitter<void>` | — |
83
+ | `afterClose` | `EventEmitter<void>` | — |
84
+
85
+
86
+ ## Examples
87
+
88
+ ### Basic
89
+
66
90
  ```html
67
91
  <geo-form-modal
68
92
  [open]="open"
@@ -76,13 +100,57 @@ Full-page wizards — use geo-step-form-layout.
76
100
  </geo-form-modal>
77
101
  ```
78
102
 
103
+ ### Full options
104
+
105
+ ```html
106
+ <geo-form-modal
107
+ [open]="open"
108
+ title="Lập phiếu đăng ký"
109
+ [titleUppercase]="true"
110
+ cancelText="Hủy bỏ"
111
+ okText="Lưu"
112
+ okIcon="right"
113
+ okIconPlacement="end"
114
+ [confirmLoading]="saving"
115
+ [okDisabled]="!valid"
116
+ [width]="720"
117
+ [closable]="true"
118
+ [mask]="true"
119
+ [maskClosable]="false"
120
+ [centered]="true"
121
+ [bodyScroll]="true"
122
+ bodyMaxHeight="60vh"
123
+ (openChange)="open = $event"
124
+ (ok)="onSave()"
125
+ (cancel)="open = false"
126
+ >
127
+ <div style="display:grid;grid-template-columns:1fr 1fr;gap:16px;">
128
+ <geo-input label="Mã" [required]="true" [block]="true" [(ngModel)]="code"></geo-input>
129
+ <geo-input label="Tên" [required]="true" [block]="true" [(ngModel)]="name"></geo-input>
130
+ </div>
131
+ </geo-form-modal>
132
+ ```
133
+
134
+ ## Tips
135
+
136
+ - Wizard full-page → geo-step-form-layout.
137
+ - okIcon/cancelIcon + placement cho nút Tiếp theo / Quay lại.
138
+ - bodyMaxHeight mặc định 60vh; readonly ẩn nút OK.
139
+ ## Related components
140
+
141
+ - [`geo-stepper`](./geo-stepper.md)
142
+ - [`geo-input`](./geo-input.md)
143
+ - [`geo-select`](./geo-select.md)
144
+ - [`geo-confirm-modal`](./geo-confirm-modal.md)
145
+ - [`geo-step-form-layout`](./geo-step-form-layout.md)
146
+ ## Package path
147
+ `node_modules/@geoit/ui/ai/components/geo-form-modal.md`
148
+
79
149
  ## Source
80
150
  `projects/geo-ui/src/lib/figma/geo-form-modal/geo-form-modal.component.ts`
81
151
 
82
- ## Storybook
83
- GEO / related story for `geo-form-modal`
84
-
85
- ## Rules for AI
86
- - Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
152
+ ## Rules for AI / consumers
153
+ - Prefer this component over raw ng-zorro / HTML for the same UI role.
87
154
  - Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
88
- - Match props to Storybook Controls / this doc; do not invent unsupported inputs.
155
+ - Match props exactly to the Inputs table; do not invent unsupported inputs.
156
+ - Copy examples and adapt labels/bindings only.
@@ -1,16 +1,23 @@
1
1
  # geo-icon
2
2
 
3
- > AI quick reference for **GeoIconComponent**
3
+ > Complete usage reference for **GeoIconComponent** (`@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
  Ant Design icon wrapper with GEO size/color tokens.
7
9
 
8
10
  ## Import
11
+
9
12
  ```ts
10
13
  import { GeoIconComponent } from '@geoit/ui';
11
14
  ```
12
15
 
13
- Standalone component — add to `imports: [GeoIconComponent]` of the consuming standalone component/module.
16
+ Add to the consuming standalone component:
17
+
18
+ ```ts
19
+ imports: [GeoIconComponent]
20
+ ```
14
21
 
15
22
  ## Selector
16
23
  `geo-icon`
@@ -24,30 +31,77 @@ Standalone icons; buttons usually use geo-button [icon].
24
31
  ## Do not use when
25
32
  Do not hardcode icon hex colors — use color token names.
26
33
 
34
+ ## How to use
35
+
36
+ Wrapper icon Ant Design. Bắt buộc [type]; size xs|sm|md|lg|xl hoặc px; color dùng token (vd. primary / var(--geo-color-*)).
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
- | `type` | See component TS / Storybook Controls |
31
- | `theme` | See component TS / Storybook Controls |
32
- | `spin` | See component TS / Storybook Controls |
33
- | `size` | See component TS / Storybook Controls |
34
- | `color` | See component TS / Storybook Controls |
43
+
44
+ Every supported Input (do not invent others):
45
+
46
+ | Input | Type | Default | Description |
47
+ |-------|------|---------|-------------|
48
+ | `type` | | | Tên icon Ant Design (vd. `close`, `search`, `appstore`). |
49
+ | `theme` | `'outline' \| 'fill' \| 'twotone'` | `'outline'` | — |
50
+ | `spin` | `boolean` | `false` | — |
51
+ | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| number \| string` | `'md'` | xs \| sm \| md \| lg \| xl \| number(px) \| CSS size string |
52
+ | `color` | `string` | — | CSS color — ưu tiên design token, vd. `var(--geo-color-primary-default)` |
35
53
 
36
54
  ## Outputs
55
+
37
56
  _None_
38
57
 
39
- ## Example
58
+ ## Related types
59
+
60
+ From `figma/geo-icon/geo-icon.types.ts`:
61
+
62
+ ```ts
63
+ export type GeoIconTheme = 'outline' | 'fill' | 'twotone';
64
+
65
+ export type GeoIconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number | string;
66
+ ```
67
+
68
+ ## Examples
69
+
70
+ ### Basic
71
+
40
72
  ```html
41
73
  <geo-icon type="search" size="md" color="primary"></geo-icon>
42
74
  ```
43
75
 
76
+ ### Full options
77
+
78
+ ```html
79
+ <geo-icon
80
+ type="loading"
81
+ theme="outline"
82
+ size="lg"
83
+ color="var(--geo-color-primary-default)"
84
+ [spin]="true"
85
+ ></geo-icon>
86
+ ```
87
+
88
+ ## Tips
89
+
90
+ - Trong nút ưu tiên geo-button [icon].
91
+ - Không hardcode hex — dùng color token.
92
+ - theme outline|fill|twotone; spin cho loading.
93
+ ## Related components
94
+
95
+ - [`geo-button`](./geo-button.md)
96
+ - [`geo-status-tag`](./geo-status-tag.md)
97
+ ## Package path
98
+ `node_modules/@geoit/ui/ai/components/geo-icon.md`
99
+
44
100
  ## Source
45
101
  `projects/geo-ui/src/lib/figma/geo-icon/geo-icon.component.ts`
46
102
 
47
- ## Storybook
48
- GEO / related story for `geo-icon`
49
-
50
- ## Rules for AI
51
- - Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
103
+ ## Rules for AI / consumers
104
+ - Prefer this component over raw ng-zorro / HTML for the same UI role.
52
105
  - Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
53
- - Match props to Storybook Controls / this doc; do not invent unsupported inputs.
106
+ - Match props exactly to the Inputs table; do not invent unsupported inputs.
107
+ - Copy examples and adapt labels/bindings only.
@@ -1,16 +1,24 @@
1
1
  # geo-input
2
2
 
3
- > AI quick reference for **GeoInputComponent**
3
+ > Complete usage reference for **GeoInputComponent** (`@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
  Text input with label, validation, icons; CVA/ngModel.
7
9
 
8
10
  ## Import
11
+
9
12
  ```ts
10
13
  import { GeoInputComponent } from '@geoit/ui';
14
+ import { FormsModule } from '@angular/forms'; // when using [(ngModel)]
11
15
  ```
12
16
 
13
- Standalone component — add to `imports: [GeoInputComponent]` of the consuming standalone component/module.
17
+ Add to the consuming standalone component:
18
+
19
+ ```ts
20
+ imports: [GeoInputComponent, FormsModule]
21
+ ```
14
22
 
15
23
  ## Selector
16
24
  `geo-input`
@@ -24,42 +32,97 @@ Default text fields in forms.
24
32
  ## Do not use when
25
33
  Long text — use geo-textarea; select options — use geo-select.
26
34
 
35
+ ## How to use
36
+
37
+ Ô text chuẩn form (CVA). label + [(ngModel)]; type text|number|password|email; prefixIcon/suffixIcon; [block] full width.
38
+
39
+ ## Binding
40
+
41
+ Supports **ControlValueAccessor**.
42
+
43
+ ```html
44
+ <geo-input [(ngModel)]="value"></geo-input>
45
+ <!-- or -->
46
+ <geo-input formControlName="field"></geo-input>
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
- | `type` | See component TS / Storybook Controls |
33
- | `disabled` | See component TS / Storybook Controls |
34
- | `readonly` | See component TS / Storybook Controls |
35
- | `required` | See component TS / Storybook Controls |
36
- | `error` | See component TS / Storybook Controls |
37
- | `errorMessage` | See component TS / Storybook Controls |
38
- | `maxlength` | See component TS / Storybook Controls |
39
- | `prefixIcon` | See component TS / Storybook Controls |
40
- | `suffixIcon` | See component TS / Storybook Controls |
41
- | `allowClear` | See component TS / Storybook Controls |
42
- | `block` | See component TS / Storybook Controls |
43
- | `width` | 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
+ | `type` | `'text' \| 'number' \| 'password' \| 'email'` | `'text'` | — |
60
+ | `disabled` | `boolean` | `false` | |
61
+ | `readonly` | `boolean` | `false` | |
62
+ | `required` | `boolean` | `false` | |
63
+ | `error` | `boolean` | `false` | |
64
+ | `errorMessage` | `string` | `''` | |
65
+ | `maxlength` | `number` | | |
66
+ | `prefixIcon` | `string` | | |
67
+ | `suffixIcon` | `string` | | |
68
+ | `allowClear` | `boolean` | `false` | — |
69
+ | `block` | `boolean` | `false` | — |
70
+ | `width` | `number \| string` | — | — |
44
71
 
45
72
  ## Outputs
46
- | Output | Notes |
47
- |--------|-------|
48
- | `valueChange` | EventEmitter |
49
- | `enterPressed` | EventEmitter |
50
73
 
51
- ## Example
74
+ | Output | Payload | Description |
75
+ |--------|---------|-------------|
76
+ | `valueChange` | `EventEmitter<string>` | — |
77
+ | `enterPressed` | `EventEmitter<void>` | — |
78
+
79
+
80
+ ## Examples
81
+
82
+ ### Basic
83
+
52
84
  ```html
53
85
  <geo-input label="Họ tên" [required]="true" [block]="true" [(ngModel)]="name"></geo-input>
54
86
  ```
55
87
 
88
+ ### Full options
89
+
90
+ ```html
91
+ <geo-input
92
+ label="Mã hồ sơ"
93
+ placeholder="Nhập mã hồ sơ"
94
+ type="text"
95
+ prefixIcon="search"
96
+ [allowClear]="true"
97
+ [required]="true"
98
+ [block]="true"
99
+ [maxlength]="50"
100
+ [error]="codeError"
101
+ errorMessage="Mã không được để trống"
102
+ [(ngModel)]="code"
103
+ (enterPressed)="onSearch()"
104
+ (valueChange)="onCode($event)"
105
+ ></geo-input>
106
+ ```
107
+
108
+ ## Tips
109
+
110
+ - Văn bản dài → geo-textarea; chọn danh sách → geo-select.
111
+ - error + errorMessage khi validate fail.
112
+ - (enterPressed) cho tìm kiếm nhanh.
113
+ ## Related components
114
+
115
+ - [`geo-textarea`](./geo-textarea.md)
116
+ - [`geo-select`](./geo-select.md)
117
+ - [`geo-form-modal`](./geo-form-modal.md)
118
+ ## Package path
119
+ `node_modules/@geoit/ui/ai/components/geo-input.md`
120
+
56
121
  ## Source
57
122
  `projects/geo-ui/src/lib/figma/geo-input/geo-input.component.ts`
58
123
 
59
- ## Storybook
60
- GEO / related story for `geo-input`
61
-
62
- ## Rules for AI
63
- - Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
124
+ ## Rules for AI / consumers
125
+ - Prefer this component over raw ng-zorro / HTML for the same UI role.
64
126
  - Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
65
- - Match props to Storybook Controls / this doc; do not invent unsupported inputs.
127
+ - Match props exactly to the Inputs table; do not invent unsupported inputs.
128
+ - Copy examples and adapt labels/bindings only.