@gisce/ooui 2.7.0 → 2.9.0
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/Graph.d.ts +3 -0
- package/dist/Graph/Graph.d.ts.map +1 -1
- package/dist/Graph/processor/graphProcessor.d.ts +24 -5
- package/dist/Graph/processor/graphProcessor.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/ooui.es.js +285 -260
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Graph/Graph.ts +12 -0
- package/src/Graph/processor/graphProcessor.ts +51 -3
- package/src/index.ts +4 -0
- package/src/spec/graphProcessor.spec.ts +95 -0
package/dist/ooui.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var n = (i, t, e) => (
|
|
4
|
-
import { decode as
|
|
5
|
-
import { evaluateCondition as
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var he = (i, t, e) => t in i ? ue(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var n = (i, t, e) => (he(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { decode as _e } from "html-entities";
|
|
5
|
+
import { evaluateCondition as fe } from "@gisce/conscheck";
|
|
6
6
|
import * as Y from "txml";
|
|
7
|
-
import
|
|
8
|
-
const
|
|
7
|
+
import P from "moment";
|
|
8
|
+
const k = class k {
|
|
9
9
|
constructor(t) {
|
|
10
10
|
/**
|
|
11
11
|
* Determines if widget is read only (default is undefined)
|
|
@@ -36,7 +36,7 @@ const C = class C {
|
|
|
36
36
|
*/
|
|
37
37
|
n(this, "_key");
|
|
38
38
|
n(this, "_parsedWidgetProps", {});
|
|
39
|
-
if (this._colspan =
|
|
39
|
+
if (this._colspan = k._defaultColspan, this._invisible = !1, t) {
|
|
40
40
|
if (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (t.readonly === "1" || t.readonly === 1 || t.readonly === !0 ? this._readOnly = !0 : (t.readonly === "0" || t.readonly === 0 || t.readonly === !1) && (this._readOnly = !1)), t.invisible && (t.invisible === 1 || t.invisible === "1" || t.invisible === !0) && (this._invisible = !0), t.type && (this._type = t.type), t.context && (this._context = t.context), t.domain && (typeof t.domain != "string" ? this._domain = JSON.stringify(t.domain) : this._domain = t.domain), t.widget_props)
|
|
41
41
|
try {
|
|
42
42
|
this._parsedWidgetProps = JSON.parse(
|
|
@@ -49,10 +49,10 @@ const C = class C {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
static get defaultColspan() {
|
|
52
|
-
return
|
|
52
|
+
return k._defaultColspan;
|
|
53
53
|
}
|
|
54
54
|
static set defaultColspan(t) {
|
|
55
|
-
|
|
55
|
+
k._defaultColspan = t;
|
|
56
56
|
}
|
|
57
57
|
get readOnly() {
|
|
58
58
|
return this._readOnly;
|
|
@@ -106,9 +106,9 @@ const C = class C {
|
|
|
106
106
|
/**
|
|
107
107
|
* Default colspan
|
|
108
108
|
*/
|
|
109
|
-
n(
|
|
110
|
-
let
|
|
111
|
-
const
|
|
109
|
+
n(k, "_defaultColspan", 1);
|
|
110
|
+
let C = k;
|
|
111
|
+
const ge = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), me = ({
|
|
112
112
|
entry: i,
|
|
113
113
|
values: t,
|
|
114
114
|
fields: e
|
|
@@ -144,7 +144,7 @@ const _e = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), fe
|
|
|
144
144
|
default:
|
|
145
145
|
return !1;
|
|
146
146
|
}
|
|
147
|
-
}, b = (i) =>
|
|
147
|
+
}, b = (i) => _e(i, { level: "xml" }), q = ({
|
|
148
148
|
fieldName: i,
|
|
149
149
|
valueInObject: t,
|
|
150
150
|
expectedValue: e,
|
|
@@ -164,19 +164,19 @@ const _e = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), fe
|
|
|
164
164
|
modifiedExpectedValue: null,
|
|
165
165
|
directOutcome: !1
|
|
166
166
|
} : (r.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject = r.modifiedValueInObject === void 0 ? !1 : r.modifiedValueInObject, r.modifiedValueInObject = r.modifiedValueInObject === null ? !1 : r.modifiedValueInObject), s[i].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
|
|
167
|
-
},
|
|
167
|
+
}, be = ({
|
|
168
168
|
attrs: i,
|
|
169
169
|
values: t,
|
|
170
170
|
fields: e,
|
|
171
171
|
widgetType: s
|
|
172
172
|
}) => {
|
|
173
173
|
const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(u), h = JSON.parse(_), d = {};
|
|
174
|
-
for (const
|
|
175
|
-
const x = h[
|
|
176
|
-
x ? d[
|
|
174
|
+
for (const f of Object.keys(h)) {
|
|
175
|
+
const x = h[f].map((y) => me({ entry: y, values: t, fields: e })).every((y) => y);
|
|
176
|
+
x ? d[f] = !0 : f === "readonly" && !x && s === "button" && (d[f] = !1);
|
|
177
177
|
}
|
|
178
178
|
return d;
|
|
179
|
-
},
|
|
179
|
+
}, ye = ({
|
|
180
180
|
attrs: i,
|
|
181
181
|
values: t,
|
|
182
182
|
fields: e
|
|
@@ -186,7 +186,7 @@ const _e = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), fe
|
|
|
186
186
|
s.replace(/'/g, '"')
|
|
187
187
|
), a = {};
|
|
188
188
|
for (const l of Object.keys(r))
|
|
189
|
-
a[l] =
|
|
189
|
+
a[l] = fe({
|
|
190
190
|
object: t,
|
|
191
191
|
condition: r[l],
|
|
192
192
|
evaluateFieldComparison: ({
|
|
@@ -206,7 +206,7 @@ const _e = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), fe
|
|
|
206
206
|
"Error parsing new json_attrs. Original string: " + i
|
|
207
207
|
) : s;
|
|
208
208
|
}
|
|
209
|
-
},
|
|
209
|
+
}, xe = ({
|
|
210
210
|
tagAttributes: i,
|
|
211
211
|
values: t,
|
|
212
212
|
fields: e,
|
|
@@ -214,14 +214,14 @@ const _e = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), fe
|
|
|
214
214
|
fallbackMode: r = !0
|
|
215
215
|
}) => {
|
|
216
216
|
let a = {}, l = {};
|
|
217
|
-
if (i.attrs && (l =
|
|
217
|
+
if (i.attrs && (l = be({
|
|
218
218
|
attrs: i.attrs,
|
|
219
219
|
values: t,
|
|
220
220
|
fields: e,
|
|
221
221
|
widgetType: s
|
|
222
222
|
})), i.json_attrs)
|
|
223
223
|
try {
|
|
224
|
-
a =
|
|
224
|
+
a = ye({
|
|
225
225
|
attrs: i.json_attrs,
|
|
226
226
|
values: t,
|
|
227
227
|
fields: e
|
|
@@ -241,7 +241,7 @@ const _e = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), fe
|
|
|
241
241
|
json_attrs: void 0
|
|
242
242
|
};
|
|
243
243
|
};
|
|
244
|
-
class g extends
|
|
244
|
+
class g extends C {
|
|
245
245
|
constructor(e) {
|
|
246
246
|
super(e);
|
|
247
247
|
/**
|
|
@@ -287,7 +287,7 @@ class g extends F {
|
|
|
287
287
|
* Values and keys
|
|
288
288
|
*/
|
|
289
289
|
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
290
|
-
this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(e.help)), e.nolabel && (e.nolabel === "1" || typeof e.nolabel == "boolean" && e.nolabel === !0) && (this._nolabel = !0), e.required && (e.required === "1" || e.required === !0 || e.required === "True") && (this._required = !0), e.sum && (this._sum = b(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline =
|
|
290
|
+
this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(e.help)), e.nolabel && (e.nolabel === "1" || typeof e.nolabel == "boolean" && e.nolabel === !0) && (this._nolabel = !0), e.required && (e.required === "1" || e.required === !0 || e.required === "True") && (this._required = !0), e.sum && (this._sum = b(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = ge(e.help_inline)));
|
|
291
291
|
}
|
|
292
292
|
get id() {
|
|
293
293
|
return this._id;
|
|
@@ -351,9 +351,9 @@ class g extends F {
|
|
|
351
351
|
return this._id === e ? this : null;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
class
|
|
354
|
+
class pe extends g {
|
|
355
355
|
}
|
|
356
|
-
class J extends
|
|
356
|
+
class J extends C {
|
|
357
357
|
findById(t) {
|
|
358
358
|
return null;
|
|
359
359
|
}
|
|
@@ -517,7 +517,7 @@ class z {
|
|
|
517
517
|
}), e;
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
const
|
|
520
|
+
const O = class O extends C {
|
|
521
521
|
constructor(e) {
|
|
522
522
|
super(e);
|
|
523
523
|
/**
|
|
@@ -540,7 +540,7 @@ const k = class k extends F {
|
|
|
540
540
|
n(this, "_label", "");
|
|
541
541
|
this._container = new z(
|
|
542
542
|
e == null ? void 0 : e.col,
|
|
543
|
-
|
|
543
|
+
O._defaultColspan,
|
|
544
544
|
this.readOnly,
|
|
545
545
|
e == null ? void 0 : e.key
|
|
546
546
|
), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label = b(e.string)));
|
|
@@ -552,10 +552,10 @@ const k = class k extends F {
|
|
|
552
552
|
this._id = e;
|
|
553
553
|
}
|
|
554
554
|
static get defaultColspan() {
|
|
555
|
-
return
|
|
555
|
+
return O._defaultColspan;
|
|
556
556
|
}
|
|
557
557
|
static set defaultColspan(e) {
|
|
558
|
-
|
|
558
|
+
O._defaultColspan = e;
|
|
559
559
|
}
|
|
560
560
|
get container() {
|
|
561
561
|
return this._container;
|
|
@@ -589,20 +589,20 @@ const k = class k extends F {
|
|
|
589
589
|
return e === this.id ? this : this.container.findById(e);
|
|
590
590
|
}
|
|
591
591
|
};
|
|
592
|
-
n(
|
|
593
|
-
let
|
|
594
|
-
const
|
|
592
|
+
n(O, "_defaultColspan", 6);
|
|
593
|
+
let v = O;
|
|
594
|
+
const T = class T extends v {
|
|
595
595
|
constructor(e) {
|
|
596
596
|
super(e);
|
|
597
597
|
n(this, "_tabPosition", "top");
|
|
598
598
|
n(this, "_pages", []);
|
|
599
|
-
this.colspan =
|
|
599
|
+
this.colspan = T._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
|
|
600
600
|
}
|
|
601
601
|
static get defaultColspan() {
|
|
602
|
-
return
|
|
602
|
+
return T._defaultColspan;
|
|
603
603
|
}
|
|
604
604
|
static set defaultColspan(e) {
|
|
605
|
-
|
|
605
|
+
T._defaultColspan = e;
|
|
606
606
|
}
|
|
607
607
|
get tabPosition() {
|
|
608
608
|
return this._tabPosition;
|
|
@@ -614,9 +614,9 @@ const O = class O extends w {
|
|
|
614
614
|
return [].concat.apply([], this._container.rows);
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
|
-
n(
|
|
618
|
-
let M =
|
|
619
|
-
class
|
|
617
|
+
n(T, "_defaultColspan", 3);
|
|
618
|
+
let M = T;
|
|
619
|
+
class we extends v {
|
|
620
620
|
constructor(e) {
|
|
621
621
|
super(e);
|
|
622
622
|
n(this, "_icon", null);
|
|
@@ -629,7 +629,7 @@ class xe extends w {
|
|
|
629
629
|
this._icon = e;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
class
|
|
632
|
+
class ve extends v {
|
|
633
633
|
constructor(e) {
|
|
634
634
|
super(e);
|
|
635
635
|
n(this, "_icon", null);
|
|
@@ -714,7 +714,7 @@ class Q extends g {
|
|
|
714
714
|
this._danger = e;
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
class
|
|
717
|
+
class Fe extends v {
|
|
718
718
|
constructor(e) {
|
|
719
719
|
super(e);
|
|
720
720
|
n(this, "_defaultName", "");
|
|
@@ -845,7 +845,7 @@ class B extends g {
|
|
|
845
845
|
this._translatable = e;
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
|
-
class
|
|
848
|
+
class E extends g {
|
|
849
849
|
constructor(e) {
|
|
850
850
|
super(e);
|
|
851
851
|
/**
|
|
@@ -861,7 +861,7 @@ class P extends g {
|
|
|
861
861
|
this._size = e;
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
class
|
|
864
|
+
class Ce extends g {
|
|
865
865
|
constructor(e) {
|
|
866
866
|
super(e);
|
|
867
867
|
/**
|
|
@@ -887,14 +887,14 @@ class ve extends g {
|
|
|
887
887
|
this._relation = e;
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
class
|
|
890
|
+
class ke extends B {
|
|
891
891
|
}
|
|
892
892
|
class X extends g {
|
|
893
893
|
constructor(t) {
|
|
894
894
|
super(t);
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
|
-
class
|
|
897
|
+
class Oe extends g {
|
|
898
898
|
constructor(t) {
|
|
899
899
|
super(t);
|
|
900
900
|
}
|
|
@@ -932,18 +932,18 @@ class L extends g {
|
|
|
932
932
|
this._decimalDigits = e;
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
|
-
class ke extends L {
|
|
936
|
-
}
|
|
937
|
-
class Oe extends g {
|
|
938
|
-
}
|
|
939
935
|
class Te extends L {
|
|
940
936
|
}
|
|
941
937
|
class Pe extends g {
|
|
938
|
+
}
|
|
939
|
+
class Ee extends L {
|
|
940
|
+
}
|
|
941
|
+
class Ie extends g {
|
|
942
942
|
constructor(t) {
|
|
943
943
|
super(t);
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
|
-
class
|
|
946
|
+
class We extends g {
|
|
947
947
|
constructor(t) {
|
|
948
948
|
super(t);
|
|
949
949
|
}
|
|
@@ -1042,7 +1042,7 @@ class U extends g {
|
|
|
1042
1042
|
this._infinite = e;
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
class
|
|
1045
|
+
class Se extends C {
|
|
1046
1046
|
constructor(e) {
|
|
1047
1047
|
super(e);
|
|
1048
1048
|
/**
|
|
@@ -1068,9 +1068,9 @@ class Ie extends F {
|
|
|
1068
1068
|
return null;
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
class
|
|
1071
|
+
class ze extends E {
|
|
1072
1072
|
}
|
|
1073
|
-
class
|
|
1073
|
+
class Ve extends g {
|
|
1074
1074
|
constructor(e) {
|
|
1075
1075
|
super(e);
|
|
1076
1076
|
/**
|
|
@@ -1086,14 +1086,14 @@ class Se extends g {
|
|
|
1086
1086
|
this._filenameField = e;
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
|
-
class
|
|
1089
|
+
class Ye extends g {
|
|
1090
1090
|
}
|
|
1091
|
-
class
|
|
1091
|
+
class De extends g {
|
|
1092
1092
|
constructor(t) {
|
|
1093
1093
|
super(t);
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
class
|
|
1096
|
+
class je extends U {
|
|
1097
1097
|
constructor(e) {
|
|
1098
1098
|
super(e);
|
|
1099
1099
|
/**
|
|
@@ -1125,7 +1125,7 @@ class Ye extends U {
|
|
|
1125
1125
|
return this.parsedWidgetProps.colorField;
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
class
|
|
1128
|
+
class Me extends E {
|
|
1129
1129
|
constructor(e) {
|
|
1130
1130
|
super(e);
|
|
1131
1131
|
n(this, "_nolabel", !0);
|
|
@@ -1216,14 +1216,14 @@ class K extends g {
|
|
|
1216
1216
|
this._columns = e;
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
1219
|
-
class
|
|
1219
|
+
class Ae extends K {
|
|
1220
1220
|
}
|
|
1221
|
-
class
|
|
1221
|
+
class Ne extends E {
|
|
1222
1222
|
get colors() {
|
|
1223
1223
|
return this._parsedWidgetProps.colors || {};
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
class
|
|
1226
|
+
class Be extends E {
|
|
1227
1227
|
constructor(e) {
|
|
1228
1228
|
super(e);
|
|
1229
1229
|
/**
|
|
@@ -1239,9 +1239,9 @@ class Ae extends P {
|
|
|
1239
1239
|
this._direction = e;
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
|
1242
|
-
class
|
|
1242
|
+
class Le extends X {
|
|
1243
1243
|
}
|
|
1244
|
-
class
|
|
1244
|
+
class Ge extends g {
|
|
1245
1245
|
constructor(e) {
|
|
1246
1246
|
super(e);
|
|
1247
1247
|
/**
|
|
@@ -1264,7 +1264,7 @@ class Be extends g {
|
|
|
1264
1264
|
this._errorField = e;
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
|
-
class
|
|
1267
|
+
class $e extends B {
|
|
1268
1268
|
constructor(e) {
|
|
1269
1269
|
super(e);
|
|
1270
1270
|
n(this, "_lang", null);
|
|
@@ -1277,12 +1277,12 @@ class Le extends B {
|
|
|
1277
1277
|
this._lang = e;
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
|
-
class
|
|
1280
|
+
class Re extends g {
|
|
1281
1281
|
constructor(t) {
|
|
1282
1282
|
super(t);
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
|
-
class
|
|
1285
|
+
class qe extends g {
|
|
1286
1286
|
constructor(e) {
|
|
1287
1287
|
super(e);
|
|
1288
1288
|
/**
|
|
@@ -1332,10 +1332,10 @@ class G {
|
|
|
1332
1332
|
this._widgetClass = M;
|
|
1333
1333
|
break;
|
|
1334
1334
|
case "page":
|
|
1335
|
-
this._widgetClass =
|
|
1335
|
+
this._widgetClass = we;
|
|
1336
1336
|
break;
|
|
1337
1337
|
case "group":
|
|
1338
|
-
this._widgetClass =
|
|
1338
|
+
this._widgetClass = ve;
|
|
1339
1339
|
break;
|
|
1340
1340
|
case "label":
|
|
1341
1341
|
this._widgetClass = H;
|
|
@@ -1350,37 +1350,37 @@ class G {
|
|
|
1350
1350
|
this._widgetClass = Q;
|
|
1351
1351
|
break;
|
|
1352
1352
|
case "buttonGroup":
|
|
1353
|
-
this._widgetClass =
|
|
1353
|
+
this._widgetClass = Fe;
|
|
1354
1354
|
break;
|
|
1355
1355
|
case "selection":
|
|
1356
|
-
this._widgetClass =
|
|
1356
|
+
this._widgetClass = E;
|
|
1357
1357
|
break;
|
|
1358
1358
|
case "many2one":
|
|
1359
|
-
this._widgetClass =
|
|
1359
|
+
this._widgetClass = Ce;
|
|
1360
1360
|
break;
|
|
1361
1361
|
case "boolean":
|
|
1362
1362
|
this._widgetClass = X;
|
|
1363
1363
|
break;
|
|
1364
1364
|
case "integer":
|
|
1365
|
-
this._widgetClass =
|
|
1365
|
+
this._widgetClass = Oe;
|
|
1366
1366
|
break;
|
|
1367
1367
|
case "float":
|
|
1368
1368
|
this._widgetClass = L;
|
|
1369
1369
|
break;
|
|
1370
1370
|
case "float_time":
|
|
1371
|
-
this._widgetClass =
|
|
1371
|
+
this._widgetClass = Te;
|
|
1372
1372
|
break;
|
|
1373
1373
|
case "date":
|
|
1374
|
-
this._widgetClass =
|
|
1374
|
+
this._widgetClass = Ie;
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "datetime":
|
|
1377
|
-
this._widgetClass =
|
|
1377
|
+
this._widgetClass = We;
|
|
1378
1378
|
break;
|
|
1379
1379
|
case "progressbar":
|
|
1380
|
-
this._widgetClass =
|
|
1380
|
+
this._widgetClass = Ee;
|
|
1381
1381
|
break;
|
|
1382
1382
|
case "markdown":
|
|
1383
|
-
this._widgetClass =
|
|
1383
|
+
this._widgetClass = ke;
|
|
1384
1384
|
break;
|
|
1385
1385
|
case "many2many":
|
|
1386
1386
|
case "one2many":
|
|
@@ -1391,7 +1391,7 @@ class G {
|
|
|
1391
1391
|
this._widgetClass = J;
|
|
1392
1392
|
break;
|
|
1393
1393
|
case "separator":
|
|
1394
|
-
this._widgetClass =
|
|
1394
|
+
this._widgetClass = Se;
|
|
1395
1395
|
break;
|
|
1396
1396
|
case "url":
|
|
1397
1397
|
this._widgetClass = D;
|
|
@@ -1400,61 +1400,61 @@ class G {
|
|
|
1400
1400
|
this._widgetClass = D;
|
|
1401
1401
|
break;
|
|
1402
1402
|
case "reference":
|
|
1403
|
-
this._widgetClass =
|
|
1403
|
+
this._widgetClass = ze;
|
|
1404
1404
|
break;
|
|
1405
1405
|
case "binary":
|
|
1406
|
-
this._widgetClass =
|
|
1406
|
+
this._widgetClass = Ve;
|
|
1407
1407
|
break;
|
|
1408
1408
|
case "image":
|
|
1409
|
-
this._widgetClass =
|
|
1409
|
+
this._widgetClass = Ye;
|
|
1410
1410
|
break;
|
|
1411
1411
|
case "fiber_grid":
|
|
1412
|
-
this._widgetClass =
|
|
1412
|
+
this._widgetClass = De;
|
|
1413
1413
|
break;
|
|
1414
1414
|
case "timeline":
|
|
1415
|
-
this._widgetClass =
|
|
1415
|
+
this._widgetClass = je;
|
|
1416
1416
|
break;
|
|
1417
1417
|
case "indicator":
|
|
1418
|
-
this._widgetClass =
|
|
1418
|
+
this._widgetClass = Me;
|
|
1419
1419
|
break;
|
|
1420
1420
|
case "tags":
|
|
1421
|
-
this._widgetClass =
|
|
1421
|
+
this._widgetClass = Ae;
|
|
1422
1422
|
break;
|
|
1423
1423
|
case "tag":
|
|
1424
|
-
this._widgetClass =
|
|
1424
|
+
this._widgetClass = Ne;
|
|
1425
1425
|
break;
|
|
1426
1426
|
case "avatar":
|
|
1427
|
-
this._widgetClass =
|
|
1427
|
+
this._widgetClass = pe;
|
|
1428
1428
|
break;
|
|
1429
1429
|
case "radio":
|
|
1430
|
-
this._widgetClass =
|
|
1430
|
+
this._widgetClass = Be;
|
|
1431
1431
|
break;
|
|
1432
1432
|
case "multicheckbox":
|
|
1433
1433
|
this._widgetClass = K;
|
|
1434
1434
|
break;
|
|
1435
1435
|
case "switch":
|
|
1436
|
-
this._widgetClass =
|
|
1436
|
+
this._widgetClass = Le;
|
|
1437
1437
|
break;
|
|
1438
1438
|
case "steps":
|
|
1439
|
-
this._widgetClass =
|
|
1439
|
+
this._widgetClass = Ge;
|
|
1440
1440
|
break;
|
|
1441
1441
|
case "codeeditor":
|
|
1442
|
-
this._widgetClass =
|
|
1442
|
+
this._widgetClass = $e;
|
|
1443
1443
|
break;
|
|
1444
1444
|
case "time":
|
|
1445
|
-
this._widgetClass =
|
|
1445
|
+
this._widgetClass = Re;
|
|
1446
1446
|
break;
|
|
1447
1447
|
case "html_preview":
|
|
1448
|
-
this._widgetClass =
|
|
1448
|
+
this._widgetClass = Pe;
|
|
1449
1449
|
break;
|
|
1450
1450
|
case "alert":
|
|
1451
|
-
this._widgetClass =
|
|
1451
|
+
this._widgetClass = qe;
|
|
1452
1452
|
break;
|
|
1453
1453
|
}
|
|
1454
1454
|
}
|
|
1455
1455
|
createWidget(t, e) {
|
|
1456
1456
|
let s = t;
|
|
1457
|
-
switch (this.setWidgetClass(t), this._widgetClass === void 0 && (s = e.fieldsWidgetType, this.setWidgetClass(e.fieldsWidgetType)), this._widgetClass === void 0 && (this._widgetClass =
|
|
1457
|
+
switch (this.setWidgetClass(t), this._widgetClass === void 0 && (s = e.fieldsWidgetType, this.setWidgetClass(e.fieldsWidgetType)), this._widgetClass === void 0 && (this._widgetClass = C), t) {
|
|
1458
1458
|
case "notebook":
|
|
1459
1459
|
case "page":
|
|
1460
1460
|
case "group":
|
|
@@ -1470,7 +1470,7 @@ class G {
|
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
const
|
|
1473
|
+
const Je = ({
|
|
1474
1474
|
fieldName: i,
|
|
1475
1475
|
values: t,
|
|
1476
1476
|
fields: e
|
|
@@ -1495,7 +1495,7 @@ const Re = ({
|
|
|
1495
1495
|
r[o] = u.some((_) => _);
|
|
1496
1496
|
}
|
|
1497
1497
|
return r;
|
|
1498
|
-
},
|
|
1498
|
+
}, He = ({
|
|
1499
1499
|
states: i,
|
|
1500
1500
|
values: t
|
|
1501
1501
|
}) => {
|
|
@@ -1504,7 +1504,7 @@ const Re = ({
|
|
|
1504
1504
|
const e = i.split(",");
|
|
1505
1505
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1506
1506
|
};
|
|
1507
|
-
function
|
|
1507
|
+
function Qe({
|
|
1508
1508
|
values: i = {},
|
|
1509
1509
|
fieldName: t,
|
|
1510
1510
|
fields: e = {}
|
|
@@ -1528,26 +1528,26 @@ const Z = ({
|
|
|
1528
1528
|
return s;
|
|
1529
1529
|
if (i.trim().length === 0)
|
|
1530
1530
|
return;
|
|
1531
|
-
const d = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((
|
|
1532
|
-
return d.forEach((
|
|
1533
|
-
const
|
|
1534
|
-
if (!
|
|
1535
|
-
const x =
|
|
1531
|
+
const d = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((c) => c.split(":")), f = {};
|
|
1532
|
+
return d.forEach((c) => {
|
|
1533
|
+
const m = c[1];
|
|
1534
|
+
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1535
|
+
const x = Qe({
|
|
1536
1536
|
values: t,
|
|
1537
1537
|
fields: e,
|
|
1538
|
-
fieldName:
|
|
1538
|
+
fieldName: m === "active_id" ? "id" : m
|
|
1539
1539
|
});
|
|
1540
|
-
c[
|
|
1540
|
+
f[c[0].replace(/'/g, "")] = x || void 0;
|
|
1541
1541
|
} else
|
|
1542
|
-
|
|
1542
|
+
c[1] === "true" ? f[c[0].replace(/'/g, "")] = !0 : c[1] === "false" ? f[c[0].replace(/'/g, "")] = !1 : f[c[0].replace(/'/g, "")] = c[1].replace(
|
|
1543
1543
|
/'/g,
|
|
1544
1544
|
""
|
|
1545
1545
|
);
|
|
1546
|
-
}),
|
|
1546
|
+
}), f;
|
|
1547
1547
|
} catch {
|
|
1548
1548
|
return;
|
|
1549
1549
|
}
|
|
1550
|
-
},
|
|
1550
|
+
}, wt = (i) => {
|
|
1551
1551
|
const t = [];
|
|
1552
1552
|
try {
|
|
1553
1553
|
return !i || te(i) || typeof i != "string" ? t : ee(i) !== null ? [] : (i.trim().length === 0 || i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
|
|
@@ -1567,26 +1567,26 @@ function ee(i) {
|
|
|
1567
1567
|
function te(i) {
|
|
1568
1568
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1569
1569
|
}
|
|
1570
|
-
const
|
|
1570
|
+
const Xe = (i) => {
|
|
1571
1571
|
const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1572
1572
|
return {
|
|
1573
1573
|
method: e,
|
|
1574
1574
|
args: r
|
|
1575
1575
|
};
|
|
1576
1576
|
};
|
|
1577
|
-
function
|
|
1577
|
+
function Ue(i) {
|
|
1578
1578
|
const t = [];
|
|
1579
1579
|
function e(s) {
|
|
1580
1580
|
const r = [];
|
|
1581
1581
|
for (const a of s)
|
|
1582
|
-
a instanceof
|
|
1582
|
+
a instanceof v ? e(a._container.rows.flat()) : r.push(a);
|
|
1583
1583
|
r.length > 0 && t.push(r);
|
|
1584
1584
|
}
|
|
1585
1585
|
for (const s of i)
|
|
1586
1586
|
e(s);
|
|
1587
1587
|
return t.flat();
|
|
1588
1588
|
}
|
|
1589
|
-
class
|
|
1589
|
+
class vt {
|
|
1590
1590
|
constructor(t, e = 4) {
|
|
1591
1591
|
/**
|
|
1592
1592
|
* Object containing fields specification of the form.
|
|
@@ -1694,7 +1694,7 @@ class pt {
|
|
|
1694
1694
|
fields: a.children,
|
|
1695
1695
|
container: this._container,
|
|
1696
1696
|
values: s
|
|
1697
|
-
}),
|
|
1697
|
+
}), Ue(this._container._rows).forEach((u) => {
|
|
1698
1698
|
const _ = u;
|
|
1699
1699
|
_._id && _._context && (this._contextForFields[_._id] = u._context);
|
|
1700
1700
|
});
|
|
@@ -1706,65 +1706,65 @@ class pt {
|
|
|
1706
1706
|
}) {
|
|
1707
1707
|
const r = new G();
|
|
1708
1708
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
1709
|
-
var
|
|
1709
|
+
var p, F;
|
|
1710
1710
|
const { tagName: l, attributes: o, children: u } = a;
|
|
1711
1711
|
let _ = l, h = o;
|
|
1712
1712
|
if (l === "field") {
|
|
1713
|
-
const { name:
|
|
1713
|
+
const { name: w, widget: I } = o;
|
|
1714
1714
|
if (I)
|
|
1715
1715
|
_ = I;
|
|
1716
|
-
else if (
|
|
1717
|
-
if (!this._fields[
|
|
1716
|
+
else if (w) {
|
|
1717
|
+
if (!this._fields[w])
|
|
1718
1718
|
throw new Error(
|
|
1719
|
-
`Field ${
|
|
1719
|
+
`Field ${w} doesn't exist in fields defintion`
|
|
1720
1720
|
);
|
|
1721
|
-
_ = this._fields[
|
|
1721
|
+
_ = this._fields[w].type;
|
|
1722
1722
|
}
|
|
1723
1723
|
h = {
|
|
1724
|
-
...this._fields[
|
|
1724
|
+
...this._fields[w],
|
|
1725
1725
|
...o,
|
|
1726
|
-
fieldsWidgetType: this._fields[
|
|
1726
|
+
fieldsWidgetType: this._fields[w].type
|
|
1727
1727
|
};
|
|
1728
1728
|
}
|
|
1729
|
-
const d =
|
|
1729
|
+
const d = xe({
|
|
1730
1730
|
tagAttributes: h,
|
|
1731
1731
|
values: s,
|
|
1732
1732
|
fields: this._fields,
|
|
1733
1733
|
widgetType: l
|
|
1734
1734
|
});
|
|
1735
|
-
let
|
|
1736
|
-
l === "button" && h.states ?
|
|
1735
|
+
let f;
|
|
1736
|
+
l === "button" && h.states ? f = He({
|
|
1737
1737
|
states: h.states,
|
|
1738
1738
|
values: s
|
|
1739
|
-
}) :
|
|
1739
|
+
}) : f = Je({
|
|
1740
1740
|
fieldName: h.name,
|
|
1741
1741
|
values: s,
|
|
1742
1742
|
fields: this._fields
|
|
1743
1743
|
});
|
|
1744
|
-
const
|
|
1745
|
-
context: h.context || ((
|
|
1744
|
+
const c = Z({
|
|
1745
|
+
context: h.context || ((p = this._fields[h.name]) == null ? void 0 : p.context),
|
|
1746
1746
|
values: s,
|
|
1747
1747
|
fields: this._fields
|
|
1748
1748
|
});
|
|
1749
|
-
h.on_change && (this._onChangeFields[h.name] =
|
|
1749
|
+
h.on_change && (this._onChangeFields[h.name] = Xe(
|
|
1750
1750
|
h.on_change
|
|
1751
1751
|
));
|
|
1752
|
-
let
|
|
1753
|
-
R(h.domain) && (
|
|
1752
|
+
let m;
|
|
1753
|
+
R(h.domain) && (m = h.domain), R((F = this._fields[h.name]) == null ? void 0 : F.domain) && (m = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1754
1754
|
const x = {
|
|
1755
1755
|
...d,
|
|
1756
|
-
...
|
|
1757
|
-
context:
|
|
1758
|
-
domain:
|
|
1756
|
+
...f,
|
|
1757
|
+
context: c,
|
|
1758
|
+
domain: m,
|
|
1759
1759
|
key: `${this._keyIdx}`
|
|
1760
1760
|
};
|
|
1761
1761
|
e.readOnly && (x.readonly = !0);
|
|
1762
|
-
const
|
|
1763
|
-
|
|
1762
|
+
const y = r.createWidget(_, x);
|
|
1763
|
+
y.invisible && y instanceof g && this._invisibleFields.push(x.name), y instanceof v && this.parseNode({
|
|
1764
1764
|
fields: u,
|
|
1765
|
-
container:
|
|
1765
|
+
container: y.container,
|
|
1766
1766
|
values: s
|
|
1767
|
-
}),
|
|
1767
|
+
}), y instanceof Q && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
1768
1768
|
});
|
|
1769
1769
|
}
|
|
1770
1770
|
/**
|
|
@@ -1778,7 +1778,7 @@ class pt {
|
|
|
1778
1778
|
function R(i) {
|
|
1779
1779
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1780
1780
|
}
|
|
1781
|
-
class
|
|
1781
|
+
class Ft {
|
|
1782
1782
|
constructor(t) {
|
|
1783
1783
|
/**
|
|
1784
1784
|
* Object containing fields specification of the form.
|
|
@@ -1847,7 +1847,7 @@ class wt {
|
|
|
1847
1847
|
throw new Error(`Field ${u} doesn't exist in fields defintion`);
|
|
1848
1848
|
const d = this._fields[u];
|
|
1849
1849
|
o = d.type, (Array.isArray(d == null ? void 0 : d.domain) && (d == null ? void 0 : d.domain.length) === 0 || (d == null ? void 0 : d.domain) === !1) && l.domain && l.domain.length > 0 && delete d.domain;
|
|
1850
|
-
const
|
|
1850
|
+
const f = Z({
|
|
1851
1851
|
context: l.context || d.context,
|
|
1852
1852
|
values: {},
|
|
1853
1853
|
fields: this._fields
|
|
@@ -1856,8 +1856,8 @@ class wt {
|
|
|
1856
1856
|
...d,
|
|
1857
1857
|
...l,
|
|
1858
1858
|
fieldsWidgetType: d == null ? void 0 : d.type,
|
|
1859
|
-
context:
|
|
1860
|
-
}, this._contextForFields[u] =
|
|
1859
|
+
context: f
|
|
1860
|
+
}, this._contextForFields[u] = f;
|
|
1861
1861
|
}
|
|
1862
1862
|
if (_ && (o = _), !h.invisible) {
|
|
1863
1863
|
const d = s.createWidget(o, h);
|
|
@@ -1874,7 +1874,7 @@ class wt {
|
|
|
1874
1874
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
|
-
const
|
|
1877
|
+
const Ke = {
|
|
1878
1878
|
text: "text",
|
|
1879
1879
|
many2one: "many2one",
|
|
1880
1880
|
char: "char",
|
|
@@ -1887,7 +1887,7 @@ const Xe = {
|
|
|
1887
1887
|
date: "date",
|
|
1888
1888
|
datetime: "datetime"
|
|
1889
1889
|
};
|
|
1890
|
-
class
|
|
1890
|
+
class Ct {
|
|
1891
1891
|
constructor(t, e, s = 8) {
|
|
1892
1892
|
/**
|
|
1893
1893
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -1935,7 +1935,7 @@ class vt {
|
|
|
1935
1935
|
colspan: 2
|
|
1936
1936
|
}, { type: a, widget: l } = r;
|
|
1937
1937
|
let o = l ?? a;
|
|
1938
|
-
return
|
|
1938
|
+
return Ke[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
1939
1939
|
});
|
|
1940
1940
|
}
|
|
1941
1941
|
/**
|
|
@@ -1946,7 +1946,7 @@ class vt {
|
|
|
1946
1946
|
return this.advancedSearchContainer.findById(t);
|
|
1947
1947
|
}
|
|
1948
1948
|
}
|
|
1949
|
-
const
|
|
1949
|
+
const kt = ({
|
|
1950
1950
|
domain: i,
|
|
1951
1951
|
widgetFieldName: t
|
|
1952
1952
|
}) => {
|
|
@@ -1961,8 +1961,8 @@ const Ft = ({
|
|
|
1961
1961
|
r.length - 1
|
|
1962
1962
|
)) : (o = r, u = "id"), o === t && e.push([u, a, l]);
|
|
1963
1963
|
}), e;
|
|
1964
|
-
},
|
|
1965
|
-
class
|
|
1964
|
+
}, Ot = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
1965
|
+
class Ze {
|
|
1966
1966
|
constructor(t) {
|
|
1967
1967
|
n(this, "_action_id", null);
|
|
1968
1968
|
n(this, "_position", null);
|
|
@@ -1975,7 +1975,7 @@ class Ue {
|
|
|
1975
1975
|
return this._position;
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
|
-
class
|
|
1978
|
+
class Tt {
|
|
1979
1979
|
constructor(t) {
|
|
1980
1980
|
n(this, "_string", null);
|
|
1981
1981
|
n(this, "_items", []);
|
|
@@ -1983,7 +1983,7 @@ class kt {
|
|
|
1983
1983
|
this._string = e.attributes.string || null;
|
|
1984
1984
|
const { children: s } = e;
|
|
1985
1985
|
s.forEach((r) => {
|
|
1986
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
1986
|
+
r.tagName === "dashboard_item" && this._items.push(new Ze(r.attributes));
|
|
1987
1987
|
});
|
|
1988
1988
|
}
|
|
1989
1989
|
get string() {
|
|
@@ -1999,7 +1999,11 @@ class ie {
|
|
|
1999
1999
|
n(this, "_type");
|
|
2000
2000
|
n(this, "_timerange", null);
|
|
2001
2001
|
n(this, "_interval", 1);
|
|
2002
|
-
this
|
|
2002
|
+
n(this, "_y_range", "default");
|
|
2003
|
+
if (this._string = t.attributes.string || null, this._timerange = t.attributes.timerange || null, t.attributes.interval && (this._interval = parseInt(t.attributes.interval)), t.attributes.y_range) {
|
|
2004
|
+
const e = t.attributes.y_range;
|
|
2005
|
+
(e === "auto" || e === "full" || e === "default") && (this._y_range = e);
|
|
2006
|
+
}
|
|
2003
2007
|
}
|
|
2004
2008
|
get string() {
|
|
2005
2009
|
return this._string;
|
|
@@ -2013,8 +2017,11 @@ class ie {
|
|
|
2013
2017
|
get interval() {
|
|
2014
2018
|
return this._interval;
|
|
2015
2019
|
}
|
|
2020
|
+
get y_range() {
|
|
2021
|
+
return this._y_range;
|
|
2022
|
+
}
|
|
2016
2023
|
}
|
|
2017
|
-
const
|
|
2024
|
+
const et = (i) => i === 1 || i === "1" || i === !0 || i === "True";
|
|
2018
2025
|
class se extends ie {
|
|
2019
2026
|
constructor(e, s) {
|
|
2020
2027
|
super(s);
|
|
@@ -2023,7 +2030,7 @@ class se extends ie {
|
|
|
2023
2030
|
n(this, "_totalDomain", null);
|
|
2024
2031
|
n(this, "_showPercent", !1);
|
|
2025
2032
|
n(this, "_suffix", null);
|
|
2026
|
-
this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent =
|
|
2033
|
+
this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent = et(s.attributes.showPercent);
|
|
2027
2034
|
}
|
|
2028
2035
|
get color() {
|
|
2029
2036
|
return this._color;
|
|
@@ -2041,7 +2048,7 @@ class se extends ie {
|
|
|
2041
2048
|
return this._suffix;
|
|
2042
2049
|
}
|
|
2043
2050
|
}
|
|
2044
|
-
class
|
|
2051
|
+
class tt extends se {
|
|
2045
2052
|
constructor(e, s) {
|
|
2046
2053
|
super(e, s);
|
|
2047
2054
|
n(this, "_field");
|
|
@@ -2061,7 +2068,7 @@ class Ze extends se {
|
|
|
2061
2068
|
return this._operator;
|
|
2062
2069
|
}
|
|
2063
2070
|
}
|
|
2064
|
-
const
|
|
2071
|
+
const it = (i) => {
|
|
2065
2072
|
const t = [];
|
|
2066
2073
|
let e;
|
|
2067
2074
|
if (i.forEach((s) => {
|
|
@@ -2071,10 +2078,10 @@ const et = (i) => {
|
|
|
2071
2078
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2072
2079
|
if (!l)
|
|
2073
2080
|
throw new Error("Missing name attribute for field");
|
|
2074
|
-
r === "x" ? e = new
|
|
2081
|
+
r === "x" ? e = new rt({
|
|
2075
2082
|
name: l
|
|
2076
2083
|
}) : r === "y" && t.push(
|
|
2077
|
-
new
|
|
2084
|
+
new nt({
|
|
2078
2085
|
name: l,
|
|
2079
2086
|
operator: a,
|
|
2080
2087
|
label: o,
|
|
@@ -2097,7 +2104,7 @@ class j extends ie {
|
|
|
2097
2104
|
n(this, "_x");
|
|
2098
2105
|
n(this, "_y");
|
|
2099
2106
|
this._type = e;
|
|
2100
|
-
const r =
|
|
2107
|
+
const r = it(s.children);
|
|
2101
2108
|
this._x = r.x, this._y = r.y;
|
|
2102
2109
|
}
|
|
2103
2110
|
get x() {
|
|
@@ -2107,17 +2114,17 @@ class j extends ie {
|
|
|
2107
2114
|
return this._y;
|
|
2108
2115
|
}
|
|
2109
2116
|
}
|
|
2110
|
-
const
|
|
2117
|
+
const st = {
|
|
2111
2118
|
indicator: se,
|
|
2112
|
-
indicatorField:
|
|
2119
|
+
indicatorField: tt,
|
|
2113
2120
|
line: j,
|
|
2114
2121
|
bar: j,
|
|
2115
2122
|
pie: j
|
|
2116
|
-
},
|
|
2123
|
+
}, Pt = (i) => {
|
|
2117
2124
|
const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2118
2125
|
if (!e)
|
|
2119
2126
|
throw new Error(`${e} is not a valid graph`);
|
|
2120
|
-
const s =
|
|
2127
|
+
const s = st[e];
|
|
2121
2128
|
if (!s)
|
|
2122
2129
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2123
2130
|
return new s(e, t);
|
|
@@ -2135,7 +2142,7 @@ class ne {
|
|
|
2135
2142
|
return this._axis;
|
|
2136
2143
|
}
|
|
2137
2144
|
}
|
|
2138
|
-
class
|
|
2145
|
+
class nt extends ne {
|
|
2139
2146
|
constructor({
|
|
2140
2147
|
name: e,
|
|
2141
2148
|
operator: s,
|
|
@@ -2158,12 +2165,12 @@ class it extends ne {
|
|
|
2158
2165
|
return this._stacked;
|
|
2159
2166
|
}
|
|
2160
2167
|
}
|
|
2161
|
-
class
|
|
2168
|
+
class rt extends ne {
|
|
2162
2169
|
constructor({ name: t }) {
|
|
2163
2170
|
super({ name: t, axis: "x" });
|
|
2164
2171
|
}
|
|
2165
2172
|
}
|
|
2166
|
-
const
|
|
2173
|
+
const at = ({ ooui: i }) => {
|
|
2167
2174
|
const e = [i.x.name];
|
|
2168
2175
|
return i.y ? (i.y.forEach((s) => {
|
|
2169
2176
|
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
@@ -2185,27 +2192,27 @@ function $({
|
|
|
2185
2192
|
}
|
|
2186
2193
|
return { value: r, label: r };
|
|
2187
2194
|
}
|
|
2188
|
-
const
|
|
2195
|
+
const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2189
2196
|
__proto__: null,
|
|
2190
|
-
getFieldsToRetrieve:
|
|
2197
|
+
getFieldsToRetrieve: at,
|
|
2191
2198
|
getValueAndLabelForField: $
|
|
2192
2199
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2193
|
-
function
|
|
2200
|
+
function lt({
|
|
2194
2201
|
values: i,
|
|
2195
2202
|
timerange: t,
|
|
2196
2203
|
interval: e = 1
|
|
2197
2204
|
}) {
|
|
2198
|
-
const s =
|
|
2205
|
+
const s = dt({
|
|
2199
2206
|
values: i,
|
|
2200
2207
|
timerange: t
|
|
2201
2208
|
});
|
|
2202
|
-
return
|
|
2209
|
+
return ot({
|
|
2203
2210
|
values: s,
|
|
2204
2211
|
timerange: t,
|
|
2205
2212
|
interval: e
|
|
2206
2213
|
});
|
|
2207
2214
|
}
|
|
2208
|
-
function
|
|
2215
|
+
function ot({
|
|
2209
2216
|
values: i,
|
|
2210
2217
|
timerange: t,
|
|
2211
2218
|
interval: e = 1
|
|
@@ -2221,16 +2228,16 @@ function at({
|
|
|
2221
2228
|
const h = u[_];
|
|
2222
2229
|
if (s.push(h), _ === u.length - 1)
|
|
2223
2230
|
return;
|
|
2224
|
-
const d = h.x,
|
|
2225
|
-
if (!re([d,
|
|
2226
|
-
const
|
|
2227
|
-
dates: [d,
|
|
2231
|
+
const d = h.x, f = u[_ + 1].x;
|
|
2232
|
+
if (!re([d, f], a)) {
|
|
2233
|
+
const c = ct({
|
|
2234
|
+
dates: [d, f],
|
|
2228
2235
|
timerange: t,
|
|
2229
2236
|
interval: e
|
|
2230
2237
|
});
|
|
2231
2238
|
s = s.concat(
|
|
2232
|
-
|
|
2233
|
-
x:
|
|
2239
|
+
c.map((m) => ({
|
|
2240
|
+
x: m,
|
|
2234
2241
|
value: 0,
|
|
2235
2242
|
type: h.type,
|
|
2236
2243
|
stacked: h.stacked
|
|
@@ -2240,7 +2247,7 @@ function at({
|
|
|
2240
2247
|
}
|
|
2241
2248
|
}), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
|
|
2242
2249
|
}
|
|
2243
|
-
function
|
|
2250
|
+
function ct({
|
|
2244
2251
|
dates: i,
|
|
2245
2252
|
timerange: t,
|
|
2246
2253
|
interval: e = 1
|
|
@@ -2252,21 +2259,21 @@ function lt({
|
|
|
2252
2259
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2253
2260
|
const o = a[l], u = a[l + 1];
|
|
2254
2261
|
if (!re([o, u], r)) {
|
|
2255
|
-
const _ =
|
|
2262
|
+
const _ = P(o, S(r)).add(
|
|
2256
2263
|
e,
|
|
2257
2264
|
r
|
|
2258
|
-
), h =
|
|
2265
|
+
), h = P(u, S(r));
|
|
2259
2266
|
for (; _.isBefore(h); )
|
|
2260
2267
|
s.push(_.format(S(r))), _.add(e, r);
|
|
2261
2268
|
}
|
|
2262
2269
|
}
|
|
2263
2270
|
return s;
|
|
2264
2271
|
}
|
|
2265
|
-
function
|
|
2272
|
+
function dt({
|
|
2266
2273
|
values: i,
|
|
2267
2274
|
timerange: t
|
|
2268
2275
|
}) {
|
|
2269
|
-
const e =
|
|
2276
|
+
const e = ut({
|
|
2270
2277
|
values: i,
|
|
2271
2278
|
timerange: t
|
|
2272
2279
|
}), s = [], r = ae({
|
|
@@ -2284,24 +2291,24 @@ function ot({
|
|
|
2284
2291
|
});
|
|
2285
2292
|
}), s;
|
|
2286
2293
|
}
|
|
2287
|
-
function
|
|
2294
|
+
function ut({
|
|
2288
2295
|
values: i,
|
|
2289
2296
|
timerange: t
|
|
2290
2297
|
}) {
|
|
2291
2298
|
return i.map((e) => ({
|
|
2292
2299
|
...e,
|
|
2293
|
-
x:
|
|
2300
|
+
x: ht({
|
|
2294
2301
|
date: e.x,
|
|
2295
2302
|
timerange: t
|
|
2296
2303
|
})
|
|
2297
2304
|
}));
|
|
2298
2305
|
}
|
|
2299
|
-
function
|
|
2306
|
+
function ht({
|
|
2300
2307
|
date: i,
|
|
2301
2308
|
timerange: t
|
|
2302
2309
|
}) {
|
|
2303
|
-
let e =
|
|
2304
|
-
const s =
|
|
2310
|
+
let e = _t(i);
|
|
2311
|
+
const s = P(i, e);
|
|
2305
2312
|
switch (t) {
|
|
2306
2313
|
case "hour": {
|
|
2307
2314
|
e = "YYYY-MM-DD HH:00";
|
|
@@ -2326,7 +2333,7 @@ function dt({
|
|
|
2326
2333
|
}
|
|
2327
2334
|
return s.format(e);
|
|
2328
2335
|
}
|
|
2329
|
-
function
|
|
2336
|
+
function _t(i) {
|
|
2330
2337
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2331
2338
|
}
|
|
2332
2339
|
function re(i, t) {
|
|
@@ -2337,7 +2344,7 @@ function re(i, t) {
|
|
|
2337
2344
|
if (i.length === 1)
|
|
2338
2345
|
return !0;
|
|
2339
2346
|
for (let r = 0; r < i.length - 1; r++) {
|
|
2340
|
-
const a =
|
|
2347
|
+
const a = P(i[r], s), o = P(i[r + 1], s).diff(a, t);
|
|
2341
2348
|
Math.abs(o) === 1 ? e = !0 : e = !1;
|
|
2342
2349
|
}
|
|
2343
2350
|
return e;
|
|
@@ -2367,7 +2374,7 @@ function S(i) {
|
|
|
2367
2374
|
return "YYYY-MM-DD HH:mm";
|
|
2368
2375
|
}
|
|
2369
2376
|
}
|
|
2370
|
-
const
|
|
2377
|
+
const ft = {
|
|
2371
2378
|
count: "count",
|
|
2372
2379
|
"+": "sum",
|
|
2373
2380
|
"-": "subtract",
|
|
@@ -2375,7 +2382,7 @@ const ht = {
|
|
|
2375
2382
|
avg: "average",
|
|
2376
2383
|
min: "min",
|
|
2377
2384
|
max: "max"
|
|
2378
|
-
},
|
|
2385
|
+
}, gt = ({
|
|
2379
2386
|
ooui: i,
|
|
2380
2387
|
values: t,
|
|
2381
2388
|
fields: e,
|
|
@@ -2387,43 +2394,43 @@ const ht = {
|
|
|
2387
2394
|
fields: e
|
|
2388
2395
|
}), a = [];
|
|
2389
2396
|
i.y.forEach((c) => {
|
|
2390
|
-
Object.keys(r).forEach((
|
|
2391
|
-
const
|
|
2397
|
+
Object.keys(r).forEach((m) => {
|
|
2398
|
+
const x = r[m].label, y = r[m].entries;
|
|
2392
2399
|
if (c.label) {
|
|
2393
|
-
const
|
|
2400
|
+
const p = N({
|
|
2394
2401
|
fieldName: c.label,
|
|
2395
|
-
values:
|
|
2402
|
+
values: y,
|
|
2396
2403
|
fields: e
|
|
2397
2404
|
});
|
|
2398
|
-
Object.keys(
|
|
2399
|
-
const
|
|
2400
|
-
entries:
|
|
2405
|
+
Object.keys(p).forEach((F) => {
|
|
2406
|
+
const w = p[F].entries, I = p[F].label, ce = A({
|
|
2407
|
+
entries: w,
|
|
2401
2408
|
fields: e,
|
|
2402
2409
|
fieldName: c.name
|
|
2403
|
-
}),
|
|
2404
|
-
values:
|
|
2410
|
+
}), de = V({
|
|
2411
|
+
values: ce,
|
|
2405
2412
|
operator: c.operator
|
|
2406
2413
|
});
|
|
2407
2414
|
a.push({
|
|
2408
|
-
x:
|
|
2409
|
-
value:
|
|
2410
|
-
type:
|
|
2415
|
+
x: x || !1,
|
|
2416
|
+
value: de,
|
|
2417
|
+
type: I,
|
|
2411
2418
|
operator: c.operator,
|
|
2412
2419
|
stacked: c.stacked
|
|
2413
2420
|
});
|
|
2414
2421
|
});
|
|
2415
2422
|
} else {
|
|
2416
|
-
const
|
|
2417
|
-
entries:
|
|
2423
|
+
const p = A({
|
|
2424
|
+
entries: y,
|
|
2418
2425
|
fields: e,
|
|
2419
2426
|
fieldName: c.name
|
|
2420
|
-
}),
|
|
2421
|
-
values:
|
|
2427
|
+
}), F = V({
|
|
2428
|
+
values: p,
|
|
2422
2429
|
operator: c.operator
|
|
2423
2430
|
});
|
|
2424
2431
|
a.push({
|
|
2425
|
-
x:
|
|
2426
|
-
value:
|
|
2432
|
+
x: x || !1,
|
|
2433
|
+
value: F,
|
|
2427
2434
|
type: le({
|
|
2428
2435
|
yAxis: c,
|
|
2429
2436
|
fields: e
|
|
@@ -2435,22 +2442,30 @@ const ht = {
|
|
|
2435
2442
|
});
|
|
2436
2443
|
});
|
|
2437
2444
|
const l = i.y.some((c) => c.label !== void 0), o = i.y.some((c) => c.stacked !== void 0);
|
|
2438
|
-
let _ = [...a.sort((c,
|
|
2445
|
+
let _ = [...a.sort((c, m) => c.x < m.x ? -1 : c.x > m.x ? 1 : 0)];
|
|
2439
2446
|
o && i.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
|
|
2440
2447
|
let h = [..._];
|
|
2441
2448
|
i.type === "pie" && h.some((c) => c.x === !1) ? h = h.map((c) => c.x === !1 ? { ...c, x: (s == null ? void 0 : s.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (h = h.filter(
|
|
2442
2449
|
(c) => c.x !== !1
|
|
2443
2450
|
));
|
|
2444
2451
|
let d = h;
|
|
2445
|
-
|
|
2452
|
+
i.timerange ? d = lt({
|
|
2446
2453
|
values: d,
|
|
2447
2454
|
timerange: i.timerange,
|
|
2448
2455
|
interval: i.interval
|
|
2449
|
-
}) : i.type == "pie" && (d = h.sort((c,
|
|
2456
|
+
}) : i.type == "pie" && (d = h.sort((c, m) => m.value - c.value));
|
|
2457
|
+
const f = {
|
|
2450
2458
|
data: d,
|
|
2451
2459
|
isGroup: o || l,
|
|
2452
2460
|
isStack: o
|
|
2453
2461
|
};
|
|
2462
|
+
if (i.type === "line" && i.y_range && (f.yAxisOpts = {
|
|
2463
|
+
mode: i.y_range
|
|
2464
|
+
}, i.y_range === "auto")) {
|
|
2465
|
+
const { min: c, max: m } = oe(d);
|
|
2466
|
+
f.yAxisOpts.valueOpts = { min: c, max: m };
|
|
2467
|
+
}
|
|
2468
|
+
return f;
|
|
2454
2469
|
};
|
|
2455
2470
|
function A({
|
|
2456
2471
|
entries: i,
|
|
@@ -2516,7 +2531,7 @@ function N({
|
|
|
2516
2531
|
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
|
|
2517
2532
|
}), s;
|
|
2518
2533
|
}
|
|
2519
|
-
function
|
|
2534
|
+
function mt(i) {
|
|
2520
2535
|
let t = [];
|
|
2521
2536
|
return Object.keys(i).forEach((e) => {
|
|
2522
2537
|
const s = i[e];
|
|
@@ -2530,77 +2545,87 @@ function le({
|
|
|
2530
2545
|
const e = t[i.name];
|
|
2531
2546
|
return e != null && e.string ? e.string : i.name;
|
|
2532
2547
|
}
|
|
2533
|
-
|
|
2548
|
+
function oe(i, t = 0.1) {
|
|
2549
|
+
if (i.length === 0)
|
|
2550
|
+
throw new Error("The values array cannot be empty.");
|
|
2551
|
+
const e = i.map((l) => l.value), s = Math.min(...e), r = Math.max(...e), a = (r - s) * t;
|
|
2552
|
+
return {
|
|
2553
|
+
min: s - a,
|
|
2554
|
+
max: r + a
|
|
2555
|
+
};
|
|
2556
|
+
}
|
|
2557
|
+
const It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2534
2558
|
__proto__: null,
|
|
2535
|
-
getAllObjectsInGroupedValues:
|
|
2559
|
+
getAllObjectsInGroupedValues: mt,
|
|
2560
|
+
getMinMax: oe,
|
|
2536
2561
|
getValueForOperator: V,
|
|
2537
2562
|
getValuesForYField: A,
|
|
2538
2563
|
getValuesGroupedByField: N,
|
|
2539
2564
|
getYAxisFieldname: le,
|
|
2540
|
-
labelsForOperator:
|
|
2541
|
-
processGraphData:
|
|
2565
|
+
labelsForOperator: ft,
|
|
2566
|
+
processGraphData: gt
|
|
2542
2567
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2543
2568
|
export {
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2569
|
+
qe as Alert,
|
|
2570
|
+
pe as Avatar,
|
|
2571
|
+
Ve as Binary,
|
|
2547
2572
|
X as Boolean,
|
|
2548
2573
|
Q as Button,
|
|
2549
|
-
|
|
2574
|
+
Fe as ButtonGroup,
|
|
2550
2575
|
D as Char,
|
|
2551
|
-
|
|
2576
|
+
$e as CodeEditor,
|
|
2552
2577
|
z as Container,
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2578
|
+
v as ContainerWidget,
|
|
2579
|
+
Tt as Dashboard,
|
|
2580
|
+
Ze as DashboardItem,
|
|
2581
|
+
Ie as Date,
|
|
2582
|
+
We as DateTime,
|
|
2558
2583
|
g as Field,
|
|
2559
2584
|
L as Float,
|
|
2560
|
-
|
|
2561
|
-
|
|
2585
|
+
Te as FloatTime,
|
|
2586
|
+
vt as Form,
|
|
2562
2587
|
ie as Graph,
|
|
2563
2588
|
ne as GraphAxis,
|
|
2564
2589
|
j as GraphChart,
|
|
2565
2590
|
se as GraphIndicator,
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2591
|
+
tt as GraphIndicatorField,
|
|
2592
|
+
rt as GraphXAxis,
|
|
2593
|
+
nt as GraphYAxis,
|
|
2594
|
+
ve as Group,
|
|
2595
|
+
Pe as HTMLPreview,
|
|
2596
|
+
Ye as Image,
|
|
2597
|
+
Me as Indicator,
|
|
2598
|
+
Oe as Integer,
|
|
2574
2599
|
H as Label,
|
|
2575
|
-
|
|
2576
|
-
|
|
2600
|
+
Ce as Many2one,
|
|
2601
|
+
ke as Markdown,
|
|
2577
2602
|
K as MultiCheckbox,
|
|
2578
2603
|
J as NewLine,
|
|
2579
2604
|
M as Notebook,
|
|
2580
2605
|
U as One2many,
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2606
|
+
we as Page,
|
|
2607
|
+
Ee as ProgressBar,
|
|
2608
|
+
Be as Radio,
|
|
2609
|
+
ze as Reference,
|
|
2610
|
+
Ke as SearchFieldTypes,
|
|
2611
|
+
Ct as SearchFilter,
|
|
2612
|
+
E as Selection,
|
|
2613
|
+
Se as Separator,
|
|
2614
|
+
Ge as Steps,
|
|
2615
|
+
Le as Switch,
|
|
2616
|
+
Ne as Tag,
|
|
2617
|
+
Ae as Tags,
|
|
2593
2618
|
B as Text,
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2619
|
+
Re as Time,
|
|
2620
|
+
je as Timeline,
|
|
2621
|
+
Ft as Tree,
|
|
2622
|
+
C as Widget,
|
|
2623
|
+
Et as graphFieldUtils,
|
|
2624
|
+
It as graphProcessor,
|
|
2600
2625
|
Z as parseContext,
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2626
|
+
wt as parseContextFields,
|
|
2627
|
+
Ot as parseDomainFields,
|
|
2628
|
+
Pt as parseGraph,
|
|
2629
|
+
kt as transformDomainForChildWidget
|
|
2605
2630
|
};
|
|
2606
2631
|
//# sourceMappingURL=ooui.es.js.map
|