@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
package/ai/recipes.md
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
# GEO UI — Recipes
|
|
1
|
+
# GEO UI — Recipes
|
|
2
2
|
|
|
3
3
|
Copy-paste patterns for common screens. Adjust labels/bindings only.
|
|
4
4
|
|
|
5
|
+
Import what you need:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import {
|
|
9
|
+
GeoButtonComponent,
|
|
10
|
+
GeoInputComponent,
|
|
11
|
+
GeoFormModalComponent,
|
|
12
|
+
GeoStepperComponent,
|
|
13
|
+
GeoBreadcrumbComponent,
|
|
14
|
+
GeoPageTitleComponent,
|
|
15
|
+
GeoTableComponent,
|
|
16
|
+
GeoTableToolbarComponent,
|
|
17
|
+
GeoToastService,
|
|
18
|
+
GeoStatusTagComponent,
|
|
19
|
+
GeoTypographyComponent,
|
|
20
|
+
GeoConfirmModalComponent,
|
|
21
|
+
} from '@geoit/ui';
|
|
22
|
+
```
|
|
23
|
+
|
|
5
24
|
## 1. Form modal (single step)
|
|
6
25
|
|
|
7
26
|
```html
|
|
@@ -20,6 +39,12 @@ Copy-paste patterns for common screens. Adjust labels/bindings only.
|
|
|
20
39
|
<div style="display:grid;grid-template-columns:1fr 1fr;gap:16px;">
|
|
21
40
|
<geo-input label="Mã" [required]="true" [block]="true" [(ngModel)]="code"></geo-input>
|
|
22
41
|
<geo-input label="Tên" [required]="true" [block]="true" [(ngModel)]="name"></geo-input>
|
|
42
|
+
<geo-select
|
|
43
|
+
label="Trạng thái"
|
|
44
|
+
[options]="[{ label: 'Active', value: 1 }, { label: 'Inactive', value: 0 }]"
|
|
45
|
+
[(ngModel)]="status"
|
|
46
|
+
[block]="true"
|
|
47
|
+
></geo-select>
|
|
23
48
|
</div>
|
|
24
49
|
</geo-form-modal>
|
|
25
50
|
```
|
|
@@ -60,6 +85,10 @@ steps = [
|
|
|
60
85
|
{ key: 'info', label: '1. Thông tin phiếu mượn' },
|
|
61
86
|
{ key: 'confirm', label: '2. Xác nhận yêu cầu' },
|
|
62
87
|
];
|
|
88
|
+
activeIndex = 0;
|
|
89
|
+
get isLast(): boolean {
|
|
90
|
+
return this.activeIndex >= this.steps.length - 1;
|
|
91
|
+
}
|
|
63
92
|
```
|
|
64
93
|
|
|
65
94
|
## 3. Page header: breadcrumb + title
|
|
@@ -85,12 +114,35 @@ constructor(private toast: GeoToastService) {}
|
|
|
85
114
|
save(): void {
|
|
86
115
|
this.toast.success('Thành công!', 'Đã lưu hồ sơ.');
|
|
87
116
|
}
|
|
117
|
+
|
|
118
|
+
fail(): void {
|
|
119
|
+
this.toast.error('Lỗi!', 'Không thể lưu.');
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 5. Confirm delete
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<geo-button appearance="primary" color="danger" (clicked)="confirmOpen = true">Xóa</geo-button>
|
|
127
|
+
|
|
128
|
+
<geo-confirm-modal
|
|
129
|
+
[visible]="confirmOpen"
|
|
130
|
+
title="Xóa hồ sơ?"
|
|
131
|
+
message="Hành động không thể hoàn tác."
|
|
132
|
+
confirmText="Xóa"
|
|
133
|
+
(confirm)="onDelete()"
|
|
134
|
+
(visibleChange)="confirmOpen = $event"
|
|
135
|
+
></geo-confirm-modal>
|
|
88
136
|
```
|
|
89
137
|
|
|
90
|
-
##
|
|
138
|
+
## 6. Table list (toolbar + table)
|
|
91
139
|
|
|
92
140
|
```html
|
|
93
|
-
<geo-table-toolbar
|
|
141
|
+
<geo-table-toolbar
|
|
142
|
+
[resultCount]="total"
|
|
143
|
+
[showAdd]="true"
|
|
144
|
+
(addClick)="openCreate()"
|
|
145
|
+
></geo-table-toolbar>
|
|
94
146
|
|
|
95
147
|
<geo-table
|
|
96
148
|
[columns]="columns"
|
|
@@ -103,9 +155,29 @@ save(): void {
|
|
|
103
155
|
></geo-table>
|
|
104
156
|
```
|
|
105
157
|
|
|
106
|
-
|
|
158
|
+
```ts
|
|
159
|
+
columns = [
|
|
160
|
+
{ key: 'code', title: 'Mã', width: 120 },
|
|
161
|
+
{ key: 'name', title: 'Tên' },
|
|
162
|
+
{ key: 'status', title: 'Trạng thái' },
|
|
163
|
+
];
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## 7. Typography + status
|
|
107
167
|
|
|
108
168
|
```html
|
|
109
169
|
<geo-typography variant="h4" [strong]="true">1. Thông tin cá nhân</geo-typography>
|
|
110
170
|
<geo-status-tag status="success" label="Đã duyệt"></geo-status-tag>
|
|
111
171
|
```
|
|
172
|
+
|
|
173
|
+
## 8. Tabs with content
|
|
174
|
+
|
|
175
|
+
```html
|
|
176
|
+
<geo-tabs
|
|
177
|
+
[items]="[{ key: 'info', title: 'Thông tin' }, { key: 'files', title: 'Tệp đính kèm' }]"
|
|
178
|
+
[(selectedKey)]="tab"
|
|
179
|
+
>
|
|
180
|
+
<ng-template uiTab="info">…</ng-template>
|
|
181
|
+
<ng-template uiTab="files">…</ng-template>
|
|
182
|
+
</geo-tabs>
|
|
183
|
+
```
|