@acorex/core 18.4.4 → 18.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/date-time/index.d.ts +2 -2
  2. package/esm2022/config/lib/configs.mjs +1 -1
  3. package/esm2022/date-time/index.mjs +3 -3
  4. package/esm2022/date-time/lib/dateTime.config.mjs +1 -1
  5. package/esm2022/date-time/lib/datetime.pipe.mjs +1 -1
  6. package/esm2022/date-time/lib/formatters/datetime-formatter.mjs +1 -1
  7. package/esm2022/date-time/lib/georgian.calendar.mjs +4 -9
  8. package/esm2022/date-time/lib/holidays.loader.mjs +1 -1
  9. package/esm2022/date-time/lib/jalali.calendar.mjs +10 -33
  10. package/esm2022/file/index.mjs +3 -3
  11. package/esm2022/file/lib/file-download-ref.class.mjs +1 -1
  12. package/esm2022/file/lib/file-upload-ref.class.mjs +1 -1
  13. package/esm2022/format/index.mjs +2 -2
  14. package/esm2022/format/lib/format.module.mjs +2 -2
  15. package/esm2022/format/lib/format.pipe.mjs +4 -8
  16. package/esm2022/image/lib/image.service.mjs +1 -1
  17. package/esm2022/pipes/lib/safe/safe.pipe.mjs +2 -2
  18. package/esm2022/platform/lib/platform.service.mjs +2 -1
  19. package/esm2022/storage/cookie-storage.service.mjs +5 -11
  20. package/esm2022/translation/index.mjs +3 -3
  21. package/esm2022/translation/lib/translation-scope.resolver.mjs +2 -2
  22. package/esm2022/translation/lib/translation.config.mjs +1 -1
  23. package/esm2022/translation/lib/translation.loader.mjs +1 -1
  24. package/esm2022/translation/lib/translation.module.mjs +4 -4
  25. package/esm2022/translation/lib/translator.directive.mjs +2 -2
  26. package/esm2022/translation/lib/translator.pipe.mjs +2 -2
  27. package/esm2022/utils/lib/auto-unsubscribe.mjs +1 -1
  28. package/esm2022/utils/lib/color-util.mjs +2 -4
  29. package/esm2022/utils/lib/drawing-util.mjs +4 -10
  30. package/esm2022/utils/lib/string-util.mjs +1 -1
  31. package/esm2022/validation/lib/rules/between-rule.mjs +2 -2
  32. package/esm2022/validation/lib/rules/equal-rule.mjs +2 -2
  33. package/esm2022/validation/lib/rules/greater-than.mjs +3 -7
  34. package/esm2022/validation/lib/rules/length-rule.mjs +2 -5
  35. package/esm2022/validation/lib/rules/less-than-rule.mjs +3 -7
  36. package/esm2022/validation/lib/rules/maxlength-rule.mjs +3 -6
  37. package/esm2022/validation/lib/rules/minlength-rule.mjs +3 -6
  38. package/esm2022/validation/lib/rules/regex-rule.mjs +5 -8
  39. package/esm2022/validation/lib/rules/required-rule.mjs +6 -4
  40. package/esm2022/validation/lib/validation.config.mjs +1 -1
  41. package/esm2022/validation/lib/validation.module.mjs +10 -10
  42. package/esm2022/validation/lib/validation.service.mjs +3 -3
  43. package/esm2022/validation/lib/validation.types.mjs +1 -1
  44. package/fesm2022/acorex-core-config.mjs.map +1 -1
  45. package/fesm2022/acorex-core-date-time.mjs +87 -115
  46. package/fesm2022/acorex-core-date-time.mjs.map +1 -1
  47. package/fesm2022/acorex-core-file.mjs +42 -42
  48. package/fesm2022/acorex-core-file.mjs.map +1 -1
  49. package/fesm2022/acorex-core-format.mjs +2 -6
  50. package/fesm2022/acorex-core-format.mjs.map +1 -1
  51. package/fesm2022/acorex-core-image.mjs.map +1 -1
  52. package/fesm2022/acorex-core-pipes.mjs.map +1 -1
  53. package/fesm2022/acorex-core-platform.mjs +1 -0
  54. package/fesm2022/acorex-core-platform.mjs.map +1 -1
  55. package/fesm2022/acorex-core-storage.mjs +4 -10
  56. package/fesm2022/acorex-core-storage.mjs.map +1 -1
  57. package/fesm2022/acorex-core-translation.mjs +27 -27
  58. package/fesm2022/acorex-core-translation.mjs.map +1 -1
  59. package/fesm2022/acorex-core-utils.mjs +4 -12
  60. package/fesm2022/acorex-core-utils.mjs.map +1 -1
  61. package/fesm2022/acorex-core-validation.mjs +11 -29
  62. package/fesm2022/acorex-core-validation.mjs.map +1 -1
  63. package/file/index.d.ts +2 -2
  64. package/format/index.d.ts +1 -1
  65. package/format/lib/format.pipe.d.ts +1 -1
  66. package/package.json +17 -17
  67. package/platform/lib/platform.service.d.ts +1 -1
  68. package/translation/index.d.ts +2 -2
  69. package/translation/lib/translation.loader.d.ts +1 -1
  70. package/translation/lib/translator.pipe.d.ts +1 -1
  71. package/validation/lib/validation.service.d.ts +2 -2
