ms-time-sheet 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.
package/README.md CHANGED
@@ -1,428 +1,428 @@
1
- # MS Time Sheet Component
2
-
3
- A powerful, high-performance Angular data grid component specifically designed for time sheet management and attendance tracking systems. Built with Angular 18+ and optimized for handling large datasets with advanced features like virtual scrolling, infinite scroll, drag-and-drop column management, and comprehensive filtering capabilities.
4
-
5
- ## Features
6
-
7
- ### Core Functionality
8
- - **Advanced Data Grid**: Full-featured table component with customizable columns, rows, and cell types
9
- - **Time Sheet Management**: Specialized for attendance, clock-in/out, breaks, and manual log tracking
10
- - **Virtual Scrolling**: Efficiently handles thousands of rows with smooth scrolling performance
11
- - **Infinite Scroll**: Load data progressively as users scroll for better performance with large datasets
12
-
13
- ### User Interactions
14
- - **Drag & Drop**: Reorder columns, pin/unpin columns, group data by dragging
15
- - **Column Management**: Show/hide columns, resize columns, autosize columns, column grouping
16
- - **Advanced Filtering**: Multi-condition filtering with dropdown, text, date, number filters, and logical operators (AND/OR/NONE)
17
- - **Sorting**: Ascending/descending sort with multi-column support and custom sort fields
18
- - **Row Selection**: Single and multi-row selection with taskbar actions and bulk operations
19
- - **Accordion Details**: Expandable row details with nested tables and manual log tracking
20
- - **Copy/Paste Operations**: Advanced clipboard functionality with cell-level and row-level copy/paste
21
- - **Cut Operations**: Cut selected data with visual feedback animations
22
- - **Cell Editing**: Inline editing with validation and change detection
23
- - **Context Menus**: Right-click context menus with customizable actions
24
- - **Tooltips**: Rich tooltips for breaks, manual logs, and status information
25
- - **Modal Dialogs**: Manual logs modal, column chooser, table presets, and filter panels
26
-
27
- ### Performance Optimizations
28
- - **Virtual Scrolling**: Efficiently handles thousands of rows with smooth scrolling performance and dynamic item heights
29
- - **Infinite Scroll**: Load data progressively as users scroll for better performance with large datasets, including prefetching
30
- - **Advanced Caching**: DOM query caching, computation caching, service worker support, and template expression memoization
31
- - **Memory Management**: Automatic cleanup of event listeners, timers, component references, and WeakRef-based cleanup
32
- - **Lazy Loading**: Modules loaded on-demand based on feature usage with progressive hydration
33
- - **Advanced DOM Optimization**: DOM query caching with TTL, LRU eviction, and optimized element selection
34
- - **Zone.js Optimizations**: Batched microtasks for ultra-fast change detection
35
- - **Performance Profiling**: Built-in performance metrics and optimization suggestions
36
- - **Worker-based Computations**: Heavy filtering operations moved to web workers
37
-
38
- ### UI/UX Features
39
- - **Responsive Design**: Adapts to different screen sizes and layouts
40
- - **Themes & Styling**: Customizable colors, fonts, and visual themes
41
- - **Tooltips & Modals**: Rich tooltips for breaks, manual logs modal, and context menus
42
- - **Export Functionality**: Export selected data or entire datasets
43
- - **Presets**: Save and load table configurations and filter states
44
-
45
- ### Data Types Supported
46
- - Text/String fields
47
- - Numbers
48
- - Dates with custom formatting
49
- - Booleans with badge display
50
- - Status fields with color coding
51
- - Arrays with item counts
52
- - Images with fallback avatars
53
- - Custom cell templates
54
-
55
- ## Installation
56
-
57
- ### As an Angular Library
58
-
59
- 1. Install the library:
60
- ```bash
61
- npm install ms-time-sheet
62
- ```
63
-
64
- 2. Import the module in your Angular application:
65
- ```typescript
66
- import { TimeSheetComponent } from 'ms-time-sheet';
67
-
68
- @NgModule({
69
- imports: [
70
- // ... other imports
71
- TimeSheetComponent
72
- ]
73
- })
74
- export class AppModule { }
75
- ```
76
-
77
- ### Development Setup
78
-
79
- 1. Clone the repository
80
- 2. Install dependencies:
81
- ```bash
82
- npm install
83
- ```
84
-
85
- 3. Build the library:
86
- ```bash
87
- ng build ms-time-sheet
88
- ```
89
-
90
- 4. Run tests:
91
- ```bash
92
- ng test ms-time-sheet
93
- ```
94
-
95
- ## Usage
96
-
97
- ### Basic Usage
98
-
99
- ```html
100
- <time-sheet
101
- [dataSet]="timeSheetData"
102
- [columns]="columnDefinitions"
103
- [config]="paginationConfig"
104
- (filterOptions)="onFilterChange($event)"
105
- (sortingOrderOptions)="onSortChange($event)">
106
- </time-sheet>
107
- ```
108
-
109
- ### Advanced Configuration
110
-
111
- ```typescript
112
- import { Component } from '@angular/core';
113
-
114
- @Component({
115
- selector: 'app-time-sheet-demo',
116
- template: `
117
- <time-sheet
118
- [dataSet]="attendanceData"
119
- [columns]="columns"
120
- [config]="config"
121
- [filtersConfig]="filters"
122
- [paginationConfig]="pagination"
123
- [showFilterRow]="true"
124
- [showColumnsGrouping]="true"
125
- [enableInfiniteScroll]="true"
126
- [enableProgressiveLoading]="true"
127
- [rowHeight]="44"
128
- [headerRowHeight]="44"
129
- [showVerticalBorder]="true"
130
- [showSerialNumber]="true"
131
- [tableName]="'attendance'"
132
- [selectedTableLayout]="'medium'"
133
- [globalSearchText]="searchText"
134
- [actions]="['edit', 'delete', 'export']"
135
- [taskbarActions]="['Export', 'Delete']"
136
- [showTaskbar]="true"
137
- [showSideMenu]="true"
138
- [columnThreedotsMunuConfig]="menuConfig"
139
- [timezonePrefs]="timezoneSettings"
140
- [gridType]="'TimeSheet'"
141
- [isSingleDay]="false"
142
- [dateFormat]="'dd/MM/yyyy'"
143
- [tableSearch]="tableSearch"
144
- [loading]="isLoading"
145
- [verticalScrollbarWidth]="'auto'"
146
- [horizintalScrollbarWidth]="'auto'"
147
- [showCellDetailsBox]="true"
148
- [fontFaimly]="'sans-serif'"
149
- [showRowsGrouping]="false"
150
- [showFilterRow]="true"
151
- [footerRowHeight]="46"
152
- [topFilterRowHeight]="50"
153
- [rowShadingEnabled]="false"
154
- [singleSpaAssetsPath]="'assets/'"
155
- [filtersConfig]="activeFilters"
156
- [loading]="false"
157
- [actions]="contextMenuActions"
158
- [config]="tableConfig"
159
- [showTaskbar]="true"
160
- [tableName]="'timeSheet'"
161
- [listingType]="''"
162
- [checkboxState]="{ reset: false }"
163
- [taskbarActions]="['Export', 'Delete']"
164
- [sortingConfig]="currentSorting"
165
- [tableFilterViewId]="currentViewId"
166
- [selectedTableLayout]="'medium'"
167
- [closeDropdown]="{ preset: { closed: false, loading: false } }"
168
- [globalSearchText]="globalSearch"
169
- [nestedTablerowFontsize]="14"
170
- [nestedTableHeaderRowHeight]="40"
171
- [nestedTablerowHeight]="36"
172
- [gridType]="'TimeSheet'"
173
- [isSingleDay]="false"
174
- [leftPinnedBoxshadow]="'#4b4b4b 1px 1px 5px 0px'"
175
- [rightPinnedBoxshadow]="'#4b4b4b 4px 1px 6px 0px'"
176
- [enableAccordionShadow]="false"
177
- [enableAccordionSeparators]="false"
178
- [enableRowShading]="false"
179
- [selectedRowsBackgroundColor]="'#8ac5ff'"
180
- [nestedTableHeaderBAckgroundColor]="'#eaeaea'"
181
- [tableView]="savedViews"
182
- [columnThreedotsMunuConfig]="columnMenuConfig"
183
- [timezonePrefs]="timezonePreferences"
184
- [enableProgressiveLoading]="true"
185
- [progressiveChunkSize]="100"
186
- [progressiveDelay]="50"
187
- [enableInfiniteScroll]="true"
188
- [hasMoreData]="hasMorePages"
189
- [loadingMore]="loadingMoreData"
190
- (loadMoreData)="loadMore()"
191
- (changeLayout)="onLayoutChange($event)"
192
- (filterOptions)="onFilterApply($event)"
193
- (genericEvent)="onGenericEvent($event)"
194
- (tablePresetConfig)="onPresetConfig($event)"
195
- (sortingOrderOptions)="onSortingChange($event)"
196
- (createUpdateConfigListing)="onConfigUpdate($event)"
197
- (onShortBreakClick)="onShortBreakClick($event)"
198
- (searchEvent)="onSearch($event)">
199
- </time-sheet>
200
- `
201
- })
202
- export class TimeSheetDemoComponent {
203
- // Component logic here
204
- }
205
- ```
206
-
207
- ## API Reference
208
-
209
- ### Inputs
210
-
211
- | Input | Type | Default | Description |
212
- |-------|------|---------|-------------|
213
- | `dataSet` | `any[]` | `[]` | Array of data objects to display |
214
- | `columns` | `any[]` | `[]` | Column definitions with field, header, type, etc. |
215
- | `config` | `any` | `{}` | Table configuration including pagination |
216
- | `filtersConfig` | `any[]` | `[]` | Active filter configurations |
217
- | `paginationConfig` | `any` | `{}` | Pagination settings |
218
- | `rowHeight` | `number` | `44` | Height of data rows in pixels |
219
- | `headerRowHeight` | `number` | `44` | Height of header rows in pixels |
220
- | `showVerticalBorder` | `boolean` | `true` | Show vertical borders between columns |
221
- | `showSerialNumber` | `boolean` | `false` | Display row serial numbers |
222
- | `showFilterRow` | `boolean` | `false` | Show filter row below headers |
223
- | `showColumnsGrouping` | `boolean` | `false` | Enable column grouping functionality |
224
- | `showRowsGrouping` | `boolean` | `false` | Enable row grouping |
225
- | `showSideMenu` | `boolean` | `false` | Show side menu for column management |
226
- | `enableInfiniteScroll` | `boolean` | `false` | Enable infinite scrolling |
227
- | `enableProgressiveLoading` | `boolean` | `false` | Enable progressive data loading |
228
- | `loading` | `boolean` | `false` | Show loading state |
229
- | `tableName` | `string` | `''` | Unique identifier for table state management |
230
- | `selectedTableLayout` | `string` | `'medium'` | Layout size: 'small', 'medium', 'large' |
231
- | `globalSearchText` | `string` | `''` | Global search text |
232
- | `actions` | `any[]` | `[]` | Context menu actions |
233
- | `taskbarActions` | `any[]` | `[]` | Actions for selected rows taskbar |
234
- | `showTaskbar` | `boolean` | `false` | Show taskbar for selected rows |
235
- | `dateFormat` | `string` | `'dd/MM/yyyy'` | Date display format |
236
- | `fontFaimly` | `string` | `'sans-serif'` | Font family for the table |
237
- | `singleSpaAssetsPath` | `string` | `'assets/'` | Path to static assets |
238
- | `gridType` | `string` | `'TimeSheet'` | Type of grid for styling |
239
- | `isSingleDay` | `boolean` | `false` | Single day view mode |
240
- | `timezonePrefs` | `any` | `{}` | Timezone preferences |
241
- | `columnThreedotsMunuConfig` | `any` | `{}` | Configuration for column menu |
242
-
243
- ### Outputs
244
-
245
- | Output | Description |
246
- |--------|-------------|
247
- | `filterOptions` | Emitted when filters are applied |
248
- | `sortingOrderOptions` | Emitted when sorting changes |
249
- | `genericEvent` | Generic event emitter for various actions |
250
- | `tablePresetConfig` | Emitted for preset configuration changes |
251
- | `createUpdateConfigListing` | Emitted when column configuration updates |
252
- | `changeLayout` | Emitted when layout changes |
253
- | `loadMoreData` | Emitted when more data is needed (infinite scroll) |
254
- | `onShortBreakClick` | Emitted when short break is clicked |
255
- | `searchEvent` | Emitted for search events |
256
-
257
- ### Column Definition Structure
258
-
259
- ```typescript
260
- interface Column {
261
- field: string; // Data field name
262
- header: string; // Display header
263
- type: 'string' | 'number' | 'date' | 'boolean' | 'status' | 'array' | 'image';
264
- width?: number; // Column width
265
- is_visible?: boolean; // Visibility state
266
- is_sortable?: boolean; // Sortable flag
267
- is_groupable?: boolean; // Groupable flag
268
- pinned?: 'left' | 'right' | null; // Pin position
269
- children?: Column[]; // Child columns for grouping
270
- query?: any; // Filter query configuration
271
- // ... additional properties
272
- }
273
- ```
274
-
275
- ## Data Structure
276
-
277
- The component expects data in the following format for time sheet functionality:
278
-
279
- ```typescript
280
- interface TimeSheetRow {
281
- _id?: string;
282
- id?: string;
283
- User?: {
284
- full_name: string;
285
- profile_pictures?: Array<{ path: string }>;
286
- logo?: string;
287
- };
288
- attendanceDate: string;
289
- clock_in_time?: string;
290
- clock_out_time?: string;
291
- attendanceStatus: string;
292
- breaks?: Array<{
293
- break_duration: number;
294
- type: string;
295
- }>;
296
- manually_logs?: Array<{
297
- log_date: string;
298
- clock_in?: {
299
- time: string;
300
- status: string;
301
- previous_state: string;
302
- };
303
- clock_out?: {
304
- time: string;
305
- status: string;
306
- previous_state: string;
307
- };
308
- breaks?: any[];
309
- remarks?: string;
310
- updated_by?: {
311
- full_name: string;
312
- };
313
- }>;
314
- short_leave?: Array<{
315
- // Short leave details
316
- }>;
317
- // ... additional fields
318
- }
319
- ```
320
-
321
- ## Styling and Theming
322
-
323
- The component supports extensive customization through input properties:
324
-
325
- - Row colors (even/odd, hover, selected)
326
- - Header and body colors
327
- - Font sizes and weights
328
- - Border styles and shadows
329
- - Pinned column shadows
330
-
331
- ## Performance Considerations
332
-
333
- - **Virtual Scrolling**: Enabled by default for datasets > 1000 rows with adaptive overscan and dynamic item heights
334
- - **Progressive Loading**: Load data in chunks to prevent UI blocking with configurable chunk sizes and delays
335
- - **DOM Caching**: Intelligent caching of DOM queries and computations with TTL and LRU eviction
336
- - **Memory Management**: Automatic cleanup of resources with WeakRef registry and advanced cleanup patterns
337
- - **Lazy Loading**: Modules loaded on-demand with progressive hydration for better initial load performance
338
- - **Worker Computations**: Heavy operations like filtering moved to web workers to prevent UI blocking
339
- - **Performance Monitoring**: Built-in profiling with thresholds and optimization suggestions
340
-
341
- ## Browser Support
342
-
343
- - Chrome 90+
344
- - Firefox 88+
345
- - Safari 14+
346
- - Edge 90+
347
-
348
- ## Dependencies
349
-
350
- - Angular 18.2.0+
351
- - Angular CDK (for drag-drop, scrolling, virtual scrolling)
352
- - ngx-bootstrap (for datepickers and UI components)
353
- - ng-inline-svg (for SVG icon support)
354
- - moment.js (for date manipulation)
355
- - tslib (TypeScript runtime helpers)
356
-
357
- ## Services and Pipes
358
-
359
- ### Included Services
360
- - **CommonService**: Utility functions for column visibility, filtering, and data manipulation
361
- - **SplitColumnsService**: Handles column splitting and width calculations
362
- - **CopyServiceService**: Advanced clipboard operations with copy/paste/cut functionality
363
- - **MsTimeSheetService**: Main service for time sheet operations
364
-
365
- ### Included Pipes
366
- - **FilterPipe**: Generic filtering pipe for arrays with search functionality
367
- - **PinnedColumnsPipe**: Filters columns by pinned state (left/right/center)
368
-
369
- ## Status Badge System
370
-
371
- The component includes a comprehensive status badge system with predefined color mappings:
372
-
373
- ```typescript
374
- // Success (Green)
375
- 'active', 'approved', 'accepted', 'completed', 'evaluated', 'assigned', 'scrap', 'move-available', 'move-assigned', 'present'
376
-
377
- // Warning (Yellow)
378
- 'contract', 'warranty', 'scheduled', 'leased', 'disposed', 'maintenance', 'assigning start', 'evaluation start', 'to be start assigning', 'pending', 'leave'
379
-
380
- // Danger (Red)
381
- 'inactive', 'rejected', 'unassigned', 'trashed', 'onhold', 'assigning stop', 'evaluation stop', 'unavailable', 'move-error', 'failed', 'absent'
382
-
383
- // Info (Blue)
384
- 'insurance', 'pastdue'
385
-
386
- // Dark (Neutral)
387
- 'expired', 'draft'
388
- ```
389
-
390
- ## Advanced Features
391
-
392
- ### Copy/Paste Operations
393
- - **Cell-level Copy**: Copy individual cells or ranges
394
- - **Row-level Copy**: Copy entire selected rows
395
- - **Paste Support**: Paste data with automatic type conversion
396
- - **Cut Operations**: Cut data with visual feedback animations
397
-
398
- ### Change Detection
399
- - **Field-level Change Detection**: Tracks changes by field type (string, number, date, boolean, dropdown)
400
- - **Dirty State Management**: Maintains original vs current values
401
- - **Validation**: Built-in validation for different data types
402
-
403
- ### Keyboard Navigation
404
- - **Arrow Keys**: Navigate between cells
405
- - **Enter/Escape**: Confirm/cancel edits
406
- - **Tab**: Move to next cell
407
- - **Copy/Paste Shortcuts**: Standard Ctrl+C/Ctrl+V support
408
-
409
- ### Export Functionality
410
- - **Selected Rows Export**: Export only selected data
411
- - **Filtered Data Export**: Export current filtered view
412
- - **Custom Export**: Configurable export formats
413
-
414
- ## Contributing
415
-
416
- 1. Fork the repository
417
- 2. Create a feature branch
418
- 3. Make your changes
419
- 4. Add tests if applicable
420
- 5. Submit a pull request
421
-
422
- ## License
423
-
424
- This project is licensed under the MIT License - see the LICENSE file for details.
425
-
426
- ## Support
427
-
428
- For support and questions, please open an issue on the GitHub repository.
1
+ # MS Time Sheet Component
2
+
3
+ A powerful, high-performance Angular data grid component specifically designed for time sheet management and attendance tracking systems. Built with Angular 18+ and optimized for handling large datasets with advanced features like virtual scrolling, infinite scroll, drag-and-drop column management, and comprehensive filtering capabilities.
4
+
5
+ ## Features
6
+
7
+ ### Core Functionality
8
+ - **Advanced Data Grid**: Full-featured table component with customizable columns, rows, and cell types
9
+ - **Time Sheet Management**: Specialized for attendance, clock-in/out, breaks, and manual log tracking
10
+ - **Virtual Scrolling**: Efficiently handles thousands of rows with smooth scrolling performance
11
+ - **Infinite Scroll**: Load data progressively as users scroll for better performance with large datasets
12
+
13
+ ### User Interactions
14
+ - **Drag & Drop**: Reorder columns, pin/unpin columns, group data by dragging
15
+ - **Column Management**: Show/hide columns, resize columns, autosize columns, column grouping
16
+ - **Advanced Filtering**: Multi-condition filtering with dropdown, text, date, number filters, and logical operators (AND/OR/NONE)
17
+ - **Sorting**: Ascending/descending sort with multi-column support and custom sort fields
18
+ - **Row Selection**: Single and multi-row selection with taskbar actions and bulk operations
19
+ - **Accordion Details**: Expandable row details with nested tables and manual log tracking
20
+ - **Copy/Paste Operations**: Advanced clipboard functionality with cell-level and row-level copy/paste
21
+ - **Cut Operations**: Cut selected data with visual feedback animations
22
+ - **Cell Editing**: Inline editing with validation and change detection
23
+ - **Context Menus**: Right-click context menus with customizable actions
24
+ - **Tooltips**: Rich tooltips for breaks, manual logs, and status information
25
+ - **Modal Dialogs**: Manual logs modal, column chooser, table presets, and filter panels
26
+
27
+ ### Performance Optimizations
28
+ - **Virtual Scrolling**: Efficiently handles thousands of rows with smooth scrolling performance and dynamic item heights
29
+ - **Infinite Scroll**: Load data progressively as users scroll for better performance with large datasets, including prefetching
30
+ - **Advanced Caching**: DOM query caching, computation caching, service worker support, and template expression memoization
31
+ - **Memory Management**: Automatic cleanup of event listeners, timers, component references, and WeakRef-based cleanup
32
+ - **Lazy Loading**: Modules loaded on-demand based on feature usage with progressive hydration
33
+ - **Advanced DOM Optimization**: DOM query caching with TTL, LRU eviction, and optimized element selection
34
+ - **Zone.js Optimizations**: Batched microtasks for ultra-fast change detection
35
+ - **Performance Profiling**: Built-in performance metrics and optimization suggestions
36
+ - **Worker-based Computations**: Heavy filtering operations moved to web workers
37
+
38
+ ### UI/UX Features
39
+ - **Responsive Design**: Adapts to different screen sizes and layouts
40
+ - **Themes & Styling**: Customizable colors, fonts, and visual themes
41
+ - **Tooltips & Modals**: Rich tooltips for breaks, manual logs modal, and context menus
42
+ - **Export Functionality**: Export selected data or entire datasets
43
+ - **Presets**: Save and load table configurations and filter states
44
+
45
+ ### Data Types Supported
46
+ - Text/String fields
47
+ - Numbers
48
+ - Dates with custom formatting
49
+ - Booleans with badge display
50
+ - Status fields with color coding
51
+ - Arrays with item counts
52
+ - Images with fallback avatars
53
+ - Custom cell templates
54
+
55
+ ## Installation
56
+
57
+ ### As an Angular Library
58
+
59
+ 1. Install the library:
60
+ ```bash
61
+ npm install ms-time-sheet
62
+ ```
63
+
64
+ 2. Import the module in your Angular application:
65
+ ```typescript
66
+ import { TimeSheetComponent } from 'ms-time-sheet';
67
+
68
+ @NgModule({
69
+ imports: [
70
+ // ... other imports
71
+ TimeSheetComponent
72
+ ]
73
+ })
74
+ export class AppModule { }
75
+ ```
76
+
77
+ ### Development Setup
78
+
79
+ 1. Clone the repository
80
+ 2. Install dependencies:
81
+ ```bash
82
+ npm install
83
+ ```
84
+
85
+ 3. Build the library:
86
+ ```bash
87
+ ng build ms-time-sheet
88
+ ```
89
+
90
+ 4. Run tests:
91
+ ```bash
92
+ ng test ms-time-sheet
93
+ ```
94
+
95
+ ## Usage
96
+
97
+ ### Basic Usage
98
+
99
+ ```html
100
+ <time-sheet
101
+ [dataSet]="timeSheetData"
102
+ [columns]="columnDefinitions"
103
+ [config]="paginationConfig"
104
+ (filterOptions)="onFilterChange($event)"
105
+ (sortingOrderOptions)="onSortChange($event)">
106
+ </time-sheet>
107
+ ```
108
+
109
+ ### Advanced Configuration
110
+
111
+ ```typescript
112
+ import { Component } from '@angular/core';
113
+
114
+ @Component({
115
+ selector: 'app-time-sheet-demo',
116
+ template: `
117
+ <time-sheet
118
+ [dataSet]="attendanceData"
119
+ [columns]="columns"
120
+ [config]="config"
121
+ [filtersConfig]="filters"
122
+ [paginationConfig]="pagination"
123
+ [showFilterRow]="true"
124
+ [showColumnsGrouping]="true"
125
+ [enableInfiniteScroll]="true"
126
+ [enableProgressiveLoading]="true"
127
+ [rowHeight]="44"
128
+ [headerRowHeight]="44"
129
+ [showVerticalBorder]="true"
130
+ [showSerialNumber]="true"
131
+ [tableName]="'attendance'"
132
+ [selectedTableLayout]="'medium'"
133
+ [globalSearchText]="searchText"
134
+ [actions]="['edit', 'delete', 'export']"
135
+ [taskbarActions]="['Export', 'Delete']"
136
+ [showTaskbar]="true"
137
+ [showSideMenu]="true"
138
+ [columnThreedotsMunuConfig]="menuConfig"
139
+ [timezonePrefs]="timezoneSettings"
140
+ [gridType]="'TimeSheet'"
141
+ [isSingleDay]="false"
142
+ [dateFormat]="'dd/MM/yyyy'"
143
+ [tableSearch]="tableSearch"
144
+ [loading]="isLoading"
145
+ [verticalScrollbarWidth]="'auto'"
146
+ [horizintalScrollbarWidth]="'auto'"
147
+ [showCellDetailsBox]="true"
148
+ [fontFaimly]="'sans-serif'"
149
+ [showRowsGrouping]="false"
150
+ [showFilterRow]="true"
151
+ [footerRowHeight]="46"
152
+ [topFilterRowHeight]="50"
153
+ [rowShadingEnabled]="false"
154
+ [singleSpaAssetsPath]="'assets/'"
155
+ [filtersConfig]="activeFilters"
156
+ [loading]="false"
157
+ [actions]="contextMenuActions"
158
+ [config]="tableConfig"
159
+ [showTaskbar]="true"
160
+ [tableName]="'timeSheet'"
161
+ [listingType]="''"
162
+ [checkboxState]="{ reset: false }"
163
+ [taskbarActions]="['Export', 'Delete']"
164
+ [sortingConfig]="currentSorting"
165
+ [tableFilterViewId]="currentViewId"
166
+ [selectedTableLayout]="'medium'"
167
+ [closeDropdown]="{ preset: { closed: false, loading: false } }"
168
+ [globalSearchText]="globalSearch"
169
+ [nestedTablerowFontsize]="14"
170
+ [nestedTableHeaderRowHeight]="40"
171
+ [nestedTablerowHeight]="36"
172
+ [gridType]="'TimeSheet'"
173
+ [isSingleDay]="false"
174
+ [leftPinnedBoxshadow]="'#4b4b4b 1px 1px 5px 0px'"
175
+ [rightPinnedBoxshadow]="'#4b4b4b 4px 1px 6px 0px'"
176
+ [enableAccordionShadow]="false"
177
+ [enableAccordionSeparators]="false"
178
+ [enableRowShading]="false"
179
+ [selectedRowsBackgroundColor]="'#8ac5ff'"
180
+ [nestedTableHeaderBAckgroundColor]="'#eaeaea'"
181
+ [tableView]="savedViews"
182
+ [columnThreedotsMunuConfig]="columnMenuConfig"
183
+ [timezonePrefs]="timezonePreferences"
184
+ [enableProgressiveLoading]="true"
185
+ [progressiveChunkSize]="100"
186
+ [progressiveDelay]="50"
187
+ [enableInfiniteScroll]="true"
188
+ [hasMoreData]="hasMorePages"
189
+ [loadingMore]="loadingMoreData"
190
+ (loadMoreData)="loadMore()"
191
+ (changeLayout)="onLayoutChange($event)"
192
+ (filterOptions)="onFilterApply($event)"
193
+ (genericEvent)="onGenericEvent($event)"
194
+ (tablePresetConfig)="onPresetConfig($event)"
195
+ (sortingOrderOptions)="onSortingChange($event)"
196
+ (createUpdateConfigListing)="onConfigUpdate($event)"
197
+ (onShortBreakClick)="onShortBreakClick($event)"
198
+ (searchEvent)="onSearch($event)">
199
+ </time-sheet>
200
+ `
201
+ })
202
+ export class TimeSheetDemoComponent {
203
+ // Component logic here
204
+ }
205
+ ```
206
+
207
+ ## API Reference
208
+
209
+ ### Inputs
210
+
211
+ | Input | Type | Default | Description |
212
+ |-------|------|---------|-------------|
213
+ | `dataSet` | `any[]` | `[]` | Array of data objects to display |
214
+ | `columns` | `any[]` | `[]` | Column definitions with field, header, type, etc. |
215
+ | `config` | `any` | `{}` | Table configuration including pagination |
216
+ | `filtersConfig` | `any[]` | `[]` | Active filter configurations |
217
+ | `paginationConfig` | `any` | `{}` | Pagination settings |
218
+ | `rowHeight` | `number` | `44` | Height of data rows in pixels |
219
+ | `headerRowHeight` | `number` | `44` | Height of header rows in pixels |
220
+ | `showVerticalBorder` | `boolean` | `true` | Show vertical borders between columns |
221
+ | `showSerialNumber` | `boolean` | `false` | Display row serial numbers |
222
+ | `showFilterRow` | `boolean` | `false` | Show filter row below headers |
223
+ | `showColumnsGrouping` | `boolean` | `false` | Enable column grouping functionality |
224
+ | `showRowsGrouping` | `boolean` | `false` | Enable row grouping |
225
+ | `showSideMenu` | `boolean` | `false` | Show side menu for column management |
226
+ | `enableInfiniteScroll` | `boolean` | `false` | Enable infinite scrolling |
227
+ | `enableProgressiveLoading` | `boolean` | `false` | Enable progressive data loading |
228
+ | `loading` | `boolean` | `false` | Show loading state |
229
+ | `tableName` | `string` | `''` | Unique identifier for table state management |
230
+ | `selectedTableLayout` | `string` | `'medium'` | Layout size: 'small', 'medium', 'large' |
231
+ | `globalSearchText` | `string` | `''` | Global search text |
232
+ | `actions` | `any[]` | `[]` | Context menu actions |
233
+ | `taskbarActions` | `any[]` | `[]` | Actions for selected rows taskbar |
234
+ | `showTaskbar` | `boolean` | `false` | Show taskbar for selected rows |
235
+ | `dateFormat` | `string` | `'dd/MM/yyyy'` | Date display format |
236
+ | `fontFaimly` | `string` | `'sans-serif'` | Font family for the table |
237
+ | `singleSpaAssetsPath` | `string` | `'assets/'` | Path to static assets |
238
+ | `gridType` | `string` | `'TimeSheet'` | Type of grid for styling |
239
+ | `isSingleDay` | `boolean` | `false` | Single day view mode |
240
+ | `timezonePrefs` | `any` | `{}` | Timezone preferences |
241
+ | `columnThreedotsMunuConfig` | `any` | `{}` | Configuration for column menu |
242
+
243
+ ### Outputs
244
+
245
+ | Output | Description |
246
+ |--------|-------------|
247
+ | `filterOptions` | Emitted when filters are applied |
248
+ | `sortingOrderOptions` | Emitted when sorting changes |
249
+ | `genericEvent` | Generic event emitter for various actions |
250
+ | `tablePresetConfig` | Emitted for preset configuration changes |
251
+ | `createUpdateConfigListing` | Emitted when column configuration updates |
252
+ | `changeLayout` | Emitted when layout changes |
253
+ | `loadMoreData` | Emitted when more data is needed (infinite scroll) |
254
+ | `onShortBreakClick` | Emitted when short break is clicked |
255
+ | `searchEvent` | Emitted for search events |
256
+
257
+ ### Column Definition Structure
258
+
259
+ ```typescript
260
+ interface Column {
261
+ field: string; // Data field name
262
+ header: string; // Display header
263
+ type: 'string' | 'number' | 'date' | 'boolean' | 'status' | 'array' | 'image';
264
+ width?: number; // Column width
265
+ is_visible?: boolean; // Visibility state
266
+ is_sortable?: boolean; // Sortable flag
267
+ is_groupable?: boolean; // Groupable flag
268
+ pinned?: 'left' | 'right' | null; // Pin position
269
+ children?: Column[]; // Child columns for grouping
270
+ query?: any; // Filter query configuration
271
+ // ... additional properties
272
+ }
273
+ ```
274
+
275
+ ## Data Structure
276
+
277
+ The component expects data in the following format for time sheet functionality:
278
+
279
+ ```typescript
280
+ interface TimeSheetRow {
281
+ _id?: string;
282
+ id?: string;
283
+ User?: {
284
+ full_name: string;
285
+ profile_pictures?: Array<{ path: string }>;
286
+ logo?: string;
287
+ };
288
+ attendanceDate: string;
289
+ clock_in_time?: string;
290
+ clock_out_time?: string;
291
+ attendanceStatus: string;
292
+ breaks?: Array<{
293
+ break_duration: number;
294
+ type: string;
295
+ }>;
296
+ manually_logs?: Array<{
297
+ log_date: string;
298
+ clock_in?: {
299
+ time: string;
300
+ status: string;
301
+ previous_state: string;
302
+ };
303
+ clock_out?: {
304
+ time: string;
305
+ status: string;
306
+ previous_state: string;
307
+ };
308
+ breaks?: any[];
309
+ remarks?: string;
310
+ updated_by?: {
311
+ full_name: string;
312
+ };
313
+ }>;
314
+ short_leave?: Array<{
315
+ // Short leave details
316
+ }>;
317
+ // ... additional fields
318
+ }
319
+ ```
320
+
321
+ ## Styling and Theming
322
+
323
+ The component supports extensive customization through input properties:
324
+
325
+ - Row colors (even/odd, hover, selected)
326
+ - Header and body colors
327
+ - Font sizes and weights
328
+ - Border styles and shadows
329
+ - Pinned column shadows
330
+
331
+ ## Performance Considerations
332
+
333
+ - **Virtual Scrolling**: Enabled by default for datasets > 1000 rows with adaptive overscan and dynamic item heights
334
+ - **Progressive Loading**: Load data in chunks to prevent UI blocking with configurable chunk sizes and delays
335
+ - **DOM Caching**: Intelligent caching of DOM queries and computations with TTL and LRU eviction
336
+ - **Memory Management**: Automatic cleanup of resources with WeakRef registry and advanced cleanup patterns
337
+ - **Lazy Loading**: Modules loaded on-demand with progressive hydration for better initial load performance
338
+ - **Worker Computations**: Heavy operations like filtering moved to web workers to prevent UI blocking
339
+ - **Performance Monitoring**: Built-in profiling with thresholds and optimization suggestions
340
+
341
+ ## Browser Support
342
+
343
+ - Chrome 90+
344
+ - Firefox 88+
345
+ - Safari 14+
346
+ - Edge 90+
347
+
348
+ ## Dependencies
349
+
350
+ - Angular 18.2.0+
351
+ - Angular CDK (for drag-drop, scrolling, virtual scrolling)
352
+ - ngx-bootstrap (for datepickers and UI components)
353
+ - ng-inline-svg (for SVG icon support)
354
+ - moment.js (for date manipulation)
355
+ - tslib (TypeScript runtime helpers)
356
+
357
+ ## Services and Pipes
358
+
359
+ ### Included Services
360
+ - **CommonService**: Utility functions for column visibility, filtering, and data manipulation
361
+ - **SplitColumnsService**: Handles column splitting and width calculations
362
+ - **CopyServiceService**: Advanced clipboard operations with copy/paste/cut functionality
363
+ - **MsTimeSheetService**: Main service for time sheet operations
364
+
365
+ ### Included Pipes
366
+ - **FilterPipe**: Generic filtering pipe for arrays with search functionality
367
+ - **PinnedColumnsPipe**: Filters columns by pinned state (left/right/center)
368
+
369
+ ## Status Badge System
370
+
371
+ The component includes a comprehensive status badge system with predefined color mappings:
372
+
373
+ ```typescript
374
+ // Success (Green)
375
+ 'active', 'approved', 'accepted', 'completed', 'evaluated', 'assigned', 'scrap', 'move-available', 'move-assigned', 'present'
376
+
377
+ // Warning (Yellow)
378
+ 'contract', 'warranty', 'scheduled', 'leased', 'disposed', 'maintenance', 'assigning start', 'evaluation start', 'to be start assigning', 'pending', 'leave'
379
+
380
+ // Danger (Red)
381
+ 'inactive', 'rejected', 'unassigned', 'trashed', 'onhold', 'assigning stop', 'evaluation stop', 'unavailable', 'move-error', 'failed', 'absent'
382
+
383
+ // Info (Blue)
384
+ 'insurance', 'pastdue'
385
+
386
+ // Dark (Neutral)
387
+ 'expired', 'draft'
388
+ ```
389
+
390
+ ## Advanced Features
391
+
392
+ ### Copy/Paste Operations
393
+ - **Cell-level Copy**: Copy individual cells or ranges
394
+ - **Row-level Copy**: Copy entire selected rows
395
+ - **Paste Support**: Paste data with automatic type conversion
396
+ - **Cut Operations**: Cut data with visual feedback animations
397
+
398
+ ### Change Detection
399
+ - **Field-level Change Detection**: Tracks changes by field type (string, number, date, boolean, dropdown)
400
+ - **Dirty State Management**: Maintains original vs current values
401
+ - **Validation**: Built-in validation for different data types
402
+
403
+ ### Keyboard Navigation
404
+ - **Arrow Keys**: Navigate between cells
405
+ - **Enter/Escape**: Confirm/cancel edits
406
+ - **Tab**: Move to next cell
407
+ - **Copy/Paste Shortcuts**: Standard Ctrl+C/Ctrl+V support
408
+
409
+ ### Export Functionality
410
+ - **Selected Rows Export**: Export only selected data
411
+ - **Filtered Data Export**: Export current filtered view
412
+ - **Custom Export**: Configurable export formats
413
+
414
+ ## Contributing
415
+
416
+ 1. Fork the repository
417
+ 2. Create a feature branch
418
+ 3. Make your changes
419
+ 4. Add tests if applicable
420
+ 5. Submit a pull request
421
+
422
+ ## License
423
+
424
+ This project is licensed under the MIT License - see the LICENSE file for details.
425
+
426
+ ## Support
427
+
428
+ For support and questions, please open an issue on the GitHub repository.