@acorex/core 22.1.0-next.31 → 22.1.0-next.33

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 (57) hide show
  1. package/constants/README.md +7 -1
  2. package/fesm2022/acorex-core-components.mjs +3 -3
  3. package/fesm2022/acorex-core-config.mjs +3 -3
  4. package/fesm2022/acorex-core-constants.mjs +27809 -1
  5. package/fesm2022/acorex-core-constants.mjs.map +1 -1
  6. package/fesm2022/acorex-core-date-time.mjs +55 -41
  7. package/fesm2022/acorex-core-date-time.mjs.map +1 -1
  8. package/fesm2022/acorex-core-events.mjs +3 -3
  9. package/fesm2022/acorex-core-file.mjs +53 -46
  10. package/fesm2022/acorex-core-file.mjs.map +1 -1
  11. package/fesm2022/acorex-core-format.mjs +19 -19
  12. package/fesm2022/acorex-core-full-screen.mjs +232 -59
  13. package/fesm2022/acorex-core-full-screen.mjs.map +1 -1
  14. package/fesm2022/acorex-core-icon.mjs +3 -3
  15. package/fesm2022/acorex-core-image.mjs +3 -3
  16. package/fesm2022/acorex-core-locale.mjs +13 -10
  17. package/fesm2022/acorex-core-locale.mjs.map +1 -1
  18. package/fesm2022/acorex-core-network.mjs +3 -3
  19. package/fesm2022/acorex-core-pipes.mjs +3 -3
  20. package/fesm2022/acorex-core-platform.mjs +4 -3
  21. package/fesm2022/acorex-core-platform.mjs.map +1 -1
  22. package/fesm2022/acorex-core-storage.mjs +9 -9
  23. package/fesm2022/acorex-core-theme-builder.mjs +1329 -0
  24. package/fesm2022/acorex-core-theme-builder.mjs.map +1 -0
  25. package/fesm2022/acorex-core-translation.mjs +36 -24
  26. package/fesm2022/acorex-core-translation.mjs.map +1 -1
  27. package/fesm2022/acorex-core-utils.mjs +256 -80
  28. package/fesm2022/acorex-core-utils.mjs.map +1 -1
  29. package/fesm2022/acorex-core-validation.mjs +40 -40
  30. package/fesm2022/acorex-core-z-index.mjs +3 -3
  31. package/i18n/en-AU/acorex.json +1101 -0
  32. package/i18n/en-AU/common.json +290 -0
  33. package/i18n/en-US/acorex.json +1101 -0
  34. package/i18n/en-US/common.json +285 -0
  35. package/i18n/fa-IR/acorex.json +1101 -0
  36. package/i18n/fa-IR/common.json +284 -0
  37. package/package.json +8 -2
  38. package/theme-builder/README.md +53 -0
  39. package/types/acorex-core-components.d.ts +1 -1
  40. package/types/acorex-core-config.d.ts +1 -1
  41. package/types/acorex-core-constants.d.ts +58 -2
  42. package/types/acorex-core-date-time.d.ts +9 -4
  43. package/types/acorex-core-events.d.ts +1 -1
  44. package/types/acorex-core-file.d.ts +12 -11
  45. package/types/acorex-core-format.d.ts +3 -3
  46. package/types/acorex-core-full-screen.d.ts +67 -18
  47. package/types/acorex-core-icon.d.ts +1 -1
  48. package/types/acorex-core-image.d.ts +1 -1
  49. package/types/acorex-core-locale.d.ts +4 -2
  50. package/types/acorex-core-network.d.ts +1 -1
  51. package/types/acorex-core-platform.d.ts +1 -1
  52. package/types/acorex-core-storage.d.ts +3 -3
  53. package/types/acorex-core-theme-builder.d.ts +42 -0
  54. package/types/acorex-core-translation.d.ts +12 -6
  55. package/types/acorex-core-utils.d.ts +54 -16
  56. package/types/acorex-core-validation.d.ts +12 -12
  57. package/types/acorex-core-z-index.d.ts +1 -1
