ms-data-grid 0.0.16 → 0.0.17

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/DOCUMENTATION.md +243 -0
  3. package/ng-package.json +10 -0
  4. package/package.json +33 -45
  5. package/src/lib/css/bootstrap.css +12043 -0
  6. package/src/lib/data-grid/data-grid.component.html +4806 -0
  7. package/src/lib/data-grid/data-grid.component.scss +1502 -0
  8. package/src/lib/data-grid/data-grid.component.spec.ts +28 -0
  9. package/src/lib/data-grid/data-grid.component.ts +4216 -0
  10. package/src/lib/data-grid/statuses.ts +47 -0
  11. package/src/lib/data-grid.module.ts +20 -0
  12. package/src/lib/data-grid.service.spec.ts +16 -0
  13. package/src/lib/data-grid.service.ts +9 -0
  14. package/src/lib/directives/draggable-header.directive.spec.ts +11 -0
  15. package/src/lib/directives/draggable-header.directive.ts +172 -0
  16. package/src/lib/pipes/filter.pipe.spec.ts +11 -0
  17. package/src/lib/pipes/filter.pipe.ts +16 -0
  18. package/src/lib/services/cell-selection.service.spec.ts +16 -0
  19. package/src/lib/services/cell-selection.service.ts +234 -0
  20. package/src/lib/services/common.service.spec.ts +16 -0
  21. package/src/lib/services/common.service.ts +239 -0
  22. package/src/lib/services/copy-service.service.spec.ts +16 -0
  23. package/src/lib/services/copy-service.service.ts +251 -0
  24. package/src/lib/services/drag-drp.service.spec.ts +16 -0
  25. package/src/lib/services/drag-drp.service.ts +58 -0
  26. package/src/lib/services/split-columns.service.spec.ts +16 -0
  27. package/src/lib/services/split-columns.service.ts +148 -0
  28. package/src/lib/services/swap-columns.service.spec.ts +16 -0
  29. package/src/lib/services/swap-columns.service.ts +162 -0
  30. package/{public-api.d.ts → src/public-api.ts} +8 -4
  31. package/tsconfig.lib.json +16 -0
  32. package/tsconfig.lib.prod.json +10 -0
  33. package/tsconfig.spec.json +14 -0
  34. package/esm2022/lib/data-grid/data-grid.component.mjs +0 -3623
  35. package/esm2022/lib/data-grid/statuses.mjs +0 -44
  36. package/esm2022/lib/data-grid.module.mjs +0 -26
  37. package/esm2022/lib/data-grid.service.mjs +0 -14
  38. package/esm2022/lib/directives/draggable-header.directive.mjs +0 -145
  39. package/esm2022/lib/pipes/filter.pipe.mjs +0 -22
  40. package/esm2022/lib/services/common.service.mjs +0 -206
  41. package/esm2022/lib/services/copy-service.service.mjs +0 -221
  42. package/esm2022/lib/services/split-columns.service.mjs +0 -143
  43. package/esm2022/lib/services/swap-columns.service.mjs +0 -118
  44. package/esm2022/ms-data-grid.mjs +0 -5
  45. package/esm2022/public-api.mjs +0 -8
  46. package/fesm2022/ms-data-grid.mjs +0 -4546
  47. package/fesm2022/ms-data-grid.mjs.map +0 -1
  48. package/index.d.ts +0 -5
  49. package/lib/data-grid/data-grid.component.d.ts +0 -468
  50. package/lib/data-grid/statuses.d.ts +0 -3
  51. package/lib/data-grid.module.d.ts +0 -14
  52. package/lib/data-grid.service.d.ts +0 -6
  53. package/lib/directives/draggable-header.directive.d.ts +0 -31
  54. package/lib/pipes/filter.pipe.d.ts +0 -7
  55. package/lib/services/common.service.d.ts +0 -17
  56. package/lib/services/copy-service.service.d.ts +0 -14
  57. package/lib/services/split-columns.service.d.ts +0 -9
  58. package/lib/services/swap-columns.service.d.ts +0 -19
