angular-slickgrid 4.2.0 → 4.2.1

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 (232) hide show
  1. package/{dist/angular-slickgrid.d.ts → angular-slickgrid.d.ts} +0 -0
  2. package/{dist/app → app}/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +0 -0
  3. package/{dist/app → app}/modules/angular-slickgrid/constants.d.ts +0 -0
  4. package/{dist/app → app}/modules/angular-slickgrid/extensions/index.d.ts +0 -0
  5. package/{dist/app → app}/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -0
  6. package/{dist/app → app}/modules/angular-slickgrid/global-grid-options.d.ts +0 -0
  7. package/{dist/app → app}/modules/angular-slickgrid/index.d.ts +0 -0
  8. package/{dist/app → app}/modules/angular-slickgrid/models/angularComponentOutput.interface.d.ts +0 -0
  9. package/{dist/app → app}/modules/angular-slickgrid/models/angularGridInstance.interface.d.ts +0 -0
  10. package/{dist/app → app}/modules/angular-slickgrid/models/externalTestingDependencies.interface.d.ts +0 -0
  11. package/{dist/app → app}/modules/angular-slickgrid/models/gridOption.interface.d.ts +0 -0
  12. package/{dist/app → app}/modules/angular-slickgrid/models/index.d.ts +0 -0
  13. package/{dist/app → app}/modules/angular-slickgrid/models/rowDetailView.interface.d.ts +0 -0
  14. package/{dist/app → app}/modules/angular-slickgrid/models/slickGrid.interface.d.ts +0 -0
  15. package/{dist/app → app}/modules/angular-slickgrid/modules/angular-slickgrid.module.d.ts +0 -0
  16. package/{dist/app → app}/modules/angular-slickgrid/services/angularUtil.service.d.ts +0 -0
  17. package/{dist/app → app}/modules/angular-slickgrid/services/bsDropdown.service.d.ts +0 -0
  18. package/{dist/app → app}/modules/angular-slickgrid/services/container.service.d.ts +0 -0
  19. package/{dist/app → app}/modules/angular-slickgrid/services/index.d.ts +0 -0
  20. package/{dist/app → app}/modules/angular-slickgrid/services/translater.service.d.ts +0 -0
  21. package/{dist/app → app}/modules/angular-slickgrid/services/utilities.d.ts +0 -0
  22. package/{dist/app → app}/modules/angular-slickgrid/slickgrid-config.d.ts +0 -0
  23. package/docs/assets/lib/multiple-select/README.md +17 -0
  24. package/{dist/esm2020 → esm2020}/angular-slickgrid.mjs +0 -0
  25. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +0 -0
  26. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/constants.mjs +0 -0
  27. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/extensions/index.mjs +0 -0
  28. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +0 -0
  29. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/global-grid-options.mjs +0 -0
  30. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/index.mjs +0 -0
  31. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +0 -0
  32. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +0 -0
  33. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +0 -0
  34. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/gridOption.interface.mjs +0 -0
  35. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/index.mjs +0 -0
  36. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +0 -0
  37. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +0 -0
  38. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +0 -0
  39. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/angularUtil.service.mjs +0 -0
  40. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +0 -0
  41. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/container.service.mjs +0 -0
  42. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/index.mjs +0 -0
  43. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/translater.service.mjs +0 -0
  44. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/utilities.mjs +0 -0
  45. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/slickgrid-config.mjs +0 -0
  46. package/{dist/esm2020 → esm2020}/public_api.mjs +0 -0
  47. package/{dist/fesm2015 → fesm2015}/angular-slickgrid.mjs +0 -0
  48. package/{dist/fesm2015 → fesm2015}/angular-slickgrid.mjs.map +0 -0
  49. package/{dist/fesm2020 → fesm2020}/angular-slickgrid.mjs +0 -0
  50. package/{dist/fesm2020 → fesm2020}/angular-slickgrid.mjs.map +0 -0
  51. package/{dist/i18n → i18n}/en.json +0 -0
  52. package/{dist/i18n → i18n}/fr.json +0 -0
  53. package/package.json +25 -110
  54. package/{dist/public_api.d.ts → public_api.d.ts} +0 -0
  55. package/.browserslistrc +0 -12
  56. package/.codecov.yml +0 -17
  57. package/.editorconfig +0 -18
  58. package/.eslintrc.json +0 -50
  59. package/.github/CODE_OF_CONDUCT.md +0 -76
  60. package/.github/FUNDING.yml +0 -8
  61. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -54
  62. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  63. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -44
  64. package/.github/renovate.json5 +0 -26
  65. package/.github/stale.yml +0 -7
  66. package/.github/workflows/main.yml +0 -83
  67. package/.vscode/extensions.json +0 -9
  68. package/.vscode/launch.json +0 -72
  69. package/.vscode/settings.json +0 -7
  70. package/.vscode/tasks.json +0 -77
  71. package/CHANGELOG.md +0 -1172
  72. package/angular.json +0 -148
  73. package/dist/LICENSE +0 -20
  74. package/dist/README.md +0 -182
  75. package/dist/package.json +0 -79
  76. package/global.d.ts +0 -1
  77. package/ngcc.config.js +0 -13
  78. package/screenshots/column-picker.png +0 -0
  79. package/screenshots/composite-editor.png +0 -0
  80. package/screenshots/draggable-grouping.png +0 -0
  81. package/screenshots/editors.png +0 -0
  82. package/screenshots/export-to-file.png +0 -0
  83. package/screenshots/filter_and_sort.png +0 -0
  84. package/screenshots/formatters.png +0 -0
  85. package/screenshots/frozen.png +0 -0
  86. package/screenshots/multipleSelectFilter.png +0 -0
  87. package/screenshots/pagination.png +0 -0
  88. package/screenshots/selectFilter.png +0 -0
  89. package/screenshots/singleFilter.png +0 -0
  90. package/src/app/app-routing.module.ts +0 -83
  91. package/src/app/app.component.html +0 -160
  92. package/src/app/app.component.scss +0 -65
  93. package/src/app/app.component.ts +0 -10
  94. package/src/app/app.module.ts +0 -175
  95. package/src/app/examples/custom-angularComponentEditor.ts +0 -184
  96. package/src/app/examples/custom-angularComponentFilter.ts +0 -126
  97. package/src/app/examples/custom-inputEditor.ts +0 -124
  98. package/src/app/examples/custom-inputFilter.ts +0 -142
  99. package/src/app/examples/custom-titleFormatter.component.ts +0 -8
  100. package/src/app/examples/editor-ng-select.component.ts +0 -37
  101. package/src/app/examples/filter-ng-select.component.ts +0 -32
  102. package/src/app/examples/grid-additem.component.html +0 -48
  103. package/src/app/examples/grid-additem.component.ts +0 -272
  104. package/src/app/examples/grid-angular.component.html +0 -79
  105. package/src/app/examples/grid-angular.component.scss +0 -28
  106. package/src/app/examples/grid-angular.component.ts +0 -370
  107. package/src/app/examples/grid-autoheight.component.html +0 -52
  108. package/src/app/examples/grid-autoheight.component.ts +0 -147
  109. package/src/app/examples/grid-basic.component.html +0 -29
  110. package/src/app/examples/grid-basic.component.ts +0 -82
  111. package/src/app/examples/grid-clientside.component.html +0 -51
  112. package/src/app/examples/grid-clientside.component.ts +0 -293
  113. package/src/app/examples/grid-colspan.component.html +0 -39
  114. package/src/app/examples/grid-colspan.component.scss +0 -11
  115. package/src/app/examples/grid-colspan.component.ts +0 -155
  116. package/src/app/examples/grid-composite-editor.component.html +0 -79
  117. package/src/app/examples/grid-composite-editor.component.scss +0 -19
  118. package/src/app/examples/grid-composite-editor.component.ts +0 -948
  119. package/src/app/examples/grid-contextmenu.component.html +0 -62
  120. package/src/app/examples/grid-contextmenu.component.scss +0 -44
  121. package/src/app/examples/grid-contextmenu.component.ts +0 -473
  122. package/src/app/examples/grid-custom-tooltip.component.html +0 -25
  123. package/src/app/examples/grid-custom-tooltip.component.scss +0 -77
  124. package/src/app/examples/grid-custom-tooltip.component.ts +0 -483
  125. package/src/app/examples/grid-draggrouping.component.html +0 -93
  126. package/src/app/examples/grid-draggrouping.component.ts +0 -397
  127. package/src/app/examples/grid-editor.component.html +0 -88
  128. package/src/app/examples/grid-editor.component.ts +0 -699
  129. package/src/app/examples/grid-formatter.component.html +0 -26
  130. package/src/app/examples/grid-formatter.component.ts +0 -162
  131. package/src/app/examples/grid-frozen.component.html +0 -65
  132. package/src/app/examples/grid-frozen.component.scss +0 -11
  133. package/src/app/examples/grid-frozen.component.ts +0 -303
  134. package/src/app/examples/grid-graphql-nopage.component.html +0 -33
  135. package/src/app/examples/grid-graphql-nopage.component.scss +0 -9
  136. package/src/app/examples/grid-graphql-nopage.component.ts +0 -242
  137. package/src/app/examples/grid-graphql.component.html +0 -87
  138. package/src/app/examples/grid-graphql.component.ts +0 -304
  139. package/src/app/examples/grid-grouping.component.html +0 -80
  140. package/src/app/examples/grid-grouping.component.ts +0 -313
  141. package/src/app/examples/grid-headerbutton.component.html +0 -31
  142. package/src/app/examples/grid-headerbutton.component.scss +0 -10
  143. package/src/app/examples/grid-headerbutton.component.ts +0 -233
  144. package/src/app/examples/grid-headermenu.component.html +0 -31
  145. package/src/app/examples/grid-headermenu.component.scss +0 -25
  146. package/src/app/examples/grid-headermenu.component.ts +0 -159
  147. package/src/app/examples/grid-localization.component.html +0 -54
  148. package/src/app/examples/grid-localization.component.ts +0 -293
  149. package/src/app/examples/grid-menu.component.html +0 -37
  150. package/src/app/examples/grid-menu.component.scss +0 -28
  151. package/src/app/examples/grid-menu.component.ts +0 -229
  152. package/src/app/examples/grid-odata.component.html +0 -116
  153. package/src/app/examples/grid-odata.component.ts +0 -441
  154. package/src/app/examples/grid-range.component.html +0 -74
  155. package/src/app/examples/grid-range.component.ts +0 -291
  156. package/src/app/examples/grid-remote.component.html +0 -37
  157. package/src/app/examples/grid-remote.component.ts +0 -153
  158. package/src/app/examples/grid-resize-by-content.component.html +0 -62
  159. package/src/app/examples/grid-resize-by-content.component.scss +0 -19
  160. package/src/app/examples/grid-resize-by-content.component.ts +0 -780
  161. package/src/app/examples/grid-rowdetail.component.html +0 -35
  162. package/src/app/examples/grid-rowdetail.component.ts +0 -205
  163. package/src/app/examples/grid-rowmove.component.html +0 -49
  164. package/src/app/examples/grid-rowmove.component.ts +0 -234
  165. package/src/app/examples/grid-rowselection.component.html +0 -76
  166. package/src/app/examples/grid-rowselection.component.ts +0 -267
  167. package/src/app/examples/grid-state.component.html +0 -36
  168. package/src/app/examples/grid-state.component.ts +0 -259
  169. package/src/app/examples/grid-tabs.component.html +0 -35
  170. package/src/app/examples/grid-tabs.component.ts +0 -115
  171. package/src/app/examples/grid-trading.component.html +0 -58
  172. package/src/app/examples/grid-trading.component.scss +0 -49
  173. package/src/app/examples/grid-trading.component.ts +0 -319
  174. package/src/app/examples/grid-tree-data-hierarchical.component.html +0 -79
  175. package/src/app/examples/grid-tree-data-hierarchical.component.scss +0 -47
  176. package/src/app/examples/grid-tree-data-hierarchical.component.ts +0 -311
  177. package/src/app/examples/grid-tree-data-parent-child.component.html +0 -108
  178. package/src/app/examples/grid-tree-data-parent-child.component.scss +0 -10
  179. package/src/app/examples/grid-tree-data-parent-child.component.ts +0 -351
  180. package/src/app/examples/home.component.html +0 -41
  181. package/src/app/examples/home.component.ts +0 -9
  182. package/src/app/examples/rowdetail-preload.component.ts +0 -10
  183. package/src/app/examples/rowdetail-view.component.html +0 -36
  184. package/src/app/examples/rowdetail-view.component.ts +0 -54
  185. package/src/app/examples/swt-common-grid-pagination.component.ts +0 -156
  186. package/src/app/examples/swt-common-grid-test.component.html +0 -30
  187. package/src/app/examples/swt-common-grid-test.component.ts +0 -219
  188. package/src/app/examples/swt-common-grid.component.ts +0 -436
  189. package/src/app/examples/swt-logger.service.ts +0 -165
  190. package/src/app/modules/angular-slickgrid/components/angular-slickgrid.component.html +0 -4
  191. package/src/app/modules/angular-slickgrid/components/angular-slickgrid.component.ts +0 -1395
  192. package/src/app/modules/angular-slickgrid/constants.ts +0 -97
  193. package/src/app/modules/angular-slickgrid/extensions/index.ts +0 -1
  194. package/src/app/modules/angular-slickgrid/extensions/slickRowDetailView.ts +0 -375
  195. package/src/app/modules/angular-slickgrid/global-grid-options.ts +0 -245
  196. package/src/app/modules/angular-slickgrid/index.ts +0 -11
  197. package/src/app/modules/angular-slickgrid/models/angularComponentOutput.interface.ts +0 -6
  198. package/src/app/modules/angular-slickgrid/models/angularGridInstance.interface.ts +0 -68
  199. package/src/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.ts +0 -37
  200. package/src/app/modules/angular-slickgrid/models/gridOption.interface.ts +0 -12
  201. package/src/app/modules/angular-slickgrid/models/index.ts +0 -6
  202. package/src/app/modules/angular-slickgrid/models/rowDetailView.interface.ts +0 -33
  203. package/src/app/modules/angular-slickgrid/models/slickGrid.interface.ts +0 -7
  204. package/src/app/modules/angular-slickgrid/modules/angular-slickgrid.module.ts +0 -37
  205. package/src/app/modules/angular-slickgrid/services/angularUtil.service.ts +0 -48
  206. package/src/app/modules/angular-slickgrid/services/bsDropdown.service.ts +0 -142
  207. package/src/app/modules/angular-slickgrid/services/container.service.ts +0 -24
  208. package/src/app/modules/angular-slickgrid/services/index.ts +0 -5
  209. package/src/app/modules/angular-slickgrid/services/translater.service.ts +0 -38
  210. package/src/app/modules/angular-slickgrid/services/utilities.ts +0 -19
  211. package/src/app/modules/angular-slickgrid/slickgrid-config.ts +0 -10
  212. package/src/app/slickgrid-custom-variables.scss +0 -10
  213. package/src/assets/.gitkeep +0 -0
  214. package/src/assets/data/collection_100_numbers.json +0 -12
  215. package/src/assets/data/collection_500_numbers.json +0 -52
  216. package/src/assets/data/countries.json +0 -245
  217. package/src/assets/data/country_names.json +0 -245
  218. package/src/assets/data/customers_100.json +0 -102
  219. package/src/assets/i18n/en.json +0 -90
  220. package/src/assets/i18n/fr.json +0 -91
  221. package/src/environments/environment.prod.ts +0 -3
  222. package/src/environments/environment.ts +0 -8
  223. package/src/favicon.ico +0 -0
  224. package/src/index.html +0 -18
  225. package/src/main.ts +0 -13
  226. package/src/polyfills.ts +0 -52
  227. package/src/public_api.ts +0 -1
  228. package/src/styles.scss +0 -66
  229. package/src/typings.d.ts +0 -10
  230. package/tsconfig.app.json +0 -25
  231. package/tsconfig.json +0 -40
  232. package/tsconfig.spec.json +0 -23
