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