@annalib/anna-core 7.2.3 → 7.2.4

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 (156) 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 +19 -39
  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 +35 -0
  34. package/src/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.ts +307 -0
  35. package/src/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.ts +19 -0
  36. package/src/lib/anna-core-shared-lib/models/anna-generic-data-type.model.ts +19 -0
  37. 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
  38. package/src/lib/anna-core-shared-lib/models/anna-manage-users.model.ts +6 -0
  39. 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} +28 -17
  40. package/src/lib/anna-core-shared-lib/models/anna-sort.model.ts +13 -0
  41. package/src/lib/anna-core-shared-lib/models/anna-tooltip.model.ts +44 -0
  42. package/src/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.ts +20 -0
  43. package/src/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.ts +43 -0
  44. package/src/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.ts +19 -0
  45. package/src/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.ts +12 -0
  46. package/src/lib/anna-core-shared-lib/services/anna-date-time-format.service.ts +219 -0
  47. package/src/lib/anna-core-shared-lib/services/anna-filter.service.ts +563 -0
  48. package/src/lib/anna-core-shared-lib/services/anna-generic-table.service.ts +136 -0
  49. package/src/lib/anna-core-shared-lib/services/anna-global-config.service.ts +170 -0
  50. package/src/lib/anna-core-shared-lib/services/anna-number-format.service.ts +43 -0
  51. package/src/lib/anna-core-shared-lib/services/anna-sort.service.ts +179 -0
  52. package/src/lib/anna-core.module.ts +112 -0
  53. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.html +46 -0
  54. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.scss +153 -0
  55. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.spec.ts +24 -0
  56. package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.ts +106 -0
  57. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.html +129 -0
  58. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.scss +275 -0
  59. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.spec.ts +24 -0
  60. package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.ts +414 -0
  61. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.html +1080 -0
  62. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.scss +668 -0
  63. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.spec.ts +25 -0
  64. package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.ts +2186 -0
  65. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.html +10 -0
  66. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.scss +1 -0
  67. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.spec.ts +24 -0
  68. package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.ts +69 -0
  69. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.html +13 -0
  70. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.scss +88 -0
  71. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.spec.ts +25 -0
  72. package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.ts +460 -0
  73. 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
  74. 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
  75. package/src/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.ts +204 -0
  76. 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
  77. package/{public-api.d.ts → src/public-api.ts} +28 -0
  78. package/src/test.ts +27 -0
  79. package/tsconfig.lib.json +19 -0
  80. package/tsconfig.lib.prod.json +10 -0
  81. package/tsconfig.spec.json +17 -0
  82. package/annalib-anna-core.d.ts +0 -5
  83. package/esm2020/annalib-anna-core.mjs +0 -5
  84. package/esm2020/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.mjs +0 -15
  85. package/esm2020/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.mjs +0 -35
  86. package/esm2020/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.mjs +0 -15
  87. package/esm2020/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.mjs +0 -22
  88. package/esm2020/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.mjs +0 -15
  89. package/esm2020/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.mjs +0 -21
  90. package/esm2020/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.mjs +0 -15
  91. package/esm2020/lib/anna-core-shared-lib/constants/shared.constant.mjs +0 -35
  92. package/esm2020/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.mjs +0 -282
  93. package/esm2020/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.mjs +0 -27
  94. package/esm2020/lib/anna-core-shared-lib/models/anna-generic-data-type.model.mjs +0 -2
  95. package/esm2020/lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.mjs +0 -2
  96. package/esm2020/lib/anna-core-shared-lib/models/anna-manage-users.model.mjs +0 -8
  97. package/esm2020/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.mjs +0 -2
  98. package/esm2020/lib/anna-core-shared-lib/models/anna-sort.model.mjs +0 -7
  99. package/esm2020/lib/anna-core-shared-lib/models/anna-tooltip.model.mjs +0 -30
  100. package/esm2020/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.mjs +0 -26
  101. package/esm2020/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.mjs +0 -46
  102. package/esm2020/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.mjs +0 -25
  103. package/esm2020/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.mjs +0 -16
  104. package/esm2020/lib/anna-core-shared-lib/services/anna-date-time-format.service.mjs +0 -199
  105. package/esm2020/lib/anna-core-shared-lib/services/anna-filter.service.mjs +0 -469
  106. package/esm2020/lib/anna-core-shared-lib/services/anna-generic-table.service.mjs +0 -124
  107. package/esm2020/lib/anna-core-shared-lib/services/anna-global-config.service.mjs +0 -133
  108. package/esm2020/lib/anna-core-shared-lib/services/anna-number-format.service.mjs +0 -41
  109. package/esm2020/lib/anna-core-shared-lib/services/anna-sort.service.mjs +0 -147
  110. package/esm2020/lib/anna-core.module.mjs +0 -180
  111. package/esm2020/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.mjs +0 -101
  112. package/esm2020/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.mjs +0 -364
  113. package/esm2020/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.mjs +0 -1834
  114. package/esm2020/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.mjs +0 -69
  115. package/esm2020/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.mjs +0 -357
  116. 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
  117. package/esm2020/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.mjs +0 -2
  118. package/esm2020/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.mjs +0 -178
  119. package/esm2020/lib/anna-generic-table-lib/directives/anna-virtual-table/index.mjs +0 -2
  120. package/esm2020/public-api.mjs +0 -50
  121. package/fesm2015/annalib-anna-core.mjs +0 -4875
  122. package/fesm2015/annalib-anna-core.mjs.map +0 -1
  123. package/fesm2020/annalib-anna-core.mjs +0 -4868
  124. package/fesm2020/annalib-anna-core.mjs.map +0 -1
  125. package/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.d.ts +0 -8
  126. package/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.d.ts +0 -16
  127. package/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.d.ts +0 -8
  128. package/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.d.ts +0 -11
  129. package/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.d.ts +0 -8
  130. package/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.d.ts +0 -11
  131. package/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.d.ts +0 -8
  132. package/lib/anna-core-shared-lib/constants/shared.constant.d.ts +0 -33
  133. package/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.d.ts +0 -34
  134. package/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.d.ts +0 -9
  135. package/lib/anna-core-shared-lib/models/anna-generic-data-type.model.d.ts +0 -16
  136. package/lib/anna-core-shared-lib/models/anna-manage-users.model.d.ts +0 -6
  137. package/lib/anna-core-shared-lib/models/anna-sort.model.d.ts +0 -11
  138. package/lib/anna-core-shared-lib/models/anna-tooltip.model.d.ts +0 -25
  139. package/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.d.ts +0 -9
  140. package/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.d.ts +0 -9
  141. package/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.d.ts +0 -9
  142. package/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.d.ts +0 -7
  143. package/lib/anna-core-shared-lib/services/anna-date-time-format.service.d.ts +0 -27
  144. package/lib/anna-core-shared-lib/services/anna-filter.service.d.ts +0 -74
  145. package/lib/anna-core-shared-lib/services/anna-generic-table.service.d.ts +0 -28
  146. package/lib/anna-core-shared-lib/services/anna-global-config.service.d.ts +0 -21
  147. package/lib/anna-core-shared-lib/services/anna-number-format.service.d.ts +0 -7
  148. package/lib/anna-core-shared-lib/services/anna-sort.service.d.ts +0 -16
  149. package/lib/anna-core.module.d.ts +0 -36
  150. package/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.d.ts +0 -34
  151. package/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.d.ts +0 -70
  152. package/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.d.ts +0 -283
  153. package/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.d.ts +0 -17
  154. package/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.d.ts +0 -141
  155. 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
  156. 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,35 @@
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 = "Ownership Group Admin";
12
+ static readonly ASARole = "Anna Station Admin";
13
+ static readonly dollars = "$";
14
+ }
15
+
16
+ export class ErrorCodes {
17
+ static readonly BAD_REQUEST = 400;
18
+ static readonly SERVER_ERROR = 500;
19
+ static readonly SUCCESS_CODE = 200;
20
+ static readonly SUCCESS_CODE_GET = 200;
21
+ static readonly SUCCESS_CODE_POST = 201;
22
+ static readonly SUCCESS_CODE_PATCH = 204;
23
+ static readonly NO_CONTENT = 204;
24
+ static readonly under_review = 409;
25
+ }
26
+
27
+ export enum Days {
28
+ M = 1,
29
+ Tu = 2,
30
+ We = 3,
31
+ Th = 4,
32
+ F = 5,
33
+ Sa = 6,
34
+ Su = 7,
35
+ }
@@ -0,0 +1,307 @@
1
+ import {
2
+ Directive,
3
+ ElementRef,
4
+ HostListener,
5
+ Input,
6
+ OnChanges,
7
+ SimpleChanges,
8
+ } from '@angular/core';
9
+
10
+ @Directive({
11
+ selector: '[digitOnly]',
12
+ })
13
+ export class DigitOnlyDirective implements OnChanges {
14
+ private hasDecimalPoint = false;
15
+ private hasNegativeSign = false;
16
+ private navigationKeys = [
17
+ 'Backspace',
18
+ 'Delete',
19
+ 'Tab',
20
+ 'Escape',
21
+ 'Enter',
22
+ 'Home',
23
+ 'End',
24
+ 'ArrowLeft',
25
+ 'ArrowRight',
26
+ 'Clear',
27
+ 'Copy',
28
+ 'Paste',
29
+ ];
30
+
31
+ @Input() decimal = false;
32
+ @Input() decimalSeparator = '.';
33
+ @Input() allowNegatives = false;
34
+ @Input() allowPaste = true;
35
+ @Input() negativeSign = '-';
36
+ @Input() min = -Infinity;
37
+ @Input() max = Infinity;
38
+ @Input() pattern?: string | RegExp;
39
+ private regex: RegExp | null = null;
40
+ inputElement: HTMLInputElement;
41
+
42
+ constructor(public el: ElementRef) {
43
+ this.inputElement = el.nativeElement;
44
+ }
45
+
46
+ ngOnChanges(changes: SimpleChanges): void {
47
+ if (changes['pattern']) {
48
+ this.regex = this.pattern ? RegExp(this.pattern) : null;
49
+ }
50
+
51
+ if (changes['min']) {
52
+ const maybeMin = Number(this.min);
53
+ this.min = isNaN(maybeMin) ? -Infinity : maybeMin;
54
+ }
55
+
56
+ if (changes['max']) {
57
+ const maybeMax = Number(this.max);
58
+ this.max = isNaN(maybeMax) ? Infinity : maybeMax;
59
+ }
60
+ }
61
+
62
+ @HostListener('beforeinput', ['$event'])
63
+ onBeforeInput(e: InputEvent): any {
64
+ if (isNaN(Number(e.data))) {
65
+ if (
66
+ e.data === this.decimalSeparator ||
67
+ (e.data === this.negativeSign && this.allowNegatives)
68
+ ) {
69
+ return; // go on
70
+ }
71
+ e.preventDefault();
72
+ e.stopPropagation();
73
+ }
74
+ }
75
+
76
+ @HostListener('keydown', ['$event'])
77
+ onKeyDown(e: KeyboardEvent): any {
78
+ console.log("called");
79
+ if (
80
+ this.navigationKeys.indexOf(e.key) > -1 || // Allow: navigation keys: backspace, delete, arrows etc.
81
+ ((e.key === 'a' || e.code === 'KeyA') && e.ctrlKey === true) || // Allow: Ctrl+A
82
+ ((e.key === 'c' || e.code === 'KeyC') && e.ctrlKey === true) || // Allow: Ctrl+C
83
+ ((e.key === 'v' || e.code === 'KeyV') && e.ctrlKey === true) || // Allow: Ctrl+V
84
+ ((e.key === 'x' || e.code === 'KeyX') && e.ctrlKey === true) || // Allow: Ctrl+X
85
+ ((e.key === 'a' || e.code === 'KeyA') && e.metaKey === true) || // Allow: Cmd+A (Mac)
86
+ ((e.key === 'c' || e.code === 'KeyC') && e.metaKey === true) || // Allow: Cmd+C (Mac)
87
+ ((e.key === 'v' || e.code === 'KeyV') && e.metaKey === true) || // Allow: Cmd+V (Mac)
88
+ ((e.key === 'x' || e.code === 'KeyX') && e.metaKey === true) // Allow: Cmd+X (Mac)
89
+ ) {
90
+ // let it happen, don't do anything
91
+ return;
92
+ }
93
+
94
+ let newValue = '';
95
+
96
+ if (this.decimal && e.key === this.decimalSeparator) {
97
+ newValue = this.forecastValue(e.key);
98
+ if (newValue.split(this.decimalSeparator).length > 2) {
99
+ // has two or more decimal points
100
+ e.preventDefault();
101
+ return;
102
+ } else {
103
+ this.hasDecimalPoint = newValue.indexOf(this.decimalSeparator) > -1;
104
+ return; // Allow: only one decimal point
105
+ }
106
+ }
107
+
108
+ if (e.key === this.negativeSign && this.allowNegatives) {
109
+ newValue = this.forecastValue(e.key);
110
+ if (
111
+ newValue.charAt(0) !== this.negativeSign ||
112
+ newValue.split(this.negativeSign).length > 2
113
+ ) {
114
+ e.preventDefault();
115
+ return;
116
+ } else {
117
+ this.hasNegativeSign = newValue.split(this.negativeSign).length > -1;
118
+ return;
119
+ }
120
+ }
121
+
122
+ // Ensure that it is a number and stop the keypress
123
+ if (e.key === ' ' || isNaN(Number(e.key))) {
124
+ e.preventDefault();
125
+ return;
126
+ }
127
+
128
+ newValue = newValue || this.forecastValue(e.key);
129
+ // check the input pattern RegExp
130
+ if (this.regex) {
131
+ if (!this.regex.test(newValue)) {
132
+ e.preventDefault();
133
+ return;
134
+ }
135
+ }
136
+
137
+ const newNumber = Number(newValue);
138
+ if (newNumber > this.max || newNumber < this.min) {
139
+ e.preventDefault();
140
+ }
141
+ }
142
+
143
+ @HostListener('paste', ['$event'])
144
+ onPaste(event: any): void {
145
+ if (this.allowPaste === true) {
146
+ let pastedInput: string = '';
147
+ if ((window as { [key: string]: any })['clipboardData']) {
148
+ // Browser is IE
149
+ pastedInput = (window as { [key: string]: any })[
150
+ 'clipboardData'
151
+ ].getData('text');
152
+ } else if (event.clipboardData && event.clipboardData.getData) {
153
+ // Other browsers
154
+ pastedInput = event.clipboardData.getData('text/plain');
155
+ }
156
+
157
+ this.pasteData(pastedInput);
158
+ event.preventDefault();
159
+ } else {
160
+ // this prevents the paste
161
+ event.preventDefault();
162
+ event.stopPropagation();
163
+ }
164
+ }
165
+
166
+ @HostListener('drop', ['$event'])
167
+ onDrop(event: DragEvent): void {
168
+ const textData = event.dataTransfer?.getData('text') ?? '';
169
+ this.inputElement.focus();
170
+ this.pasteData(textData);
171
+ event.preventDefault();
172
+ }
173
+
174
+ private pasteData(pastedContent: string): void {
175
+ const sanitizedContent = this.sanitizeInput(pastedContent);
176
+ if (
177
+ sanitizedContent.includes(this.negativeSign) &&
178
+ this.hasNegativeSign &&
179
+ !this.getSelection().includes(this.negativeSign)
180
+ ) {
181
+ return;
182
+ }
183
+ const pasted = document.execCommand('insertText', false, sanitizedContent);
184
+ if (!pasted) {
185
+ if (this.inputElement.setRangeText) {
186
+ const { selectionStart: start, selectionEnd: end } = this.inputElement;
187
+ this.inputElement.setRangeText(
188
+ sanitizedContent,
189
+ start ?? 0,
190
+ end ?? 0,
191
+ 'end'
192
+ );
193
+ // Angular's Reactive Form relies on "input" event, but on Firefox, the setRangeText method doesn't trigger it
194
+ // so we have to trigger it ourself.
195
+ if (
196
+ typeof (window as { [key: string]: any })['InstallTrigger'] !==
197
+ 'undefined'
198
+ ) {
199
+ this.inputElement.dispatchEvent(
200
+ new Event('input', { cancelable: true })
201
+ );
202
+ }
203
+ } else {
204
+ // Browser does not support setRangeText, e.g. IE
205
+ this.insertAtCursor(this.inputElement, sanitizedContent);
206
+ }
207
+ }
208
+ if (this.decimal) {
209
+ this.hasDecimalPoint =
210
+ this.inputElement.value.indexOf(this.decimalSeparator) > -1;
211
+ }
212
+ this.hasNegativeSign =
213
+ this.inputElement.value.indexOf(this.negativeSign) > -1;
214
+ }
215
+
216
+ // The following 2 methods were added from the below article for browsers that do not support setRangeText
217
+ // https://stackoverflow.com/questions/11076975/how-to-insert-text-into-the-textarea-at-the-current-cursor-position
218
+ private insertAtCursor(myField: HTMLInputElement, myValue: string): void {
219
+ const startPos = myField.selectionStart ?? 0;
220
+ const endPos = myField.selectionEnd ?? 0;
221
+
222
+ myField.value =
223
+ myField.value.substring(0, startPos) +
224
+ myValue +
225
+ myField.value.substring(endPos, myField.value.length);
226
+
227
+ const pos = startPos + myValue.length;
228
+ myField.focus();
229
+ myField.setSelectionRange(pos, pos);
230
+
231
+ this.triggerEvent(myField, 'input');
232
+ }
233
+
234
+ private triggerEvent(el: HTMLInputElement, type: string): void {
235
+ if ('createEvent' in document) {
236
+ // modern browsers, IE9+
237
+ const e = document.createEvent('HTMLEvents');
238
+ e.initEvent(type, false, true);
239
+ el.dispatchEvent(e);
240
+ }
241
+ }
242
+ // end stack overflow code
243
+
244
+ private sanitizeInput(input: string): string {
245
+ let result = '';
246
+ let regex;
247
+ if (this.decimal && this.isValidDecimal(input)) {
248
+ regex = new RegExp(
249
+ `${this.getNegativeSignRegExp()}[^0-9${this.decimalSeparator}]`,
250
+ 'g'
251
+ );
252
+ } else {
253
+ regex = new RegExp(`${this.getNegativeSignRegExp()}[^0-9]`, 'g');
254
+ }
255
+ result = input.replace(regex, '');
256
+
257
+ const maxLength = this.inputElement.maxLength;
258
+ if (maxLength > 0) {
259
+ // the input element has maxLength limit
260
+ const allowedLength =
261
+ maxLength -
262
+ this.inputElement.value.length +
263
+ (result.includes(`${this.negativeSign}`) ? 1 : 0);
264
+ result = allowedLength > 0 ? result.substring(0, allowedLength) : '';
265
+ }
266
+ return result;
267
+ }
268
+
269
+ private getNegativeSignRegExp(): string {
270
+ return this.allowNegatives &&
271
+ (!this.hasNegativeSign || this.getSelection().includes(this.negativeSign))
272
+ ? `(?!^${this.negativeSign})`
273
+ : '';
274
+ }
275
+
276
+ private isValidDecimal(string: string): boolean {
277
+ if (!this.hasDecimalPoint) {
278
+ return string.split(this.decimalSeparator).length <= 2;
279
+ } else {
280
+ // the input element already has a decimal separator
281
+ const selectedText = this.getSelection();
282
+ if (selectedText && selectedText.indexOf(this.decimalSeparator) > -1) {
283
+ return string.split(this.decimalSeparator).length <= 2;
284
+ } else {
285
+ return string.indexOf(this.decimalSeparator) < 0;
286
+ }
287
+ }
288
+ }
289
+
290
+ private getSelection(): string {
291
+ return this.inputElement.value.substring(
292
+ this.inputElement.selectionStart ?? 0,
293
+ this.inputElement.selectionEnd ?? 0
294
+ );
295
+ }
296
+
297
+ private forecastValue(key: string): string {
298
+ const selectionStart = this.inputElement.selectionStart ?? 0;
299
+ const selectionEnd = this.inputElement.selectionEnd ?? 0;
300
+ const oldValue = this.inputElement.value;
301
+ return (
302
+ oldValue.substring(0, selectionStart) +
303
+ key +
304
+ oldValue.substring(selectionEnd)
305
+ );
306
+ }
307
+ }
@@ -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";
@@ -0,0 +1,6 @@
1
+ export enum UserActivationStatus {
2
+ activationEmailSent = 'ActivationEmailSent' ,
3
+ activationEmailReSent = 'ActivationEmailResent' ,
4
+ ResendActivationEmail = 'ResendActivationEmail' ,
5
+ lastSignedIn = 'LastSignedIn',
6
+ }
@@ -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,28 @@ 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" | "CLICKABLE_DATA_2" | "STRING__TEXT_ACTION" | "STRING__ICON_ACTION" | "STRING___ICON_OR_TEXT_ACTION" | "STRING___ICON_OR_TEXT_ACTION_1" | "STRING___ICON_OR_TEXT_ACTION_2" | "STRING___ICON_OR_TEXT_ACTION_3";
24
- declare type FILTERTYPE = "CHECKBOX" | "SLIDER" | "DATE" | "TIME" | "WEEK";
25
+
26
+ type DATATYPE = "CHECKBOX" | "ICON" | "STRING" | "RADIO" | "" | "SVG_ICON" | "TEXT_ACTIONS" | "CLICKABLE_DATA" | "CLICKABLE_DATA_2" | "STRING__TEXT_ACTION" | "STRING__ICON_ACTION" | "STRING___ICON_OR_TEXT_ACTION" |
27
+ "STRING___ICON_OR_TEXT_ACTION_1" | "STRING___ICON_OR_TEXT_ACTION_2" | "STRING___ICON_OR_TEXT_ACTION_3";
28
+ type FILTERTYPE = "CHECKBOX" | "SLIDER" | "DATE" | "TIME" | "WEEK";
29
+ type TOOLTIPOSITION = "left" | "right";
30
+
25
31
  export interface ITotalRowInfo {
26
32
  colspan: number;
27
33
  data: string;
28
34
  lowerData?: string;
29
35
  colName: string;
30
36
  class?: string;
31
- tooltipMessage?: string;
37
+ tooltipMessage?: string;
32
38
  }