@@ -1,3 +1,3 @@
1
1
  export class AXValidationRule {
2
2
  }
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGlvbi50eXBlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS92YWxpZGF0aW9uL3NyYy9saWIvdmFsaWRhdGlvbi50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFTQSxNQUFNLE9BQWdCLGdCQUFnQjtDQU1yQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgQVhWYWxpZGF0aW9uUnVsZU9wdGlvbnMge1xuICBtZXNzYWdlPzogc3RyaW5nO1xuICBba2V5OiBzdHJpbmddOiB1bmtub3duO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEFYVmFsaWRhdGlvblJ1bGVPcHRpb25zTWFwIHtcbiAgLy8gaW5pdGlhbGx5IGVtcHR5LCBidXQgd2lsbCBiZSBleHRlbmRlZCBieSBvdGhlciBtb2R1bGVzXG59XG5cbmV4cG9ydCBhYnN0cmFjdCBjbGFzcyBBWFZhbGlkYXRpb25SdWxlIHtcbiAgYWJzdHJhY3QgZ2V0IG5hbWUoKTogc3RyaW5nO1xuICBhYnN0cmFjdCB2YWxpZGF0ZShcbiAgICB2YWx1ZTogdW5rbm93bixcbiAgICBvcHRpb25zPzogQVhWYWxpZGF0aW9uUnVsZU9wdGlvbnNcbiAgKTogUHJvbWlzZTxBWFZhbGlkYXRpb25SdWxlUmVzdWx0Pjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBBWFZhbGlkYXRpb25SdWxlUmVzdWx0IHt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zKTogUHJvbWlzZTxBWFZhbGlkYXRpb25SdWxlUmVzdWx0Pjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBBWFZhbGlkYXRpb25SdWxlUmVzdWx0IHtcbiAgcnVsZTogc3RyaW5nO1xuICB2YWx1ZT86IHVua25vd247XG4gIG1lc3NhZ2U/OiBzdHJpbmcgfCBudWxsO1xuICByZXN1bHQ6IGJvb2xlYW47XG4gIFtrZXk6IHN0cmluZ106IHVua25vd247XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgQVhWYWxpZGF0aW9uU3VtbWFyeSB7XG4gIHJlc3VsdDogYm9vbGVhbjtcbiAgcnVsZXM6IEFYVmFsaWRhdGlvblJ1bGVSZXN1bHRbXTtcbn1cbiJdfQ==
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-config.mjs","sources":["../../../../libs/core/config/src/lib/configs.ts","../../../../libs/core/config/src/lib/configs.service.ts","../../../../libs/core/config/src/acorex-core-config.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type AXGlobalConfig = {\n [key: string]: unknown;\n};\n\nexport const AXGlobalDefaultConfig: AXGlobalConfig = {};\n\nexport const AX_GLOBAL_CONFIG = new InjectionToken<AXGlobalConfig>(\n 'AX_GLOBAL_CONFIG',\n {\n providedIn: 'root',\n factory: () => AXGlobalDefaultConfig,\n }\n);\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { get } from 'lodash-es';\nimport { AX_GLOBAL_CONFIG } from './configs';\n\n@Injectable({ providedIn: 'root' })\nexport class AXConfigService {\n /**\n * @ignore\n */\n constructor(private injector: Injector) {}\n\n public get<T = string>(key: string, defaultValue?: T) {\n const v1 = this.injector.get(AX_GLOBAL_CONFIG);\n const parts = key.split('.');\n const tokenName = parts.slice(0, parts.length - 1).join('.');\n const providerToken = get(v1, tokenName);\n const v2 = this.injector.get(providerToken as InjectionToken<unknown>);\n return get(v2, parts[parts.length - 1], defaultValue);\n }\n}\n","/**\n * Generated bundle index. Do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EAAA,IAAA,EAAA,eAAe,cADF,MAAM,EAAA,CAAA,CAAA,EAAA;;2FACnB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACJlC;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-config.mjs","sources":["../../../../libs/core/config/src/lib/configs.ts","../../../../libs/core/config/src/lib/configs.service.ts","../../../../libs/core/config/src/acorex-core-config.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport type AXGlobalConfig = {\n [key: string]: unknown;\n};\n\nexport const AXGlobalDefaultConfig: AXGlobalConfig = {};\n\nexport const AX_GLOBAL_CONFIG = new InjectionToken<AXGlobalConfig>('AX_GLOBAL_CONFIG', {\n providedIn: 'root',\n factory: () => AXGlobalDefaultConfig,\n});\n","import { Injectable, InjectionToken, Injector } from '@angular/core';\nimport { get } from 'lodash-es';\nimport { AX_GLOBAL_CONFIG } from './configs';\n\n@Injectable({ providedIn: 'root' })\nexport class AXConfigService {\n /**\n * @ignore\n */\n constructor(private injector: Injector) {}\n\n public get<T = string>(key: string, defaultValue?: T) {\n const v1 = this.injector.get(AX_GLOBAL_CONFIG);\n const parts = key.split('.');\n const tokenName = parts.slice(0, parts.length - 1).join('.');\n const providerToken = get(v1, tokenName);\n const v2 = this.injector.get(providerToken as InjectionToken<unknown>);\n return get(v2, parts[parts.length - 1], defaultValue);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAMO,MAAM,qBAAqB,GAAmB,GAAG;MAE3C,gBAAgB,GAAG,IAAI,cAAc,CAAiB,kBAAkB,EAAE;AACrF,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,qBAAqB;AACrC,CAAA;;MCNY,eAAe,CAAA;AAC1B;;AAEG;AACH,IAAA,WAAA,CAAoB,QAAkB,EAAA;QAAlB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;KAAI;IAEnC,GAAG,CAAa,GAAW,EAAE,YAAgB,EAAA;QAClD,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7B,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7D,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACzC,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAwC,CAAC,CAAC;AACvE,QAAA,OAAO,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;KACvD;8GAbU,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cADF,MAAM,EAAA,CAAA,CAAA,EAAA;;2FACnB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACJlC;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
+ import { AXEventTypes, AXEventService } from '@acorex/core/events';
1
2
  import * as i0 from '@angular/core';
2
3
  import { InjectionToken, inject, Injectable, Pipe, NgModule } from '@angular/core';
3
- import { AXEventTypes, AXEventService } from '@acorex/core/events';
4
4
  import { BehaviorSubject, Subject } from 'rxjs';
5
5
  import { AX_GLOBAL_CONFIG } from '@acorex/core/config';
6
6
  import { defaults, orderBy, set, isNil } from 'lodash-es';
@@ -376,10 +376,7 @@ class GeorgianCalendar extends AXCalendar {
376
376
  }
377
377
  weekOfYear(date) {
378
378
  const firstDay = new AXDateTime(date, this).startOf('year');
379
- return Math.ceil(((date.getTime() - firstDay.date.getTime()) / 86400000 +
380
- firstDay.date.getDay() +
381
- 1) /
382
- 7);
379
+ return Math.ceil(((date.getTime() - firstDay.date.getTime()) / 86400000 + firstDay.date.getDay() + 1) / 7);
383
380
  }
384
381
  year(date) {
385
382
  return date.getFullYear();
@@ -433,9 +430,7 @@ class GeorgianCalendar extends AXCalendar {
433
430
  newDate.setFullYear(newDate.getFullYear() + amount);
434
431
  // Handling for leap years: if the original date is February 29th, and the new year is not a leap year,
435
432
  // set the date to February 28th.
436
- if (date.getMonth() === 1 &&
437
- date.getDate() === 29 &&
438
- newDate.getMonth() !== 1) {
433
+ if (date.getMonth() === 1 && date.getDate() === 29 && newDate.getMonth() !== 1) {
439
434
  newDate.setMonth(1);
440
435
  newDate.setDate(28);
441
436
  }
@@ -554,10 +549,7 @@ class JalaliCalendar extends AXCalendar {
554
549
  /*
555
550
  Jalaali years starting the 33-year rule.
556
551
  */
557
- this.breaks = [
558
- -61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097,
559
- 2192, 2262, 2324, 2394, 2456, 3178,
560
- ];
552
+ this.breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178];
561
553
  }
562
554
  create(value) {
563
555
  const a = this.toGregorian(value.year, value.month, value.date);
@@ -571,7 +563,7 @@ class JalaliCalendar extends AXCalendar {
571
563
  }
572
564
  dayOfYear(date) {
573
565
  const j = this.toJalaali(date);
574
- return ((j.month <= 6 ? (j.month - 1) * 31 : 6 * 31 + (j.month - 7) * 30) + j.day);
566
+ return (j.month <= 6 ? (j.month - 1) * 31 : 6 * 31 + (j.month - 7) * 30) + j.day;
575
567
  }
576
568
  dayOfWeek(date) {
577
569
  return date.getDay() == 6 ? 1 : date.getDay() + 2;
@@ -579,10 +571,7 @@ class JalaliCalendar extends AXCalendar {
579
571
  weekOfYear(date) {
580
572
  //TODO : apply jalali
581
573
  const firstDay = new AXDateTime(date, this).startOf('year');
582
- return Math.ceil(((date.getTime() - firstDay.date.getTime()) / 86400000 +
583
- firstDay.date.getDay() +
584
- 1) /
585
- 7);
574
+ return Math.ceil(((date.getTime() - firstDay.date.getTime()) / 86400000 + firstDay.date.getDay() + 1) / 7);
586
575
  }
587
576
  year(date) {
588
577
  return this.toJalaali(date).year;
@@ -713,9 +702,7 @@ class JalaliCalendar extends AXCalendar {
713
702
  clone.setHours(0, 0, 0, 0);
714
703
  return new AXDateTime(clone, this);
715
704
  case 'week':
716
- return new AXDateTime(clone, this)
717
- .add('day', -this.dayOfWeek(clone) + 1)
718
- .startOf('day');
705
+ return new AXDateTime(clone, this).add('day', -this.dayOfWeek(clone) + 1).startOf('day');
719
706
  case 'month': {
720
707
  const jy = this.year(date);
721
708
  const jm = this.monthOfYear(date);
@@ -800,12 +787,7 @@ class JalaliCalendar extends AXCalendar {
800
787
  Checks whether a Jalaali date is valid or not.
801
788
  */
802
789
  isValidJalaaliDate(jy, jm, jd) {
803
- return (jy >= -61 &&
804
- jy <= 3177 &&
805
- jm >= 1 &&
806
- jm <= 12 &&
807
- jd >= 1 &&
808
- jd <= this.jalaaliMonthLength(jy, jm));
790
+ return jy >= -61 && jy <= 3177 && jm >= 1 && jm <= 12 && jd >= 1 && jd <= this.jalaaliMonthLength(jy, jm);
809
791
  }
810
792
  /*
811
793
  Is this a leap year or not?
@@ -893,11 +875,7 @@ class JalaliCalendar extends AXCalendar {
893
875
  }
894
876
  j2d(jy, jm, jd) {
895
877
  let r = this.jalCal(jy, true);
896
- return (this.g2d(r.gy, 3, r.march) +
897
- (jm - 1) * 31 -
898
- this.div(jm, 7) * (jm - 7) +
899
- jd -
900
- 1);
878
+ return this.g2d(r.gy, 3, r.march) + (jm - 1) * 31 - this.div(jm, 7) * (jm - 7) + jd - 1;
901
879
  }
902
880
  d2j(jdn) {
903
881
  let gy = this.d2g(jdn).gy, // Calculate Gregorian year (gy).
@@ -936,14 +914,8 @@ class JalaliCalendar extends AXCalendar {
936
914
  };
937
915
  }
938
916
  g2d(gy, gm, gd) {
939
- let d = this.div((gy + this.div(gm - 8, 6) + 100100) * 1461, 4) +
940
- this.div(153 * this.mod(gm + 9, 12) + 2, 5) +
941
- gd -
942
- 34840408;
943
- d =
944
- d -
945
- this.div(this.div(gy + 100100 + this.div(gm - 8, 6), 100) * 3, 4) +
946
- 752;
917
+ let d = this.div((gy + this.div(gm - 8, 6) + 100100) * 1461, 4) + this.div(153 * this.mod(gm + 9, 12) + 2, 5) + gd - 34840408;
918
+ d = d - this.div(this.div(gy + 100100 + this.div(gm - 8, 6), 100) * 3, 4) + 752;
947
919
  return d;
948
920
  }
949
921
  d2g(jdn) {
@@ -1127,6 +1099,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
1127
1099
  args: [{ providedIn: 'root' }]
1128
1100
  }], ctorParameters: () => [] });
1129
1101
 
1102
+ /**
1103
+ * @deprecated The pipe should not be used, use format instead
1104
+ */
1105
+ class AXDateTimePipe {
1106
+ constructor() {
1107
+ this._calendarService = inject(AXCalendarService);
1108
+ }
1109
+ transform(value, format, calendarName) {
1110
+ if (value == null) {
1111
+ return '';
1112
+ }
1113
+ let calendar = this._calendarService.calendar;
1114
+ if (calendarName) {
1115
+ calendar = this._calendarService.resolveCalendar(calendarName);
1116
+ }
1117
+ const val = this._calendarService.convert(value, calendar.name());
1118
+ return val.format(format);
1119
+ }
1120
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1121
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.0.2", ngImport: i0, type: AXDateTimePipe, name: "axDate" }); }
1122
+ }
1123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXDateTimePipe, decorators: [{
1124
+ type: Pipe,
1125
+ args: [{ name: 'axDate' }]
1126
+ }] });
1127
+
1130
1128
  class AXDateTimeFormatter {
1131
1129
  constructor() {
1132
1130
  this.calendarService = inject(AXCalendarService);
@@ -1156,6 +1154,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
1156
1154
  type: Injectable
1157
1155
  }] });
1158
1156
 
1157
+ class AXTimeDurationFormatter {
1158
+ get name() {
1159
+ return 'time-duration';
1160
+ }
1161
+ format(value, options) {
1162
+ const milliseconds = Number(value);
1163
+ if (milliseconds === null || isNaN(milliseconds)) {
1164
+ return '...';
1165
+ }
1166
+ // Convert milliseconds to various units
1167
+ const totalMilliseconds = milliseconds % 1000;
1168
+ const totalSeconds = Math.floor(milliseconds / 1000);
1169
+ const seconds = totalSeconds % 60;
1170
+ const totalMinutes = Math.floor(totalSeconds / 60);
1171
+ const minutes = totalMinutes % 60;
1172
+ const totalHours = Math.floor(totalMinutes / 60);
1173
+ // Helper function for zero-padding
1174
+ const pad = (num, length = 2) => num.toString().padStart(length, '0');
1175
+ // Default format if none provided
1176
+ const format = options?.format || (totalHours >= 0 ? 'HH:mm:ss' : 'mm:ss');
1177
+ const formattedTime = [];
1178
+ // Parse format and build the time string accordingly
1179
+ if (format.includes('HH') || format.includes('H')) {
1180
+ formattedTime.push(pad(totalHours));
1181
+ }
1182
+ if (format.includes('mm')) {
1183
+ formattedTime.push(pad(minutes));
1184
+ }
1185
+ else if (format.includes('m')) {
1186
+ formattedTime.push(minutes.toString());
1187
+ }
1188
+ if (format.includes('ss')) {
1189
+ formattedTime.push(pad(seconds));
1190
+ }
1191
+ else if (format.includes('s')) {
1192
+ formattedTime.push(seconds.toString());
1193
+ }
1194
+ if (format.includes('ms') || format.includes('MS')) {
1195
+ formattedTime.push(pad(totalMilliseconds, 3));
1196
+ }
1197
+ // Join the parts according to the format
1198
+ return formattedTime.join(format.includes('ms') || format.includes('MS') ? ':' : ':');
1199
+ }
1200
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXTimeDurationFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1201
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXTimeDurationFormatter }); }
1202
+ }
1203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXTimeDurationFormatter, decorators: [{
1204
+ type: Injectable
1205
+ }] });
1206
+
1159
1207
  class AXTimeLeftFormatter {
1160
1208
  get name() {
1161
1209
  return 'timeleft';
@@ -1244,82 +1292,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
1244
1292
  type: Injectable
1245
1293
  }] });
