@sd-angular/core 1.3.180 → 1.3.182

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.
@@ -288,7 +288,7 @@ class SdTableConfigurationService {
288
288
  SELECTION: 'sdSelection',
289
289
  GROUP: 'sdGroup',
290
290
  });
291
- _prefix.set(this, 'bd364e28-fe67-48b9-a537-1a306f7d195c');
291
+ _prefix.set(this, 'c9e94836-6ace-4aeb-b148-4f0be63589ee');
292
292
  _getSetting.set(this, (gridOption) => {
293
293
  if (!(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)) {
294
294
  return null;
@@ -1127,7 +1127,7 @@ class SdTable {
1127
1127
  for (const item of exportItems) {
1128
1128
  const obj = {};
1129
1129
  const handle = (exportColumn) => __awaiter(this, void 0, void 0, function* () {
1130
- var _v, _w, _x, _y;
1130
+ var _v, _w, _x, _y, _z;
1131
1131
  obj[exportColumn.field] = item[exportColumn.field];
1132
1132
  const column = allColumns.find(e => e.field === exportColumn.field);
1133
1133
  const exportedColumn = allExportedColumns.find(e => e.field === exportColumn.field);
@@ -1188,9 +1188,10 @@ class SdTable {
1188
1188
  // Nếu là time thì convert theo đúng format
1189
1189
  obj[column.field] = Date.toFormat(date, 'HH:mm');
1190
1190
  }
1191
- else if (column.type === 'values') {
1191
+ else if (column.type === 'values' || column.type === 'lazy-values') {
1192
1192
  // Nếu là values thì lấy giá trị của value được chọn
1193
- obj[column.field] = ((_y = __classPrivateFieldGet(this, _cacheObjValues)[column.field]) === null || _y === void 0 ? void 0 : _y[item[column.field]]) || item[column.field];
1193
+ obj[column.field] =
1194
+ ((_z = (_y = __classPrivateFieldGet(this, _cacheObjValues)[column.field]) === null || _y === void 0 ? void 0 : _y[item[column.field]]) === null || _z === void 0 ? void 0 : _z[column.option.displayField]) || item[column.field];
1194
1195
  }
1195
1196
  else {
1196
1197
  obj[column.field] = item[column.field];
@@ -1280,8 +1281,8 @@ class SdTable {
1280
1281
  });
1281
1282
  };
1282
1283
  this.onExpand = (rowData) => __awaiter(this, void 0, void 0, function* () {
1283
- var _z, _0, _1, _2, _3;
1284
- if ((_z = this.tableOption.expand) === null || _z === void 0 ? void 0 : _z.always) {
1284
+ var _0, _1, _2, _3, _4;
1285
+ if ((_0 = this.tableOption.expand) === null || _0 === void 0 ? void 0 : _0.always) {
1285
1286
  return;
1286
1287
  }
1287
1288
  if (rowData.meta.expand.isExpanding) {
@@ -1291,8 +1292,8 @@ class SdTable {
1291
1292
  rowData.meta.expand.isExpanded = false;
1292
1293
  return;
1293
1294
  }
1294
- const data = (_2 = (_1 = (_0 = this.tableOption) === null || _0 === void 0 ? void 0 : _0.expand) === null || _1 === void 0 ? void 0 : _1.onExpand) === null || _2 === void 0 ? void 0 : _2.call(_1, rowData.data);
1295
- if (!((_3 = this.tableOption.expand) === null || _3 === void 0 ? void 0 : _3.multiple)) {
1295
+ const data = (_3 = (_2 = (_1 = this.tableOption) === null || _1 === void 0 ? void 0 : _1.expand) === null || _2 === void 0 ? void 0 : _2.onExpand) === null || _3 === void 0 ? void 0 : _3.call(_2, rowData.data);
1296
+ if (!((_4 = this.tableOption.expand) === null || _4 === void 0 ? void 0 : _4.multiple)) {
1296
1297
  this.items.forEach(item => (item.meta.expand.isExpanding = item.meta.expand.isExpanded = false));
1297
1298
  }
1298
1299
  if (data instanceof Promise) {
@@ -1408,7 +1409,7 @@ class SdTable {
1408
1409
  }
1409
1410
  }));
1410
1411
  _format.set(this, (rawItems, columns) => __awaiter(this, void 0, void 0, function* () {
1411
- var _4, _5, _6, _7, _8;
1412
+ var _5, _6, _7, _8, _9;
1412
1413
  const items = rawItems.map(MapToSdTableItem);
1413
1414
  for (const column of columns) {
1414
1415
  // Clickable
@@ -1487,10 +1488,10 @@ class SdTable {
1487
1488
  }
1488
1489
  if (column.type === 'values' || column.type === 'lazy-values') {
1489
1490
  if (column.type === 'lazy-values' && typeof column.option.mapValue === 'function') {
1490
- display.data = ((_5 = (_4 = __classPrivateFieldGet(this, _cacheObjValues)[field]) === null || _4 === void 0 ? void 0 : _4[column.option.mapValue(value, rowData)]) === null || _5 === void 0 ? void 0 : _5[column.option.displayField]) || value;
1491
+ display.data = ((_6 = (_5 = __classPrivateFieldGet(this, _cacheObjValues)[field]) === null || _5 === void 0 ? void 0 : _5[column.option.mapValue(value, rowData)]) === null || _6 === void 0 ? void 0 : _6[column.option.displayField]) || value;
1491
1492
  }
1492
1493
  else {
1493
- display.data = ((_7 = (_6 = __classPrivateFieldGet(this, _cacheObjValues)[field]) === null || _6 === void 0 ? void 0 : _6[value]) === null || _7 === void 0 ? void 0 : _7[column.option.displayField]) || value;
1494
+ display.data = ((_8 = (_7 = __classPrivateFieldGet(this, _cacheObjValues)[field]) === null || _7 === void 0 ? void 0 : _7[value]) === null || _8 === void 0 ? void 0 : _8[column.option.displayField]) || value;
1494
1495
  }
1495
1496
  }
1496
1497
  if (column.type === 'number' && Number.isNumber(value)) {
@@ -1510,7 +1511,7 @@ class SdTable {
1510
1511
  display.badge = {
1511
1512
  type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'icon' : column.badgeType,
1512
1513
  color: column.badge(value, rowData),
1513
- icon: (_8 = column.badgeIcon) === null || _8 === void 0 ? void 0 : _8.call(column, value, rowData),
1514
+ icon: (_9 = column.badgeIcon) === null || _9 === void 0 ? void 0 : _9.call(column, value, rowData),
1514
1515
  };
1515
1516
  }
1516
1517
  else if (column.type === 'bool') {
@@ -2248,7 +2249,7 @@ class SdSelectionVisiblePipe {
2248
2249
  hasGroup = true;
2249
2250
  }
2250
2251
  if (typeof (hidden) === 'function') {
2251
- if (!hidden(rowData)) {
2252
+ if (!hidden(rowData.data)) {
2252
2253
  flag = true;
2253
2254
  rowData.meta.selector.actions.push(key);
2254
2255
  if (isGrouped) {
@@ -2275,7 +2276,7 @@ class SdSelectionVisiblePipe {
2275
2276
  const { hidden, isGrouped } = action;
2276
2277
  const key = hash__default(action);
2277
2278
  if (typeof (hidden) === 'function') {
2278
- if (!hidden(rowData)) {
2279
+ if (!hidden(rowData.data)) {
2279
2280
  rowData.meta.selector.actions.push(key);
2280
2281
  if (isGrouped) {
2281
2282
  groupedActions.push(key);