@sachin9822/reports-lib 0.0.211 → 0.0.213

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 (211) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +17 -0
  3. package/package.json +16 -31
  4. package/src/assets/images/BreadcrumbArrow.png +0 -0
  5. package/src/lib/assets/images/Search.svg +10 -0
  6. package/src/lib/assets/images/XMLogo.png +0 -0
  7. package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.html +27 -0
  8. package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.scss +46 -0
  9. package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.spec.ts +23 -0
  10. package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.ts +292 -0
  11. package/src/lib/components/accounting-report/accounting-report.component.html +64 -0
  12. package/src/lib/components/accounting-report/accounting-report.component.scss +24 -0
  13. package/src/lib/components/accounting-report/accounting-report.component.spec.ts +23 -0
  14. package/src/lib/components/accounting-report/accounting-report.component.ts +738 -0
  15. package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.html +46 -0
  16. package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.scss +2 -0
  17. package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.spec.ts +23 -0
  18. package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.ts +247 -0
  19. package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.html +46 -0
  20. package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.scss +3 -0
  21. package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.spec.ts +23 -0
  22. package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.ts +276 -0
  23. package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.html +51 -0
  24. package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.scss +7 -0
  25. package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.spec.ts +23 -0
  26. package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.ts +840 -0
  27. package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.html +68 -0
  28. package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.scss +65 -0
  29. package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.spec.ts +23 -0
  30. package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.ts +290 -0
  31. package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.html +25 -0
  32. package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.scss +1 -0
  33. package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.spec.ts +23 -0
  34. package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.ts +213 -0
  35. package/src/lib/components/funding-report/funding-report.component.html +49 -0
  36. package/src/lib/components/funding-report/funding-report.component.scss +1 -0
  37. package/src/lib/components/funding-report/funding-report.component.spec.ts +23 -0
  38. package/src/lib/components/funding-report/funding-report.component.ts +221 -0
  39. package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.html +26 -0
  40. package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.scss +1 -0
  41. package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.spec.ts +23 -0
  42. package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.ts +267 -0
  43. package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.html +95 -0
  44. package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.scss +54 -0
  45. package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.spec.ts +23 -0
  46. package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.ts +904 -0
  47. package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.html +49 -0
  48. package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.scss +2 -0
  49. package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.spec.ts +32 -0
  50. package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.ts +304 -0
  51. package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.html +46 -0
  52. package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.scss +7 -0
  53. package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.ts +343 -0
  54. package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.html +25 -0
  55. package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.scss +23 -0
  56. package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.spec.ts +23 -0
  57. package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.ts +745 -0
  58. package/src/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.ts +10 -0
  59. package/src/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.ts +20 -0
  60. package/src/lib/models/accounting-report/accounting-report-branch-group.ts +7 -0
  61. package/src/lib/models/accounting-report/accounting-report-entry-model.ts +25 -0
  62. package/src/lib/models/accounting-report/accounting-report-model.ts +7 -0
  63. package/{lib/models/accounting-report/accounting-report-sub-group.d.ts → src/lib/models/accounting-report/accounting-report-sub-group.ts} +3 -2
  64. package/{lib/models/app-config.model.d.ts → src/lib/models/app-config.model.ts} +8 -7
  65. package/src/lib/models/branch-activity-receive-report/branch-activity-receive.model.ts +18 -0
  66. package/src/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.ts +16 -0
  67. package/src/lib/models/branch-activity-report/branch-activity-send-report.ts +26 -0
  68. package/src/lib/models/cancellation-transaction-report/cancellation-transaction.model.ts +65 -0
  69. package/src/lib/models/component-loading-states.ts +5 -0
  70. package/src/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.ts +28 -0
  71. package/{lib/models/revenue-per-transaction-report/revenue-per-transaction.model.d.ts → src/lib/models/revenue-per-transaction-report/revenue-per-transaction.model.ts} +1 -1
  72. package/src/lib/models/statement-of-account-report/statement-of-accounts.model.ts +21 -0
  73. package/src/lib/models/transaction-enquiry-report/transaction-enquiry.model.ts +127 -0
  74. package/src/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.ts +16 -0
  75. package/src/lib/models/transaction-monitoring-report/transaction-monitoring-report.ts +29 -0
  76. package/src/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.ts +46 -0
  77. package/src/lib/reports-lib-routing.module.ts +20 -0
  78. package/src/lib/reports-lib.component.spec.ts +23 -0
  79. package/src/lib/reports-lib.component.ts +20 -0
  80. package/src/lib/reports-lib.module.ts +102 -0
  81. package/src/lib/reports-lib.service.spec.ts +16 -0
  82. package/src/lib/reports-lib.service.ts +9 -0
  83. package/src/lib/services/config.service.ts +43 -0
  84. package/src/lib/services/report.service.spec.ts +16 -0
  85. package/src/lib/services/report.service.ts +463 -0
  86. package/src/lib/shared/export-generic.service.ts +557 -0
  87. package/src/lib/shared/export.service.spec.ts +16 -0
  88. package/src/lib/shared/export.service.ts +457 -0
  89. package/src/lib/shared/loader/loader.component.html +8 -0
  90. package/src/lib/shared/loader/loader.component.scss +52 -0
  91. package/src/lib/shared/loader/loader.component.ts +10 -0
  92. package/src/lib/shared/metadata/metadata.component.html +42 -0
  93. package/src/lib/shared/metadata/metadata.component.scss +95 -0
  94. package/src/lib/shared/metadata/metadata.component.spec.ts +23 -0
  95. package/src/lib/shared/metadata/metadata.component.ts +38 -0
  96. package/src/lib/shared/page-size-selector/page-size-selector.component.html +7 -0
  97. package/src/lib/shared/page-size-selector/page-size-selector.component.scss +42 -0
  98. package/src/lib/shared/page-size-selector/page-size-selector.component.spec.ts +23 -0
  99. package/src/lib/shared/page-size-selector/page-size-selector.component.ts +38 -0
  100. package/src/lib/shared/search-filter/search-filter.component.html +601 -0
  101. package/src/lib/shared/search-filter/search-filter.component.scss +203 -0
  102. package/src/lib/shared/search-filter/search-filter.component.spec.ts +23 -0
  103. package/src/lib/shared/search-filter/search-filter.component.ts +2387 -0
  104. package/src/lib/shared/shared.module.ts +13 -0
  105. package/{public-api.d.ts → src/public-api.ts} +17 -7
  106. package/src/styles/ag-grid-report-style.scss +71 -0
  107. package/src/styles/common-ag-grid-style.scss +146 -0
  108. package/src/styles/common-report-style.scss +395 -0
  109. package/src/styles/common-style.scss +615 -0
  110. package/src/test.ts +27 -0
  111. package/tsconfig.lib.json +15 -0
  112. package/tsconfig.lib.prod.json +10 -0
  113. package/tsconfig.spec.json +17 -0
  114. package/esm2020/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.mjs +0 -240
  115. package/esm2020/lib/components/accounting-report/accounting-report.component.mjs +0 -596
  116. package/esm2020/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.mjs +0 -218
  117. package/esm2020/lib/components/branch-activity-send-report/branch-activity-send-report.component.mjs +0 -243
  118. package/esm2020/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.mjs +0 -700
  119. package/esm2020/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.mjs +0 -255
  120. package/esm2020/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.mjs +0 -192
  121. package/esm2020/lib/components/funding-report/funding-report.component.mjs +0 -198
  122. package/esm2020/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.mjs +0 -244
  123. package/esm2020/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.mjs +0 -776
  124. package/esm2020/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.mjs +0 -266
  125. package/esm2020/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.mjs +0 -311
  126. package/esm2020/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.mjs +0 -631
  127. package/esm2020/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.mjs +0 -2
  128. package/esm2020/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.mjs +0 -2
  129. package/esm2020/lib/models/accounting-report/accounting-report-branch-group.mjs +0 -2
  130. package/esm2020/lib/models/accounting-report/accounting-report-entry-model.mjs +0 -2
  131. package/esm2020/lib/models/accounting-report/accounting-report-model.mjs +0 -2
  132. package/esm2020/lib/models/accounting-report/accounting-report-sub-group.mjs +0 -2
  133. package/esm2020/lib/models/app-config.model.mjs +0 -2
  134. package/esm2020/lib/models/branch-activity-receive-report/branch-activity-receive.model.mjs +0 -2
  135. package/esm2020/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.mjs +0 -6
  136. package/esm2020/lib/models/branch-activity-report/branch-activity-send-report.mjs +0 -3
  137. package/esm2020/lib/models/cancellation-transaction-report/cancellation-transaction.model.mjs +0 -10
  138. package/esm2020/lib/models/component-loading-states.mjs +0 -7
  139. package/esm2020/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.mjs +0 -5
  140. package/esm2020/lib/models/revenue-per-transaction-report/revenue-per-transaction.model.mjs +0 -2
  141. package/esm2020/lib/models/statement-of-account-report/statement-of-accounts.model.mjs +0 -2
  142. package/esm2020/lib/models/transaction-enquiry-report/transaction-enquiry.model.mjs +0 -8
  143. package/esm2020/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.mjs +0 -6
  144. package/esm2020/lib/models/transaction-monitoring-report/transaction-monitoring-report.mjs +0 -5
  145. package/esm2020/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.mjs +0 -3
  146. package/esm2020/lib/reports-lib-routing.module.mjs +0 -24
  147. package/esm2020/lib/reports-lib.component.mjs +0 -22
  148. package/esm2020/lib/reports-lib.module.mjs +0 -172
  149. package/esm2020/lib/reports-lib.service.mjs +0 -14
  150. package/esm2020/lib/services/config.service.mjs +0 -39
  151. package/esm2020/lib/services/report.service.mjs +0 -374
  152. package/esm2020/lib/shared/export-generic.service.mjs +0 -443
  153. package/esm2020/lib/shared/export.service.mjs +0 -379
  154. package/esm2020/lib/shared/loader/loader.component.mjs +0 -11
  155. package/esm2020/lib/shared/metadata/metadata.component.mjs +0 -51
  156. package/esm2020/lib/shared/page-size-selector/page-size-selector.component.mjs +0 -44
  157. package/esm2020/lib/shared/search-filter/search-filter.component.mjs +0 -2134
  158. package/esm2020/lib/shared/shared.module.mjs +0 -21
  159. package/esm2020/public-api.mjs +0 -41
  160. package/esm2020/sachin9822-reports-lib.mjs +0 -5
  161. package/fesm2015/sachin9822-reports-lib.mjs +0 -8402
  162. package/fesm2015/sachin9822-reports-lib.mjs.map +0 -1
  163. package/fesm2020/sachin9822-reports-lib.mjs +0 -8384
  164. package/fesm2020/sachin9822-reports-lib.mjs.map +0 -1
  165. package/index.d.ts +0 -5
  166. package/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.d.ts +0 -70
  167. package/lib/components/accounting-report/accounting-report.component.d.ts +0 -76
  168. package/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.d.ts +0 -58
  169. package/lib/components/branch-activity-send-report/branch-activity-send-report.component.d.ts +0 -69
  170. package/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.d.ts +0 -78
  171. package/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.d.ts +0 -95
  172. package/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.d.ts +0 -55
  173. package/lib/components/funding-report/funding-report.component.d.ts +0 -55
  174. package/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.d.ts +0 -57
  175. package/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.d.ts +0 -109
  176. package/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.d.ts +0 -76
  177. package/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.d.ts +0 -68
  178. package/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.d.ts +0 -71
  179. package/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.d.ts +0 -8
  180. package/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.d.ts +0 -18
  181. package/lib/models/accounting-report/accounting-report-branch-group.d.ts +0 -6
  182. package/lib/models/accounting-report/accounting-report-entry-model.d.ts +0 -24
  183. package/lib/models/accounting-report/accounting-report-model.d.ts +0 -6
  184. package/lib/models/branch-activity-receive-report/branch-activity-receive.model.d.ts +0 -18
  185. package/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.d.ts +0 -13
  186. package/lib/models/branch-activity-report/branch-activity-send-report.d.ts +0 -24
  187. package/lib/models/cancellation-transaction-report/cancellation-transaction.model.d.ts +0 -44
  188. package/lib/models/component-loading-states.d.ts +0 -5
  189. package/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.d.ts +0 -26
  190. package/lib/models/statement-of-account-report/statement-of-accounts.model.d.ts +0 -18
  191. package/lib/models/transaction-enquiry-report/transaction-enquiry.model.d.ts +0 -113
  192. package/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.d.ts +0 -13
  193. package/lib/models/transaction-monitoring-report/transaction-monitoring-report.d.ts +0 -23
  194. package/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.d.ts +0 -38
  195. package/lib/reports-lib-routing.module.d.ts +0 -7
  196. package/lib/reports-lib.component.d.ts +0 -8
  197. package/lib/reports-lib.module.d.ts +0 -33
  198. package/lib/reports-lib.service.d.ts +0 -6
  199. package/lib/services/config.service.d.ts +0 -20
  200. package/lib/services/report.service.d.ts +0 -80
  201. package/lib/shared/export-generic.service.d.ts +0 -50
  202. package/lib/shared/export.service.d.ts +0 -32
  203. package/lib/shared/loader/loader.component.d.ts +0 -5
  204. package/lib/shared/metadata/metadata.component.d.ts +0 -24
  205. package/lib/shared/page-size-selector/page-size-selector.component.d.ts +0 -15
  206. package/lib/shared/search-filter/search-filter.component.d.ts +0 -127
  207. package/lib/shared/shared.module.d.ts +0 -11
  208. /package/{lib → src}/assets/images/Search.svg +0 -0
  209. /package/{lib/assets/images/XMLogo.png → src/assets/images/XMCoral.png} +0 -0
  210. /package/{lib → src/lib}/assets/config/app-config.json +0 -0
  211. /package/{lib → src/lib}/assets/svg-loaders/blue-tail-spin.svg +0 -0
