pjc-fields 0.0.50 → 0.0.52

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.
@@ -462,6 +462,7 @@ class PjcCepFieldComponent {
462
462
  }
463
463
  writeValue(val) {
464
464
  this.value = val ?? '';
465
+ this.cdr.markForCheck();
465
466
  }
466
467
  registerOnChange(fn) {
467
468
  this.onChange = fn;
@@ -579,6 +580,7 @@ class PjcChassiFieldComponent {
579
580
  }
580
581
  writeValue(val) {
581
582
  this.value = val?.toUpperCase().replace(/[^A-HJ-NPR-Z0-9]/g, '').substring(0, 17) ?? '';
583
+ this.cdr.markForCheck();
582
584
  }
583
585
  registerOnChange(fn) {
584
586
  this.onChange = fn;
@@ -706,6 +708,7 @@ class PjcCidadeFieldComponent {
706
708
  else {
707
709
  this.value = val;
708
710
  }
711
+ this.cdr.markForCheck();
709
712
  }
710
713
  registerOnChange(fn) {
711
714
  this.onChange = fn;
@@ -814,6 +817,7 @@ class PjcCnhFieldComponent {
814
817
  }
815
818
  writeValue(val) {
816
819
  this.value = val ?? '';
820
+ this.cdr.markForCheck();
817
821
  }
818
822
  registerOnChange(fn) {
819
823
  this.onChange = fn;
@@ -893,6 +897,7 @@ class PjcCnpjFieldComponent {
893
897
  }
894
898
  writeValue(val) {
895
899
  this.value = val ?? '';
900
+ this.cdr.markForCheck();
896
901
  }
897
902
  registerOnChange(fn) {
898
903
  this.onChange = fn;
@@ -977,6 +982,7 @@ class PjcCpfCnpjFieldComponent {
977
982
  this.rawValue = val?.replaceAll(/\D/g, '') ?? '';
978
983
  this.displayValue = this.formatValue(this.rawValue);
979
984
  this.updatePlaceholder();
985
+ this.cdr.markForCheck();
980
986
  }
981
987
  registerOnChange(fn) {
982
988
  this.onChange = fn;
@@ -1098,6 +1104,7 @@ class PjcCpfFieldComponent {
1098
1104
  }
1099
1105
  writeValue(val) {
1100
1106
  this.value = val ?? '';
1107
+ this.cdr.markForCheck();
1101
1108
  }
1102
1109
  registerOnChange(fn) {
1103
1110
  this.onChange = fn;
@@ -1232,7 +1239,24 @@ class PjcDataFieldComponent {
1232
1239
  input.setSelectionRange(newCursor, newCursor);
1233
1240
  };
1234
1241
  writeValue(val) {
1235
- this.value = val ?? null;
1242
+ if (val === null || val === undefined) {
1243
+ this.value = null;
1244
+ }
1245
+ else if (typeof val === 'string') {
1246
+ // Parse ISO date strings (e.g., '1996-01-21') as local dates
1247
+ // to avoid timezone offset causing a day shift.
1248
+ // new Date('1996-01-21') parses as UTC midnight, which shifts
1249
+ // to the previous day in negative-UTC timezones.
1250
+ const parts = val.split('-').map(Number);
1251
+ this.value = parts.length >= 3
1252
+ ? new Date(parts[0], parts[1] - 1, parts[2])
1253
+ : new Date(val);
1254
+ }
1255
+ else {
1256
+ this.value = val;
1257
+ }
1258
+ this.valueSignal.set(this.value);
1259
+ this.cdr.markForCheck();
1236
1260
  }
1237
1261
  registerOnChange(fn) {
1238
1262
  this.onChange = fn;
@@ -1378,7 +1402,20 @@ class PjcDataHoraFieldComponent {
1378
1402
  input.setSelectionRange(newCursor, newCursor);
1379
1403
  };
1380
1404
  writeValue(val) {
1381
- this.value = val ?? null;
1405
+ if (val === null || val === undefined) {
1406
+ this.value = null;
1407
+ }
1408
+ else if (typeof val === 'string') {
1409
+ // Parse ISO date strings as local dates to avoid timezone offset day shift.
1410
+ const parts = val.split('-').map(Number);
1411
+ this.value = parts.length >= 3
1412
+ ? new Date(parts[0], parts[1] - 1, parts[2])
1413
+ : new Date(val);
1414
+ }
1415
+ else {
1416
+ this.value = val;
1417
+ }
1418
+ this.cdr.markForCheck();
1382
1419
  }
1383
1420
  registerOnChange(fn) {
1384
1421
  this.onChange = fn;
@@ -1462,6 +1499,7 @@ class PjcEmailFieldComponent {
1462
1499
  }
1463
1500
  writeValue(val) {
1464
1501
  this.value = val?.toLowerCase() ?? '';
1502
+ this.cdr.markForCheck();
1465
1503
  }
1466
1504
  registerOnChange(fn) {
1467
1505
  this.onChange = fn;
@@ -1707,6 +1745,7 @@ class PjcHoraFieldComponent {
1707
1745
  }
1708
1746
  writeValue(val) {
1709
1747
  this.value = val ?? '';
1748
+ this.cdr.markForCheck();
1710
1749
  }
1711
1750
  registerOnChange(fn) {
1712
1751
  this.onChange = fn;
@@ -1784,6 +1823,7 @@ class PjcImeiFieldComponent {
1784
1823
  }
1785
1824
  writeValue(val) {
1786
1825
  this.value = val ?? '';
1826
+ this.cdr.markForCheck();
1787
1827
  }
1788
1828
  registerOnChange(fn) {
1789
1829
  this.onChange = fn;
@@ -1865,6 +1905,7 @@ class PjcIntegerFieldComponent {
1865
1905
  }
1866
1906
  writeValue(val) {
1867
1907
  this.value = val;
1908
+ this.cdr.markForCheck();
1868
1909
  }
1869
1910
  registerOnChange(fn) {
1870
1911
  this.onChange = fn;
@@ -2030,6 +2071,7 @@ class PjcNumeroCartaoFieldComponent {
2030
2071
  }
2031
2072
  writeValue(val) {
2032
2073
  this.value = val ?? '';
2074
+ this.cdr.markForCheck();
2033
2075
  }
2034
2076
  registerOnChange(fn) {
2035
2077
  this.onChange = fn;
@@ -2108,6 +2150,7 @@ class PjcPasswordFieldComponent {
2108
2150
  }
2109
2151
  writeValue(val) {
2110
2152
  this.value = val ?? '';
2153
+ this.cdr.markForCheck();
2111
2154
  }
2112
2155
  registerOnChange(fn) {
2113
2156
  this.onChange = fn;
@@ -2171,6 +2214,7 @@ class PjcPlacaFieldComponent {
2171
2214
  }
2172
2215
  writeValue(val) {
2173
2216
  this.value = val?.toUpperCase() || '';
2217
+ this.cdr.markForCheck();
2174
2218
  }
2175
2219
  registerOnChange(fn) {
2176
2220
  this.onChange = fn;
@@ -2245,6 +2289,7 @@ class PjcRenavamFieldComponent {
2245
2289
  }
2246
2290
  writeValue(val) {
2247
2291
  this.value = val ?? '';
2292
+ this.cdr.markForCheck();
2248
2293
  }
2249
2294
  registerOnChange(fn) {
2250
2295
  this.onChange = fn;
@@ -2324,6 +2369,7 @@ class PjcTelefoneFieldComponent {
2324
2369
  this.rawValue = val?.replaceAll(/\D/g, '') ?? '';
2325
2370
  this.displayValue = this.formatValue(this.rawValue);
2326
2371
  this.updatePlaceholder();
2372
+ this.cdr.markForCheck();
2327
2373
  }
2328
2374
  registerOnChange(fn) {
2329
2375
  this.onChange = fn;
@@ -2443,6 +2489,7 @@ class PjcTipoPessoaFieldComponent {
2443
2489
  }
2444
2490
  writeValue(val) {
2445
2491
  this.value = val;
2492
+ this.cdr.markForCheck();
2446
2493
  }
2447
2494
  registerOnChange(fn) {
2448
2495
  this.onChange = fn;
@@ -2550,6 +2597,7 @@ class PjcUfFieldComponent {
2550
2597
  }
2551
2598
  writeValue(val) {
2552
2599
  this.value = val?.uf ? (ESTADOS.find(e => e.uf === val.uf) ?? null) : null;
2600
+ this.cdr.markForCheck();
2553
2601
  }
2554
2602
  registerOnChange(fn) {
2555
2603
  this.onChange = fn;