39
+
33
40
  export interface IGtHeaderConfig {
34
41
  iconColumn: boolean;
35
42
  checkboxColumn: boolean;
36
43
  lastColumnKeys: string[];
37
44
  }
38
- export interface IGtGeneralConfig extends ISpotTableConfig {
45
+
46
+ export interface IGtGeneralConfig extends ISpotTableConfig{
39
47
  component: COMPONENTNAME;
40
48
  totalRow: boolean;
41
49
  isHeaderChecked?: boolean;
@@ -48,25 +56,28 @@ export interface IGtGeneralConfig extends ISpotTableConfig {
48
56
  bufferSize: number;
49
57
  page: string;
50
58
  }
51
- declare type COMPONENTNAME = "SPOTDETAILS" | "EXCLUDEINVENTORYPOPUP" | "EXCLUDEINVENTORY" | "DRRLISTING" | "DRR" | "" | "RATING" | "ORDER_LISTING_INFLIGHT" | "ORDER_LISTING_COMPLETED" | "ORDER_LISTING_BLANK" | "LUR_VIOLATIONS" | "ACTIVITYLOG";
59
+
60
+ type COMPONENTNAME = "SPOTDETAILS" | "EXCLUDEINVENTORYPOPUP" | "EXCLUDEINVENTORY" | "DRRLISTING" | "DRR" | "" | "RATING" | "ORDER_LISTING_INFLIGHT" | "ORDER_LISTING_COMPLETED" | "ORDER_LISTING_BLANK" | "LUR_VIOLATIONS" | "ACTIVITYLOG";
52
61
  interface ISpotTableConfig {
53
62
  isGrouped: boolean;
54
63
  }
55
- export interface ITooltip {
64
+
65
+
66
+ export interface ITooltip{
56
67
  iconPosition: TooltipPosition;
57
68
  name: string;
58
69
  tooltipPosition: string;
59
70
  iconClass: string;
60
71
  tooltipClass: string;
61
72
  }
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 {};
73
+
74
+ export interface IconData{
75
+ data: any;
76
+ iconClass: string;
77
+ }
78
+ export interface TextAction{
79
+ id: number;
80
+ name: string;
81
+ class: string;
82
+ isDisabled: boolean;
83
+ }
@@ -0,0 +1,13 @@
1
+ export type SortType = "DEFAULT" | "ASC" | "DESC";
2
+
3
+ export interface SortOption{
4
+ sortType: SortType,
5
+ isOptionActive: boolean,
6
+ text: string
7
+ }
8
+
9
+ export enum SortTypeEnum {
10
+ DEFAULT = "DEFAULT",
11
+ ASC = "ASC",
12
+ DESC = "DESC"
13
+ }
@@ -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
+ }