tnx-shared 5.0.56 → 5.0.58

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.
@@ -2360,6 +2360,14 @@
2360
2360
  errorDetail: err
2361
2361
  };
2362
2362
  };
2363
+ CommonService.prototype.tryParseJson = function (data) {
2364
+ try {
2365
+ return { valid: true, value: JSON.parse(data) };
2366
+ }
2367
+ catch (e) {
2368
+ return { valid: false, value: data };
2369
+ }
2370
+ };
2363
2371
  return CommonService;
2364
2372
  }());
2365
2373
  CommonService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CommonService_Factory() { return new CommonService(i0.ɵɵinject(ModuleConfigService)); }, token: CommonService, providedIn: "root" });
@@ -6001,7 +6009,7 @@
6001
6009
  if (model.hasOwnProperty(sourceField)) {
6002
6010
  valueFilter = model[sourceField];
6003
6011
  if (canAccessSubField(valueFilter)) {
6004
- if (isArray(valueFilter)) {
6012
+ if (isArray(valueFilter) && typeof subField === 'string') {
6005
6013
  valueFilter = valueFilter.map(function (x) { return x[subField]; });
6006
6014
  }
6007
6015
  else {
@@ -6215,6 +6223,7 @@
6215
6223
  });
6216
6224
  };
6217
6225
  CrudService.prototype.mergeRefDataToDatasource = function (dataSource, schema, data) {
6226
+ data !== null && data !== void 0 ? data : (data = []);
6218
6227
  var field = schema.field;
6219
6228
  var funcGetLabel = function (item) { return item[schema.displayField] || item['label']; };
6220
6229
  if (schema.funcGetLabel) {
@@ -11704,6 +11713,7 @@
11704
11713
  });
11705
11714
  };
11706
11715
  DataListBase.prototype.mergeRefDataToDatasource = function (dataSource, schema, data) {
11716
+ data !== null && data !== void 0 ? data : (data = []);
11707
11717
  var field = schema.field;
11708
11718
  var funcGetLabel = function (item) { return item[schema.displayField] || item['label']; };
11709
11719
  if (schema.funcGetLabel) {
@@ -30645,7 +30655,7 @@
30645
30655
  };
30646
30656
  EntityPickerDataComponent.prototype.modifyGridInfo = function (gridInfo) {
30647
30657
  return __awaiter(this, void 0, void 0, function () {
30648
- var _a, _b, filter, allow;
30658
+ var _a, _b, filter, value, allow;
30649
30659
  var e_1, _c;
30650
30660
  return __generator(this, function (_d) {
30651
30661
  switch (_d.label) {
@@ -30656,11 +30666,14 @@
30656
30666
  try {
30657
30667
  for (_a = __values(gridInfo.filters), _b = _a.next(); !_b.done; _b = _a.next()) {
30658
30668
  filter = _b.value;
30659
- if (filter.operator == exports.Operator.in) {
30660
- filter.value = JSON.parse(filter.value).join(',');
30661
- }
30662
- else {
30663
- filter.value = JSON.parse(filter.value).toString();
30669
+ value = this._commonService.tryParseJson(filter.value);
30670
+ if (value.valid) {
30671
+ if (filter.operator == exports.Operator.in) {
30672
+ filter.value = JSON.parse(filter.value).join(',');
30673
+ }
30674
+ else {
30675
+ filter.value = JSON.parse(filter.value).toString();
30676
+ }
30664
30677
  }
30665
30678
  }
30666
30679
  }
@@ -30867,7 +30880,7 @@
30867
30880
  };
30868
30881
  EntityPickerSelectedComponent.prototype.modifyGridInfo = function (gridInfo) {
30869
30882
  return __awaiter(this, void 0, void 0, function () {
30870
- var _a, _b, filter;
30883
+ var _a, _b, filter, value;
30871
30884
  var e_1, _c;
30872
30885
  return __generator(this, function (_d) {
30873
30886
  switch (_d.label) {
@@ -30878,11 +30891,14 @@
30878
30891
  try {
30879
30892
  for (_a = __values(gridInfo.filters), _b = _a.next(); !_b.done; _b = _a.next()) {
30880
30893
  filter = _b.value;
30881
- if (filter.operator == exports.Operator.in) {
30882
- filter.value = JSON.parse(filter.value).join(',');
30883
- }
30884
- else {
30885
- filter.value = JSON.parse(filter.value).toString();
30894
+ value = this._commonService.tryParseJson(filter.value);
30895
+ if (value.valid) {
30896
+ if (filter.operator == exports.Operator.in) {
30897
+ filter.value = JSON.parse(filter.value).join(',');
30898
+ }
30899
+ else {
30900
+ filter.value = JSON.parse(filter.value).toString();
30901
+ }
30886
30902
  }
30887
30903
  }
30888
30904
  }