@gisce/ooui 2.29.0 → 2.29.1
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/helpers/attributeParser.d.ts.map +1 -1
- package/dist/ooui.es.js +101 -96
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/attributeParser.ts +12 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributeParser.d.ts","sourceRoot":"","sources":["../../src/helpers/attributeParser.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM,WAAW,MAAM,GAAG,OAAO,GAAG,MAAM,YAGtD,CAAC;AAuDF,QAAA,MAAM,eAAe,WAAY,MAAM,KAAG,MAEzC,CAAC;AAwHF,eAAO,MAAM,gBAAgB,iBAAkB,MAAM,GAAG,MAAM,KAAG,MAchE,CAAC;AAEF,eAAO,MAAM,mBAAmB;WAMvB,MAAM;YACL,GAAG;YACH,GAAG;;6BAkDZ,CAAC;AAEF,QAAA,MAAM,kBAAkB;mBAOP,GAAG;YACV,GAAG;YACH,GAAG;;;
|
|
1
|
+
{"version":3,"file":"attributeParser.d.ts","sourceRoot":"","sources":["../../src/helpers/attributeParser.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM,WAAW,MAAM,GAAG,OAAO,GAAG,MAAM,YAGtD,CAAC;AAuDF,QAAA,MAAM,eAAe,WAAY,MAAM,KAAG,MAEzC,CAAC;AAwHF,eAAO,MAAM,gBAAgB,iBAAkB,MAAM,GAAG,MAAM,KAAG,MAchE,CAAC;AAEF,eAAO,MAAM,mBAAmB;WAMvB,MAAM;YACL,GAAG;YACH,GAAG;;6BAkDZ,CAAC;AAEF,QAAA,MAAM,kBAAkB;mBAOP,GAAG;YACV,GAAG;YACH,GAAG;;;SAyCZ,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,CAAC"}
|
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
|
|
1
|
+
var be = Object.defineProperty;
|
|
2
|
+
var ye = (i, t, e) => t in i ? be(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var n = (i, t, e) => (ye(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { decode as pe } from "html-entities";
|
|
5
|
+
import { evaluateCondition as xe } from "@gisce/conscheck";
|
|
6
6
|
import * as D from "txml";
|
|
7
7
|
import W from "moment";
|
|
8
|
-
const
|
|
8
|
+
const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve = ({
|
|
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 = X({
|
|
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) => pe(i, { level: "xml" }), X = ({
|
|
45
45
|
fieldName: i,
|
|
46
46
|
valueInObject: t,
|
|
47
47
|
expectedValue: e,
|
|
@@ -61,7 +61,7 @@ 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 === void 0 ? r.modifiedValueInObject = !1 : Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] !== void 0 && (r.modifiedValueInObject = r.modifiedValueInObject[0]), r.modifiedValueInObject === null && (r.modifiedValueInObject = !1)), 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
|
+
}, J = ({
|
|
65
65
|
attrs: i,
|
|
66
66
|
values: t,
|
|
67
67
|
fields: e,
|
|
@@ -69,11 +69,11 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
69
69
|
}) => {
|
|
70
70
|
const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(u), h = JSON.parse(_), d = {};
|
|
71
71
|
for (const g of Object.keys(h)) {
|
|
72
|
-
const p = h[g].map((y) =>
|
|
72
|
+
const p = h[g].map((y) => ve({ entry: y, values: t, fields: e })).every((y) => y);
|
|
73
73
|
p ? d[g] = !0 : g === "readonly" && !p && s === "button" && (d[g] = !1);
|
|
74
74
|
}
|
|
75
75
|
return d;
|
|
76
|
-
},
|
|
76
|
+
}, U = (i) => {
|
|
77
77
|
if (i === void 0)
|
|
78
78
|
return {};
|
|
79
79
|
if (typeof i == "string")
|
|
@@ -95,14 +95,14 @@ 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 u =
|
|
98
|
+
const u = xe({
|
|
99
99
|
object: t,
|
|
100
100
|
condition: a[o],
|
|
101
101
|
evaluateFieldComparison: ({
|
|
102
102
|
fieldName: _,
|
|
103
103
|
valueInObject: h,
|
|
104
104
|
expectedValue: d
|
|
105
|
-
}) =>
|
|
105
|
+
}) => X({
|
|
106
106
|
fieldName: _,
|
|
107
107
|
valueInObject: h,
|
|
108
108
|
expectedValue: d,
|
|
@@ -124,13 +124,8 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
124
124
|
widgetType: s,
|
|
125
125
|
fallbackMode: r = !0
|
|
126
126
|
}) => {
|
|
127
|
-
let a = {}
|
|
128
|
-
if (i.
|
|
129
|
-
attrs: i.attrs,
|
|
130
|
-
values: t,
|
|
131
|
-
fields: e,
|
|
132
|
-
widgetType: s
|
|
133
|
-
})), i.json_attrs)
|
|
127
|
+
let a = {};
|
|
128
|
+
if (i.json_attrs)
|
|
134
129
|
try {
|
|
135
130
|
a = Fe({
|
|
136
131
|
attrs: i.json_attrs,
|
|
@@ -138,14 +133,24 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
138
133
|
fields: e,
|
|
139
134
|
widgetType: s
|
|
140
135
|
});
|
|
141
|
-
} catch (
|
|
136
|
+
} catch (l) {
|
|
142
137
|
if (r && i.attrs)
|
|
143
|
-
a =
|
|
138
|
+
a = J({
|
|
139
|
+
attrs: i.attrs,
|
|
140
|
+
values: t,
|
|
141
|
+
fields: e,
|
|
142
|
+
widgetType: s
|
|
143
|
+
});
|
|
144
144
|
else
|
|
145
|
-
throw
|
|
145
|
+
throw l;
|
|
146
146
|
}
|
|
147
147
|
else
|
|
148
|
-
i.attrs && (a =
|
|
148
|
+
i.attrs && (a = J({
|
|
149
|
+
attrs: i.attrs,
|
|
150
|
+
values: t,
|
|
151
|
+
fields: e,
|
|
152
|
+
widgetType: s
|
|
153
|
+
}));
|
|
149
154
|
return {
|
|
150
155
|
...i,
|
|
151
156
|
...a,
|
|
@@ -188,7 +193,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
188
193
|
* Base type of the field
|
|
189
194
|
*/
|
|
190
195
|
n(this, "_fieldType", "");
|
|
191
|
-
this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = T(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 =
|
|
196
|
+
this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = T(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 = U(t.widget_props)), t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function));
|
|
192
197
|
}
|
|
193
198
|
static get defaultColspan() {
|
|
194
199
|
return k._defaultColspan;
|
|
@@ -307,7 +312,7 @@ class f extends C {
|
|
|
307
312
|
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
308
313
|
n(this, "_autoRefresh", !1);
|
|
309
314
|
n(this, "_raw_props");
|
|
310
|
-
this._activated = !0, e && (this._raw_props = 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 =
|
|
315
|
+
this._activated = !0, e && (this._raw_props = 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 = we(e.help_inline)), e.autorefresh && (this.autoRefresh = T(e.autorefresh)));
|
|
311
316
|
}
|
|
312
317
|
get id() {
|
|
313
318
|
return this._id;
|
|
@@ -394,12 +399,12 @@ class f extends C {
|
|
|
394
399
|
}
|
|
395
400
|
class ke extends f {
|
|
396
401
|
}
|
|
397
|
-
class
|
|
402
|
+
class K extends C {
|
|
398
403
|
findById(t) {
|
|
399
404
|
return null;
|
|
400
405
|
}
|
|
401
406
|
}
|
|
402
|
-
class
|
|
407
|
+
class Z extends f {
|
|
403
408
|
constructor(e) {
|
|
404
409
|
super({ ...e, nolabel: !0 });
|
|
405
410
|
/**
|
|
@@ -526,13 +531,13 @@ class V {
|
|
|
526
531
|
}
|
|
527
532
|
addWidget(t, e) {
|
|
528
533
|
const s = [], r = e ? e.addLabel : !0;
|
|
529
|
-
if (t instanceof
|
|
534
|
+
if (t instanceof K) {
|
|
530
535
|
this._rows.push([]), this._index++;
|
|
531
536
|
return;
|
|
532
537
|
}
|
|
533
538
|
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof f && !t.nolabel) {
|
|
534
539
|
t.colspan > 1 && (t.colspan -= 1);
|
|
535
|
-
const l = new
|
|
540
|
+
const l = new Z({
|
|
536
541
|
name: t.id + "_label",
|
|
537
542
|
string: t.label,
|
|
538
543
|
invisible: t.invisible,
|
|
@@ -712,7 +717,7 @@ class Pe extends L {
|
|
|
712
717
|
this._height = e;
|
|
713
718
|
}
|
|
714
719
|
}
|
|
715
|
-
class
|
|
720
|
+
class ee extends f {
|
|
716
721
|
constructor(e) {
|
|
717
722
|
super({
|
|
718
723
|
...e,
|
|
@@ -966,7 +971,7 @@ class We extends f {
|
|
|
966
971
|
}
|
|
967
972
|
class Ie extends G {
|
|
968
973
|
}
|
|
969
|
-
class
|
|
974
|
+
class te extends f {
|
|
970
975
|
constructor(t) {
|
|
971
976
|
super(t);
|
|
972
977
|
}
|
|
@@ -1025,7 +1030,7 @@ class De extends f {
|
|
|
1025
1030
|
super(t);
|
|
1026
1031
|
}
|
|
1027
1032
|
}
|
|
1028
|
-
class
|
|
1033
|
+
class ie extends f {
|
|
1029
1034
|
constructor(e) {
|
|
1030
1035
|
super(e);
|
|
1031
1036
|
/**
|
|
@@ -1174,7 +1179,7 @@ class Be extends f {
|
|
|
1174
1179
|
super(t);
|
|
1175
1180
|
}
|
|
1176
1181
|
}
|
|
1177
|
-
class Le extends
|
|
1182
|
+
class Le extends ie {
|
|
1178
1183
|
constructor(e) {
|
|
1179
1184
|
super(e);
|
|
1180
1185
|
/**
|
|
@@ -1256,7 +1261,7 @@ class Ge extends I {
|
|
|
1256
1261
|
this._height = e;
|
|
1257
1262
|
}
|
|
1258
1263
|
}
|
|
1259
|
-
class
|
|
1264
|
+
class se extends f {
|
|
1260
1265
|
constructor(e) {
|
|
1261
1266
|
super(e);
|
|
1262
1267
|
/**
|
|
@@ -1309,7 +1314,7 @@ class ie extends f {
|
|
|
1309
1314
|
this._columns = e;
|
|
1310
1315
|
}
|
|
1311
1316
|
}
|
|
1312
|
-
class Re extends
|
|
1317
|
+
class Re extends se {
|
|
1313
1318
|
}
|
|
1314
1319
|
class $e extends I {
|
|
1315
1320
|
get colors() {
|
|
@@ -1336,7 +1341,7 @@ class qe extends I {
|
|
|
1336
1341
|
this._direction = e;
|
|
1337
1342
|
}
|
|
1338
1343
|
}
|
|
1339
|
-
class Je extends
|
|
1344
|
+
class Je extends te {
|
|
1340
1345
|
}
|
|
1341
1346
|
class He extends f {
|
|
1342
1347
|
constructor(e) {
|
|
@@ -1368,7 +1373,7 @@ class He extends f {
|
|
|
1368
1373
|
this._lastStep = e;
|
|
1369
1374
|
}
|
|
1370
1375
|
}
|
|
1371
|
-
class
|
|
1376
|
+
class ne extends G {
|
|
1372
1377
|
constructor(e) {
|
|
1373
1378
|
super(e);
|
|
1374
1379
|
n(this, "_lang", null);
|
|
@@ -1445,7 +1450,7 @@ class Ue extends f {
|
|
|
1445
1450
|
this._height = e;
|
|
1446
1451
|
}
|
|
1447
1452
|
}
|
|
1448
|
-
class
|
|
1453
|
+
class H extends ne {
|
|
1449
1454
|
constructor() {
|
|
1450
1455
|
super(...arguments);
|
|
1451
1456
|
n(this, "_lang", "json");
|
|
@@ -1511,7 +1516,7 @@ class $ {
|
|
|
1511
1516
|
this._widgetClass = Pe;
|
|
1512
1517
|
break;
|
|
1513
1518
|
case "label":
|
|
1514
|
-
this._widgetClass =
|
|
1519
|
+
this._widgetClass = Z;
|
|
1515
1520
|
break;
|
|
1516
1521
|
case "char":
|
|
1517
1522
|
this._widgetClass = A;
|
|
@@ -1520,7 +1525,7 @@ class $ {
|
|
|
1520
1525
|
this._widgetClass = G;
|
|
1521
1526
|
break;
|
|
1522
1527
|
case "button":
|
|
1523
|
-
this._widgetClass =
|
|
1528
|
+
this._widgetClass = ee;
|
|
1524
1529
|
break;
|
|
1525
1530
|
case "buttonGroup":
|
|
1526
1531
|
this._widgetClass = Te;
|
|
@@ -1532,7 +1537,7 @@ class $ {
|
|
|
1532
1537
|
this._widgetClass = We;
|
|
1533
1538
|
break;
|
|
1534
1539
|
case "boolean":
|
|
1535
|
-
this._widgetClass =
|
|
1540
|
+
this._widgetClass = te;
|
|
1536
1541
|
break;
|
|
1537
1542
|
case "integer":
|
|
1538
1543
|
this._widgetClass = Ee;
|
|
@@ -1558,10 +1563,10 @@ class $ {
|
|
|
1558
1563
|
case "many2many":
|
|
1559
1564
|
case "one2many":
|
|
1560
1565
|
case "one2many_list":
|
|
1561
|
-
this._widgetClass =
|
|
1566
|
+
this._widgetClass = ie;
|
|
1562
1567
|
break;
|
|
1563
1568
|
case "newline":
|
|
1564
|
-
this._widgetClass =
|
|
1569
|
+
this._widgetClass = K;
|
|
1565
1570
|
break;
|
|
1566
1571
|
case "separator":
|
|
1567
1572
|
this._widgetClass = je;
|
|
@@ -1603,7 +1608,7 @@ class $ {
|
|
|
1603
1608
|
this._widgetClass = qe;
|
|
1604
1609
|
break;
|
|
1605
1610
|
case "multicheckbox":
|
|
1606
|
-
this._widgetClass =
|
|
1611
|
+
this._widgetClass = se;
|
|
1607
1612
|
break;
|
|
1608
1613
|
case "switch":
|
|
1609
1614
|
this._widgetClass = Je;
|
|
@@ -1612,7 +1617,7 @@ class $ {
|
|
|
1612
1617
|
this._widgetClass = He;
|
|
1613
1618
|
break;
|
|
1614
1619
|
case "codeeditor":
|
|
1615
|
-
this._widgetClass =
|
|
1620
|
+
this._widgetClass = ne;
|
|
1616
1621
|
break;
|
|
1617
1622
|
case "time":
|
|
1618
1623
|
this._widgetClass = Qe;
|
|
@@ -1627,10 +1632,10 @@ class $ {
|
|
|
1627
1632
|
this._widgetClass = Ue;
|
|
1628
1633
|
break;
|
|
1629
1634
|
case "json":
|
|
1630
|
-
this._widgetClass =
|
|
1635
|
+
this._widgetClass = H;
|
|
1631
1636
|
break;
|
|
1632
1637
|
case "arrow_steps":
|
|
1633
|
-
this._widgetClass =
|
|
1638
|
+
this._widgetClass = H;
|
|
1634
1639
|
break;
|
|
1635
1640
|
case "spinner":
|
|
1636
1641
|
this._widgetClass = L;
|
|
@@ -1705,7 +1710,7 @@ function st({
|
|
|
1705
1710
|
const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
|
|
1706
1711
|
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);
|
|
1707
1712
|
}
|
|
1708
|
-
const
|
|
1713
|
+
const re = ({
|
|
1709
1714
|
context: i,
|
|
1710
1715
|
values: t,
|
|
1711
1716
|
fields: e
|
|
@@ -1713,9 +1718,9 @@ const ne = ({
|
|
|
1713
1718
|
try {
|
|
1714
1719
|
if (!i)
|
|
1715
1720
|
return;
|
|
1716
|
-
if (
|
|
1721
|
+
if (le(i) || typeof i != "string")
|
|
1717
1722
|
return i;
|
|
1718
|
-
const s =
|
|
1723
|
+
const s = ae(i);
|
|
1719
1724
|
if (s !== null)
|
|
1720
1725
|
return s;
|
|
1721
1726
|
if (i.trim().length === 0)
|
|
@@ -1742,21 +1747,21 @@ const ne = ({
|
|
|
1742
1747
|
}, Tt = (i) => {
|
|
1743
1748
|
const t = [];
|
|
1744
1749
|
try {
|
|
1745
|
-
return !i ||
|
|
1750
|
+
return !i || le(i) || typeof i != "string" ? t : ae(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) => {
|
|
1746
1751
|
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1747
1752
|
}), t);
|
|
1748
1753
|
} catch {
|
|
1749
1754
|
}
|
|
1750
1755
|
return t;
|
|
1751
1756
|
};
|
|
1752
|
-
function
|
|
1757
|
+
function ae(i) {
|
|
1753
1758
|
try {
|
|
1754
1759
|
return JSON.parse(i.replace(/'/g, '"'));
|
|
1755
1760
|
} catch {
|
|
1756
1761
|
return null;
|
|
1757
1762
|
}
|
|
1758
1763
|
}
|
|
1759
|
-
function
|
|
1764
|
+
function le(i) {
|
|
1760
1765
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1761
1766
|
}
|
|
1762
1767
|
const nt = (i) => {
|
|
@@ -1920,7 +1925,7 @@ class Wt {
|
|
|
1920
1925
|
`Field ${x} doesn't exist in fields defintion`
|
|
1921
1926
|
);
|
|
1922
1927
|
_ = this._fields[x].type, o.widget_props = {
|
|
1923
|
-
...
|
|
1928
|
+
...U(o.widget_props),
|
|
1924
1929
|
...this._fields[x].widget_props || {}
|
|
1925
1930
|
};
|
|
1926
1931
|
}
|
|
@@ -1945,7 +1950,7 @@ class Wt {
|
|
|
1945
1950
|
values: s,
|
|
1946
1951
|
fields: this._fields
|
|
1947
1952
|
});
|
|
1948
|
-
const c =
|
|
1953
|
+
const c = re({
|
|
1949
1954
|
context: h.context || ((v = this._fields[h.name]) == null ? void 0 : v.context),
|
|
1950
1955
|
values: s,
|
|
1951
1956
|
fields: this._fields
|
|
@@ -1954,7 +1959,7 @@ class Wt {
|
|
|
1954
1959
|
h.on_change
|
|
1955
1960
|
));
|
|
1956
1961
|
let m;
|
|
1957
|
-
|
|
1962
|
+
Q(h.domain) ? m = h.domain : Q((F = this._fields[h.name]) == null ? void 0 : F.domain) && (m = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1958
1963
|
const p = {
|
|
1959
1964
|
...d,
|
|
1960
1965
|
...g,
|
|
@@ -1968,7 +1973,7 @@ class Wt {
|
|
|
1968
1973
|
fields: u,
|
|
1969
1974
|
container: y.container,
|
|
1970
1975
|
values: s
|
|
1971
|
-
}), y instanceof
|
|
1976
|
+
}), y instanceof ee && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
1972
1977
|
});
|
|
1973
1978
|
}
|
|
1974
1979
|
/**
|
|
@@ -1979,7 +1984,7 @@ class Wt {
|
|
|
1979
1984
|
return this.container.findById(t);
|
|
1980
1985
|
}
|
|
1981
1986
|
}
|
|
1982
|
-
function
|
|
1987
|
+
function Q(i) {
|
|
1983
1988
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1984
1989
|
}
|
|
1985
1990
|
class It {
|
|
@@ -2068,7 +2073,7 @@ class It {
|
|
|
2068
2073
|
throw new Error(`Field ${u} doesn't exist in fields defintion`);
|
|
2069
2074
|
const d = this._fields[u];
|
|
2070
2075
|
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;
|
|
2071
|
-
const g =
|
|
2076
|
+
const g = re({
|
|
2072
2077
|
context: l.context || d.context,
|
|
2073
2078
|
values: {},
|
|
2074
2079
|
fields: this._fields
|
|
@@ -2215,7 +2220,7 @@ class Vt {
|
|
|
2215
2220
|
return this._items;
|
|
2216
2221
|
}
|
|
2217
2222
|
}
|
|
2218
|
-
class
|
|
2223
|
+
class oe {
|
|
2219
2224
|
constructor(t) {
|
|
2220
2225
|
n(this, "_string", null);
|
|
2221
2226
|
n(this, "_type");
|
|
@@ -2243,7 +2248,7 @@ class le {
|
|
|
2243
2248
|
return this._y_range;
|
|
2244
2249
|
}
|
|
2245
2250
|
}
|
|
2246
|
-
class
|
|
2251
|
+
class ce extends oe {
|
|
2247
2252
|
constructor(e, s) {
|
|
2248
2253
|
super(s);
|
|
2249
2254
|
n(this, "_color", null);
|
|
@@ -2269,7 +2274,7 @@ class oe extends le {
|
|
|
2269
2274
|
return this._suffix;
|
|
2270
2275
|
}
|
|
2271
2276
|
}
|
|
2272
|
-
class ot extends
|
|
2277
|
+
class ot extends ce {
|
|
2273
2278
|
constructor(e, s) {
|
|
2274
2279
|
super(e, s);
|
|
2275
2280
|
n(this, "_field");
|
|
@@ -2319,7 +2324,7 @@ const ct = (i) => {
|
|
|
2319
2324
|
y: t
|
|
2320
2325
|
};
|
|
2321
2326
|
};
|
|
2322
|
-
class j extends
|
|
2327
|
+
class j extends oe {
|
|
2323
2328
|
constructor(e, s) {
|
|
2324
2329
|
super(s);
|
|
2325
2330
|
n(this, "_x");
|
|
@@ -2336,7 +2341,7 @@ class j extends le {
|
|
|
2336
2341
|
}
|
|
2337
2342
|
}
|
|
2338
2343
|
const ut = {
|
|
2339
|
-
indicator:
|
|
2344
|
+
indicator: ce,
|
|
2340
2345
|
indicatorField: ot,
|
|
2341
2346
|
line: j,
|
|
2342
2347
|
bar: j,
|
|
@@ -2350,7 +2355,7 @@ const ut = {
|
|
|
2350
2355
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2351
2356
|
return new s(e, t);
|
|
2352
2357
|
};
|
|
2353
|
-
class
|
|
2358
|
+
class ue {
|
|
2354
2359
|
constructor({ name: t, axis: e }) {
|
|
2355
2360
|
n(this, "_name");
|
|
2356
2361
|
n(this, "_axis");
|
|
@@ -2363,7 +2368,7 @@ class ce {
|
|
|
2363
2368
|
return this._axis;
|
|
2364
2369
|
}
|
|
2365
2370
|
}
|
|
2366
|
-
class dt extends
|
|
2371
|
+
class dt extends ue {
|
|
2367
2372
|
constructor({
|
|
2368
2373
|
name: e,
|
|
2369
2374
|
operator: s,
|
|
@@ -2386,7 +2391,7 @@ class dt extends ce {
|
|
|
2386
2391
|
return this._stacked;
|
|
2387
2392
|
}
|
|
2388
2393
|
}
|
|
2389
|
-
class ht extends
|
|
2394
|
+
class ht extends ue {
|
|
2390
2395
|
constructor({ name: t }) {
|
|
2391
2396
|
super({ name: t, axis: "x" });
|
|
2392
2397
|
}
|
|
@@ -2439,7 +2444,7 @@ function gt({
|
|
|
2439
2444
|
interval: e = 1
|
|
2440
2445
|
}) {
|
|
2441
2446
|
let s = [];
|
|
2442
|
-
const r =
|
|
2447
|
+
const r = he({
|
|
2443
2448
|
values: i,
|
|
2444
2449
|
groupBy: "type-stacked"
|
|
2445
2450
|
}), a = `${t}s`;
|
|
@@ -2450,7 +2455,7 @@ function gt({
|
|
|
2450
2455
|
if (s.push(h), _ === u.length - 1)
|
|
2451
2456
|
return;
|
|
2452
2457
|
const d = h.x, g = u[_ + 1].x;
|
|
2453
|
-
if (!
|
|
2458
|
+
if (!de([d, g], a)) {
|
|
2454
2459
|
const c = mt({
|
|
2455
2460
|
dates: [d, g],
|
|
2456
2461
|
timerange: t,
|
|
@@ -2479,7 +2484,7 @@ function mt({
|
|
|
2479
2484
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2480
2485
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2481
2486
|
const o = a[l], u = a[l + 1];
|
|
2482
|
-
if (!
|
|
2487
|
+
if (!de([o, u], r)) {
|
|
2483
2488
|
const _ = W(o, z(r)).add(
|
|
2484
2489
|
e,
|
|
2485
2490
|
r
|
|
@@ -2497,7 +2502,7 @@ function bt({
|
|
|
2497
2502
|
const e = yt({
|
|
2498
2503
|
values: i,
|
|
2499
2504
|
timerange: t
|
|
2500
|
-
}), s = [], r =
|
|
2505
|
+
}), s = [], r = he({
|
|
2501
2506
|
values: e,
|
|
2502
2507
|
groupBy: "all"
|
|
2503
2508
|
});
|
|
@@ -2557,7 +2562,7 @@ function pt({
|
|
|
2557
2562
|
function xt(i) {
|
|
2558
2563
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2559
2564
|
}
|
|
2560
|
-
function
|
|
2565
|
+
function de(i, t) {
|
|
2561
2566
|
let e = !1;
|
|
2562
2567
|
const s = z(t);
|
|
2563
2568
|
if (i.length === 0)
|
|
@@ -2570,7 +2575,7 @@ function ue(i, t) {
|
|
|
2570
2575
|
}
|
|
2571
2576
|
return e;
|
|
2572
2577
|
}
|
|
2573
|
-
function
|
|
2578
|
+
function he({
|
|
2574
2579
|
values: i,
|
|
2575
2580
|
groupBy: t
|
|
2576
2581
|
}) {
|
|
@@ -2624,17 +2629,17 @@ const wt = {
|
|
|
2624
2629
|
fields: e
|
|
2625
2630
|
});
|
|
2626
2631
|
Object.keys(v).forEach((F) => {
|
|
2627
|
-
const x = v[F].entries, E = v[F].label,
|
|
2632
|
+
const x = v[F].entries, E = v[F].label, ge = N({
|
|
2628
2633
|
entries: x,
|
|
2629
2634
|
fields: e,
|
|
2630
2635
|
fieldName: c.name
|
|
2631
|
-
}),
|
|
2632
|
-
values:
|
|
2636
|
+
}), me = Y({
|
|
2637
|
+
values: ge,
|
|
2633
2638
|
operator: c.operator
|
|
2634
2639
|
});
|
|
2635
2640
|
a.push({
|
|
2636
2641
|
x: p || !1,
|
|
2637
|
-
value:
|
|
2642
|
+
value: me,
|
|
2638
2643
|
type: E,
|
|
2639
2644
|
operator: c.operator,
|
|
2640
2645
|
stacked: c.stacked
|
|
@@ -2652,7 +2657,7 @@ const wt = {
|
|
|
2652
2657
|
a.push({
|
|
2653
2658
|
x: p || !1,
|
|
2654
2659
|
value: F,
|
|
2655
|
-
type:
|
|
2660
|
+
type: _e({
|
|
2656
2661
|
yAxis: c,
|
|
2657
2662
|
fields: e
|
|
2658
2663
|
}),
|
|
@@ -2683,7 +2688,7 @@ const wt = {
|
|
|
2683
2688
|
if (i.type === "line" && i.y_range && (g.yAxisOpts = {
|
|
2684
2689
|
mode: i.y_range
|
|
2685
2690
|
}, i.y_range === "auto")) {
|
|
2686
|
-
const { min: c, max: m } =
|
|
2691
|
+
const { min: c, max: m } = fe(d);
|
|
2687
2692
|
g.yAxisOpts.valueOpts = { min: c, max: m };
|
|
2688
2693
|
}
|
|
2689
2694
|
return g;
|
|
@@ -2759,14 +2764,14 @@ function Ft(i) {
|
|
|
2759
2764
|
t = t.concat(s.entries);
|
|
2760
2765
|
}), t;
|
|
2761
2766
|
}
|
|
2762
|
-
function
|
|
2767
|
+
function _e({
|
|
2763
2768
|
yAxis: i,
|
|
2764
2769
|
fields: t
|
|
2765
2770
|
}) {
|
|
2766
2771
|
const e = t[i.name];
|
|
2767
2772
|
return e != null && e.string ? e.string : i.name;
|
|
2768
2773
|
}
|
|
2769
|
-
function
|
|
2774
|
+
function fe(i, t = 0.1) {
|
|
2770
2775
|
if (i.length === 0)
|
|
2771
2776
|
throw new Error("The values array cannot be empty.");
|
|
2772
2777
|
const e = i.map((l) => l.value), s = Math.min(...e), r = Math.max(...e), a = (r - s) * t;
|
|
@@ -2778,11 +2783,11 @@ function _e(i, t = 0.1) {
|
|
|
2778
2783
|
const jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2779
2784
|
__proto__: null,
|
|
2780
2785
|
getAllObjectsInGroupedValues: Ft,
|
|
2781
|
-
getMinMax:
|
|
2786
|
+
getMinMax: fe,
|
|
2782
2787
|
getValueForOperator: Y,
|
|
2783
2788
|
getValuesForYField: N,
|
|
2784
2789
|
getValuesGroupedByField: B,
|
|
2785
|
-
getYAxisFieldname:
|
|
2790
|
+
getYAxisFieldname: _e,
|
|
2786
2791
|
labelsForOperator: wt,
|
|
2787
2792
|
processGraphData: vt
|
|
2788
2793
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -2790,12 +2795,12 @@ export {
|
|
|
2790
2795
|
Xe as Alert,
|
|
2791
2796
|
ke as Avatar,
|
|
2792
2797
|
Ae as Binary,
|
|
2793
|
-
|
|
2794
|
-
|
|
2798
|
+
te as Boolean,
|
|
2799
|
+
ee as Button,
|
|
2795
2800
|
Te as ButtonGroup,
|
|
2796
2801
|
Ze as Carousel,
|
|
2797
2802
|
A as Char,
|
|
2798
|
-
|
|
2803
|
+
ne as CodeEditor,
|
|
2799
2804
|
et as ColorPicker,
|
|
2800
2805
|
Ue as Comments,
|
|
2801
2806
|
V as Container,
|
|
@@ -2809,10 +2814,10 @@ export {
|
|
|
2809
2814
|
R as Float,
|
|
2810
2815
|
Se as FloatTime,
|
|
2811
2816
|
Wt as Form,
|
|
2812
|
-
|
|
2813
|
-
|
|
2817
|
+
oe as Graph,
|
|
2818
|
+
ue as GraphAxis,
|
|
2814
2819
|
j as GraphChart,
|
|
2815
|
-
|
|
2820
|
+
ce as GraphIndicator,
|
|
2816
2821
|
ot as GraphIndicatorField,
|
|
2817
2822
|
ht as GraphXAxis,
|
|
2818
2823
|
dt as GraphYAxis,
|
|
@@ -2821,14 +2826,14 @@ export {
|
|
|
2821
2826
|
Ne as Image,
|
|
2822
2827
|
Ge as Indicator,
|
|
2823
2828
|
Ee as Integer,
|
|
2824
|
-
|
|
2825
|
-
|
|
2829
|
+
H as JSONField,
|
|
2830
|
+
Z as Label,
|
|
2826
2831
|
We as Many2one,
|
|
2827
2832
|
Ie as Markdown,
|
|
2828
|
-
|
|
2829
|
-
|
|
2833
|
+
se as MultiCheckbox,
|
|
2834
|
+
K as NewLine,
|
|
2830
2835
|
M as Notebook,
|
|
2831
|
-
|
|
2836
|
+
ie as One2many,
|
|
2832
2837
|
Oe as Page,
|
|
2833
2838
|
Ve as ProgressBar,
|
|
2834
2839
|
qe as Radio,
|
|
@@ -2849,7 +2854,7 @@ export {
|
|
|
2849
2854
|
C as Widget,
|
|
2850
2855
|
Dt as graphFieldUtils,
|
|
2851
2856
|
jt as graphProcessor,
|
|
2852
|
-
|
|
2857
|
+
re as parseContext,
|
|
2853
2858
|
Tt as parseContextFields,
|
|
2854
2859
|
zt as parseDomainFields,
|
|
2855
2860
|
Yt as parseGraph,
|