@acorex/core 20.2.0-next.1 → 20.2.0-next.3

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.
@@ -188,6 +188,7 @@ declare class AXDateTimeFormatter implements AXFormatter {
188
188
  interface AXHolidayDate {
189
189
  date: Date;
190
190
  title: string;
191
+ cssClass?: string;
191
192
  description?: string;
192
193
  [key: string]: unknown;
193
194
  }
@@ -277,7 +278,7 @@ declare class AXTimeDurationFormatter implements AXFormatter {
277
278
  get name(): string;
278
279
  format(value: number, options?: AXTimeDurationFormatterOptions): string;
279
280
  translationService: AXTranslationService;
280
- millisecondsToMask(ms: number, startUnit?: AXTimeDurationUnit, endUnit?: AXTimeDurationUnit): Promise<string>;
281
+ millisecondsToMask(ms: number, startUnit?: AXTimeDurationUnit, endUnit?: AXTimeDurationUnit, label?: boolean): Promise<string>;
281
282
  static ɵfac: i0.ɵɵFactoryDeclaration<AXTimeDurationFormatter, never>;
282
283
  static ɵprov: i0.ɵɵInjectableDeclaration<AXTimeDurationFormatter>;
283
284
  }
@@ -1424,7 +1424,7 @@ class AXTimeDurationFormatter {
1424
1424
  // Join the parts according to the format
1425
1425
  return formattedTime.join(format.includes('ms') || format.includes('MS') ? ':' : ':');
1426
1426
  }
1427
- async millisecondsToMask(ms, startUnit = 'YEAR', endUnit = 'MILLISECOND') {
1427
+ async millisecondsToMask(ms, startUnit = 'YEAR', endUnit = 'MILLISECOND', label = false) {
1428
1428
  if (ms <= 0)
1429
1429
  return '';
1430
1430
  const translations = await Promise.all([
@@ -1459,26 +1459,31 @@ class AXTimeDurationFormatter {
1459
1459
  // Special handling for milliseconds (3 digits)
1460
1460
  if (unit.key === 'MILLISECOND') {
1461
1461
  if (count < 10) {
1462
- return `00${count} (${unit.label})`;
1462
+ return label ? `00${count} (${unit.label})` : `00${count}`;
1463
1463
  }
1464
1464
  else if (count < 100) {
1465
- return `0${count} (${unit.label})`;
1465
+ return label ? `0${count} (${unit.label})` : `0${count}`;
1466
1466
  }
1467
1467
  else {
1468
- return `${count} (${unit.label})`;
1468
+ return label ? `${count} (${unit.label})` : `${count}`;
1469
1469
  }
1470
1470
  }
1471
1471
  else {
1472
1472
  // For other units, pad with one zero if less than 10
1473
1473
  const paddedCount = count < 10 ? `0${count}` : `${count}`;
1474
- return `${paddedCount} (${unit.label})`;
1474
+ return label ? `${paddedCount} (${unit.label})` : `${paddedCount}`;
1475
1475
  }
1476
1476
  });
1477
- if (this.translationService.getActiveLang() === 'fa-IR') {
1478
- return result.reverse().join(' : ');
1477
+ if (label) {
1478
+ if (this.translationService.getActiveLang() === 'fa-IR') {
1479
+ return result.reverse().join(' : ');
1480
+ }
1481
+ else {
1482
+ return result.join(' : ');
1483
+ }
1479
1484
  }
1480
1485
  else {
1481
- return result.join(' : ');
1486
+ return result.join(':');
1482
1487
  }
1483
1488
  }
1484
1489
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXTimeDurationFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }