@nova-ui/dashboards 12.0.2-3378 → 12.0.3-3463
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 +32 -12
- package/bundles/nova-ui-dashboards.umd.js.map +1 -1
- package/esm2015/lib/components/providers/interaction/url-interaction-handler.js +8 -9
- package/esm2015/lib/services/public-api.js +2 -1
- package/esm2015/lib/services/url-interaction.service.js +20 -0
- package/fesm2015/nova-ui-dashboards.js +24 -9
- package/fesm2015/nova-ui-dashboards.js.map +1 -1
- package/lib/components/providers/interaction/url-interaction-handler.d.ts +3 -2
- package/lib/services/public-api.d.ts +1 -0
- package/lib/services/url-interaction.service.d.ts +7 -0
- package/package.json +3 -3
- package/sdk/atoms/src/lib/components/providers/interaction/url-interaction-handler.d.ts +3 -2
- package/sdk/atoms/src/lib/components/providers/interaction/url-interaction-handler.js +6 -7
- package/sdk/atoms/src/lib/components/providers/interaction/url-interaction-handler.js.map +1 -1
- package/sdk/atoms/src/lib/services/public-api.d.ts +1 -0
- package/sdk/atoms/src/lib/services/public-api.js +1 -0
- package/sdk/atoms/src/lib/services/public-api.js.map +1 -1
- package/sdk/atoms/src/lib/services/url-interaction.service.d.ts +4 -0
- package/sdk/atoms/src/lib/services/url-interaction.service.js +21 -0
- package/sdk/atoms/src/lib/services/url-interaction.service.js.map +1 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventBus, IEvent, LoggerService } from "@nova-ui/bits";
|
|
2
|
+
import { UrlInteractionService } from "./../../../services/url-interaction.service";
|
|
2
3
|
import { IInteractionHandlerProperties, IInteractionPayload, InteractionHandler } from "./interaction-handler";
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export interface IUrlInteractionHandlerProperties extends IInteractionHandlerProperties {
|
|
@@ -10,8 +11,8 @@ export declare class WindowObject extends Window {
|
|
|
10
11
|
export declare class UrlInteractionHandler extends InteractionHandler<IUrlInteractionHandlerProperties, any> {
|
|
11
12
|
private window;
|
|
12
13
|
private logger;
|
|
13
|
-
private
|
|
14
|
-
constructor(eventBus: EventBus<IEvent>, window: WindowObject, logger: LoggerService);
|
|
14
|
+
private urlInteractionService;
|
|
15
|
+
constructor(eventBus: EventBus<IEvent>, window: WindowObject, logger: LoggerService, urlInteractionService: UrlInteractionService);
|
|
15
16
|
protected handleInteraction(interaction: IInteractionPayload<any>): void;
|
|
16
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<UrlInteractionHandler, never>;
|
|
17
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<UrlInteractionHandler>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class UrlInteractionService {
|
|
3
|
+
template(url: string, data: any): string;
|
|
4
|
+
private evaluate;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UrlInteractionService, never>;
|
|
6
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UrlInteractionService>;
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nova-ui/dashboards",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "12.0.
|
|
4
|
+
"version": "12.0.3-3463",
|
|
5
5
|
"author": "SolarWinds <nova-ui@solarwinds.com>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
{
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
],
|
|
21
21
|
"schematics": "./sdk/schematics/collection.json",
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@nova-ui/bits": "~12.0.
|
|
24
|
-
"@nova-ui/charts": "~12.0.
|
|
23
|
+
"@nova-ui/bits": "~12.0.3-0",
|
|
24
|
+
"@nova-ui/charts": "~12.0.3-0",
|
|
25
25
|
"@schematics/angular": "^12.2.14 || ^13.0.0",
|
|
26
26
|
"angular-gridster2": "^12.1.0 || ^13.0.0",
|
|
27
27
|
"d3": "^5.9.2",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventBus, IEvent, LoggerService } from "@nova-ui/bits";
|
|
2
|
+
import { UrlInteractionService } from "./../../../services/url-interaction.service";
|
|
2
3
|
import { IInteractionHandlerProperties, IInteractionPayload, InteractionHandler } from "./interaction-handler";
|
|
3
4
|
export interface IUrlInteractionHandlerProperties extends IInteractionHandlerProperties {
|
|
4
5
|
url: string;
|
|
@@ -9,7 +10,7 @@ export declare class WindowObject extends Window {
|
|
|
9
10
|
export declare class UrlInteractionHandler extends InteractionHandler<IUrlInteractionHandlerProperties, any> {
|
|
10
11
|
private window;
|
|
11
12
|
private logger;
|
|
12
|
-
private
|
|
13
|
-
constructor(eventBus: EventBus<IEvent>, window: WindowObject, logger: LoggerService);
|
|
13
|
+
private urlInteractionService;
|
|
14
|
+
constructor(eventBus: EventBus<IEvent>, window: WindowObject, logger: LoggerService, urlInteractionService: UrlInteractionService);
|
|
14
15
|
protected handleInteraction(interaction: IInteractionPayload<any>): void;
|
|
15
16
|
}
|
|
@@ -4,7 +4,7 @@ exports.UrlInteractionHandler = exports.WindowObject = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@angular/core");
|
|
6
6
|
const bits_1 = require("@nova-ui/bits");
|
|
7
|
-
const
|
|
7
|
+
const url_interaction_service_1 = require("./../../../services/url-interaction.service");
|
|
8
8
|
const types_1 = require("../../../types");
|
|
9
9
|
const interaction_handler_1 = require("./interaction-handler");
|
|
10
10
|
// Window is an interface, so it fails when used in constructor parameters for AoT
|
|
@@ -12,13 +12,11 @@ class WindowObject extends Window {
|
|
|
12
12
|
}
|
|
13
13
|
exports.WindowObject = WindowObject;
|
|
14
14
|
let UrlInteractionHandler = class UrlInteractionHandler extends interaction_handler_1.InteractionHandler {
|
|
15
|
-
constructor(eventBus, window, logger) {
|
|
15
|
+
constructor(eventBus, window, logger, urlInteractionService) {
|
|
16
16
|
super(eventBus);
|
|
17
17
|
this.window = window;
|
|
18
18
|
this.logger = logger;
|
|
19
|
-
this.
|
|
20
|
-
evaluate: null, // disable javascript evaluation in provided url
|
|
21
|
-
};
|
|
19
|
+
this.urlInteractionService = urlInteractionService;
|
|
22
20
|
}
|
|
23
21
|
handleInteraction(interaction) {
|
|
24
22
|
var _a;
|
|
@@ -26,7 +24,7 @@ let UrlInteractionHandler = class UrlInteractionHandler extends interaction_hand
|
|
|
26
24
|
this.logger.warn("The target url has not been defined.");
|
|
27
25
|
return;
|
|
28
26
|
}
|
|
29
|
-
const href =
|
|
27
|
+
const href = this.urlInteractionService.template(this.properties.url, { "data": interaction.data });
|
|
30
28
|
// if the link evaluates as empty, then don't go anywhere
|
|
31
29
|
if (!href) {
|
|
32
30
|
return;
|
|
@@ -45,7 +43,8 @@ UrlInteractionHandler = tslib_1.__decorate([
|
|
|
45
43
|
tslib_1.__param(1, core_1.Inject("windowObject")),
|
|
46
44
|
tslib_1.__metadata("design:paramtypes", [bits_1.EventBus,
|
|
47
45
|
WindowObject,
|
|
48
|
-
bits_1.LoggerService
|
|
46
|
+
bits_1.LoggerService,
|
|
47
|
+
url_interaction_service_1.UrlInteractionService])
|
|
49
48
|
], UrlInteractionHandler);
|
|
50
49
|
exports.UrlInteractionHandler = UrlInteractionHandler;
|
|
51
50
|
//# sourceMappingURL=url-interaction-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-interaction-handler.js","sourceRoot":"","sources":["../../../../../../../../src/lib/components/providers/interaction/url-interaction-handler.ts"],"names":[],"mappings":";;;;AAAA,wCAAmD;AACnD,wCAAgE;AAChE,
|
|
1
|
+
{"version":3,"file":"url-interaction-handler.js","sourceRoot":"","sources":["../../../../../../../../src/lib/components/providers/interaction/url-interaction-handler.ts"],"names":[],"mappings":";;;;AAAA,wCAAmD;AACnD,wCAAgE;AAChE,yFAAoF;AAEpF,0CAAoD;AAEpD,+DAA+G;AAO/G,kFAAkF;AAClF,MAAa,YAA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.service"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./kpi-color-comparators-registry.service"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./proportional-content-aggregators-registry.service"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./url-interaction.service"), exports);
|
|
13
14
|
//# sourceMappingURL=public-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../../../../src/lib/services/public-api.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,sEAA4C;AAC5C,yEAA+C;AAC/C,oFAA0D;AAC1D,iEAAuC;AACvC,mEAAyC;AACzC,6EAAmD;AACnD,mFAAyD;AACzD,8FAAoE"}
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../../../../src/lib/services/public-api.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,sEAA4C;AAC5C,yEAA+C;AAC/C,oFAA0D;AAC1D,iEAAuC;AACvC,mEAAyC;AACzC,6EAAmD;AACnD,mFAAyD;AACzD,8FAAoE;AACpE,oEAA0C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UrlInteractionService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
let UrlInteractionService = class UrlInteractionService {
|
|
7
|
+
template(url, data) {
|
|
8
|
+
const regex = new RegExp(/\$\{([a-zA-Z0-9.]*)\}/g);
|
|
9
|
+
return url.replace(regex, (match, captured) => this.evaluate(captured.split("."), data));
|
|
10
|
+
}
|
|
11
|
+
evaluate(expresion, data) {
|
|
12
|
+
return expresion.reduce((result, item) => result[item], data);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
UrlInteractionService = tslib_1.__decorate([
|
|
16
|
+
core_1.Injectable({
|
|
17
|
+
providedIn: "root",
|
|
18
|
+
})
|
|
19
|
+
], UrlInteractionService);
|
|
20
|
+
exports.UrlInteractionService = UrlInteractionService;
|
|
21
|
+
//# sourceMappingURL=url-interaction.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-interaction.service.js","sourceRoot":"","sources":["../../../../../../src/lib/services/url-interaction.service.ts"],"names":[],"mappings":";;;;AAAA,wCAA2C;AAK3C,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IACvB,QAAQ,CAAC,GAAW,EAAE,IAAS;QAClC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAA;QAClD,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7F,CAAC;IAEO,QAAQ,CAAC,SAAmB,EAAE,IAAS;QAC3C,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;IACjE,CAAC;CACJ,CAAA;AATY,qBAAqB;IAHjC,iBAAU,CAAC;QACR,UAAU,EAAE,MAAM;KACrB,CAAC;GACW,qBAAqB,CASjC;AATY,sDAAqB"}
|