ngx-deebodata 0.0.2 → 0.0.3

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 (76) hide show
  1. package/fesm2022/ngx-deebodata.mjs +6863 -0
  2. package/fesm2022/ngx-deebodata.mjs.map +1 -0
  3. package/package.json +35 -16
  4. package/types/ngx-deebodata.d.ts +439 -0
  5. package/ng-package.json +0 -7
  6. package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.css +0 -156
  7. package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.html +0 -29
  8. package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.spec.ts +0 -23
  9. package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.ts +0 -286
  10. package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.css +0 -27
  11. package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.html +0 -53
  12. package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.spec.ts +0 -23
  13. package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.ts +0 -214
  14. package/src/lib/data-table/charts/column-chart/column-chart.css +0 -19
  15. package/src/lib/data-table/charts/column-chart/column-chart.html +0 -47
  16. package/src/lib/data-table/charts/column-chart/column-chart.spec.ts +0 -23
  17. package/src/lib/data-table/charts/column-chart/column-chart.ts +0 -178
  18. package/src/lib/data-table/charts/line-graph-component/line-graph-component.css +0 -33
  19. package/src/lib/data-table/charts/line-graph-component/line-graph-component.html +0 -59
  20. package/src/lib/data-table/charts/line-graph-component/line-graph-component.spec.ts +0 -23
  21. package/src/lib/data-table/charts/line-graph-component/line-graph-component.ts +0 -661
  22. package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.css +0 -61
  23. package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.html +0 -27
  24. package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.spec.ts +0 -23
  25. package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.ts +0 -210
  26. package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.css +0 -0
  27. package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.html +0 -15
  28. package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.spec.ts +0 -23
  29. package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.ts +0 -197
  30. package/src/lib/data-table/data-table-module/data-cell/data-cell.css +0 -0
  31. package/src/lib/data-table/data-table-module/data-cell/data-cell.html +0 -6
  32. package/src/lib/data-table/data-table-module/data-cell/data-cell.spec.ts +0 -23
  33. package/src/lib/data-table/data-table-module/data-cell/data-cell.ts +0 -271
  34. package/src/lib/data-table/data-table-module/data-table-header/data-table-header.css +0 -25
  35. package/src/lib/data-table/data-table-module/data-table-header/data-table-header.html +0 -55
  36. package/src/lib/data-table/data-table-module/data-table-header/data-table-header.spec.ts +0 -23
  37. package/src/lib/data-table/data-table-module/data-table-header/data-table-header.ts +0 -261
  38. package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.css +0 -69
  39. package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.html +0 -24
  40. package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.spec.ts +0 -23
  41. package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.ts +0 -125
  42. package/src/lib/data-table/data-table-module/export-component/export-component.css +0 -91
  43. package/src/lib/data-table/data-table-module/export-component/export-component.html +0 -16
  44. package/src/lib/data-table/data-table-module/export-component/export-component.spec.ts +0 -23
  45. package/src/lib/data-table/data-table-module/export-component/export-component.ts +0 -206
  46. package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.css +0 -91
  47. package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.html +0 -193
  48. package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.spec.ts +0 -23
  49. package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.ts +0 -2226
  50. package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.css +0 -14
  51. package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.html +0 -27
  52. package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.spec.ts +0 -23
  53. package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.ts +0 -58
  54. package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.css +0 -23
  55. package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.html +0 -48
  56. package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.spec.ts +0 -23
  57. package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.ts +0 -599
  58. package/src/lib/data-table/data-table-module/worker.worker.ts +0 -44
  59. package/src/lib/interfaces/cell-edit.ts +0 -5
  60. package/src/lib/interfaces/column-header.ts +0 -10
  61. package/src/lib/interfaces/column-styles.ts +0 -14
  62. package/src/lib/interfaces/column-symbol.ts +0 -4
  63. package/src/lib/interfaces/data-cell.ts +0 -14
  64. package/src/lib/interfaces/data-row.ts +0 -11
  65. package/src/lib/interfaces/row-number.ts +0 -4
  66. package/src/lib/services/common-service.spec.ts +0 -16
  67. package/src/lib/services/common-service.ts +0 -336
  68. package/src/lib/services/data-table-service.spec.ts +0 -16
  69. package/src/lib/services/data-table-service.ts +0 -597
  70. package/src/lib/services/table-drag-service.spec.ts +0 -16
  71. package/src/lib/services/table-drag-service.ts +0 -347
  72. package/src/lib/styles.css +0 -1065
  73. package/src/public-api.ts +0 -8
  74. package/tsconfig.lib.json +0 -17
  75. package/tsconfig.lib.prod.json +0 -11
  76. package/tsconfig.spec.json +0 -15