@@ -1,30 +0,0 @@
1
- <div class="container-fluid" style="margin-top: 10px">
2
- <h2>
3
- <span [innerHTML]="title"></span>
4
- <span class="float-end">
5
- <a style="font-size: 18px"
6
- target="_blank"
7
- href="https://github.com/ghiscoding/Angular-Slickgrid/blob/master/src/app/examples/swt-common-grid-test.component.ts">
8
- <span class="fa fa-link"></span> code
9
- </a>
10
- </span>
11
- </h2>
12
- <div class="subtitle" [innerHTML]="subTitle"></div>
13
-
14
- <div class="row">
15
- <div class="col-sm-8">
16
- <div class="alert alert-info">
17
- <strong>Custom Pagination URL:</strong>
18
- <div [innerHTML]="currentUrl" data-test="query-string"></div>
19
- </div>
20
- </div>
21
- <div class="col-sm-4">
22
- <swt-common-grid-pagination #commonGridPag1></swt-common-grid-pagination>
23
- </div>
24
- </div>
25
- <swt-common-grid #commonGrid1
26
- (onFilterChanged)="filterChanged($event.detail)"
27
- (onPaginationChanged)="paginationChanged($event.detail)"
28
- (onSortChanged)="sortChanged($event.detail)">
29
- </swt-common-grid>
30
- </div>
@@ -1,219 +0,0 @@
1
- import {
2
- AfterViewInit,
3
- Component,
4
- ComponentFactoryResolver,
5
- OnInit,
6
- ViewChild,
7
- ViewContainerRef,
8
- } from '@angular/core';
9
- import { HttpClient } from '@angular/common/http';
10
-
11
- import { SwtCommonGridComponent } from './swt-common-grid.component';
12
- import { SwtCommonGridPaginationComponent } from './swt-common-grid-pagination.component';
13
- import { FilterChangedArgs, PaginationChangedArgs } from '../modules/angular-slickgrid';
14
-
15
- import { Logger } from './swt-logger.service';
16
- /**
17
- * Main test Component
18
- *
19
- * @author Saber Chebka, saber.chebka@gmail.com
20
- */
21
- @Component({
22
- selector: 'swt-common-grid-test',
23
- templateUrl: './swt-common-grid-test.component.html'
24
- })
25
- export class SwtCommonGridTestComponent implements OnInit, AfterViewInit {
26
- title = 'Example 13: Custom Backend Server Pagination';
27
- subTitle = `A simple component to show that it is possible to create a custom Backend Service for any other backend querying, the example below is for Oracle.`;
28
- componentFactory: any;
29
- testurl = 'http://127.0.0.1:8080/grid!display.do?';
30
- currentUrl = this.testurl;
31
-
32
- @ViewChild('commonGrid1', { static: true }) commonGrid!: SwtCommonGridComponent;
33
- @ViewChild('commonGridPag1', { static: true }) commonGridPag!: SwtCommonGridPaginationComponent;
34
-
35
- private logger: Logger;
36
-
37
- constructor(private httpClient: HttpClient,
38
- private viewContainerRef: ViewContainerRef,
39
- private componentFactoryResolver: ComponentFactoryResolver) {
40
- this.logger = new Logger('test', undefined);
41
-
42
- }
43
-
44
- ngOnInit() {
45
- // Link pagination component into the current Grid
46
- if (this.commonGridPag) {
47
- this.commonGrid.paginationComponent = this.commonGridPag;
48
- }
49
-
50
- }
51
-
52
- ngAfterViewInit() {
53
- this.logger.info('method [ngAfterViewInit] - START');
54
-
55
- setTimeout(() => {
56
- // Init datagrid example:
57
- this.commonGridPag.processing = true;
58
-
59
- // Real HTTP call
60
- this.currentUrl = this.testurl + '&currentPage=1';
61
- /*
62
- this.httpClient.get(this.currentUrl).subscribe(
63
- (data: any) => {
64
- this.commonGrid.CustomGrid(data.suspectManagement.grid.metadata);
65
- this.commonGrid.gridData = data.suspectManagement.grid.rows;
66
- this.commonGridPag.pageCount = data.suspectManagement.singletons.maxpage;
67
- this.commonGridPag.processing = false;
68
- }
69
- );
70
- */
71
- this.commonGrid.CustomGrid(data_sample.pagination_samples.grid.metadata);
72
- this.commonGrid.gridData = data_sample.pagination_samples.grid.rows;
73
- this.commonGridPag.pageCount = data_sample.pagination_samples.grid.rows.maxpage;
74
-
75
- this.commonGridPag.processing = false;
76
- }, 0);
77
- this.logger.info('method [ngAfterViewInit] - END');
78
- }
79
-
80
- filterChanged(event: FilterChangedArgs) {
81
- this.commonGridPag.processing = true;
82
- this.updateGridData();
83
- }
84
-
85
- paginationChanged(event: PaginationChangedArgs) {
86
- this.commonGridPag.processing = true;
87
- this.updateGridData();
88
- }
89
-
90
- sortChanged(event: any) {
91
- this.commonGridPag.processing = true;
92
- this.updateGridData();
93
- }
94
-
95
-
96
- updateGridData() {
97
- this.currentUrl = this.testurl + '&currentPage=' + this.commonGrid.currentPage + '&selectedSort=' + this.commonGrid.sortedGridColumn + '&selectedFilter=' + this.commonGrid.filteredGridColumns;
98
- // Real HTTP call
99
- /*this.httpClient.get(this.currentUrl).subscribe(
100
- (data: any) => {
101
- this.commonGrid.gridData = data.suspectManagement?data.suspectManagement.grid.rows:[];
102
- this.commonGridPag.pageCount = data.suspectManagement?data.suspectManagement.singletons.maxpage:1;
103
- this.commonGridPag.processing = false;
104
- }
105
- );*/
106
- setTimeout(() => {
107
- this.commonGrid.gridData = data_sample.pagination_samples.grid.rows;
108
- this.commonGridPag.pageCount = data_sample.pagination_samples.grid.rows.maxpage;
109
- }, 750);
110
- }
111
- }
112
-
113
-
114
- export const data_sample = {
115
- 'pagination_samples': {
116
- 'grid': {
117
- 'metadata': {
118
- 'columns': {
119
- 'column': [{
120
- 'sort': true,
121
- 'filterable': false,
122
- 'width': 60,
123
- 'dataelement': 'hasNote',
124
- 'heading': 'Note'
125
- },
126
- {
127
- 'sort': true,
128
- 'filterable': true,
129
- 'width': 125,
130
- 'dataelement': 'status',
131
- 'heading': 'Status'
132
- },
133
- {
134
- 'sort': true,
135
- 'visible': true,
136
- 'filterable': true,
137
- 'width': 125,
138
- 'dataelement': 'currency',
139
- 'heading': 'Currency'
140
- },
141
- {
142
- 'sort': true,
143
- 'visible': true,
144
- 'filterable': true,
145
- 'width': 125,
146
- 'dataelement': 'amount',
147
- 'heading': 'Amount'
148
- },
149
- {
150
- 'sort': true,
151
- 'visible': true,
152
- 'filterable': true,
153
- 'width': 125,
154
- 'dataelement': 'inputDate',
155
- 'heading': 'Input Date'
156
- },
157
- {
158
- 'sort': true,
159
- 'visible': true,
160
- 'filterable': true,
161
- 'width': 125,
162
- 'dataelement': 'inputTime',
163
- 'heading': 'Input Time'
164
- }]
165
- }
166
- },
167
- 'rows': {
168
- 'row': [{
169
- 'currency': {
170
- 'content': 'EUR'
171
- },
172
- 'amount': {
173
- 'content': '2 203 677,000'
174
- },
175
- 'startTime': {
176
- 'content': '06/19/2017 11:52:51'
177
- },
178
- 'inputDate': {
179
- 'content': '06/19/2017'
180
- },
181
- 'status': {
182
- 'content': 'New'
183
- },
184
- 'inputTime': {
185
- 'content': '11:52:51'
186
- },
187
- 'hasNote': {
188
- 'content': 'False'
189
- }
190
- },
191
- {
192
- 'currency': {
193
- 'content': 'USD'
194
- },
195
- 'amount': {
196
- 'content': '6 203 677,000'
197
- },
198
- 'startTime': {
199
- 'content': '06/28/2017 10:42:00'
200
- },
201
- 'inputDate': {
202
- 'content': '06/28/2017'
203
- },
204
- 'status': {
205
- 'content': 'New'
206
- },
207
- 'inputTime': {
208
- 'content': '10:40:12'
209
- },
210
- 'hasNote': {
211
- 'content': 'True'
212
- }
213
- }
214
- ],
215
- 'maxpage': 5
216
- }
217
- }
218
- }
219
- };
@@ -1,436 +0,0 @@
1
- import { Component, OnInit, AfterViewInit, Input, EventEmitter, Output, ViewChild, ElementRef, Renderer2 } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import {
4
- AngularGridInstance,
5
- AngularSlickgridComponent, Column, FieldType,
6
- GridOption, BackendService,
7
- BackendServiceOption, FilterChangedArgs, PaginationChangedArgs, Pagination, SlickGrid, SlickDataView
8
- } from '../modules/angular-slickgrid';
9
- import { TranslateService } from '@ngx-translate/core';
10
- import { Logger } from './swt-logger.service';
11
- import { SwtCommonGridPaginationComponent } from './swt-common-grid-pagination.component';
12
-
13
- /**
14
- * Custom wrapper of angular-slickgrid components, allows easily interacting with SwtCommonGridPaginationComponent
15
- *
16
- * @author Saber Chebka, saber.chebka@gmail.com
17
- */
18
-
19
- let timer: any;
20
- const DEFAULT_FILTER_TYPING_DEBOUNCE = 750;
21
-
22
- @Component({
23
- selector: 'swt-common-grid',
24
- template: `<angular-slickgrid gridId='common-grid'
25
- #angularSlickGrid
26
- (onAngularGridCreated)="gridReady($event.detail)"
27
- [columnDefinitions]="columnDefinitions"
28
- [gridOptions]="gridOptions"
29
- [dataset]="dataset">
30
- </angular-slickgrid>`,
31
- styles: [`
32
- :host ::ng-deep .gridPane{
33
- width: 100%!important;
34
- }
35
- :host ::ng-deep .slickgrid-container{
36
- width: 100%!important;
37
- }
38
- `]
39
- })
40
- export class SwtCommonGridComponent implements OnInit, AfterViewInit, BackendService {
41
-
42
- private logger: Logger;
43
- private defaultPageSize = 20;
44
-
45
- @Input() gridHeight = 100;
46
- @Input() gridWidth = 600;
47
-
48
- gridHeightString!: string;
49
- gridWidthString!: string;
50
-
51
- @ViewChild('angularSlickGrid', { static: true }) angularSlickGrid!: AngularSlickgridComponent;
52
-
53
- columnDefinitions: Column[] = [];
54
- dataset!: any[];
55
- gridObj: any;
56
- dataviewObj: any;
57
- isAutoEdit = false;
58
- updatedObject: any;
59
- isMultiSelect = true;
60
- selectedObjects!: any[];
61
- selectedObject: any;
62
-
63
- // Slick grid
64
- metaData: any;
65
- columnData: any;
66
- rowsData: any;
67
- selects: any;
68
- id: any;
69
-
70
- options!: BackendServiceOption;
71
- pagination?: Pagination;
72
-
73
- @Output() onFilterChanged: EventEmitter<FilterChangedArgs> = new EventEmitter<FilterChangedArgs>();
74
- @Output() onPaginationChanged: EventEmitter<PaginationChangedArgs> = new EventEmitter<PaginationChangedArgs>();
75
- @Output() onSortChanged: EventEmitter<any> = new EventEmitter<any>();
76
-
77
- sortedGridColumn = '';
78
- currentPage = 1;
79
- filteredGridColumns = '';
80
-
81
- // Data
82
-
83
-
84
- // Injected functions
85
- private _onRowDoubleClick: Function = new Function();
86
- private _onRowClick: Function = new Function();
87
-
88
-
89
- private _selectedRow: any;
90
-
91
-
92
- gridOptions: GridOption = {
93
- asyncEditorLoading: false,
94
- autoEdit: this.isAutoEdit,
95
- autoResize: {
96
- container: '#common-grid-container',
97
- rightPadding: 10
98
- },
99
- gridHeight: 200,
100
- enableColumnPicker: true,
101
- enableCellNavigation: true,
102
- enableRowSelection: true,
103
- enableCheckboxSelector: false,
104
- enableFiltering: true,
105
- rowHeight: 23,
106
- forceFitColumns: true,
107
- enableAutoTooltip: true,
108
- enableGridMenu: true,
109
- enablePagination: false
110
- };
111
-
112
- // Initialized to a fake pagination object
113
- private _paginationComponent: any = {
114
- processing: false,
115
- realPagination: false
116
- };
117
-
118
- @Input()
119
- set paginationComponent(value: SwtCommonGridPaginationComponent) {
120
- this.logger!.info('method [pagination] - START, assigned datagrid pagination object: ', value.realPagination);
121
- if (value.realPagination) {
122
- this._paginationComponent = value;
123
- this.gridOptions.backendServiceApi = {
124
- service: this,
125
- preProcess: () => { },
126
- process: () => {
127
- return null;
128
- },
129
- postProcess: () => { }
130
- } as any;
131
- this._paginationComponent.gridPaginationOptions = this.gridOptions;
132
- this.angularSlickGrid.createBackendApiInternalPostProcessCallback(this.gridOptions);
133
- }
134
- this.logger!.info('method [pagination] - START');
135
- }
136
-
137
- get paginationComponent(): SwtCommonGridPaginationComponent {
138
- return this._paginationComponent;
139
- }
140
-
141
- /**
142
- *
143
- * @param gridService
144
- * @param resizer
145
- * @param httpClient
146
- */
147
- constructor(private httpClient: HttpClient, private translate: TranslateService,
148
- private el: ElementRef, private renderer: Renderer2) {
149
- this.logger = new Logger('grid', httpClient);
150
-
151
- this.logger.info('method [constructor] - START/END');
152
- }
153
-
154
-
155
-
156
- /**
157
- *
158
- */
159
- ngOnInit() {
160
- this.logger.info('method [ngOnInit] - START/END');
161
- // this.gridHeightString = `${this.gridHeight}px`;
162
- // this.gridWidthString = `${this.gridWidth}px`;
163
- }
164
-
165
-
166
- /**
167
- *
168
- */
169
- ngAfterViewInit() {
170
- this.logger.info('method [ngAfterViewInit] - START/END');
171
- }
172
-
173
- /**
174
- * CustomGrid constructor
175
- * @param columnData
176
- */
177
- CustomGrid(columnData: any) {
178
- this.logger.info('method [CustomGrid] - START');
179
-
180
- this.id = 'grid' + Math.floor(Math.random() * Math.floor(100));
181
-
182
- // get metadata from input JSON
183
- this.metaData = columnData;
184
-
185
- // COLUMNS DATA
186
- const rowData: any = [];
187
-
188
- // check if allcolumns tag contains any children
189
- if (this.metaData.columns.column) {
190
-
191
- // set columnsData and columnDefinitions
192
- this.columnData = this.metaData.columns.column;
193
-
194
- for (let index = 0; index < this.columnData.length; index++) {
195
-
196
- const type = FieldType.string;
197
- const editor = null;
198
- const formatter = null;
199
- const filter = null;
200
- const outputType = null;
201
- const params = null;
202
-
203
- const col: any = {
204
- id: this.columnData[index].dataelement,
205
- name: this.columnData[index].heading,
206
- field: this.columnData[index].dataelement,
207
- sortable: this.columnData[index].sort,
208
- filterable: this.columnData[index].filterable,
209
- type,
210
- editor,
211
- formatter,
212
- filter,
213
- outputType,
214
- params,
215
- width: this.columnData[index].width
216
- };
217
-
218
- this.columnDefinitions.push(col);
219
- rowData[col.id] = '';
220
- }
221
-
222
- // Columns are not visible, seems to be a bug ? next line fixed it..
223
- this.gridObj.setColumns(this.columnDefinitions);
224
- this.angularSlickGrid.showPagination = false;
225
-
226
- // Show filters when grid starts; this could be parametrized
227
- // this.gridObj.setHeaderRowVisibility(false);
228
- // this.gridObj.setTopPanelVisibility(false);
229
- }
230
-
231
- // Dummy dataset
232
- this.dataset = rowData;
233
-
234
- this.logger.info('method [CustomGrid] - END, this.columnDefinitions=', this.columnDefinitions);
235
- }
236
-
237
- /**
238
- * CommonGrid constructor
239
- * @param columnsData
240
- * @param lockedColumnCount
241
- * @param uniqueColumn
242
- * @param baseURL
243
- * @param programId
244
- * @param componentId
245
- * @param enableRenders
246
- * @param colValidationMap
247
- * @param checkHeader
248
- * @param cboLinked
249
- */
250
- CommonGrid(columnsData: any, lockedColumnCount: number, uniqueColumn: string, baseURL: string, programId: string, componentId: string, enableRenders: boolean = true, colValidationMap: any = null, checkHeader: boolean = false, cboLinked: boolean = false) {
251
- }
252
-
253
-
254
- set gridData(rawData: any) {
255
- this.logger.info('method [gridData] - START');
256
- const dataProvider: any = [];
257
-
258
- for (let index = 0; rawData.row && index < rawData.row.length; index++) {
259
- const row = <Object>rawData.row[index];
260
- const idObj = {
261
- id: index
262
- };
263
-
264
- let key: string;
265
- const rowData: any = [];
266
- for (key in row) {
267
- if (row.hasOwnProperty(key)) {
268
- rowData[key] = (row as any)[key].content;
269
- }
270
- }
271
- dataProvider[index] = Object.assign(rowData, idObj);
272
- }
273
-
274
- this.dataset = dataProvider;
275
- this.paginationComponent.processing = false;
276
- this.logger.info('method [gridData] - END, all data size=' + (rawData && rawData.hasOwnProperty('size') ? rawData.size : 0));
277
-
278
- // this.gridObj.setSortColumn('excludeType', true);
279
- // this.dataviewObj.reSort();
280
- // this.gridObj.setSortColumns([{'columnId':'excludeType','sortAsc':true}]);
281
-
282
- // this.gridObj.invalidate();
283
- // this.gridObj.render();
284
- }
285
-
286
- get gridData(): any {
287
- return this.dataset;
288
- }
289
-
290
- gridReady(instance: AngularGridInstance) {
291
- this.logger.info('method [gridReady] - START');
292
- this.gridObj = instance.slickGrid;
293
- this.dataviewObj = instance.dataView;
294
- this.logger.info('method [gridReady] - END');
295
- }
296
-
297
- dataviewReady(dataview: SlickDataView) {
298
- this.logger.info('method [dataviewReady] - START/END', dataview);
299
- this.dataviewObj = dataview;
300
- }
301
-
302
-
303
-
304
-
305
- /********************************************************/
306
- /******** Pagination+Sot+Filter service : START *********/
307
- /********************************************************/
308
- buildQuery(): string {
309
- return 'buildQuery...';
310
- }
311
-
312
- init(serviceOptions: BackendServiceOption, pagination?: Pagination): void {
313
- this.options = serviceOptions;
314
- this.pagination = pagination;
315
- }
316
-
317
-
318
- resetPaginationOptions() {
319
-
320
- }
321
-
322
- updateOptions(serviceOptions?: Partial<BackendServiceOption>) {
323
- this.options = { ...this.options, ...serviceOptions };
324
- }
325
-
326
-
327
- /**
328
- * FILTERING EMIT EVENT
329
- * @param event
330
- * @param args
331
- */
332
- processOnFilterChanged(event: Event | undefined, args: FilterChangedArgs): string {
333
- this.logger.info('method [onFilterChanged] - START', args);
334
- this.filteredGridColumns = '';
335
- let timing = 0;
336
- if (event && (event.type === 'keyup' || event.type === 'keydown')) {
337
- timing = DEFAULT_FILTER_TYPING_DEBOUNCE;
338
- clearTimeout(timer);
339
- }
340
- timer = setTimeout(() => {
341
- this.filteredGridColumns = '';
342
- for (let idx = 0; idx < this.columnDefinitions.length; idx++) {
343
- if (args.columnFilters.hasOwnProperty(this.columnDefinitions[idx].field)) {
344
- this.filteredGridColumns += args.columnFilters[this.columnDefinitions[idx].field].searchTerms[0] + '|';
345
- } else {
346
- this.filteredGridColumns += 'All|';
347
- }
348
- }
349
-
350
- // Reset to the first page
351
- this.paginationComponent.pageNumber = 1;
352
- this.currentPage = 1;
353
-
354
- // dispatch event
355
- this.onFilterChanged.emit(args);
356
- this.logger.info('method [onFilterChanged] - onFilterChanged.emit(args) performed, filteredGridColumns=' + this.filteredGridColumns);
357
- }, timing);
358
-
359
- this.logger.info('method [onFilterChanged] - END');
360
- return '';
361
- }
362
-
363
-
364
- /**
365
- * PAGINATION EMIT EVENT
366
- * @param event
367
- * @param args
368
- */
369
- processOnPaginationChanged(event: Event | undefined, args: PaginationChangedArgs) {
370
- this.logger.info('method [onPaginationChanged] - START');
371
- this.currentPage = args.newPage;
372
- this.onPaginationChanged.emit(args);
373
- this.logger.info('method [onPaginationChanged] - END, currentPage=' + this.currentPage);
374
- return 'onPaginationChanged';
375
- }
376
-
377
- /**
378
- * SORT EMIT EVENT
379
- * @param event
380
- * @param args
381
- */
382
- processOnSortChanged(event: Event | undefined, args: any) {
383
- this.logger.info('method [onSortChanged] - START');
384
- this.sortedGridColumn = '';
385
- const sortDirection = '|' + args!.sortCols![0].sortAsc + '|';
386
- for (let idx = 0; idx < this.columnDefinitions.length; idx++) {
387
- if (this.columnDefinitions[idx].field === args!.sortCols![0].sortCol.field) {
388
- this.sortedGridColumn = '' + idx + sortDirection;
389
- }
390
- }
391
- this.onSortChanged.emit(args);
392
- this.logger.info('method [onSortChanged] - END, sortedGridColumn=' + this.sortedGridColumn);
393
- return 'onSortChanged';
394
- }
395
-
396
-
397
-
398
- getFilteredGridColumns() {
399
- return this.filteredGridColumns;
400
- }
401
-
402
- getSortedGridColumn() {
403
- return this.sortedGridColumn;
404
- }
405
-
406
- /******** Pagination+Sot+Filter service: END *****************/
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
- // Getters and Setters
415
- get selectedRow() {
416
- return this._selectedRow;
417
- }
418
- set selectedRow(row: any) {
419
- this._selectedRow = row;
420
- }
421
-
422
- get onRowDoubleClick() {
423
- return this._onRowDoubleClick;
424
- }
425
- set onRowDoubleClick(event: Function) {
426
- this._onRowDoubleClick = event;
427
- }
428
-
429
- get onRowClick() {
430
- return this._onRowClick;
431
- }
432
- set onRowClick(event: Function) {
433
- this._onRowClick = event;
434
- }
435
-
436
- }