@gipisistemas/ng-core 1.1.1 → 1.1.2
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/bundles/gipisistemas-ng-core.umd.js +115 -54
 - package/bundles/gipisistemas-ng-core.umd.js.map +1 -1
 - package/bundles/gipisistemas-ng-core.umd.min.js +3 -3
 - package/bundles/gipisistemas-ng-core.umd.min.js.map +1 -1
 - package/esm2015/shared/components/table/table.component.js +102 -40
 - package/esm2015/shared/gipi-components/input-monthpicker/input-monthpicker.component.js +1 -1
 - package/esm2015/shared/gipi-components/month-year-picker/month-year-picker.component.js +1 -1
 - package/esm5/shared/components/table/table.component.js +115 -54
 - package/esm5/shared/gipi-components/input-monthpicker/input-monthpicker.component.js +1 -1
 - package/esm5/shared/gipi-components/month-year-picker/month-year-picker.component.js +1 -1
 - package/fesm2015/gipisistemas-ng-core.js +102 -40
 - package/fesm2015/gipisistemas-ng-core.js.map +1 -1
 - package/fesm5/gipisistemas-ng-core.js +115 -54
 - package/fesm5/gipisistemas-ng-core.js.map +1 -1
 - package/gipisistemas-ng-core.metadata.json +1 -1
 - package/package.json +1 -1
 - package/shared/components/table/table.component.d.ts +60 -9
 
    
        package/package.json
    CHANGED
    
    
