@gisce/ooui 2.23.0-alpha.4 → 2.23.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/Field.d.ts +0 -5
- package/dist/Field.d.ts.map +1 -1
- package/dist/Form.d.ts +0 -5
- package/dist/Form.d.ts.map +1 -1
- package/dist/Tree.d.ts +0 -5
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Widget.d.ts.map +1 -1
- package/dist/WidgetFactory.d.ts.map +1 -1
- package/dist/helpers/nodeParser.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/ooui.es.js +372 -421
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Field.ts +0 -25
- package/src/Form.ts +0 -13
- package/src/Tree.ts +1 -13
- package/src/Widget.ts +13 -2
- package/src/WidgetFactory.ts +0 -4
- package/src/helpers/nodeParser.ts +1 -7
- package/src/index.ts +0 -2
- package/src/spec/Form.spec.ts +0 -50
- package/src/spec/Tree.spec.ts +0 -19
- package/dist/Carousel.d.ts +0 -11
- package/dist/Carousel.d.ts.map +0 -1
- package/src/Carousel.ts +0 -30
- package/src/spec/Carousel.spec.ts +0 -75
- package/src/spec/Field.spec.ts +0 -35
- package/src/spec/nodeParser.spec.ts +0 -53
package/dist/ooui.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var n = (i, t, e) => (
|
|
4
|
-
import { decode as
|
|
5
|
-
import { evaluateCondition as
|
|
6
|
-
import * as
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var me = (i, t, e) => t in i ? ge(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var n = (i, t, e) => (me(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { decode as be } from "html-entities";
|
|
5
|
+
import { evaluateCondition as ye } from "@gisce/conscheck";
|
|
6
|
+
import * as Y from "txml";
|
|
7
7
|
import T from "moment";
|
|
8
|
-
const
|
|
8
|
+
const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe = ({
|
|
9
9
|
entry: i,
|
|
10
10
|
values: t,
|
|
11
11
|
fields: e
|
|
12
12
|
}) => {
|
|
13
13
|
let [s, r, a] = i, l = t[s];
|
|
14
|
-
const o =
|
|
14
|
+
const o = H({
|
|
15
15
|
fieldName: s,
|
|
16
16
|
valueInObject: l,
|
|
17
17
|
expectedValue: a,
|
|
@@ -41,7 +41,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
41
41
|
default:
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
44
|
-
}, b = (i) =>
|
|
44
|
+
}, b = (i) => be(i, { level: "xml" }), H = ({
|
|
45
45
|
fieldName: i,
|
|
46
46
|
valueInObject: t,
|
|
47
47
|
expectedValue: e,
|
|
@@ -61,19 +61,19 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
61
61
|
modifiedExpectedValue: null,
|
|
62
62
|
directOutcome: !1
|
|
63
63
|
} : (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);
|
|
64
|
-
},
|
|
64
|
+
}, we = ({
|
|
65
65
|
attrs: i,
|
|
66
66
|
values: t,
|
|
67
67
|
fields: e,
|
|
68
68
|
widgetType: s
|
|
69
69
|
}) => {
|
|
70
|
-
const
|
|
71
|
-
for (const
|
|
72
|
-
const p =
|
|
73
|
-
p ? d[
|
|
70
|
+
const h = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(h), u = JSON.parse(_), d = {};
|
|
71
|
+
for (const f of Object.keys(u)) {
|
|
72
|
+
const p = u[f].map((y) => xe({ entry: y, values: t, fields: e })).every((y) => y);
|
|
73
|
+
p ? d[f] = !0 : f === "readonly" && !p && s === "button" && (d[f] = !1);
|
|
74
74
|
}
|
|
75
75
|
return d;
|
|
76
|
-
},
|
|
76
|
+
}, Q = (i) => {
|
|
77
77
|
if (i === void 0)
|
|
78
78
|
return {};
|
|
79
79
|
if (typeof i == "string")
|
|
@@ -84,7 +84,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
84
84
|
}
|
|
85
85
|
else
|
|
86
86
|
return i;
|
|
87
|
-
},
|
|
87
|
+
}, ve = ({
|
|
88
88
|
attrs: i,
|
|
89
89
|
values: t,
|
|
90
90
|
fields: e,
|
|
@@ -95,21 +95,21 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
95
95
|
r.replace(/'/g, '"')
|
|
96
96
|
), l = {};
|
|
97
97
|
for (const o of Object.keys(a)) {
|
|
98
|
-
const
|
|
98
|
+
const h = ye({
|
|
99
99
|
object: t,
|
|
100
100
|
condition: a[o],
|
|
101
101
|
evaluateFieldComparison: ({
|
|
102
102
|
fieldName: _,
|
|
103
|
-
valueInObject:
|
|
103
|
+
valueInObject: u,
|
|
104
104
|
expectedValue: d
|
|
105
|
-
}) =>
|
|
105
|
+
}) => H({
|
|
106
106
|
fieldName: _,
|
|
107
|
-
valueInObject:
|
|
107
|
+
valueInObject: u,
|
|
108
108
|
expectedValue: d,
|
|
109
109
|
fields: e
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
|
-
|
|
112
|
+
h ? l[o] = !0 : o === "readonly" && !h && s === "button" && (l[o] = !1);
|
|
113
113
|
}
|
|
114
114
|
return l;
|
|
115
115
|
} catch (r) {
|
|
@@ -117,7 +117,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
117
117
|
"Error parsing new json_attrs. Original string: " + i
|
|
118
118
|
) : r;
|
|
119
119
|
}
|
|
120
|
-
},
|
|
120
|
+
}, Fe = ({
|
|
121
121
|
tagAttributes: i,
|
|
122
122
|
values: t,
|
|
123
123
|
fields: e,
|
|
@@ -125,14 +125,14 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
125
125
|
fallbackMode: r = !0
|
|
126
126
|
}) => {
|
|
127
127
|
let a = {}, l = {};
|
|
128
|
-
if (i.attrs && (l =
|
|
128
|
+
if (i.attrs && (l = we({
|
|
129
129
|
attrs: i.attrs,
|
|
130
130
|
values: t,
|
|
131
131
|
fields: e,
|
|
132
132
|
widgetType: s
|
|
133
133
|
})), i.json_attrs)
|
|
134
134
|
try {
|
|
135
|
-
a =
|
|
135
|
+
a = ve({
|
|
136
136
|
attrs: i.json_attrs,
|
|
137
137
|
values: t,
|
|
138
138
|
fields: e,
|
|
@@ -152,7 +152,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
152
152
|
attrs: void 0,
|
|
153
153
|
json_attrs: void 0
|
|
154
154
|
};
|
|
155
|
-
},
|
|
155
|
+
}, k = class k {
|
|
156
156
|
constructor(t) {
|
|
157
157
|
/**
|
|
158
158
|
* Determines if widget is read only (default is undefined)
|
|
@@ -188,7 +188,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
188
188
|
* Base type of the field
|
|
189
189
|
*/
|
|
190
190
|
n(this, "_fieldType", "");
|
|
191
|
-
this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly =
|
|
191
|
+
this._colspan = k._defaultColspan, this._invisible = !1, t && (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 = b(JSON.stringify(t.domain)) : this._domain = b(t.domain)), t.type && (this._fieldType = t.fieldsWidgetType), t.widget_props && (this._parsedWidgetProps = Q(t.widget_props)), t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function));
|
|
192
192
|
}
|
|
193
193
|
static get defaultColspan() {
|
|
194
194
|
return k._defaultColspan;
|
|
@@ -259,7 +259,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
259
259
|
*/
|
|
260
260
|
n(k, "_defaultColspan", 1);
|
|
261
261
|
let C = k;
|
|
262
|
-
class
|
|
262
|
+
class g extends C {
|
|
263
263
|
constructor(e) {
|
|
264
264
|
super(e);
|
|
265
265
|
/**
|
|
@@ -305,8 +305,7 @@ class f extends C {
|
|
|
305
305
|
* Values and keys
|
|
306
306
|
*/
|
|
307
307
|
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
308
|
-
|
|
309
|
-
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 = xe(e.help_inline)), e.autorefresh && (this.autoRefresh = W(e.autorefresh)));
|
|
308
|
+
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 = pe(e.help_inline)));
|
|
310
309
|
}
|
|
311
310
|
get id() {
|
|
312
311
|
return this._id;
|
|
@@ -368,18 +367,6 @@ class f extends C {
|
|
|
368
367
|
set selectionValues(e) {
|
|
369
368
|
this._selectionValues = e;
|
|
370
369
|
}
|
|
371
|
-
get autoRefresh() {
|
|
372
|
-
return this._autoRefresh ?? !1;
|
|
373
|
-
}
|
|
374
|
-
set autoRefresh(e) {
|
|
375
|
-
this._autoRefresh = e;
|
|
376
|
-
}
|
|
377
|
-
get readOnly() {
|
|
378
|
-
return this.autoRefresh ? !0 : super.readOnly;
|
|
379
|
-
}
|
|
380
|
-
set readOnly(e) {
|
|
381
|
-
super.readOnly = e;
|
|
382
|
-
}
|
|
383
370
|
/**
|
|
384
371
|
* Returns this instance in case this id matches param id.
|
|
385
372
|
* @param {string} id id (name) to find
|
|
@@ -388,14 +375,14 @@ class f extends C {
|
|
|
388
375
|
return this._id === e ? this : null;
|
|
389
376
|
}
|
|
390
377
|
}
|
|
391
|
-
class
|
|
378
|
+
class Ce extends g {
|
|
392
379
|
}
|
|
393
|
-
class
|
|
380
|
+
class X extends C {
|
|
394
381
|
findById(t) {
|
|
395
382
|
return null;
|
|
396
383
|
}
|
|
397
384
|
}
|
|
398
|
-
class
|
|
385
|
+
class U extends g {
|
|
399
386
|
constructor(e) {
|
|
400
387
|
super({ ...e, nolabel: !0 });
|
|
401
388
|
/**
|
|
@@ -451,7 +438,7 @@ class K extends f {
|
|
|
451
438
|
this._fieldForLabel = e;
|
|
452
439
|
}
|
|
453
440
|
}
|
|
454
|
-
class
|
|
441
|
+
class z {
|
|
455
442
|
constructor(t = 4, e = 6, s = !1, r = void 0) {
|
|
456
443
|
/**
|
|
457
444
|
* Number of columns the container is divided
|
|
@@ -518,13 +505,13 @@ class V {
|
|
|
518
505
|
}
|
|
519
506
|
addWidget(t, e) {
|
|
520
507
|
const s = [], r = e ? e.addLabel : !0;
|
|
521
|
-
if (t instanceof
|
|
508
|
+
if (t instanceof X) {
|
|
522
509
|
this._rows.push([]), this._index++;
|
|
523
510
|
return;
|
|
524
511
|
}
|
|
525
|
-
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof
|
|
512
|
+
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof g && !t.nolabel) {
|
|
526
513
|
t.colspan > 1 && (t.colspan -= 1);
|
|
527
|
-
const l = new
|
|
514
|
+
const l = new U({
|
|
528
515
|
name: t.id + "_label",
|
|
529
516
|
string: t.label,
|
|
530
517
|
invisible: t.invisible,
|
|
@@ -575,7 +562,7 @@ const O = class O extends C {
|
|
|
575
562
|
* Container label
|
|
576
563
|
*/
|
|
577
564
|
n(this, "_label", "");
|
|
578
|
-
this._container = new
|
|
565
|
+
this._container = new z(
|
|
579
566
|
e == null ? void 0 : e.col,
|
|
580
567
|
O._defaultColspan,
|
|
581
568
|
this.readOnly,
|
|
@@ -627,8 +614,8 @@ const O = class O extends C {
|
|
|
627
614
|
}
|
|
628
615
|
};
|
|
629
616
|
n(O, "_defaultColspan", 6);
|
|
630
|
-
let
|
|
631
|
-
const P = class P extends
|
|
617
|
+
let v = O;
|
|
618
|
+
const P = class P extends v {
|
|
632
619
|
constructor(e) {
|
|
633
620
|
super(e);
|
|
634
621
|
n(this, "_tabPosition", "top");
|
|
@@ -652,8 +639,8 @@ const P = class P extends w {
|
|
|
652
639
|
}
|
|
653
640
|
};
|
|
654
641
|
n(P, "_defaultColspan", 3);
|
|
655
|
-
let
|
|
656
|
-
class
|
|
642
|
+
let j = P;
|
|
643
|
+
class A extends v {
|
|
657
644
|
constructor(e) {
|
|
658
645
|
super(e);
|
|
659
646
|
n(this, "_loading", !1);
|
|
@@ -666,7 +653,7 @@ class B extends w {
|
|
|
666
653
|
this._loading = e;
|
|
667
654
|
}
|
|
668
655
|
}
|
|
669
|
-
class
|
|
656
|
+
class ke extends A {
|
|
670
657
|
constructor(e) {
|
|
671
658
|
super(e);
|
|
672
659
|
n(this, "_icon", null);
|
|
@@ -679,7 +666,7 @@ class Oe extends B {
|
|
|
679
666
|
this._icon = e;
|
|
680
667
|
}
|
|
681
668
|
}
|
|
682
|
-
class
|
|
669
|
+
class Oe extends A {
|
|
683
670
|
constructor(e) {
|
|
684
671
|
super(e);
|
|
685
672
|
n(this, "_icon", null);
|
|
@@ -692,7 +679,7 @@ class Pe extends B {
|
|
|
692
679
|
this._icon = e;
|
|
693
680
|
}
|
|
694
681
|
}
|
|
695
|
-
class
|
|
682
|
+
class K extends g {
|
|
696
683
|
constructor(e) {
|
|
697
684
|
super({
|
|
698
685
|
...e,
|
|
@@ -764,7 +751,7 @@ class Z extends f {
|
|
|
764
751
|
this._danger = e;
|
|
765
752
|
}
|
|
766
753
|
}
|
|
767
|
-
class
|
|
754
|
+
class Pe extends v {
|
|
768
755
|
constructor(e) {
|
|
769
756
|
super(e);
|
|
770
757
|
n(this, "_defaultName", "");
|
|
@@ -795,7 +782,7 @@ class Te extends w {
|
|
|
795
782
|
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
796
783
|
}
|
|
797
784
|
}
|
|
798
|
-
class
|
|
785
|
+
class R extends g {
|
|
799
786
|
constructor(e) {
|
|
800
787
|
super(e);
|
|
801
788
|
/**
|
|
@@ -838,7 +825,7 @@ class q extends f {
|
|
|
838
825
|
this._translatable = e;
|
|
839
826
|
}
|
|
840
827
|
}
|
|
841
|
-
class
|
|
828
|
+
class B extends g {
|
|
842
829
|
constructor(e) {
|
|
843
830
|
super(e);
|
|
844
831
|
/**
|
|
@@ -902,7 +889,7 @@ class L extends f {
|
|
|
902
889
|
this._translatable = e;
|
|
903
890
|
}
|
|
904
891
|
}
|
|
905
|
-
class
|
|
892
|
+
class W extends g {
|
|
906
893
|
constructor(e) {
|
|
907
894
|
super(e);
|
|
908
895
|
/**
|
|
@@ -918,7 +905,7 @@ class E extends f {
|
|
|
918
905
|
this._size = e;
|
|
919
906
|
}
|
|
920
907
|
}
|
|
921
|
-
class
|
|
908
|
+
class Te extends g {
|
|
922
909
|
constructor(e) {
|
|
923
910
|
super(e);
|
|
924
911
|
/**
|
|
@@ -944,19 +931,19 @@ class We extends f {
|
|
|
944
931
|
this._relation = e;
|
|
945
932
|
}
|
|
946
933
|
}
|
|
947
|
-
class
|
|
934
|
+
class We extends B {
|
|
948
935
|
}
|
|
949
|
-
class
|
|
936
|
+
class Z extends g {
|
|
950
937
|
constructor(t) {
|
|
951
938
|
super(t);
|
|
952
939
|
}
|
|
953
940
|
}
|
|
954
|
-
class
|
|
941
|
+
class Ee extends g {
|
|
955
942
|
constructor(t) {
|
|
956
943
|
super(t);
|
|
957
944
|
}
|
|
958
945
|
}
|
|
959
|
-
class
|
|
946
|
+
class L extends g {
|
|
960
947
|
constructor(e) {
|
|
961
948
|
super(e);
|
|
962
949
|
/**
|
|
@@ -989,23 +976,23 @@ class G extends f {
|
|
|
989
976
|
this._decimalDigits = e;
|
|
990
977
|
}
|
|
991
978
|
}
|
|
992
|
-
class
|
|
979
|
+
class Ie extends L {
|
|
993
980
|
}
|
|
994
|
-
class
|
|
981
|
+
class Se extends g {
|
|
995
982
|
}
|
|
996
|
-
class
|
|
983
|
+
class ze extends L {
|
|
997
984
|
}
|
|
998
|
-
class
|
|
985
|
+
class Ve extends g {
|
|
999
986
|
constructor(t) {
|
|
1000
987
|
super(t);
|
|
1001
988
|
}
|
|
1002
989
|
}
|
|
1003
|
-
class
|
|
990
|
+
class Ye extends g {
|
|
1004
991
|
constructor(t) {
|
|
1005
992
|
super(t);
|
|
1006
993
|
}
|
|
1007
994
|
}
|
|
1008
|
-
class
|
|
995
|
+
class ee extends g {
|
|
1009
996
|
constructor(e) {
|
|
1010
997
|
super(e);
|
|
1011
998
|
/**
|
|
@@ -1099,7 +1086,7 @@ class te extends f {
|
|
|
1099
1086
|
this._infinite = e;
|
|
1100
1087
|
}
|
|
1101
1088
|
}
|
|
1102
|
-
class
|
|
1089
|
+
class De extends C {
|
|
1103
1090
|
constructor(e) {
|
|
1104
1091
|
super(e);
|
|
1105
1092
|
/**
|
|
@@ -1125,9 +1112,9 @@ class je extends C {
|
|
|
1125
1112
|
return null;
|
|
1126
1113
|
}
|
|
1127
1114
|
}
|
|
1128
|
-
class
|
|
1115
|
+
class je extends W {
|
|
1129
1116
|
}
|
|
1130
|
-
class
|
|
1117
|
+
class Me extends g {
|
|
1131
1118
|
constructor(e) {
|
|
1132
1119
|
super(e);
|
|
1133
1120
|
/**
|
|
@@ -1143,18 +1130,18 @@ class Ne extends f {
|
|
|
1143
1130
|
this._filenameField = e;
|
|
1144
1131
|
}
|
|
1145
1132
|
}
|
|
1146
|
-
class
|
|
1133
|
+
class Ne extends g {
|
|
1147
1134
|
get showControls() {
|
|
1148
1135
|
var t;
|
|
1149
1136
|
return ((t = this.parsedWidgetProps) == null ? void 0 : t.showControls) ?? !0;
|
|
1150
1137
|
}
|
|
1151
1138
|
}
|
|
1152
|
-
class
|
|
1139
|
+
class Ae extends g {
|
|
1153
1140
|
constructor(t) {
|
|
1154
1141
|
super(t);
|
|
1155
1142
|
}
|
|
1156
1143
|
}
|
|
1157
|
-
class
|
|
1144
|
+
class Be extends ee {
|
|
1158
1145
|
constructor(e) {
|
|
1159
1146
|
super(e);
|
|
1160
1147
|
/**
|
|
@@ -1186,7 +1173,7 @@ class Le extends te {
|
|
|
1186
1173
|
return this.parsedWidgetProps.colorField;
|
|
1187
1174
|
}
|
|
1188
1175
|
}
|
|
1189
|
-
class
|
|
1176
|
+
class Le extends W {
|
|
1190
1177
|
constructor(e) {
|
|
1191
1178
|
super(e);
|
|
1192
1179
|
n(this, "_nolabel", !0);
|
|
@@ -1236,7 +1223,7 @@ class Ge extends E {
|
|
|
1236
1223
|
this._height = e;
|
|
1237
1224
|
}
|
|
1238
1225
|
}
|
|
1239
|
-
class
|
|
1226
|
+
class te extends g {
|
|
1240
1227
|
constructor(e) {
|
|
1241
1228
|
super(e);
|
|
1242
1229
|
/**
|
|
@@ -1289,14 +1276,14 @@ class ie extends f {
|
|
|
1289
1276
|
this._columns = e;
|
|
1290
1277
|
}
|
|
1291
1278
|
}
|
|
1292
|
-
class
|
|
1279
|
+
class Ge extends te {
|
|
1293
1280
|
}
|
|
1294
|
-
class $e extends
|
|
1281
|
+
class $e extends W {
|
|
1295
1282
|
get colors() {
|
|
1296
1283
|
return this._parsedWidgetProps.colors || {};
|
|
1297
1284
|
}
|
|
1298
1285
|
}
|
|
1299
|
-
class
|
|
1286
|
+
class Re extends W {
|
|
1300
1287
|
constructor(e) {
|
|
1301
1288
|
super(e);
|
|
1302
1289
|
/**
|
|
@@ -1312,9 +1299,9 @@ class qe extends E {
|
|
|
1312
1299
|
this._direction = e;
|
|
1313
1300
|
}
|
|
1314
1301
|
}
|
|
1315
|
-
class
|
|
1302
|
+
class qe extends Z {
|
|
1316
1303
|
}
|
|
1317
|
-
class
|
|
1304
|
+
class Je extends g {
|
|
1318
1305
|
constructor(e) {
|
|
1319
1306
|
super(e);
|
|
1320
1307
|
/**
|
|
@@ -1344,7 +1331,7 @@ class He extends f {
|
|
|
1344
1331
|
this._lastStep = e;
|
|
1345
1332
|
}
|
|
1346
1333
|
}
|
|
1347
|
-
class
|
|
1334
|
+
class ie extends B {
|
|
1348
1335
|
constructor(e) {
|
|
1349
1336
|
super(e);
|
|
1350
1337
|
n(this, "_lang", null);
|
|
@@ -1357,12 +1344,12 @@ class se extends L {
|
|
|
1357
1344
|
this._lang = e;
|
|
1358
1345
|
}
|
|
1359
1346
|
}
|
|
1360
|
-
class
|
|
1347
|
+
class He extends g {
|
|
1361
1348
|
constructor(t) {
|
|
1362
1349
|
super(t);
|
|
1363
1350
|
}
|
|
1364
1351
|
}
|
|
1365
|
-
class
|
|
1352
|
+
class Qe extends v {
|
|
1366
1353
|
constructor(e) {
|
|
1367
1354
|
super(e);
|
|
1368
1355
|
/**
|
|
@@ -1402,7 +1389,7 @@ class Xe extends w {
|
|
|
1402
1389
|
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
1403
1390
|
}
|
|
1404
1391
|
}
|
|
1405
|
-
class
|
|
1392
|
+
class Xe extends g {
|
|
1406
1393
|
constructor(e) {
|
|
1407
1394
|
super(e);
|
|
1408
1395
|
/**
|
|
@@ -1421,13 +1408,13 @@ class Ue extends f {
|
|
|
1421
1408
|
this._height = e;
|
|
1422
1409
|
}
|
|
1423
1410
|
}
|
|
1424
|
-
class
|
|
1411
|
+
class q extends ie {
|
|
1425
1412
|
constructor() {
|
|
1426
1413
|
super(...arguments);
|
|
1427
1414
|
n(this, "_lang", "json");
|
|
1428
1415
|
}
|
|
1429
1416
|
}
|
|
1430
|
-
class
|
|
1417
|
+
class Ue extends g {
|
|
1431
1418
|
constructor(e) {
|
|
1432
1419
|
super(e);
|
|
1433
1420
|
n(this, "_multi", !1);
|
|
@@ -1447,23 +1434,7 @@ class Ke extends f {
|
|
|
1447
1434
|
this._size = e;
|
|
1448
1435
|
}
|
|
1449
1436
|
}
|
|
1450
|
-
class
|
|
1451
|
-
constructor(e) {
|
|
1452
|
-
super(e);
|
|
1453
|
-
n(this, "_autoPlay", !0);
|
|
1454
|
-
e && "auto_play" in e && (this._autoPlay = W(e.auto_play));
|
|
1455
|
-
}
|
|
1456
|
-
get autoPlay() {
|
|
1457
|
-
return this._autoPlay;
|
|
1458
|
-
}
|
|
1459
|
-
set autoPlay(e) {
|
|
1460
|
-
this._autoPlay = e;
|
|
1461
|
-
}
|
|
1462
|
-
get items() {
|
|
1463
|
-
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
class R {
|
|
1437
|
+
class G {
|
|
1467
1438
|
constructor() {
|
|
1468
1439
|
/**
|
|
1469
1440
|
* Widget class
|
|
@@ -1473,141 +1444,138 @@ class R {
|
|
|
1473
1444
|
setWidgetClass(t) {
|
|
1474
1445
|
switch (t) {
|
|
1475
1446
|
case "notebook":
|
|
1476
|
-
this._widgetClass =
|
|
1447
|
+
this._widgetClass = j;
|
|
1477
1448
|
break;
|
|
1478
1449
|
case "page":
|
|
1479
|
-
this._widgetClass =
|
|
1450
|
+
this._widgetClass = ke;
|
|
1480
1451
|
break;
|
|
1481
1452
|
case "group":
|
|
1482
|
-
this._widgetClass =
|
|
1453
|
+
this._widgetClass = Oe;
|
|
1483
1454
|
break;
|
|
1484
1455
|
case "label":
|
|
1485
|
-
this._widgetClass =
|
|
1456
|
+
this._widgetClass = U;
|
|
1486
1457
|
break;
|
|
1487
1458
|
case "char":
|
|
1488
|
-
this._widgetClass =
|
|
1459
|
+
this._widgetClass = R;
|
|
1489
1460
|
break;
|
|
1490
1461
|
case "text":
|
|
1491
|
-
this._widgetClass =
|
|
1462
|
+
this._widgetClass = B;
|
|
1492
1463
|
break;
|
|
1493
1464
|
case "button":
|
|
1494
|
-
this._widgetClass =
|
|
1465
|
+
this._widgetClass = K;
|
|
1495
1466
|
break;
|
|
1496
1467
|
case "buttonGroup":
|
|
1497
|
-
this._widgetClass =
|
|
1468
|
+
this._widgetClass = Pe;
|
|
1498
1469
|
break;
|
|
1499
1470
|
case "selection":
|
|
1500
|
-
this._widgetClass =
|
|
1471
|
+
this._widgetClass = W;
|
|
1501
1472
|
break;
|
|
1502
1473
|
case "many2one":
|
|
1503
|
-
this._widgetClass =
|
|
1474
|
+
this._widgetClass = Te;
|
|
1504
1475
|
break;
|
|
1505
1476
|
case "boolean":
|
|
1506
|
-
this._widgetClass =
|
|
1477
|
+
this._widgetClass = Z;
|
|
1507
1478
|
break;
|
|
1508
1479
|
case "integer":
|
|
1509
|
-
this._widgetClass =
|
|
1480
|
+
this._widgetClass = Ee;
|
|
1510
1481
|
break;
|
|
1511
1482
|
case "float":
|
|
1512
|
-
this._widgetClass =
|
|
1483
|
+
this._widgetClass = L;
|
|
1513
1484
|
break;
|
|
1514
1485
|
case "float_time":
|
|
1515
|
-
this._widgetClass =
|
|
1486
|
+
this._widgetClass = Ie;
|
|
1516
1487
|
break;
|
|
1517
1488
|
case "date":
|
|
1518
|
-
this._widgetClass =
|
|
1489
|
+
this._widgetClass = Ve;
|
|
1519
1490
|
break;
|
|
1520
1491
|
case "datetime":
|
|
1521
|
-
this._widgetClass =
|
|
1492
|
+
this._widgetClass = Ye;
|
|
1522
1493
|
break;
|
|
1523
1494
|
case "progressbar":
|
|
1524
|
-
this._widgetClass =
|
|
1495
|
+
this._widgetClass = ze;
|
|
1525
1496
|
break;
|
|
1526
1497
|
case "markdown":
|
|
1527
|
-
this._widgetClass =
|
|
1498
|
+
this._widgetClass = We;
|
|
1528
1499
|
break;
|
|
1529
1500
|
case "many2many":
|
|
1530
1501
|
case "one2many":
|
|
1531
1502
|
case "one2many_list":
|
|
1532
|
-
this._widgetClass =
|
|
1503
|
+
this._widgetClass = ee;
|
|
1533
1504
|
break;
|
|
1534
1505
|
case "newline":
|
|
1535
|
-
this._widgetClass =
|
|
1506
|
+
this._widgetClass = X;
|
|
1536
1507
|
break;
|
|
1537
1508
|
case "separator":
|
|
1538
|
-
this._widgetClass =
|
|
1509
|
+
this._widgetClass = De;
|
|
1539
1510
|
break;
|
|
1540
1511
|
case "url":
|
|
1541
|
-
this._widgetClass =
|
|
1512
|
+
this._widgetClass = R;
|
|
1542
1513
|
break;
|
|
1543
1514
|
case "email":
|
|
1544
|
-
this._widgetClass =
|
|
1515
|
+
this._widgetClass = Ue;
|
|
1545
1516
|
break;
|
|
1546
1517
|
case "reference":
|
|
1547
|
-
this._widgetClass =
|
|
1518
|
+
this._widgetClass = je;
|
|
1548
1519
|
break;
|
|
1549
1520
|
case "binary":
|
|
1550
|
-
this._widgetClass =
|
|
1521
|
+
this._widgetClass = Me;
|
|
1551
1522
|
break;
|
|
1552
1523
|
case "image":
|
|
1553
|
-
this._widgetClass =
|
|
1524
|
+
this._widgetClass = Ne;
|
|
1554
1525
|
break;
|
|
1555
1526
|
case "fiber_grid":
|
|
1556
|
-
this._widgetClass =
|
|
1527
|
+
this._widgetClass = Ae;
|
|
1557
1528
|
break;
|
|
1558
1529
|
case "timeline":
|
|
1559
|
-
this._widgetClass =
|
|
1530
|
+
this._widgetClass = Be;
|
|
1560
1531
|
break;
|
|
1561
1532
|
case "indicator":
|
|
1562
|
-
this._widgetClass =
|
|
1533
|
+
this._widgetClass = Le;
|
|
1563
1534
|
break;
|
|
1564
1535
|
case "tags":
|
|
1565
|
-
this._widgetClass =
|
|
1536
|
+
this._widgetClass = Ge;
|
|
1566
1537
|
break;
|
|
1567
1538
|
case "tag":
|
|
1568
1539
|
this._widgetClass = $e;
|
|
1569
1540
|
break;
|
|
1570
1541
|
case "avatar":
|
|
1571
|
-
this._widgetClass =
|
|
1542
|
+
this._widgetClass = Ce;
|
|
1572
1543
|
break;
|
|
1573
1544
|
case "radio":
|
|
1574
|
-
this._widgetClass =
|
|
1545
|
+
this._widgetClass = Re;
|
|
1575
1546
|
break;
|
|
1576
1547
|
case "multicheckbox":
|
|
1577
|
-
this._widgetClass =
|
|
1548
|
+
this._widgetClass = te;
|
|
1578
1549
|
break;
|
|
1579
1550
|
case "switch":
|
|
1580
|
-
this._widgetClass =
|
|
1551
|
+
this._widgetClass = qe;
|
|
1581
1552
|
break;
|
|
1582
1553
|
case "steps":
|
|
1583
|
-
this._widgetClass =
|
|
1554
|
+
this._widgetClass = Je;
|
|
1584
1555
|
break;
|
|
1585
1556
|
case "codeeditor":
|
|
1586
|
-
this._widgetClass =
|
|
1557
|
+
this._widgetClass = ie;
|
|
1587
1558
|
break;
|
|
1588
1559
|
case "time":
|
|
1589
|
-
this._widgetClass =
|
|
1560
|
+
this._widgetClass = He;
|
|
1590
1561
|
break;
|
|
1591
1562
|
case "html_preview":
|
|
1592
|
-
this._widgetClass =
|
|
1563
|
+
this._widgetClass = Se;
|
|
1593
1564
|
break;
|
|
1594
1565
|
case "alert":
|
|
1595
|
-
this._widgetClass =
|
|
1566
|
+
this._widgetClass = Qe;
|
|
1596
1567
|
break;
|
|
1597
1568
|
case "comments_timeline":
|
|
1598
|
-
this._widgetClass =
|
|
1569
|
+
this._widgetClass = Xe;
|
|
1599
1570
|
break;
|
|
1600
1571
|
case "json":
|
|
1601
|
-
this._widgetClass =
|
|
1572
|
+
this._widgetClass = q;
|
|
1602
1573
|
break;
|
|
1603
1574
|
case "arrow_steps":
|
|
1604
|
-
this._widgetClass =
|
|
1575
|
+
this._widgetClass = q;
|
|
1605
1576
|
break;
|
|
1606
1577
|
case "spinner":
|
|
1607
|
-
this._widgetClass =
|
|
1608
|
-
break;
|
|
1609
|
-
case "carousel":
|
|
1610
|
-
this._widgetClass = Ze;
|
|
1578
|
+
this._widgetClass = A;
|
|
1611
1579
|
break;
|
|
1612
1580
|
}
|
|
1613
1581
|
}
|
|
@@ -1630,7 +1598,7 @@ class R {
|
|
|
1630
1598
|
}
|
|
1631
1599
|
}
|
|
1632
1600
|
}
|
|
1633
|
-
const
|
|
1601
|
+
const Ke = ({
|
|
1634
1602
|
fieldName: i,
|
|
1635
1603
|
values: t,
|
|
1636
1604
|
fields: e
|
|
@@ -1644,18 +1612,18 @@ const et = ({
|
|
|
1644
1612
|
const r = {}, a = {};
|
|
1645
1613
|
for (const o of Object.keys(s))
|
|
1646
1614
|
if (t.state === o) {
|
|
1647
|
-
const
|
|
1648
|
-
for (const _ of
|
|
1649
|
-
const [
|
|
1650
|
-
a[
|
|
1615
|
+
const h = s[o];
|
|
1616
|
+
for (const _ of h) {
|
|
1617
|
+
const [u, d] = _;
|
|
1618
|
+
a[u] || (a[u] = []), a[u].push(d);
|
|
1651
1619
|
}
|
|
1652
1620
|
}
|
|
1653
1621
|
for (const o of Object.keys(a)) {
|
|
1654
|
-
const
|
|
1655
|
-
r[o] =
|
|
1622
|
+
const h = a[o];
|
|
1623
|
+
r[o] = h.some((_) => _);
|
|
1656
1624
|
}
|
|
1657
1625
|
return r;
|
|
1658
|
-
},
|
|
1626
|
+
}, Ze = ({
|
|
1659
1627
|
states: i,
|
|
1660
1628
|
values: t
|
|
1661
1629
|
}) => {
|
|
@@ -1664,7 +1632,7 @@ const et = ({
|
|
|
1664
1632
|
const e = i.split(",");
|
|
1665
1633
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1666
1634
|
};
|
|
1667
|
-
function
|
|
1635
|
+
function et({
|
|
1668
1636
|
values: i = {},
|
|
1669
1637
|
fieldName: t,
|
|
1670
1638
|
fields: e = {}
|
|
@@ -1673,7 +1641,7 @@ function it({
|
|
|
1673
1641
|
const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
|
|
1674
1642
|
return s === "many2one" ? i[t] ? i[t][0] || null : !1 : s === "one2many" || s === "many2many" ? i[t].map((a) => a.id) : i != null && i[t] ? i == null ? void 0 : i[t] : t.includes("'") ? t : parseInt(t);
|
|
1675
1643
|
}
|
|
1676
|
-
const
|
|
1644
|
+
const se = ({
|
|
1677
1645
|
context: i,
|
|
1678
1646
|
values: t,
|
|
1679
1647
|
fields: e
|
|
@@ -1681,72 +1649,72 @@ const ne = ({
|
|
|
1681
1649
|
try {
|
|
1682
1650
|
if (!i)
|
|
1683
1651
|
return;
|
|
1684
|
-
if (
|
|
1652
|
+
if (re(i) || typeof i != "string")
|
|
1685
1653
|
return i;
|
|
1686
|
-
const s =
|
|
1654
|
+
const s = ne(i);
|
|
1687
1655
|
if (s !== null)
|
|
1688
1656
|
return s;
|
|
1689
1657
|
if (i.trim().length === 0)
|
|
1690
1658
|
return;
|
|
1691
|
-
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(":")),
|
|
1659
|
+
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 = {};
|
|
1692
1660
|
return d.forEach((c) => {
|
|
1693
1661
|
const m = c[1];
|
|
1694
1662
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1695
|
-
const p =
|
|
1663
|
+
const p = et({
|
|
1696
1664
|
values: t,
|
|
1697
1665
|
fields: e,
|
|
1698
1666
|
fieldName: m === "active_id" ? "id" : m
|
|
1699
1667
|
});
|
|
1700
|
-
|
|
1668
|
+
f[c[0].replace(/'/g, "")] = p || void 0;
|
|
1701
1669
|
} else
|
|
1702
|
-
c[1] === "true" ?
|
|
1670
|
+
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(
|
|
1703
1671
|
/'/g,
|
|
1704
1672
|
""
|
|
1705
1673
|
);
|
|
1706
|
-
}),
|
|
1674
|
+
}), f;
|
|
1707
1675
|
} catch {
|
|
1708
1676
|
return;
|
|
1709
1677
|
}
|
|
1710
|
-
},
|
|
1678
|
+
}, Ot = (i) => {
|
|
1711
1679
|
const t = [];
|
|
1712
1680
|
try {
|
|
1713
|
-
return !i ||
|
|
1681
|
+
return !i || re(i) || typeof i != "string" ? t : ne(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) => {
|
|
1714
1682
|
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1715
1683
|
}), t);
|
|
1716
1684
|
} catch {
|
|
1717
1685
|
}
|
|
1718
1686
|
return t;
|
|
1719
1687
|
};
|
|
1720
|
-
function
|
|
1688
|
+
function ne(i) {
|
|
1721
1689
|
try {
|
|
1722
1690
|
return JSON.parse(i.replace(/'/g, '"'));
|
|
1723
1691
|
} catch {
|
|
1724
1692
|
return null;
|
|
1725
1693
|
}
|
|
1726
1694
|
}
|
|
1727
|
-
function
|
|
1695
|
+
function re(i) {
|
|
1728
1696
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1729
1697
|
}
|
|
1730
|
-
const
|
|
1698
|
+
const tt = (i) => {
|
|
1731
1699
|
const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1732
1700
|
return {
|
|
1733
1701
|
method: e,
|
|
1734
1702
|
args: r
|
|
1735
1703
|
};
|
|
1736
1704
|
};
|
|
1737
|
-
function
|
|
1705
|
+
function it(i) {
|
|
1738
1706
|
const t = [];
|
|
1739
1707
|
function e(s) {
|
|
1740
1708
|
const r = [];
|
|
1741
1709
|
for (const a of s)
|
|
1742
|
-
a instanceof
|
|
1710
|
+
a instanceof v ? e(a._container.rows.flat()) : r.push(a);
|
|
1743
1711
|
r.length > 0 && t.push(r);
|
|
1744
1712
|
}
|
|
1745
1713
|
for (const s of i)
|
|
1746
1714
|
e(s);
|
|
1747
1715
|
return t.flat();
|
|
1748
1716
|
}
|
|
1749
|
-
class
|
|
1717
|
+
class Pt {
|
|
1750
1718
|
constructor(t, e = 4) {
|
|
1751
1719
|
/**
|
|
1752
1720
|
* Object containing fields specification of the form.
|
|
@@ -1793,15 +1761,11 @@ class Tt {
|
|
|
1793
1761
|
* List of invisible fields
|
|
1794
1762
|
*/
|
|
1795
1763
|
n(this, "_invisibleFields", []);
|
|
1796
|
-
/**
|
|
1797
|
-
* List of autorefreshable fields
|
|
1798
|
-
*/
|
|
1799
|
-
n(this, "_autorefreshableFields", []);
|
|
1800
1764
|
/**
|
|
1801
1765
|
* Context for each field in the form
|
|
1802
1766
|
*/
|
|
1803
1767
|
n(this, "_contextForFields", {});
|
|
1804
|
-
this._fields = t, this._container = new
|
|
1768
|
+
this._fields = t, this._container = new z(e, 6, !1, "root");
|
|
1805
1769
|
}
|
|
1806
1770
|
get fields() {
|
|
1807
1771
|
return this._fields;
|
|
@@ -1845,9 +1809,6 @@ class Tt {
|
|
|
1845
1809
|
set invisibleFields(t) {
|
|
1846
1810
|
this._invisibleFields = t;
|
|
1847
1811
|
}
|
|
1848
|
-
get autorefreshableFields() {
|
|
1849
|
-
return this._autorefreshableFields;
|
|
1850
|
-
}
|
|
1851
1812
|
get contextForFields() {
|
|
1852
1813
|
return this._contextForFields;
|
|
1853
1814
|
}
|
|
@@ -1856,87 +1817,85 @@ class Tt {
|
|
|
1856
1817
|
}
|
|
1857
1818
|
parse(t, e) {
|
|
1858
1819
|
var o;
|
|
1859
|
-
const { values: s = {}, readOnly: r = !1 } = e || {}, a =
|
|
1820
|
+
const { values: s = {}, readOnly: r = !1 } = e || {}, a = Y.parse(t).filter((h) => h.tagName === "form")[0];
|
|
1860
1821
|
this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = s.id ? { active_id: s.id, active_ids: [s.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
1861
1822
|
fields: a.children,
|
|
1862
1823
|
container: this._container,
|
|
1863
1824
|
values: s
|
|
1825
|
+
}), it(this._container._rows).forEach((h) => {
|
|
1826
|
+
const _ = h;
|
|
1827
|
+
_._id && _._context && (this._contextForFields[_._id] = h._context);
|
|
1864
1828
|
});
|
|
1865
|
-
const l = nt(this._container._rows);
|
|
1866
|
-
l.forEach((u) => {
|
|
1867
|
-
const _ = u;
|
|
1868
|
-
_._id && _._context && (this._contextForFields[_._id] = u._context);
|
|
1869
|
-
}), this._autorefreshableFields = l.filter((u) => u instanceof f && u.autoRefresh).map((u) => u._id);
|
|
1870
1829
|
}
|
|
1871
1830
|
parseNode({
|
|
1872
1831
|
fields: t,
|
|
1873
1832
|
container: e,
|
|
1874
1833
|
values: s
|
|
1875
1834
|
}) {
|
|
1876
|
-
const r = new
|
|
1835
|
+
const r = new G();
|
|
1877
1836
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
1878
|
-
var
|
|
1879
|
-
const { tagName: l, attributes: o, children:
|
|
1880
|
-
let _ = l,
|
|
1837
|
+
var w, F;
|
|
1838
|
+
const { tagName: l, attributes: o, children: h } = a;
|
|
1839
|
+
let _ = l, u = o;
|
|
1881
1840
|
if (l === "field") {
|
|
1882
|
-
const { name: x, widget:
|
|
1883
|
-
if (
|
|
1884
|
-
_ =
|
|
1841
|
+
const { name: x, widget: E } = o;
|
|
1842
|
+
if (E)
|
|
1843
|
+
_ = E;
|
|
1885
1844
|
else if (x) {
|
|
1886
1845
|
if (!this._fields[x])
|
|
1887
1846
|
throw new Error(
|
|
1888
1847
|
`Field ${x} doesn't exist in fields defintion`
|
|
1889
1848
|
);
|
|
1890
1849
|
_ = this._fields[x].type, o.widget_props = {
|
|
1891
|
-
...
|
|
1850
|
+
...Q(o.widget_props),
|
|
1892
1851
|
...this._fields[x].widget_props || {}
|
|
1893
1852
|
};
|
|
1894
1853
|
}
|
|
1895
|
-
|
|
1854
|
+
u = {
|
|
1896
1855
|
...this._fields[x],
|
|
1897
1856
|
...o,
|
|
1898
1857
|
fieldsWidgetType: this._fields[x].type
|
|
1899
1858
|
};
|
|
1900
1859
|
}
|
|
1901
|
-
const d =
|
|
1902
|
-
tagAttributes:
|
|
1860
|
+
const d = Fe({
|
|
1861
|
+
tagAttributes: u,
|
|
1903
1862
|
values: s,
|
|
1904
1863
|
fields: this._fields,
|
|
1905
1864
|
widgetType: l
|
|
1906
1865
|
});
|
|
1907
|
-
let
|
|
1908
|
-
l === "button" &&
|
|
1909
|
-
states:
|
|
1866
|
+
let f;
|
|
1867
|
+
l === "button" && u.states ? f = Ze({
|
|
1868
|
+
states: u.states,
|
|
1910
1869
|
values: s
|
|
1911
|
-
}) :
|
|
1912
|
-
fieldName:
|
|
1870
|
+
}) : f = Ke({
|
|
1871
|
+
fieldName: u.name,
|
|
1913
1872
|
values: s,
|
|
1914
1873
|
fields: this._fields
|
|
1915
1874
|
});
|
|
1916
|
-
const c =
|
|
1917
|
-
context:
|
|
1875
|
+
const c = se({
|
|
1876
|
+
context: u.context || ((w = this._fields[u.name]) == null ? void 0 : w.context),
|
|
1918
1877
|
values: s,
|
|
1919
1878
|
fields: this._fields
|
|
1920
1879
|
});
|
|
1921
|
-
|
|
1922
|
-
|
|
1880
|
+
u.on_change && (this._onChangeFields[u.name] = tt(
|
|
1881
|
+
u.on_change
|
|
1923
1882
|
));
|
|
1924
1883
|
let m;
|
|
1925
|
-
|
|
1884
|
+
J(u.domain) ? m = u.domain : J((F = this._fields[u.name]) == null ? void 0 : F.domain) && (m = this._fields[u.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1926
1885
|
const p = {
|
|
1927
1886
|
...d,
|
|
1928
|
-
...
|
|
1887
|
+
...f,
|
|
1929
1888
|
context: c,
|
|
1930
1889
|
domain: m,
|
|
1931
1890
|
key: `${this._keyIdx}`
|
|
1932
1891
|
};
|
|
1933
1892
|
e.readOnly && (p.readonly = !0);
|
|
1934
1893
|
const y = r.createWidget(_, p);
|
|
1935
|
-
y.invisible && y instanceof
|
|
1936
|
-
fields:
|
|
1894
|
+
y.invisible && y instanceof g && this._invisibleFields.push(p.name), y instanceof v && this.parseNode({
|
|
1895
|
+
fields: h,
|
|
1937
1896
|
container: y.container,
|
|
1938
1897
|
values: s
|
|
1939
|
-
}), y instanceof
|
|
1898
|
+
}), y instanceof K && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
1940
1899
|
});
|
|
1941
1900
|
}
|
|
1942
1901
|
/**
|
|
@@ -1947,10 +1906,10 @@ class Tt {
|
|
|
1947
1906
|
return this.container.findById(t);
|
|
1948
1907
|
}
|
|
1949
1908
|
}
|
|
1950
|
-
function
|
|
1909
|
+
function J(i) {
|
|
1951
1910
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1952
1911
|
}
|
|
1953
|
-
class
|
|
1912
|
+
class Tt {
|
|
1954
1913
|
constructor(t) {
|
|
1955
1914
|
/**
|
|
1956
1915
|
* Object containing fields specification of the form.
|
|
@@ -1975,10 +1934,6 @@ class Wt {
|
|
|
1975
1934
|
* Context for each field in the form
|
|
1976
1935
|
*/
|
|
1977
1936
|
n(this, "_contextForFields", {});
|
|
1978
|
-
/**
|
|
1979
|
-
* List of autorefreshable fields
|
|
1980
|
-
*/
|
|
1981
|
-
n(this, "_autorefreshableFields", []);
|
|
1982
1937
|
/**
|
|
1983
1938
|
* Is infinite
|
|
1984
1939
|
*/
|
|
@@ -2012,9 +1967,6 @@ class Wt {
|
|
|
2012
1967
|
set contextForFields(t) {
|
|
2013
1968
|
this._contextForFields = t;
|
|
2014
1969
|
}
|
|
2015
|
-
get autorefreshableFields() {
|
|
2016
|
-
return this._autorefreshableFields;
|
|
2017
|
-
}
|
|
2018
1970
|
get infinite() {
|
|
2019
1971
|
return this._infinite;
|
|
2020
1972
|
}
|
|
@@ -2022,37 +1974,36 @@ class Wt {
|
|
|
2022
1974
|
this._infinite = t;
|
|
2023
1975
|
}
|
|
2024
1976
|
parse(t) {
|
|
2025
|
-
const e =
|
|
1977
|
+
const e = Y.parse(t).filter((r) => r.tagName === "tree")[0];
|
|
2026
1978
|
this._string = e.attributes.string || null, this._string && (this._string = b(this._string)), this._colors = e.attributes.colors || null, this._colors && (this._colors = b(this._colors)), this._status = e.attributes.status || null, this._status && (this._status = b(this._status)), this._editable = e.attributes.editable || null, this._infinite = e.attributes.infinite || !1;
|
|
2027
|
-
const s = new
|
|
1979
|
+
const s = new G();
|
|
2028
1980
|
e.children.forEach((r) => {
|
|
2029
1981
|
const { tagName: a, attributes: l } = r;
|
|
2030
1982
|
let o = null;
|
|
2031
1983
|
if (a === "field") {
|
|
2032
|
-
const { name:
|
|
2033
|
-
let
|
|
2034
|
-
if (
|
|
2035
|
-
if (!this._fields[
|
|
2036
|
-
throw new Error(`Field ${
|
|
2037
|
-
const d = this._fields[
|
|
1984
|
+
const { name: h, widget: _ } = l;
|
|
1985
|
+
let u = l;
|
|
1986
|
+
if (h) {
|
|
1987
|
+
if (!this._fields[h])
|
|
1988
|
+
throw new Error(`Field ${h} doesn't exist in fields defintion`);
|
|
1989
|
+
const d = this._fields[h];
|
|
2038
1990
|
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;
|
|
2039
|
-
const
|
|
1991
|
+
const f = se({
|
|
2040
1992
|
context: l.context || d.context,
|
|
2041
1993
|
values: {},
|
|
2042
1994
|
fields: this._fields
|
|
2043
1995
|
});
|
|
2044
|
-
|
|
1996
|
+
u = {
|
|
2045
1997
|
...d,
|
|
2046
1998
|
...l,
|
|
2047
1999
|
fieldsWidgetType: d == null ? void 0 : d.type,
|
|
2048
|
-
context:
|
|
2049
|
-
}, this._contextForFields[
|
|
2000
|
+
context: f
|
|
2001
|
+
}, this._contextForFields[h] = f;
|
|
2050
2002
|
}
|
|
2051
|
-
if (_ && (o = _), !
|
|
2052
|
-
const d = s.createWidget(o,
|
|
2003
|
+
if (_ && (o = _), !u.invisible) {
|
|
2004
|
+
const d = s.createWidget(o, u);
|
|
2053
2005
|
this._columns.push(d);
|
|
2054
2006
|
}
|
|
2055
|
-
W(h.autorefresh) && this._autorefreshableFields.push(u);
|
|
2056
2007
|
}
|
|
2057
2008
|
});
|
|
2058
2009
|
}
|
|
@@ -2064,7 +2015,7 @@ class Wt {
|
|
|
2064
2015
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
2065
2016
|
}
|
|
2066
2017
|
}
|
|
2067
|
-
const
|
|
2018
|
+
const st = {
|
|
2068
2019
|
text: "text",
|
|
2069
2020
|
many2one: "many2one",
|
|
2070
2021
|
char: "char",
|
|
@@ -2077,7 +2028,7 @@ const rt = {
|
|
|
2077
2028
|
date: "date",
|
|
2078
2029
|
datetime: "datetime"
|
|
2079
2030
|
};
|
|
2080
|
-
class
|
|
2031
|
+
class Wt {
|
|
2081
2032
|
constructor(t, e, s = 8) {
|
|
2082
2033
|
/**
|
|
2083
2034
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -2089,7 +2040,7 @@ class Et {
|
|
|
2089
2040
|
n(this, "_fields");
|
|
2090
2041
|
n(this, "_simpleSearchContainer");
|
|
2091
2042
|
n(this, "_advancedSearchContainer");
|
|
2092
|
-
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new
|
|
2043
|
+
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new z(s), this._advancedSearchContainer = new z(s);
|
|
2093
2044
|
}
|
|
2094
2045
|
get searchFields() {
|
|
2095
2046
|
return this._searchFields;
|
|
@@ -2104,7 +2055,7 @@ class Et {
|
|
|
2104
2055
|
return this._advancedSearchContainer;
|
|
2105
2056
|
}
|
|
2106
2057
|
parse() {
|
|
2107
|
-
const t = new
|
|
2058
|
+
const t = new G();
|
|
2108
2059
|
this.parseFields(
|
|
2109
2060
|
this.searchFields.primary,
|
|
2110
2061
|
t
|
|
@@ -2125,7 +2076,7 @@ class Et {
|
|
|
2125
2076
|
colspan: 2
|
|
2126
2077
|
}, { type: a, widget: l } = r;
|
|
2127
2078
|
let o = l ?? a;
|
|
2128
|
-
return
|
|
2079
|
+
return st[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
2129
2080
|
});
|
|
2130
2081
|
}
|
|
2131
2082
|
/**
|
|
@@ -2136,7 +2087,7 @@ class Et {
|
|
|
2136
2087
|
return this.advancedSearchContainer.findById(t);
|
|
2137
2088
|
}
|
|
2138
2089
|
}
|
|
2139
|
-
const
|
|
2090
|
+
const Et = ({
|
|
2140
2091
|
domain: i,
|
|
2141
2092
|
widgetFieldName: t
|
|
2142
2093
|
}) => {
|
|
@@ -2145,14 +2096,14 @@ const It = ({
|
|
|
2145
2096
|
if (!Array.isArray(s))
|
|
2146
2097
|
return;
|
|
2147
2098
|
const [r, a, l] = s;
|
|
2148
|
-
let o,
|
|
2149
|
-
r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")),
|
|
2099
|
+
let o, h;
|
|
2100
|
+
r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), h = r.substr(
|
|
2150
2101
|
r.indexOf(".") + 1,
|
|
2151
2102
|
r.length - 1
|
|
2152
|
-
)) : (o = r,
|
|
2103
|
+
)) : (o = r, h = "id"), o === t && e.push([h, a, l]);
|
|
2153
2104
|
}), e;
|
|
2154
|
-
},
|
|
2155
|
-
class
|
|
2105
|
+
}, It = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2106
|
+
class nt {
|
|
2156
2107
|
constructor(t) {
|
|
2157
2108
|
n(this, "_action_id", null);
|
|
2158
2109
|
n(this, "_position", null);
|
|
@@ -2165,15 +2116,15 @@ class at {
|
|
|
2165
2116
|
return this._position;
|
|
2166
2117
|
}
|
|
2167
2118
|
}
|
|
2168
|
-
class
|
|
2119
|
+
class St {
|
|
2169
2120
|
constructor(t) {
|
|
2170
2121
|
n(this, "_string", null);
|
|
2171
2122
|
n(this, "_items", []);
|
|
2172
|
-
const e =
|
|
2123
|
+
const e = Y.parse(t).filter((r) => r.tagName === "dashboard")[0];
|
|
2173
2124
|
this._string = e.attributes.string || null;
|
|
2174
2125
|
const { children: s } = e;
|
|
2175
2126
|
s.forEach((r) => {
|
|
2176
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
2127
|
+
r.tagName === "dashboard_item" && this._items.push(new nt(r.attributes));
|
|
2177
2128
|
});
|
|
2178
2129
|
}
|
|
2179
2130
|
get string() {
|
|
@@ -2183,7 +2134,7 @@ class zt {
|
|
|
2183
2134
|
return this._items;
|
|
2184
2135
|
}
|
|
2185
2136
|
}
|
|
2186
|
-
class
|
|
2137
|
+
class ae {
|
|
2187
2138
|
constructor(t) {
|
|
2188
2139
|
n(this, "_string", null);
|
|
2189
2140
|
n(this, "_type");
|
|
@@ -2211,7 +2162,8 @@ class le {
|
|
|
2211
2162
|
return this._y_range;
|
|
2212
2163
|
}
|
|
2213
2164
|
}
|
|
2214
|
-
|
|
2165
|
+
const rt = (i) => i === 1 || i === "1" || i === !0 || i === "True";
|
|
2166
|
+
class le extends ae {
|
|
2215
2167
|
constructor(e, s) {
|
|
2216
2168
|
super(s);
|
|
2217
2169
|
n(this, "_color", null);
|
|
@@ -2219,7 +2171,7 @@ class oe extends le {
|
|
|
2219
2171
|
n(this, "_totalDomain", null);
|
|
2220
2172
|
n(this, "_showPercent", !1);
|
|
2221
2173
|
n(this, "_suffix", null);
|
|
2222
|
-
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 =
|
|
2174
|
+
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 = rt(s.attributes.showPercent);
|
|
2223
2175
|
}
|
|
2224
2176
|
get color() {
|
|
2225
2177
|
return this._color;
|
|
@@ -2237,7 +2189,7 @@ class oe extends le {
|
|
|
2237
2189
|
return this._suffix;
|
|
2238
2190
|
}
|
|
2239
2191
|
}
|
|
2240
|
-
class
|
|
2192
|
+
class at extends le {
|
|
2241
2193
|
constructor(e, s) {
|
|
2242
2194
|
super(e, s);
|
|
2243
2195
|
n(this, "_field");
|
|
@@ -2257,12 +2209,12 @@ class lt extends oe {
|
|
|
2257
2209
|
return this._operator;
|
|
2258
2210
|
}
|
|
2259
2211
|
}
|
|
2260
|
-
const
|
|
2212
|
+
const lt = (i) => {
|
|
2261
2213
|
const t = [];
|
|
2262
2214
|
let e;
|
|
2263
2215
|
if (i.forEach((s) => {
|
|
2264
2216
|
if (s.tagName === "field") {
|
|
2265
|
-
const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0,
|
|
2217
|
+
const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, h = s.attributes.stacked || void 0;
|
|
2266
2218
|
if (!r)
|
|
2267
2219
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2268
2220
|
if (!l)
|
|
@@ -2270,11 +2222,11 @@ const ot = (i) => {
|
|
|
2270
2222
|
r === "x" ? e = new dt({
|
|
2271
2223
|
name: l
|
|
2272
2224
|
}) : r === "y" && t.push(
|
|
2273
|
-
new
|
|
2225
|
+
new ct({
|
|
2274
2226
|
name: l,
|
|
2275
2227
|
operator: a,
|
|
2276
2228
|
label: o,
|
|
2277
|
-
stacked:
|
|
2229
|
+
stacked: h
|
|
2278
2230
|
})
|
|
2279
2231
|
);
|
|
2280
2232
|
}
|
|
@@ -2287,13 +2239,13 @@ const ot = (i) => {
|
|
|
2287
2239
|
y: t
|
|
2288
2240
|
};
|
|
2289
2241
|
};
|
|
2290
|
-
class
|
|
2242
|
+
class D extends ae {
|
|
2291
2243
|
constructor(e, s) {
|
|
2292
2244
|
super(s);
|
|
2293
2245
|
n(this, "_x");
|
|
2294
2246
|
n(this, "_y");
|
|
2295
2247
|
this._type = e;
|
|
2296
|
-
const r =
|
|
2248
|
+
const r = lt(s.children);
|
|
2297
2249
|
this._x = r.x, this._y = r.y;
|
|
2298
2250
|
}
|
|
2299
2251
|
get x() {
|
|
@@ -2303,22 +2255,22 @@ class j extends le {
|
|
|
2303
2255
|
return this._y;
|
|
2304
2256
|
}
|
|
2305
2257
|
}
|
|
2306
|
-
const
|
|
2307
|
-
indicator:
|
|
2308
|
-
indicatorField:
|
|
2309
|
-
line:
|
|
2310
|
-
bar:
|
|
2311
|
-
pie:
|
|
2312
|
-
},
|
|
2313
|
-
const t =
|
|
2258
|
+
const ot = {
|
|
2259
|
+
indicator: le,
|
|
2260
|
+
indicatorField: at,
|
|
2261
|
+
line: D,
|
|
2262
|
+
bar: D,
|
|
2263
|
+
pie: D
|
|
2264
|
+
}, zt = (i) => {
|
|
2265
|
+
const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2314
2266
|
if (!e)
|
|
2315
2267
|
throw new Error(`${e} is not a valid graph`);
|
|
2316
|
-
const s =
|
|
2268
|
+
const s = ot[e];
|
|
2317
2269
|
if (!s)
|
|
2318
2270
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2319
2271
|
return new s(e, t);
|
|
2320
2272
|
};
|
|
2321
|
-
class
|
|
2273
|
+
class oe {
|
|
2322
2274
|
constructor({ name: t, axis: e }) {
|
|
2323
2275
|
n(this, "_name");
|
|
2324
2276
|
n(this, "_axis");
|
|
@@ -2331,7 +2283,7 @@ class ce {
|
|
|
2331
2283
|
return this._axis;
|
|
2332
2284
|
}
|
|
2333
2285
|
}
|
|
2334
|
-
class
|
|
2286
|
+
class ct extends oe {
|
|
2335
2287
|
constructor({
|
|
2336
2288
|
name: e,
|
|
2337
2289
|
operator: s,
|
|
@@ -2354,12 +2306,12 @@ class ut extends ce {
|
|
|
2354
2306
|
return this._stacked;
|
|
2355
2307
|
}
|
|
2356
2308
|
}
|
|
2357
|
-
class dt extends
|
|
2309
|
+
class dt extends oe {
|
|
2358
2310
|
constructor({ name: t }) {
|
|
2359
2311
|
super({ name: t, axis: "x" });
|
|
2360
2312
|
}
|
|
2361
2313
|
}
|
|
2362
|
-
const
|
|
2314
|
+
const ut = ({ ooui: i }) => {
|
|
2363
2315
|
const e = [i.x.name];
|
|
2364
2316
|
return i.y ? (i.y.forEach((s) => {
|
|
2365
2317
|
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
@@ -2381,27 +2333,27 @@ function $({
|
|
|
2381
2333
|
}
|
|
2382
2334
|
return { value: r, label: r };
|
|
2383
2335
|
}
|
|
2384
|
-
const
|
|
2336
|
+
const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2385
2337
|
__proto__: null,
|
|
2386
|
-
getFieldsToRetrieve:
|
|
2338
|
+
getFieldsToRetrieve: ut,
|
|
2387
2339
|
getValueAndLabelForField: $
|
|
2388
2340
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2389
|
-
function
|
|
2341
|
+
function ht({
|
|
2390
2342
|
values: i,
|
|
2391
2343
|
timerange: t,
|
|
2392
2344
|
interval: e = 1
|
|
2393
2345
|
}) {
|
|
2394
|
-
const s =
|
|
2346
|
+
const s = gt({
|
|
2395
2347
|
values: i,
|
|
2396
2348
|
timerange: t
|
|
2397
2349
|
});
|
|
2398
|
-
return
|
|
2350
|
+
return _t({
|
|
2399
2351
|
values: s,
|
|
2400
2352
|
timerange: t,
|
|
2401
2353
|
interval: e
|
|
2402
2354
|
});
|
|
2403
2355
|
}
|
|
2404
|
-
function
|
|
2356
|
+
function _t({
|
|
2405
2357
|
values: i,
|
|
2406
2358
|
timerange: t,
|
|
2407
2359
|
interval: e = 1
|
|
@@ -2412,15 +2364,15 @@ function ft({
|
|
|
2412
2364
|
groupBy: "type-stacked"
|
|
2413
2365
|
}), a = `${t}s`;
|
|
2414
2366
|
return Object.keys(r).forEach((o) => {
|
|
2415
|
-
const
|
|
2416
|
-
for (let _ = 0; _ <
|
|
2417
|
-
const
|
|
2418
|
-
if (s.push(
|
|
2367
|
+
const h = r[o];
|
|
2368
|
+
for (let _ = 0; _ < h.length; _++) {
|
|
2369
|
+
const u = h[_];
|
|
2370
|
+
if (s.push(u), _ === h.length - 1)
|
|
2419
2371
|
return;
|
|
2420
|
-
const d =
|
|
2421
|
-
if (!
|
|
2422
|
-
const c =
|
|
2423
|
-
dates: [d,
|
|
2372
|
+
const d = u.x, f = h[_ + 1].x;
|
|
2373
|
+
if (!ce([d, f], a)) {
|
|
2374
|
+
const c = ft({
|
|
2375
|
+
dates: [d, f],
|
|
2424
2376
|
timerange: t,
|
|
2425
2377
|
interval: e
|
|
2426
2378
|
});
|
|
@@ -2428,15 +2380,15 @@ function ft({
|
|
|
2428
2380
|
c.map((m) => ({
|
|
2429
2381
|
x: m,
|
|
2430
2382
|
value: 0,
|
|
2431
|
-
type:
|
|
2432
|
-
stacked:
|
|
2383
|
+
type: u.type,
|
|
2384
|
+
stacked: u.stacked
|
|
2433
2385
|
}))
|
|
2434
2386
|
);
|
|
2435
2387
|
}
|
|
2436
2388
|
}
|
|
2437
|
-
}), s.sort((o,
|
|
2389
|
+
}), s.sort((o, h) => o.x < h.x ? -1 : o.x > h.x ? 1 : 0);
|
|
2438
2390
|
}
|
|
2439
|
-
function
|
|
2391
|
+
function ft({
|
|
2440
2392
|
dates: i,
|
|
2441
2393
|
timerange: t,
|
|
2442
2394
|
interval: e = 1
|
|
@@ -2446,23 +2398,23 @@ function gt({
|
|
|
2446
2398
|
return i;
|
|
2447
2399
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2448
2400
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2449
|
-
const o = a[l],
|
|
2450
|
-
if (!
|
|
2451
|
-
const _ = T(o,
|
|
2401
|
+
const o = a[l], h = a[l + 1];
|
|
2402
|
+
if (!ce([o, h], r)) {
|
|
2403
|
+
const _ = T(o, S(r)).add(
|
|
2452
2404
|
e,
|
|
2453
2405
|
r
|
|
2454
|
-
),
|
|
2455
|
-
for (; _.isBefore(
|
|
2456
|
-
s.push(_.format(
|
|
2406
|
+
), u = T(h, S(r));
|
|
2407
|
+
for (; _.isBefore(u); )
|
|
2408
|
+
s.push(_.format(S(r))), _.add(e, r);
|
|
2457
2409
|
}
|
|
2458
2410
|
}
|
|
2459
2411
|
return s;
|
|
2460
2412
|
}
|
|
2461
|
-
function
|
|
2413
|
+
function gt({
|
|
2462
2414
|
values: i,
|
|
2463
2415
|
timerange: t
|
|
2464
2416
|
}) {
|
|
2465
|
-
const e =
|
|
2417
|
+
const e = mt({
|
|
2466
2418
|
values: i,
|
|
2467
2419
|
timerange: t
|
|
2468
2420
|
}), s = [], r = de({
|
|
@@ -2470,33 +2422,33 @@ function mt({
|
|
|
2470
2422
|
groupBy: "all"
|
|
2471
2423
|
});
|
|
2472
2424
|
return Object.keys(r).forEach((a) => {
|
|
2473
|
-
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator,
|
|
2425
|
+
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, h = V({
|
|
2474
2426
|
values: l.map((_) => _.value),
|
|
2475
2427
|
operator: o
|
|
2476
2428
|
});
|
|
2477
2429
|
s.push({
|
|
2478
2430
|
...l[0],
|
|
2479
|
-
value:
|
|
2431
|
+
value: h
|
|
2480
2432
|
});
|
|
2481
2433
|
}), s;
|
|
2482
2434
|
}
|
|
2483
|
-
function
|
|
2435
|
+
function mt({
|
|
2484
2436
|
values: i,
|
|
2485
2437
|
timerange: t
|
|
2486
2438
|
}) {
|
|
2487
2439
|
return i.map((e) => ({
|
|
2488
2440
|
...e,
|
|
2489
|
-
x:
|
|
2441
|
+
x: bt({
|
|
2490
2442
|
date: e.x,
|
|
2491
2443
|
timerange: t
|
|
2492
2444
|
})
|
|
2493
2445
|
}));
|
|
2494
2446
|
}
|
|
2495
|
-
function
|
|
2447
|
+
function bt({
|
|
2496
2448
|
date: i,
|
|
2497
2449
|
timerange: t
|
|
2498
2450
|
}) {
|
|
2499
|
-
let e =
|
|
2451
|
+
let e = yt(i);
|
|
2500
2452
|
const s = T(i, e);
|
|
2501
2453
|
switch (t) {
|
|
2502
2454
|
case "hour": {
|
|
@@ -2522,12 +2474,12 @@ function yt({
|
|
|
2522
2474
|
}
|
|
2523
2475
|
return s.format(e);
|
|
2524
2476
|
}
|
|
2525
|
-
function
|
|
2477
|
+
function yt(i) {
|
|
2526
2478
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2527
2479
|
}
|
|
2528
|
-
function
|
|
2480
|
+
function ce(i, t) {
|
|
2529
2481
|
let e = !1;
|
|
2530
|
-
const s =
|
|
2482
|
+
const s = S(t);
|
|
2531
2483
|
if (i.length === 0)
|
|
2532
2484
|
return !1;
|
|
2533
2485
|
if (i.length === 1)
|
|
@@ -2548,7 +2500,7 @@ function de({
|
|
|
2548
2500
|
e[o] || (e[o] = []), e[o].push(s);
|
|
2549
2501
|
}), e;
|
|
2550
2502
|
}
|
|
2551
|
-
function
|
|
2503
|
+
function S(i) {
|
|
2552
2504
|
switch (i) {
|
|
2553
2505
|
case "days":
|
|
2554
2506
|
return "YYYY-MM-DD";
|
|
@@ -2563,7 +2515,7 @@ function z(i) {
|
|
|
2563
2515
|
return "YYYY-MM-DD HH:mm";
|
|
2564
2516
|
}
|
|
2565
2517
|
}
|
|
2566
|
-
const
|
|
2518
|
+
const pt = {
|
|
2567
2519
|
count: "count",
|
|
2568
2520
|
"+": "sum",
|
|
2569
2521
|
"-": "subtract",
|
|
@@ -2571,13 +2523,13 @@ const xt = {
|
|
|
2571
2523
|
avg: "average",
|
|
2572
2524
|
min: "min",
|
|
2573
2525
|
max: "max"
|
|
2574
|
-
},
|
|
2526
|
+
}, xt = ({
|
|
2575
2527
|
ooui: i,
|
|
2576
2528
|
values: t,
|
|
2577
2529
|
fields: e,
|
|
2578
2530
|
options: s
|
|
2579
2531
|
}) => {
|
|
2580
|
-
const r =
|
|
2532
|
+
const r = N({
|
|
2581
2533
|
fieldName: i.x.name,
|
|
2582
2534
|
values: t,
|
|
2583
2535
|
fields: e
|
|
@@ -2586,41 +2538,41 @@ const xt = {
|
|
|
2586
2538
|
Object.keys(r).forEach((m) => {
|
|
2587
2539
|
const p = r[m].label, y = r[m].entries;
|
|
2588
2540
|
if (c.label) {
|
|
2589
|
-
const
|
|
2541
|
+
const w = N({
|
|
2590
2542
|
fieldName: c.label,
|
|
2591
2543
|
values: y,
|
|
2592
2544
|
fields: e
|
|
2593
2545
|
});
|
|
2594
|
-
Object.keys(
|
|
2595
|
-
const x =
|
|
2546
|
+
Object.keys(w).forEach((F) => {
|
|
2547
|
+
const x = w[F].entries, E = w[F].label, _e = M({
|
|
2596
2548
|
entries: x,
|
|
2597
2549
|
fields: e,
|
|
2598
2550
|
fieldName: c.name
|
|
2599
|
-
}),
|
|
2600
|
-
values:
|
|
2551
|
+
}), fe = V({
|
|
2552
|
+
values: _e,
|
|
2601
2553
|
operator: c.operator
|
|
2602
2554
|
});
|
|
2603
2555
|
a.push({
|
|
2604
2556
|
x: p || !1,
|
|
2605
|
-
value:
|
|
2606
|
-
type:
|
|
2557
|
+
value: fe,
|
|
2558
|
+
type: E,
|
|
2607
2559
|
operator: c.operator,
|
|
2608
2560
|
stacked: c.stacked
|
|
2609
2561
|
});
|
|
2610
2562
|
});
|
|
2611
2563
|
} else {
|
|
2612
|
-
const
|
|
2564
|
+
const w = M({
|
|
2613
2565
|
entries: y,
|
|
2614
2566
|
fields: e,
|
|
2615
2567
|
fieldName: c.name
|
|
2616
|
-
}), F =
|
|
2617
|
-
values:
|
|
2568
|
+
}), F = V({
|
|
2569
|
+
values: w,
|
|
2618
2570
|
operator: c.operator
|
|
2619
2571
|
});
|
|
2620
2572
|
a.push({
|
|
2621
2573
|
x: p || !1,
|
|
2622
2574
|
value: F,
|
|
2623
|
-
type:
|
|
2575
|
+
type: ue({
|
|
2624
2576
|
yAxis: c,
|
|
2625
2577
|
fields: e
|
|
2626
2578
|
}),
|
|
@@ -2633,30 +2585,30 @@ const xt = {
|
|
|
2633
2585
|
const l = i.y.some((c) => c.label !== void 0), o = i.y.some((c) => c.stacked !== void 0);
|
|
2634
2586
|
let _ = [...a.sort((c, m) => c.x < m.x ? -1 : c.x > m.x ? 1 : 0)];
|
|
2635
2587
|
o && i.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
|
|
2636
|
-
let
|
|
2637
|
-
i.type === "pie" &&
|
|
2588
|
+
let u = [..._];
|
|
2589
|
+
i.type === "pie" && u.some((c) => c.x === !1) ? u = u.map((c) => c.x === !1 ? { ...c, x: (s == null ? void 0 : s.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (u = u.filter(
|
|
2638
2590
|
(c) => c.x !== !1
|
|
2639
2591
|
));
|
|
2640
|
-
let d =
|
|
2641
|
-
i.timerange ? d =
|
|
2592
|
+
let d = u;
|
|
2593
|
+
i.timerange ? d = ht({
|
|
2642
2594
|
values: d,
|
|
2643
2595
|
timerange: i.timerange,
|
|
2644
2596
|
interval: i.interval
|
|
2645
|
-
}) : i.type == "pie" && (d =
|
|
2646
|
-
const
|
|
2597
|
+
}) : i.type == "pie" && (d = u.sort((c, m) => m.value - c.value));
|
|
2598
|
+
const f = {
|
|
2647
2599
|
data: d,
|
|
2648
2600
|
isGroup: o || l,
|
|
2649
2601
|
isStack: o
|
|
2650
2602
|
};
|
|
2651
|
-
if (i.type === "line" && i.y_range && (
|
|
2603
|
+
if (i.type === "line" && i.y_range && (f.yAxisOpts = {
|
|
2652
2604
|
mode: i.y_range
|
|
2653
2605
|
}, i.y_range === "auto")) {
|
|
2654
|
-
const { min: c, max: m } =
|
|
2655
|
-
|
|
2606
|
+
const { min: c, max: m } = he(d);
|
|
2607
|
+
f.yAxisOpts.valueOpts = { min: c, max: m };
|
|
2656
2608
|
}
|
|
2657
|
-
return
|
|
2609
|
+
return f;
|
|
2658
2610
|
};
|
|
2659
|
-
function
|
|
2611
|
+
function M({
|
|
2660
2612
|
entries: i,
|
|
2661
2613
|
fieldName: t,
|
|
2662
2614
|
fields: e
|
|
@@ -2667,7 +2619,7 @@ function N({
|
|
|
2667
2619
|
fields: e
|
|
2668
2620
|
})).map(({ value: s, label: r }) => r);
|
|
2669
2621
|
}
|
|
2670
|
-
function
|
|
2622
|
+
function V({
|
|
2671
2623
|
operator: i,
|
|
2672
2624
|
values: t
|
|
2673
2625
|
}) {
|
|
@@ -2675,26 +2627,26 @@ function Y({
|
|
|
2675
2627
|
case "count":
|
|
2676
2628
|
return t.length;
|
|
2677
2629
|
case "+":
|
|
2678
|
-
return
|
|
2630
|
+
return I(
|
|
2679
2631
|
t.reduce(function(e, s) {
|
|
2680
2632
|
return e + s;
|
|
2681
2633
|
})
|
|
2682
2634
|
);
|
|
2683
2635
|
case "-":
|
|
2684
|
-
return
|
|
2636
|
+
return I(
|
|
2685
2637
|
t.reduce(function(e, s) {
|
|
2686
2638
|
return e - s;
|
|
2687
2639
|
})
|
|
2688
2640
|
);
|
|
2689
2641
|
case "*":
|
|
2690
|
-
return
|
|
2642
|
+
return I(
|
|
2691
2643
|
t.reduce(function(e, s) {
|
|
2692
2644
|
return e * s;
|
|
2693
2645
|
})
|
|
2694
2646
|
);
|
|
2695
2647
|
case "avg": {
|
|
2696
2648
|
const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
|
|
2697
|
-
return
|
|
2649
|
+
return I(s);
|
|
2698
2650
|
}
|
|
2699
2651
|
case "min":
|
|
2700
2652
|
return Math.min(...t);
|
|
@@ -2702,10 +2654,10 @@ function Y({
|
|
|
2702
2654
|
return Math.max(...t);
|
|
2703
2655
|
}
|
|
2704
2656
|
}
|
|
2705
|
-
function
|
|
2657
|
+
function I(i) {
|
|
2706
2658
|
return Math.round((i + Number.EPSILON) * 100) / 100;
|
|
2707
2659
|
}
|
|
2708
|
-
function
|
|
2660
|
+
function N({
|
|
2709
2661
|
fieldName: i,
|
|
2710
2662
|
fields: t,
|
|
2711
2663
|
values: e
|
|
@@ -2720,21 +2672,21 @@ function A({
|
|
|
2720
2672
|
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
|
|
2721
2673
|
}), s;
|
|
2722
2674
|
}
|
|
2723
|
-
function
|
|
2675
|
+
function wt(i) {
|
|
2724
2676
|
let t = [];
|
|
2725
2677
|
return Object.keys(i).forEach((e) => {
|
|
2726
2678
|
const s = i[e];
|
|
2727
2679
|
t = t.concat(s.entries);
|
|
2728
2680
|
}), t;
|
|
2729
2681
|
}
|
|
2730
|
-
function
|
|
2682
|
+
function ue({
|
|
2731
2683
|
yAxis: i,
|
|
2732
2684
|
fields: t
|
|
2733
2685
|
}) {
|
|
2734
2686
|
const e = t[i.name];
|
|
2735
2687
|
return e != null && e.string ? e.string : i.name;
|
|
2736
2688
|
}
|
|
2737
|
-
function
|
|
2689
|
+
function he(i, t = 0.1) {
|
|
2738
2690
|
if (i.length === 0)
|
|
2739
2691
|
throw new Error("The values array cannot be empty.");
|
|
2740
2692
|
const e = i.map((l) => l.value), s = Math.min(...e), r = Math.max(...e), a = (r - s) * t;
|
|
@@ -2743,83 +2695,82 @@ function _e(i, t = 0.1) {
|
|
|
2743
2695
|
max: r + a
|
|
2744
2696
|
};
|
|
2745
2697
|
}
|
|
2746
|
-
const
|
|
2698
|
+
const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2747
2699
|
__proto__: null,
|
|
2748
|
-
getAllObjectsInGroupedValues:
|
|
2749
|
-
getMinMax:
|
|
2750
|
-
getValueForOperator:
|
|
2751
|
-
getValuesForYField:
|
|
2752
|
-
getValuesGroupedByField:
|
|
2753
|
-
getYAxisFieldname:
|
|
2754
|
-
labelsForOperator:
|
|
2755
|
-
processGraphData:
|
|
2700
|
+
getAllObjectsInGroupedValues: wt,
|
|
2701
|
+
getMinMax: he,
|
|
2702
|
+
getValueForOperator: V,
|
|
2703
|
+
getValuesForYField: M,
|
|
2704
|
+
getValuesGroupedByField: N,
|
|
2705
|
+
getYAxisFieldname: ue,
|
|
2706
|
+
labelsForOperator: pt,
|
|
2707
|
+
processGraphData: xt
|
|
2756
2708
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2757
2709
|
export {
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
Ye as
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
lt as GraphIndicatorField,
|
|
2710
|
+
Qe as Alert,
|
|
2711
|
+
Ce as Avatar,
|
|
2712
|
+
Me as Binary,
|
|
2713
|
+
Z as Boolean,
|
|
2714
|
+
K as Button,
|
|
2715
|
+
Pe as ButtonGroup,
|
|
2716
|
+
R as Char,
|
|
2717
|
+
ie as CodeEditor,
|
|
2718
|
+
Xe as Comments,
|
|
2719
|
+
z as Container,
|
|
2720
|
+
v as ContainerWidget,
|
|
2721
|
+
St as Dashboard,
|
|
2722
|
+
nt as DashboardItem,
|
|
2723
|
+
Ve as Date,
|
|
2724
|
+
Ye as DateTime,
|
|
2725
|
+
Ue as Email,
|
|
2726
|
+
g as Field,
|
|
2727
|
+
L as Float,
|
|
2728
|
+
Ie as FloatTime,
|
|
2729
|
+
Pt as Form,
|
|
2730
|
+
ae as Graph,
|
|
2731
|
+
oe as GraphAxis,
|
|
2732
|
+
D as GraphChart,
|
|
2733
|
+
le as GraphIndicator,
|
|
2734
|
+
at as GraphIndicatorField,
|
|
2784
2735
|
dt as GraphXAxis,
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2736
|
+
ct as GraphYAxis,
|
|
2737
|
+
Oe as Group,
|
|
2738
|
+
Se as HTMLPreview,
|
|
2739
|
+
Ne as Image,
|
|
2740
|
+
Le as Indicator,
|
|
2741
|
+
Ee as Integer,
|
|
2742
|
+
q as JSONField,
|
|
2743
|
+
U as Label,
|
|
2744
|
+
Te as Many2one,
|
|
2745
|
+
We as Markdown,
|
|
2746
|
+
te as MultiCheckbox,
|
|
2747
|
+
X as NewLine,
|
|
2748
|
+
j as Notebook,
|
|
2749
|
+
ee as One2many,
|
|
2750
|
+
ke as Page,
|
|
2751
|
+
ze as ProgressBar,
|
|
2752
|
+
Re as Radio,
|
|
2753
|
+
je as Reference,
|
|
2754
|
+
st as SearchFieldTypes,
|
|
2755
|
+
Wt as SearchFilter,
|
|
2756
|
+
W as Selection,
|
|
2757
|
+
De as Separator,
|
|
2758
|
+
A as Spinner,
|
|
2759
|
+
Je as Steps,
|
|
2760
|
+
qe as Switch,
|
|
2810
2761
|
$e as Tag,
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2762
|
+
Ge as Tags,
|
|
2763
|
+
B as Text,
|
|
2764
|
+
He as Time,
|
|
2765
|
+
Be as Timeline,
|
|
2766
|
+
Tt as Tree,
|
|
2816
2767
|
C as Widget,
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2768
|
+
Vt as graphFieldUtils,
|
|
2769
|
+
Yt as graphProcessor,
|
|
2770
|
+
se as parseContext,
|
|
2771
|
+
Ot as parseContextFields,
|
|
2772
|
+
It as parseDomainFields,
|
|
2773
|
+
zt as parseGraph,
|
|
2774
|
+
Et as transformDomainForChildWidget
|
|
2824
2775
|
};
|
|
2825
2776
|
//# sourceMappingURL=ooui.es.js.map
|