@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.
@@ -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 === undefined || val === null) {
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 === undefined || val === null) {
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 = (val === undefined || val === null) ? 0 : val.length;
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
- return val && val.length > 0 ? val[0] : undefined;
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 values
1572
+ * @param val
1573
1573
  * @param opts property to get, or options
1574
1574
  */
1575
- transform(values, opts) {
1576
- if (!opts || !values)
1577
- return values;
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
- values.map(value => getPropertyByPath(value, property)) :
1581
- values.map(value => getPropertyByPath(value, property)).filter(isNotNil);
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, args) {
1594
- return val && val.includes(args) || false;
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
- return val && val.filter(filterFn);
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
- return val && val.join(separator) || '';
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 });