@@ -76,9 +76,9 @@ class AXDateTime {
76
76
  // 01 02 ... 11 12
77
77
  MM: () => this.pad(this.calendar.monthOfYear(this.date), 2),
78
78
  // Jan Feb ... Nov Dec
79
- MMM: () => translateSync(`@acorex:dateTime.months.${this.calendar.name()}.short.${this.calendar.monthOfYear(this.date) - 1}`),
79
+ MMM: () => translateSync(`dateTime.months.${this.calendar.name()}.short.${this.calendar.monthOfYear(this.date) - 1}`),
80
80
  // January February ... November December
81
- MMMM: () => translateSync(`@acorex:dateTime.months.${this.calendar.name()}.long.${this.calendar.monthOfYear(this.date) - 1}`),
81
+ MMMM: () => translateSync(`dateTime.months.${this.calendar.name()}.long.${this.calendar.monthOfYear(this.date) - 1}`),
82
82
  // 1 2 ... 7
83
83
  E: () => this.calendar.dayOfWeek(this.date).toString(),
84
84
  // 01 02 ... 07
@@ -554,12 +554,24 @@ class AXGregorianCalendar extends AXCalendar {
554
554
  break;
555
555
  case 'week':
556
556
  break;
557
- case 'month':
558
- clone.setMonth(Math.max(0, value - 1));
557
+ case 'month': {
558
+ const newMonth = Math.max(0, value - 1);
559
+ const lastDayOfMonth = new Date(clone.getFullYear(), newMonth + 1, 0).getDate();
560
+ const day = Math.min(clone.getDate(), lastDayOfMonth);
561
+ // Set to the 1st first so native Date does not overflow (e.g. Jan 31 → Feb).
562
+ clone.setDate(1);
563
+ clone.setMonth(newMonth);
564
+ clone.setDate(day);
559
565
  break;
560
- case 'year':
566
+ }
567
+ case 'year': {
568
+ const isFeb29 = clone.getMonth() === 1 && clone.getDate() === 29;
561
569
  clone.setFullYear(value);
570
+ if (isFeb29 && clone.getMonth() !== 1) {
571
+ clone.setMonth(1, 28);
572
+ }
562
573
  break;
574
+ }
563
575
  }
564
576
  return new AXDateTime(clone, this);
565
577
  }
@@ -778,10 +790,7 @@ class AXSolarHijriCalendar extends AXCalendar {
778
790
  default:
779
791
  case 'day': {
780
792
  const gDate = this.toGregorian(jDate.year, jDate.month, value);
781
- clone.setFullYear(gDate.getFullYear());
782
- clone.setMonth(gDate.getMonth());
783
- clone.setDate(gDate.getDate());
784
- break;
793
+ return this.withCivilDate(clone, gDate);
785
794
  }
786
795
  case 'week':
787
796
  break;
@@ -789,19 +798,24 @@ class AXSolarHijriCalendar extends AXCalendar {
789
798
  const lastDay = this.SolarHijriMonthLength(jDate.year, value);
790
799
  const day = Math.min(jDate.day, lastDay);
791
800
  const gDate2 = this.toGregorian(jDate.year, value, day);
792
- clone.setFullYear(gDate2.getFullYear());
793
- clone.setMonth(gDate2.getMonth());
794
- clone.setDate(gDate2.getDate());
795
- break;
801
+ return this.withCivilDate(clone, gDate2);
796
802
  }
797
803
  case 'year': {
798
- const gDate3 = this.toGregorian(value, jDate.month, jDate.day);
799
- clone.setFullYear(gDate3.getFullYear());
800
- break;
804
+ const lastDay = this.SolarHijriMonthLength(value, jDate.month);
805
+ const day = Math.min(jDate.day, lastDay);
806
+ const gDate3 = this.toGregorian(value, jDate.month, day);
807
+ return this.withCivilDate(clone, gDate3);
801
808
  }
802
809
  }
803
810
  return new AXDateTime(clone, this);
804
811
  }
812
+ /**
813
+ * Builds a Date from converted civil Y/M/D while keeping the original time.
814
+ * Assigning year/month/day on an existing Date sequentially overflows (e.g. Aug 31 → Feb).
815
+ */
816
+ withCivilDate(source, civil) {
817
+ return new AXDateTime(new Date(civil.getFullYear(), civil.getMonth(), civil.getDate(), source.getHours(), source.getMinutes(), source.getSeconds(), source.getMilliseconds()), this);
818
+ }
805
819
  startOf(date, unit) {
806
820
  const clone = new Date(date.valueOf());
807
821
  switch (unit) {
@@ -1259,10 +1273,10 @@ class AXCalendarService {
1259
1273
  calendar: calendar.name(),
1260
1274
  });
1261
1275
  }
