@sumaris-net/ngx-components 0.24.1 → 0.24.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.
@@ -607,16 +607,15 @@
607
607
  // Stop if not equals, otherwise continue with the next key
608
608
  .find(function (res) { return res !== 0; }) || 0; };
609
609
  }
610
- function sort(array, attribute) {
610
+ function sort(array, attribute, opts) {
611
611
  if (isEmptyArray(array))
612
612
  return array;
613
+ var compareFn = opts
614
+ ? new Intl.Collator(undefined, opts).compare
615
+ : function (v1, v2) { return v1 === v2 ? 0 : v1 > v2 ? 1 : -1; };
613
616
  return array
614
617
  .slice() // copy
615
- .sort(function (a, b) {
616
- var valueA = a[attribute];
617
- var valueB = b[attribute];
618
- return valueA === valueB ? 0 : (valueA > valueB ? 1 : -1);
619
- });
618
+ .sort(function (a, b) { return compareFn(a[attribute], b[attribute]); });
620
619
  }
621
620
  var INTEGER_REGEXP = /^[-]?\d+$/;
622
621
  function isInt(value) {
@@ -21399,7 +21398,6 @@
21399
21398
  var url = config.getProperty(CORE_CONFIG_OPTIONS.ANDROID_INSTALL_URL);
21400
21399
  if (isNilOrBlank(url))
21401
21400
  url = this.environment.defaultAndroidInstallUrl || null;
21402
- var minVersion = config.getProperty(CORE_CONFIG_OPTIONS.APP_MIN_VERSION);
21403
21401
  // Compute App name
21404
21402
  var name = isNotNilOrBlank(url) && config.label || this.environment.defaultAppName || 'SUMARiS';
21405
21403
  if (url) {
@@ -21408,7 +21406,7 @@
21408
21406
  var mimeType = void 0;
21409
21407
  // Get file name
21410
21408
  var filename = this.getFilename(url);
21411
- version = minVersion || 'latest';
21409
+ version = config.getProperty(CORE_CONFIG_OPTIONS.APP_MIN_VERSION);
21412
21410
  // OK, this is a downloadable APK file (e.g. NOT a link to a playstore)
21413
21411
  if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.apk')) {
21414
21412
  // Define mime type
@@ -21418,12 +21416,13 @@
21418
21416
  version = versionMatches && versionMatches[1] || version;
21419
21417
  // Compute a new file name, with the version
21420
21418
  if (isNotNilOrBlank(name)) {
21421
- downloadFilename = (name + "-v" + version + ".apk").toLowerCase();
21419
+ downloadFilename = name + "-" + version + ".apk";
21422
21420
  }
21423
21421
  else {
21424
21422
  downloadFilename = filename;
21425
- // Replace 'latest' with the app version, if present
21423
+ // Replace 'latest' with the app min version
21426
21424
  if (downloadFilename.indexOf('latest')) {
21425
+ version = config.getProperty(CORE_CONFIG_OPTIONS.APP_MIN_VERSION);
21427
21426
  downloadFilename = downloadFilename.replace('latest', version);
21428
21427
  }
21429
21428
  }
@@ -26905,6 +26904,7 @@
26905
26904
  this.userProfiles = source.userProfiles;
26906
26905
  this.excludedIds = source.excludedIds;
26907
26906
  this.searchAttribute = source.searchAttribute;
26907
+ this.searchAttributes = source.searchAttributes;
26908
26908
  };
26909
26909
  PersonFilter.prototype.asObject = function (opts) {
26910
26910
  var target = _super.prototype.asObject.call(this, opts);
@@ -26915,6 +26915,7 @@
26915
26915
  target.userProfiles = this.userProfiles;
26916
26916
  target.excludedIds = this.excludedIds;
26917
26917
  target.searchAttribute = this.searchAttribute;
26918
+ target.searchAttributes = this.searchAttributes;
26918
26919
  return target;
26919
26920
  };
26920
26921
  PersonFilter.prototype.buildFilter = function () {
@@ -26929,7 +26930,7 @@
26929
26930
  filterFns.push(function (e) { return isNil(e.id) || !_this.excludedIds.includes(e.id); });
26930
26931
  }
26931
26932
  // Search text
26932
- var searchTextFilter = EntityUtils.searchTextFilter(this.searchAttribute || ['lastName', 'firstName', 'department.name'], this.searchText);
26933
+ var searchTextFilter = EntityUtils.searchTextFilter(this.searchAttribute || this.searchAttributes || ['lastName', 'firstName', 'department.name'], this.searchText);
26933
26934
  if (searchTextFilter)
26934
26935
  filterFns.push(searchTextFilter);
26935
26936
  return filterFns;
@@ -27018,7 +27019,8 @@
27018
27019
  if (ReferentialUtils.isNotEmpty(value))
27019
27020
  return [2 /*return*/, { data: [value] }];
27020
27021
  value = (typeof value === 'string' && value !== '*') && value || undefined;
27021
- return [2 /*return*/, this.loadAll(0, !value ? 30 : 10, sortBy || (filter === null || filter === void 0 ? void 0 : filter.searchAttribute), sortDirection, Object.assign(Object.assign({}, filter), { searchText: value, statusIds: filter && filter.statusIds || [StatusIds.ENABLE], userProfiles: filter && filter.userProfiles }), { withTotal: true /* need by autocomplete */ })];
27022
+ sortBy = sortBy || filter.searchAttribute || (filter.searchAttributes && filter.searchAttributes[0]);
27023
+ return [2 /*return*/, this.loadAll(0, !value ? 30 : 10, sortBy, sortDirection, Object.assign(Object.assign({}, filter), { searchText: value, statusIds: filter && filter.statusIds || [StatusIds.ENABLE], userProfiles: filter && filter.userProfiles }), { withTotal: true /* need by autocomplete */ })];
27022
27024
  });
27023
27025
  });
27024
27026
  };