@gisce/ooui 2.23.0-alpha.2 → 2.23.0-alpha.3
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/Carousel.d.ts +11 -0
- package/dist/Carousel.d.ts.map +1 -0
- package/dist/WidgetFactory.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/ooui.es.js +206 -186
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Carousel.ts +30 -0
- package/src/WidgetFactory.ts +4 -0
- package/src/index.ts +2 -0
- package/src/spec/Carousel.spec.ts +75 -0
package/dist/ooui.es.js
CHANGED
|
@@ -3,7 +3,7 @@ var be = (i, t, e) => t in i ? me(i, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var n = (i, t, e) => (be(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import { decode as ye } from "html-entities";
|
|
5
5
|
import { evaluateCondition as pe } from "@gisce/conscheck";
|
|
6
|
-
import * as
|
|
6
|
+
import * as D from "txml";
|
|
7
7
|
import T from "moment";
|
|
8
8
|
const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we = ({
|
|
9
9
|
entry: i,
|
|
@@ -67,12 +67,12 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
67
67
|
fields: e,
|
|
68
68
|
widgetType: s
|
|
69
69
|
}) => {
|
|
70
|
-
const
|
|
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
72
|
const p = h[g].map((y) => we({ entry: y, values: t, fields: e })).every((y) => y);
|
|
73
|
-
p ?
|
|
73
|
+
p ? d[g] = !0 : g === "readonly" && !p && s === "button" && (d[g] = !1);
|
|
74
74
|
}
|
|
75
|
-
return
|
|
75
|
+
return d;
|
|
76
76
|
}, X = (i) => {
|
|
77
77
|
if (i === void 0)
|
|
78
78
|
return {};
|
|
@@ -95,21 +95,21 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
95
95
|
r.replace(/'/g, '"')
|
|
96
96
|
), l = {};
|
|
97
97
|
for (const o of Object.keys(a)) {
|
|
98
|
-
const
|
|
98
|
+
const u = pe({
|
|
99
99
|
object: t,
|
|
100
100
|
condition: a[o],
|
|
101
101
|
evaluateFieldComparison: ({
|
|
102
102
|
fieldName: _,
|
|
103
103
|
valueInObject: h,
|
|
104
|
-
expectedValue:
|
|
104
|
+
expectedValue: d
|
|
105
105
|
}) => Q({
|
|
106
106
|
fieldName: _,
|
|
107
107
|
valueInObject: h,
|
|
108
|
-
expectedValue:
|
|
108
|
+
expectedValue: d,
|
|
109
109
|
fields: e
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
|
-
|
|
112
|
+
u ? l[o] = !0 : o === "readonly" && !u && s === "button" && (l[o] = !1);
|
|
113
113
|
}
|
|
114
114
|
return l;
|
|
115
115
|
} catch (r) {
|
|
@@ -152,7 +152,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
152
152
|
attrs: void 0,
|
|
153
153
|
json_attrs: void 0
|
|
154
154
|
};
|
|
155
|
-
},
|
|
155
|
+
}, W = (i) => i === 1 || i === "1" || i === !0 || i === "True" || i === "true", k = class k {
|
|
156
156
|
constructor(t) {
|
|
157
157
|
/**
|
|
158
158
|
* Determines if widget is read only (default is undefined)
|
|
@@ -188,7 +188,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
188
188
|
* Base type of the field
|
|
189
189
|
*/
|
|
190
190
|
n(this, "_fieldType", "");
|
|
191
|
-
this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly =
|
|
191
|
+
this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = W(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));
|
|
192
192
|
}
|
|
193
193
|
static get defaultColspan() {
|
|
194
194
|
return k._defaultColspan;
|
|
@@ -306,7 +306,7 @@ class f extends C {
|
|
|
306
306
|
*/
|
|
307
307
|
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
308
308
|
n(this, "_autoRefresh", !1);
|
|
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 =
|
|
309
|
+
this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(e.help)), e.nolabel && (e.nolabel === "1" || typeof e.nolabel == "boolean" && e.nolabel === !0) && (this._nolabel = !0), e.required && (e.required === "1" || e.required === !0 || e.required === "True") && (this._required = !0), e.sum && (this._sum = b(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = xe(e.help_inline)), e.autorefresh && (this.autoRefresh = W(e.autorefresh)));
|
|
310
310
|
}
|
|
311
311
|
get id() {
|
|
312
312
|
return this._id;
|
|
@@ -451,7 +451,7 @@ class K extends f {
|
|
|
451
451
|
this._fieldForLabel = e;
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
class
|
|
454
|
+
class V {
|
|
455
455
|
constructor(t = 4, e = 6, s = !1, r = void 0) {
|
|
456
456
|
/**
|
|
457
457
|
* Number of columns the container is divided
|
|
@@ -575,7 +575,7 @@ const O = class O extends C {
|
|
|
575
575
|
* Container label
|
|
576
576
|
*/
|
|
577
577
|
n(this, "_label", "");
|
|
578
|
-
this._container = new
|
|
578
|
+
this._container = new V(
|
|
579
579
|
e == null ? void 0 : e.col,
|
|
580
580
|
O._defaultColspan,
|
|
581
581
|
this.readOnly,
|
|
@@ -627,8 +627,8 @@ const O = class O extends C {
|
|
|
627
627
|
}
|
|
628
628
|
};
|
|
629
629
|
n(O, "_defaultColspan", 6);
|
|
630
|
-
let
|
|
631
|
-
const P = class P extends
|
|
630
|
+
let w = O;
|
|
631
|
+
const P = class P extends w {
|
|
632
632
|
constructor(e) {
|
|
633
633
|
super(e);
|
|
634
634
|
n(this, "_tabPosition", "top");
|
|
@@ -653,7 +653,7 @@ const P = class P extends v {
|
|
|
653
653
|
};
|
|
654
654
|
n(P, "_defaultColspan", 3);
|
|
655
655
|
let M = P;
|
|
656
|
-
class B extends
|
|
656
|
+
class B extends w {
|
|
657
657
|
constructor(e) {
|
|
658
658
|
super(e);
|
|
659
659
|
n(this, "_loading", !1);
|
|
@@ -764,7 +764,7 @@ class Z extends f {
|
|
|
764
764
|
this._danger = e;
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
class Te extends
|
|
767
|
+
class Te extends w {
|
|
768
768
|
constructor(e) {
|
|
769
769
|
super(e);
|
|
770
770
|
n(this, "_defaultName", "");
|
|
@@ -902,7 +902,7 @@ class L extends f {
|
|
|
902
902
|
this._translatable = e;
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
|
-
class
|
|
905
|
+
class E extends f {
|
|
906
906
|
constructor(e) {
|
|
907
907
|
super(e);
|
|
908
908
|
/**
|
|
@@ -1125,7 +1125,7 @@ class je extends C {
|
|
|
1125
1125
|
return null;
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
class Me extends
|
|
1128
|
+
class Me extends E {
|
|
1129
1129
|
}
|
|
1130
1130
|
class Ne extends f {
|
|
1131
1131
|
constructor(e) {
|
|
@@ -1186,7 +1186,7 @@ class Le extends te {
|
|
|
1186
1186
|
return this.parsedWidgetProps.colorField;
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
|
-
class Ge extends
|
|
1189
|
+
class Ge extends E {
|
|
1190
1190
|
constructor(e) {
|
|
1191
1191
|
super(e);
|
|
1192
1192
|
n(this, "_nolabel", !0);
|
|
@@ -1291,12 +1291,12 @@ class ie extends f {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
class Re extends ie {
|
|
1293
1293
|
}
|
|
1294
|
-
class $e extends
|
|
1294
|
+
class $e extends E {
|
|
1295
1295
|
get colors() {
|
|
1296
1296
|
return this._parsedWidgetProps.colors || {};
|
|
1297
1297
|
}
|
|
1298
1298
|
}
|
|
1299
|
-
class qe extends
|
|
1299
|
+
class qe extends E {
|
|
1300
1300
|
constructor(e) {
|
|
1301
1301
|
super(e);
|
|
1302
1302
|
/**
|
|
@@ -1362,7 +1362,7 @@ class Qe extends f {
|
|
|
1362
1362
|
super(t);
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
|
-
class Xe extends
|
|
1365
|
+
class Xe extends w {
|
|
1366
1366
|
constructor(e) {
|
|
1367
1367
|
super(e);
|
|
1368
1368
|
/**
|
|
@@ -1447,6 +1447,22 @@ class Ke extends f {
|
|
|
1447
1447
|
this._size = e;
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
|
+
class Ze extends w {
|
|
1451
|
+
constructor(e) {
|
|
1452
|
+
super(e);
|
|
1453
|
+
n(this, "_autoPlay", !0);
|
|
1454
|
+
e && "auto_play" in e && (this._autoPlay = W(e.auto_play));
|
|
1455
|
+
}
|
|
1456
|
+
get autoPlay() {
|
|
1457
|
+
return this._autoPlay;
|
|
1458
|
+
}
|
|
1459
|
+
set autoPlay(e) {
|
|
1460
|
+
this._autoPlay = e;
|
|
1461
|
+
}
|
|
1462
|
+
get items() {
|
|
1463
|
+
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1450
1466
|
class R {
|
|
1451
1467
|
constructor() {
|
|
1452
1468
|
/**
|
|
@@ -1481,7 +1497,7 @@ class R {
|
|
|
1481
1497
|
this._widgetClass = Te;
|
|
1482
1498
|
break;
|
|
1483
1499
|
case "selection":
|
|
1484
|
-
this._widgetClass =
|
|
1500
|
+
this._widgetClass = E;
|
|
1485
1501
|
break;
|
|
1486
1502
|
case "many2one":
|
|
1487
1503
|
this._widgetClass = We;
|
|
@@ -1590,6 +1606,9 @@ class R {
|
|
|
1590
1606
|
case "spinner":
|
|
1591
1607
|
this._widgetClass = B;
|
|
1592
1608
|
break;
|
|
1609
|
+
case "carousel":
|
|
1610
|
+
this._widgetClass = Ze;
|
|
1611
|
+
break;
|
|
1593
1612
|
}
|
|
1594
1613
|
}
|
|
1595
1614
|
createWidget(t, e) {
|
|
@@ -1611,7 +1630,7 @@ class R {
|
|
|
1611
1630
|
}
|
|
1612
1631
|
}
|
|
1613
1632
|
}
|
|
1614
|
-
const
|
|
1633
|
+
const et = ({
|
|
1615
1634
|
fieldName: i,
|
|
1616
1635
|
values: t,
|
|
1617
1636
|
fields: e
|
|
@@ -1625,18 +1644,18 @@ const Ze = ({
|
|
|
1625
1644
|
const r = {}, a = {};
|
|
1626
1645
|
for (const o of Object.keys(s))
|
|
1627
1646
|
if (t.state === o) {
|
|
1628
|
-
const
|
|
1629
|
-
for (const _ of
|
|
1630
|
-
const [h,
|
|
1631
|
-
a[h] || (a[h] = []), a[h].push(
|
|
1647
|
+
const u = s[o];
|
|
1648
|
+
for (const _ of u) {
|
|
1649
|
+
const [h, d] = _;
|
|
1650
|
+
a[h] || (a[h] = []), a[h].push(d);
|
|
1632
1651
|
}
|
|
1633
1652
|
}
|
|
1634
1653
|
for (const o of Object.keys(a)) {
|
|
1635
|
-
const
|
|
1636
|
-
r[o] =
|
|
1654
|
+
const u = a[o];
|
|
1655
|
+
r[o] = u.some((_) => _);
|
|
1637
1656
|
}
|
|
1638
1657
|
return r;
|
|
1639
|
-
},
|
|
1658
|
+
}, tt = ({
|
|
1640
1659
|
states: i,
|
|
1641
1660
|
values: t
|
|
1642
1661
|
}) => {
|
|
@@ -1645,7 +1664,7 @@ const Ze = ({
|
|
|
1645
1664
|
const e = i.split(",");
|
|
1646
1665
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1647
1666
|
};
|
|
1648
|
-
function
|
|
1667
|
+
function it({
|
|
1649
1668
|
values: i = {},
|
|
1650
1669
|
fieldName: t,
|
|
1651
1670
|
fields: e = {}
|
|
@@ -1669,11 +1688,11 @@ const ne = ({
|
|
|
1669
1688
|
return s;
|
|
1670
1689
|
if (i.trim().length === 0)
|
|
1671
1690
|
return;
|
|
1672
|
-
const
|
|
1673
|
-
return
|
|
1691
|
+
const d = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((c) => c.split(":")), g = {};
|
|
1692
|
+
return d.forEach((c) => {
|
|
1674
1693
|
const m = c[1];
|
|
1675
1694
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1676
|
-
const p =
|
|
1695
|
+
const p = it({
|
|
1677
1696
|
values: t,
|
|
1678
1697
|
fields: e,
|
|
1679
1698
|
fieldName: m === "active_id" ? "id" : m
|
|
@@ -1688,11 +1707,11 @@ const ne = ({
|
|
|
1688
1707
|
} catch {
|
|
1689
1708
|
return;
|
|
1690
1709
|
}
|
|
1691
|
-
},
|
|
1710
|
+
}, Pt = (i) => {
|
|
1692
1711
|
const t = [];
|
|
1693
1712
|
try {
|
|
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((
|
|
1695
|
-
!
|
|
1713
|
+
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) => {
|
|
1714
|
+
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1696
1715
|
}), t);
|
|
1697
1716
|
} catch {
|
|
1698
1717
|
}
|
|
@@ -1708,26 +1727,26 @@ function re(i) {
|
|
|
1708
1727
|
function ae(i) {
|
|
1709
1728
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1710
1729
|
}
|
|
1711
|
-
const
|
|
1730
|
+
const st = (i) => {
|
|
1712
1731
|
const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1713
1732
|
return {
|
|
1714
1733
|
method: e,
|
|
1715
1734
|
args: r
|
|
1716
1735
|
};
|
|
1717
1736
|
};
|
|
1718
|
-
function
|
|
1737
|
+
function nt(i) {
|
|
1719
1738
|
const t = [];
|
|
1720
1739
|
function e(s) {
|
|
1721
1740
|
const r = [];
|
|
1722
1741
|
for (const a of s)
|
|
1723
|
-
a instanceof
|
|
1742
|
+
a instanceof w ? e(a._container.rows.flat()) : r.push(a);
|
|
1724
1743
|
r.length > 0 && t.push(r);
|
|
1725
1744
|
}
|
|
1726
1745
|
for (const s of i)
|
|
1727
1746
|
e(s);
|
|
1728
1747
|
return t.flat();
|
|
1729
1748
|
}
|
|
1730
|
-
class
|
|
1749
|
+
class Tt {
|
|
1731
1750
|
constructor(t, e = 4) {
|
|
1732
1751
|
/**
|
|
1733
1752
|
* Object containing fields specification of the form.
|
|
@@ -1782,7 +1801,7 @@ class Pt {
|
|
|
1782
1801
|
* Context for each field in the form
|
|
1783
1802
|
*/
|
|
1784
1803
|
n(this, "_contextForFields", {});
|
|
1785
|
-
this._fields = t, this._container = new
|
|
1804
|
+
this._fields = t, this._container = new V(e, 6, !1, "root");
|
|
1786
1805
|
}
|
|
1787
1806
|
get fields() {
|
|
1788
1807
|
return this._fields;
|
|
@@ -1837,17 +1856,17 @@ class Pt {
|
|
|
1837
1856
|
}
|
|
1838
1857
|
parse(t, e) {
|
|
1839
1858
|
var o;
|
|
1840
|
-
const { values: s = {}, readOnly: r = !1 } = e || {}, a =
|
|
1859
|
+
const { values: s = {}, readOnly: r = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
|
|
1841
1860
|
this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = s.id ? { active_id: s.id, active_ids: [s.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
1842
1861
|
fields: a.children,
|
|
1843
1862
|
container: this._container,
|
|
1844
1863
|
values: s
|
|
1845
1864
|
});
|
|
1846
|
-
const l =
|
|
1847
|
-
l.forEach((
|
|
1848
|
-
const _ =
|
|
1849
|
-
_._id && _._context && (this._contextForFields[_._id] =
|
|
1850
|
-
}), this._autorefreshableFields = l.filter((
|
|
1865
|
+
const l = nt(this._container._rows);
|
|
1866
|
+
l.forEach((u) => {
|
|
1867
|
+
const _ = u;
|
|
1868
|
+
_._id && _._context && (this._contextForFields[_._id] = u._context);
|
|
1869
|
+
}), this._autorefreshableFields = l.filter((u) => u instanceof f && u.autoRefresh).map((u) => u._id);
|
|
1851
1870
|
}
|
|
1852
1871
|
parseNode({
|
|
1853
1872
|
fields: t,
|
|
@@ -1856,13 +1875,13 @@ class Pt {
|
|
|
1856
1875
|
}) {
|
|
1857
1876
|
const r = new R();
|
|
1858
1877
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
1859
|
-
var
|
|
1860
|
-
const { tagName: l, attributes: o, children:
|
|
1878
|
+
var v, F;
|
|
1879
|
+
const { tagName: l, attributes: o, children: u } = a;
|
|
1861
1880
|
let _ = l, h = o;
|
|
1862
1881
|
if (l === "field") {
|
|
1863
|
-
const { name: x, widget:
|
|
1864
|
-
if (
|
|
1865
|
-
_ =
|
|
1882
|
+
const { name: x, widget: I } = o;
|
|
1883
|
+
if (I)
|
|
1884
|
+
_ = I;
|
|
1866
1885
|
else if (x) {
|
|
1867
1886
|
if (!this._fields[x])
|
|
1868
1887
|
throw new Error(
|
|
@@ -1879,33 +1898,33 @@ class Pt {
|
|
|
1879
1898
|
fieldsWidgetType: this._fields[x].type
|
|
1880
1899
|
};
|
|
1881
1900
|
}
|
|
1882
|
-
const
|
|
1901
|
+
const d = Ce({
|
|
1883
1902
|
tagAttributes: h,
|
|
1884
1903
|
values: s,
|
|
1885
1904
|
fields: this._fields,
|
|
1886
1905
|
widgetType: l
|
|
1887
1906
|
});
|
|
1888
1907
|
let g;
|
|
1889
|
-
l === "button" && h.states ? g =
|
|
1908
|
+
l === "button" && h.states ? g = tt({
|
|
1890
1909
|
states: h.states,
|
|
1891
1910
|
values: s
|
|
1892
|
-
}) : g =
|
|
1911
|
+
}) : g = et({
|
|
1893
1912
|
fieldName: h.name,
|
|
1894
1913
|
values: s,
|
|
1895
1914
|
fields: this._fields
|
|
1896
1915
|
});
|
|
1897
1916
|
const c = ne({
|
|
1898
|
-
context: h.context || ((
|
|
1917
|
+
context: h.context || ((v = this._fields[h.name]) == null ? void 0 : v.context),
|
|
1899
1918
|
values: s,
|
|
1900
1919
|
fields: this._fields
|
|
1901
1920
|
});
|
|
1902
|
-
h.on_change && (this._onChangeFields[h.name] =
|
|
1921
|
+
h.on_change && (this._onChangeFields[h.name] = st(
|
|
1903
1922
|
h.on_change
|
|
1904
1923
|
));
|
|
1905
1924
|
let m;
|
|
1906
1925
|
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;
|
|
1907
1926
|
const p = {
|
|
1908
|
-
...
|
|
1927
|
+
...d,
|
|
1909
1928
|
...g,
|
|
1910
1929
|
context: c,
|
|
1911
1930
|
domain: m,
|
|
@@ -1913,8 +1932,8 @@ class Pt {
|
|
|
1913
1932
|
};
|
|
1914
1933
|
e.readOnly && (p.readonly = !0);
|
|
1915
1934
|
const y = r.createWidget(_, p);
|
|
1916
|
-
y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof
|
|
1917
|
-
fields:
|
|
1935
|
+
y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof w && this.parseNode({
|
|
1936
|
+
fields: u,
|
|
1918
1937
|
container: y.container,
|
|
1919
1938
|
values: s
|
|
1920
1939
|
}), y instanceof Z && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
@@ -1931,7 +1950,7 @@ class Pt {
|
|
|
1931
1950
|
function H(i) {
|
|
1932
1951
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1933
1952
|
}
|
|
1934
|
-
class
|
|
1953
|
+
class Wt {
|
|
1935
1954
|
constructor(t) {
|
|
1936
1955
|
/**
|
|
1937
1956
|
* Object containing fields specification of the form.
|
|
@@ -2003,37 +2022,37 @@ class Tt {
|
|
|
2003
2022
|
this._infinite = t;
|
|
2004
2023
|
}
|
|
2005
2024
|
parse(t) {
|
|
2006
|
-
const e =
|
|
2025
|
+
const e = D.parse(t).filter((r) => r.tagName === "tree")[0];
|
|
2007
2026
|
this._string = e.attributes.string || null, this._string && (this._string = b(this._string)), this._colors = e.attributes.colors || null, this._colors && (this._colors = b(this._colors)), this._status = e.attributes.status || null, this._status && (this._status = b(this._status)), this._editable = e.attributes.editable || null, this._infinite = e.attributes.infinite || !1;
|
|
2008
2027
|
const s = new R();
|
|
2009
2028
|
e.children.forEach((r) => {
|
|
2010
2029
|
const { tagName: a, attributes: l } = r;
|
|
2011
2030
|
let o = null;
|
|
2012
2031
|
if (a === "field") {
|
|
2013
|
-
const { name:
|
|
2032
|
+
const { name: u, widget: _ } = l;
|
|
2014
2033
|
let h = l;
|
|
2015
|
-
if (
|
|
2016
|
-
if (!this._fields[
|
|
2017
|
-
throw new Error(`Field ${
|
|
2018
|
-
const
|
|
2019
|
-
o =
|
|
2034
|
+
if (u) {
|
|
2035
|
+
if (!this._fields[u])
|
|
2036
|
+
throw new Error(`Field ${u} doesn't exist in fields defintion`);
|
|
2037
|
+
const d = this._fields[u];
|
|
2038
|
+
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;
|
|
2020
2039
|
const g = ne({
|
|
2021
|
-
context: l.context ||
|
|
2040
|
+
context: l.context || d.context,
|
|
2022
2041
|
values: {},
|
|
2023
2042
|
fields: this._fields
|
|
2024
2043
|
});
|
|
2025
2044
|
h = {
|
|
2026
|
-
...
|
|
2045
|
+
...d,
|
|
2027
2046
|
...l,
|
|
2028
|
-
fieldsWidgetType:
|
|
2047
|
+
fieldsWidgetType: d == null ? void 0 : d.type,
|
|
2029
2048
|
context: g
|
|
2030
|
-
}, this._contextForFields[
|
|
2049
|
+
}, this._contextForFields[u] = g;
|
|
2031
2050
|
}
|
|
2032
2051
|
if (_ && (o = _), !h.invisible) {
|
|
2033
|
-
const
|
|
2034
|
-
this._columns.push(
|
|
2052
|
+
const d = s.createWidget(o, h);
|
|
2053
|
+
this._columns.push(d);
|
|
2035
2054
|
}
|
|
2036
|
-
|
|
2055
|
+
W(h.autorefresh) && this._autorefreshableFields.push(u);
|
|
2037
2056
|
}
|
|
2038
2057
|
});
|
|
2039
2058
|
}
|
|
@@ -2045,7 +2064,7 @@ class Tt {
|
|
|
2045
2064
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
2046
2065
|
}
|
|
2047
2066
|
}
|
|
2048
|
-
const
|
|
2067
|
+
const rt = {
|
|
2049
2068
|
text: "text",
|
|
2050
2069
|
many2one: "many2one",
|
|
2051
2070
|
char: "char",
|
|
@@ -2058,7 +2077,7 @@ const nt = {
|
|
|
2058
2077
|
date: "date",
|
|
2059
2078
|
datetime: "datetime"
|
|
2060
2079
|
};
|
|
2061
|
-
class
|
|
2080
|
+
class Et {
|
|
2062
2081
|
constructor(t, e, s = 8) {
|
|
2063
2082
|
/**
|
|
2064
2083
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -2070,7 +2089,7 @@ class Wt {
|
|
|
2070
2089
|
n(this, "_fields");
|
|
2071
2090
|
n(this, "_simpleSearchContainer");
|
|
2072
2091
|
n(this, "_advancedSearchContainer");
|
|
2073
|
-
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new
|
|
2092
|
+
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new V(s), this._advancedSearchContainer = new V(s);
|
|
2074
2093
|
}
|
|
2075
2094
|
get searchFields() {
|
|
2076
2095
|
return this._searchFields;
|
|
@@ -2106,7 +2125,7 @@ class Wt {
|
|
|
2106
2125
|
colspan: 2
|
|
2107
2126
|
}, { type: a, widget: l } = r;
|
|
2108
2127
|
let o = l ?? a;
|
|
2109
|
-
return
|
|
2128
|
+
return rt[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
2110
2129
|
});
|
|
2111
2130
|
}
|
|
2112
2131
|
/**
|
|
@@ -2117,7 +2136,7 @@ class Wt {
|
|
|
2117
2136
|
return this.advancedSearchContainer.findById(t);
|
|
2118
2137
|
}
|
|
2119
2138
|
}
|
|
2120
|
-
const
|
|
2139
|
+
const It = ({
|
|
2121
2140
|
domain: i,
|
|
2122
2141
|
widgetFieldName: t
|
|
2123
2142
|
}) => {
|
|
@@ -2126,14 +2145,14 @@ const Et = ({
|
|
|
2126
2145
|
if (!Array.isArray(s))
|
|
2127
2146
|
return;
|
|
2128
2147
|
const [r, a, l] = s;
|
|
2129
|
-
let o,
|
|
2130
|
-
r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")),
|
|
2148
|
+
let o, u;
|
|
2149
|
+
r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), u = r.substr(
|
|
2131
2150
|
r.indexOf(".") + 1,
|
|
2132
2151
|
r.length - 1
|
|
2133
|
-
)) : (o = r,
|
|
2152
|
+
)) : (o = r, u = "id"), o === t && e.push([u, a, l]);
|
|
2134
2153
|
}), e;
|
|
2135
|
-
},
|
|
2136
|
-
class
|
|
2154
|
+
}, St = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2155
|
+
class at {
|
|
2137
2156
|
constructor(t) {
|
|
2138
2157
|
n(this, "_action_id", null);
|
|
2139
2158
|
n(this, "_position", null);
|
|
@@ -2146,15 +2165,15 @@ class rt {
|
|
|
2146
2165
|
return this._position;
|
|
2147
2166
|
}
|
|
2148
2167
|
}
|
|
2149
|
-
class
|
|
2168
|
+
class zt {
|
|
2150
2169
|
constructor(t) {
|
|
2151
2170
|
n(this, "_string", null);
|
|
2152
2171
|
n(this, "_items", []);
|
|
2153
|
-
const e =
|
|
2172
|
+
const e = D.parse(t).filter((r) => r.tagName === "dashboard")[0];
|
|
2154
2173
|
this._string = e.attributes.string || null;
|
|
2155
2174
|
const { children: s } = e;
|
|
2156
2175
|
s.forEach((r) => {
|
|
2157
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
2176
|
+
r.tagName === "dashboard_item" && this._items.push(new at(r.attributes));
|
|
2158
2177
|
});
|
|
2159
2178
|
}
|
|
2160
2179
|
get string() {
|
|
@@ -2200,7 +2219,7 @@ class oe extends le {
|
|
|
2200
2219
|
n(this, "_totalDomain", null);
|
|
2201
2220
|
n(this, "_showPercent", !1);
|
|
2202
2221
|
n(this, "_suffix", null);
|
|
2203
|
-
this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent =
|
|
2222
|
+
this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent = W(s.attributes.showPercent);
|
|
2204
2223
|
}
|
|
2205
2224
|
get color() {
|
|
2206
2225
|
return this._color;
|
|
@@ -2218,7 +2237,7 @@ class oe extends le {
|
|
|
2218
2237
|
return this._suffix;
|
|
2219
2238
|
}
|
|
2220
2239
|
}
|
|
2221
|
-
class
|
|
2240
|
+
class lt extends oe {
|
|
2222
2241
|
constructor(e, s) {
|
|
2223
2242
|
super(e, s);
|
|
2224
2243
|
n(this, "_field");
|
|
@@ -2238,12 +2257,12 @@ class at extends oe {
|
|
|
2238
2257
|
return this._operator;
|
|
2239
2258
|
}
|
|
2240
2259
|
}
|
|
2241
|
-
const
|
|
2260
|
+
const ot = (i) => {
|
|
2242
2261
|
const t = [];
|
|
2243
2262
|
let e;
|
|
2244
2263
|
if (i.forEach((s) => {
|
|
2245
2264
|
if (s.tagName === "field") {
|
|
2246
|
-
const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0,
|
|
2265
|
+
const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, u = s.attributes.stacked || void 0;
|
|
2247
2266
|
if (!r)
|
|
2248
2267
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2249
2268
|
if (!l)
|
|
@@ -2251,11 +2270,11 @@ const lt = (i) => {
|
|
|
2251
2270
|
r === "x" ? e = new dt({
|
|
2252
2271
|
name: l
|
|
2253
2272
|
}) : r === "y" && t.push(
|
|
2254
|
-
new
|
|
2273
|
+
new ut({
|
|
2255
2274
|
name: l,
|
|
2256
2275
|
operator: a,
|
|
2257
2276
|
label: o,
|
|
2258
|
-
stacked:
|
|
2277
|
+
stacked: u
|
|
2259
2278
|
})
|
|
2260
2279
|
);
|
|
2261
2280
|
}
|
|
@@ -2274,7 +2293,7 @@ class j extends le {
|
|
|
2274
2293
|
n(this, "_x");
|
|
2275
2294
|
n(this, "_y");
|
|
2276
2295
|
this._type = e;
|
|
2277
|
-
const r =
|
|
2296
|
+
const r = ot(s.children);
|
|
2278
2297
|
this._x = r.x, this._y = r.y;
|
|
2279
2298
|
}
|
|
2280
2299
|
get x() {
|
|
@@ -2284,17 +2303,17 @@ class j extends le {
|
|
|
2284
2303
|
return this._y;
|
|
2285
2304
|
}
|
|
2286
2305
|
}
|
|
2287
|
-
const
|
|
2306
|
+
const ct = {
|
|
2288
2307
|
indicator: oe,
|
|
2289
|
-
indicatorField:
|
|
2308
|
+
indicatorField: lt,
|
|
2290
2309
|
line: j,
|
|
2291
2310
|
bar: j,
|
|
2292
2311
|
pie: j
|
|
2293
|
-
},
|
|
2294
|
-
const t =
|
|
2312
|
+
}, Vt = (i) => {
|
|
2313
|
+
const t = D.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2295
2314
|
if (!e)
|
|
2296
2315
|
throw new Error(`${e} is not a valid graph`);
|
|
2297
|
-
const s =
|
|
2316
|
+
const s = ct[e];
|
|
2298
2317
|
if (!s)
|
|
2299
2318
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2300
2319
|
return new s(e, t);
|
|
@@ -2312,7 +2331,7 @@ class ce {
|
|
|
2312
2331
|
return this._axis;
|
|
2313
2332
|
}
|
|
2314
2333
|
}
|
|
2315
|
-
class
|
|
2334
|
+
class ut extends ce {
|
|
2316
2335
|
constructor({
|
|
2317
2336
|
name: e,
|
|
2318
2337
|
operator: s,
|
|
@@ -2340,7 +2359,7 @@ class dt extends ce {
|
|
|
2340
2359
|
super({ name: t, axis: "x" });
|
|
2341
2360
|
}
|
|
2342
2361
|
}
|
|
2343
|
-
const
|
|
2362
|
+
const ht = ({ ooui: i }) => {
|
|
2344
2363
|
const e = [i.x.name];
|
|
2345
2364
|
return i.y ? (i.y.forEach((s) => {
|
|
2346
2365
|
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
@@ -2362,46 +2381,46 @@ function $({
|
|
|
2362
2381
|
}
|
|
2363
2382
|
return { value: r, label: r };
|
|
2364
2383
|
}
|
|
2365
|
-
const
|
|
2384
|
+
const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2366
2385
|
__proto__: null,
|
|
2367
|
-
getFieldsToRetrieve:
|
|
2386
|
+
getFieldsToRetrieve: ht,
|
|
2368
2387
|
getValueAndLabelForField: $
|
|
2369
2388
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2370
|
-
function
|
|
2389
|
+
function _t({
|
|
2371
2390
|
values: i,
|
|
2372
2391
|
timerange: t,
|
|
2373
2392
|
interval: e = 1
|
|
2374
2393
|
}) {
|
|
2375
|
-
const s =
|
|
2394
|
+
const s = mt({
|
|
2376
2395
|
values: i,
|
|
2377
2396
|
timerange: t
|
|
2378
2397
|
});
|
|
2379
|
-
return
|
|
2398
|
+
return ft({
|
|
2380
2399
|
values: s,
|
|
2381
2400
|
timerange: t,
|
|
2382
2401
|
interval: e
|
|
2383
2402
|
});
|
|
2384
2403
|
}
|
|
2385
|
-
function
|
|
2404
|
+
function ft({
|
|
2386
2405
|
values: i,
|
|
2387
2406
|
timerange: t,
|
|
2388
2407
|
interval: e = 1
|
|
2389
2408
|
}) {
|
|
2390
2409
|
let s = [];
|
|
2391
|
-
const r =
|
|
2410
|
+
const r = de({
|
|
2392
2411
|
values: i,
|
|
2393
2412
|
groupBy: "type-stacked"
|
|
2394
2413
|
}), a = `${t}s`;
|
|
2395
2414
|
return Object.keys(r).forEach((o) => {
|
|
2396
|
-
const
|
|
2397
|
-
for (let _ = 0; _ <
|
|
2398
|
-
const h =
|
|
2399
|
-
if (s.push(h), _ ===
|
|
2415
|
+
const u = r[o];
|
|
2416
|
+
for (let _ = 0; _ < u.length; _++) {
|
|
2417
|
+
const h = u[_];
|
|
2418
|
+
if (s.push(h), _ === u.length - 1)
|
|
2400
2419
|
return;
|
|
2401
|
-
const
|
|
2402
|
-
if (!
|
|
2403
|
-
const c =
|
|
2404
|
-
dates: [
|
|
2420
|
+
const d = h.x, g = u[_ + 1].x;
|
|
2421
|
+
if (!ue([d, g], a)) {
|
|
2422
|
+
const c = gt({
|
|
2423
|
+
dates: [d, g],
|
|
2405
2424
|
timerange: t,
|
|
2406
2425
|
interval: e
|
|
2407
2426
|
});
|
|
@@ -2415,9 +2434,9 @@ function _t({
|
|
|
2415
2434
|
);
|
|
2416
2435
|
}
|
|
2417
2436
|
}
|
|
2418
|
-
}), s.sort((o,
|
|
2437
|
+
}), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
|
|
2419
2438
|
}
|
|
2420
|
-
function
|
|
2439
|
+
function gt({
|
|
2421
2440
|
dates: i,
|
|
2422
2441
|
timerange: t,
|
|
2423
2442
|
interval: e = 1
|
|
@@ -2427,57 +2446,57 @@ function ft({
|
|
|
2427
2446
|
return i;
|
|
2428
2447
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2429
2448
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2430
|
-
const o = a[l],
|
|
2431
|
-
if (!
|
|
2432
|
-
const _ = T(o,
|
|
2449
|
+
const o = a[l], u = a[l + 1];
|
|
2450
|
+
if (!ue([o, u], r)) {
|
|
2451
|
+
const _ = T(o, z(r)).add(
|
|
2433
2452
|
e,
|
|
2434
2453
|
r
|
|
2435
|
-
), h = T(
|
|
2454
|
+
), h = T(u, z(r));
|
|
2436
2455
|
for (; _.isBefore(h); )
|
|
2437
|
-
s.push(_.format(
|
|
2456
|
+
s.push(_.format(z(r))), _.add(e, r);
|
|
2438
2457
|
}
|
|
2439
2458
|
}
|
|
2440
2459
|
return s;
|
|
2441
2460
|
}
|
|
2442
|
-
function
|
|
2461
|
+
function mt({
|
|
2443
2462
|
values: i,
|
|
2444
2463
|
timerange: t
|
|
2445
2464
|
}) {
|
|
2446
|
-
const e =
|
|
2465
|
+
const e = bt({
|
|
2447
2466
|
values: i,
|
|
2448
2467
|
timerange: t
|
|
2449
|
-
}), s = [], r =
|
|
2468
|
+
}), s = [], r = de({
|
|
2450
2469
|
values: e,
|
|
2451
2470
|
groupBy: "all"
|
|
2452
2471
|
});
|
|
2453
2472
|
return Object.keys(r).forEach((a) => {
|
|
2454
|
-
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator,
|
|
2473
|
+
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
|
|
2455
2474
|
values: l.map((_) => _.value),
|
|
2456
2475
|
operator: o
|
|
2457
2476
|
});
|
|
2458
2477
|
s.push({
|
|
2459
2478
|
...l[0],
|
|
2460
|
-
value:
|
|
2479
|
+
value: u
|
|
2461
2480
|
});
|
|
2462
2481
|
}), s;
|
|
2463
2482
|
}
|
|
2464
|
-
function
|
|
2483
|
+
function bt({
|
|
2465
2484
|
values: i,
|
|
2466
2485
|
timerange: t
|
|
2467
2486
|
}) {
|
|
2468
2487
|
return i.map((e) => ({
|
|
2469
2488
|
...e,
|
|
2470
|
-
x:
|
|
2489
|
+
x: yt({
|
|
2471
2490
|
date: e.x,
|
|
2472
2491
|
timerange: t
|
|
2473
2492
|
})
|
|
2474
2493
|
}));
|
|
2475
2494
|
}
|
|
2476
|
-
function
|
|
2495
|
+
function yt({
|
|
2477
2496
|
date: i,
|
|
2478
2497
|
timerange: t
|
|
2479
2498
|
}) {
|
|
2480
|
-
let e =
|
|
2499
|
+
let e = pt(i);
|
|
2481
2500
|
const s = T(i, e);
|
|
2482
2501
|
switch (t) {
|
|
2483
2502
|
case "hour": {
|
|
@@ -2503,12 +2522,12 @@ function bt({
|
|
|
2503
2522
|
}
|
|
2504
2523
|
return s.format(e);
|
|
2505
2524
|
}
|
|
2506
|
-
function
|
|
2525
|
+
function pt(i) {
|
|
2507
2526
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2508
2527
|
}
|
|
2509
|
-
function
|
|
2528
|
+
function ue(i, t) {
|
|
2510
2529
|
let e = !1;
|
|
2511
|
-
const s =
|
|
2530
|
+
const s = z(t);
|
|
2512
2531
|
if (i.length === 0)
|
|
2513
2532
|
return !1;
|
|
2514
2533
|
if (i.length === 1)
|
|
@@ -2519,7 +2538,7 @@ function de(i, t) {
|
|
|
2519
2538
|
}
|
|
2520
2539
|
return e;
|
|
2521
2540
|
}
|
|
2522
|
-
function
|
|
2541
|
+
function de({
|
|
2523
2542
|
values: i,
|
|
2524
2543
|
groupBy: t
|
|
2525
2544
|
}) {
|
|
@@ -2529,7 +2548,7 @@ function ue({
|
|
|
2529
2548
|
e[o] || (e[o] = []), e[o].push(s);
|
|
2530
2549
|
}), e;
|
|
2531
2550
|
}
|
|
2532
|
-
function
|
|
2551
|
+
function z(i) {
|
|
2533
2552
|
switch (i) {
|
|
2534
2553
|
case "days":
|
|
2535
2554
|
return "YYYY-MM-DD";
|
|
@@ -2544,7 +2563,7 @@ function S(i) {
|
|
|
2544
2563
|
return "YYYY-MM-DD HH:mm";
|
|
2545
2564
|
}
|
|
2546
2565
|
}
|
|
2547
|
-
const
|
|
2566
|
+
const xt = {
|
|
2548
2567
|
count: "count",
|
|
2549
2568
|
"+": "sum",
|
|
2550
2569
|
"-": "subtract",
|
|
@@ -2552,7 +2571,7 @@ const pt = {
|
|
|
2552
2571
|
avg: "average",
|
|
2553
2572
|
min: "min",
|
|
2554
2573
|
max: "max"
|
|
2555
|
-
},
|
|
2574
|
+
}, wt = ({
|
|
2556
2575
|
ooui: i,
|
|
2557
2576
|
values: t,
|
|
2558
2577
|
fields: e,
|
|
@@ -2567,35 +2586,35 @@ const pt = {
|
|
|
2567
2586
|
Object.keys(r).forEach((m) => {
|
|
2568
2587
|
const p = r[m].label, y = r[m].entries;
|
|
2569
2588
|
if (c.label) {
|
|
2570
|
-
const
|
|
2589
|
+
const v = A({
|
|
2571
2590
|
fieldName: c.label,
|
|
2572
2591
|
values: y,
|
|
2573
2592
|
fields: e
|
|
2574
2593
|
});
|
|
2575
|
-
Object.keys(
|
|
2576
|
-
const x =
|
|
2594
|
+
Object.keys(v).forEach((F) => {
|
|
2595
|
+
const x = v[F].entries, I = v[F].label, fe = N({
|
|
2577
2596
|
entries: x,
|
|
2578
2597
|
fields: e,
|
|
2579
2598
|
fieldName: c.name
|
|
2580
|
-
}), ge =
|
|
2599
|
+
}), ge = Y({
|
|
2581
2600
|
values: fe,
|
|
2582
2601
|
operator: c.operator
|
|
2583
2602
|
});
|
|
2584
2603
|
a.push({
|
|
2585
2604
|
x: p || !1,
|
|
2586
2605
|
value: ge,
|
|
2587
|
-
type:
|
|
2606
|
+
type: I,
|
|
2588
2607
|
operator: c.operator,
|
|
2589
2608
|
stacked: c.stacked
|
|
2590
2609
|
});
|
|
2591
2610
|
});
|
|
2592
2611
|
} else {
|
|
2593
|
-
const
|
|
2612
|
+
const v = N({
|
|
2594
2613
|
entries: y,
|
|
2595
2614
|
fields: e,
|
|
2596
2615
|
fieldName: c.name
|
|
2597
|
-
}), F =
|
|
2598
|
-
values:
|
|
2616
|
+
}), F = Y({
|
|
2617
|
+
values: v,
|
|
2599
2618
|
operator: c.operator
|
|
2600
2619
|
});
|
|
2601
2620
|
a.push({
|
|
@@ -2618,21 +2637,21 @@ const pt = {
|
|
|
2618
2637
|
i.type === "pie" && h.some((c) => c.x === !1) ? h = h.map((c) => c.x === !1 ? { ...c, x: (s == null ? void 0 : s.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (h = h.filter(
|
|
2619
2638
|
(c) => c.x !== !1
|
|
2620
2639
|
));
|
|
2621
|
-
let
|
|
2622
|
-
i.timerange ?
|
|
2623
|
-
values:
|
|
2640
|
+
let d = h;
|
|
2641
|
+
i.timerange ? d = _t({
|
|
2642
|
+
values: d,
|
|
2624
2643
|
timerange: i.timerange,
|
|
2625
2644
|
interval: i.interval
|
|
2626
|
-
}) : i.type == "pie" && (
|
|
2645
|
+
}) : i.type == "pie" && (d = h.sort((c, m) => m.value - c.value));
|
|
2627
2646
|
const g = {
|
|
2628
|
-
data:
|
|
2647
|
+
data: d,
|
|
2629
2648
|
isGroup: o || l,
|
|
2630
2649
|
isStack: o
|
|
2631
2650
|
};
|
|
2632
2651
|
if (i.type === "line" && i.y_range && (g.yAxisOpts = {
|
|
2633
2652
|
mode: i.y_range
|
|
2634
2653
|
}, i.y_range === "auto")) {
|
|
2635
|
-
const { min: c, max: m } = _e(
|
|
2654
|
+
const { min: c, max: m } = _e(d);
|
|
2636
2655
|
g.yAxisOpts.valueOpts = { min: c, max: m };
|
|
2637
2656
|
}
|
|
2638
2657
|
return g;
|
|
@@ -2648,7 +2667,7 @@ function N({
|
|
|
2648
2667
|
fields: e
|
|
2649
2668
|
})).map(({ value: s, label: r }) => r);
|
|
2650
2669
|
}
|
|
2651
|
-
function
|
|
2670
|
+
function Y({
|
|
2652
2671
|
operator: i,
|
|
2653
2672
|
values: t
|
|
2654
2673
|
}) {
|
|
@@ -2656,26 +2675,26 @@ function V({
|
|
|
2656
2675
|
case "count":
|
|
2657
2676
|
return t.length;
|
|
2658
2677
|
case "+":
|
|
2659
|
-
return
|
|
2678
|
+
return S(
|
|
2660
2679
|
t.reduce(function(e, s) {
|
|
2661
2680
|
return e + s;
|
|
2662
2681
|
})
|
|
2663
2682
|
);
|
|
2664
2683
|
case "-":
|
|
2665
|
-
return
|
|
2684
|
+
return S(
|
|
2666
2685
|
t.reduce(function(e, s) {
|
|
2667
2686
|
return e - s;
|
|
2668
2687
|
})
|
|
2669
2688
|
);
|
|
2670
2689
|
case "*":
|
|
2671
|
-
return
|
|
2690
|
+
return S(
|
|
2672
2691
|
t.reduce(function(e, s) {
|
|
2673
2692
|
return e * s;
|
|
2674
2693
|
})
|
|
2675
2694
|
);
|
|
2676
2695
|
case "avg": {
|
|
2677
2696
|
const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
|
|
2678
|
-
return
|
|
2697
|
+
return S(s);
|
|
2679
2698
|
}
|
|
2680
2699
|
case "min":
|
|
2681
2700
|
return Math.min(...t);
|
|
@@ -2683,7 +2702,7 @@ function V({
|
|
|
2683
2702
|
return Math.max(...t);
|
|
2684
2703
|
}
|
|
2685
2704
|
}
|
|
2686
|
-
function
|
|
2705
|
+
function S(i) {
|
|
2687
2706
|
return Math.round((i + Number.EPSILON) * 100) / 100;
|
|
2688
2707
|
}
|
|
2689
2708
|
function A({
|
|
@@ -2701,7 +2720,7 @@ function A({
|
|
|
2701
2720
|
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
|
|
2702
2721
|
}), s;
|
|
2703
2722
|
}
|
|
2704
|
-
function
|
|
2723
|
+
function vt(i) {
|
|
2705
2724
|
let t = [];
|
|
2706
2725
|
return Object.keys(i).forEach((e) => {
|
|
2707
2726
|
const s = i[e];
|
|
@@ -2724,16 +2743,16 @@ function _e(i, t = 0.1) {
|
|
|
2724
2743
|
max: r + a
|
|
2725
2744
|
};
|
|
2726
2745
|
}
|
|
2727
|
-
const
|
|
2746
|
+
const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2728
2747
|
__proto__: null,
|
|
2729
|
-
getAllObjectsInGroupedValues:
|
|
2748
|
+
getAllObjectsInGroupedValues: vt,
|
|
2730
2749
|
getMinMax: _e,
|
|
2731
|
-
getValueForOperator:
|
|
2750
|
+
getValueForOperator: Y,
|
|
2732
2751
|
getValuesForYField: N,
|
|
2733
2752
|
getValuesGroupedByField: A,
|
|
2734
2753
|
getYAxisFieldname: he,
|
|
2735
|
-
labelsForOperator:
|
|
2736
|
-
processGraphData:
|
|
2754
|
+
labelsForOperator: xt,
|
|
2755
|
+
processGraphData: wt
|
|
2737
2756
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2738
2757
|
export {
|
|
2739
2758
|
Xe as Alert,
|
|
@@ -2742,27 +2761,28 @@ export {
|
|
|
2742
2761
|
ee as Boolean,
|
|
2743
2762
|
Z as Button,
|
|
2744
2763
|
Te as ButtonGroup,
|
|
2764
|
+
Ze as Carousel,
|
|
2745
2765
|
q as Char,
|
|
2746
2766
|
se as CodeEditor,
|
|
2747
2767
|
Ue as Comments,
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2768
|
+
V as Container,
|
|
2769
|
+
w as ContainerWidget,
|
|
2770
|
+
zt as Dashboard,
|
|
2771
|
+
at as DashboardItem,
|
|
2752
2772
|
Ye as Date,
|
|
2753
2773
|
De as DateTime,
|
|
2754
2774
|
Ke as Email,
|
|
2755
2775
|
f as Field,
|
|
2756
2776
|
G as Float,
|
|
2757
2777
|
Se as FloatTime,
|
|
2758
|
-
|
|
2778
|
+
Tt as Form,
|
|
2759
2779
|
le as Graph,
|
|
2760
2780
|
ce as GraphAxis,
|
|
2761
2781
|
j as GraphChart,
|
|
2762
2782
|
oe as GraphIndicator,
|
|
2763
|
-
|
|
2783
|
+
lt as GraphIndicatorField,
|
|
2764
2784
|
dt as GraphXAxis,
|
|
2765
|
-
|
|
2785
|
+
ut as GraphYAxis,
|
|
2766
2786
|
Pe as Group,
|
|
2767
2787
|
ze as HTMLPreview,
|
|
2768
2788
|
Ae as Image,
|
|
@@ -2780,9 +2800,9 @@ export {
|
|
|
2780
2800
|
Ve as ProgressBar,
|
|
2781
2801
|
qe as Radio,
|
|
2782
2802
|
Me as Reference,
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2803
|
+
rt as SearchFieldTypes,
|
|
2804
|
+
Et as SearchFilter,
|
|
2805
|
+
E as Selection,
|
|
2786
2806
|
je as Separator,
|
|
2787
2807
|
B as Spinner,
|
|
2788
2808
|
He as Steps,
|
|
@@ -2792,14 +2812,14 @@ export {
|
|
|
2792
2812
|
L as Text,
|
|
2793
2813
|
Qe as Time,
|
|
2794
2814
|
Le as Timeline,
|
|
2795
|
-
|
|
2815
|
+
Wt as Tree,
|
|
2796
2816
|
C as Widget,
|
|
2797
|
-
|
|
2798
|
-
|
|
2817
|
+
Yt as graphFieldUtils,
|
|
2818
|
+
Dt as graphProcessor,
|
|
2799
2819
|
ne as parseContext,
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2820
|
+
Pt as parseContextFields,
|
|
2821
|
+
St as parseDomainFields,
|
|
2822
|
+
Vt as parseGraph,
|
|
2823
|
+
It as transformDomainForChildWidget
|
|
2804
2824
|
};
|
|
2805
2825
|
//# sourceMappingURL=ooui.es.js.map
|