package/CHANGELOG.md ADDED
@@ -0,0 +1,57 @@
1
+ # Changelog
2
+
3
+ All notable changes to the MS Data Grid project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.0.2] - 2024-01-15
9
+
10
+ ### Added
11
+ - Advanced data grid component for Angular applications
12
+ - Customizable column configuration with sorting and filtering
13
+ - Flexible pagination system
14
+ - Row selection with checkbox support
15
+ - Column pinning (left and right)
16
+ - Taskbar with customizable actions
17
+ - Global search functionality
18
+ - Responsive design support
19
+ - Custom styling options for headers, rows, and cells
20
+ - Loading state indicator
21
+ - Cell details popup
22
+ - Multiple table view configurations
23
+ - Horizontal and vertical scrollbar customization
24
+
25
+ ### Features
26
+ - **Performance Optimized**: Efficient rendering for large datasets
27
+ - **Fully Customizable**: Complete control over appearance and behavior
28
+ - **TypeScript Support**: Full type safety and IntelliSense
29
+ - **Accessibility**: WCAG compliant design
30
+ - **Mobile Responsive**: Works seamlessly on all devices
31
+
32
+ ### Technical Specifications
33
+ - Angular 16+ compatibility
34
+ - TypeScript support
35
+ - Tree-shakable build
36
+ - Minimal bundle size impact
37
+ - No external dependencies (except Angular core)
38
+
39
+ ## [0.0.1] - 2024-01-01
40
+
41
+ ### Added
42
+ - Initial release of MS Data Grid
43
+ - Basic table functionality
44
+ - Column configuration
45
+ - Data binding support
46
+
47
+ ---
48
+
49
+ ## Upcoming Features
50
+
51
+ - Export functionality (CSV, Excel, PDF)
52
+ - Advanced filtering with date ranges
53
+ - Column resizing
54
+ - Row grouping
55
+ - Virtual scrolling for massive datasets
56
+ - Dark theme support
57
+ - Internationalization (i18n)
@@ -0,0 +1,243 @@
1
+ # MS Data Grid - Complete API Documentation
2
+
3
+ ## Table of Contents
4
+ - [Installation](#installation)
5
+ - [Getting Started](#getting-started)
6
+ - [Configuration](#configuration)
7
+ - [API Reference](#api-reference)
8
+ - [Examples](#examples)
9
+ - [Best Practices](#best-practices)
10
+ - [Troubleshooting](#troubleshooting)
11
+
12
+ ## Installation
13
+
14
+ Install MS Data Grid via npm:
15
+
16
+ ```bash
17
+ npm install ms-data-grid
18
+ ```
19
+
20
+ Import the module in your Angular application:
21
+
22
+ ```typescript
23
+ import { MsDataGridModule } from 'ms-data-grid';
24
+
25
+ @NgModule({
26
+ imports: [MsDataGridModule],
27
+ // ...
28
+ })
29
+ export class AppModule { }
30
+ ```
31
+
32
+ ## Getting Started
33
+
34
+ ### Basic Implementation
35
+
36
+ ```typescript
37
+ import { Component } from '@angular/core';
38
+
39
+ @Component({
40
+ selector: 'app-data-example',
41
+ template: `
42
+ <ms-data-grid
43
+ [columns]="gridColumns"
44
+ [dataSet]="gridData"
45
+ [showFilterRow]="true"
46
+ [paginationConfig]="pagination"
47
+ (genericEvent)="handleGridEvent($event)">
48
+ </ms-data-grid>
49
+ `
50
+ })
51
+ export class DataExampleComponent {
52
+ gridColumns = [
53
+ {
54
+ field: 'id',
55
+ header: 'ID',
56
+ width: '80px',
57
+ sortable: true,
58
+ filterable: false
59
+ },
60
+ {
61
+ field: 'name',
62
+ header: 'Full Name',
63
+ sortable: true,
64
+ filterable: true,
65
+ width: '200px'
66
+ },
67
+ {
68
+ field: 'email',
69
+ header: 'Email Address',
70
+ sortable: true,
71
+ filterable: true
72
+ },
73
+ {
74
+ field: 'department',
75
+ header: 'Department',
76
+ sortable: true,
77
+ filterable: true
78
+ }
79
+ ];
80
+
81
+ gridData = [
82
+ { id: 1, name: 'John Doe', email: 'john@company.com', department: 'Engineering' },
83
+ { id: 2, name: 'Jane Smith', email: 'jane@company.com', department: 'Marketing' },
84
+ // ... more data
85
+ ];
86
+
87
+ pagination = {
88
+ pageSize: 25,
89
+ showPagination: true,
90
+ showPageSizeSelector: true,
91
+ pageSizeOptions: [10, 25, 50, 100]
92
+ };
93
+
94
+ handleGridEvent(event: any) {
95
+ console.log('Grid event:', event);
96
+ }
97
+ }
98
+ ```
99
+
100
+ ## Configuration
101
+
102
+ ### Column Configuration
103
+
104
+ Each column supports the following properties:
105
+
106
+ ```typescript
107
+ interface ColumnConfig {
108
+ field: string; // Data field name
109
+ header: string; // Display header text
110
+ width?: string; // Column width (e.g., '100px', '20%')
111
+ sortable?: boolean; // Enable sorting
112
+ filterable?: boolean; // Enable filtering
113
+ pinned?: 'left' | 'right'; // Pin column position
114
+ type?: 'text' | 'number' | 'date' | 'boolean'; // Data type
115
+ format?: string; // Display format
116
+ editable?: boolean; // Enable inline editing
117
+ }
118
+ ```
119
+
120
+ ### Styling Configuration
121
+
122
+ Customize the grid appearance:
123
+
124
+ ```typescript
125
+ // Component template
126
+ <ms-data-grid
127
+ [columns]="columns"
128
+ [dataSet]="data"
129
+ evenRowsBackgroundColor="#f8f9fa"
130
+ oddRowsBackgroundColor="#ffffff"
131
+ headerBackgroundColor="#e9ecef"
132
+ headerTextColor="#495057"
133
+ bodyTextColor="#212529"
134
+ fontFamily="'Inter', sans-serif"
135
+ headerTextFontsSize="14px"
136
+ bodyTextFontsSize="13px"
137
+ [showVerticalBorder]="true"
138
+ [rowShadingEnabled]="true">
139
+ </ms-data-grid>
140
+ ```
141
+
142
+ ## API Reference
143
+
144
+ ### Input Properties
145
+
146
+ | Property | Type | Default | Description |
147
+ |----------|------|---------|-------------|
148
+ | `columns` | `ColumnConfig[]` | `[]` | Column definitions |
149
+ | `dataSet` | `any[]` | `[]` | Data to display |
150
+ | `loading` | `boolean` | `false` | Show loading indicator |
151
+ | `showFilterRow` | `boolean` | `false` | Display filter row |
152
+ | `showTaskbar` | `boolean` | `false` | Display taskbar |
153
+ | `paginationConfig` | `PaginationConfig` | `null` | Pagination settings |
154
+
155
+ ### Output Events
156
+
157
+ | Event | Payload | Description |
158
+ |-------|---------|-------------|
159
+ | `genericEvent` | `GridEvent` | General grid events |
160
+ | `filterOptions` | `FilterEvent` | Filter changes |
161
+ | `sortingOrderOptions` | `SortEvent` | Sort changes |
162
+
163
+ ## Examples
164
+
165
+ ### Advanced Filtering Example
166
+
167
+ ```typescript
168
+ // Enable advanced filtering
169
+ filtersConfig = {
170
+ enableGlobalSearch: true,
171
+ enableColumnFilters: true,
172
+ filterTypes: {
173
+ text: ['contains', 'equals', 'startsWith', 'endsWith'],
174
+ number: ['equals', 'greaterThan', 'lessThan', 'between'],
175
+ date: ['equals', 'before', 'after', 'between']
176
+ }
177
+ };
178
+ ```
179
+
180
+ ### Custom Taskbar Actions
181
+
182
+ ```typescript
183
+ taskbarActions = [
184
+ {
185
+ id: 'export',
186
+ label: 'Export Data',
187
+ icon: 'download',
188
+ action: () => this.exportData()
189
+ },
190
+ {
191
+ id: 'refresh',
192
+ label: 'Refresh',
193
+ icon: 'refresh',
194
+ action: () => this.refreshData()
195
+ }
196
+ ];
197
+ ```
198
+
199
+ ## Best Practices
200
+
201
+ ### Performance Optimization
202
+
203
+ 1. **Use trackBy functions** for large datasets
204
+ 2. **Implement virtual scrolling** for 1000+ rows
205
+ 3. **Lazy load data** with server-side pagination
206
+ 4. **Debounce filter inputs** to reduce API calls
207
+
208
+ ### Accessibility
209
+
210
+ 1. **Provide meaningful column headers**
211
+ 2. **Use proper ARIA labels**
212
+ 3. **Ensure keyboard navigation works**
213
+ 4. **Maintain sufficient color contrast**
214
+
215
+ ## Troubleshooting
216
+
217
+ ### Common Issues
218
+
219
+ **Q: Grid not displaying data**
220
+ A: Ensure `columns` and `dataSet` are properly bound and contain valid data.
221
+
222
+ **Q: Styling not applied**
223
+ A: Check that CSS custom properties are correctly set and not overridden.
224
+
225
+ **Q: Performance issues with large datasets**
226
+ A: Implement server-side pagination and consider virtual scrolling.
227
+
228
+ ### Browser Support
229
+
230
+ - Chrome 90+
231
+ - Firefox 88+
232
+ - Safari 14+
233
+ - Edge 90+
234
+
235
+ ### Angular Version Compatibility
236
+
237
+ - Angular 16.x ✅
238
+ - Angular 15.x ✅ (with compatibility mode)
239
+ - Angular 17.x ✅
240
+
241
+ ---
242
+
243
+ For more examples and advanced usage, visit our [GitHub repository](https://github.com/yourusername/ms-data-grid).
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/data-grid",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ },
7
+ "assets": [
8
+ "src/assets"
9
+ ]
10
+ }
package/package.json CHANGED
@@ -1,45 +1,33 @@
1
- {
2
- "name": "ms-data-grid",
3
- "version": "0.0.16",
4
- "description": "A powerful, customizable Angular data grid component with advanced features like sorting, filtering, pagination, column pinning, and taskbar actions. Perfect for enterprise applications.",
5
- "keywords": [
6
- "angular",
7
- "data-grid",
8
- "table",
9
- "datagrid",
10
- "angular-component",
11
- "data-table",
12
- "grid",
13
- "sorting",
14
- "filtering",
15
- "pagination",
16
- "angular-grid",
17
- "enterprise-grid",
18
- "customizable-grid",
19
- "responsive-table",
20
- "column-pinning"
21
- ],
22
- "author": "Bilal",
23
- "license": "MIT",
24
- "peerDependencies": {
25
- "@angular/common": "^16.2.0",
26
- "@angular/core": "^16.2.0"
27
- },
28
- "dependencies": {
29
- "tslib": "^2.3.0"
30
- },
31
- "sideEffects": false,
32
- "module": "fesm2022/ms-data-grid.mjs",
33
- "typings": "index.d.ts",
34
- "exports": {
35
- "./package.json": {
36
- "default": "./package.json"
37
- },
38
- ".": {
39
- "types": "./index.d.ts",
40
- "esm2022": "./esm2022/ms-data-grid.mjs",
41
- "esm": "./esm2022/ms-data-grid.mjs",
42
- "default": "./fesm2022/ms-data-grid.mjs"
43
- }
44
- }
45
- }
1
+ {
2
+ "name": "ms-data-grid",
3
+ "version": "0.0.17",
4
+ "description": "A powerful, customizable Angular data grid component with advanced features like sorting, filtering, pagination, column pinning, and taskbar actions. Perfect for enterprise applications.",
5
+ "keywords": [
6
+ "angular",
7
+ "data-grid",
8
+ "table",
9
+ "datagrid",
10
+ "angular-component",
11
+ "data-table",
12
+ "grid",
13
+ "sorting",
14
+ "filtering",
15
+ "pagination",
16
+ "angular-grid",
17
+ "enterprise-grid",
18
+ "customizable-grid",
19
+ "responsive-table",
20
+ "column-pinning"
21
+ ],
22
+ "author": "Bilal",
23
+ "license": "MIT",
24
+ "peerDependencies": {
25
+ "@angular/common": "^16.2.0",
26
+ "@angular/core": "^16.2.0",
27
+ "ng-inline-svg": "^13.1.1"
28
+ },
29
+ "dependencies": {
30
+ "tslib": "^2.3.0"
31
+ },
32
+ "sideEffects": false
33
+ }