tnx-shared 5.3.276 → 5.3.277

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.
@@ -6890,6 +6890,18 @@
6890
6890
  }
6891
6891
  }
6892
6892
  };
6893
+ CrudService.prototype.renderTimespan = function (datetime) {
6894
+ if (!datetime) {
6895
+ return '';
6896
+ }
6897
+ try {
6898
+ var arrTime = datetime.split(':');
6899
+ return arrTime[0] + ":" + arrTime[1];
6900
+ }
6901
+ catch (_a) {
6902
+ return '';
6903
+ }
6904
+ };
6893
6905
  CrudService.prototype.renderDate = function (datetime, format) {
6894
6906
  if (format === void 0) { format = 'normal'; }
6895
6907
  if (!datetime) {
@@ -7010,9 +7022,9 @@
7010
7022
  if (callBackAfterGetRefDataDropdown === void 0) { callBackAfterGetRefDataDropdown = null; }
7011
7023
  return __awaiter(this, void 0, void 0, function () {
7012
7024
  var schemaHasOrder, dicData, schemas_1, schemas_1_1, schema, promise, data, lstData, _loop_1, this_1, lstData_1, lstData_1_1, element, e_1_1;
7013
- var e_2, _a, e_1, _b;
7014
- return __generator(this, function (_c) {
7015
- switch (_c.label) {
7025
+ var e_2, _b, e_1, _c;
7026
+ return __generator(this, function (_d) {
7027
+ switch (_d.label) {
7016
7028
  case 0:
7017
7029
  if (!dataSource || !dataSource.length)
7018
7030
  return [2 /*return*/];
@@ -7021,7 +7033,7 @@
7021
7033
  schemaHasOrder = schemas.filter(function (x) { return Number.isInteger(x.order); });
7022
7034
  if (!schemaHasOrder) return [3 /*break*/, 2];
7023
7035
  return [4 /*yield*/, this.getRefDataInDatasourceWithOrder(dataSource, schemaHasOrder, callBackAfterGetRefDataDropdown)];
7024
- case 1: return [2 /*return*/, _c.sent()];
7036
+ case 1: return [2 /*return*/, _d.sent()];
7025
7037
  case 2:
7026
7038
  schemas = schemas.filter(function (x) { return !Number.isInteger(x.order); });
7027
7039
  dicData = [];
@@ -7045,15 +7057,15 @@
7045
7057
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
7046
7058
  finally {
7047
7059
  try {
7048
- if (schemas_1_1 && !schemas_1_1.done && (_a = schemas_1.return)) _a.call(schemas_1);
7060
+ if (schemas_1_1 && !schemas_1_1.done && (_b = schemas_1.return)) _b.call(schemas_1);
7049
7061
  }
7050
7062
  finally { if (e_2) throw e_2.error; }
7051
7063
  }
7052
7064
  lstData = Object.values(dicData);
7053
7065
  _loop_1 = function (element) {
7054
7066
  var data, promises, schemaDatas, arrRes;
7055
- return __generator(this, function (_d) {
7056
- switch (_d.label) {
7067
+ return __generator(this, function (_e) {
7068
+ switch (_e.label) {
7057
7069
  case 0:
7058
7070
  data = element;
7059
7071
  if (data == null) {
@@ -7066,7 +7078,7 @@
7066
7078
  }
7067
7079
  return [4 /*yield*/, Promise.all(promises)];
7068
7080
  case 1:
7069
- arrRes = _d.sent();
7081
+ arrRes = _e.sent();
7070
7082
  schemaDatas.forEach(function (schema, resIndex) {
7071
7083
  var schemaData = arrRes[resIndex] === true ? schema.dataSource : arrRes[resIndex];
7072
7084
  if (schema.callbackDataFinish) {
@@ -7085,29 +7097,29 @@
7085
7097
  });
7086
7098
  };
7087
7099
  this_1 = this;
7088
- _c.label = 3;
7100
+ _d.label = 3;
7089
7101
  case 3:
7090
- _c.trys.push([3, 8, 9, 10]);
7102
+ _d.trys.push([3, 8, 9, 10]);
7091
7103
  lstData_1 = __values(lstData), lstData_1_1 = lstData_1.next();
7092
- _c.label = 4;
7104
+ _d.label = 4;
7093
7105
  case 4:
7094
7106
  if (!!lstData_1_1.done) return [3 /*break*/, 7];
7095
7107
  element = lstData_1_1.value;
7096
7108
  return [5 /*yield**/, _loop_1(element)];
7097
7109
  case 5:
7098
- _c.sent();
7099
- _c.label = 6;
7110
+ _d.sent();
7111
+ _d.label = 6;
7100
7112
  case 6:
7101
7113
  lstData_1_1 = lstData_1.next();
7102
7114
  return [3 /*break*/, 4];
7103
7115
  case 7: return [3 /*break*/, 10];
7104
7116
  case 8:
7105
- e_1_1 = _c.sent();
7117
+ e_1_1 = _d.sent();
7106
7118
  e_1 = { error: e_1_1 };
7107
7119
  return [3 /*break*/, 10];
7108
7120
  case 9:
7109
7121
  try {
7110
- if (lstData_1_1 && !lstData_1_1.done && (_b = lstData_1.return)) _b.call(lstData_1);
7122
+ if (lstData_1_1 && !lstData_1_1.done && (_c = lstData_1.return)) _c.call(lstData_1);
7111
7123
  }
7112
7124
  finally { if (e_1) throw e_1.error; }
7113
7125
  return [7 /*endfinally*/];
@@ -7120,10 +7132,10 @@
7120
7132
  if (callBackAfterGetRefDataDropdown === void 0) { callBackAfterGetRefDataDropdown = null; }
7121
7133
  return __awaiter(this, void 0, void 0, function () {
7122
7134
  var dicData, _loop_2, schemas_2, schemas_2_1, schema, lstData, _loop_3, this_2, index;
7123
- var e_3, _a;
7135
+ var e_3, _b;
7124
7136
  var _this = this;
7125
- return __generator(this, function (_b) {
7126
- switch (_b.label) {
7137
+ return __generator(this, function (_c) {
7138
+ switch (_c.label) {
7127
7139
  case 0:
7128
7140
  schemas.sort(function (a, b) { return a.order - b.order; });
7129
7141
  dicData = [];
@@ -7152,15 +7164,15 @@
7152
7164
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
7153
7165
  finally {
7154
7166
  try {
7155
- if (schemas_2_1 && !schemas_2_1.done && (_a = schemas_2.return)) _a.call(schemas_2);
7167
+ if (schemas_2_1 && !schemas_2_1.done && (_b = schemas_2.return)) _b.call(schemas_2);
7156
7168
  }
7157
7169
  finally { if (e_3) throw e_3.error; }
7158
7170
  }
7159
7171
  lstData = Object.values(dicData);
7160
7172
  _loop_3 = function (index) {
7161
7173
  var data, promises, schemaDatas, promiseAll, arrRes;
7162
- return __generator(this, function (_c) {
7163
- switch (_c.label) {
7174
+ return __generator(this, function (_d) {
7175
+ switch (_d.label) {
7164
7176
  case 0:
7165
7177
  data = lstData[index];
7166
7178
  if (data == null) {
@@ -7174,7 +7186,7 @@
7174
7186
  promiseAll = promises.map(function (x) { return x(dataSource); });
7175
7187
  return [4 /*yield*/, Promise.all(promiseAll)];
7176
7188
  case 1:
7177
- arrRes = _c.sent();
7189
+ arrRes = _d.sent();
7178
7190
  schemaDatas.forEach(function (schema, resIndex) {
7179
7191
  var schemaData = arrRes[resIndex] === true ? schema.dataSource : arrRes[resIndex];
7180
7192
  if (schema.callbackDataFinish) {
@@ -7194,13 +7206,13 @@
7194
7206
  };
7195
7207
  this_2 = this;
7196
7208
  index = 0;
7197
- _b.label = 1;
7209
+ _c.label = 1;
7198
7210
  case 1:
7199
7211
  if (!(index < lstData.length)) return [3 /*break*/, 4];
7200
7212
  return [5 /*yield**/, _loop_3(index)];
7201
7213
  case 2:
7202
- _b.sent();
7203
- _b.label = 3;
7214
+ _c.sent();
7215
+ _c.label = 3;
7204
7216
  case 3:
7205
7217
  index++;
7206
7218
  return [3 /*break*/, 1];
@@ -7256,7 +7268,7 @@
7256
7268
  return schema.funcGetLabel ? schema.funcGetLabel : function (item) { return item[schema.displayFieldInGrid] || item[schema.displayField] || item['ten']; };
7257
7269
  };
7258
7270
  CrudService.prototype.mergeRefDatasToDatasource = function (dataSource, schemas, callBackAfterGetRefDataDropdown) {
7259
- var e_4, _a, e_5, _b;
7271
+ var e_4, _b, e_5, _c;
7260
7272
  try {
7261
7273
  // #region set default function
7262
7274
  for (var dataSource_1 = __values(dataSource), dataSource_1_1 = dataSource_1.next(); !dataSource_1_1.done; dataSource_1_1 = dataSource_1.next()) {
@@ -7334,7 +7346,7 @@
7334
7346
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
7335
7347
  finally {
7336
7348
  try {
7337
- if (schemas_3_1 && !schemas_3_1.done && (_b = schemas_3.return)) _b.call(schemas_3);
7349
+ if (schemas_3_1 && !schemas_3_1.done && (_c = schemas_3.return)) _c.call(schemas_3);
7338
7350
  }
7339
7351
  finally { if (e_5) throw e_5.error; }
7340
7352
  }
@@ -7346,7 +7358,7 @@
7346
7358
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
7347
7359
  finally {
7348
7360
  try {
7349
- if (dataSource_1_1 && !dataSource_1_1.done && (_a = dataSource_1.return)) _a.call(dataSource_1);
7361
+ if (dataSource_1_1 && !dataSource_1_1.done && (_b = dataSource_1.return)) _b.call(dataSource_1);
7350
7362
  }
7351
7363
  finally { if (e_4) throw e_4.error; }
7352
7364
  }
@@ -7836,7 +7848,7 @@
7836
7848
  }
7837
7849
  };
7838
7850
  CrudService.prototype.getValueFilter = function (filter, model, rootModel) {
7839
- var e_6, _a;
7851
+ var e_6, _b;
7840
7852
  var _this = this;
7841
7853
  var sourceField = filter.sourceField;
7842
7854
  var subField = filter.subField;
@@ -7882,7 +7894,7 @@
7882
7894
  catch (e_6_1) { e_6 = { error: e_6_1 }; }
7883
7895
  finally {
7884
7896
  try {
7885
- if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
7897
+ if (fields_1_1 && !fields_1_1.done && (_b = fields_1.return)) _b.call(fields_1);
7886
7898
  }
7887
7899
  finally { if (e_6) throw e_6.error; }
7888
7900
  }
@@ -39920,8 +39932,7 @@
39920
39932
  return this._crudService.renderDate(value, format);
39921
39933
  }
39922
39934
  else if (dataType == 'timespan') {
39923
- var arrTime = value.split(':');
39924
- return arrTime[0] + ":" + arrTime[1];
39935
+ return this._crudService.renderTimespan(value);
39925
39936
  }
39926
39937
  return this._crudService.renderDateTime(value, format);
39927
39938
  };