@@ -0,0 +1,38 @@
1
+ import { Component, Input, OnInit, Output, EventEmitter} from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'lib-metadata',
5
+ templateUrl: './metadata.component.html',
6
+ styleUrls: ['./metadata.component.scss']
7
+ })
8
+ export class MetadataComponent implements OnInit {
9
+ @Input() metaDataOne:Record<string,string> ={};
10
+ @Input() metaDataTwo:Record<string,string> = {};
11
+ @Input()showmetaDataOne = true;
12
+ @Input()showmetaDataTwo = false;
13
+ @Input() reportName:string;
14
+ @Output() searchEvent = new EventEmitter<string>();
15
+ @Output() exportEvent = new EventEmitter<string>();
16
+ searchText:any = "";
17
+ exportFormats = [{formatName:"Excel",code:'excel'},{formatName:"PDF",code:'pdf'},{formatName:"CSV",code:'csv'}]
18
+ selectedExportOption = 'excel';
19
+ preserveOrder = (_a: any, _b: any): number => 0;
20
+ constructor() {
21
+
22
+ }
23
+
24
+ ngOnInit(): void {
25
+ console.log("Meta Data")
26
+ console.log(this.showmetaDataOne);
27
+ console.log(this.showmetaDataTwo);
28
+ }
29
+
30
+ onSearch(){
31
+ this.searchEvent.emit(this.searchText?.trim());
32
+ }
33
+
34
+ handleExport(){
35
+ this.exportEvent.emit(this.selectedExportOption);
36
+ }
37
+
38
+ }
@@ -0,0 +1,7 @@
1
+ <div class="d-flex align-items-center gap-2 entries-selecter-div">
2
+ <select class="form-select custom-height w-auto" id="pageSize" [(ngModel)]="selectedPageSizeOption"
3
+ (ngModelChange)="onPageSizeChanged($event)">
4
+ <option *ngFor="let size of pageSizeArray" [value]="size">{{ size }}</option>
5
+ </select>
6
+ <label class="entry-label" for="pageSize">Entries Per Page</label>
7
+ </div>
@@ -0,0 +1,42 @@
1
+ @import "bootstrap/scss/bootstrap";
2
+
3
+ .entries-selecter-div {
4
+ position: absolute !important;
5
+ left: 10px !important;
6
+ bottom: 5.5px !important;
7
+ z-index: 1 !important;
8
+ background: transparent !important;
9
+ padding-right: 10px !important;
10
+ align-items: center !important;
11
+ justify-content: center !important;
12
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
13
+ }
14
+
15
+ .entry-label {
16
+ font-weight: 600;
17
+ font-size: 11px !important;
18
+ margin: 0px !important;
19
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
20
+ align-items: center !important;
21
+ justify-content: center !important;
22
+ }
23
+
24
+ .form-select.custom-height {
25
+ height: 20px !important;
26
+ padding-top: 0px !important;
27
+ padding-bottom: 0px !important;
28
+ font-size: 11px !important;
29
+ line-height: 1 !important;
30
+ border-radius: 2px !important;
31
+ border: 1px solid #babfc7 !important;
32
+ }
33
+
34
+ .form-select.custom-height:focus {
35
+ outline: none !important;
36
+ box-shadow: none !important;
37
+ border-color: #babfc7 !important;
38
+ }
39
+
40
+ ::ng-deep .ag-paging-panel {
41
+ font-size: 11px !important;
42
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { PageSizeSelectorComponent } from './page-size-selector.component';
4
+
5
+ describe('PageSizeSelectorComponent', () => {
6
+ let component: PageSizeSelectorComponent;
7
+ let fixture: ComponentFixture<PageSizeSelectorComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ PageSizeSelectorComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(PageSizeSelectorComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,38 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'lib-page-size-selector',
5
+ templateUrl: './page-size-selector.component.html',
6
+ styleUrls: ['./page-size-selector.component.scss']
7
+ })
8
+ export class PageSizeSelectorComponent implements OnInit {
9
+
10
+ @Input() pageSizeArray: (number | string)[] = [10, 15, 20, 30, 50, 100, 200, 'All'];
11
+ @Input() defaultSize: string = '15';
12
+ @Input() totalEntries: number = 0;
13
+ @Input() gridApi: any;
14
+
15
+ selectedPageSizeOption: string = '15';
16
+
17
+ ngOnInit(): void {
18
+ this.selectedPageSizeOption = this.defaultSize;
19
+ this.applyPageSize(this.defaultSize);
20
+ }
21
+
22
+ onPageSizeChanged(value: string) {
23
+ this.selectedPageSizeOption = value;
24
+ this.applyPageSize(value);
25
+ }
26
+
27
+ private applyPageSize(value: string) {
28
+ const size = value === 'All' ? this.totalEntries : Number(value);
29
+ if (this.gridApi) {
30
+ this.gridApi.paginationSetPageSize(size);
31
+ }
32
+ }
33
+
34
+ ngOnDestroy(): void {
35
+ this.gridApi = undefined;
36
+ }
37
+
38
+ }