@annalib/anna-core 4.3.8 → 4.4.0

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 (21) hide show
  1. package/esm2020/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.mjs +4 -4
  2. package/esm2020/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.mjs +282 -0
  3. package/esm2020/lib/anna-core-shared-lib/services/anna-date-time-format.service.mjs +29 -29
  4. package/esm2020/lib/anna-core-shared-lib/services/anna-filter.service.mjs +50 -38
  5. package/esm2020/lib/anna-core-shared-lib/services/anna-number-format.service.mjs +41 -0
  6. package/esm2020/lib/anna-core.module.mjs +9 -4
  7. package/esm2020/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.mjs +10 -10
  8. package/esm2020/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.mjs +45 -30
  9. package/esm2020/public-api.mjs +3 -1
  10. package/fesm2015/annalib-anna-core.mjs +461 -107
  11. package/fesm2015/annalib-anna-core.mjs.map +1 -1
  12. package/fesm2020/annalib-anna-core.mjs +457 -107
  13. package/fesm2020/annalib-anna-core.mjs.map +1 -1
  14. package/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.d.ts +34 -0
  15. package/lib/anna-core-shared-lib/services/anna-date-time-format.service.d.ts +2 -2
  16. package/lib/anna-core-shared-lib/services/anna-filter.service.d.ts +5 -5
  17. package/lib/anna-core-shared-lib/services/anna-number-format.service.d.ts +7 -0
  18. package/lib/anna-core.module.d.ts +12 -11
  19. package/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.d.ts +3 -3
  20. package/package.json +2 -2
  21. package/public-api.d.ts +2 -0
