@sd-angular/core 1.0.12 → 1.0.13
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.
- package/bundles/sd-angular-core-grid-material.umd.js +27 -18
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/cell-view.pipe.js +9 -3
- package/fesm2015/sd-angular-core-grid-material.js +8 -2
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/grid-material/src/lib/models/grid-column.model.d.ts +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.0.12.tgz → sd-angular-core-1.0.13.tgz} +0 -0
|
@@ -4279,9 +4279,9 @@
|
|
|
4279
4279
|
SdCellViewPipe.prototype.transform = function (value, rowData, column, gridOption, key) {
|
|
4280
4280
|
var _a, _b, _c, _d;
|
|
4281
4281
|
return __awaiter(this, void 0, void 0, function () {
|
|
4282
|
-
var displayOnEmpty, align, click, tooltip, htmlTemplate, transform, result, option, seconds, data, option;
|
|
4283
|
-
return __generator(this, function (
|
|
4284
|
-
switch (
|
|
4282
|
+
var displayOnEmpty, align, click, tooltip, htmlTemplate, transform, result, val, _e, option, seconds, data, option;
|
|
4283
|
+
return __generator(this, function (_f) {
|
|
4284
|
+
switch (_f.label) {
|
|
4285
4285
|
case 0:
|
|
4286
4286
|
displayOnEmpty = gridOption.displayOnEmpty;
|
|
4287
4287
|
align = column.align, click = column.click, tooltip = column.tooltip, htmlTemplate = column.htmlTemplate, transform = column.transform;
|
|
@@ -4296,12 +4296,21 @@
|
|
|
4296
4296
|
};
|
|
4297
4297
|
if (!(typeof (htmlTemplate) === 'function')) return [3 /*break*/, 1];
|
|
4298
4298
|
result.display.html = htmlTemplate(value, rowData, __classPrivateFieldGet(this, _isMobileOrTablet$1));
|
|
4299
|
-
return [3 /*break*/,
|
|
4299
|
+
return [3 /*break*/, 10];
|
|
4300
4300
|
case 1:
|
|
4301
|
-
if (!transform) return [3 /*break*/,
|
|
4302
|
-
|
|
4303
|
-
return [3 /*break*/,
|
|
4301
|
+
if (!(typeof (transform) === 'function')) return [3 /*break*/, 5];
|
|
4302
|
+
val = transform(value, rowData);
|
|
4303
|
+
if (!(val instanceof Promise)) return [3 /*break*/, 3];
|
|
4304
|
+
_e = result.display;
|
|
4305
|
+
return [4 /*yield*/, val];
|
|
4304
4306
|
case 2:
|
|
4307
|
+
_e.value = _f.sent();
|
|
4308
|
+
return [3 /*break*/, 4];
|
|
4309
|
+
case 3:
|
|
4310
|
+
result.display.value = val;
|
|
4311
|
+
_f.label = 4;
|
|
4312
|
+
case 4: return [3 /*break*/, 9];
|
|
4313
|
+
case 5:
|
|
4305
4314
|
if (column.type === 'date' || column.type === 'datetime') {
|
|
4306
4315
|
option = column.option;
|
|
4307
4316
|
seconds = Math.round((new Date().getTime() - new Date(value).getTime()) / 1000);
|
|
@@ -4335,24 +4344,24 @@
|
|
|
4335
4344
|
if (column.type === 'time') {
|
|
4336
4345
|
result.display.value = Date.toFormat(value, 'HH:mm');
|
|
4337
4346
|
}
|
|
4338
|
-
if (!(column.type === 'values')) return [3 /*break*/,
|
|
4347
|
+
if (!(column.type === 'values')) return [3 /*break*/, 7];
|
|
4339
4348
|
return [4 /*yield*/, this.gridService.loadValues(column, key)];
|
|
4340
|
-
case
|
|
4341
|
-
data =
|
|
4349
|
+
case 6:
|
|
4350
|
+
data = _f.sent();
|
|
4342
4351
|
result.display.value = (_c = (_a = data.obj[value]) === null || _a === void 0 ? void 0 : _a[(_b = column.option) === null || _b === void 0 ? void 0 : _b.displayField]) !== null && _c !== void 0 ? _c : value;
|
|
4343
|
-
return [3 /*break*/,
|
|
4344
|
-
case
|
|
4352
|
+
return [3 /*break*/, 8];
|
|
4353
|
+
case 7:
|
|
4345
4354
|
if (column.type === 'number' && Number.isNumber(value)) {
|
|
4346
4355
|
result.display.value = Number.toVNCurrency(value);
|
|
4347
4356
|
}
|
|
4348
|
-
|
|
4349
|
-
case
|
|
4357
|
+
_f.label = 8;
|
|
4358
|
+
case 8:
|
|
4350
4359
|
if (column.type === 'bool') {
|
|
4351
4360
|
option = column.option;
|
|
4352
4361
|
result.display.value = value === true ? ((option === null || option === void 0 ? void 0 : option.displayOnTrue) || 'True') : ((option === null || option === void 0 ? void 0 : option.displayOnFalse) || 'False');
|
|
4353
4362
|
}
|
|
4354
|
-
|
|
4355
|
-
case
|
|
4363
|
+
_f.label = 9;
|
|
4364
|
+
case 9:
|
|
4356
4365
|
if (displayOnEmpty && (result.display.value === null || result.display.value === undefined || result.display.value === '')) {
|
|
4357
4366
|
if (typeof (displayOnEmpty) === 'function') {
|
|
4358
4367
|
result.display.html = displayOnEmpty(rowData, column);
|
|
@@ -4361,8 +4370,8 @@
|
|
|
4361
4370
|
result.display.html = "<div class=\"T16R text-black400\">--</div>";
|
|
4362
4371
|
}
|
|
4363
4372
|
}
|
|
4364
|
-
|
|
4365
|
-
case
|
|
4373
|
+
_f.label = 10;
|
|
4374
|
+
case 10:
|
|
4366
4375
|
// Badge
|
|
4367
4376
|
if ((column.type === 'string' || column.type === 'number' || column.type === 'values') && column.badge) {
|
|
4368
4377
|
result.badge = {
|