@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-alert
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoAlertComponent** (`@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
|
Inline alert banner (success/error/warning/info).
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoAlertComponent } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoAlertComponent]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-alert`
|
|
@@ -24,33 +31,80 @@ Form-level or page-level status messages that stay in layout.
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Transient notifications — use geo-toast / GeoToastService.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
Hiển thị banner trạng thái cố định trong layout (form/page). Dùng type success|error|warning|info; đóng qua closable + (closed).
|
|
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
|
-
| `
|
|
43
|
+
|
|
44
|
+
Every supported Input (do not invent others):
|
|
45
|
+
|
|
46
|
+
| Input | Type | Default | Description |
|
|
47
|
+
|-------|------|---------|-------------|
|
|
48
|
+
| `type` | `'success' \| 'error' \| 'warning' \| 'info'` | `'info'` | — |
|
|
49
|
+
| `title` | `string` | `''` | — |
|
|
50
|
+
| `message` | `string` | `''` | — |
|
|
51
|
+
| `closable` | `boolean` | `true` | — |
|
|
52
|
+
| `visible` | `boolean` | `true` | — |
|
|
53
|
+
| `showIcon` | `boolean` | `true` | — |
|
|
36
54
|
|
|
37
55
|
## Outputs
|
|
38
|
-
| Output | Notes |
|
|
39
|
-
|--------|-------|
|
|
40
|
-
| `closed` | EventEmitter |
|
|
41
56
|
|
|
42
|
-
|
|
57
|
+
| Output | Payload | Description |
|
|
58
|
+
|--------|---------|-------------|
|
|
59
|
+
| `closed` | `EventEmitter<void>` | — |
|
|
60
|
+
|
|
61
|
+
## Related types
|
|
62
|
+
|
|
63
|
+
From `figma/geo-alert/geo-alert.types.ts`:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
export type GeoAlertType = 'success' | 'error' | 'warning' | 'info';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Examples
|
|
70
|
+
|
|
71
|
+
### Basic
|
|
72
|
+
|
|
43
73
|
```html
|
|
44
|
-
<geo-alert type="success" title="Thành công" message="Đã lưu
|
|
74
|
+
<geo-alert type="success" title="Thành công" message="Đã lưu hồ sơ."></geo-alert>
|
|
45
75
|
```
|
|
46
76
|
|
|
77
|
+
### Full options
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<geo-alert
|
|
81
|
+
type="warning"
|
|
82
|
+
title="Cảnh báo"
|
|
83
|
+
message="Vui lòng kiểm tra lại thông tin trước khi gửi."
|
|
84
|
+
[closable]="true"
|
|
85
|
+
[visible]="showAlert"
|
|
86
|
+
[showIcon]="true"
|
|
87
|
+
(closed)="showAlert = false"
|
|
88
|
+
></geo-alert>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Tips
|
|
92
|
+
|
|
93
|
+
- Toast tạm thời → GeoToastService / geo-toast; alert là inline persistent.
|
|
94
|
+
- Gắn [visible] nếu cần ẩn/hiện từ component cha.
|
|
95
|
+
- title + message dùng tiếng Việt ngắn gọn.
|
|
96
|
+
## Related components
|
|
97
|
+
|
|
98
|
+
- [`geo-toast`](./geo-toast.md)
|
|
99
|
+
- [`geo-icon`](./geo-icon.md)
|
|
100
|
+
## Package path
|
|
101
|
+
`node_modules/@geoit/ui/ai/components/geo-alert.md`
|
|
102
|
+
|
|
47
103
|
## Source
|
|
48
104
|
`projects/geo-ui/src/lib/figma/geo-alert/geo-alert.component.ts`
|
|
49
105
|
|
|
50
|
-
##
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## Rules for AI
|
|
54
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
106
|
+
## Rules for AI / consumers
|
|
107
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
55
108
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
56
|
-
- Match props to
|
|
109
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
110
|
+
- Copy examples and adapt labels/bindings only.
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# geo-back-button
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoBackButtonComponent** (`@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
|
Back navigation control (history or custom click).
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoBackButtonComponent } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoBackButtonComponent]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-back-button`
|
|
@@ -24,31 +31,70 @@ Detail/edit pages that return to a list.
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Primary CTA — use geo-button.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
Nút quay lại trên trang chi tiết/sửa. Mặc định historyBack=true; hoặc lắng nghe (clicked) để điều hướng tùy chỉnh.
|
|
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
|
-
| `
|
|
43
|
+
|
|
44
|
+
Every supported Input (do not invent others):
|
|
45
|
+
|
|
46
|
+
| Input | Type | Default | Description |
|
|
47
|
+
|-------|------|---------|-------------|
|
|
48
|
+
| `ariaLabel` | `string` | `'Quay lại'` | — |
|
|
49
|
+
| `title` | `string` | `'Quay lại'` | — |
|
|
50
|
+
| `disabled` | `boolean` | `false` | — |
|
|
51
|
+
| `historyBack` | `boolean` | `true` | `true` (mặc định): `Location.back()` — về trang trước trong history. |
|
|
34
52
|
|
|
35
53
|
## Outputs
|
|
36
|
-
| Output | Notes |
|
|
37
|
-
|--------|-------|
|
|
38
|
-
| `clicked` | EventEmitter |
|
|
39
54
|
|
|
40
|
-
|
|
55
|
+
| Output | Payload | Description |
|
|
56
|
+
|--------|---------|-------------|
|
|
57
|
+
| `clicked` | `EventEmitter<MouseEvent>` | — |
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### Basic
|
|
63
|
+
|
|
41
64
|
```html
|
|
42
65
|
<geo-back-button (clicked)="goBack()"></geo-back-button>
|
|
43
66
|
```
|
|
44
67
|
|
|
68
|
+
### Full options
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<geo-back-button
|
|
72
|
+
title="Quay lại danh sách"
|
|
73
|
+
ariaLabel="Quay lại danh sách"
|
|
74
|
+
[historyBack]="false"
|
|
75
|
+
[disabled]="saving"
|
|
76
|
+
(clicked)="router.navigate(['/danh-sach'])"
|
|
77
|
+
></geo-back-button>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Tips
|
|
81
|
+
|
|
82
|
+
- CTA chính → geo-button, không dùng back-button.
|
|
83
|
+
- Đặt title/ariaLabel tiếng Việt (mặc định 'Quay lại').
|
|
84
|
+
- Tắt historyBack và xử lý (clicked) khi dùng router.navigate.
|
|
85
|
+
## Related components
|
|
86
|
+
|
|
87
|
+
- [`geo-button`](./geo-button.md)
|
|
88
|
+
- [`geo-page-title`](./geo-page-title.md)
|
|
89
|
+
- [`geo-breadcrumb`](./geo-breadcrumb.md)
|
|
90
|
+
## Package path
|
|
91
|
+
`node_modules/@geoit/ui/ai/components/geo-back-button.md`
|
|
92
|
+
|
|
45
93
|
## Source
|
|
46
94
|
`projects/geo-ui/src/lib/figma/geo-back-button/geo-back-button.component.ts`
|
|
47
95
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## Rules for AI
|
|
52
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
96
|
+
## Rules for AI / consumers
|
|
97
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
53
98
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
54
|
-
- Match props to
|
|
99
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
100
|
+
- Copy examples and adapt labels/bindings only.
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# geo-breadcrumb
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoBreadcrumbComponent** (`@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
|
Breadcrumb trail; last item active (primary).
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoBreadcrumbComponent } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoBreadcrumbComponent]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-breadcrumb`
|
|
@@ -24,15 +31,47 @@ Page hierarchy under page title.
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Primary navigation / sidebar menus.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
Đường dẫn phân cấp trang. Truyền [items] dạng { label, link? }; mục cuối là active (không cần link).
|
|
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
|
-
|
|
43
|
+
|
|
44
|
+
Every supported Input (do not invent others):
|
|
45
|
+
|
|
46
|
+
| Input | Type | Default | Description |
|
|
47
|
+
|-------|------|---------|-------------|
|
|
48
|
+
| `items` | `GeoBreadcrumbItem[]` | `[]` | — |
|
|
31
49
|
|
|
32
50
|
## Outputs
|
|
51
|
+
|
|
33
52
|
_None_
|
|
34
53
|
|
|
35
|
-
##
|
|
54
|
+
## Related types
|
|
55
|
+
|
|
56
|
+
From `figma/geo-breadcrumb/geo-breadcrumb.types.ts`:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
export interface GeoBreadcrumbItem {
|
|
60
|
+
/** Hiển thị trên breadcrumb. */
|
|
61
|
+
label: string;
|
|
62
|
+
/** Router link (optional) — bỏ trống = không phải link. */
|
|
63
|
+
link?: string | string[];
|
|
64
|
+
/** Query params khi dùng routerLink. */
|
|
65
|
+
queryParams?: Record<string, string | number | boolean>;
|
|
66
|
+
/** Đánh dấu item hiện tại (thường là item cuối). */
|
|
67
|
+
active?: boolean;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Examples
|
|
72
|
+
|
|
73
|
+
### Basic
|
|
74
|
+
|
|
36
75
|
```html
|
|
37
76
|
<geo-breadcrumb [items]="[
|
|
38
77
|
{ label: 'Trang chủ', link: '/' },
|
|
@@ -40,13 +79,33 @@ _None_
|
|
|
40
79
|
]"></geo-breadcrumb>
|
|
41
80
|
```
|
|
42
81
|
|
|
82
|
+
### Full options
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<geo-breadcrumb [items]="[
|
|
86
|
+
{ label: 'Trang chủ', link: '/' },
|
|
87
|
+
{ label: 'Tra cứu hồ sơ', link: '/tra-cuu' },
|
|
88
|
+
{ label: 'Xem chi tiết hồ sơ' }
|
|
89
|
+
]"></geo-breadcrumb>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Tips
|
|
93
|
+
|
|
94
|
+
- Thường đặt trên geo-page-title.
|
|
95
|
+
- Không dùng cho menu sidebar.
|
|
96
|
+
- label tiếng Việt; link là route path.
|
|
97
|
+
## Related components
|
|
98
|
+
|
|
99
|
+
- [`geo-page-title`](./geo-page-title.md)
|
|
100
|
+
- [`geo-back-button`](./geo-back-button.md)
|
|
101
|
+
## Package path
|
|
102
|
+
`node_modules/@geoit/ui/ai/components/geo-breadcrumb.md`
|
|
103
|
+
|
|
43
104
|
## Source
|
|
44
105
|
`projects/geo-ui/src/lib/figma/geo-breadcrumb/geo-breadcrumb.component.ts`
|
|
45
106
|
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## Rules for AI
|
|
50
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
107
|
+
## Rules for AI / consumers
|
|
108
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
51
109
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
52
|
-
- Match props to
|
|
110
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
111
|
+
- Copy examples and adapt labels/bindings only.
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# geo-button
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoButtonComponent** (`@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
|
Primary action button with brand/semantic colors and icons.
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoButtonComponent } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoButtonComponent]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-button`
|
|
@@ -24,40 +31,96 @@ All CTAs, form submit/cancel, toolbar actions.
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Do not use raw ant-btn or native button for branded UI.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
CTA chính của GEO UI. appearance primary|secondary|tertiary; color brand|danger|warning|success; icon Ant Design qua [icon].
|
|
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
|
-
| `
|
|
43
|
+
|
|
44
|
+
Every supported Input (do not invent others):
|
|
45
|
+
|
|
46
|
+
| Input | Type | Default | Description |
|
|
47
|
+
|-------|------|---------|-------------|
|
|
48
|
+
| `appearance` | `'primary' \| 'secondary' \| 'tertiary'` | `'primary'` | — |
|
|
49
|
+
| `color` | `'brand' \| 'danger' \| 'warning' \| 'success'` | `'brand'` | — |
|
|
50
|
+
| `icon` | `string` | — | — |
|
|
51
|
+
| `iconTheme` | `'outline' \| 'fill' \| 'twotone'` | `'outline'` | — |
|
|
52
|
+
| `iconPlacement` | `'start' \| 'end'` | `'start'` | Vị trí icon: `start` (trái) hoặc `end` (phải). |
|
|
53
|
+
| `iconOnly` | `boolean` | `false` | — |
|
|
54
|
+
| `type` | `'button' \| 'submit'` | `'button'` | — |
|
|
55
|
+
| `disabled` | `boolean` | `false` | — |
|
|
56
|
+
| `tooltip` | `string` | `''` | Tooltip Ant Design (`nz-tooltip`). Ưu tiên hơn `title` native. |
|
|
57
|
+
| `tooltipPlacement` | `'top' \| 'left' \| 'right' \| 'bottom' \| 'topLeft' \| 'topRight' \| 'bottomLeft' \| 'bottomRight' \| 'le…` | `'top'` | — |
|
|
58
|
+
| `active` | `boolean` | `false` | Trạng thái active (vd. toolbar toggle đang bật). |
|
|
59
|
+
| `title` | `string` | `''` | Native `title` — fallback khi không set `tooltip`. |
|
|
42
60
|
|
|
43
61
|
## Outputs
|
|
44
|
-
| Output | Notes |
|
|
45
|
-
|--------|-------|
|
|
46
|
-
| `clicked` | EventEmitter |
|
|
47
62
|
|
|
48
|
-
|
|
63
|
+
| Output | Payload | Description |
|
|
64
|
+
|--------|---------|-------------|
|
|
65
|
+
| `clicked` | `EventEmitter<MouseEvent>` | — |
|
|
66
|
+
|
|
67
|
+
## Related types
|
|
68
|
+
|
|
69
|
+
From `figma/geo-button/geo-button.types.ts`:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
export type GeoButtonAppearance = 'primary' | 'secondary' | 'tertiary';
|
|
73
|
+
|
|
74
|
+
export type GeoButtonColor = 'brand' | 'danger' | 'warning' | 'success';
|
|
75
|
+
|
|
76
|
+
export type GeoButtonTooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Examples
|
|
80
|
+
|
|
81
|
+
### Basic
|
|
82
|
+
|
|
49
83
|
```html
|
|
50
84
|
<geo-button appearance="primary" color="brand" icon="plus">Thêm mới</geo-button>
|
|
51
|
-
<geo-button appearance="primary" icon="right" iconPlacement="end">Tiếp theo</geo-button>
|
|
52
85
|
```
|
|
53
86
|
|
|
87
|
+
### Full options
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<geo-button
|
|
91
|
+
appearance="primary"
|
|
92
|
+
color="brand"
|
|
93
|
+
icon="right"
|
|
94
|
+
iconTheme="outline"
|
|
95
|
+
iconPlacement="end"
|
|
96
|
+
type="submit"
|
|
97
|
+
tooltip="Lưu và tiếp tục"
|
|
98
|
+
tooltipPlacement="top"
|
|
99
|
+
[disabled]="saving"
|
|
100
|
+
(clicked)="onSave()"
|
|
101
|
+
>Tiếp theo</geo-button>
|
|
102
|
+
|
|
103
|
+
<geo-button appearance="secondary" color="danger" icon="delete" [iconOnly]="true" tooltip="Xóa"></geo-button>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Tips
|
|
107
|
+
|
|
108
|
+
- Không dùng ant-btn / <button> raw cho UI brand.
|
|
109
|
+
- iconPlacement start|end; iconOnly cho toolbar icon.
|
|
110
|
+
- Dùng tooltip thay title native khi cần hover text.
|
|
111
|
+
## Related components
|
|
112
|
+
|
|
113
|
+
- [`geo-icon`](./geo-icon.md)
|
|
114
|
+
- [`geo-form-modal`](./geo-form-modal.md)
|
|
115
|
+
- [`geo-confirm-modal`](./geo-confirm-modal.md)
|
|
116
|
+
## Package path
|
|
117
|
+
`node_modules/@geoit/ui/ai/components/geo-button.md`
|
|
118
|
+
|
|
54
119
|
## Source
|
|
55
120
|
`projects/geo-ui/src/lib/figma/geo-button/geo-button.component.ts`
|
|
56
121
|
|
|
57
|
-
##
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
## Rules for AI
|
|
61
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
122
|
+
## Rules for AI / consumers
|
|
123
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
62
124
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
63
|
-
- Match props to
|
|
125
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
126
|
+
- Copy examples and adapt labels/bindings only.
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# geo-checkbox
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoCheckboxComponent** (`@geoit/ui`)
|
|
4
|
+
>
|
|
5
|
+
> Read this file before using the component. Use **only** the Inputs/Outputs listed here.
|
|
4
6
|
|
|
5
7
|
## Summary
|
|
6
|
-
Checkbox with label;
|
|
8
|
+
Checkbox with label; bind with [(checked)] (not CVA/ngModel).
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoCheckboxComponent } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoCheckboxComponent]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-checkbox`
|
|
@@ -24,31 +31,73 @@ Boolean / multi-select options in forms.
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Single exclusive choice — use geo-radio.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
Checkbox có label. Two-way bằng [(checked)] / (checkedChange) — không phải CVA ngModel.
|
|
37
|
+
|
|
38
|
+
## Binding
|
|
39
|
+
|
|
40
|
+
**Not CVA.** Use two-way `checked`:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<geo-checkbox [(checked)]="agreed" (checkedChange)="onChange($event)"></geo-checkbox>
|
|
44
|
+
```
|
|
45
|
+
|
|
27
46
|
## Inputs
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
| `
|
|
47
|
+
|
|
48
|
+
Every supported Input (do not invent others):
|
|
49
|
+
|
|
50
|
+
| Input | Type | Default | Description |
|
|
51
|
+
|-------|------|---------|-------------|
|
|
52
|
+
| `label` | `string` | `''` | — |
|
|
53
|
+
| `checked` | `boolean` | `false` | — |
|
|
54
|
+
| `disabled` | `boolean` | `false` | — |
|
|
55
|
+
| `indeterminate` | `boolean` | `false` | — |
|
|
34
56
|
|
|
35
57
|
## Outputs
|
|
36
|
-
| Output | Notes |
|
|
37
|
-
|--------|-------|
|
|
38
|
-
| `checkedChange` | EventEmitter |
|
|
39
58
|
|
|
40
|
-
|
|
59
|
+
| Output | Payload | Description |
|
|
60
|
+
|--------|---------|-------------|
|
|
61
|
+
| `checkedChange` | `EventEmitter<boolean>` | — |
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Examples
|
|
65
|
+
|
|
66
|
+
### Basic
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<geo-checkbox label="Tôi đồng ý điều khoản" [(checked)]="agreed"></geo-checkbox>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Full options
|
|
73
|
+
|
|
41
74
|
```html
|
|
42
|
-
<geo-checkbox
|
|
75
|
+
<geo-checkbox
|
|
76
|
+
label="Chọn tất cả"
|
|
77
|
+
[(checked)]="allChecked"
|
|
78
|
+
[indeterminate]="indeterminate"
|
|
79
|
+
[disabled]="loading"
|
|
80
|
+
(checkedChange)="onToggleAll($event)"
|
|
81
|
+
></geo-checkbox>
|
|
43
82
|
```
|
|
44
83
|
|
|
84
|
+
## Tips
|
|
85
|
+
|
|
86
|
+
- Độc quyền 1 lựa chọn → geo-radio.
|
|
87
|
+
- indeterminate cho trạng thái chọn một phần (select-all).
|
|
88
|
+
- Luôn dùng [(checked)], không [(ngModel)].
|
|
89
|
+
## Related components
|
|
90
|
+
|
|
91
|
+
- [`geo-radio`](./geo-radio.md)
|
|
92
|
+
- [`geo-button`](./geo-button.md)
|
|
93
|
+
## Package path
|
|
94
|
+
`node_modules/@geoit/ui/ai/components/geo-checkbox.md`
|
|
95
|
+
|
|
45
96
|
## Source
|
|
46
97
|
`projects/geo-ui/src/lib/figma/geo-checkbox/geo-checkbox.component.ts`
|
|
47
98
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## Rules for AI
|
|
52
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
99
|
+
## Rules for AI / consumers
|
|
100
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
53
101
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
54
|
-
- Match props to
|
|
102
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
103
|
+
- Copy examples and adapt labels/bindings only.
|