@annalib/anna-core 4.2.3 → 4.2.5

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/.browserslistrc +16 -0
  2. package/karma.conf.js +44 -0
  3. package/ng-package.json +14 -0
  4. package/package.json +18 -38
  5. package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.html +22 -0
  6. package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.scss +0 -0
  7. package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.spec.ts +25 -0
  8. package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.ts +16 -0
  9. package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.html +33 -0
  10. package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.scss +0 -0
  11. package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.spec.ts +25 -0
  12. package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.ts +28 -0
  13. package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.html +20 -0
  14. package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.scss +0 -0
  15. package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.spec.ts +25 -0
  16. package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.ts +16 -0
  17. package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.html +3 -0
  18. package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.scss +17 -0
  19. package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.spec.ts +24 -0
  20. package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.ts +20 -0
  21. package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.html +23 -0
  22. package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.scss +0 -0
  23. package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.spec.ts +25 -0
  24. package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.ts +16 -0
  25. package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.html +15 -0
  26. package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.scss +0 -0
  27. package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.spec.ts +25 -0
  28. package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.ts +19 -0
  29. package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.html +14 -0
  30. package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.scss +0 -0
  31. package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.spec.ts +25 -0
  32. package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.ts +16 -0
  33. package/src/lib/anna-core-shared-lib/constants/shared.constant.ts +34 -0
  34. package/src/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.ts +19 -0
  35. package/src/lib/anna-core-shared-lib/models/anna-generic-data-type.model.ts +19 -0
  36. package/{lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.d.ts → src/lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.ts} +21 -9
  37. package/{lib/anna-core-shared-lib/models/anna-non-editable-gt-models.d.ts → src/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.ts} +27 -17
  38. package/src/lib/anna-core-shared-lib/models/anna-sort.model.ts +7 -0
  39. package/src/lib/anna-core-shared-lib/models/anna-tooltip.model.ts +44 -0
  40. package/src/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.ts +20 -0
  41. package/src/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.ts +43 -0
  42. package/src/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.ts +19 -0
  43. package/src/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.ts +12 -0
  44. package/src/lib/anna-core-shared-lib/services/anna-date-time-format.service.ts +216 -0
  45. package/src/lib/anna-core-shared-lib/services/anna-filter.service.ts +514 -0
  46. package/src/lib/anna-core-shared-lib/services/anna-generic-table.service.ts +44 -0
  47. package/src/lib/anna-core-shared-lib/services/anna-global-config.service.ts +170 -0
  48. package/src/lib/anna-core-shared-lib/services/anna-sort.service.ts +179 -0
  49. package/src/lib/anna-core.module.ts +110 -0
  50. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.html +46 -0
  51. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.scss +153 -0
  52. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.spec.ts +24 -0
  53. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.ts +106 -0
  54. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.html +129 -0
  55. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.scss +275 -0
  56. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.spec.ts +24 -0
  57. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.ts +412 -0
  58. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.html +926 -0
  59. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.scss +628 -0
  60. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.spec.ts +25 -0
  61. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.ts +2064 -0
  62. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.html +10 -0
  63. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.scss +1 -0
  64. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.spec.ts +24 -0
  65. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.ts +70 -0
  66. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.html +13 -0
  67. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.scss +88 -0
  68. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.spec.ts +25 -0
  69. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.ts +460 -0
  70. 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 +237 -0
  71. package/{lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.d.ts → src/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.ts} +0 -0
  72. package/src/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.ts +204 -0
  73. package/{lib/anna-generic-table-lib/directives/anna-virtual-table/index.d.ts → src/lib/anna-generic-table-lib/directives/anna-virtual-table/index.ts} +0 -0
  74. package/{public-api.d.ts → src/public-api.ts} +28 -0
  75. package/src/test.ts +27 -0
  76. package/tsconfig.lib.json +19 -0
  77. package/tsconfig.lib.prod.json +10 -0
  78. package/tsconfig.spec.json +17 -0
  79. package/annalib-anna-core.d.ts +0 -5
  80. package/esm2020/annalib-anna-core.mjs +0 -5
  81. package/esm2020/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.mjs +0 -15
  82. package/esm2020/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.mjs +0 -35
  83. package/esm2020/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.mjs +0 -15
  84. package/esm2020/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.mjs +0 -22
  85. package/esm2020/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.mjs +0 -15
  86. package/esm2020/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.mjs +0 -21
  87. package/esm2020/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.mjs +0 -15
  88. package/esm2020/lib/anna-core-shared-lib/constants/shared.constant.mjs +0 -34
  89. package/esm2020/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.mjs +0 -27
  90. package/esm2020/lib/anna-core-shared-lib/models/anna-generic-data-type.model.mjs +0 -2
  91. package/esm2020/lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.mjs +0 -2
  92. package/esm2020/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.mjs +0 -3
  93. package/esm2020/lib/anna-core-shared-lib/models/anna-sort.model.mjs +0 -2
  94. package/esm2020/lib/anna-core-shared-lib/models/anna-tooltip.model.mjs +0 -30
  95. package/esm2020/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.mjs +0 -26
  96. package/esm2020/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.mjs +0 -46
  97. package/esm2020/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.mjs +0 -25
  98. package/esm2020/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.mjs +0 -16
  99. package/esm2020/lib/anna-core-shared-lib/services/anna-date-time-format.service.mjs +0 -196
  100. package/esm2020/lib/anna-core-shared-lib/services/anna-filter.service.mjs +0 -426
  101. package/esm2020/lib/anna-core-shared-lib/services/anna-generic-table.service.mjs +0 -48
  102. package/esm2020/lib/anna-core-shared-lib/services/anna-global-config.service.mjs +0 -133
  103. package/esm2020/lib/anna-core-shared-lib/services/anna-sort.service.mjs +0 -147
  104. package/esm2020/lib/anna-core.module.mjs +0 -175
  105. package/esm2020/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.mjs +0 -100
  106. package/esm2020/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.mjs +0 -362
  107. package/esm2020/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.mjs +0 -1724
  108. package/esm2020/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.mjs +0 -67
  109. package/esm2020/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.mjs +0 -357
  110. 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 +0 -189
  111. package/esm2020/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.mjs +0 -2
  112. package/esm2020/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.mjs +0 -178
  113. package/esm2020/lib/anna-generic-table-lib/directives/anna-virtual-table/index.mjs +0 -2
  114. package/esm2020/public-api.mjs +0 -47
  115. package/fesm2015/annalib-anna-core.mjs +0 -4302
  116. package/fesm2015/annalib-anna-core.mjs.map +0 -1
  117. package/fesm2020/annalib-anna-core.mjs +0 -4299
  118. package/fesm2020/annalib-anna-core.mjs.map +0 -1
  119. package/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.d.ts +0 -8
  120. package/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.d.ts +0 -16
  121. package/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.d.ts +0 -8
  122. package/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.d.ts +0 -11
  123. package/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.d.ts +0 -8
  124. package/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.d.ts +0 -11
  125. package/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.d.ts +0 -8
  126. package/lib/anna-core-shared-lib/constants/shared.constant.d.ts +0 -32
  127. package/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.d.ts +0 -9
  128. package/lib/anna-core-shared-lib/models/anna-generic-data-type.model.d.ts +0 -16
  129. package/lib/anna-core-shared-lib/models/anna-sort.model.d.ts +0 -6
  130. package/lib/anna-core-shared-lib/models/anna-tooltip.model.d.ts +0 -25
  131. package/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.d.ts +0 -9
  132. package/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.d.ts +0 -9
  133. package/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.d.ts +0 -9
  134. package/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.d.ts +0 -7
  135. package/lib/anna-core-shared-lib/services/anna-date-time-format.service.d.ts +0 -27
  136. package/lib/anna-core-shared-lib/services/anna-filter.service.d.ts +0 -73
  137. package/lib/anna-core-shared-lib/services/anna-generic-table.service.d.ts +0 -14
  138. package/lib/anna-core-shared-lib/services/anna-global-config.service.d.ts +0 -21
  139. package/lib/anna-core-shared-lib/services/anna-sort.service.d.ts +0 -16
  140. package/lib/anna-core.module.d.ts +0 -35
  141. package/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.d.ts +0 -34
  142. package/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.d.ts +0 -70
  143. package/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.d.ts +0 -271
  144. package/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.d.ts +0 -17
  145. package/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.d.ts +0 -141
  146. 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 +0 -89
  147. package/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.d.ts +0 -45
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,34 @@
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
+ }
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,19 @@
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,9 +1,10 @@
1
1
  export interface IRadioButton {
2
- value: string;
3
- isDisabled: boolean;
4
- label: string;
5
- class: string;
2
+ value: string;
3
+ isDisabled: boolean;
4
+ label: string;
5
+ class: string;
6
6
  }