@@ -1,69 +0,0 @@
1
- :host{
2
- --accent-color:rgb(50, 50, 50);
3
- --grid-color:rgb(199, 199, 199);
4
- --pad-left-base: 33px;
5
- --row-num-width: 75px;
6
- --reg-font-size: 17px
7
- }
8
-
9
- .data-table-footer{
10
- padding:15px;
11
- border-bottom-left-radius:7px;
12
- border-bottom-right-radius:7px;
13
- box-shadow:0 1px 3px 1px var(--grid-color);
14
- -moz-box-shadow:0 1px 3px 1px var(--grid-color);
15
- -webkit-box-shadow:0 1px 3px 1px var(--grid-color)
16
- }
17
-
18
- .skip-to-contain{
19
- position: relative;
20
- display: inline-block;
21
- vertical-align: middle;
22
- }
23
-
24
- #skipTo{
25
- min-width: 125px
26
- }
27
-
28
- .skip-to-options-hide{
29
- opacity: 0;
30
- max-height: 0;
31
- min-width: 0;
32
- max-width: 0;
33
- overflow: hidden;
34
- }
35
-
36
- .skip-to-options{
37
- right: 0;
38
- z-index: 10;
39
- bottom:33px;
40
- border-radius: 3px;
41
- position: absolute;
42
- background: white;
43
- vertical-align: middle;
44
- opacity: 1 !important;
45
- overflow: auto !important;
46
- min-width: 175px !important;
47
- max-width: 200px !important;
48
- max-height: 200px !important;
49
- min-height: 150px;
50
- box-shadow:0 0 3px 2px var(--grid-color);
51
- -moz-box-shadow:0 0 3px 2px var(--grid-color);
52
- -webkit-box-shadow:0 0 3px 2px var(--grid-color);
53
- transition: opacity 0.2s ease;
54
- }
55
-
56
- .skip-to-options div{
57
- cursor: pointer;
58
- padding: 15px 7px;
59
- text-align: left !important;
60
- border-bottom: 1px solid var(--grid-color);
61
- }
62
-
63
- .skip-to-options div:hover{
64
- text-decoration: underline;
65
- }
66
-
67
- .skip-to-options div:last-of-type{
68
- border-bottom: none;
69
- }
@@ -1,24 +0,0 @@
1
- <div id="tableFooter" class="data-table-footer" (mousemove)="tblDragService.checkPaginatorBorderCursor($event)"
2
- (mousemove)="tblDragService.handleTableHeightAdjust($event)" (mousedown)="tblDragService.handleTableHeightAdjust($event)"
3
- (mouseup)="tblDragService.handleColResMouseUp($event)">
4
- <div class="three-qtr-wid">
5
- @if(!common.goodLs()){<span class="v-mid error-message lg-text">{{"Invalid License Key"}} </span>}
6
- <div class="inline v-mid semi-heavy lg-text">{{totalRowStr}}</div>&nbsp;<div class="inline v-mid">row{{totalRows === 1 ? "" : "s"}}</div>
7
- @if(filSortStr()){
8
- <div class="inline v-mid" [innerHTML]="filSortStr()"></div>
9
- }
10
- </div><div class="qtr-wid right">
11
- <label class="skip-lbl" for="skipTo">Jump To Row</label>&nbsp;&nbsp;<div class="skip-to-contain"><input type="number" min="1" [attr.max]="totalRowStr"
12
- name="skipTo" id="skipTo" #skipTo placeholder="Jump to..." (input)="handleSkipToPageOnKeyup($event, $any($event).target.value)"
13
- (focus)="showSkipToOptions($event)" (click)="showSkipToOptions($event)" (blur)="handleSkipToPageOnKeyup($event, $any($event).target.value)"
14
- (keyup.enter)="handleSkipToPageOnKeyupEnter($any($event).target.value)" (keyup)="handleSkipToPageOnKeyup($event, $any($event).target.value)"
15
- (mouseup)="common.unbindMouseEvent($event)" [disabled]="disableJump" />
16
- <div #skipToOptions class="skip-to-options-hide" [class.skip-to-options]="showSkipTo">
17
- @for(row of jumpableRows; track row.value){
18
- <div (click)="setUpHandleSkipToPage(row.value)"
19
- (keyup.enter)="setUpHandleSkipToPage(row.value)"
20
- tabIndex="0" >{{row.text}}</div>
21
- }
22
- </div></div>
23
- </div>
24
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { DataTablePaginator } from './data-table-paginator';
4
-
5
- describe('DataTablePaginator', () => {
6
- let component: DataTablePaginator;
7
- let fixture: ComponentFixture<DataTablePaginator>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [DataTablePaginator]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(DataTablePaginator);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,125 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, Input, Output, SimpleChanges, HostListener, input, signal } from '@angular/core';
2
- import { DataTableService } from '../../../services/data-table-service';
3
- import { CommonModule } from '@angular/common';
4
- import { FormsModule } from '@angular/forms';
5
- import { TableDragService } from '../../../services/table-drag-service';
6
- import { CommonService } from '../../../services/common-service';
7
-
8
- @Component({
9
- selector: 'app-data-table-paginator',
10
- imports: [CommonModule, FormsModule,],
11
- templateUrl: './data-table-paginator.html',
12
- styleUrls: ['./data-table-paginator.css', '../../../styles.css']
13
- })
14
- export class DataTablePaginator {
15
-
16
- @HostListener('window:click', ['$event'])
17
- onWindowClick(e: MouseEvent) {
18
- if(this.listenToWindowSkipTo && document.getElementsByClassName("skip-to-options").length){
19
- if(e && e.target && (e.target instanceof Element) && (/skip/g.test(e.target.className) || /skip/g.test(e.target.id)))
20
- return;
21
- this.closeSkipOpts()
22
- }
23
- }
24
-
25
- constructor(public dataTableService: DataTableService,
26
- public tblDragService: TableDragService,
27
- public common: CommonService,
28
- public skipTo: ElementRef,) {
29
-
30
- }
31
-
32
- init = true
33
- isKeying = false
34
- totalRowStr = "";
35
- rowinating = false
36
- jumpableRows: any[] = []
37
- listenToWindowSkipTo = false
38
- showSkipTo: boolean = false;
39
- @Input() totalRows: number = 0;
40
- filSortStr = input<string>("");
41
- @Input() disableJump: boolean = false;
42
- @Output("jumpTo") jumpTo: EventEmitter<number> = new EventEmitter(true)
43
-
44
- ngOnChanges(changes: SimpleChanges){
45
- if(!this.init && changes){
46
- if(changes["totalRows"])
47
- this.setUpPagi()
48
- }
49
- }
50
-
51
- ngOnInit() {
52
- this.setUpPagi()
53
- this.init = false
54
- }
55
-
56
- setUpPagi() {
57
- this.handleSkipToDD()
58
- this.totalRowStr = this.totalRows.toLocaleString(undefined, { maximumFractionDigits: 0 })
59
- }
60
-
61
- //PAGINATOR
62
- handleSkipToPage(value: any) {
63
- const pnum = parseInt(value.toString())
64
- if(value && !isNaN(pnum) && !this.isKeying){
65
- this.jumpTo.emit(pnum)
66
- this.closeSkipOpts()
67
- }
68
- }
69
-
70
- setUpHandleSkipToPage(val: any) {//mock option click
71
- if(val){
72
- const useVal = Math.min(val, this.totalRows)
73
- this.skipTo.nativeElement.value = useVal
74
- this.handleSkipToPage(useVal)
75
- } else {
76
- this.closeSkipOpts()
77
- }
78
- }
79
-
80
- handleSkipToPageOnKeyup(event: any, val: any) {
81
- if(event && event.type === "blur" && ((event.relatedTarget && /skip-to-options/g.test(event.relatedTarget.className)) ||
82
- (event.relatedTarget && event.relatedTarget.parentElement && /skip-to-options/g.test(event.relatedTarget.parentElement.className)))) return;
83
- this.isKeying = true
84
- setTimeout( () => {
85
- this.isKeying = false
86
- this.handleSkipToPage(val)
87
- })
88
- }
89
-
90
- setUpHandleSkipToPageOnEnter(page: any) {
91
- this.setUpHandleSkipToPage(page)
92
- }
93
-
94
- handleSkipToPageOnKeyupEnter(val: any) {
95
- this.handleSkipToPage(val)
96
- }
97
-
98
- showSkipToOptions(event: Event) {
99
- if(!this.showSkipTo)
100
- this.showSkipTo = true;
101
- if(event && event.type === "click" && !this.listenToWindowSkipTo)
102
- setTimeout( () => { this.listenToWindowSkipTo = true })
103
- }
104
-
105
- closeSkipOpts() {
106
- this.showSkipTo = false;
107
- this.listenToWindowSkipTo = false
108
- }
109
-
110
- handleSkipToDD() {
111
- this.jumpableRows = []
112
- this.jumpableRows.push({ text: "1st Row", value: "1" })
113
- if(this.totalRows > 10){
114
- const qtr = Math.ceil(this.totalRows/4)
115
- const half = Math.ceil(this.totalRows/2)
116
- const thrqtr = Math.ceil(this.totalRows*.75)
117
- this.jumpableRows.push({ text: "Row " + qtr.toLocaleString(undefined, { maximumFractionDigits: 0 }), value: qtr })
118
- this.jumpableRows.push({ text: "Row " + half.toLocaleString(undefined, { maximumFractionDigits: 0 }), value: half })
119
- this.jumpableRows.push({ text: "Row " + thrqtr.toLocaleString(undefined, { maximumFractionDigits: 0 }), value: thrqtr })
120
- }
121
- this.jumpableRows.push({ text: "Last Row", value: this.totalRows })
122
- }
123
- //PAGINATOR
124
-
125
- }
@@ -1,91 +0,0 @@
1
- :host{
2
- --accent-color:rgb(50, 50, 50);
3
- --grid-color:rgb(199, 199, 199);
4
- --pad-left-base: 33px;
5
- --row-num-width: 75px;
6
- --reg-font-size: 17px
7
- }
8
-
9
- .deebo-dd-select-hide{
10
- opacity: 0;
11
- max-height: 0;
12
- min-width: 0;
13
- max-width: 0;
14
- overflow: hidden;
15
- }
16
-
17
- .deebo-dd-contain{
18
- height:36px;
19
- border:none;
20
- padding: 0 7px;
21
- border-radius:3px;
22
- display: inline-flex;
23
- background: white;
24
- vertical-align: middle;
25
- box-sizing: border-box;
26
- border-bottom: none !important;
27
- box-shadow:0 0 1px 1px var(--grid-color);
28
- -moz-box-shadow:0 0 1px 1px var(--grid-color);
29
- -webkit-box-shadow:0 0 1px 1px var(--grid-color);
30
- font-family:'Roboto Condensed', Arial, Helvetica, sans-serif
31
- }
32
-
33
- .deebo-dd-selected{
34
- position: relative;
35
- }
36
-
37
- .deebo-dd-contain button, .deebo-dd-contain label{
38
- padding: 0;
39
- overflow: hidden;
40
- vertical-align: middle;
41
- }
42
-
43
- .deebo-dd-contain button span, .deebo-dd-contain button i{
44
- vertical-align: middle;
45
- font-size: var(--reg-font-size);
46
- }
47
-
48
- .deebo-dd-opt{
49
- padding: 15px 7px;
50
- overflow-x: hidden;
51
- text-overflow: ellipsis;
52
- border-bottom: 1px solid var(--grid-color);
53
- }
54
-
55
- .deebo-dd-opt button, .deebo-dd-opt div{
56
- width: 100%;
57
- text-align: left;
58
- font-size: var(--reg-font-size);
59
- }
60
-
61
- .btn-deebo-dd i{
62
- margin-left: 5px;
63
- }
64
-
65
- .deebo-dd-select{
66
- right: 0;/*keeps export dd from flowing off page horiz*/
67
- top: -150px;
68
- z-index: 10;
69
- border-radius: 3px;
70
- position: absolute;
71
- background: white;
72
- opacity: 1 !important;
73
- overflow: auto !important;
74
- min-height: 120px;
75
- white-space: normal;
76
- min-width: 200px !important;
77
- max-width: 275px !important;
78
- max-height: 300px !important;
79
- box-shadow:0 0 2px 2px var(--grid-color);
80
- -moz-box-shadow:0 0 2px 2px var(--grid-color);
81
- -webkit-box-shadow:0 0 2px 2px var(--grid-color);
82
- transition: opacity 0.2s ease;
83
- }
84
-
85
- .deebo-dd-opt:hover{
86
- background: #ebebeb;
87
- }
88
-
89
- .deebo-dd-opt:last-of-type{
90
- border-bottom: none;
91
- }
@@ -1,16 +0,0 @@
1
- <div class="relly">
2
- <div #ddSelect class="deebo-dd-select-hide deebo-dd-export" [class.deebo-dd-select]="optsOpen">
3
- @for(format of formats; track format){
4
- <div class="deebo-dd-opt deebo-dd-export">
5
- <button type="button" class="no-btn btn-export" (click)="handleExportData(format)"
6
- [disabled]="exporting || !count">{{format}}</button>
7
- </div>
8
- }
9
- </div>
10
- </div>
11
- <div class="deebo-dd-contain deebo-dd-export flex-center">
12
- <button type="button" class="btn-deebo-dd deebo-dd-export no-btn" (click)="toggleExportOpts()" [disabled]="disableExport()">
13
- <span>Export {{count | number}} {{rowsStr}}</span>
14
- <i class="material-icons" aria-hidden="false">{{optsOpen ? "keyboard_arrow_up" : "keyboard_arrow_down"}}</i>
15
- </button>
16
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { ExportComponent } from './export-component';
4
-
5
- describe('ExportComponent', () => {
6
- let component: ExportComponent;
7
- let fixture: ComponentFixture<ExportComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [ExportComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(ExportComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,206 +0,0 @@
1
- import { Component, ElementRef, input, Input, SimpleChanges, ViewChild, } from '@angular/core';
2
- import { DataTableService } from '../../../services/data-table-service';
3
- import { ColumnHeader } from '../../../interfaces/column-header';
4
- import { CommonModule, DecimalPipe } from '@angular/common';
5
- import { FormsModule } from '@angular/forms';
6
-
7
- @Component({
8
- selector: 'app-export-component',
9
- imports: [CommonModule, DecimalPipe, FormsModule],
10
- templateUrl: './export-component.html',
11
- styleUrls: ['./export-component.css', '../../../styles.css']
12
- })
13
- export class ExportComponent {
14
-
15
- constructor(private dataTableService: DataTableService,) {
16
-
17
- }
18
-
19
- init = true
20
- rowsStr = "rows"
21
- optsOpen = false
22
- disableExport = input<boolean>(false)
23
- exporting: boolean = false;
24
- @Input() count: number = 0
25
- @Input() columns: ColumnHeader[] = []
26
- formats: string[] = ["csv" ,"json" ,"psv" ,"tsv"]
27
- @ViewChild("ddSelect", { static: true }) ddSelect!: ElementRef<HTMLDivElement>;
28
-
29
- ngOnChanges(changes: SimpleChanges) {
30
- if(!this.init && changes){
31
- if(changes["count"]?.currentValue)
32
- this.rowsStr = this.count === 1 ? "row" : "rows"
33
- }
34
- }
35
-
36
- ngOnInit() {
37
- this.init = false
38
- this.dataTableService.closeExportOpts.subscribe( e => this.optsOpen = e)
39
- }
40
-
41
- toggleExportOpts() {
42
- this.optsOpen = !this.optsOpen
43
- if(this.optsOpen){
44
- setTimeout( () => {
45
- const hgt = this.ddSelect.nativeElement.getBoundingClientRect().height
46
- this.dataTableService.listenToCloseExportOpts = true;
47
- this.ddSelect.nativeElement.style.top = -(hgt+3) + "px"
48
- })
49
- }
50
- }
51
-
52
- //EXPORT
53
- handleExportData(format: string) {
54
- if(!this.dataTableService.mainData || !this.dataTableService.mainDataLen){
55
- this.optsOpen = false;
56
- this.dataTableService.listenToCloseExportOpts = false
57
- return alert("Please generate a table then export data!");
58
- }
59
- this.exporting = true
60
- try{
61
- let data; let cType = "application/octet-stream";
62
- const dt = new Date().getTime()
63
- let rows = this.dataTableService.currFilData.filter( function(d) { return true })
64
- const rLen = rows.length
65
- const selLen = this.dataTableService.currSelRows.length
66
- if(selLen && (selLen !== rLen)){
67
- setTimeout( () => { this.endExportOpts() })
68
- const sStr = (selLen.toLocaleString(undefined, {maximumFractionDigits:0}) + (" row" + (selLen === 1 ? "" : "s")))
69
- const rStr = (rLen.toLocaleString(undefined, {maximumFractionDigits:0}) + (" row" + (rLen === 1 ? "" : "s")))
70
- const noun = (selLen === 1 ? "just that one" : "them only")
71
- if(!confirm("You've selected " + sStr + " but didn't toggle to export "+noun+", so you're about to export " + rStr + ". Continue?"))
72
- return
73
- }
74
- if(!rLen){
75
- setTimeout( () => { this.endExportOpts() })
76
- return alert("Please include some rows to export.")
77
- }
78
- let c = 0
79
- let cols = []
80
- const colLen = this.columns.length
81
- for(c; c < colLen; c++)
82
- cols.push(this.columns[c].column)
83
- let title = "MyDataTable"
84
- const fName = title + dt
85
- if(format === "csv"){
86
- cType = "text/csv"
87
- data = this.whipToDelimForm(rows, cols, ",")
88
- return this.downloadFileExp(data, cType, fName, format)
89
- }
90
- if(format === "tsv")
91
- data = this.whipToDelimForm(rows, cols, '\t')
92
- if(format === "psv")
93
- data = this.whipToDelimForm(rows, cols, '|')
94
- if(data && (format === "tsv" || format === "psv"))
95
- return this.downloadFileExp(data, cType, fName, format)
96
- if(format === "json"){
97
- let n = 0
98
- let i = 0
99
- let useCols = []
100
- const clen = cols.length
101
- cType = "application/json"
102
- for(n; n < clen; n++){
103
- if(!this.dataTableService.dataFilSrtTracker[cols[n]]["minimize"])
104
- useCols.push(cols[n])
105
- }
106
- const uLen = useCols.length
107
- if(!uLen){
108
- setTimeout( () => { this.endExportOpts() })
109
- return alert("Please select or unhide some columns to export.")
110
- }
111
- if(uLen === clen){//nothing hidden just strinify
112
- data = JSON.stringify(rows)
113
- } else {//we know we have objs by now
114
- let json = []
115
- for(i; i < rLen; i++){
116
- const row = rows[i]
117
- if(row && typeof row === "object"){
118
- let exp: any = {}
119
- for(const prop in row){
120
- if(useCols.indexOf(prop) > -1)
121
- exp[prop] = row[prop]
122
- }
123
- json.push(exp)
124
- } else {
125
- json.push(row)
126
- }
127
- }
128
- data = JSON.stringify(json)
129
- }
130
- if(data)
131
- this.downloadFileExp(data, cType, fName, format)
132
- }
133
- }catch(e){
134
- setTimeout( () => { this.endExportOpts() })
135
- }
136
- }
137
-
138
- downloadFileExp(data: any, cType: string, fName: string, format: string) {
139
- const blob = new Blob([data], {type: cType})
140
- const url = URL.createObjectURL(blob)
141
- const link = document.createElement("a");
142
- link.setAttribute("href", url);
143
- link.setAttribute("download", (fName + "." + format));
144
- document.body.appendChild(link);
145
- link.click();
146
- document.body.removeChild(link);
147
- URL.revokeObjectURL(url)
148
- setTimeout( () => { this.endExportOpts() })
149
- }
150
-
151
- endExportOpts() {
152
- this.exporting = false;
153
- this.optsOpen = false;
154
- this.dataTableService.listenToCloseExportOpts = false
155
- }
156
-
157
- whipToDelimForm(rows: any[], cols: any[], delim: any) {
158
- let text = ""
159
- let i = 0; let n =0; let o = 0;
160
- const len = rows.length
161
- let useCols = []
162
- const clen = cols.length
163
- for(n; n < clen; n++){
164
- if(!this.dataTableService.dataFilSrtTracker[cols[n]]["minimize"])
165
- useCols.push(cols[n])
166
- }
167
- const ulen = useCols.length
168
- for(o; o < ulen; o++)
169
- text += (useCols[o].replace(/[,\|]/g, "") + (o < (ulen-1) ? delim : ""));//just remove commas in a col header
170
- if(!text)
171
- return alert("Please select or unhide some columns to export.")
172
- text += '\n'
173
- for(i; i < len; i++){
174
- const row = rows[i]
175
- if(typeof row === "object"){
176
- let z = 0
177
- for(const prop in row){
178
- if(this.dataTableService.dataFilSrtTracker[prop]["minimize"])
179
- continue
180
- const val: any = row[prop]
181
- if(val && typeof val === "string"){
182
- if((delim === "," && /,/g.test(val)) || (delim === "|" && /\|/g.test(val)))
183
- text += ('"' + val + '"' + (z < (ulen-1) ? delim : ""))
184
- else
185
- text += ((val || "null") + (z < (ulen-1) ? delim : ""))
186
- } else
187
- text += ((val || "null") + (z < (ulen-1) ? delim : ""))
188
- z += 1
189
- }
190
- } else {
191
- if(row && typeof row === "string"){
192
- if((delim === "," && /,/g.test(row)) || (delim === "|" && /\|/g.test(row)))
193
- text += ('"' + row + '"')
194
- else
195
- text += (row || "null")
196
- } else
197
- text += (row || "null")
198
- }
199
- if(i < (len-1))
200
- text += '\n'
201
- }
202
- return text
203
- }
204
- //EXPORT
205
-
206
- }
@@ -1,91 +0,0 @@
1
- :host{
2
- --accent-color:rgb(50, 50, 50);
3
- --grid-color:rgb(199, 199, 199);
4
- --pad-left-base: 33px;
5
- --row-num-width: 75px;
6
- --reg-font-size: 17px
7
- }
8
-
9
- input[name=topLevelDataFilter]{
10
- float: left;
11
- padding: 7px 5px;
12
- vertical-align: middle;
13
- box-shadow: 0 0 1px 1px var(--grid-color);
14
- -moz-box-shadow: 0 0 1px 1px var(--grid-color);
15
- -webkit-box-shadow: 0 0 1px 1px var(--grid-color);
16
- }
17
-
18
- .deebo-dd-contain-div{
19
- margin: 0 31px;
20
- }
21
-
22
- .btn-chart, .btn-clear-grp{
23
- border-radius: 3px;
24
- }
25
-
26
- .btn-chart i{
27
- font-size: 28px;
28
- vertical-align: middle;
29
- color: var(--accent-color);
30
- }
31
-
32
- .btn-chart:hover, .btn-clear-grp:hover{
33
- background: #e9e9e9;
34
- transition: background 0.5s ease;
35
- }
36
-
37
- .dt-checks{
38
- margin-left: var(--row-num-width);
39
- }
40
-
41
- .row-numbers{
42
- margin-top: 11px;
43
- display: inline-block;
44
- width: var(--row-num-width);
45
- }
46
-
47
- .row-num-header{
48
- background: #e9e9e9;
49
- box-sizing: border-box;
50
- border-bottom: 1px solid var(--accent-color);
51
- border-right: 1px solid var(--accent-color);
52
- box-shadow:0 -1px 3px 1px var(--grid-color);
53
- -moz-box-shadow:0 -1px 3px 1px var(--grid-color);
54
- -webkit-box-shadow:0 -1px 3px 1px var(--grid-color)
55
- }
56
-
57
- .num-row{
58
- white-space:nowrap;
59
- box-sizing:border-box;
60
- border-left: 1px solid var(--grid-color);
61
- border-bottom: 1px solid var(--grid-color);
62
- }
63
-
64
- .inline-table{
65
- display: inline-block;
66
- width: calc(100% - var(--row-num-width));
67
- }
68
-
69
- .special-edit-container{
70
- z-index: 5;
71
- height: 0 !important;
72
- }
73
-
74
- .edit-input{
75
- border: none;
76
- font-size: 15px;
77
- box-shadow:none;
78
- position: absolute;
79
- background: white;
80
- -moz-box-shadow:none;
81
- -webkit-box-shadow: none;
82
- box-sizing: border-box;
83
- }
84
-
85
- .edit-input[type=number]{
86
- text-align: right;
87
- }
88
-
89
- .edit-input[type=date]{
90
- padding-left: 17px;
91
- }