@nova-ui/dashboards 12.0.9 → 12.0.10-3654
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/nova-ui-dashboards.umd.js +18 -7
- package/bundles/nova-ui-dashboards.umd.js.map +1 -1
- package/esm2015/lib/common/pipes/dashboard-unit-conversion-pipe.js +3 -3
- package/esm2015/lib/components/timeseries-widget/timeseries-scales.service.js +3 -3
- package/esm2015/lib/services/url-interaction.service.js +18 -4
- package/fesm2015/nova-ui-dashboards.js +18 -6
- package/fesm2015/nova-ui-dashboards.js.map +1 -1
- package/lib/common/pipes/dashboard-unit-conversion-pipe.d.ts +1 -1
- package/lib/services/url-interaction.service.d.ts +3 -0
- package/package.json +3 -3
- package/sdk/atoms/src/lib/common/pipes/dashboard-unit-conversion-pipe.d.ts +1 -1
- package/sdk/atoms/src/lib/common/pipes/dashboard-unit-conversion-pipe.js +2 -2
- package/sdk/atoms/src/lib/common/pipes/dashboard-unit-conversion-pipe.js.map +1 -1
- package/sdk/atoms/src/lib/components/timeseries-widget/timeseries-scales.service.js +1 -1
- package/sdk/atoms/src/lib/components/timeseries-widget/timeseries-scales.service.js.map +1 -1
- package/sdk/atoms/src/lib/services/url-interaction.service.d.ts +3 -0
- package/sdk/atoms/src/lib/services/url-interaction.service.js +16 -2
- package/sdk/atoms/src/lib/services/url-interaction.service.js.map +1 -1
|
@@ -457,10 +457,11 @@
|
|
|
457
457
|
*
|
|
458
458
|
* @returns The string representation of the converted value
|
|
459
459
|
*/
|
|
460
|
-
this.transform = function (value, units) {
|
|
460
|
+
this.transform = function (value, units, defaultThreshold) {
|
|
461
461
|
if (units === void 0) { units = "generic"; }
|
|
462
|
+
if (defaultThreshold === void 0) { defaultThreshold = DEFAULT_UNIT_CONVERSION_THRESHOLD; }
|
|
462
463
|
var valueAsNumber = typeof value === "string" ? parseFloat(value) : value;
|
|
463
|
-
if (valueAsNumber === undefined || isNaN(valueAsNumber) || valueAsNumber <
|
|
464
|
+
if (valueAsNumber === undefined || isNaN(valueAsNumber) || valueAsNumber < defaultThreshold) {
|
|
464
465
|
return (value === null || value === void 0 ? void 0 : value.toString()) || "";
|
|
465
466
|
}
|
|
466
467
|
var conversion = _this.unitConversionService.convert(valueAsNumber, (units === "bytes") ? i2.UnitBase.Bytes : i2.UnitBase.Standard, 1);
|
|
@@ -1387,26 +1388,36 @@
|
|
|
1387
1388
|
} });
|
|
1388
1389
|
|
|
1389
1390
|
var UrlInteractionService = /** @class */ (function () {
|
|
1390
|
-
function UrlInteractionService() {
|
|
1391
|
+
function UrlInteractionService(logger) {
|
|
1392
|
+
this.logger = logger;
|
|
1391
1393
|
}
|
|
1392
1394
|
UrlInteractionService.prototype.template = function (url, data) {
|
|
1393
1395
|
var _this = this;
|
|
1394
1396
|
var regex = new RegExp(/\$\{([a-zA-Z0-9.]*)\}/g);
|
|
1395
|
-
return url.replace(regex, function (match, captured) {
|
|
1397
|
+
return url.replace(regex, function (match, captured) {
|
|
1398
|
+
var _a;
|
|
1399
|
+
try {
|
|
1400
|
+
return (_a = _this.evaluate(captured.split("."), data)) !== null && _a !== void 0 ? _a : "";
|
|
1401
|
+
}
|
|
1402
|
+
catch (e) {
|
|
1403
|
+
_this.logger.error(e);
|
|
1404
|
+
return "";
|
|
1405
|
+
}
|
|
1406
|
+
});
|
|
1396
1407
|
};
|
|
1397
1408
|
UrlInteractionService.prototype.evaluate = function (expresion, data) {
|
|
1398
1409
|
return expresion.reduce(function (result, item) { return result[item]; }, data);
|
|
1399
1410
|
};
|
|
1400
1411
|
return UrlInteractionService;
|
|
1401
1412
|
}());
|
|
1402
|
-
/** @nocollapse */ UrlInteractionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: UrlInteractionService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1413
|
+
/** @nocollapse */ UrlInteractionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: UrlInteractionService, deps: [{ token: i2__namespace.LoggerService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1403
1414
|
/** @nocollapse */ UrlInteractionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: UrlInteractionService, providedIn: "root" });
|
|
1404
1415
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: UrlInteractionService, decorators: [{
|
|
1405
1416
|
type: i0.Injectable,
|
|
1406
1417
|
args: [{
|
|
1407
1418
|
providedIn: "root",
|
|
1408
1419
|
}]
|
|
1409
|
-
}] });
|
|
1420
|
+
}], ctorParameters: function () { return [{ type: i2__namespace.LoggerService }]; } });
|
|
1410
1421
|
|
|
1411
1422
|
// Window is an interface, so it fails when used in constructor parameters for AoT
|
|
1412
1423
|
var WindowObject = /** @class */ (function (_super) {
|
|
@@ -6574,7 +6585,7 @@
|
|
|
6574
6585
|
}
|
|
6575
6586
|
case exports.TimeseriesScaleType.Linear: {
|
|
6576
6587
|
scale = new i2$1.LinearScale();
|
|
6577
|
-
scale.formatters.tick = function (value) { return _this.unitConversionPipe.transform(value, units); };
|
|
6588
|
+
scale.formatters.tick = function (value) { return _this.unitConversionPipe.transform(value, units, i2.UnitBase.Standard); };
|
|
6578
6589
|
break;
|
|
6579
6590
|
}
|
|
6580
6591
|
case exports.TimeseriesScaleType.TimeInterval: {
|