| 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { AfterViewInit, EventEmitter, OnChanges, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { AfterViewInit, EventEmitter, NgZone, OnChanges, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
         
     | 
| 
       2 
2 
     | 
    
         
             
            import { MatPaginator, MatSort, MatTableDataSource, Sort, SortDirection } from '@angular/material';
         
     | 
| 
       3 
3 
     | 
    
         
             
            import { Observable } from 'rxjs';
         
     | 
| 
       4 
4 
     | 
    
         
             
            import { TableColumnDTO } from '../../../core/models/dto/table-column.dto';
         
     | 
| 
       5 
5 
     | 
    
         
             
            import { TableGroupHeaderDTO } from '../../../core/models/dto/table-group-header.dto';
         
     | 
| 
       6 
6 
     | 
    
         
             
            import { TablePageEventDTO } from '../../../core/models/dto/table-page-event.dto';
         
     | 
| 
       7 
7 
     | 
    
         
             
            export declare class TableComponent<T> implements AfterViewInit, OnChanges, OnInit {
         
     | 
| 
       8 
     | 
    
         
            -
                private  
     | 
| 
      
 8 
     | 
    
         
            +
                private _ngZone;
         
     | 
| 
      
 9 
     | 
    
         
            +
                _expandedRows: T[];
         
     | 
| 
       9 
10 
     | 
    
         
             
                _scrollHeightCalc: number;
         
     | 
| 
       10 
11 
     | 
    
         
             
                _isPopoverHover: any;
         
     | 
| 
       11 
12 
     | 
    
         
             
                _contextPopover: T;
         
     | 
| 
       12 
     | 
    
         
            -
                _expandedElement: any;
         
     | 
| 
       13 
13 
     | 
    
         
             
                _displayedColumns: any[];
         
     | 
| 
       14 
14 
     | 
    
         
             
                _dataSource: MatTableDataSource<T | TableGroupHeaderDTO>;
         
     | 
| 
       15 
15 
     | 
    
         
             
                matSort: MatSort;
         
     | 
| 
         @@ -55,27 +55,78 @@ export declare class TableComponent<T> implements AfterViewInit, OnChanges, OnIn 
     | 
|
| 
       55 
55 
     | 
    
         
             
                showColumnExpandableFixed: boolean;
         
     | 
| 
       56 
56 
     | 
    
         
             
                expandableOneRow: boolean;
         
     | 
| 
       57 
57 
     | 
    
         
             
                ignoreChildrenExpandRow: boolean;
         
     | 
| 
      
 58 
     | 
    
         
            +
                sort: boolean;
         
     | 
| 
       58 
59 
     | 
    
         
             
                clearSort: boolean;
         
     | 
| 
       59 
60 
     | 
    
         
             
                sortActive: string;
         
     | 
| 
       60 
61 
     | 
    
         
             
                sortDirection: SortDirection;
         
     | 
| 
       61 
     | 
    
         
            -
                 
     | 
| 
      
 62 
     | 
    
         
            +
                rowExpanded: EventEmitter<T>;
         
     | 
| 
       62 
63 
     | 
    
         
             
                dataChange: EventEmitter<T[]>;
         
     | 
| 
       63 
64 
     | 
    
         
             
                page: EventEmitter<TablePageEventDTO>;
         
     | 
| 
       64 
65 
     | 
    
         
             
                rowHover: EventEmitter<any>;
         
     | 
| 
       65 
66 
     | 
    
         
             
                get matTableHeigth(): Observable<string>;
         
     | 
| 
       66 
     | 
    
         
            -
                constructor();
         
     | 
| 
      
 67 
     | 
    
         
            +
                constructor(_ngZone: NgZone);
         
     | 
| 
       67 
68 
     | 
    
         
             
                ngOnInit(): void;
         
     | 
| 
       68 
69 
     | 
    
         
             
                ngAfterViewInit(): void;
         
     | 
| 
       69 
70 
     | 
    
         
             
                ngOnChanges(changes: SimpleChanges): void;
         
     | 
| 
       70 
71 
     | 
    
         
             
                private _createDataSource;
         
     | 
| 
       71 
72 
     | 
    
         
             
                calcScrollHeight(): void;
         
     | 
| 
       72 
73 
     | 
    
         
             
                onPage(pageEvent: TablePageEventDTO): void;
         
     | 
| 
       73 
     | 
    
         
            -
                 
     | 
| 
       74 
     | 
    
         
            -
                 
     | 
| 
       75 
     | 
    
         
            -
                addCollapse(element: any): void;
         
     | 
| 
       76 
     | 
    
         
            -
                rowExpandedChangeEmit(element: any): void;
         
     | 
| 
      
 74 
     | 
    
         
            +
                isExpandedRow(row: T): Observable<boolean>;
         
     | 
| 
      
 75 
     | 
    
         
            +
                toggleExpandRow(row: T): void;
         
     | 
| 
       77 
76 
     | 
    
         
             
                sortData(sort: Sort): void;
         
     | 
| 
       78 
77 
     | 
    
         
             
                showPopover(event: MouseEvent, data: any): void;
         
     | 
| 
      
 78 
     | 
    
         
            +
                /**
         
     | 
| 
      
 79 
     | 
    
         
            +
                showPopover(event: MouseEvent, data: any): void {
         
     | 
| 
      
 80 
     | 
    
         
            +
                    const popover: HTMLElement = document.getElementById('table-popover');
         
     | 
| 
      
 81 
     | 
    
         
            +
                    if (!ObjectUtil.isNull(popover)) {
         
     | 
| 
      
 82 
     | 
    
         
            +
                        popover.style.visibility = 'hidden';
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
                        if (!this.loading) {
         
     | 
| 
      
 85 
     | 
    
         
            +
                            const domRectPopover = popover.getBoundingClientRect();
         
     | 
| 
      
 86 
     | 
    
         
            +
                            const domRectRow = (event.currentTarget as HTMLElement).getBoundingClientRect();
         
     | 
| 
      
 87 
     | 
    
         
            +
                            const cells = (event.currentTarget as HTMLTableRowElement).children;
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
                            if (domRectPopover && domRectRow) {
         
     | 
| 
      
 90 
     | 
    
         
            +
                                popover.style.visibility = 'visible';
         
     | 
| 
      
 91 
     | 
    
         
            +
                                popover.style.top = `${(domRectRow.top + domRectRow.height) - 1}px`;
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
                                let startPosition: number = 0;
         
     | 
| 
      
 94 
     | 
    
         
            +
                                let endPosition: number = 0;
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
      
 96 
     | 
    
         
            +
                                if (this.columnInitial && (this.columnInitial >= 0)) {
         
     | 
| 
      
 97 
     | 
    
         
            +
                                    if (!cells[this.columnInitial]) {
         
     | 
| 
      
 98 
     | 
    
         
            +
                                        throw new Error('Initial column undefined or null');
         
     | 
| 
      
 99 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 100 
     | 
    
         
            +
                                    startPosition = cells[this.columnInitial].getBoundingClientRect().left;
         
     | 
| 
      
 101 
     | 
    
         
            +
                                } else {
         
     | 
| 
      
 102 
     | 
    
         
            +
                                    startPosition = domRectRow.left;
         
     | 
| 
      
 103 
     | 
    
         
            +
                                }
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
                                if (this.columnFinal && (this.columnFinal >= 0)) {
         
     | 
| 
      
 106 
     | 
    
         
            +
                                    if (!cells[this.columnFinal]) {
         
     | 
| 
      
 107 
     | 
    
         
            +
                                        throw new Error('Final column undefined or null');
         
     | 
| 
      
 108 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 109 
     | 
    
         
            +
                                    endPosition = cells[this.columnFinal].getBoundingClientRect().left - domRectPopover.width;
         
     | 
| 
      
 110 
     | 
    
         
            +
                                } else {
         
     | 
| 
      
 111 
     | 
    
         
            +
                                    endPosition = domRectRow.right - domRectPopover.width;
         
     | 
| 
      
 112 
     | 
    
         
            +
                                }
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
                                setTimeout(() => {
         
     | 
| 
      
 115 
     | 
    
         
            +
                                    if (event.clientX > startPosition + 15 && event.clientX < endPosition) {
         
     | 
| 
      
 116 
     | 
    
         
            +
                                        popover.style.left = `${event.clientX - 15}px`;
         
     | 
| 
      
 117 
     | 
    
         
            +
                                    } else if (event.clientX <= startPosition) {
         
     | 
| 
      
 118 
     | 
    
         
            +
                                        popover.style.left = `${startPosition}px`;
         
     | 
| 
      
 119 
     | 
    
         
            +
                                    } else if (event.clientX >= endPosition) {
         
     | 
| 
      
 120 
     | 
    
         
            +
                                        popover.style.left = `${endPosition}px`;
         
     | 
| 
      
 121 
     | 
    
         
            +
                                    }
         
     | 
| 
      
 122 
     | 
    
         
            +
                                });
         
     | 
| 
      
 123 
     | 
    
         
            +
                            }
         
     | 
| 
      
 124 
     | 
    
         
            +
                        }
         
     | 
| 
      
 125 
     | 
    
         
            +
                    }
         
     | 
| 
      
 126 
     | 
    
         
            +
                    this.rowHover.emit(data);
         
     | 
| 
      
 127 
     | 
    
         
            +
                    this._contextPopover = data;
         
     | 
| 
      
 128 
     | 
    
         
            +
                }
         
     | 
| 
      
 129 
     | 
    
         
            +
                */
         
     | 
| 
       79 
130 
     | 
    
         
             
                closePopover(time: number): void;
         
     | 
| 
       80 
131 
     | 
    
         
             
                setSortingDataAccessor(): void;
         
     | 
| 
       81 
132 
     | 
    
         
             
                genereteGroupsByColumn(data: any[]): TableGroupHeaderDTO[];
         
     |