1262
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXCalendarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1263
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXCalendarService, providedIn: 'root' }); }
1276
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXCalendarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1277
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXCalendarService, providedIn: 'root' }); }
1264
1278
  }
1265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXCalendarService, decorators: [{
1279
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXCalendarService, decorators: [{
1266
1280
  type: Injectable,
1267
1281
  args: [{ providedIn: 'root' }]
1268
1282
  }], ctorParameters: () => [] });
@@ -1286,10 +1300,10 @@ class AXDateTimePipe {
1286
1300
  const val = this._calendarService.convert(value, calendar.name());
1287
1301
  return this.formatService.format(val, 'datetime', format);
1288
1302
  }
1289
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1290
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimePipe, isStandalone: true, name: "axDate" }); }
1303
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1304
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimePipe, isStandalone: true, name: "axDate" }); }
1291
1305
  }
1292
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimePipe, decorators: [{
1306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimePipe, decorators: [{
1293
1307
  type: Pipe,
1294
1308
  args: [{ name: 'axDate' }]
1295
1309
  }] });
@@ -1334,10 +1348,10 @@ class AXDateFormatter {
1334
1348
  .convert(value, effectiveOptions.calendar)
1335
1349
  .format(format, { locale: effectiveOptions.locale });
1336
1350
  }
1337
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1338
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateFormatter }); }
1351
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1352
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateFormatter }); }
1339
1353
  }
1340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateFormatter, decorators: [{
1354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateFormatter, decorators: [{
1341
1355
  type: Injectable
1342
1356
  }] });
1343
1357
 
@@ -1391,10 +1405,10 @@ class AXDateTimeFormatter {
1391
1405
  .convert(value, effectiveOptions.calendar)
1392
1406
  .format(format, { locale: effectiveOptions.locale });
1393
1407
  }
1394
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1395
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeFormatter }); }
1408
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimeFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1409
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimeFormatter }); }
1396
1410
  }
1397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeFormatter, decorators: [{
1411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimeFormatter, decorators: [{
1398
1412
  type: Injectable
1399
1413
  }] });
1400
1414
 
@@ -1517,10 +1531,10 @@ class AXTimeDurationFormatter {
1517
1531
  return result.join(separator);
1518
1532
  }
1519
1533
  }
1520
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeDurationFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1521
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeDurationFormatter }); }
1534
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeDurationFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1535
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeDurationFormatter }); }
1522
1536
  }
1523
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeDurationFormatter, decorators: [{
1537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeDurationFormatter, decorators: [{
1524
1538
  type: Injectable
1525
1539
  }] });
1526
1540
 
@@ -1564,10 +1578,10 @@ class AXTimeFormatter {
1564
1578
  .convert(value, effectiveOptions.calendar)
1565
1579
  .format(format, { locale: effectiveOptions.locale });
1566
1580
  }
1567
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1568
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeFormatter }); }
1581
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1582
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeFormatter }); }
1569
1583
  }
1570
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeFormatter, decorators: [{
1584
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeFormatter, decorators: [{
1571
1585
  type: Injectable
1572
1586
  }] });
1573
1587
 
@@ -1689,21 +1703,21 @@ class AXTimeLeftFormatter {
1689
1703
  return 'Invalid format';
1690
1704
  }
1691
1705
  }
1692
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeLeftFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1693
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeLeftFormatter }); }
1706
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeLeftFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1707
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeLeftFormatter }); }
1694
1708
  }
1695
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXTimeLeftFormatter, decorators: [{
1709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTimeLeftFormatter, decorators: [{
1696
1710
  type: Injectable
1697
1711
  }] });
1698
1712
 
1699
1713
  class AXDateTimeModule {
1700
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1701
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeModule, imports: [i1.AXFormatModule, AXDateTimePipe], exports: [AXDateTimePipe] }); }
1702
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeModule, imports: [AXFormatModule.forChild({
1714
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1715
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimeModule, imports: [i1.AXFormatModule, AXDateTimePipe], exports: [AXDateTimePipe] }); }
1716
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimeModule, imports: [AXFormatModule.forChild({
1703
1717
  formatters: [AXDateTimeFormatter, AXDateFormatter, AXTimeFormatter, AXTimeLeftFormatter, AXTimeDurationFormatter],
1704
1718
  })] }); }
1705
1719
  }
1706
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeModule, decorators: [{
1720
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXDateTimeModule, decorators: [{
1707
1721
  type: NgModule,
1708
1722
  args: [{
1709
1723
  imports: [