@sd-angular/core 1.3.19 → 1.3.21

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.
@@ -1711,38 +1711,54 @@
1711
1711
  _prefix$1.set(this, 'a1e67660-8aa2-4c11-b02d-71a32188719f');
1712
1712
  _cache$1.set(this, {});
1713
1713
  this.transform = function (value, column) { return __awaiter(_this, void 0, void 0, function () {
1714
- var _a, _b, _c, _d, _e, _f, items, valueField, displayField, remain, key, values;
1715
- return __generator(this, function (_g) {
1716
- switch (_g.label) {
1714
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, items, valueField, displayField, selection, remain, key, isMultible, values, result, result;
1715
+ return __generator(this, function (_m) {
1716
+ switch (_m.label) {
1717
1717
  case 0:
1718
1718
  if (column.type !== 'values' || !((_a = column.option) === null || _a === void 0 ? void 0 : _a.items) || !((_b = column.option) === null || _b === void 0 ? void 0 : _b.valueField) || !((_c = column.option) === null || _c === void 0 ? void 0 : _c.displayField)) {
1719
1719
  return [2 /*return*/, value];
1720
1720
  }
1721
- _f = column.option, items = _f.items, valueField = _f.valueField, displayField = _f.displayField, remain = __rest(_f, ["items", "valueField", "displayField"]);
1721
+ _l = column.option, items = _l.items, valueField = _l.valueField, displayField = _l.displayField, selection = _l.selection, remain = __rest(_l, ["items", "valueField", "displayField", "selection"]);
1722
1722
  key = hash__default['default']({
1723
1723
  prefix: __classPrivateFieldGet(this, _prefix$1),
1724
1724
  valueField: valueField,
1725
1725
  displayField: displayField,
1726
+ selection: selection,
1726
1727
  remain: remain,
1727
1728
  value: value
1728
1729
  });
1730
+ isMultible = ['MULTIPLE', 'MULTIPLEAUTOCOMPLETE', 'MULTIPLE_EDITOR', 'MULTIPLEAUTOCOMPLETE_EDITOR'].includes(selection);
1729
1731
  if (!(typeof (items) === 'function')) return [3 /*break*/, 3];
1730
1732
  if (!!__classPrivateFieldGet(this, _cache$1)[key]) return [3 /*break*/, 2];
1731
1733
  return [4 /*yield*/, items(value, true)];
1732
1734
  case 1:
1733
- values = _g.sent();
1735
+ values = _m.sent();
1736
+ result = '';
1737
+ if (isMultible && Array.isArray(value)) {
1738
+ result = ((_e = (_d = values === null || values === void 0 ? void 0 : values.filter(function (e) { return value === null || value === void 0 ? void 0 : value.includes(e === null || e === void 0 ? void 0 : e[valueField]); })) === null || _d === void 0 ? void 0 : _d.map(function (e) { return e === null || e === void 0 ? void 0 : e[displayField]; })) === null || _e === void 0 ? void 0 : _e.join(', ')) || (value === null || value === void 0 ? void 0 : value.join(', '));
1739
+ }
1740
+ else {
1741
+ result = ((_f = values === null || values === void 0 ? void 0 : values.find(function (e) { return (e === null || e === void 0 ? void 0 : e[valueField]) === value; })) === null || _f === void 0 ? void 0 : _f[displayField]) || value;
1742
+ }
1734
1743
  __classPrivateFieldGet(this, _cache$1)[key] = {
1735
- result: ((_d = values === null || values === void 0 ? void 0 : values.find(function (e) { return (e === null || e === void 0 ? void 0 : e[valueField]) === value; })) === null || _d === void 0 ? void 0 : _d[displayField]) || value
1744
+ result: result
1736
1745
  };
1737
- _g.label = 2;
1746
+ _m.label = 2;
1738
1747
  case 2: return [3 /*break*/, 4];
1739
1748
  case 3:
1740
1749
  if (!__classPrivateFieldGet(this, _cache$1)[key]) {
1750
+ result = '';
1751
+ if (isMultible && Array.isArray(value)) {
1752
+ result = (_j = (_h = (_g = items === null || items === void 0 ? void 0 : items.filter(function (e) { return value === null || value === void 0 ? void 0 : value.includes(e === null || e === void 0 ? void 0 : e[valueField]); })) === null || _g === void 0 ? void 0 : _g.map(function (e) { return e === null || e === void 0 ? void 0 : e[displayField]; })) === null || _h === void 0 ? void 0 : _h.join(', ')) !== null && _j !== void 0 ? _j : value === null || value === void 0 ? void 0 : value.join(', ');
1753
+ }
1754
+ else {
1755
+ result = ((_k = items === null || items === void 0 ? void 0 : items.find(function (e) { return (e === null || e === void 0 ? void 0 : e[valueField]) === value; })) === null || _k === void 0 ? void 0 : _k[displayField]) || value;
1756
+ }
1741
1757
  __classPrivateFieldGet(this, _cache$1)[key] = {
1742
- result: ((_e = items === null || items === void 0 ? void 0 : items.find(function (e) { return (e === null || e === void 0 ? void 0 : e[valueField]) === value; })) === null || _e === void 0 ? void 0 : _e[displayField]) || value
1758
+ result: result
1743
1759
  };
1744
1760
  }
1745
- _g.label = 4;
1761
+ _m.label = 4;
1746
1762
  case 4: return [2 /*return*/, __classPrivateFieldGet(this, _cache$1)[key].result];
1747
1763
  }
1748
1764
  });