1246
1294
 
1247
- /**
1248
- * @deprecated The pipe should not be used, use format instead
1249
- */
1250
- class AXDateTimePipe {
1251
- constructor() {
1252
- this._calendarService = inject(AXCalendarService);
1253
- }
1254
- transform(value, format, calendarName) {
1255
- if (value == null) {
1256
- return '';
1257
- }
1258
- let calendar = this._calendarService.calendar;
1259
- if (calendarName) {
1260
- calendar = this._calendarService.resolveCalendar(calendarName);
1261
- }
1262
- const val = this._calendarService.convert(value, calendar.name());
1263
- return val.format(format);
1264
- }
1265
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1266
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.0.2", ngImport: i0, type: AXDateTimePipe, name: "axDate" }); }
1267
- }
1268
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXDateTimePipe, decorators: [{
1269
- type: Pipe,
1270
- args: [{ name: 'axDate' }]
1271
- }] });
1272
-
1273
- class AXTimeDurationFormatter {
1274
- get name() {
1275
- return 'time-duration';
1276
- }
1277
- format(value, options) {
1278
- const milliseconds = Number(value);
1279
- if (milliseconds === null || isNaN(milliseconds)) {
1280
- return '...';
1281
- }
1282
- // Convert milliseconds to various units
1283
- const totalMilliseconds = milliseconds % 1000;
1284
- const totalSeconds = Math.floor(milliseconds / 1000);
1285
- const seconds = totalSeconds % 60;
1286
- const totalMinutes = Math.floor(totalSeconds / 60);
1287
- const minutes = totalMinutes % 60;
1288
- const totalHours = Math.floor(totalMinutes / 60);
1289
- // Helper function for zero-padding
1290
- const pad = (num, length = 2) => num.toString().padStart(length, '0');
1291
- // Default format if none provided
1292
- const format = options?.format || (totalHours >= 0 ? 'HH:mm:ss' : 'mm:ss');
1293
- const formattedTime = [];
1294
- // Parse format and build the time string accordingly
1295
- if (format.includes('HH') || format.includes('H')) {
1296
- formattedTime.push(pad(totalHours));
1297
- }
1298
- if (format.includes('mm')) {
1299
- formattedTime.push(pad(minutes));
1300
- }
1301
- else if (format.includes('m')) {
1302
- formattedTime.push(minutes.toString());
1303
- }
1304
- if (format.includes('ss')) {
1305
- formattedTime.push(pad(seconds));
1306
- }
1307
- else if (format.includes('s')) {
1308
- formattedTime.push(seconds.toString());
1309
- }
1310
- if (format.includes('ms') || format.includes('MS')) {
1311
- formattedTime.push(pad(totalMilliseconds, 3));
1312
- }
1313
- // Join the parts according to the format
1314
- return formattedTime.join(format.includes('ms') || format.includes('MS') ? ':' : ':');
1315
- }
1316
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXTimeDurationFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1317
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXTimeDurationFormatter }); }
1318
- }
1319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXTimeDurationFormatter, decorators: [{
1320
- type: Injectable
1321
- }] });
1322
-
1323
1295
  class AXDateTimeModule {
1324
1296
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1325
1297
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.2", ngImport: i0, type: AXDateTimeModule, declarations: [AXDateTimePipe], imports: [i1.AXFormatModule], exports: [AXDateTimePipe] }); }