@libs-ui/components-component-outlet 0.2.356-9 → 0.2.357-0
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
CHANGED
|
@@ -1,82 +1,38 @@
|
|
|
1
1
|
# @libs-ui/components-component-outlet
|
|
2
2
|
|
|
3
|
-
> ⚠️ **DEPRECATED**
|
|
3
|
+
> ⚠️ **DEPRECATED** — Base component cũ để chuẩn hóa input cho dynamic component trong Table/List. Không sử dụng trong code mới.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
**Component này đã bị deprecated và không nên sử dụng trong code mới.**
|
|
8
|
-
|
|
9
|
-
### Lý do Deprecation
|
|
10
|
-
|
|
11
|
-
Hàm `getDataComponentOutlet` trong List/Table config đã hỗ trợ trả về input theo component truyền vào, **không cần extend base component này nữa**.
|
|
12
|
-
|
|
13
|
-
### Migration Guide
|
|
14
|
-
|
|
15
|
-
**❌ Cách cũ (Deprecated):**
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
// KHÔNG nên làm như này nữa
|
|
19
|
-
export class CustomComponent extends LibsUiComponentsComponentOutletComponent {
|
|
20
|
-
// Extend base component
|
|
21
|
-
}
|
|
22
|
-
```
|
|
5
|
+
---
|
|
23
6
|
|
|
24
|
-
|
|
7
|
+
## ⚠️ Deprecation Notice
|
|
25
8
|
|
|
26
|
-
|
|
27
|
-
// Tạo standalone component với input tùy chỉnh
|
|
28
|
-
@Component({
|
|
29
|
-
selector: 'app-custom-component',
|
|
30
|
-
standalone: true,
|
|
31
|
-
template: `
|
|
32
|
-
<div>{{ data().name }}</div>
|
|
33
|
-
`,
|
|
34
|
-
})
|
|
35
|
-
export class CustomComponent {
|
|
36
|
-
// Input tùy chỉnh theo nhu cầu
|
|
37
|
-
readonly data = input.required<MyCustomType>();
|
|
38
|
-
}
|
|
9
|
+
**`LibsUiComponentsComponentOutletComponent` đã bị deprecated và không nên sử dụng trong code mới.**
|
|
39
10
|
|
|
40
|
-
|
|
41
|
-
configTemplateText: signal({
|
|
42
|
-
getComponentOutlet: () => of(CustomComponent),
|
|
43
|
-
getDataComponentOutlet: (item: any) => ({ data: item }), // Map to component inputs
|
|
44
|
-
});
|
|
45
|
-
```
|
|
11
|
+
Hàm `getDataComponentOutlet` trong cấu hình Table/List hiện đã hỗ trợ truyền input tùy chỉnh trực tiếp vào component mà không cần extend base component. Pattern mới linh hoạt hơn, type-safe hơn và không phụ thuộc vào base class này.
|
|
46
12
|
|
|
47
13
|
---
|
|
48
14
|
|
|
49
|
-
## Giới thiệu
|
|
15
|
+
## Giới thiệu
|
|
50
16
|
|
|
51
|
-
`LibsUiComponentsComponentOutletComponent` là một standalone
|
|
17
|
+
`LibsUiComponentsComponentOutletComponent` là một Angular standalone base component với input duy nhất `[item]: TYPE_OBJECT`. Trước đây, các custom component dùng trong Table/List cần extend class này để nhận dữ liệu từ `getDataComponentOutlet`. Kể từ khi `getDataComponentOutlet` hỗ trợ truyền input tùy chỉnh theo từng component, base class này không còn cần thiết nữa.
|
|
52
18
|
|
|
53
|
-
|
|
19
|
+
Package cũng export type `TYPE_COMPONENT_OUTLET_DATA = WritableSignal<TYPE_OBJECT>` dùng cho reactive data binding.
|
|
54
20
|
|
|
55
|
-
|
|
56
|
-
- ✅ Required input `[item]` với type `TYPE_OBJECT`
|
|
57
|
-
- ✅ Empty template - components con override template
|
|
58
|
-
- ✅ Sử dụng với Angular Component Outlet
|
|
59
|
-
- ✅ Type safety với TYPE_OBJECT từ @libs-ui/interfaces-types
|
|
60
|
-
- ✅ Standalone Component
|
|
61
|
-
- ✅ Minimal overhead
|
|
21
|
+
## Tính năng
|
|
62
22
|
|
|
63
|
-
|
|
23
|
+
- ✅ Base component với input chuẩn hóa `[item]` kiểu `TYPE_OBJECT`
|
|
24
|
+
- ✅ Template rỗng — component con tự định nghĩa template
|
|
25
|
+
- ✅ Standalone component, không cần NgModule
|
|
26
|
+
- ✅ Export `TYPE_COMPONENT_OUTLET_DATA` type alias
|
|
64
27
|
|
|
65
|
-
|
|
66
|
-
- Khi tạo custom item component cho List component với component outlet
|
|
67
|
-
- Khi cần chuẩn hóa input interface cho dynamic components
|
|
68
|
-
- Khi muốn đảm bảo tất cả custom components nhận cùng một data structure
|
|
69
|
-
- Khi extend base component để tạo custom render components
|
|
70
|
-
|
|
71
|
-
## Important Notes
|
|
72
|
-
|
|
73
|
-
⚠️ **Base Component**: Đây là base component, KHÔNG sử dụng trực tiếp. Extend component này để tạo custom components.
|
|
28
|
+
## Khi nào sử dụng
|
|
74
29
|
|
|
75
|
-
|
|
30
|
+
> 🚫 **Không sử dụng trong code mới.** Xem phần [Migration Guide](#migration-guide) bên dưới.
|
|
76
31
|
|
|
77
|
-
|
|
32
|
+
Lib này chỉ còn giá trị khi:
|
|
78
33
|
|
|
79
|
-
|
|
34
|
+
- Duy trì code cũ đang extend `LibsUiComponentsComponentOutletComponent` và chưa có kế hoạch migrate.
|
|
35
|
+
- Cần tham chiếu type `TYPE_COMPONENT_OUTLET_DATA` từ package này.
|
|
80
36
|
|
|
81
37
|
## Cài đặt
|
|
82
38
|
|
|
@@ -84,181 +40,284 @@ configTemplateText: signal({
|
|
|
84
40
|
npm install @libs-ui/components-component-outlet
|
|
85
41
|
```
|
|
86
42
|
|
|
87
|
-
##
|
|
43
|
+
## Import
|
|
88
44
|
|
|
89
|
-
|
|
45
|
+
```typescript
|
|
46
|
+
import { LibsUiComponentsComponentOutletComponent } from '@libs-ui/components-component-outlet';
|
|
47
|
+
import { TYPE_COMPONENT_OUTLET_DATA } from '@libs-ui/components-component-outlet';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Migration Guide
|
|
53
|
+
|
|
54
|
+
### Cách cũ — Extend base component (❌ Deprecated)
|
|
90
55
|
|
|
91
56
|
```typescript
|
|
92
57
|
import { Component } from '@angular/core';
|
|
93
58
|
import { LibsUiComponentsComponentOutletComponent } from '@libs-ui/components-component-outlet';
|
|
94
59
|
|
|
95
|
-
//
|
|
60
|
+
// ❌ KHÔNG làm như này trong code mới
|
|
96
61
|
@Component({
|
|
97
|
-
selector: 'app-
|
|
62
|
+
selector: 'app-product-cell',
|
|
98
63
|
standalone: true,
|
|
99
64
|
template: `
|
|
100
|
-
<div
|
|
101
|
-
<
|
|
102
|
-
<span
|
|
103
|
-
@if (item().status === 'active') {
|
|
104
|
-
<span class="px-2 py-1 bg-green-100 text-green-800 rounded text-xs">Active</span>
|
|
105
|
-
}
|
|
65
|
+
<div>
|
|
66
|
+
<strong>{{ item().name }}</strong>
|
|
67
|
+
<span>{{ item().price }}</span>
|
|
106
68
|
</div>
|
|
107
69
|
`,
|
|
108
70
|
})
|
|
109
|
-
export class
|
|
110
|
-
//
|
|
111
|
-
// Không cần khai báo lại input
|
|
71
|
+
export class ProductCellComponent extends LibsUiComponentsComponentOutletComponent {
|
|
72
|
+
// Kế thừa input 'item: TYPE_OBJECT' từ base component
|
|
112
73
|
}
|
|
113
74
|
```
|
|
114
75
|
|
|
115
|
-
|
|
76
|
+
```typescript
|
|
77
|
+
// ❌ getDataComponentOutlet trả về item nguyên xi (không type-safe)
|
|
78
|
+
configTemplateText: signal({
|
|
79
|
+
fieldKey: 'id',
|
|
80
|
+
getComponentOutlet: () => of(ProductCellComponent),
|
|
81
|
+
getDataComponentOutlet: (item: any) => item,
|
|
82
|
+
})
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Cách mới — Standalone component + getDataComponentOutlet (✅ Recommended)
|
|
116
86
|
|
|
117
87
|
```typescript
|
|
118
|
-
import { Component,
|
|
119
|
-
import { LibsUiComponentsListComponent } from '@libs-ui/components-list';
|
|
88
|
+
import { Component, input } from '@angular/core';
|
|
120
89
|
import { of } from 'rxjs';
|
|
121
90
|
|
|
91
|
+
// ✅ Standalone component với input tùy chỉnh, KHÔNG extend base
|
|
122
92
|
@Component({
|
|
123
|
-
selector: 'app-
|
|
93
|
+
selector: 'app-product-cell',
|
|
124
94
|
standalone: true,
|
|
125
|
-
|
|
95
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
126
96
|
template: `
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
(
|
|
97
|
+
<div>
|
|
98
|
+
<strong>{{ product().name }}</strong>
|
|
99
|
+
<span>{{ product().price }}</span>
|
|
100
|
+
</div>
|
|
130
101
|
`,
|
|
131
102
|
})
|
|
132
|
-
export class
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
httpRequestData: signal({
|
|
136
|
-
objectInstance: returnListObject(myData),
|
|
137
|
-
argumentsValue: [],
|
|
138
|
-
functionName: 'list',
|
|
139
|
-
}),
|
|
140
|
-
configTemplateText: signal({
|
|
141
|
-
fieldKey: 'id',
|
|
142
|
-
|
|
143
|
-
// Trả về custom component class
|
|
144
|
-
getComponentOutlet: () => of(CustomListItemComponent),
|
|
145
|
-
|
|
146
|
-
// Trả về data cho component
|
|
147
|
-
getDataComponentOutlet: (item: any) => item,
|
|
148
|
-
}),
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
onItemSelected(event: any) {
|
|
152
|
-
console.log('Selected:', event);
|
|
153
|
-
}
|
|
103
|
+
export class ProductCellComponent {
|
|
104
|
+
// Input tùy chỉnh — tên và type hoàn toàn tự do
|
|
105
|
+
readonly product = input.required<{ name: string; price: number }>();
|
|
154
106
|
}
|
|
155
107
|
```
|
|
156
108
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
109
|
+
```typescript
|
|
110
|
+
// ✅ getDataComponentOutlet map đúng input name và type
|
|
111
|
+
configTemplateText: signal({
|
|
112
|
+
fieldKey: 'id',
|
|
113
|
+
getComponentOutlet: () => of(ProductCellComponent),
|
|
114
|
+
getDataComponentOutlet: (item: any) => ({
|
|
115
|
+
product: {
|
|
116
|
+
name: item.productName,
|
|
117
|
+
price: item.salePrice,
|
|
118
|
+
},
|
|
119
|
+
}),
|
|
120
|
+
})
|
|
121
|
+
```
|
|
160
122
|
|
|
161
|
-
|
|
162
|
-
| -------- | ------------- | ---------- | ---------------------------------------------------- |
|
|
163
|
-
| `[item]` | `TYPE_OBJECT` | `required` | Data object được pass vào component (required input) |
|
|
123
|
+
**Lợi ích của cách mới:**
|
|
164
124
|
|
|
165
|
-
|
|
125
|
+
- Input name tùy chỉnh (`product` thay vì `item`) — đặt tên rõ nghĩa theo domain
|
|
126
|
+
- Type-safe với interface cụ thể thay vì `TYPE_OBJECT`
|
|
127
|
+
- Không phụ thuộc vào base class
|
|
128
|
+
- Dễ test hơn (standalone component thuần)
|
|
166
129
|
|
|
167
|
-
|
|
130
|
+
---
|
|
168
131
|
|
|
169
|
-
##
|
|
132
|
+
## Ví dụ sử dụng
|
|
170
133
|
|
|
171
|
-
###
|
|
134
|
+
### Ví dụ 1 — Custom status component trong List (Cách mới)
|
|
172
135
|
|
|
173
136
|
```typescript
|
|
174
|
-
import {
|
|
175
|
-
import {
|
|
137
|
+
import { Component, input, ChangeDetectionStrategy } from '@angular/core';
|
|
138
|
+
import { of } from 'rxjs';
|
|
176
139
|
|
|
177
|
-
|
|
178
|
-
|
|
140
|
+
// Bước 1: Tạo standalone component tùy chỉnh
|
|
141
|
+
@Component({
|
|
142
|
+
selector: 'app-status-cell',
|
|
143
|
+
standalone: true,
|
|
144
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
145
|
+
template: `
|
|
146
|
+
<span [class]="statusClass()">{{ label().text }}</span>
|
|
147
|
+
`,
|
|
148
|
+
})
|
|
149
|
+
export class StatusCellComponent {
|
|
150
|
+
readonly label = input.required<{ text: string; color: string }>();
|
|
179
151
|
|
|
180
|
-
|
|
152
|
+
protected statusClass = computed(() => {
|
|
153
|
+
const color = this.label().color;
|
|
154
|
+
return color === 'green' ? 'text-green-600 font-medium' : 'text-gray-400';
|
|
155
|
+
});
|
|
156
|
+
}
|
|
181
157
|
|
|
182
|
-
|
|
158
|
+
// Bước 2: Dùng trong List config
|
|
159
|
+
@Component({
|
|
160
|
+
selector: 'app-order-list',
|
|
161
|
+
standalone: true,
|
|
162
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
163
|
+
imports: [LibsUiComponentsListComponent],
|
|
164
|
+
template: `
|
|
165
|
+
<libs_ui-components-list [config]="listConfig()" />
|
|
166
|
+
`,
|
|
167
|
+
})
|
|
168
|
+
export class OrderListComponent {
|
|
169
|
+
protected listConfig = signal({
|
|
170
|
+
type: 'text',
|
|
171
|
+
configTemplateText: signal({
|
|
172
|
+
fieldKey: 'orderId',
|
|
173
|
+
getComponentOutlet: () => of(StatusCellComponent),
|
|
174
|
+
getDataComponentOutlet: (item: any) => ({
|
|
175
|
+
label: {
|
|
176
|
+
text: item.statusText,
|
|
177
|
+
color: item.statusColor,
|
|
178
|
+
},
|
|
179
|
+
}),
|
|
180
|
+
}),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
```
|
|
183
184
|
|
|
184
|
-
###
|
|
185
|
+
### Ví dụ 2 — Custom action component trong Table (Cách mới)
|
|
185
186
|
|
|
186
187
|
```typescript
|
|
187
|
-
import { Component } from '@angular/core';
|
|
188
|
-
import {
|
|
188
|
+
import { Component, input, output, ChangeDetectionStrategy } from '@angular/core';
|
|
189
|
+
import { of } from 'rxjs';
|
|
189
190
|
|
|
190
|
-
//
|
|
191
|
+
// Bước 1: Tạo component với output event
|
|
191
192
|
@Component({
|
|
192
|
-
selector: 'app-
|
|
193
|
+
selector: 'app-action-cell',
|
|
193
194
|
standalone: true,
|
|
195
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
194
196
|
template: `
|
|
195
|
-
<
|
|
196
|
-
{{
|
|
197
|
-
</
|
|
197
|
+
<button class="text-blue-500 hover:underline" (click)="handlerView($event)">
|
|
198
|
+
Xem {{ row().name }}
|
|
199
|
+
</button>
|
|
198
200
|
`,
|
|
199
201
|
})
|
|
200
|
-
export class
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
export class ActionCellComponent {
|
|
203
|
+
readonly row = input.required<{ id: string; name: string }>();
|
|
204
|
+
readonly outView = output<{ id: string; name: string }>();
|
|
205
|
+
|
|
206
|
+
protected handlerView(event: Event): void {
|
|
207
|
+
event.stopPropagation();
|
|
208
|
+
this.outView.emit(this.row());
|
|
203
209
|
}
|
|
204
210
|
}
|
|
205
211
|
|
|
206
|
-
//
|
|
212
|
+
// Bước 2: Dùng trong Table config
|
|
207
213
|
@Component({
|
|
208
|
-
selector: 'app-
|
|
214
|
+
selector: 'app-user-table',
|
|
209
215
|
standalone: true,
|
|
216
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
217
|
+
imports: [LibsUiComponentsTableComponent],
|
|
210
218
|
template: `
|
|
211
|
-
<
|
|
219
|
+
<libs_ui-components-table [config]="tableConfig()" />
|
|
212
220
|
`,
|
|
213
221
|
})
|
|
214
|
-
export class
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
export class UserTableComponent {
|
|
223
|
+
protected tableConfig = signal({
|
|
224
|
+
columns: signal([
|
|
225
|
+
{
|
|
226
|
+
key: 'action',
|
|
227
|
+
title: 'Thao tác',
|
|
228
|
+
getComponentOutlet: () => of(ActionCellComponent),
|
|
229
|
+
getDataComponentOutlet: (item: any) => ({
|
|
230
|
+
row: { id: item.userId, name: item.fullName },
|
|
231
|
+
}),
|
|
232
|
+
},
|
|
233
|
+
]),
|
|
234
|
+
});
|
|
218
235
|
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Ví dụ 3 — Duy trì code cũ đang extend base (Legacy)
|
|
239
|
+
|
|
240
|
+
> Chỉ dùng khi chưa kịp migrate. Đặt task refactor sang cách mới.
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
import { Component } from '@angular/core';
|
|
244
|
+
import { LibsUiComponentsComponentOutletComponent } from '@libs-ui/components-component-outlet';
|
|
245
|
+
import { of } from 'rxjs';
|
|
219
246
|
|
|
220
|
-
//
|
|
247
|
+
// Code cũ — vẫn hoạt động nhưng không nên dùng trong code mới
|
|
221
248
|
@Component({
|
|
222
|
-
selector: 'app-
|
|
249
|
+
selector: 'app-legacy-cell',
|
|
223
250
|
standalone: true,
|
|
224
251
|
template: `
|
|
225
|
-
<
|
|
226
|
-
{{ item().
|
|
227
|
-
|
|
252
|
+
<div class="flex items-center gap-2">
|
|
253
|
+
<strong>{{ item().name }}</strong>
|
|
254
|
+
<span class="text-xs text-gray-500">{{ item().id }}</span>
|
|
255
|
+
</div>
|
|
228
256
|
`,
|
|
229
257
|
})
|
|
230
|
-
export class
|
|
231
|
-
//
|
|
258
|
+
export class LegacyCellComponent extends LibsUiComponentsComponentOutletComponent {
|
|
259
|
+
// Kế thừa: readonly item = input.required<TYPE_OBJECT>()
|
|
232
260
|
}
|
|
261
|
+
|
|
262
|
+
// Sử dụng trong List
|
|
263
|
+
listConfig = signal({
|
|
264
|
+
configTemplateText: signal({
|
|
265
|
+
fieldKey: 'id',
|
|
266
|
+
getComponentOutlet: () => of(LegacyCellComponent),
|
|
267
|
+
getDataComponentOutlet: (item: any) => item,
|
|
268
|
+
}),
|
|
269
|
+
});
|
|
233
270
|
```
|
|
234
271
|
|
|
235
|
-
|
|
272
|
+
---
|
|
236
273
|
|
|
237
|
-
|
|
274
|
+
## @Input()
|
|
238
275
|
|
|
239
|
-
|
|
276
|
+
| Input | Type | Default | Mô tả | Ví dụ |
|
|
277
|
+
|---|---|---|---|---|
|
|
278
|
+
| `[item]` | `TYPE_OBJECT` | `required` | Data object truyền vào component. Là required signal input kế thừa từ base. | `[item]="rowData()"` |
|
|
240
279
|
|
|
241
|
-
|
|
280
|
+
## @Output()
|
|
242
281
|
|
|
243
|
-
|
|
282
|
+
Component này không có output. Nếu cần emit event từ dynamic component, khai báo `output()` trực tiếp trong component tùy chỉnh (không phụ thuộc vào base class).
|
|
244
283
|
|
|
245
|
-
|
|
284
|
+
---
|
|
246
285
|
|
|
247
|
-
|
|
286
|
+
## Types & Interfaces
|
|
248
287
|
|
|
249
|
-
|
|
288
|
+
```typescript
|
|
289
|
+
import { TYPE_COMPONENT_OUTLET_DATA } from '@libs-ui/components-component-outlet';
|
|
290
|
+
import { WritableSignal } from '@angular/core';
|
|
291
|
+
import { TYPE_OBJECT } from '@libs-ui/interfaces-types';
|
|
250
292
|
|
|
251
|
-
|
|
293
|
+
// TYPE_COMPONENT_OUTLET_DATA là alias cho WritableSignal<TYPE_OBJECT>
|
|
294
|
+
// Dùng khi cần typed signal chứa generic object
|
|
295
|
+
const data: TYPE_COMPONENT_OUTLET_DATA = signal({ id: 1, name: 'Item A' });
|
|
296
|
+
```
|
|
252
297
|
|
|
253
|
-
|
|
298
|
+
| Type | Definition | Mô tả |
|
|
299
|
+
|---|---|---|
|
|
300
|
+
| `TYPE_COMPONENT_OUTLET_DATA` | `WritableSignal<TYPE_OBJECT>` | Signal có thể ghi chứa generic object, dùng cho reactive data binding |
|
|
301
|
+
| `TYPE_OBJECT` | _(từ `@libs-ui/interfaces-types`)_ | Generic object type, cho phép truyền bất kỳ cấu trúc object nào |
|
|
254
302
|
|
|
255
|
-
|
|
256
|
-
- `@libs-ui/interfaces-types`
|
|
303
|
+
---
|
|
257
304
|
|
|
258
|
-
##
|
|
305
|
+
## Lưu ý quan trọng
|
|
306
|
+
|
|
307
|
+
⚠️ **DEPRECATED**: Component này đã bị deprecated và sẽ bị xóa trong phiên bản tương lai. Không sử dụng trong code mới.
|
|
308
|
+
|
|
309
|
+
⚠️ **Template rỗng**: Base component có `template: ''` — không render bất kỳ UI nào. Chỉ có tác dụng khi được extend bởi component con tự định nghĩa template.
|
|
259
310
|
|
|
260
|
-
|
|
311
|
+
⚠️ **Input bắt buộc**: `[item]` là `input.required<TYPE_OBJECT>()` — phải truyền giá trị khi dùng, nếu không sẽ báo lỗi runtime.
|
|
261
312
|
|
|
262
|
-
|
|
313
|
+
⚠️ **Chỉ extend, không dùng trực tiếp**: Nếu render `<libs_ui-components-component_outlet [item]="data()">` trực tiếp, component sẽ không hiển thị gì cả do template rỗng.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Demo
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
npx nx serve core-ui
|
|
321
|
+
```
|
|
263
322
|
|
|
264
|
-
|
|
323
|
+
Truy cập: [http://localhost:4500/components/component-outlet](http://localhost:4500/components/component-outlet)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libs-ui-components-component-outlet.mjs","sources":["../../../../../libs-ui/components/component-outlet/src/component-outlet.component.ts","../../../../../libs-ui/components/component-outlet/src/libs-ui-components-component-outlet.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\nimport { TYPE_OBJECT } from '@libs-ui/interfaces-types';\n\n/**\n * @deprecated Component này đã cũ và không còn được sử dụng.\n *\n * Lý do: Hàm `getDataComponentOutlet` trong List/Table config đã hỗ trợ trả về input theo component truyền vào,\n * không cần extend base component này nữa.\n *\n * Thay vào đó, tạo standalone component với input tùy chỉnh và sử dụng `getDataComponentOutlet` để map data.\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-components-component_outlet',\n template: ``,\n standalone: true,\n})\nexport class LibsUiComponentsComponentOutletComponent {\n readonly item = input.required<TYPE_OBJECT>();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA;;;;;;;AAOG;MAOU,wCAAwC,CAAA;AAC1C,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAe;
|
|
1
|
+
{"version":3,"file":"libs-ui-components-component-outlet.mjs","sources":["../../../../../libs-ui/components/component-outlet/src/component-outlet.component.ts","../../../../../libs-ui/components/component-outlet/src/libs-ui-components-component-outlet.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\nimport { TYPE_OBJECT } from '@libs-ui/interfaces-types';\n\n/**\n * @deprecated Component này đã cũ và không còn được sử dụng.\n *\n * Lý do: Hàm `getDataComponentOutlet` trong List/Table config đã hỗ trợ trả về input theo component truyền vào,\n * không cần extend base component này nữa.\n *\n * Thay vào đó, tạo standalone component với input tùy chỉnh và sử dụng `getDataComponentOutlet` để map data.\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-components-component_outlet',\n template: ``,\n standalone: true,\n})\nexport class LibsUiComponentsComponentOutletComponent {\n readonly item = input.required<TYPE_OBJECT>();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA;;;;;;;AAOG;MAOU,wCAAwC,CAAA;AAC1C,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAe,CAAC;wGADnC,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,wCAAwC,+NAHzC,CAAE,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;4FAGD,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBANpD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,qCAAqC;AAC/C,oBAAA,QAAQ,EAAE,CAAE,CAAA;AACZ,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libs-ui/components-component-outlet",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.357-0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/
|
|
6
|
-
"@
|
|
5
|
+
"@angular/core": ">=18.0.0",
|
|
6
|
+
"@libs-ui/interfaces-types": "0.2.357-0"
|
|
7
7
|
},
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"module": "fesm2022/libs-ui-components-component-outlet.mjs",
|