7
+
7
8
  export interface IAngular2MultiSelectSettings {
8
9
  text: string;
9
10
  selectAllText: string;
@@ -21,6 +22,7 @@ export interface IAngular2MultiSelectSettings {
21
22
  enableFilterSelectAll: boolean;
22
23
  maxHeight: number;
23
24
  }
25
+
24
26
  export interface INgxAsideSettings {
25
27
  title: string;
26
28
  cancelButtonTitle: string;
@@ -30,6 +32,7 @@ export interface INgxAsideSettings {
30
32
  showDefaultFooter: boolean;
31
33
  showDefaultHeader: boolean;
32
34
  }
35
+
33
36
  export interface INgbDatePickerSettings {
34
37
  autoClose: boolean;
35
38
  placeholder: string;
@@ -38,23 +41,28 @@ export interface INgbDatePickerSettings {
38
41
  showWeekNumbers: boolean;
39
42
  readonly: boolean;
40
43
  }
44
+
41
45
  export interface INgSelectSettings {
42
46
  allowClear: boolean;
43
47
  placeholder: string;
44
48
  }
49
+
45
50
  export interface INgxInfiniteScrollSettings {
46
51
  infiniteScrollDistance: number;
47
52
  infiniteScrollUpDistance: number;
48
53
  infiniteScrollThrottle: number;
49
54
  scrollWindow: boolean;
50
55
  }
56
+
51
57
  export interface INgxSkeletonLoaderSettings {
52
58
  numberOfSkeletonRows: number[];
53
59
  }
60
+
54
61
  export interface IRadioButtonComponentConfig {
55
62
  heading?: string;
56
63
  radioButtons: IRadioButton[];
57
64
  }
65
+
58
66
  export interface IConfirmationPopupConfig {
59
67
  showCancelButton: boolean;
60
68
  title: string;
@@ -67,6 +75,7 @@ export interface IConfirmationPopupConfig {
67
75
  size: "sm" | "lg";
68
76
  keyboard: boolean;
69
77
  }
78
+
70
79
  export interface IWeekCalendar {
71
80
  firstDayOfWeek?: number;
72
81
  numberOfMonthsToEnableInPast: number;
@@ -81,15 +90,18 @@ export interface IWeekCalendar {
81
90
  showAsDropdown: boolean;
82
91
  selectCurrentWeek: boolean;
83
92
  }
84
- export interface ICustomSingleSelect {
93
+
94
+
95
+ export interface ICustomSingleSelect{
85
96
  showSearchBar: boolean;
86
97
  placeholder: string;
87
98
  classes: string;
88
99
  position: Position;
89
- maxHeightOfList: number;
100
+ maxHeightOfList: number; //px value
90
101
  }
91
- export interface ICustomMultiSelect extends ICustomSingleSelect {
102
+
103
+ export interface ICustomMultiSelect extends ICustomSingleSelect{
92
104
  showErrorWhenNoOptionSelected: boolean;
93
105
  }
94
- declare type Position = "TOP" | "BOTTOM";
95
- export {};
106
+
107
+ type Position = "TOP"| "BOTTOM";
@@ -1,10 +1,12 @@
1
1
  import { TooltipPosition } from "@angular/material/tooltip";
2
2
  import { IWeekCalendar } from "./anna-global-dropdown-config.model";
3
+
3
4
  export interface IGtTableHeader {
4
5
  headerInfo: IHeaderInfo[];
5
6
  visible: boolean;
6
7
  width: string;
7
8
  }
9
+
8
10
  export interface IHeaderInfo {
9
11
  name: string;
10
12
  objectKey: string;
@@ -20,22 +22,27 @@ export interface IHeaderInfo {
20
22
  tooltip?: ITooltip;
21
23
  joinedFilterSortObjectKeys?: string;
22
24
  }
23
- declare type DATATYPE = "CHECKBOX" | "ICON" | "STRING" | "RADIO" | "" | "SVG_ICON" | "TEXT_ACTIONS" | "CLICKABLE_DATA";
24
- declare type FILTERTYPE = "CHECKBOX" | "SLIDER" | "DATE" | "TIME" | "WEEK";
25
+
26
+ type DATATYPE = "CHECKBOX" | "ICON" | "STRING" | "RADIO" | "" | "SVG_ICON" | "TEXT_ACTIONS" | "CLICKABLE_DATA";
27
+ type FILTERTYPE = "CHECKBOX" | "SLIDER" | "DATE" | "TIME" | "WEEK";
28
+ type TOOLTIPOSITION = "left" | "right";
29
+
25
30
  export interface ITotalRowInfo {
26
31
  colspan: number;
27
32
  data: string;
28
33
  lowerData?: string;
29
34
  colName: string;
30
35
  class?: string;
31
- tooltipMessage?: string;
36
+ tooltipMessage?: string;
32
37
  }
38
+
33
39
  export interface IGtHeaderConfig {
34
40
  iconColumn: boolean;
35
41
  checkboxColumn: boolean;
36
42
  lastColumnKeys: string[];
37
43
  }
38
- export interface IGtGeneralConfig extends ISpotTableConfig {
44
+
45
+ export interface IGtGeneralConfig extends ISpotTableConfig{
39
46
  component: COMPONENTNAME;
40
47
  totalRow: boolean;
41
48
  isHeaderChecked?: boolean;
@@ -48,25 +55,28 @@ export interface IGtGeneralConfig extends ISpotTableConfig {
48
55
  bufferSize: number;
49
56
  page: string;
50
57
  }
51
- declare type COMPONENTNAME = "SPOTDETAILS" | "EXCLUDEINVENTORYPOPUP" | "EXCLUDEINVENTORY" | "DRRLISTING" | "DRR" | "" | "RATING" | "ORDER_LISTING_INFLIGHT" | "ORDER_LISTING_COMPLETED" | "ORDER_LISTING_BLANK" | "LUR_VIOLATIONS";
58
+
59
+ type COMPONENTNAME = "SPOTDETAILS" | "EXCLUDEINVENTORYPOPUP" | "EXCLUDEINVENTORY" | "DRRLISTING" | "DRR" | "" | "RATING" | "ORDER_LISTING_INFLIGHT" | "ORDER_LISTING_COMPLETED" | "ORDER_LISTING_BLANK" | "LUR_VIOLATIONS";;
52
60
  interface ISpotTableConfig {
53
61
  isGrouped: boolean;
54
62
  }
55
- export interface ITooltip {
63
+
64
+
65
+ export interface ITooltip{
56
66
  iconPosition: TooltipPosition;
57
67
  name: string;
58
68
  tooltipPosition: string;
59
69
  iconClass: string;
60
70
  tooltipClass: string;
61
71
  }
62
- export interface IconData {
63
- data: any;
64
- iconClass: string;
65
- }
66
- export interface TextAction {
67
- id: number;
68
- name: string;
69
- class: string;
70
- isDisabled: boolean;
71
- }
72
- export {};
72
+
73
+ export interface IconData{
74
+ data: any;
75
+ iconClass: string;
76
+ }
77
+ export interface TextAction{
78
+ id: number;
79
+ name: string;
80
+ class: string;
81
+ isDisabled: boolean;
82
+ }
@@ -0,0 +1,7 @@
1
+ export type SortType = "DEFAULT" | "ASC" | "DESC";
2
+
3
+ export interface SortOption{
4
+ sortType: SortType,
5
+ isOptionActive: boolean,
6
+ text: string
7
+ }
@@ -0,0 +1,44 @@
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
+ }
@@ -0,0 +1,20 @@
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
+ }
@@ -0,0 +1,43 @@
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
+ }
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,12 @@
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
+ }
@@ -0,0 +1,216 @@
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
+ }