@sumaris-net/ngx-components 2.4.99 → 2.4.101
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.
- package/esm2020/src/app/shared/pipes/arrays.pipe.mjs +23 -17
- package/fesm2015/sumaris-net.ngx-components.mjs +22 -16
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +22 -16
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/pipes/arrays.pipe.d.ts +9 -9
- package/src/theme/_ionic.globals.scss +2 -0
|
@@ -1499,9 +1499,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1499
1499
|
|
|
1500
1500
|
class NotEmptyArrayPipe {
|
|
1501
1501
|
transform(val) {
|
|
1502
|
-
if (val
|
|
1502
|
+
if (!val || !Array.isArray(val))
|
|
1503
1503
|
return false;
|
|
1504
|
-
}
|
|
1505
1504
|
return val.length > 0;
|
|
1506
1505
|
}
|
|
1507
1506
|
}
|
|
@@ -1515,9 +1514,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1515
1514
|
}] });
|
|
1516
1515
|
class EmptyArrayPipe {
|
|
1517
1516
|
transform(val) {
|
|
1518
|
-
if (val
|
|
1517
|
+
if (!val || !Array.isArray(val))
|
|
1519
1518
|
return true;
|
|
1520
|
-
}
|
|
1521
1519
|
return val.length === 0;
|
|
1522
1520
|
}
|
|
1523
1521
|
}
|
|
@@ -1532,7 +1530,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1532
1530
|
class ArrayLengthPipe {
|
|
1533
1531
|
transform(val, args) {
|
|
1534
1532
|
args = args || {};
|
|
1535
|
-
const size =
|
|
1533
|
+
const size = !val || !Array.isArray(val) ? 0 : val.length;
|
|
1536
1534
|
if (isNotNil(args.lessThan)) {
|
|
1537
1535
|
return size < args.lessThan;
|
|
1538
1536
|
}
|
|
@@ -1555,7 +1553,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1555
1553
|
}] });
|
|
1556
1554
|
class ArrayFirstPipe {
|
|
1557
1555
|
transform(val) {
|
|
1558
|
-
|
|
1556
|
+
if (!val || !Array.isArray(val))
|
|
1557
|
+
return null;
|
|
1558
|
+
return val.length > 0 ? val[0] : null;
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
1561
|
ArrayFirstPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ArrayFirstPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -1569,16 +1569,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1569
1569
|
class ArrayPluckPipe {
|
|
1570
1570
|
/**
|
|
1571
1571
|
*
|
|
1572
|
-
* @param
|
|
1572
|
+
* @param val
|
|
1573
1573
|
* @param opts property to get, or options
|
|
1574
1574
|
*/
|
|
1575
|
-
transform(
|
|
1576
|
-
if (!
|
|
1577
|
-
return
|
|
1575
|
+
transform(val, opts) {
|
|
1576
|
+
if (!val || !Array.isArray(val) || !opts)
|
|
1577
|
+
return null;
|
|
1578
1578
|
const property = (typeof opts === 'string') || Array.isArray(opts) ? opts : opts.property;
|
|
1579
1579
|
return (opts['omitNil'] !== true) ?
|
|
1580
|
-
|
|
1581
|
-
|
|
1580
|
+
val.map(value => getPropertyByPath(value, property)) :
|
|
1581
|
+
val.map(value => getPropertyByPath(value, property)).filter(isNotNil);
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
1584
1584
|
ArrayPluckPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ArrayPluckPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -1590,8 +1590,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1590
1590
|
}]
|
|
1591
1591
|
}] });
|
|
1592
1592
|
class ArrayIncludesPipe {
|
|
1593
|
-
transform(val,
|
|
1594
|
-
|
|
1593
|
+
transform(val, searchElement, fromIndex) {
|
|
1594
|
+
if (!val || !Array.isArray(val))
|
|
1595
|
+
return false;
|
|
1596
|
+
return val && val.includes(searchElement, fromIndex) || false;
|
|
1595
1597
|
}
|
|
1596
1598
|
}
|
|
1597
1599
|
ArrayIncludesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ArrayIncludesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -1604,7 +1606,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1604
1606
|
}] });
|
|
1605
1607
|
class ArrayFilterPipe {
|
|
1606
1608
|
transform(val, filterFn) {
|
|
1607
|
-
|
|
1609
|
+
if (!val || !Array.isArray(val))
|
|
1610
|
+
return null;
|
|
1611
|
+
return val.filter(filterFn);
|
|
1608
1612
|
}
|
|
1609
1613
|
}
|
|
1610
1614
|
ArrayFilterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ArrayFilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -1617,7 +1621,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1617
1621
|
}] });
|
|
1618
1622
|
class ArrayJoinPipe {
|
|
1619
1623
|
transform(val, separator) {
|
|
1620
|
-
|
|
1624
|
+
if (!val || !Array.isArray(val))
|
|
1625
|
+
return '';
|
|
1626
|
+
return val.join(separator) || '';
|
|
1621
1627
|
}
|
|
1622
1628
|
}
|
|
1623
1629
|
ArrayJoinPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ArrayJoinPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|