@@ -0,0 +1,34 @@
1
+ import { ElementRef, OnChanges, SimpleChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DigitOnlyDirective implements OnChanges {
4
+ el: ElementRef;
5
+ private hasDecimalPoint;
6
+ private hasNegativeSign;
7
+ private navigationKeys;
8
+ decimal: boolean;
9
+ decimalSeparator: string;
10
+ allowNegatives: boolean;
11
+ allowPaste: boolean;
12
+ negativeSign: string;
13
+ min: number;
14
+ max: number;
15
+ pattern?: string | RegExp;
16
+ private regex;
17
+ inputElement: HTMLInputElement;
18
+ constructor(el: ElementRef);
19
+ ngOnChanges(changes: SimpleChanges): void;
20
+ onBeforeInput(e: InputEvent): any;
21
+ onKeyDown(e: KeyboardEvent): any;
22
+ onPaste(event: any): void;
23
+ onDrop(event: DragEvent): void;
24
+ private pasteData;
25
+ private insertAtCursor;
26
+ private triggerEvent;
27
+ private sanitizeInput;
28
+ private getNegativeSignRegExp;
29
+ private isValidDecimal;
30
+ private getSelection;
31
+ private forecastValue;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<DigitOnlyDirective, never>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DigitOnlyDirective, "[digitOnly]", never, { "decimal": "decimal"; "decimalSeparator": "decimalSeparator"; "allowNegatives": "allowNegatives"; "allowPaste": "allowPaste"; "negativeSign": "negativeSign"; "min": "min"; "max": "max"; "pattern": "pattern"; }, {}, never>;
34
+ }
@@ -17,8 +17,8 @@ export declare class AnnaDateTimeFormatService {
17
17
  sortByTimeDescending(a: any, b: any): number;
18
18
  convertNgbDateToMoment(ngbDate: NgbDate | NgbDateType): string;
19
19
  compareDate(a: string, b: string, isAsc: boolean): number;
20
- static formatTwentyFourHourTimeToHHMMAFormat(value: any): string;
21
- static formatTwelveHourTimeToHHMMAFormat(value: any): string;
20
+ static formatTwentyFourHourTimeToHHMMAFormat(value: any, date?: string): string;
21
+ static formatTwelveHourTimeToHHMMAFormat(timeValue: any, date?: string): string;
22
22
  formatDateAndHHMMATimeToStandardFormat(dateAndTime: any): string;
23
23
  compare(a: number | string, b: number | string, isAsc: boolean): number;
24
24
  sortDataByBroadcastTimeAsc(firstParamTime: string, secondParamTime: string, broadcastTime: string): number;
@@ -1,5 +1,5 @@
1
1
  import { Options } from '@angular-slider/ngx-slider';
2
- import moment from "moment";
2
+ import dayjs from "dayjs";
3
3
  import { SortType } from '../models/anna-sort.model';
4
4
  import { AnnaDateTimeFormatService, NgbDateType } from './anna-date-time-format.service';
5
5
  import { AnnaSortService } from './anna-sort.service';
@@ -34,7 +34,7 @@ export declare class AnnaFilterService {
34
34
  isFilterSortActive: any;
35
35
  constructor(dateTimeFormatService: AnnaDateTimeFormatService, annaSortService: AnnaSortService);
36
36
  returnMaxAndMinValue(data: any[], key: string, isMin: boolean): any;
37
- returnMinAndMaxDate(data: any[], key: string): moment.Moment[];
37
+ returnMinAndMaxDate(data: any[], key: string): dayjs.Dayjs[];
38
38
  isTooltipActive(header: string[], sortMap: Map<string, SortType>): boolean;
39
39
  clearColumnFilter(): void;
40
40
  setOptionValues(minValue: number, maxValue: number): {
@@ -58,13 +58,13 @@ export declare class AnnaFilterService {
58
58
  getDataInTheDateRange(obj: any, value: any, key: any): any;
59
59
  initializeTimeFilterData(clonedData: any[], key?: string): void;
60
60
  returnColumnFilterStatus(data: any[], headerName: string | number): boolean;
61
- getFilterOptionsData(data: any[], clonedData: any[], key?: string): any[];
61
+ getFilterOptionsData(data: any[], clonedData: any[]): any[];
62
62
  reOrderAppliedFiltersState(clonedData: any[], value: any): boolean;
63
63
  checkIfFilterIsApplied(clonedData: any[], value: any): boolean;
64
64
  applyFilter(data: any[], value: any): any[];
65
65
  isObjectInTheRange(obj: any, value: {
66
- fromDate: moment.Moment;
67
- toDate: moment.Moment;
66
+ fromDate: dayjs.Dayjs;
67
+ toDate: dayjs.Dayjs;
68
68
  }, key: string): boolean;
69
69
  updateStateOfTheCurrentFilterTab(sortMap: Map<string, SortType>): void;
70
70
  updateStateOfAllTheKeys(sortMap: Map<string, SortType>): void;
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class AnnaNumberFormatService {
3
+ static GetRoundedValueWithUnits(inputValue: number, digitsToRoundDecimalPoint?: number): string;
4
+ static GetValueInUnits(inputValue: number): (string | number)[];
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<AnnaNumberFormatService, never>;
6
+ static ɵprov: i0.ɵɵInjectableDeclaration<AnnaNumberFormatService>;
7
+ }
@@ -18,18 +18,19 @@ import * as i16 from "./anna-generic-table-lib/directives/anna-virtual-table/ann
18
18
  import * as i17 from "./anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component";
19
19
  import * as i18 from "./anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component";
20
20
  import * as i19 from "./anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/anna-fixed-row-size-table-virtual-scroll-strategy.directive";
21
- import * as i20 from "@angular/common";
22
- import * as i21 from "@ng-bootstrap/ng-bootstrap";
23
- import * as i22 from "@angular/forms";
24
- import * as i23 from "@angular/material/radio";
25
- import * as i24 from "@angular/material/button-toggle";
26
- import * as i25 from "@angular/material/table";
27
- import * as i26 from "@angular-slider/ngx-slider";
28
- import * as i27 from "ngx-skeleton-loader";
29
- import * as i28 from "@angular/cdk/scrolling";
30
- import * as i29 from "ng-circle-progress";
21
+ import * as i20 from "./anna-core-shared-lib/directives/digits-only/digits-only.directive";
22
+ import * as i21 from "@angular/common";
23
+ import * as i22 from "@ng-bootstrap/ng-bootstrap";
24
+ import * as i23 from "@angular/forms";
25
+ import * as i24 from "@angular/material/radio";
26
+ import * as i25 from "@angular/material/button-toggle";
27
+ import * as i26 from "@angular/material/table";
28
+ import * as i27 from "@angular-slider/ngx-slider";
29
+ import * as i28 from "ngx-skeleton-loader";
30
+ import * as i29 from "@angular/cdk/scrolling";
31
+ import * as i30 from "ng-circle-progress";
31
32
  export declare class AnnaCoreModule {
32
33
  static ɵfac: i0.ɵɵFactoryDeclaration<AnnaCoreModule, never>;
33
- static ɵmod: i0.ɵɵNgModuleDeclaration<AnnaCoreModule, [typeof i1.AnnaNoDataComponent, typeof i2.AnnaFilterSearchedTextPipe, typeof i3.AnnaConvertZeroOrNullOrUndefinedPipe, typeof i4.AnnaTypeofDataPipe, typeof i2.AnnaFilterSearchedTextPipe, typeof i5.AnnaReplaceCharPipe, typeof i6.AnnaBuyerApprovalIconTemplateComponent, typeof i7.AnnaLiveIconTemplateComponent, typeof i8.AnnaNotifyIconTemplateComponent, typeof i9.AnnaPayForPerformanceIconTemplateComponent, typeof i10.AnnaRejectedIconTemplateComponent, typeof i11.showEllipsisTextOnHoverDirective, typeof i12.AnnaIconColumnComponent, typeof i13.AnnaWeekCalendarComponent, typeof i14.AnnaCalendarFilterComponent, typeof i15.AnnaSortComponent, typeof i16.AnnaVirtualTableDirective, typeof i17.AnnaNonEditableGenericTableComponent, typeof i18.AnnaTableVirtualScrollViewportComponent, typeof i19.AnnaFixedRowSizeTableVirtualScrollStrategyDirective], [typeof i20.CommonModule, typeof i21.NgbModule, typeof i22.FormsModule, typeof i23.MatRadioModule, typeof i24.MatButtonToggleModule, typeof i25.MatTableModule, typeof i26.NgxSliderModule, typeof i27.NgxSkeletonLoaderModule, typeof i28.ScrollingModule, typeof i29.NgCircleProgressModule], [typeof i1.AnnaNoDataComponent, typeof i2.AnnaFilterSearchedTextPipe, typeof i3.AnnaConvertZeroOrNullOrUndefinedPipe, typeof i4.AnnaTypeofDataPipe, typeof i5.AnnaReplaceCharPipe, typeof i2.AnnaFilterSearchedTextPipe, typeof i6.AnnaBuyerApprovalIconTemplateComponent, typeof i7.AnnaLiveIconTemplateComponent, typeof i8.AnnaNotifyIconTemplateComponent, typeof i9.AnnaPayForPerformanceIconTemplateComponent, typeof i10.AnnaRejectedIconTemplateComponent, typeof i11.showEllipsisTextOnHoverDirective, typeof i12.AnnaIconColumnComponent, typeof i13.AnnaWeekCalendarComponent, typeof i14.AnnaCalendarFilterComponent, typeof i15.AnnaSortComponent, typeof i16.AnnaVirtualTableDirective, typeof i17.AnnaNonEditableGenericTableComponent, typeof i18.AnnaTableVirtualScrollViewportComponent, typeof i19.AnnaFixedRowSizeTableVirtualScrollStrategyDirective]>;
34
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AnnaCoreModule, [typeof i1.AnnaNoDataComponent, typeof i2.AnnaFilterSearchedTextPipe, typeof i3.AnnaConvertZeroOrNullOrUndefinedPipe, typeof i4.AnnaTypeofDataPipe, typeof i2.AnnaFilterSearchedTextPipe, typeof i5.AnnaReplaceCharPipe, typeof i6.AnnaBuyerApprovalIconTemplateComponent, typeof i7.AnnaLiveIconTemplateComponent, typeof i8.AnnaNotifyIconTemplateComponent, typeof i9.AnnaPayForPerformanceIconTemplateComponent, typeof i10.AnnaRejectedIconTemplateComponent, typeof i11.showEllipsisTextOnHoverDirective, typeof i12.AnnaIconColumnComponent, typeof i13.AnnaWeekCalendarComponent, typeof i14.AnnaCalendarFilterComponent, typeof i15.AnnaSortComponent, typeof i16.AnnaVirtualTableDirective, typeof i17.AnnaNonEditableGenericTableComponent, typeof i18.AnnaTableVirtualScrollViewportComponent, typeof i19.AnnaFixedRowSizeTableVirtualScrollStrategyDirective, typeof i20.DigitOnlyDirective], [typeof i21.CommonModule, typeof i22.NgbModule, typeof i23.FormsModule, typeof i24.MatRadioModule, typeof i25.MatButtonToggleModule, typeof i26.MatTableModule, typeof i27.NgxSliderModule, typeof i28.NgxSkeletonLoaderModule, typeof i29.ScrollingModule, typeof i30.NgCircleProgressModule], [typeof i1.AnnaNoDataComponent, typeof i2.AnnaFilterSearchedTextPipe, typeof i3.AnnaConvertZeroOrNullOrUndefinedPipe, typeof i4.AnnaTypeofDataPipe, typeof i5.AnnaReplaceCharPipe, typeof i2.AnnaFilterSearchedTextPipe, typeof i6.AnnaBuyerApprovalIconTemplateComponent, typeof i7.AnnaLiveIconTemplateComponent, typeof i8.AnnaNotifyIconTemplateComponent, typeof i9.AnnaPayForPerformanceIconTemplateComponent, typeof i10.AnnaRejectedIconTemplateComponent, typeof i11.showEllipsisTextOnHoverDirective, typeof i12.AnnaIconColumnComponent, typeof i13.AnnaWeekCalendarComponent, typeof i14.AnnaCalendarFilterComponent, typeof i15.AnnaSortComponent, typeof i16.AnnaVirtualTableDirective, typeof i17.AnnaNonEditableGenericTableComponent, typeof i18.AnnaTableVirtualScrollViewportComponent, typeof i19.AnnaFixedRowSizeTableVirtualScrollStrategyDirective, typeof i20.DigitOnlyDirective]>;
34
35
  static ɵinj: i0.ɵɵInjectorDeclaration<AnnaCoreModule>;
35
36
  }
@@ -1,5 +1,5 @@
1
1
  import { OnInit, QueryList, EventEmitter, SimpleChanges, OnChanges, ChangeDetectorRef, ElementRef, AfterViewChecked } from '@angular/core';
2
- import moment from "moment";
2
+ import dayjs from "dayjs";
3
3
  import { Options } from '@angular-slider/ngx-slider';
4
4
  import { IGtGeneralConfig, IGtTableHeader, IHeaderInfo, ITotalRowInfo } from '../../../anna-core-shared-lib/models/anna-non-editable-gt-models';
5
5
  import { AnnaDateTimeFormatService, NgbDateType } from '../../../anna-core-shared-lib/services/anna-date-time-format.service';
@@ -175,8 +175,8 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
175
175
  createListForCheckboxFilter(header: string): TooltipModel[];
176
176
  selectUnselectListCheckbox(tooltipOptions: TooltipModel[], header: string): void;
177
177
  getCalendarData(): void;
178
- createRangeForTheDateFilter(): moment.Moment[];
179
- createStartEndDateRange(optionData: any[]): moment.Moment[];
178
+ createRangeForTheDateFilter(): dayjs.Dayjs[];
179
+ createStartEndDateRange(optionData: any[]): dayjs.Dayjs[];
180
180
  selectRangeForTheDateFilter(minMaxDate: any[], parsingFormat: string): void;
181
181
  getTimeFilterData(header: string): void;
182
182
  setTimeFilterDataForComponentsOtherThanRatingsPage(header: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annalib/anna-core",
3
- "version": "4.3.8",
3
+ "version": "4.4.0",
4
4
  "peerDependencies": {
5
5
  "@angular-slider/ngx-slider": "2.0.3",
6
6
  "@angular/common": "^13.2.0",
@@ -8,7 +8,7 @@
8
8
  "@angular/material": "^13.2.6",
9
9
  "@ng-bootstrap/ng-bootstrap": "^9.0.1",
10
10
  "lodash-es": "^4.17.21",
11
- "moment": "^2.24.0",
11
+ "dayjs": "^1.11.6",
12
12
  "ngx-skeleton-loader": "^2.10.1",
13
13
  "ng-circle-progress": "^1.6.0"
14
14
  },
package/public-api.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from "./lib/anna-core-shared-lib/services/anna-global-config.service";
11
11
  export * from "./lib/anna-core-shared-lib/services/anna-filter.service";
12
12
  export * from "./lib/anna-core-shared-lib/services/anna-sort.service";
13
13
  export * from "./lib/anna-core-shared-lib/services/anna-generic-table.service";
14
+ export * from "./lib/anna-core-shared-lib/services/anna-number-format.service";
14
15
  export * from "./lib/anna-core-shared-lib/models/anna-generic-data-type.model";
15
16
  export * from "./lib/anna-core-shared-lib/models/anna-global-dropdown-config.model";
16
17
  export * from "./lib/anna-core-shared-lib/models/anna-non-editable-gt-models";
@@ -22,6 +23,7 @@ export * from "./lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined
22
23
  export * from "./lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe";
23
24
  export * from "./lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe";
24
25
  export * from "./lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive";
26
+ export * from './lib/anna-core-shared-lib/directives/digits-only/digits-only.directive';
25
27
  export * from "./lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component";
26
28
  export * from "./lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component";
27
29
  export * from "./lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component";