@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-column-picker
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoColumnPickerComponent** (`@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
|
Column visibility picker for tables (optional persistence).
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoColumnPickerComponent } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoColumnPickerComponent]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-column-picker`
|
|
@@ -24,31 +31,97 @@ Let users show/hide table columns.
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Static tables with fixed columns.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
Popup ẩn/hiện cột bảng. [items] GeoColumnPickerItem[]; (apply) nhận payload cột đã chọn; tùy chọn storageKey để persist.
|
|
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
|
+
| `triggerLabel` | `string` | `'Ẩn hiện cột'` | — |
|
|
49
|
+
| `hint` | `string` | `'Chọn cột hiển thị trên bảng.'` | — |
|
|
50
|
+
| `items` | `GeoColumnPickerItem[]` | `[]` | — |
|
|
51
|
+
| `storageKey` | `string` | — | Lưu trạng thái ẩn/hiện cột theo session khi người dùng áp dụng |
|
|
34
52
|
|
|
35
53
|
## Outputs
|
|
36
|
-
| Output | Notes |
|
|
37
|
-
|--------|-------|
|
|
38
|
-
| `apply` | EventEmitter |
|
|
39
54
|
|
|
40
|
-
|
|
55
|
+
| Output | Payload | Description |
|
|
56
|
+
|--------|---------|-------------|
|
|
57
|
+
| `apply` | `EventEmitter<GeoColumnPickerApplyPayload>` | — |
|
|
58
|
+
|
|
59
|
+
## Related types
|
|
60
|
+
|
|
61
|
+
From `figma/geo-table/geo-column-picker/geo-column-picker.types.ts`:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
export interface GeoColumnPickerItem {
|
|
65
|
+
key: string;
|
|
66
|
+
title: string;
|
|
67
|
+
visible: boolean;
|
|
68
|
+
locked?: boolean;
|
|
69
|
+
/** @deprecated Không còn UI ghim/di chuyển cột. */
|
|
70
|
+
pinnable?: boolean;
|
|
71
|
+
/** @deprecated Không còn UI ghim/di chuyển cột. */
|
|
72
|
+
pinned?: GeoColumnPinSide | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface GeoColumnPickerApplyPayload {
|
|
76
|
+
visibility: Record<string, boolean>;
|
|
77
|
+
/** @deprecated Luôn `{}` từ picker mới — giữ field để tương thích. */
|
|
78
|
+
pinned: Record<string, GeoColumnPinSide | null>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type GeoColumnPinSide = 'left' | 'right';
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Examples
|
|
85
|
+
|
|
86
|
+
### Basic
|
|
87
|
+
|
|
41
88
|
```html
|
|
42
89
|
<geo-column-picker [items]="cols" (apply)="onCols($event)"></geo-column-picker>
|
|
43
90
|
```
|
|
44
91
|
|
|
92
|
+
### Full options
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<geo-column-picker
|
|
96
|
+
triggerLabel="Ẩn hiện cột"
|
|
97
|
+
hint="Chọn cột hiển thị trên bảng."
|
|
98
|
+
[items]="[
|
|
99
|
+
{ key: 'code', label: 'Mã', visible: true },
|
|
100
|
+
{ key: 'name', label: 'Tên', visible: true },
|
|
101
|
+
{ key: 'status', label: 'Trạng thái', visible: false }
|
|
102
|
+
]"
|
|
103
|
+
storageKey="ho-so-columns"
|
|
104
|
+
(apply)="onColumnApply($event)"
|
|
105
|
+
></geo-column-picker>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Tips
|
|
109
|
+
|
|
110
|
+
- Thường gắn qua geo-table-toolbar [columnItems].
|
|
111
|
+
- storageKey ổn định theo màn hình (vd. 'hs-columns').
|
|
112
|
+
- triggerLabel/hint tiếng Việt mặc định đã có.
|
|
113
|
+
## Related components
|
|
114
|
+
|
|
115
|
+
- [`geo-table`](./geo-table.md)
|
|
116
|
+
- [`geo-table-toolbar`](./geo-table-toolbar.md)
|
|
117
|
+
## Package path
|
|
118
|
+
`node_modules/@geoit/ui/ai/components/geo-column-picker.md`
|
|
119
|
+
|
|
45
120
|
## Source
|
|
46
121
|
`projects/geo-ui/src/lib/figma/geo-table/geo-column-picker/geo-column-picker.component.ts`
|
|
47
122
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## Rules for AI
|
|
52
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
123
|
+
## Rules for AI / consumers
|
|
124
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
53
125
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
54
|
-
- Match props to
|
|
126
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
127
|
+
- Copy examples and adapt labels/bindings only.
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# geo-confirm-modal
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoConfirmModalComponent** (`@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
|
Confirm / danger dialog (destroy actions).
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoConfirmModalComponent } from '@geoit/ui';
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
Add to the consuming standalone component:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
imports: [GeoConfirmModalComponent]
|
|
20
|
+
```
|
|
14
21
|
|
|
15
22
|
## Selector
|
|
16
23
|
`geo-confirm-modal`
|
|
@@ -24,29 +31,56 @@ Delete, irreversible actions.
|
|
|
24
31
|
## Do not use when
|
|
25
32
|
Multi-field forms — use geo-form-modal.
|
|
26
33
|
|
|
34
|
+
## How to use
|
|
35
|
+
|
|
36
|
+
Dialog xác nhận hành động phá hủy (xóa). Điều khiển bằng [visible] + (visibleChange); (confirm)/(cancel).
|
|
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
|
-
| `
|
|
43
|
+
|
|
44
|
+
Every supported Input (do not invent others):
|
|
45
|
+
|
|
46
|
+
| Input | Type | Default | Description |
|
|
47
|
+
|-------|------|---------|-------------|
|
|
48
|
+
| `visible` | `boolean` | `false` | — |
|
|
49
|
+
| `title` | `string` | `'Xác nhận xoá'` | — |
|
|
50
|
+
| `message` | `string` | `''` | — |
|
|
51
|
+
| `highlight` | `string` | `''` | — |
|
|
52
|
+
| `description` | `string` | `'Hành động không thể hoàn tác, bạn chắc chắn muốn thực hiện?'` | — |
|
|
53
|
+
| `cancelText` | `string` | `'Hủy'` | — |
|
|
54
|
+
| `confirmText` | `string` | `'Xác nhận'` | — |
|
|
55
|
+
| `confirmLoading` | `boolean` | `false` | — |
|
|
56
|
+
| `width` | `number \| string` | `445` | — |
|
|
57
|
+
| `maskClosable` | `boolean` | `false` | — |
|
|
58
|
+
| `closable` | `boolean` | `true` | — |
|
|
41
59
|
|
|
42
60
|
## Outputs
|
|
43
|
-
| Output | Notes |
|
|
44
|
-
|--------|-------|
|
|
45
|
-
| `visibleChange` | EventEmitter |
|
|
46
|
-
| `confirm` | EventEmitter |
|
|
47
|
-
| `cancel` | EventEmitter |
|
|
48
61
|
|
|
49
|
-
|
|
62
|
+
| Output | Payload | Description |
|
|
63
|
+
|--------|---------|-------------|
|
|
64
|
+
| `visibleChange` | `EventEmitter<boolean>` | — |
|
|
65
|
+
| `confirm` | `EventEmitter<void>` | — |
|
|
66
|
+
| `cancel` | `EventEmitter<void>` | — |
|
|
67
|
+
|
|
68
|
+
## Related types
|
|
69
|
+
|
|
70
|
+
From `figma/geo-confirm-modal/geo-confirm-modal.types.ts`:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
export interface GeoConfirmModalContent {
|
|
74
|
+
message?: string;
|
|
75
|
+
highlight?: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Examples
|
|
81
|
+
|
|
82
|
+
### Basic
|
|
83
|
+
|
|
50
84
|
```html
|
|
51
85
|
<geo-confirm-modal
|
|
52
86
|
[visible]="open"
|
|
@@ -58,13 +92,45 @@ Multi-field forms — use geo-form-modal.
|
|
|
58
92
|
></geo-confirm-modal>
|
|
59
93
|
```
|
|
60
94
|
|
|
95
|
+
### Full options
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<geo-confirm-modal
|
|
99
|
+
[visible]="confirmOpen"
|
|
100
|
+
title="Xác nhận xoá"
|
|
101
|
+
message="Bạn sắp xóa hồ sơ"
|
|
102
|
+
highlight="HS-2024-001"
|
|
103
|
+
description="Hành động không thể hoàn tác, bạn chắc chắn muốn thực hiện?"
|
|
104
|
+
cancelText="Hủy"
|
|
105
|
+
confirmText="Xóa"
|
|
106
|
+
[confirmLoading]="deleting"
|
|
107
|
+
[width]="445"
|
|
108
|
+
[maskClosable]="false"
|
|
109
|
+
[closable]="true"
|
|
110
|
+
(confirm)="onDelete()"
|
|
111
|
+
(cancel)="confirmOpen = false"
|
|
112
|
+
(visibleChange)="confirmOpen = $event"
|
|
113
|
+
></geo-confirm-modal>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Tips
|
|
117
|
+
|
|
118
|
+
- Form nhiều field → geo-form-modal.
|
|
119
|
+
- highlight để nhấn mạnh tên đối tượng bị xóa.
|
|
120
|
+
- confirmLoading khi đang gọi API.
|
|
121
|
+
## Related components
|
|
122
|
+
|
|
123
|
+
- [`geo-form-modal`](./geo-form-modal.md)
|
|
124
|
+
- [`geo-button`](./geo-button.md)
|
|
125
|
+
- [`geo-toast`](./geo-toast.md)
|
|
126
|
+
## Package path
|
|
127
|
+
`node_modules/@geoit/ui/ai/components/geo-confirm-modal.md`
|
|
128
|
+
|
|
61
129
|
## Source
|
|
62
130
|
`projects/geo-ui/src/lib/figma/geo-confirm-modal/geo-confirm-modal.component.ts`
|
|
63
131
|
|
|
64
|
-
##
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## Rules for AI
|
|
68
|
-
- 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.
|
|
69
134
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
70
|
-
- 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-date-picker
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoDatePickerComponent** (`@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
|
Single date (optional time) picker.
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoDatePickerComponent } 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: [GeoDatePickerComponent, FormsModule]
|
|
21
|
+
```
|
|
14
22
|
|
|
15
23
|
## Selector
|
|
16
24
|
`geo-date-picker`
|
|
@@ -24,42 +32,108 @@ One date field in forms.
|
|
|
24
32
|
## Do not use when
|
|
25
33
|
Date range — use geo-date-range-picker.
|
|
26
34
|
|
|
35
|
+
## How to use
|
|
36
|
+
|
|
37
|
+
Chọn một ngày (CVA). [(ngModel)] hoặc formControlName; format mặc định dd/MM/yyyy; bật showTime khi cần giờ.
|
|
38
|
+
|
|
39
|
+
## Binding
|
|
40
|
+
|
|
41
|
+
Supports **ControlValueAccessor**.
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<geo-date-picker [(ngModel)]="value"></geo-date-picker>
|
|
45
|
+
<!-- or -->
|
|
46
|
+
<geo-date-picker formControlName="field"></geo-date-picker>
|
|
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
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
52
|
+
|
|
53
|
+
Every supported Input (do not invent others):
|
|
54
|
+
|
|
55
|
+
| Input | Type | Default | Description |
|
|
56
|
+
|-------|------|---------|-------------|
|
|
57
|
+
| `label` | `string` | `''` | — |
|
|
58
|
+
| `placeholder` | `string` | `'Chọn ngày'` | — |
|
|
59
|
+
| `format` | `string` | `'dd/MM/yyyy'` | — |
|
|
60
|
+
| `mode` | `'date' \| 'week' \| 'month' \| 'year'` | `'date'` | — |
|
|
61
|
+
| `size` | `'default' \| 'small'` | `'default'` | — |
|
|
62
|
+
| `disabled` | `boolean` | `false` | — |
|
|
63
|
+
| `required` | `boolean` | `false` | — |
|
|
64
|
+
| `error` | `boolean` | `false` | — |
|
|
65
|
+
| `errorMessage` | `string` | `''` | — |
|
|
66
|
+
| `allowClear` | `boolean` | `true` | — |
|
|
67
|
+
| `showToday` | `boolean` | `true` | — |
|
|
68
|
+
| `showTime` | `boolean` | `false` | — |
|
|
69
|
+
| `block` | `boolean` | `false` | — |
|
|
70
|
+
| `width` | `number \| string` | — | — |
|
|
71
|
+
| `disabledDate` | `(current: Date)` | `> boolean` | — |
|
|
45
72
|
|
|
46
73
|
## Outputs
|
|
47
|
-
| Output | Notes |
|
|
48
|
-
|--------|-------|
|
|
49
|
-
| `valueChange` | EventEmitter |
|
|
50
74
|
|
|
51
|
-
|
|
75
|
+
| Output | Payload | Description |
|
|
76
|
+
|--------|---------|-------------|
|
|
77
|
+
| `valueChange` | `EventEmitter<Date \| null>` | — |
|
|
78
|
+
|
|
79
|
+
## Related types
|
|
80
|
+
|
|
81
|
+
From `figma/geo-date-picker/geo-date-picker.types.ts`:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
export type GeoDatePickerMode = 'date' | 'week' | 'month' | 'year';
|
|
85
|
+
|
|
86
|
+
export type GeoDatePickerSize = 'default' | 'small';
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Examples
|
|
90
|
+
|
|
91
|
+
### Basic
|
|
92
|
+
|
|
52
93
|
```html
|
|
53
94
|
<geo-date-picker label="Ngày tạo" [required]="true" [(ngModel)]="date" [block]="true"></geo-date-picker>
|
|
54
95
|
```
|
|
55
96
|
|
|
97
|
+
### Full options
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<geo-date-picker
|
|
101
|
+
label="Ngày hiệu lực"
|
|
102
|
+
placeholder="Chọn ngày"
|
|
103
|
+
format="dd/MM/yyyy"
|
|
104
|
+
mode="date"
|
|
105
|
+
size="default"
|
|
106
|
+
[required]="true"
|
|
107
|
+
[allowClear]="true"
|
|
108
|
+
[showToday]="true"
|
|
109
|
+
[showTime]="false"
|
|
110
|
+
[block]="true"
|
|
111
|
+
[error]="hasError"
|
|
112
|
+
errorMessage="Vui lòng chọn ngày"
|
|
113
|
+
[disabledDate]="disablePast"
|
|
114
|
+
[(ngModel)]="effectiveDate"
|
|
115
|
+
(valueChange)="onDate($event)"
|
|
116
|
+
></geo-date-picker>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Tips
|
|
120
|
+
|
|
121
|
+
- Khoảng ngày → geo-date-range-picker.
|
|
122
|
+
- [block]="true" trong form modal/grid.
|
|
123
|
+
- disabledDate để chặn ngày không hợp lệ.
|
|
124
|
+
## Related components
|
|
125
|
+
|
|
126
|
+
- [`geo-date-range-picker`](./geo-date-range-picker.md)
|
|
127
|
+
- [`geo-input`](./geo-input.md)
|
|
128
|
+
- [`geo-form-modal`](./geo-form-modal.md)
|
|
129
|
+
## Package path
|
|
130
|
+
`node_modules/@geoit/ui/ai/components/geo-date-picker.md`
|
|
131
|
+
|
|
56
132
|
## Source
|
|
57
133
|
`projects/geo-ui/src/lib/figma/geo-date-picker/geo-date-picker.component.ts`
|
|
58
134
|
|
|
59
|
-
##
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## Rules for AI
|
|
63
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
135
|
+
## Rules for AI / consumers
|
|
136
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
64
137
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
65
|
-
- Match props to
|
|
138
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
139
|
+
- Copy examples and adapt labels/bindings only.
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
# geo-date-range-picker
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Complete usage reference for **GeoDateRangePickerComponent** (`@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
|
Start–end date range picker.
|
|
7
9
|
|
|
8
10
|
## Import
|
|
11
|
+
|
|
9
12
|
```ts
|
|
10
13
|
import { GeoDateRangePickerComponent } 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: [GeoDateRangePickerComponent, FormsModule]
|
|
21
|
+
```
|
|
14
22
|
|
|
15
23
|
## Selector
|
|
16
24
|
`geo-date-range-picker`
|
|
@@ -24,41 +32,104 @@ Filters and period selection.
|
|
|
24
32
|
## Do not use when
|
|
25
33
|
Single date — use geo-date-picker.
|
|
26
34
|
|
|
35
|
+
## How to use
|
|
36
|
+
|
|
37
|
+
Chọn khoảng từ–đến (CVA). [(ngModel)] nhận [Date, Date] | null; placeholder mặc định ['Từ ngày','Đến ngày'].
|
|
38
|
+
|
|
39
|
+
## Binding
|
|
40
|
+
|
|
41
|
+
Supports **ControlValueAccessor**.
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<geo-date-range-picker [(ngModel)]="value"></geo-date-range-picker>
|
|
45
|
+
<!-- or -->
|
|
46
|
+
<geo-date-range-picker formControlName="field"></geo-date-range-picker>
|
|
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
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
52
|
+
|
|
53
|
+
Every supported Input (do not invent others):
|
|
54
|
+
|
|
55
|
+
| Input | Type | Default | Description |
|
|
56
|
+
|-------|------|---------|-------------|
|
|
57
|
+
| `label` | `string` | `''` | — |
|
|
58
|
+
| `placeholder` | `[string, string]` | `['Từ ngày', 'Đến ngày']` | — |
|
|
59
|
+
| `format` | `string` | `'dd/MM/yyyy'` | — |
|
|
60
|
+
| `size` | `'default' \| 'small'` | `'default'` | — |
|
|
61
|
+
| `disabled` | `boolean` | `false` | — |
|
|
62
|
+
| `required` | `boolean` | `false` | — |
|
|
63
|
+
| `error` | `boolean` | `false` | — |
|
|
64
|
+
| `errorMessage` | `string` | `''` | — |
|
|
65
|
+
| `allowClear` | `boolean` | `true` | — |
|
|
66
|
+
| `showTime` | `boolean` | `false` | — |
|
|
67
|
+
| `block` | `boolean` | `false` | — |
|
|
68
|
+
| `width` | `number \| string` | — | — |
|
|
69
|
+
| `disabledDate` | `(current: Date)` | `> boolean` | — |
|
|
70
|
+
| `separator` | `string` | `'→'` | — |
|
|
44
71
|
|
|
45
72
|
## Outputs
|
|
46
|
-
| Output | Notes |
|
|
47
|
-
|--------|-------|
|
|
48
|
-
| `valueChange` | EventEmitter |
|
|
49
73
|
|
|
50
|
-
|
|
74
|
+
| Output | Payload | Description |
|
|
75
|
+
|--------|---------|-------------|
|
|
76
|
+
| `valueChange` | `EventEmitter<[Date, Date] \| null>` | — |
|
|
77
|
+
|
|
78
|
+
## Related types
|
|
79
|
+
|
|
80
|
+
From `figma/geo-date-range-picker/geo-date-range-picker.types.ts`:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
export type GeoDateRangeValue = [Date, Date] | null;
|
|
84
|
+
|
|
85
|
+
export type GeoDateRangeSize = 'default' | 'small';
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Examples
|
|
89
|
+
|
|
90
|
+
### Basic
|
|
91
|
+
|
|
51
92
|
```html
|
|
52
93
|
<geo-date-range-picker label="Khoảng thời gian" [(ngModel)]="range" [block]="true"></geo-date-range-picker>
|
|
53
94
|
```
|
|
54
95
|
|
|
96
|
+
### Full options
|
|
97
|
+
|
|
98
|
+
```html
|
|
99
|
+
<geo-date-range-picker
|
|
100
|
+
label="Thời gian lọc"
|
|
101
|
+
[placeholder]="['Từ ngày', 'Đến ngày']"
|
|
102
|
+
format="dd/MM/yyyy"
|
|
103
|
+
size="default"
|
|
104
|
+
separator="→"
|
|
105
|
+
[allowClear]="true"
|
|
106
|
+
[showTime]="false"
|
|
107
|
+
[block]="true"
|
|
108
|
+
[required]="true"
|
|
109
|
+
[error]="rangeError"
|
|
110
|
+
errorMessage="Vui lòng chọn khoảng thời gian"
|
|
111
|
+
[(ngModel)]="dateRange"
|
|
112
|
+
(valueChange)="onRange($event)"
|
|
113
|
+
></geo-date-range-picker>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Tips
|
|
117
|
+
|
|
118
|
+
- Một ngày đơn → geo-date-picker.
|
|
119
|
+
- Dùng trong bộ lọc bảng / báo cáo.
|
|
120
|
+
- separator mặc định '→'.
|
|
121
|
+
## Related components
|
|
122
|
+
|
|
123
|
+
- [`geo-date-picker`](./geo-date-picker.md)
|
|
124
|
+
- [`geo-table-filter`](./geo-table-filter.md)
|
|
125
|
+
## Package path
|
|
126
|
+
`node_modules/@geoit/ui/ai/components/geo-date-range-picker.md`
|
|
127
|
+
|
|
55
128
|
## Source
|
|
56
129
|
`projects/geo-ui/src/lib/figma/geo-date-range-picker/geo-date-range-picker.component.ts`
|
|
57
130
|
|
|
58
|
-
##
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Rules for AI
|
|
62
|
-
- Prefer this component over raw ng-zorro / HTML equivalents for the same UI role.
|
|
131
|
+
## Rules for AI / consumers
|
|
132
|
+
- Prefer this component over raw ng-zorro / HTML for the same UI role.
|
|
63
133
|
- Use design tokens (`var(--geo-*)`) — never hardcode brand colors or radius.
|
|
64
|
-
- Match props to
|
|
134
|
+
- Match props exactly to the Inputs table; do not invent unsupported inputs.
|
|
135
|
+
- Copy examples and adapt labels/bindings only.
|