@annalib/anna-core 4.2.5 → 4.2.6

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 (147) hide show
  1. package/annalib-anna-core.d.ts +5 -0
  2. package/esm2020/annalib-anna-core.mjs +5 -0
  3. package/esm2020/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.mjs +15 -0
  4. package/esm2020/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.mjs +35 -0
  5. package/esm2020/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.mjs +15 -0
  6. package/esm2020/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.mjs +22 -0
  7. package/esm2020/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.mjs +15 -0
  8. package/esm2020/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.mjs +21 -0
  9. package/esm2020/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.mjs +15 -0
  10. package/esm2020/lib/anna-core-shared-lib/constants/shared.constant.mjs +34 -0
  11. package/esm2020/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.mjs +27 -0
  12. package/esm2020/lib/anna-core-shared-lib/models/anna-generic-data-type.model.mjs +2 -0
  13. package/esm2020/lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.mjs +2 -0
  14. package/esm2020/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.mjs +3 -0
  15. package/esm2020/lib/anna-core-shared-lib/models/anna-sort.model.mjs +2 -0
  16. package/esm2020/lib/anna-core-shared-lib/models/anna-tooltip.model.mjs +30 -0
  17. package/esm2020/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.mjs +26 -0
  18. package/esm2020/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.mjs +46 -0
  19. package/esm2020/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.mjs +25 -0
  20. package/esm2020/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.mjs +16 -0
  21. package/esm2020/lib/anna-core-shared-lib/services/anna-date-time-format.service.mjs +196 -0
  22. package/esm2020/lib/anna-core-shared-lib/services/anna-filter.service.mjs +426 -0
  23. package/esm2020/lib/anna-core-shared-lib/services/anna-generic-table.service.mjs +48 -0
  24. package/esm2020/lib/anna-core-shared-lib/services/anna-global-config.service.mjs +133 -0
  25. package/esm2020/lib/anna-core-shared-lib/services/anna-sort.service.mjs +147 -0
  26. package/esm2020/lib/anna-core.module.mjs +175 -0
  27. package/esm2020/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.mjs +100 -0
  28. package/esm2020/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.mjs +362 -0
  29. package/esm2020/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.mjs +1730 -0
  30. package/esm2020/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.mjs +67 -0
  31. package/esm2020/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.mjs +357 -0
  32. package/esm2020/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/anna-fixed-row-size-table-virtual-scroll-strategy.directive.mjs +189 -0
  33. package/esm2020/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.mjs +2 -0
  34. package/esm2020/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.mjs +178 -0
  35. package/esm2020/lib/anna-generic-table-lib/directives/anna-virtual-table/index.mjs +2 -0
  36. package/esm2020/public-api.mjs +47 -0
  37. package/fesm2015/annalib-anna-core.mjs +4308 -0
  38. package/fesm2015/annalib-anna-core.mjs.map +1 -0
  39. package/fesm2020/annalib-anna-core.mjs +4305 -0
  40. package/fesm2020/annalib-anna-core.mjs.map +1 -0
  41. package/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.d.ts +8 -0
  42. package/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.d.ts +16 -0
  43. package/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.d.ts +8 -0
  44. package/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.d.ts +11 -0
  45. package/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.d.ts +8 -0
  46. package/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.d.ts +11 -0
  47. package/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.d.ts +8 -0
  48. package/lib/anna-core-shared-lib/constants/shared.constant.d.ts +32 -0
  49. package/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.d.ts +9 -0
  50. package/lib/anna-core-shared-lib/models/anna-generic-data-type.model.d.ts +16 -0
  51. package/{src/lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.ts → lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.d.ts} +9 -21
  52. package/{src/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.ts → lib/anna-core-shared-lib/models/anna-non-editable-gt-models.d.ts} +17 -27
  53. package/lib/anna-core-shared-lib/models/anna-sort.model.d.ts +6 -0
  54. package/lib/anna-core-shared-lib/models/anna-tooltip.model.d.ts +25 -0
  55. package/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.d.ts +9 -0
  56. package/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.d.ts +9 -0
  57. package/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.d.ts +9 -0
  58. package/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.d.ts +7 -0
  59. package/lib/anna-core-shared-lib/services/anna-date-time-format.service.d.ts +27 -0
  60. package/lib/anna-core-shared-lib/services/anna-filter.service.d.ts +73 -0
  61. package/lib/anna-core-shared-lib/services/anna-generic-table.service.d.ts +14 -0
  62. package/lib/anna-core-shared-lib/services/anna-global-config.service.d.ts +21 -0
  63. package/lib/anna-core-shared-lib/services/anna-sort.service.d.ts +16 -0
  64. package/lib/anna-core.module.d.ts +35 -0
  65. package/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.d.ts +34 -0
  66. package/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.d.ts +70 -0
  67. package/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.d.ts +271 -0
  68. package/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.d.ts +17 -0
  69. package/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.d.ts +141 -0
  70. package/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/anna-fixed-row-size-table-virtual-scroll-strategy.directive.d.ts +89 -0
  71. package/{src/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.ts → lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.d.ts} +0 -0
  72. package/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.d.ts +45 -0
  73. package/{src/lib/anna-generic-table-lib/directives/anna-virtual-table/index.ts → lib/anna-generic-table-lib/directives/anna-virtual-table/index.d.ts} +0 -0
  74. package/package.json +38 -18
  75. package/{src/public-api.ts → public-api.d.ts} +0 -28
  76. package/.browserslistrc +0 -16
  77. package/karma.conf.js +0 -44
  78. package/ng-package.json +0 -14
  79. package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.html +0 -22
  80. package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.scss +0 -0
  81. package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.spec.ts +0 -25
  82. package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.ts +0 -16
  83. package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.html +0 -33
  84. package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.scss +0 -0
  85. package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.spec.ts +0 -25
  86. package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.ts +0 -28
  87. package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.html +0 -20
  88. package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.scss +0 -0
  89. package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.spec.ts +0 -25
  90. package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.ts +0 -16
  91. package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.html +0 -3
  92. package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.scss +0 -17
  93. package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.spec.ts +0 -24
  94. package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.ts +0 -20
  95. package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.html +0 -23
  96. package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.scss +0 -0
  97. package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.spec.ts +0 -25
  98. package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.ts +0 -16
  99. package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.html +0 -15
  100. package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.scss +0 -0
  101. package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.spec.ts +0 -25
  102. package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.ts +0 -19
  103. package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.html +0 -14
  104. package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.scss +0 -0
  105. package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.spec.ts +0 -25
  106. package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.ts +0 -16
  107. package/src/lib/anna-core-shared-lib/constants/shared.constant.ts +0 -34
  108. package/src/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.ts +0 -19
  109. package/src/lib/anna-core-shared-lib/models/anna-generic-data-type.model.ts +0 -19
  110. package/src/lib/anna-core-shared-lib/models/anna-sort.model.ts +0 -7
  111. package/src/lib/anna-core-shared-lib/models/anna-tooltip.model.ts +0 -44
  112. package/src/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.ts +0 -20
  113. package/src/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.ts +0 -43
  114. package/src/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.ts +0 -19
  115. package/src/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.ts +0 -12
  116. package/src/lib/anna-core-shared-lib/services/anna-date-time-format.service.ts +0 -216
  117. package/src/lib/anna-core-shared-lib/services/anna-filter.service.ts +0 -514
  118. package/src/lib/anna-core-shared-lib/services/anna-generic-table.service.ts +0 -44
  119. package/src/lib/anna-core-shared-lib/services/anna-global-config.service.ts +0 -170
  120. package/src/lib/anna-core-shared-lib/services/anna-sort.service.ts +0 -179
  121. package/src/lib/anna-core.module.ts +0 -110
  122. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.html +0 -46
  123. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.scss +0 -153
  124. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.spec.ts +0 -24
  125. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.ts +0 -106
  126. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.html +0 -129
  127. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.scss +0 -275
  128. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.spec.ts +0 -24
  129. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.ts +0 -412
  130. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.html +0 -926
  131. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.scss +0 -628
  132. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.spec.ts +0 -25
  133. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.ts +0 -2064
  134. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.html +0 -10
  135. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.scss +0 -1
  136. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.spec.ts +0 -24
  137. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.ts +0 -70
  138. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.html +0 -13
  139. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.scss +0 -88
  140. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.spec.ts +0 -25
  141. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.ts +0 -460
  142. package/src/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/anna-fixed-row-size-table-virtual-scroll-strategy.directive.ts +0 -237
  143. package/src/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.ts +0 -204
  144. package/src/test.ts +0 -27
  145. package/tsconfig.lib.json +0 -19
  146. package/tsconfig.lib.prod.json +0 -10
  147. package/tsconfig.spec.json +0 -17
