ngx-lite-form 1.4.2 → 1.4.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 +21 -6
- package/fesm2022/ngx-lite-form.mjs +68 -28
- package/fesm2022/ngx-lite-form.mjs.map +1 -1
- package/index.d.ts +11 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ Lite Form provides 15+ form and UI components. Click on any component below for
|
|
|
62
62
|
- **[LiteFile](docs/lite-file.md)** - File upload with drag & drop and camera capture
|
|
63
63
|
|
|
64
64
|
### Data Display & Navigation
|
|
65
|
-
- **[LiteTable](docs/lite-table.md)** - Flexible data table with sorting, pagination, and row actions
|
|
65
|
+
- **[LiteTable](docs/lite-table.md)** - Flexible data table with sorting, pagination, row selection, and row actions
|
|
66
66
|
- **[LitePaginator](docs/lite-paginator.md)** - Standalone pagination component
|
|
67
67
|
|
|
68
68
|
### UI Components
|
|
@@ -198,9 +198,10 @@ export class AppComponent {
|
|
|
198
198
|
showPreview: true
|
|
199
199
|
});
|
|
200
200
|
|
|
201
|
-
// Table with custom columns and
|
|
201
|
+
// Table with custom columns, sorting, and row selection
|
|
202
202
|
employeeTable = new TableFieldDto(
|
|
203
203
|
[
|
|
204
|
+
{ key: '__select__', label: '', flex: '0 0 36px', type: 'select' },
|
|
204
205
|
{ key: 'name', label: 'Name', flex: '1', sortable: true },
|
|
205
206
|
{ key: 'department', label: 'Department', flex: '0 0 150px', sortable: true },
|
|
206
207
|
{ key: 'salary', label: 'Salary', flex: '0 0 120px', sortable: true, cellTemplate: (value) => `$${value?.toLocaleString() || '0'}` }
|
|
@@ -231,6 +232,18 @@ export class AppComponent {
|
|
|
231
232
|
};
|
|
232
233
|
}
|
|
233
234
|
|
|
235
|
+
// Handle selection changes
|
|
236
|
+
onSelectionChange(selectedRows: any[]) {
|
|
237
|
+
console.log('Selected rows:', selectedRows);
|
|
238
|
+
// Enable bulk actions, update UI, etc.
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Handle row clicks
|
|
242
|
+
onRowClick(row: any) {
|
|
243
|
+
console.log('Row clicked:', row);
|
|
244
|
+
// Navigate to detail page, open modal, etc.
|
|
245
|
+
}
|
|
246
|
+
|
|
234
247
|
// Standalone paginator
|
|
235
248
|
paginator = new PaginatorFieldDto(1, 500, 25);
|
|
236
249
|
|
|
@@ -270,10 +283,12 @@ export class AppComponent {
|
|
|
270
283
|
<lite-file [control]="fileField"></lite-file>
|
|
271
284
|
</form>
|
|
272
285
|
|
|
273
|
-
<!-- Data Table with Sorting -->
|
|
286
|
+
<!-- Data Table with Sorting, Selection, and Row Click -->
|
|
274
287
|
<lite-table
|
|
275
288
|
[table]="employeeTable"
|
|
276
|
-
(sortChange)="onTableSort($event)"
|
|
289
|
+
(sortChange)="onTableSort($event)"
|
|
290
|
+
(selectionChange)="onSelectionChange($event)"
|
|
291
|
+
(rowClick)="onRowClick($event)">
|
|
277
292
|
</lite-table>
|
|
278
293
|
|
|
279
294
|
<!-- Paginated Table with Sorting -->
|
|
@@ -455,7 +470,7 @@ interface TableColumn {
|
|
|
455
470
|
flex?: string; // CSS flex property (e.g., '0 0 100px', '1')
|
|
456
471
|
sortable?: boolean; // Enable sorting for this column
|
|
457
472
|
cellTemplate?: (value: any, row: any) => string; // Custom HTML template
|
|
458
|
-
type?: 'text' | 'menu'; // Optional column type (default: 'text')
|
|
473
|
+
type?: 'text' | 'menu' | 'select'; // Optional column type (default: 'text')
|
|
459
474
|
menuItems?: Array<{ label: string; value: string; variant?: 'danger' | 'default' }>; // For 'menu' type columns
|
|
460
475
|
}
|
|
461
476
|
```
|
|
@@ -533,4 +548,4 @@ This project is licensed under the MIT License - see the [LICENSE](https://githu
|
|
|
533
548
|
|
|
534
549
|
---
|
|
535
550
|
## Changelog
|
|
536
|
-
- See [docs/CHANGELOG.md](https://github.com/liangk/lite-form/blob/main/docs/CHANGELOG.md) for the full historical record, including the latest `v1.4.
|
|
551
|
+
- See [docs/CHANGELOG.md](https://github.com/liangk/lite-form/blob/main/docs/CHANGELOG.md) for the full historical record, including the latest `v1.4.4` release with LiteTable row selection and row click features.
|