@sumaris-net/ngx-components 1.0.1 → 1.0.2
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/bundles/sumaris-net.ngx-components.umd.js +8 -6
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/shared/functions.js +9 -7
- package/fesm2015/sumaris-net.ngx-components.js +8 -6
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -518,8 +518,11 @@
|
|
|
518
518
|
return { data: [value] };
|
|
519
519
|
value = (typeof value === 'string' && value !== '*') && value.toUpperCase() || undefined;
|
|
520
520
|
var keys = opts && (opts.searchAttribute && [opts.searchAttribute] || opts.searchAttributes) || ['label'];
|
|
521
|
+
if (!items) {
|
|
522
|
+
return { data: [], total: 0 };
|
|
523
|
+
}
|
|
521
524
|
// Filter items
|
|
522
|
-
if (isNotNilOrBlank(value)
|
|
525
|
+
if (isNotNilOrBlank(value)) {
|
|
523
526
|
// If wildcard, search using regexp
|
|
524
527
|
if (value.indexOf('*') !== -1) {
|
|
525
528
|
value = value.replace('*', '.*');
|
|
@@ -531,15 +534,14 @@
|
|
|
531
534
|
}
|
|
532
535
|
}
|
|
533
536
|
// Exclude ids
|
|
534
|
-
if (
|
|
537
|
+
if (isNotEmptyArray(opts === null || opts === void 0 ? void 0 : opts.excludedIds)) {
|
|
535
538
|
items = items.filter(function (v) { return !opts.excludedIds.includes(+v['id']); });
|
|
536
539
|
}
|
|
537
540
|
// Sort
|
|
538
|
-
|
|
539
|
-
items.sort(propertiesPathComparator(keys));
|
|
541
|
+
items.sort(propertiesPathComparator(keys));
|
|
540
542
|
// Truncate if need
|
|
541
|
-
var total = items
|
|
542
|
-
if (
|
|
543
|
+
var total = items.length || 0;
|
|
544
|
+
if (opts) {
|
|
543
545
|
if (opts.offset > 0) {
|
|
544
546
|
items = items.slice(opts.offset);
|
|
545
547
|
}
|