@@ -1,19 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'anna-pay-for-performance-icon-template',
5
- templateUrl: './anna-pay-for-performance-icon-template.component.html',
6
- styleUrls: ['./anna-pay-for-performance-icon-template.component.scss'],
7
- changeDetection: ChangeDetectionStrategy.OnPush,
8
- })
9
- export class AnnaPayForPerformanceIconTemplateComponent implements OnInit {
10
-
11
- @Input() color: string;
12
- @Input() width: string;
13
- @Input() height: string;
14
- constructor() { }
15
-
16
- ngOnInit() {
17
- }
18
-
19
- }
@@ -1,14 +0,0 @@
1
- <ng-container [ngTemplateOutlet]="rejectedIcon"></ng-container>
2
-
3
- <ng-template #rejectedIcon>
4
- <svg width="15px" height="15px" viewBox="0 0 20 20">
5
- <g id="Buyer-rejected-icon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6
- <path
7
- d="M15.7822266,4.21777344 C14.3671875,2.80276367 12.4951465,2 10.5,2 C6.37918945,2 3,5.37253906 3,9.5 C3,13.6296289 6.37133789,17 10.5,17 C14.6105273,17 18,13.6429004 18,9.5 C18,7.50485352 17.1972656,5.6327832 15.7822266,4.21777344 Z M10.5,15.2128906 C7.34220703,15.2128906 4.78710938,12.664502 4.78710938,9.5 C4.78710938,8.26950195 5.17382812,7.10055664 5.88574219,6.13375977 L13.8662402,14.1054395 C12.8993848,14.8261719 11.730498,15.2128906 10.5,15.2128906 Z M15.1054688,12.8661816 L7.13375977,4.88574219 C8.10061523,4.17382813 9.26950195,3.78710938 10.5,3.78710938 C13.6578809,3.78710938 16.2128906,6.33549805 16.2128906,9.5 C16.2128906,10.7304395 15.8261719,11.8993848 15.1054688,12.8661816 Z"
8
- id="Shape"
9
- fill="#4A4A4A"
10
- fill-rule="nonzero"
11
- ></path>
12
- </g>
13
- </svg>
14
- </ng-template>
@@ -1,25 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { AnnaRejectedIconTemplateComponent } from './anna-rejected-icon-template.component';
3
-
4
-
5
- describe('RejectedIconTemplateComponent', () => {
6
- let component: AnnaRejectedIconTemplateComponent;
7
- let fixture: ComponentFixture<AnnaRejectedIconTemplateComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ AnnaRejectedIconTemplateComponent ]
12
- })
13
- .compileComponents();
14
- });
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(AnnaRejectedIconTemplateComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,16 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'anna-rejected-icon-template',
5
- templateUrl: './anna-rejected-icon-template.component.html',
6
- styleUrls: ['./anna-rejected-icon-template.component.scss'],
7
- changeDetection: ChangeDetectionStrategy.OnPush
8
- })
9
- export class AnnaRejectedIconTemplateComponent implements OnInit {
10
-
11
- constructor() { }
12
-
13
- ngOnInit(): void {
14
- }
15
-
16
- }
@@ -1,34 +0,0 @@
1
- export class Constants {
2
- static readonly SUCCESS_STRING = "success";
3
- static readonly BACKEND_SERVER_URL = "/server/public/index.php/api";
4
- static readonly ERROR_MSG = "Error occurred please try again.";
5
- static readonly NO_DATA_MSG = "No Data to display";
6
- static readonly SERVER_ERROR = "Server error. Please try Again";
7
- static readonly USER_ORIGIN = "ANNA";
8
- static readonly ACTIVE_USER_STATUS = "active";
9
- static readonly DELETED_USER_STATUS = "deleted";
10
- static readonly INACTIVE_USER_STATUS = "inactive";
11
- static readonly OGAdminRole = "OG-admin";
12
- static readonly dollars = "$";
13
- }
14
-
15
- export class ErrorCodes {
16
- static readonly BAD_REQUEST = 400;
17
- static readonly SERVER_ERROR = 500;
18
- static readonly SUCCESS_CODE = 200;
19
- static readonly SUCCESS_CODE_GET = 200;
20
- static readonly SUCCESS_CODE_POST = 201;
21
- static readonly SUCCESS_CODE_PATCH = 204;
22
- static readonly NO_CONTENT = 204;
23
- static readonly under_review = 409;
24
- }
25
-
26
- export enum Days {
27
- M = 1,
28
- Tu = 2,
29
- We = 3,
30
- Th = 4,
31
- F = 5,
32
- Sa = 6,
33
- Su = 7,
34
- }
@@ -1,19 +0,0 @@
1
- import { Directive, ElementRef, HostListener } from '@angular/core';
2
-
3
- @Directive({
4
- selector: '[showEllipsisTextOnHover]'
5
- })
6
-
7
- export class showEllipsisTextOnHoverDirective {
8
-
9
- constructor(private elementRef: ElementRef) {}
10
-
11
- @HostListener('mouseenter')
12
- onMouseEnter(): void {
13
- const element = this.elementRef.nativeElement;
14
- if (element.offsetWidth < element.scrollWidth) {
15
- element.title = element.textContent;
16
- }
17
- else if (element.title) element.removeAttribute('title');
18
- }
19
- }
@@ -1,19 +0,0 @@
1
- export interface WeekObject {
2
- startDate: string;
3
- endDate: string;
4
- }
5
-
6
- export interface SellerGroupHierarchy {
7
- inventoryCode: string;
8
- program: string;
9
- }
10
-
11
- export interface RatingSellerGroupHierarchy{
12
- InventoryCode: string;
13
- Program: string;
14
- }
15
- export interface GtColumnIconEmittedData{
16
- data: any;
17
- key: string;
18
- }
19
-
@@ -1,7 +0,0 @@
1
- export type SortType = "DEFAULT" | "ASC" | "DESC";
2
-
3
- export interface SortOption{
4
- sortType: SortType,
5
- isOptionActive: boolean,
6
- text: string
7
- }
@@ -1,44 +0,0 @@
1
- export class TooltipModel {
2
- isSelected: boolean;
3
- label: string;
4
- id: number;
5
- value: string;
6
-
7
- constructor(obj: string,id: number) {
8
- this.label = obj ? obj.toString() : null;
9
- this.value = obj;
10
- this.isSelected = false;
11
- this.id = id;
12
- }
13
- }
14
-
15
- export class tooltipModelForColumnLevelFiltering {
16
- isHidden;
17
- isSelected: boolean;
18
- data: string;
19
- constructor(data: string) {
20
- this.data = data;
21
- this.isSelected = true;
22
- this.isHidden = false;
23
- }
24
- }
25
-
26
- export class radioButtonModel {
27
- key: string;
28
- label: string;
29
- isSortRequired: boolean;
30
- isFilterRequired: boolean;
31
-
32
- constructor(key: string, value: string,sort: boolean, filter: boolean) {
33
- this.key = key;
34
- this.label = value;
35
- this.isSortRequired = sort;
36
- this.isFilterRequired = filter;
37
- }
38
- }
39
-
40
- export enum AllSelectedStatus {
41
- none = 0,
42
- allSelected = 1,
43
- fewSelected = 2,
44
- }
@@ -1,20 +0,0 @@
1
- import { Pipe, PipeTransform } from "@angular/core";
2
- import { memoize } from "lodash-es";
3
-
4
- @Pipe({
5
- name: "AnnaConvertZeroOrNullOrUndefined",
6
- })
7
- export class AnnaConvertZeroOrNullOrUndefinedPipe implements PipeTransform {
8
- transformer = memoize(this.replace, (...args) => this.replace(args[0], args[1]));
9
-
10
- transform(value:any, convertTo:any): number | string {
11
- return this.transformer(value, convertTo);
12
- }
13
-
14
- replace(value:any, convertTo:any): number | string {
15
- if (value === "undefined" || value === null || value === "" || Number(value) === 0) {
16
- return convertTo;
17
- }
18
- return value;
19
- }
20
- }
@@ -1,43 +0,0 @@
1
- import { Pipe, PipeTransform } from "@angular/core";
2
- import { memoize } from "lodash-es";
3
-
4
- @Pipe({
5
- name: "AnnafilterSearchedText",
6
- })
7
- export class AnnaFilterSearchedTextPipe implements PipeTransform {
8
- callFilter = memoize(this.filter, (...args) => this.filter(args[0], args[1], args[2]));
9
-
10
- transform(items: any[], searchText: any, keyName?: any): any[] {
11
- return this.callFilter(items, searchText, keyName);
12
- }
13
-
14
- filter(items: any[], searchText: string, keyName?: any): any[] {
15
- if (!items) return [];
16
- if (!searchText) return items;
17
- searchText = searchText.toString().toLowerCase();
18
-
19
-
20
- // if keyName is an array then loop through all the keynames
21
- if(typeof(keyName) == 'object'){
22
- let isFoundAtleastOnce = false;
23
- let isFound:any[];
24
-
25
- for(const key of keyName){
26
- isFound = items.filter((item) => item[key].toString().toLowerCase().includes(searchText));
27
- if(isFound.length){
28
- isFoundAtleastOnce = true;
29
- break;
30
- }
31
- }
32
- return isFoundAtleastOnce ? isFound : [];
33
- }
34
- else {
35
- //if keyName is undefined every key will be considered for filtering.
36
- if (!keyName)
37
- return items.filter(
38
- (item) => Object.values(item).filter((n) => n ? n.toString().toLowerCase().includes(searchText) : false).length > 0
39
- );
40
- return items.filter((item) => item[keyName].toString().toLowerCase().startsWith(searchText));
41
- }
42
- }
43
- }
@@ -1,19 +0,0 @@
1
- import { Pipe, PipeTransform } from "@angular/core";
2
- import { memoize } from "lodash-es";
3
-
4
- @Pipe({
5
- name: "annaReplaceChar",
6
- })
7
- export class AnnaReplaceCharPipe implements PipeTransform {
8
- converter = memoize(this.replace, (...args) => this.replace(args[0], args[1], args[2]));
9
-
10
- transform(value: string, charToBeReplaced: string, replaceBy: string): string {
11
- if (value !== undefined || value != null) {
12
- return this.converter(value, charToBeReplaced, replaceBy);
13
- }
14
- }
15
-
16
- replace(value: string, from: string, to: string): string {
17
- return value.replace(new RegExp(from, "g"), to);
18
- }
19
- }
@@ -1,12 +0,0 @@
1
- import {Pipe, PipeTransform} from '@angular/core';
2
-
3
- @Pipe({
4
- name: 'AnnatypeofData'
5
- })
6
- export class AnnaTypeofDataPipe implements PipeTransform {
7
-
8
- transform(value: any): any {
9
- return typeof value;
10
- }
11
-
12
- }
@@ -1,216 +0,0 @@
1
- // Angular import statements
2
- import { Injectable } from '@angular/core';
3
- import { NgbDate } from '@ng-bootstrap/ng-bootstrap';
4
-
5
- // Third party import statements
6
- import moment from "moment";
7
-
8
- // User defined import statements
9
- export type NgbDateType = { year: number, month: number, day: number };
10
-
11
- @Injectable({
12
- providedIn: 'root'
13
- })
14
- export class AnnaDateTimeFormatService {
15
-
16
- constructor() {
17
- console.log("AnnaDateTimeFormatService service created.")
18
- }
19
-
20
- convertToNgbDateStandardFormat(date: any): NgbDateType | NgbDate {
21
- return {
22
- year: parseInt(moment(date, "MM/DD/YYYY").format("YYYY")),
23
- month: parseInt(moment(date, "MM/DD/YYYY").format("M")),
24
- day: parseInt(moment(date, "MM/DD/YYYY").format("D")),
25
- };
26
- }
27
-
28
- convertToNgbDate(date: any, parseFormat: any): NgbDateType | NgbDate {
29
- return {
30
- year: parseInt(moment(date, parseFormat).format("YYYY")),
31
- month: parseInt(moment(date, parseFormat).format("M")),
32
- day: parseInt(moment(date, parseFormat).format("D")),
33
- };
34
- }
35
-
36
- formatToTwelveHrs(time: any, callRemoveZero: boolean) {
37
- if (time.endsWith('A') || time.endsWith('P')) {
38
- time = time.substring(0, time.length - 1);
39
- }
40
- let tmp = time.split(":");
41
- let formattedTime = [];
42
- if (+tmp[0] > 12) {
43
- formattedTime[0] = (+tmp[0] - 12).toString();
44
- if (+tmp[0] == 24) formattedTime[2] = "AM";
45
- else formattedTime[2] = "PM";
46
- } else if (tmp[0] == "12") {
47
- formattedTime[0] = tmp[0];
48
- formattedTime[2] = "PM";
49
- } else if (tmp[0] == "00") {
50
- formattedTime[0] = "12"
51
- formattedTime[2] = "AM";
52
- } else {
53
- formattedTime[0] = tmp[0];
54
- formattedTime[2] = "AM";
55
- }
56
- formattedTime[1] = tmp[1];
57
- if (callRemoveZero) formattedTime = this.removeZero(formattedTime);
58
- return formattedTime;
59
- }
60
-
61
- convertTotwentyFourHrsFormat(time: any, callAddZero: any) {
62
- let tmp = time.split(/[ :]+/);
63
- let formattedTime = [];
64
- if (tmp[0] != "12" && tmp[2] == "PM") {
65
- formattedTime[0] = (+tmp[0] + 12).toString();
66
- } else if (tmp[0] == "12" && tmp[2] == "AM") {
67
- formattedTime[0] = "00";
68
- } else formattedTime[0] = tmp[0].toString();
69
- formattedTime[1] = tmp[1].toString();
70
- if (callAddZero) formattedTime = this.addZero(formattedTime);
71
- return formattedTime;
72
- }
73
-
74
- removeZero(time: any) {
75
- let removedZero;
76
- let formattedTime = time;
77
- if (
78
- time[0] == "01" ||
79
- time[0] == "02" ||
80
- time[0] == "03" ||
81
- time[0] == "04" ||
82
- time[0] == "05" ||
83
- time[0] == "06" ||
84
- time[0] == "07" ||
85
- time[0] == "08" ||
86
- time[0] == "09"
87
- ) {
88
- removedZero = time[0].toString();
89
- formattedTime[0] = removedZero.charAt(1);
90
- formattedTime[1] = time[1];
91
- formattedTime[2] = time[2];
92
- }
93
- return formattedTime;
94
- }
95
-
96
- addZero(time: any) {
97
- let addedZero;
98
- let formattedTime = time;
99
- if (time[1] == "0") time[1] = "0" + time[1];
100
- if (
101
- time[0] == "0" ||
102
- time[0] == "1" ||
103
- time[0] == "2" ||
104
- time[0] == "3" ||
105
- time[0] == "4" ||
106
- time[0] == "5" ||
107
- time[0] == "6" ||
108
- time[0] == "7" ||
109
- time[0] == "8" ||
110
- time[0] == "9"
111
- ) {
112
- addedZero = "0" + time[0];
113
- formattedTime[0] = addedZero;
114
- formattedTime[1] = time[1];
115
- }
116
- return formattedTime;
117
- }
118
-
119
- sortByTimeAscending(a: any, b: any) {
120
- let format = "HH:mm:ss";
121
- a = moment(a, format);
122
- b = moment(b, format);
123
-
124
- let results;
125
-
126
- results = a.hours() > b.hours() ? 1 : a.hours() < b.hours() ? -1 : 0;
127
-
128
- if (results === 0) results = a.minutes() > b.minutes() ? 1 : a.minutes() < b.minutes() ? -1 : 0;
129
-
130
- if (results === 0) results = a.seconds() > b.seconds() ? 1 : a.seconds() < b.seconds() ? -1 : 0;
131
-
132
- return results;
133
- }
134
-
135
- sortByTimeDescending(a: any, b: any) {
136
- let format = "HH:mm:ss";
137
- a = moment(a, format);
138
- b = moment(b, format);
139
-
140
- let results;
141
-
142
- results = a.hours() < b.hours() ? 1 : a.hours() > b.hours() ? -1 : 0;
143
-
144
- if (results === 0) results = a.minutes() < b.minutes() ? 1 : a.minutes() > b.minutes() ? -1 : 0;
145
-
146
- if (results === 0) results = a.seconds() < b.seconds() ? 1 : a.seconds() > b.seconds() ? -1 : 0;
147
- return results;
148
- }
149
-
150
- convertNgbDateToMoment(ngbDate: NgbDate | NgbDateType): string {
151
- let converted = moment();
152
- converted.month(ngbDate.month - 1);
153
- converted.date(ngbDate.day);
154
- converted.year(ngbDate.year);
155
- return converted.format("MM/DD/YYYY");
156
- }
157
-
158
- compareDate(a: string, b: string, isAsc: boolean) {
159
- return isAsc ? moment(a).diff(b) : moment(b).diff(a);
160
- }
161
-
162
- public static formatTwentyFourHourTimeToHHMMAFormat(value: any): string {
163
- value = moment(value, ["HH:mm:ss"]).format("HH:mm:ss");
164
- return value[3] == "0" && value[4] == "0"
165
- ? moment(value, ["HH:mm:ss"]).format("hA").slice(0, -1)
166
- : moment(value, ["HH:mm:ss"]).format("h:mmA").slice(0, -1);
167
- }
168
-
169
- public static formatTwelveHourTimeToHHMMAFormat(value: any): string {
170
- value = moment(value, ["HH:mm:A"]).format("HH:mm:ss");
171
- return value[3] == "0" && value[4] == "0"
172
- ? moment(value, ["HH:mm:ss"]).format("hA").slice(0, -1)
173
- : moment(value, ["HH:mm:ss"]).format("h:mmA").slice(0, -1);
174
- }
175
-
176
- formatDateAndHHMMATimeToStandardFormat(dateAndTime: any) {
177
- let standardFormat, date, time;
178
- if (dateAndTime.includes("|")) {
179
- date = dateAndTime.slice(0, dateAndTime.indexOf("|"));
180
- time = dateAndTime.slice(dateAndTime.indexOf('|') + 1, dateAndTime.length).trim();
181
-
182
- time = time.slice(0, 2) + ":" + time.slice(2, 4) + " " + time.slice(4, 5);
183
- time = time + "M";
184
- standardFormat = date + time;
185
- }
186
- else {
187
- standardFormat = dateAndTime + " 00:00 AM"
188
- }
189
- return moment(standardFormat).format("MM/DD/YYYY hh:mm A");
190
- }
191
-
192
- compare(a: number | string, b: number | string, isAsc: boolean) {
193
- if(typeof a == 'string' && typeof b == 'string'){
194
- a = a.toLowerCase();
195
- b = b.toLowerCase();
196
- }
197
-
198
- return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
199
- }
200
-
201
- sortDataByBroadcastTimeAsc(firstParamTime: string, secondParamTime: string, broadcastTime: string) {
202
- let format = "HH:mm:ss";
203
-
204
- let a = moment(firstParamTime, format);
205
- let b = moment(secondParamTime, format);
206
-
207
- let broadcastMomentDateTime = moment(broadcastTime, "HH:mm:ss");
208
-
209
- a = a.isBefore(broadcastMomentDateTime) ? a.add(1, "d") : a;
210
- b = b.isBefore(broadcastMomentDateTime) ? b.add(1, "d") : b;
211
-
212
- let result = a.isBefore(b) ? -1 : a.isAfter(b) ? 1 : 0;
213
- return result;
214
- }
215
-
216
- }