@gisce/ooui 0.2.7 → 0.2.10
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/dist/Graph.d.ts +4 -0
- package/dist/Graph.js +23 -0
- package/dist/Graph.js.map +1 -1
- package/dist/helpers/onChangeParser.js +0 -1
- package/dist/helpers/onChangeParser.js.map +1 -1
- package/package.json +1 -1
- package/src/Graph.ts +20 -0
- package/src/helpers/onChangeParser.ts +0 -1
- package/src/spec/Form.spec.ts +5 -2
package/dist/Graph.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ declare class Graph {
|
|
|
8
8
|
get color(): string | null;
|
|
9
9
|
_icon: string | null;
|
|
10
10
|
get icon(): string | null;
|
|
11
|
+
_totalDomain: string | null;
|
|
12
|
+
get totalDomain(): string | null;
|
|
13
|
+
_showPercent: boolean;
|
|
14
|
+
get showPercent(): boolean;
|
|
11
15
|
constructor(xml: string);
|
|
12
16
|
}
|
|
13
17
|
export default Graph;
|
package/dist/Graph.js
CHANGED
|
@@ -3,12 +3,21 @@ var Graph = /** @class */ (function () {
|
|
|
3
3
|
this._string = null;
|
|
4
4
|
this._color = null;
|
|
5
5
|
this._icon = null;
|
|
6
|
+
this._totalDomain = null;
|
|
7
|
+
this._showPercent = false;
|
|
6
8
|
var parser = new DOMParser();
|
|
7
9
|
var view = parser.parseFromString(xml, "text/xml");
|
|
8
10
|
this._string = view.documentElement.getAttribute("string");
|
|
9
11
|
var type = view.documentElement.getAttribute("type");
|
|
10
12
|
this._color = view.documentElement.getAttribute("color");
|
|
11
13
|
this._icon = view.documentElement.getAttribute("icon");
|
|
14
|
+
this._totalDomain = view.documentElement.getAttribute("totalDomain");
|
|
15
|
+
var showPercent = view.documentElement.getAttribute("showPercent");
|
|
16
|
+
if (showPercent &&
|
|
17
|
+
(showPercent === "1" ||
|
|
18
|
+
(typeof showPercent === "boolean" && showPercent === true))) {
|
|
19
|
+
this._showPercent = true;
|
|
20
|
+
}
|
|
12
21
|
if (type === "indicator") {
|
|
13
22
|
this._type = "indicator";
|
|
14
23
|
}
|
|
@@ -41,6 +50,20 @@ var Graph = /** @class */ (function () {
|
|
|
41
50
|
enumerable: false,
|
|
42
51
|
configurable: true
|
|
43
52
|
});
|
|
53
|
+
Object.defineProperty(Graph.prototype, "totalDomain", {
|
|
54
|
+
get: function () {
|
|
55
|
+
return this._totalDomain;
|
|
56
|
+
},
|
|
57
|
+
enumerable: false,
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(Graph.prototype, "showPercent", {
|
|
61
|
+
get: function () {
|
|
62
|
+
return this._showPercent;
|
|
63
|
+
},
|
|
64
|
+
enumerable: false,
|
|
65
|
+
configurable: true
|
|
66
|
+
});
|
|
44
67
|
return Graph;
|
|
45
68
|
}());
|
|
46
69
|
export default Graph;
|
package/dist/Graph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graph.js","sourceRoot":"","sources":["../src/Graph.ts"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"Graph.js","sourceRoot":"","sources":["../src/Graph.ts"],"names":[],"mappings":"AAEA;IA+BE,eAAY,GAAW;QA9BvB,YAAO,GAAkB,IAAI,CAAC;QAU9B,WAAM,GAAkB,IAAI,CAAC;QAK7B,UAAK,GAAkB,IAAI,CAAC;QAK5B,iBAAY,GAAkB,IAAI,CAAC;QAKnC,iBAAY,GAAY,KAAK,CAAC;QAM5B,IAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC/B,IAAM,IAAI,GAAa,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAEvD,IAAI,CAAC,MAA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],"names":[],"mappings":"AAAA,IAAM,aAAa,GAAG,UAAC,cAAsB;IAC3C,IAAM,QAAQ,GAAG,cAAc;SAC5B,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"onChangeParser.js","sourceRoot":"","sources":["../../src/helpers/onChangeParser.ts"],"names":[],"mappings":"AAAA,IAAM,aAAa,GAAG,UAAC,cAAsB;IAC3C,IAAM,QAAQ,GAAG,cAAc;SAC5B,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;SAChB,KAAK,CAAC,GAAG,CAAC,CAAC;IAEd,IAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO;QACL,MAAM,QAAA;QACN,IAAI,EAAE,YAAY;KACnB,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/Graph.ts
CHANGED
|
@@ -21,6 +21,16 @@ class Graph {
|
|
|
21
21
|
return this._icon;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
_totalDomain: string | null = null;
|
|
25
|
+
get totalDomain(): string | null {
|
|
26
|
+
return this._totalDomain;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_showPercent: boolean = false;
|
|
30
|
+
get showPercent(): boolean {
|
|
31
|
+
return this._showPercent;
|
|
32
|
+
}
|
|
33
|
+
|
|
24
34
|
constructor(xml: string) {
|
|
25
35
|
const parser = new DOMParser();
|
|
26
36
|
const view: Document = parser.parseFromString(xml, "text/xml");
|
|
@@ -29,6 +39,16 @@ class Graph {
|
|
|
29
39
|
|
|
30
40
|
this._color = view.documentElement.getAttribute("color");
|
|
31
41
|
this._icon = view.documentElement.getAttribute("icon");
|
|
42
|
+
this._totalDomain = view.documentElement.getAttribute("totalDomain");
|
|
43
|
+
|
|
44
|
+
const showPercent = view.documentElement.getAttribute("showPercent");
|
|
45
|
+
if (
|
|
46
|
+
showPercent &&
|
|
47
|
+
(showPercent === "1" ||
|
|
48
|
+
(typeof showPercent === "boolean" && showPercent === true))
|
|
49
|
+
) {
|
|
50
|
+
this._showPercent = true;
|
|
51
|
+
}
|
|
32
52
|
|
|
33
53
|
if (type === "indicator") {
|
|
34
54
|
this._type = "indicator";
|
package/src/spec/Form.spec.ts
CHANGED
|
@@ -915,7 +915,7 @@ describe("A Form", () => {
|
|
|
915
915
|
const xmlViewForm = `<?xml version="1.0"?>
|
|
916
916
|
<form string="Form1">
|
|
917
917
|
<field name="field_id" colspan="4" nolabel="1" />
|
|
918
|
-
<field name="field_char" on_change="on_change_partner_address_id(partner_address_id, context)" colspan="4" nolabel="1" />
|
|
918
|
+
<field name="field_char" on_change="on_change_partner_address_id(partner_address_id, 'foo', context)" colspan="4" nolabel="1" />
|
|
919
919
|
</form>`;
|
|
920
920
|
const form = new Form(fields);
|
|
921
921
|
form.parse(xmlViewForm, {
|
|
@@ -935,7 +935,10 @@ describe("A Form", () => {
|
|
|
935
935
|
expect(form.onChangeFields!["field_char"].args[0]).toBe(
|
|
936
936
|
"partner_address_id"
|
|
937
937
|
);
|
|
938
|
-
expect(form.onChangeFields!["field_char"].args[1]).toBe(
|
|
938
|
+
expect(form.onChangeFields!["field_char"].args[1]).toBe(
|
|
939
|
+
"'foo'"
|
|
940
|
+
);
|
|
941
|
+
expect(form.onChangeFields!["field_char"].args[2]).toBe("context");
|
|
939
942
|
});
|
|
940
943
|
|
|
941
944
|
it("should be able to parse domain for the whole form", () => {
|