@servicemind.tis/tis-smart-table-viewer 2.4.15 → 2.4.17
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.
|
@@ -459,11 +459,15 @@ class QueryParamsHelper {
|
|
|
459
459
|
const value = queryParams[key];
|
|
460
460
|
// Handle fixed parameters
|
|
461
461
|
if (key.toLowerCase() === 'pageindex') {
|
|
462
|
-
|
|
462
|
+
// Guard against malformed/stale URLs (NaN, negative): fall back to 0.
|
|
463
|
+
const n = Number(value);
|
|
464
|
+
pageIndex = (isFinite(n) && n >= 0) ? n : 0;
|
|
463
465
|
fixedKeyMatched = true;
|
|
464
466
|
}
|
|
465
467
|
else if (key.toLowerCase() === 'pagesize') {
|
|
466
|
-
|
|
468
|
+
// Guard against malformed/stale URLs (NaN, zero, negative): fall back to 10.
|
|
469
|
+
const n = Number(value);
|
|
470
|
+
pageSize = (isFinite(n) && n > 0) ? n : 10;
|
|
467
471
|
fixedKeyMatched = true;
|
|
468
472
|
}
|
|
469
473
|
else if (key.toLowerCase() === 'sortby') {
|
|
@@ -1790,21 +1794,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1790
1794
|
class TisDatePipe {
|
|
1791
1795
|
transform(value, format) {
|
|
1792
1796
|
const fmt = format || 'dd MMM yyyy';
|
|
1793
|
-
|
|
1794
|
-
|
|
1797
|
+
// Empty / "no date" inputs render blank (0 and "0" are treated as no-date).
|
|
1798
|
+
if (value === null || value === undefined || value === '' || value === 0 || value === '0') {
|
|
1799
|
+
return '';
|
|
1795
1800
|
}
|
|
1796
|
-
|
|
1797
|
-
|
|
1801
|
+
let dt;
|
|
1802
|
+
if (value instanceof Date) {
|
|
1803
|
+
dt = DateTime.fromJSDate(value);
|
|
1798
1804
|
}
|
|
1799
|
-
else if (value
|
|
1800
|
-
|
|
1805
|
+
else if (typeof value === 'number') {
|
|
1806
|
+
dt = DateTime.fromMillis(value);
|
|
1801
1807
|
}
|
|
1802
|
-
else if (
|
|
1803
|
-
|
|
1808
|
+
else if (typeof value === 'string') {
|
|
1809
|
+
const num = Number(value);
|
|
1810
|
+
// Numeric string => epoch millis (unchanged); non-numeric => ISO date.
|
|
1811
|
+
dt = !isNaN(num) ? DateTime.fromMillis(num) : DateTime.fromISO(value);
|
|
1804
1812
|
}
|
|
1805
1813
|
else {
|
|
1806
|
-
return '
|
|
1814
|
+
return '';
|
|
1807
1815
|
}
|
|
1816
|
+
// Invalid inputs render blank instead of the literal "Invalid Date".
|
|
1817
|
+
return dt.isValid ? dt.toFormat(fmt) : '';
|
|
1808
1818
|
}
|
|
1809
1819
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1810
1820
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDatePipe, isStandalone: false, name: "tisDate" });
|
|
@@ -1820,18 +1830,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1820
1830
|
class TisDateTimePipe {
|
|
1821
1831
|
transform(value, format) {
|
|
1822
1832
|
const fmt = format || 'dd MMM yyyy hh:mm a';
|
|
1823
|
-
|
|
1824
|
-
|
|
1833
|
+
// Empty / "no date" inputs render blank (0 and "0" are treated as no-date).
|
|
1834
|
+
if (value === null || value === undefined || value === '' || value === 0 || value === '0') {
|
|
1835
|
+
return '';
|
|
1825
1836
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1837
|
+
let dt;
|
|
1838
|
+
if (value instanceof Date) {
|
|
1839
|
+
dt = DateTime.fromJSDate(value);
|
|
1828
1840
|
}
|
|
1829
|
-
else if (
|
|
1830
|
-
|
|
1841
|
+
else if (typeof value === 'number') {
|
|
1842
|
+
dt = DateTime.fromMillis(value);
|
|
1843
|
+
}
|
|
1844
|
+
else if (typeof value === 'string') {
|
|
1845
|
+
const num = Number(value);
|
|
1846
|
+
// Numeric string => epoch millis (unchanged); non-numeric => ISO date.
|
|
1847
|
+
dt = !isNaN(num) ? DateTime.fromMillis(num) : DateTime.fromISO(value);
|
|
1831
1848
|
}
|
|
1832
1849
|
else {
|
|
1833
|
-
return '
|
|
1850
|
+
return '';
|
|
1834
1851
|
}
|
|
1852
|
+
// Invalid inputs render blank instead of the literal "Invalid Date".
|
|
1853
|
+
return dt.isValid ? dt.toFormat(fmt) : '';
|
|
1835
1854
|
}
|
|
1836
1855
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1837
1856
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimePipe, isStandalone: false, name: "tisDateTime" });
|
|
@@ -1847,18 +1866,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1847
1866
|
class TisDateTimeWithSecondsPipe {
|
|
1848
1867
|
transform(value, format) {
|
|
1849
1868
|
const fmt = format || 'dd MMM yyyy hh:mm:ss a';
|
|
1850
|
-
|
|
1851
|
-
|
|
1869
|
+
// Empty / "no date" inputs render blank (0 and "0" are treated as no-date).
|
|
1870
|
+
if (value === null || value === undefined || value === '' || value === 0 || value === '0') {
|
|
1871
|
+
return '';
|
|
1852
1872
|
}
|
|
1853
|
-
|
|
1854
|
-
|
|
1873
|
+
let dt;
|
|
1874
|
+
if (value instanceof Date) {
|
|
1875
|
+
dt = DateTime.fromJSDate(value);
|
|
1855
1876
|
}
|
|
1856
|
-
else if (
|
|
1857
|
-
|
|
1877
|
+
else if (typeof value === 'number') {
|
|
1878
|
+
dt = DateTime.fromMillis(value);
|
|
1879
|
+
}
|
|
1880
|
+
else if (typeof value === 'string') {
|
|
1881
|
+
const num = Number(value);
|
|
1882
|
+
// Numeric string => epoch millis (unchanged); non-numeric => ISO date.
|
|
1883
|
+
dt = !isNaN(num) ? DateTime.fromMillis(num) : DateTime.fromISO(value);
|
|
1858
1884
|
}
|
|
1859
1885
|
else {
|
|
1860
|
-
return '
|
|
1886
|
+
return '';
|
|
1861
1887
|
}
|
|
1888
|
+
// Invalid inputs render blank instead of the literal "Invalid Date".
|
|
1889
|
+
return dt.isValid ? dt.toFormat(fmt) : '';
|
|
1862
1890
|
}
|
|
1863
1891
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimeWithSecondsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1864
1892
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimeWithSecondsPipe, isStandalone: false, name: "tisDateTimeWithSeconds" });
|