@gisce/ooui 2.23.0-alpha.1 → 2.23.0-alpha.2
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 +2 -0
- package/dist/Field.d.ts.map +1 -1
- package/dist/Form.d.ts.map +1 -1
- package/dist/Widget.d.ts.map +1 -1
- package/dist/helpers/attributeParser.d.ts +1 -0
- package/dist/helpers/attributeParser.d.ts.map +1 -1
- package/dist/ooui.es.js +269 -262
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Field.ts +8 -0
- package/src/Form.ts +10 -1
- package/src/Widget.ts +2 -12
- package/src/helpers/attributeParser.ts +16 -0
- package/src/spec/Form.spec.ts +30 -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 me = Object.defineProperty;
|
|
2
|
+
var be = (i, t, e) => t in i ? me(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var n = (i, t, e) => (be(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { decode as ye } from "html-entities";
|
|
5
|
+
import { evaluateCondition as pe } from "@gisce/conscheck";
|
|
6
6
|
import * as Y from "txml";
|
|
7
|
-
import
|
|
8
|
-
const
|
|
7
|
+
import T from "moment";
|
|
8
|
+
const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we = ({
|
|
9
9
|
entry: i,
|
|
10
10
|
values: t,
|
|
11
11
|
fields: e
|
|
@@ -41,7 +41,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
|
|
|
41
41
|
default:
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
44
|
-
}, b = (i) =>
|
|
44
|
+
}, b = (i) => ye(i, { level: "xml" }), Q = ({
|
|
45
45
|
fieldName: i,
|
|
46
46
|
valueInObject: t,
|
|
47
47
|
expectedValue: e,
|
|
@@ -61,7 +61,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
|
|
|
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
|
+
}, ve = ({
|
|
65
65
|
attrs: i,
|
|
66
66
|
values: t,
|
|
67
67
|
fields: e,
|
|
@@ -69,11 +69,22 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
|
|
|
69
69
|
}) => {
|
|
70
70
|
const d = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(d), h = JSON.parse(_), u = {};
|
|
71
71
|
for (const g of Object.keys(h)) {
|
|
72
|
-
const p = h[g].map((y) =>
|
|
72
|
+
const p = h[g].map((y) => we({ entry: y, values: t, fields: e })).every((y) => y);
|
|
73
73
|
p ? u[g] = !0 : g === "readonly" && !p && s === "button" && (u[g] = !1);
|
|
74
74
|
}
|
|
75
75
|
return u;
|
|
76
|
-
},
|
|
76
|
+
}, X = (i) => {
|
|
77
|
+
if (i === void 0)
|
|
78
|
+
return {};
|
|
79
|
+
if (typeof i == "string")
|
|
80
|
+
try {
|
|
81
|
+
return JSON.parse(i.replace(/'/g, '"'));
|
|
82
|
+
} catch {
|
|
83
|
+
return console.error("Error parsing widget_props"), {};
|
|
84
|
+
}
|
|
85
|
+
else
|
|
86
|
+
return i;
|
|
87
|
+
}, Fe = ({
|
|
77
88
|
attrs: i,
|
|
78
89
|
values: t,
|
|
79
90
|
fields: e,
|
|
@@ -84,7 +95,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
|
|
|
84
95
|
r.replace(/'/g, '"')
|
|
85
96
|
), l = {};
|
|
86
97
|
for (const o of Object.keys(a)) {
|
|
87
|
-
const d =
|
|
98
|
+
const d = pe({
|
|
88
99
|
object: t,
|
|
89
100
|
condition: a[o],
|
|
90
101
|
evaluateFieldComparison: ({
|
|
@@ -106,7 +117,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
|
|
|
106
117
|
"Error parsing new json_attrs. Original string: " + i
|
|
107
118
|
) : r;
|
|
108
119
|
}
|
|
109
|
-
},
|
|
120
|
+
}, Ce = ({
|
|
110
121
|
tagAttributes: i,
|
|
111
122
|
values: t,
|
|
112
123
|
fields: e,
|
|
@@ -114,14 +125,14 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
|
|
|
114
125
|
fallbackMode: r = !0
|
|
115
126
|
}) => {
|
|
116
127
|
let a = {}, l = {};
|
|
117
|
-
if (i.attrs && (l =
|
|
128
|
+
if (i.attrs && (l = ve({
|
|
118
129
|
attrs: i.attrs,
|
|
119
130
|
values: t,
|
|
120
131
|
fields: e,
|
|
121
132
|
widgetType: s
|
|
122
133
|
})), i.json_attrs)
|
|
123
134
|
try {
|
|
124
|
-
a =
|
|
135
|
+
a = Fe({
|
|
125
136
|
attrs: i.json_attrs,
|
|
126
137
|
values: t,
|
|
127
138
|
fields: e,
|
|
@@ -177,20 +188,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
|
|
|
177
188
|
* Base type of the field
|
|
178
189
|
*/
|
|
179
190
|
n(this, "_fieldType", "");
|
|
180
|
-
|
|
181
|
-
if (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = D(t.readonly)), 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)
|
|
182
|
-
if (typeof t.widget_props == "string")
|
|
183
|
-
try {
|
|
184
|
-
this._parsedWidgetProps = JSON.parse(
|
|
185
|
-
t.widget_props.replace(/'/g, '"')
|
|
186
|
-
);
|
|
187
|
-
} catch {
|
|
188
|
-
console.error("Error parsing widget_props");
|
|
189
|
-
}
|
|
190
|
-
else
|
|
191
|
-
this._parsedWidgetProps = t.widget_props;
|
|
192
|
-
t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function);
|
|
193
|
-
}
|
|
191
|
+
this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = D(t.readonly)), 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 = X(t.widget_props)), t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function));
|
|
194
192
|
}
|
|
195
193
|
static get defaultColspan() {
|
|
196
194
|
return k._defaultColspan;
|
|
@@ -308,7 +306,7 @@ class f extends C {
|
|
|
308
306
|
*/
|
|
309
307
|
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
310
308
|
n(this, "_autoRefresh", !1);
|
|
311
|
-
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 =
|
|
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 = D(e.autorefresh)));
|
|
312
310
|
}
|
|
313
311
|
get id() {
|
|
314
312
|
return this._id;
|
|
@@ -358,6 +356,12 @@ class f extends C {
|
|
|
358
356
|
set sum(e) {
|
|
359
357
|
this._sum = e;
|
|
360
358
|
}
|
|
359
|
+
get suffix() {
|
|
360
|
+
return this._parsedWidgetProps.suffix || "";
|
|
361
|
+
}
|
|
362
|
+
get prefix() {
|
|
363
|
+
return this._parsedWidgetProps.prefix || "";
|
|
364
|
+
}
|
|
361
365
|
get selectionValues() {
|
|
362
366
|
return this._selectionValues;
|
|
363
367
|
}
|
|
@@ -384,14 +388,14 @@ class f extends C {
|
|
|
384
388
|
return this._id === e ? this : null;
|
|
385
389
|
}
|
|
386
390
|
}
|
|
387
|
-
class
|
|
391
|
+
class ke extends f {
|
|
388
392
|
}
|
|
389
|
-
class
|
|
393
|
+
class U extends C {
|
|
390
394
|
findById(t) {
|
|
391
395
|
return null;
|
|
392
396
|
}
|
|
393
397
|
}
|
|
394
|
-
class
|
|
398
|
+
class K extends f {
|
|
395
399
|
constructor(e) {
|
|
396
400
|
super({ ...e, nolabel: !0 });
|
|
397
401
|
/**
|
|
@@ -514,13 +518,13 @@ class z {
|
|
|
514
518
|
}
|
|
515
519
|
addWidget(t, e) {
|
|
516
520
|
const s = [], r = e ? e.addLabel : !0;
|
|
517
|
-
if (t instanceof
|
|
521
|
+
if (t instanceof U) {
|
|
518
522
|
this._rows.push([]), this._index++;
|
|
519
523
|
return;
|
|
520
524
|
}
|
|
521
525
|
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof f && !t.nolabel) {
|
|
522
526
|
t.colspan > 1 && (t.colspan -= 1);
|
|
523
|
-
const l = new
|
|
527
|
+
const l = new K({
|
|
524
528
|
name: t.id + "_label",
|
|
525
529
|
string: t.label,
|
|
526
530
|
invisible: t.invisible,
|
|
@@ -624,18 +628,18 @@ const O = class O extends C {
|
|
|
624
628
|
};
|
|
625
629
|
n(O, "_defaultColspan", 6);
|
|
626
630
|
let v = O;
|
|
627
|
-
const
|
|
631
|
+
const P = class P extends v {
|
|
628
632
|
constructor(e) {
|
|
629
633
|
super(e);
|
|
630
634
|
n(this, "_tabPosition", "top");
|
|
631
635
|
n(this, "_pages", []);
|
|
632
|
-
this.colspan =
|
|
636
|
+
this.colspan = P._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
|
|
633
637
|
}
|
|
634
638
|
static get defaultColspan() {
|
|
635
|
-
return
|
|
639
|
+
return P._defaultColspan;
|
|
636
640
|
}
|
|
637
641
|
static set defaultColspan(e) {
|
|
638
|
-
|
|
642
|
+
P._defaultColspan = e;
|
|
639
643
|
}
|
|
640
644
|
get tabPosition() {
|
|
641
645
|
return this._tabPosition;
|
|
@@ -647,8 +651,8 @@ const T = class T extends v {
|
|
|
647
651
|
return [].concat.apply([], this._container.rows);
|
|
648
652
|
}
|
|
649
653
|
};
|
|
650
|
-
n(
|
|
651
|
-
let M =
|
|
654
|
+
n(P, "_defaultColspan", 3);
|
|
655
|
+
let M = P;
|
|
652
656
|
class B extends v {
|
|
653
657
|
constructor(e) {
|
|
654
658
|
super(e);
|
|
@@ -662,7 +666,7 @@ class B extends v {
|
|
|
662
666
|
this._loading = e;
|
|
663
667
|
}
|
|
664
668
|
}
|
|
665
|
-
class
|
|
669
|
+
class Oe extends B {
|
|
666
670
|
constructor(e) {
|
|
667
671
|
super(e);
|
|
668
672
|
n(this, "_icon", null);
|
|
@@ -675,7 +679,7 @@ class ke extends B {
|
|
|
675
679
|
this._icon = e;
|
|
676
680
|
}
|
|
677
681
|
}
|
|
678
|
-
class
|
|
682
|
+
class Pe extends B {
|
|
679
683
|
constructor(e) {
|
|
680
684
|
super(e);
|
|
681
685
|
n(this, "_icon", null);
|
|
@@ -688,7 +692,7 @@ class Oe extends B {
|
|
|
688
692
|
this._icon = e;
|
|
689
693
|
}
|
|
690
694
|
}
|
|
691
|
-
class
|
|
695
|
+
class Z extends f {
|
|
692
696
|
constructor(e) {
|
|
693
697
|
super({
|
|
694
698
|
...e,
|
|
@@ -914,7 +918,7 @@ class W extends f {
|
|
|
914
918
|
this._size = e;
|
|
915
919
|
}
|
|
916
920
|
}
|
|
917
|
-
class
|
|
921
|
+
class We extends f {
|
|
918
922
|
constructor(e) {
|
|
919
923
|
super(e);
|
|
920
924
|
/**
|
|
@@ -940,14 +944,14 @@ class Pe extends f {
|
|
|
940
944
|
this._relation = e;
|
|
941
945
|
}
|
|
942
946
|
}
|
|
943
|
-
class
|
|
947
|
+
class Ee extends L {
|
|
944
948
|
}
|
|
945
|
-
class
|
|
949
|
+
class ee extends f {
|
|
946
950
|
constructor(t) {
|
|
947
951
|
super(t);
|
|
948
952
|
}
|
|
949
953
|
}
|
|
950
|
-
class
|
|
954
|
+
class Ie extends f {
|
|
951
955
|
constructor(t) {
|
|
952
956
|
super(t);
|
|
953
957
|
}
|
|
@@ -985,23 +989,23 @@ class G extends f {
|
|
|
985
989
|
this._decimalDigits = e;
|
|
986
990
|
}
|
|
987
991
|
}
|
|
988
|
-
class
|
|
992
|
+
class Se extends G {
|
|
989
993
|
}
|
|
990
|
-
class
|
|
994
|
+
class ze extends f {
|
|
991
995
|
}
|
|
992
|
-
class
|
|
996
|
+
class Ve extends G {
|
|
993
997
|
}
|
|
994
|
-
class
|
|
998
|
+
class Ye extends f {
|
|
995
999
|
constructor(t) {
|
|
996
1000
|
super(t);
|
|
997
1001
|
}
|
|
998
1002
|
}
|
|
999
|
-
class
|
|
1003
|
+
class De extends f {
|
|
1000
1004
|
constructor(t) {
|
|
1001
1005
|
super(t);
|
|
1002
1006
|
}
|
|
1003
1007
|
}
|
|
1004
|
-
class
|
|
1008
|
+
class te extends f {
|
|
1005
1009
|
constructor(e) {
|
|
1006
1010
|
super(e);
|
|
1007
1011
|
/**
|
|
@@ -1095,7 +1099,7 @@ class ee extends f {
|
|
|
1095
1099
|
this._infinite = e;
|
|
1096
1100
|
}
|
|
1097
1101
|
}
|
|
1098
|
-
class
|
|
1102
|
+
class je extends C {
|
|
1099
1103
|
constructor(e) {
|
|
1100
1104
|
super(e);
|
|
1101
1105
|
/**
|
|
@@ -1121,9 +1125,9 @@ class De extends C {
|
|
|
1121
1125
|
return null;
|
|
1122
1126
|
}
|
|
1123
1127
|
}
|
|
1124
|
-
class
|
|
1128
|
+
class Me extends W {
|
|
1125
1129
|
}
|
|
1126
|
-
class
|
|
1130
|
+
class Ne extends f {
|
|
1127
1131
|
constructor(e) {
|
|
1128
1132
|
super(e);
|
|
1129
1133
|
/**
|
|
@@ -1139,18 +1143,18 @@ class Me extends f {
|
|
|
1139
1143
|
this._filenameField = e;
|
|
1140
1144
|
}
|
|
1141
1145
|
}
|
|
1142
|
-
class
|
|
1146
|
+
class Ae extends f {
|
|
1143
1147
|
get showControls() {
|
|
1144
1148
|
var t;
|
|
1145
1149
|
return ((t = this.parsedWidgetProps) == null ? void 0 : t.showControls) ?? !0;
|
|
1146
1150
|
}
|
|
1147
1151
|
}
|
|
1148
|
-
class
|
|
1152
|
+
class Be extends f {
|
|
1149
1153
|
constructor(t) {
|
|
1150
1154
|
super(t);
|
|
1151
1155
|
}
|
|
1152
1156
|
}
|
|
1153
|
-
class
|
|
1157
|
+
class Le extends te {
|
|
1154
1158
|
constructor(e) {
|
|
1155
1159
|
super(e);
|
|
1156
1160
|
/**
|
|
@@ -1182,7 +1186,7 @@ class Be extends ee {
|
|
|
1182
1186
|
return this.parsedWidgetProps.colorField;
|
|
1183
1187
|
}
|
|
1184
1188
|
}
|
|
1185
|
-
class
|
|
1189
|
+
class Ge extends W {
|
|
1186
1190
|
constructor(e) {
|
|
1187
1191
|
super(e);
|
|
1188
1192
|
n(this, "_nolabel", !0);
|
|
@@ -1232,7 +1236,7 @@ class Le extends W {
|
|
|
1232
1236
|
this._height = e;
|
|
1233
1237
|
}
|
|
1234
1238
|
}
|
|
1235
|
-
class
|
|
1239
|
+
class ie extends f {
|
|
1236
1240
|
constructor(e) {
|
|
1237
1241
|
super(e);
|
|
1238
1242
|
/**
|
|
@@ -1285,14 +1289,14 @@ class te extends f {
|
|
|
1285
1289
|
this._columns = e;
|
|
1286
1290
|
}
|
|
1287
1291
|
}
|
|
1288
|
-
class
|
|
1292
|
+
class Re extends ie {
|
|
1289
1293
|
}
|
|
1290
|
-
class
|
|
1294
|
+
class $e extends W {
|
|
1291
1295
|
get colors() {
|
|
1292
1296
|
return this._parsedWidgetProps.colors || {};
|
|
1293
1297
|
}
|
|
1294
1298
|
}
|
|
1295
|
-
class
|
|
1299
|
+
class qe extends W {
|
|
1296
1300
|
constructor(e) {
|
|
1297
1301
|
super(e);
|
|
1298
1302
|
/**
|
|
@@ -1308,9 +1312,9 @@ class $e extends W {
|
|
|
1308
1312
|
this._direction = e;
|
|
1309
1313
|
}
|
|
1310
1314
|
}
|
|
1311
|
-
class
|
|
1315
|
+
class Je extends ee {
|
|
1312
1316
|
}
|
|
1313
|
-
class
|
|
1317
|
+
class He extends f {
|
|
1314
1318
|
constructor(e) {
|
|
1315
1319
|
super(e);
|
|
1316
1320
|
/**
|
|
@@ -1340,7 +1344,7 @@ class Je extends f {
|
|
|
1340
1344
|
this._lastStep = e;
|
|
1341
1345
|
}
|
|
1342
1346
|
}
|
|
1343
|
-
class
|
|
1347
|
+
class se extends L {
|
|
1344
1348
|
constructor(e) {
|
|
1345
1349
|
super(e);
|
|
1346
1350
|
n(this, "_lang", null);
|
|
@@ -1353,12 +1357,12 @@ class ie extends L {
|
|
|
1353
1357
|
this._lang = e;
|
|
1354
1358
|
}
|
|
1355
1359
|
}
|
|
1356
|
-
class
|
|
1360
|
+
class Qe extends f {
|
|
1357
1361
|
constructor(t) {
|
|
1358
1362
|
super(t);
|
|
1359
1363
|
}
|
|
1360
1364
|
}
|
|
1361
|
-
class
|
|
1365
|
+
class Xe extends v {
|
|
1362
1366
|
constructor(e) {
|
|
1363
1367
|
super(e);
|
|
1364
1368
|
/**
|
|
@@ -1398,7 +1402,7 @@ class Qe extends v {
|
|
|
1398
1402
|
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
1399
1403
|
}
|
|
1400
1404
|
}
|
|
1401
|
-
class
|
|
1405
|
+
class Ue extends f {
|
|
1402
1406
|
constructor(e) {
|
|
1403
1407
|
super(e);
|
|
1404
1408
|
/**
|
|
@@ -1417,13 +1421,13 @@ class Xe extends f {
|
|
|
1417
1421
|
this._height = e;
|
|
1418
1422
|
}
|
|
1419
1423
|
}
|
|
1420
|
-
class J extends
|
|
1424
|
+
class J extends se {
|
|
1421
1425
|
constructor() {
|
|
1422
1426
|
super(...arguments);
|
|
1423
1427
|
n(this, "_lang", "json");
|
|
1424
1428
|
}
|
|
1425
1429
|
}
|
|
1426
|
-
class
|
|
1430
|
+
class Ke extends f {
|
|
1427
1431
|
constructor(e) {
|
|
1428
1432
|
super(e);
|
|
1429
1433
|
n(this, "_multi", !1);
|
|
@@ -1456,13 +1460,13 @@ class R {
|
|
|
1456
1460
|
this._widgetClass = M;
|
|
1457
1461
|
break;
|
|
1458
1462
|
case "page":
|
|
1459
|
-
this._widgetClass =
|
|
1463
|
+
this._widgetClass = Oe;
|
|
1460
1464
|
break;
|
|
1461
1465
|
case "group":
|
|
1462
|
-
this._widgetClass =
|
|
1466
|
+
this._widgetClass = Pe;
|
|
1463
1467
|
break;
|
|
1464
1468
|
case "label":
|
|
1465
|
-
this._widgetClass =
|
|
1469
|
+
this._widgetClass = K;
|
|
1466
1470
|
break;
|
|
1467
1471
|
case "char":
|
|
1468
1472
|
this._widgetClass = q;
|
|
@@ -1471,7 +1475,7 @@ class R {
|
|
|
1471
1475
|
this._widgetClass = L;
|
|
1472
1476
|
break;
|
|
1473
1477
|
case "button":
|
|
1474
|
-
this._widgetClass =
|
|
1478
|
+
this._widgetClass = Z;
|
|
1475
1479
|
break;
|
|
1476
1480
|
case "buttonGroup":
|
|
1477
1481
|
this._widgetClass = Te;
|
|
@@ -1480,102 +1484,102 @@ class R {
|
|
|
1480
1484
|
this._widgetClass = W;
|
|
1481
1485
|
break;
|
|
1482
1486
|
case "many2one":
|
|
1483
|
-
this._widgetClass =
|
|
1487
|
+
this._widgetClass = We;
|
|
1484
1488
|
break;
|
|
1485
1489
|
case "boolean":
|
|
1486
|
-
this._widgetClass =
|
|
1490
|
+
this._widgetClass = ee;
|
|
1487
1491
|
break;
|
|
1488
1492
|
case "integer":
|
|
1489
|
-
this._widgetClass =
|
|
1493
|
+
this._widgetClass = Ie;
|
|
1490
1494
|
break;
|
|
1491
1495
|
case "float":
|
|
1492
1496
|
this._widgetClass = G;
|
|
1493
1497
|
break;
|
|
1494
1498
|
case "float_time":
|
|
1495
|
-
this._widgetClass =
|
|
1499
|
+
this._widgetClass = Se;
|
|
1496
1500
|
break;
|
|
1497
1501
|
case "date":
|
|
1498
|
-
this._widgetClass =
|
|
1502
|
+
this._widgetClass = Ye;
|
|
1499
1503
|
break;
|
|
1500
1504
|
case "datetime":
|
|
1501
|
-
this._widgetClass =
|
|
1505
|
+
this._widgetClass = De;
|
|
1502
1506
|
break;
|
|
1503
1507
|
case "progressbar":
|
|
1504
|
-
this._widgetClass =
|
|
1508
|
+
this._widgetClass = Ve;
|
|
1505
1509
|
break;
|
|
1506
1510
|
case "markdown":
|
|
1507
|
-
this._widgetClass =
|
|
1511
|
+
this._widgetClass = Ee;
|
|
1508
1512
|
break;
|
|
1509
1513
|
case "many2many":
|
|
1510
1514
|
case "one2many":
|
|
1511
1515
|
case "one2many_list":
|
|
1512
|
-
this._widgetClass =
|
|
1516
|
+
this._widgetClass = te;
|
|
1513
1517
|
break;
|
|
1514
1518
|
case "newline":
|
|
1515
|
-
this._widgetClass =
|
|
1519
|
+
this._widgetClass = U;
|
|
1516
1520
|
break;
|
|
1517
1521
|
case "separator":
|
|
1518
|
-
this._widgetClass =
|
|
1522
|
+
this._widgetClass = je;
|
|
1519
1523
|
break;
|
|
1520
1524
|
case "url":
|
|
1521
1525
|
this._widgetClass = q;
|
|
1522
1526
|
break;
|
|
1523
1527
|
case "email":
|
|
1524
|
-
this._widgetClass =
|
|
1528
|
+
this._widgetClass = Ke;
|
|
1525
1529
|
break;
|
|
1526
1530
|
case "reference":
|
|
1527
|
-
this._widgetClass =
|
|
1531
|
+
this._widgetClass = Me;
|
|
1528
1532
|
break;
|
|
1529
1533
|
case "binary":
|
|
1530
|
-
this._widgetClass =
|
|
1534
|
+
this._widgetClass = Ne;
|
|
1531
1535
|
break;
|
|
1532
1536
|
case "image":
|
|
1533
|
-
this._widgetClass =
|
|
1537
|
+
this._widgetClass = Ae;
|
|
1534
1538
|
break;
|
|
1535
1539
|
case "fiber_grid":
|
|
1536
|
-
this._widgetClass =
|
|
1540
|
+
this._widgetClass = Be;
|
|
1537
1541
|
break;
|
|
1538
1542
|
case "timeline":
|
|
1539
|
-
this._widgetClass =
|
|
1543
|
+
this._widgetClass = Le;
|
|
1540
1544
|
break;
|
|
1541
1545
|
case "indicator":
|
|
1542
|
-
this._widgetClass =
|
|
1546
|
+
this._widgetClass = Ge;
|
|
1543
1547
|
break;
|
|
1544
1548
|
case "tags":
|
|
1545
|
-
this._widgetClass =
|
|
1549
|
+
this._widgetClass = Re;
|
|
1546
1550
|
break;
|
|
1547
1551
|
case "tag":
|
|
1548
|
-
this._widgetClass =
|
|
1552
|
+
this._widgetClass = $e;
|
|
1549
1553
|
break;
|
|
1550
1554
|
case "avatar":
|
|
1551
|
-
this._widgetClass =
|
|
1555
|
+
this._widgetClass = ke;
|
|
1552
1556
|
break;
|
|
1553
1557
|
case "radio":
|
|
1554
|
-
this._widgetClass =
|
|
1558
|
+
this._widgetClass = qe;
|
|
1555
1559
|
break;
|
|
1556
1560
|
case "multicheckbox":
|
|
1557
|
-
this._widgetClass =
|
|
1561
|
+
this._widgetClass = ie;
|
|
1558
1562
|
break;
|
|
1559
1563
|
case "switch":
|
|
1560
|
-
this._widgetClass =
|
|
1564
|
+
this._widgetClass = Je;
|
|
1561
1565
|
break;
|
|
1562
1566
|
case "steps":
|
|
1563
|
-
this._widgetClass =
|
|
1567
|
+
this._widgetClass = He;
|
|
1564
1568
|
break;
|
|
1565
1569
|
case "codeeditor":
|
|
1566
|
-
this._widgetClass =
|
|
1570
|
+
this._widgetClass = se;
|
|
1567
1571
|
break;
|
|
1568
1572
|
case "time":
|
|
1569
|
-
this._widgetClass =
|
|
1573
|
+
this._widgetClass = Qe;
|
|
1570
1574
|
break;
|
|
1571
1575
|
case "html_preview":
|
|
1572
|
-
this._widgetClass =
|
|
1576
|
+
this._widgetClass = ze;
|
|
1573
1577
|
break;
|
|
1574
1578
|
case "alert":
|
|
1575
|
-
this._widgetClass =
|
|
1579
|
+
this._widgetClass = Xe;
|
|
1576
1580
|
break;
|
|
1577
1581
|
case "comments_timeline":
|
|
1578
|
-
this._widgetClass =
|
|
1582
|
+
this._widgetClass = Ue;
|
|
1579
1583
|
break;
|
|
1580
1584
|
case "json":
|
|
1581
1585
|
this._widgetClass = J;
|
|
@@ -1607,7 +1611,7 @@ class R {
|
|
|
1607
1611
|
}
|
|
1608
1612
|
}
|
|
1609
1613
|
}
|
|
1610
|
-
const
|
|
1614
|
+
const Ze = ({
|
|
1611
1615
|
fieldName: i,
|
|
1612
1616
|
values: t,
|
|
1613
1617
|
fields: e
|
|
@@ -1632,7 +1636,7 @@ const Ke = ({
|
|
|
1632
1636
|
r[o] = d.some((_) => _);
|
|
1633
1637
|
}
|
|
1634
1638
|
return r;
|
|
1635
|
-
},
|
|
1639
|
+
}, et = ({
|
|
1636
1640
|
states: i,
|
|
1637
1641
|
values: t
|
|
1638
1642
|
}) => {
|
|
@@ -1641,7 +1645,7 @@ const Ke = ({
|
|
|
1641
1645
|
const e = i.split(",");
|
|
1642
1646
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1643
1647
|
};
|
|
1644
|
-
function
|
|
1648
|
+
function tt({
|
|
1645
1649
|
values: i = {},
|
|
1646
1650
|
fieldName: t,
|
|
1647
1651
|
fields: e = {}
|
|
@@ -1650,7 +1654,7 @@ function et({
|
|
|
1650
1654
|
const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
|
|
1651
1655
|
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);
|
|
1652
1656
|
}
|
|
1653
|
-
const
|
|
1657
|
+
const ne = ({
|
|
1654
1658
|
context: i,
|
|
1655
1659
|
values: t,
|
|
1656
1660
|
fields: e
|
|
@@ -1658,9 +1662,9 @@ const se = ({
|
|
|
1658
1662
|
try {
|
|
1659
1663
|
if (!i)
|
|
1660
1664
|
return;
|
|
1661
|
-
if (
|
|
1665
|
+
if (ae(i) || typeof i != "string")
|
|
1662
1666
|
return i;
|
|
1663
|
-
const s =
|
|
1667
|
+
const s = re(i);
|
|
1664
1668
|
if (s !== null)
|
|
1665
1669
|
return s;
|
|
1666
1670
|
if (i.trim().length === 0)
|
|
@@ -1669,7 +1673,7 @@ const se = ({
|
|
|
1669
1673
|
return u.forEach((c) => {
|
|
1670
1674
|
const m = c[1];
|
|
1671
1675
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1672
|
-
const p =
|
|
1676
|
+
const p = tt({
|
|
1673
1677
|
values: t,
|
|
1674
1678
|
fields: e,
|
|
1675
1679
|
fieldName: m === "active_id" ? "id" : m
|
|
@@ -1684,34 +1688,34 @@ const se = ({
|
|
|
1684
1688
|
} catch {
|
|
1685
1689
|
return;
|
|
1686
1690
|
}
|
|
1687
|
-
},
|
|
1691
|
+
}, Ot = (i) => {
|
|
1688
1692
|
const t = [];
|
|
1689
1693
|
try {
|
|
1690
|
-
return !i ||
|
|
1694
|
+
return !i || ae(i) || typeof i != "string" ? t : re(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((u) => u.split(":")).forEach((u) => {
|
|
1691
1695
|
!u[1].includes("'") && u[1] !== "true" && u[1] !== "false" && t.push(u[1].replace(/'/g, ""));
|
|
1692
1696
|
}), t);
|
|
1693
1697
|
} catch {
|
|
1694
1698
|
}
|
|
1695
1699
|
return t;
|
|
1696
1700
|
};
|
|
1697
|
-
function
|
|
1701
|
+
function re(i) {
|
|
1698
1702
|
try {
|
|
1699
1703
|
return JSON.parse(i.replace(/'/g, '"'));
|
|
1700
1704
|
} catch {
|
|
1701
1705
|
return null;
|
|
1702
1706
|
}
|
|
1703
1707
|
}
|
|
1704
|
-
function
|
|
1708
|
+
function ae(i) {
|
|
1705
1709
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1706
1710
|
}
|
|
1707
|
-
const
|
|
1711
|
+
const it = (i) => {
|
|
1708
1712
|
const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1709
1713
|
return {
|
|
1710
1714
|
method: e,
|
|
1711
1715
|
args: r
|
|
1712
1716
|
};
|
|
1713
1717
|
};
|
|
1714
|
-
function
|
|
1718
|
+
function st(i) {
|
|
1715
1719
|
const t = [];
|
|
1716
1720
|
function e(s) {
|
|
1717
1721
|
const r = [];
|
|
@@ -1723,7 +1727,7 @@ function it(i) {
|
|
|
1723
1727
|
e(s);
|
|
1724
1728
|
return t.flat();
|
|
1725
1729
|
}
|
|
1726
|
-
class
|
|
1730
|
+
class Pt {
|
|
1727
1731
|
constructor(t, e = 4) {
|
|
1728
1732
|
/**
|
|
1729
1733
|
* Object containing fields specification of the form.
|
|
@@ -1839,7 +1843,7 @@ class Ot {
|
|
|
1839
1843
|
container: this._container,
|
|
1840
1844
|
values: s
|
|
1841
1845
|
});
|
|
1842
|
-
const l =
|
|
1846
|
+
const l = st(this._container._rows);
|
|
1843
1847
|
l.forEach((d) => {
|
|
1844
1848
|
const _ = d;
|
|
1845
1849
|
_._id && _._context && (this._contextForFields[_._id] = d._context);
|
|
@@ -1852,47 +1856,50 @@ class Ot {
|
|
|
1852
1856
|
}) {
|
|
1853
1857
|
const r = new R();
|
|
1854
1858
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
1855
|
-
var
|
|
1859
|
+
var w, F;
|
|
1856
1860
|
const { tagName: l, attributes: o, children: d } = a;
|
|
1857
1861
|
let _ = l, h = o;
|
|
1858
1862
|
if (l === "field") {
|
|
1859
|
-
const { name:
|
|
1863
|
+
const { name: x, widget: E } = o;
|
|
1860
1864
|
if (E)
|
|
1861
1865
|
_ = E;
|
|
1862
|
-
else if (
|
|
1863
|
-
if (!this._fields[
|
|
1866
|
+
else if (x) {
|
|
1867
|
+
if (!this._fields[x])
|
|
1864
1868
|
throw new Error(
|
|
1865
|
-
`Field ${
|
|
1869
|
+
`Field ${x} doesn't exist in fields defintion`
|
|
1866
1870
|
);
|
|
1867
|
-
_ = this._fields[
|
|
1871
|
+
_ = this._fields[x].type, o.widget_props = {
|
|
1872
|
+
...X(o.widget_props),
|
|
1873
|
+
...this._fields[x].widget_props || {}
|
|
1874
|
+
};
|
|
1868
1875
|
}
|
|
1869
1876
|
h = {
|
|
1870
|
-
...this._fields[
|
|
1877
|
+
...this._fields[x],
|
|
1871
1878
|
...o,
|
|
1872
|
-
fieldsWidgetType: this._fields[
|
|
1879
|
+
fieldsWidgetType: this._fields[x].type
|
|
1873
1880
|
};
|
|
1874
1881
|
}
|
|
1875
|
-
const u =
|
|
1882
|
+
const u = Ce({
|
|
1876
1883
|
tagAttributes: h,
|
|
1877
1884
|
values: s,
|
|
1878
1885
|
fields: this._fields,
|
|
1879
1886
|
widgetType: l
|
|
1880
1887
|
});
|
|
1881
1888
|
let g;
|
|
1882
|
-
l === "button" && h.states ? g =
|
|
1889
|
+
l === "button" && h.states ? g = et({
|
|
1883
1890
|
states: h.states,
|
|
1884
1891
|
values: s
|
|
1885
|
-
}) : g =
|
|
1892
|
+
}) : g = Ze({
|
|
1886
1893
|
fieldName: h.name,
|
|
1887
1894
|
values: s,
|
|
1888
1895
|
fields: this._fields
|
|
1889
1896
|
});
|
|
1890
|
-
const c =
|
|
1891
|
-
context: h.context || ((
|
|
1897
|
+
const c = ne({
|
|
1898
|
+
context: h.context || ((w = this._fields[h.name]) == null ? void 0 : w.context),
|
|
1892
1899
|
values: s,
|
|
1893
1900
|
fields: this._fields
|
|
1894
1901
|
});
|
|
1895
|
-
h.on_change && (this._onChangeFields[h.name] =
|
|
1902
|
+
h.on_change && (this._onChangeFields[h.name] = it(
|
|
1896
1903
|
h.on_change
|
|
1897
1904
|
));
|
|
1898
1905
|
let m;
|
|
@@ -1910,7 +1917,7 @@ class Ot {
|
|
|
1910
1917
|
fields: d,
|
|
1911
1918
|
container: y.container,
|
|
1912
1919
|
values: s
|
|
1913
|
-
}), y instanceof
|
|
1920
|
+
}), y instanceof Z && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
1914
1921
|
});
|
|
1915
1922
|
}
|
|
1916
1923
|
/**
|
|
@@ -2010,7 +2017,7 @@ class Tt {
|
|
|
2010
2017
|
throw new Error(`Field ${d} doesn't exist in fields defintion`);
|
|
2011
2018
|
const u = this._fields[d];
|
|
2012
2019
|
o = u.type, (Array.isArray(u == null ? void 0 : u.domain) && (u == null ? void 0 : u.domain.length) === 0 || (u == null ? void 0 : u.domain) === !1) && l.domain && l.domain.length > 0 && delete u.domain;
|
|
2013
|
-
const g =
|
|
2020
|
+
const g = ne({
|
|
2014
2021
|
context: l.context || u.context,
|
|
2015
2022
|
values: {},
|
|
2016
2023
|
fields: this._fields
|
|
@@ -2038,7 +2045,7 @@ class Tt {
|
|
|
2038
2045
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
2039
2046
|
}
|
|
2040
2047
|
}
|
|
2041
|
-
const
|
|
2048
|
+
const nt = {
|
|
2042
2049
|
text: "text",
|
|
2043
2050
|
many2one: "many2one",
|
|
2044
2051
|
char: "char",
|
|
@@ -2051,7 +2058,7 @@ const st = {
|
|
|
2051
2058
|
date: "date",
|
|
2052
2059
|
datetime: "datetime"
|
|
2053
2060
|
};
|
|
2054
|
-
class
|
|
2061
|
+
class Wt {
|
|
2055
2062
|
constructor(t, e, s = 8) {
|
|
2056
2063
|
/**
|
|
2057
2064
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -2099,7 +2106,7 @@ class Pt {
|
|
|
2099
2106
|
colspan: 2
|
|
2100
2107
|
}, { type: a, widget: l } = r;
|
|
2101
2108
|
let o = l ?? a;
|
|
2102
|
-
return
|
|
2109
|
+
return nt[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
2103
2110
|
});
|
|
2104
2111
|
}
|
|
2105
2112
|
/**
|
|
@@ -2110,7 +2117,7 @@ class Pt {
|
|
|
2110
2117
|
return this.advancedSearchContainer.findById(t);
|
|
2111
2118
|
}
|
|
2112
2119
|
}
|
|
2113
|
-
const
|
|
2120
|
+
const Et = ({
|
|
2114
2121
|
domain: i,
|
|
2115
2122
|
widgetFieldName: t
|
|
2116
2123
|
}) => {
|
|
@@ -2125,8 +2132,8 @@ const Wt = ({
|
|
|
2125
2132
|
r.length - 1
|
|
2126
2133
|
)) : (o = r, d = "id"), o === t && e.push([d, a, l]);
|
|
2127
2134
|
}), e;
|
|
2128
|
-
},
|
|
2129
|
-
class
|
|
2135
|
+
}, It = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2136
|
+
class rt {
|
|
2130
2137
|
constructor(t) {
|
|
2131
2138
|
n(this, "_action_id", null);
|
|
2132
2139
|
n(this, "_position", null);
|
|
@@ -2139,7 +2146,7 @@ class nt {
|
|
|
2139
2146
|
return this._position;
|
|
2140
2147
|
}
|
|
2141
2148
|
}
|
|
2142
|
-
class
|
|
2149
|
+
class St {
|
|
2143
2150
|
constructor(t) {
|
|
2144
2151
|
n(this, "_string", null);
|
|
2145
2152
|
n(this, "_items", []);
|
|
@@ -2147,7 +2154,7 @@ class It {
|
|
|
2147
2154
|
this._string = e.attributes.string || null;
|
|
2148
2155
|
const { children: s } = e;
|
|
2149
2156
|
s.forEach((r) => {
|
|
2150
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
2157
|
+
r.tagName === "dashboard_item" && this._items.push(new rt(r.attributes));
|
|
2151
2158
|
});
|
|
2152
2159
|
}
|
|
2153
2160
|
get string() {
|
|
@@ -2157,7 +2164,7 @@ class It {
|
|
|
2157
2164
|
return this._items;
|
|
2158
2165
|
}
|
|
2159
2166
|
}
|
|
2160
|
-
class
|
|
2167
|
+
class le {
|
|
2161
2168
|
constructor(t) {
|
|
2162
2169
|
n(this, "_string", null);
|
|
2163
2170
|
n(this, "_type");
|
|
@@ -2185,7 +2192,7 @@ class ae {
|
|
|
2185
2192
|
return this._y_range;
|
|
2186
2193
|
}
|
|
2187
2194
|
}
|
|
2188
|
-
class
|
|
2195
|
+
class oe extends le {
|
|
2189
2196
|
constructor(e, s) {
|
|
2190
2197
|
super(s);
|
|
2191
2198
|
n(this, "_color", null);
|
|
@@ -2211,7 +2218,7 @@ class le extends ae {
|
|
|
2211
2218
|
return this._suffix;
|
|
2212
2219
|
}
|
|
2213
2220
|
}
|
|
2214
|
-
class
|
|
2221
|
+
class at extends oe {
|
|
2215
2222
|
constructor(e, s) {
|
|
2216
2223
|
super(e, s);
|
|
2217
2224
|
n(this, "_field");
|
|
@@ -2231,7 +2238,7 @@ class rt extends le {
|
|
|
2231
2238
|
return this._operator;
|
|
2232
2239
|
}
|
|
2233
2240
|
}
|
|
2234
|
-
const
|
|
2241
|
+
const lt = (i) => {
|
|
2235
2242
|
const t = [];
|
|
2236
2243
|
let e;
|
|
2237
2244
|
if (i.forEach((s) => {
|
|
@@ -2241,10 +2248,10 @@ const at = (i) => {
|
|
|
2241
2248
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2242
2249
|
if (!l)
|
|
2243
2250
|
throw new Error("Missing name attribute for field");
|
|
2244
|
-
r === "x" ? e = new
|
|
2251
|
+
r === "x" ? e = new dt({
|
|
2245
2252
|
name: l
|
|
2246
2253
|
}) : r === "y" && t.push(
|
|
2247
|
-
new
|
|
2254
|
+
new ct({
|
|
2248
2255
|
name: l,
|
|
2249
2256
|
operator: a,
|
|
2250
2257
|
label: o,
|
|
@@ -2261,13 +2268,13 @@ const at = (i) => {
|
|
|
2261
2268
|
y: t
|
|
2262
2269
|
};
|
|
2263
2270
|
};
|
|
2264
|
-
class j extends
|
|
2271
|
+
class j extends le {
|
|
2265
2272
|
constructor(e, s) {
|
|
2266
2273
|
super(s);
|
|
2267
2274
|
n(this, "_x");
|
|
2268
2275
|
n(this, "_y");
|
|
2269
2276
|
this._type = e;
|
|
2270
|
-
const r =
|
|
2277
|
+
const r = lt(s.children);
|
|
2271
2278
|
this._x = r.x, this._y = r.y;
|
|
2272
2279
|
}
|
|
2273
2280
|
get x() {
|
|
@@ -2277,22 +2284,22 @@ class j extends ae {
|
|
|
2277
2284
|
return this._y;
|
|
2278
2285
|
}
|
|
2279
2286
|
}
|
|
2280
|
-
const
|
|
2281
|
-
indicator:
|
|
2282
|
-
indicatorField:
|
|
2287
|
+
const ot = {
|
|
2288
|
+
indicator: oe,
|
|
2289
|
+
indicatorField: at,
|
|
2283
2290
|
line: j,
|
|
2284
2291
|
bar: j,
|
|
2285
2292
|
pie: j
|
|
2286
|
-
},
|
|
2293
|
+
}, zt = (i) => {
|
|
2287
2294
|
const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2288
2295
|
if (!e)
|
|
2289
2296
|
throw new Error(`${e} is not a valid graph`);
|
|
2290
|
-
const s =
|
|
2297
|
+
const s = ot[e];
|
|
2291
2298
|
if (!s)
|
|
2292
2299
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2293
2300
|
return new s(e, t);
|
|
2294
2301
|
};
|
|
2295
|
-
class
|
|
2302
|
+
class ce {
|
|
2296
2303
|
constructor({ name: t, axis: e }) {
|
|
2297
2304
|
n(this, "_name");
|
|
2298
2305
|
n(this, "_axis");
|
|
@@ -2305,7 +2312,7 @@ class oe {
|
|
|
2305
2312
|
return this._axis;
|
|
2306
2313
|
}
|
|
2307
2314
|
}
|
|
2308
|
-
class
|
|
2315
|
+
class ct extends ce {
|
|
2309
2316
|
constructor({
|
|
2310
2317
|
name: e,
|
|
2311
2318
|
operator: s,
|
|
@@ -2328,12 +2335,12 @@ class ot extends oe {
|
|
|
2328
2335
|
return this._stacked;
|
|
2329
2336
|
}
|
|
2330
2337
|
}
|
|
2331
|
-
class
|
|
2338
|
+
class dt extends ce {
|
|
2332
2339
|
constructor({ name: t }) {
|
|
2333
2340
|
super({ name: t, axis: "x" });
|
|
2334
2341
|
}
|
|
2335
2342
|
}
|
|
2336
|
-
const
|
|
2343
|
+
const ut = ({ ooui: i }) => {
|
|
2337
2344
|
const e = [i.x.name];
|
|
2338
2345
|
return i.y ? (i.y.forEach((s) => {
|
|
2339
2346
|
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
@@ -2355,33 +2362,33 @@ function $({
|
|
|
2355
2362
|
}
|
|
2356
2363
|
return { value: r, label: r };
|
|
2357
2364
|
}
|
|
2358
|
-
const
|
|
2365
|
+
const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2359
2366
|
__proto__: null,
|
|
2360
|
-
getFieldsToRetrieve:
|
|
2367
|
+
getFieldsToRetrieve: ut,
|
|
2361
2368
|
getValueAndLabelForField: $
|
|
2362
2369
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2363
|
-
function
|
|
2370
|
+
function ht({
|
|
2364
2371
|
values: i,
|
|
2365
2372
|
timerange: t,
|
|
2366
2373
|
interval: e = 1
|
|
2367
2374
|
}) {
|
|
2368
|
-
const s =
|
|
2375
|
+
const s = gt({
|
|
2369
2376
|
values: i,
|
|
2370
2377
|
timerange: t
|
|
2371
2378
|
});
|
|
2372
|
-
return
|
|
2379
|
+
return _t({
|
|
2373
2380
|
values: s,
|
|
2374
2381
|
timerange: t,
|
|
2375
2382
|
interval: e
|
|
2376
2383
|
});
|
|
2377
2384
|
}
|
|
2378
|
-
function
|
|
2385
|
+
function _t({
|
|
2379
2386
|
values: i,
|
|
2380
2387
|
timerange: t,
|
|
2381
2388
|
interval: e = 1
|
|
2382
2389
|
}) {
|
|
2383
2390
|
let s = [];
|
|
2384
|
-
const r =
|
|
2391
|
+
const r = ue({
|
|
2385
2392
|
values: i,
|
|
2386
2393
|
groupBy: "type-stacked"
|
|
2387
2394
|
}), a = `${t}s`;
|
|
@@ -2392,8 +2399,8 @@ function ht({
|
|
|
2392
2399
|
if (s.push(h), _ === d.length - 1)
|
|
2393
2400
|
return;
|
|
2394
2401
|
const u = h.x, g = d[_ + 1].x;
|
|
2395
|
-
if (!
|
|
2396
|
-
const c =
|
|
2402
|
+
if (!de([u, g], a)) {
|
|
2403
|
+
const c = ft({
|
|
2397
2404
|
dates: [u, g],
|
|
2398
2405
|
timerange: t,
|
|
2399
2406
|
interval: e
|
|
@@ -2410,7 +2417,7 @@ function ht({
|
|
|
2410
2417
|
}
|
|
2411
2418
|
}), s.sort((o, d) => o.x < d.x ? -1 : o.x > d.x ? 1 : 0);
|
|
2412
2419
|
}
|
|
2413
|
-
function
|
|
2420
|
+
function ft({
|
|
2414
2421
|
dates: i,
|
|
2415
2422
|
timerange: t,
|
|
2416
2423
|
interval: e = 1
|
|
@@ -2421,25 +2428,25 @@ function _t({
|
|
|
2421
2428
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2422
2429
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2423
2430
|
const o = a[l], d = a[l + 1];
|
|
2424
|
-
if (!
|
|
2425
|
-
const _ =
|
|
2431
|
+
if (!de([o, d], r)) {
|
|
2432
|
+
const _ = T(o, S(r)).add(
|
|
2426
2433
|
e,
|
|
2427
2434
|
r
|
|
2428
|
-
), h =
|
|
2435
|
+
), h = T(d, S(r));
|
|
2429
2436
|
for (; _.isBefore(h); )
|
|
2430
2437
|
s.push(_.format(S(r))), _.add(e, r);
|
|
2431
2438
|
}
|
|
2432
2439
|
}
|
|
2433
2440
|
return s;
|
|
2434
2441
|
}
|
|
2435
|
-
function
|
|
2442
|
+
function gt({
|
|
2436
2443
|
values: i,
|
|
2437
2444
|
timerange: t
|
|
2438
2445
|
}) {
|
|
2439
|
-
const e =
|
|
2446
|
+
const e = mt({
|
|
2440
2447
|
values: i,
|
|
2441
2448
|
timerange: t
|
|
2442
|
-
}), s = [], r =
|
|
2449
|
+
}), s = [], r = ue({
|
|
2443
2450
|
values: e,
|
|
2444
2451
|
groupBy: "all"
|
|
2445
2452
|
});
|
|
@@ -2454,24 +2461,24 @@ function ft({
|
|
|
2454
2461
|
});
|
|
2455
2462
|
}), s;
|
|
2456
2463
|
}
|
|
2457
|
-
function
|
|
2464
|
+
function mt({
|
|
2458
2465
|
values: i,
|
|
2459
2466
|
timerange: t
|
|
2460
2467
|
}) {
|
|
2461
2468
|
return i.map((e) => ({
|
|
2462
2469
|
...e,
|
|
2463
|
-
x:
|
|
2470
|
+
x: bt({
|
|
2464
2471
|
date: e.x,
|
|
2465
2472
|
timerange: t
|
|
2466
2473
|
})
|
|
2467
2474
|
}));
|
|
2468
2475
|
}
|
|
2469
|
-
function
|
|
2476
|
+
function bt({
|
|
2470
2477
|
date: i,
|
|
2471
2478
|
timerange: t
|
|
2472
2479
|
}) {
|
|
2473
|
-
let e =
|
|
2474
|
-
const s =
|
|
2480
|
+
let e = yt(i);
|
|
2481
|
+
const s = T(i, e);
|
|
2475
2482
|
switch (t) {
|
|
2476
2483
|
case "hour": {
|
|
2477
2484
|
e = "YYYY-MM-DD HH:00";
|
|
@@ -2496,10 +2503,10 @@ function mt({
|
|
|
2496
2503
|
}
|
|
2497
2504
|
return s.format(e);
|
|
2498
2505
|
}
|
|
2499
|
-
function
|
|
2506
|
+
function yt(i) {
|
|
2500
2507
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2501
2508
|
}
|
|
2502
|
-
function
|
|
2509
|
+
function de(i, t) {
|
|
2503
2510
|
let e = !1;
|
|
2504
2511
|
const s = S(t);
|
|
2505
2512
|
if (i.length === 0)
|
|
@@ -2507,12 +2514,12 @@ function ce(i, t) {
|
|
|
2507
2514
|
if (i.length === 1)
|
|
2508
2515
|
return !0;
|
|
2509
2516
|
for (let r = 0; r < i.length - 1; r++) {
|
|
2510
|
-
const a =
|
|
2517
|
+
const a = T(i[r], s), o = T(i[r + 1], s).diff(a, t);
|
|
2511
2518
|
Math.abs(o) === 1 ? e = !0 : e = !1;
|
|
2512
2519
|
}
|
|
2513
2520
|
return e;
|
|
2514
2521
|
}
|
|
2515
|
-
function
|
|
2522
|
+
function ue({
|
|
2516
2523
|
values: i,
|
|
2517
2524
|
groupBy: t
|
|
2518
2525
|
}) {
|
|
@@ -2537,7 +2544,7 @@ function S(i) {
|
|
|
2537
2544
|
return "YYYY-MM-DD HH:mm";
|
|
2538
2545
|
}
|
|
2539
2546
|
}
|
|
2540
|
-
const
|
|
2547
|
+
const pt = {
|
|
2541
2548
|
count: "count",
|
|
2542
2549
|
"+": "sum",
|
|
2543
2550
|
"-": "subtract",
|
|
@@ -2545,7 +2552,7 @@ const yt = {
|
|
|
2545
2552
|
avg: "average",
|
|
2546
2553
|
min: "min",
|
|
2547
2554
|
max: "max"
|
|
2548
|
-
},
|
|
2555
|
+
}, xt = ({
|
|
2549
2556
|
ooui: i,
|
|
2550
2557
|
values: t,
|
|
2551
2558
|
fields: e,
|
|
@@ -2560,41 +2567,41 @@ const yt = {
|
|
|
2560
2567
|
Object.keys(r).forEach((m) => {
|
|
2561
2568
|
const p = r[m].label, y = r[m].entries;
|
|
2562
2569
|
if (c.label) {
|
|
2563
|
-
const
|
|
2570
|
+
const w = A({
|
|
2564
2571
|
fieldName: c.label,
|
|
2565
2572
|
values: y,
|
|
2566
2573
|
fields: e
|
|
2567
2574
|
});
|
|
2568
|
-
Object.keys(
|
|
2569
|
-
const
|
|
2570
|
-
entries:
|
|
2575
|
+
Object.keys(w).forEach((F) => {
|
|
2576
|
+
const x = w[F].entries, E = w[F].label, fe = N({
|
|
2577
|
+
entries: x,
|
|
2571
2578
|
fields: e,
|
|
2572
2579
|
fieldName: c.name
|
|
2573
|
-
}),
|
|
2574
|
-
values:
|
|
2580
|
+
}), ge = V({
|
|
2581
|
+
values: fe,
|
|
2575
2582
|
operator: c.operator
|
|
2576
2583
|
});
|
|
2577
2584
|
a.push({
|
|
2578
2585
|
x: p || !1,
|
|
2579
|
-
value:
|
|
2586
|
+
value: ge,
|
|
2580
2587
|
type: E,
|
|
2581
2588
|
operator: c.operator,
|
|
2582
2589
|
stacked: c.stacked
|
|
2583
2590
|
});
|
|
2584
2591
|
});
|
|
2585
2592
|
} else {
|
|
2586
|
-
const
|
|
2593
|
+
const w = N({
|
|
2587
2594
|
entries: y,
|
|
2588
2595
|
fields: e,
|
|
2589
2596
|
fieldName: c.name
|
|
2590
2597
|
}), F = V({
|
|
2591
|
-
values:
|
|
2598
|
+
values: w,
|
|
2592
2599
|
operator: c.operator
|
|
2593
2600
|
});
|
|
2594
2601
|
a.push({
|
|
2595
2602
|
x: p || !1,
|
|
2596
2603
|
value: F,
|
|
2597
|
-
type:
|
|
2604
|
+
type: he({
|
|
2598
2605
|
yAxis: c,
|
|
2599
2606
|
fields: e
|
|
2600
2607
|
}),
|
|
@@ -2612,7 +2619,7 @@ const yt = {
|
|
|
2612
2619
|
(c) => c.x !== !1
|
|
2613
2620
|
));
|
|
2614
2621
|
let u = h;
|
|
2615
|
-
i.timerange ? u =
|
|
2622
|
+
i.timerange ? u = ht({
|
|
2616
2623
|
values: u,
|
|
2617
2624
|
timerange: i.timerange,
|
|
2618
2625
|
interval: i.interval
|
|
@@ -2625,7 +2632,7 @@ const yt = {
|
|
|
2625
2632
|
if (i.type === "line" && i.y_range && (g.yAxisOpts = {
|
|
2626
2633
|
mode: i.y_range
|
|
2627
2634
|
}, i.y_range === "auto")) {
|
|
2628
|
-
const { min: c, max: m } =
|
|
2635
|
+
const { min: c, max: m } = _e(u);
|
|
2629
2636
|
g.yAxisOpts.valueOpts = { min: c, max: m };
|
|
2630
2637
|
}
|
|
2631
2638
|
return g;
|
|
@@ -2694,21 +2701,21 @@ function A({
|
|
|
2694
2701
|
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
|
|
2695
2702
|
}), s;
|
|
2696
2703
|
}
|
|
2697
|
-
function
|
|
2704
|
+
function wt(i) {
|
|
2698
2705
|
let t = [];
|
|
2699
2706
|
return Object.keys(i).forEach((e) => {
|
|
2700
2707
|
const s = i[e];
|
|
2701
2708
|
t = t.concat(s.entries);
|
|
2702
2709
|
}), t;
|
|
2703
2710
|
}
|
|
2704
|
-
function
|
|
2711
|
+
function he({
|
|
2705
2712
|
yAxis: i,
|
|
2706
2713
|
fields: t
|
|
2707
2714
|
}) {
|
|
2708
2715
|
const e = t[i.name];
|
|
2709
2716
|
return e != null && e.string ? e.string : i.name;
|
|
2710
2717
|
}
|
|
2711
|
-
function
|
|
2718
|
+
function _e(i, t = 0.1) {
|
|
2712
2719
|
if (i.length === 0)
|
|
2713
2720
|
throw new Error("The values array cannot be empty.");
|
|
2714
2721
|
const e = i.map((l) => l.value), s = Math.min(...e), r = Math.max(...e), a = (r - s) * t;
|
|
@@ -2717,82 +2724,82 @@ function he(i, t = 0.1) {
|
|
|
2717
2724
|
max: r + a
|
|
2718
2725
|
};
|
|
2719
2726
|
}
|
|
2720
|
-
const
|
|
2727
|
+
const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2721
2728
|
__proto__: null,
|
|
2722
|
-
getAllObjectsInGroupedValues:
|
|
2723
|
-
getMinMax:
|
|
2729
|
+
getAllObjectsInGroupedValues: wt,
|
|
2730
|
+
getMinMax: _e,
|
|
2724
2731
|
getValueForOperator: V,
|
|
2725
2732
|
getValuesForYField: N,
|
|
2726
2733
|
getValuesGroupedByField: A,
|
|
2727
|
-
getYAxisFieldname:
|
|
2728
|
-
labelsForOperator:
|
|
2729
|
-
processGraphData:
|
|
2734
|
+
getYAxisFieldname: he,
|
|
2735
|
+
labelsForOperator: pt,
|
|
2736
|
+
processGraphData: xt
|
|
2730
2737
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2731
2738
|
export {
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2739
|
+
Xe as Alert,
|
|
2740
|
+
ke as Avatar,
|
|
2741
|
+
Ne as Binary,
|
|
2742
|
+
ee as Boolean,
|
|
2743
|
+
Z as Button,
|
|
2737
2744
|
Te as ButtonGroup,
|
|
2738
2745
|
q as Char,
|
|
2739
|
-
|
|
2740
|
-
|
|
2746
|
+
se as CodeEditor,
|
|
2747
|
+
Ue as Comments,
|
|
2741
2748
|
z as Container,
|
|
2742
2749
|
v as ContainerWidget,
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2750
|
+
St as Dashboard,
|
|
2751
|
+
rt as DashboardItem,
|
|
2752
|
+
Ye as Date,
|
|
2753
|
+
De as DateTime,
|
|
2754
|
+
Ke as Email,
|
|
2748
2755
|
f as Field,
|
|
2749
2756
|
G as Float,
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2757
|
+
Se as FloatTime,
|
|
2758
|
+
Pt as Form,
|
|
2759
|
+
le as Graph,
|
|
2760
|
+
ce as GraphAxis,
|
|
2754
2761
|
j as GraphChart,
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2762
|
+
oe as GraphIndicator,
|
|
2763
|
+
at as GraphIndicatorField,
|
|
2764
|
+
dt as GraphXAxis,
|
|
2765
|
+
ct as GraphYAxis,
|
|
2766
|
+
Pe as Group,
|
|
2767
|
+
ze as HTMLPreview,
|
|
2768
|
+
Ae as Image,
|
|
2769
|
+
Ge as Indicator,
|
|
2770
|
+
Ie as Integer,
|
|
2764
2771
|
J as JSONField,
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2772
|
+
K as Label,
|
|
2773
|
+
We as Many2one,
|
|
2774
|
+
Ee as Markdown,
|
|
2775
|
+
ie as MultiCheckbox,
|
|
2776
|
+
U as NewLine,
|
|
2770
2777
|
M as Notebook,
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
+
te as One2many,
|
|
2779
|
+
Oe as Page,
|
|
2780
|
+
Ve as ProgressBar,
|
|
2781
|
+
qe as Radio,
|
|
2782
|
+
Me as Reference,
|
|
2783
|
+
nt as SearchFieldTypes,
|
|
2784
|
+
Wt as SearchFilter,
|
|
2778
2785
|
W as Selection,
|
|
2779
|
-
|
|
2786
|
+
je as Separator,
|
|
2780
2787
|
B as Spinner,
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2788
|
+
He as Steps,
|
|
2789
|
+
Je as Switch,
|
|
2790
|
+
$e as Tag,
|
|
2791
|
+
Re as Tags,
|
|
2785
2792
|
L as Text,
|
|
2786
|
-
|
|
2787
|
-
|
|
2793
|
+
Qe as Time,
|
|
2794
|
+
Le as Timeline,
|
|
2788
2795
|
Tt as Tree,
|
|
2789
2796
|
C as Widget,
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
+
Vt as graphFieldUtils,
|
|
2798
|
+
Yt as graphProcessor,
|
|
2799
|
+
ne as parseContext,
|
|
2800
|
+
Ot as parseContextFields,
|
|
2801
|
+
It as parseDomainFields,
|
|
2802
|
+
zt as parseGraph,
|
|
2803
|
+
Et as transformDomainForChildWidget
|
|
2797
2804
|
};
|
|
2798
2805
|
//# sourceMappingURL=ooui.es.js.map
|