@gisce/ooui 2.18.0-alpha.3 → 2.18.0-alpha.5
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/Indicator.d.ts.map +1 -1
- package/dist/Spinner.d.ts +9 -0
- package/dist/Spinner.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 +130 -108
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Indicator.ts +5 -1
- package/src/Spinner.ts +23 -0
- package/src/WidgetFactory.ts +4 -0
- package/src/index.ts +2 -0
- package/src/spec/Spinner.spec.ts +35 -0
package/dist/ooui.es.js
CHANGED
|
@@ -61,7 +61,7 @@ const be = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ye
|
|
|
61
61
|
modifiedExpectedValue: null,
|
|
62
62
|
directOutcome: !1
|
|
63
63
|
} : (r.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject = r.modifiedValueInObject === void 0 ? !1 : r.modifiedValueInObject, r.modifiedValueInObject = r.modifiedValueInObject === null ? !1 : r.modifiedValueInObject), s[i].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
|
|
64
|
-
},
|
|
64
|
+
}, xe = ({
|
|
65
65
|
attrs: i,
|
|
66
66
|
values: t,
|
|
67
67
|
fields: e,
|
|
@@ -69,11 +69,11 @@ const be = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ye
|
|
|
69
69
|
}) => {
|
|
70
70
|
const h = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(h), u = JSON.parse(_), d = {};
|
|
71
71
|
for (const f of Object.keys(u)) {
|
|
72
|
-
const
|
|
73
|
-
|
|
72
|
+
const x = u[f].map((y) => ye({ entry: y, values: t, fields: e })).every((y) => y);
|
|
73
|
+
x ? d[f] = !0 : f === "readonly" && !x && s === "button" && (d[f] = !1);
|
|
74
74
|
}
|
|
75
75
|
return d;
|
|
76
|
-
},
|
|
76
|
+
}, pe = ({
|
|
77
77
|
attrs: i,
|
|
78
78
|
values: t,
|
|
79
79
|
fields: e,
|
|
@@ -114,14 +114,14 @@ const be = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ye
|
|
|
114
114
|
fallbackMode: r = !0
|
|
115
115
|
}) => {
|
|
116
116
|
let a = {}, l = {};
|
|
117
|
-
if (i.attrs && (l =
|
|
117
|
+
if (i.attrs && (l = xe({
|
|
118
118
|
attrs: i.attrs,
|
|
119
119
|
values: t,
|
|
120
120
|
fields: e,
|
|
121
121
|
widgetType: s
|
|
122
122
|
})), i.json_attrs)
|
|
123
123
|
try {
|
|
124
|
-
a =
|
|
124
|
+
a = pe({
|
|
125
125
|
attrs: i.json_attrs,
|
|
126
126
|
values: t,
|
|
127
127
|
fields: e,
|
|
@@ -434,7 +434,7 @@ class Q extends g {
|
|
|
434
434
|
this._fieldForLabel = e;
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
class
|
|
437
|
+
class z {
|
|
438
438
|
constructor(t = 4, e = 6, s = !1, r = void 0) {
|
|
439
439
|
/**
|
|
440
440
|
* Number of columns the container is divided
|
|
@@ -558,7 +558,7 @@ const O = class O extends C {
|
|
|
558
558
|
* Container label
|
|
559
559
|
*/
|
|
560
560
|
n(this, "_label", "");
|
|
561
|
-
this._container = new
|
|
561
|
+
this._container = new z(
|
|
562
562
|
e == null ? void 0 : e.col,
|
|
563
563
|
O._defaultColspan,
|
|
564
564
|
this.readOnly,
|
|
@@ -610,8 +610,8 @@ const O = class O extends C {
|
|
|
610
610
|
}
|
|
611
611
|
};
|
|
612
612
|
n(O, "_defaultColspan", 6);
|
|
613
|
-
let
|
|
614
|
-
const T = class T extends
|
|
613
|
+
let p = O;
|
|
614
|
+
const T = class T extends p {
|
|
615
615
|
constructor(e) {
|
|
616
616
|
super(e);
|
|
617
617
|
n(this, "_tabPosition", "top");
|
|
@@ -636,7 +636,7 @@ const T = class T extends x {
|
|
|
636
636
|
};
|
|
637
637
|
n(T, "_defaultColspan", 3);
|
|
638
638
|
let j = T;
|
|
639
|
-
class Fe extends
|
|
639
|
+
class Fe extends p {
|
|
640
640
|
constructor(e) {
|
|
641
641
|
super(e);
|
|
642
642
|
n(this, "_icon", null);
|
|
@@ -649,7 +649,7 @@ class Fe extends x {
|
|
|
649
649
|
this._icon = e;
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
class Ce extends
|
|
652
|
+
class Ce extends p {
|
|
653
653
|
constructor(e) {
|
|
654
654
|
super(e);
|
|
655
655
|
n(this, "_icon", null);
|
|
@@ -734,7 +734,7 @@ class X extends g {
|
|
|
734
734
|
this._danger = e;
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
-
class ke extends
|
|
737
|
+
class ke extends p {
|
|
738
738
|
constructor(e) {
|
|
739
739
|
super(e);
|
|
740
740
|
n(this, "_defaultName", "");
|
|
@@ -965,12 +965,12 @@ class Ee extends g {
|
|
|
965
965
|
}
|
|
966
966
|
class Ie extends B {
|
|
967
967
|
}
|
|
968
|
-
class
|
|
968
|
+
class Se extends g {
|
|
969
969
|
constructor(t) {
|
|
970
970
|
super(t);
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
|
-
class
|
|
973
|
+
class ze extends g {
|
|
974
974
|
constructor(t) {
|
|
975
975
|
super(t);
|
|
976
976
|
}
|
|
@@ -1168,7 +1168,12 @@ class Ae extends W {
|
|
|
1168
1168
|
*/
|
|
1169
1169
|
n(this, "_actionId");
|
|
1170
1170
|
n(this, "_height");
|
|
1171
|
-
this._card = !1, this._icon = "", this._suffix = "", this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = this._parsedWidgetProps.icon || "", this._suffix = this._parsedWidgetProps.suffix || ""), e && (e.action_id && (this._actionId = parseInt(e.action_id)), e.height
|
|
1171
|
+
if (this._card = !1, this._icon = "", this._suffix = "", this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = this._parsedWidgetProps.icon || "", this._suffix = this._parsedWidgetProps.suffix || ""), e && (e.action_id && (this._actionId = parseInt(e.action_id)), e.height))
|
|
1172
|
+
try {
|
|
1173
|
+
this._height = parseInt(e.height);
|
|
1174
|
+
} catch (s) {
|
|
1175
|
+
console.error(s);
|
|
1176
|
+
}
|
|
1172
1177
|
}
|
|
1173
1178
|
get card() {
|
|
1174
1179
|
return this._card;
|
|
@@ -1327,7 +1332,7 @@ class qe extends g {
|
|
|
1327
1332
|
super(t);
|
|
1328
1333
|
}
|
|
1329
1334
|
}
|
|
1330
|
-
class Je extends
|
|
1335
|
+
class Je extends p {
|
|
1331
1336
|
constructor(e) {
|
|
1332
1337
|
super(e);
|
|
1333
1338
|
/**
|
|
@@ -1412,6 +1417,19 @@ class Qe extends g {
|
|
|
1412
1417
|
this._size = e;
|
|
1413
1418
|
}
|
|
1414
1419
|
}
|
|
1420
|
+
class Xe extends p {
|
|
1421
|
+
constructor(e) {
|
|
1422
|
+
super(e);
|
|
1423
|
+
n(this, "_loading", !1);
|
|
1424
|
+
e && e.loading && (this._loading = e.loading);
|
|
1425
|
+
}
|
|
1426
|
+
get loading() {
|
|
1427
|
+
return this._loading;
|
|
1428
|
+
}
|
|
1429
|
+
set loading(e) {
|
|
1430
|
+
this._loading = e;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1415
1433
|
class L {
|
|
1416
1434
|
constructor() {
|
|
1417
1435
|
/**
|
|
@@ -1464,10 +1482,10 @@ class L {
|
|
|
1464
1482
|
this._widgetClass = We;
|
|
1465
1483
|
break;
|
|
1466
1484
|
case "date":
|
|
1467
|
-
this._widgetClass =
|
|
1485
|
+
this._widgetClass = Se;
|
|
1468
1486
|
break;
|
|
1469
1487
|
case "datetime":
|
|
1470
|
-
this._widgetClass =
|
|
1488
|
+
this._widgetClass = ze;
|
|
1471
1489
|
break;
|
|
1472
1490
|
case "progressbar":
|
|
1473
1491
|
this._widgetClass = Ie;
|
|
@@ -1552,6 +1570,9 @@ class L {
|
|
|
1552
1570
|
case "arrow_steps":
|
|
1553
1571
|
this._widgetClass = R;
|
|
1554
1572
|
break;
|
|
1573
|
+
case "spinner":
|
|
1574
|
+
this._widgetClass = Xe;
|
|
1575
|
+
break;
|
|
1555
1576
|
}
|
|
1556
1577
|
}
|
|
1557
1578
|
createWidget(t, e) {
|
|
@@ -1573,7 +1594,7 @@ class L {
|
|
|
1573
1594
|
}
|
|
1574
1595
|
}
|
|
1575
1596
|
}
|
|
1576
|
-
const
|
|
1597
|
+
const Ue = ({
|
|
1577
1598
|
fieldName: i,
|
|
1578
1599
|
values: t,
|
|
1579
1600
|
fields: e
|
|
@@ -1598,7 +1619,7 @@ const Xe = ({
|
|
|
1598
1619
|
r[o] = h.some((_) => _);
|
|
1599
1620
|
}
|
|
1600
1621
|
return r;
|
|
1601
|
-
},
|
|
1622
|
+
}, Ke = ({
|
|
1602
1623
|
states: i,
|
|
1603
1624
|
values: t
|
|
1604
1625
|
}) => {
|
|
@@ -1607,7 +1628,7 @@ const Xe = ({
|
|
|
1607
1628
|
const e = i.split(",");
|
|
1608
1629
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1609
1630
|
};
|
|
1610
|
-
function
|
|
1631
|
+
function Ze({
|
|
1611
1632
|
values: i = {},
|
|
1612
1633
|
fieldName: t,
|
|
1613
1634
|
fields: e = {}
|
|
@@ -1635,12 +1656,12 @@ const te = ({
|
|
|
1635
1656
|
return d.forEach((c) => {
|
|
1636
1657
|
const m = c[1];
|
|
1637
1658
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1638
|
-
const
|
|
1659
|
+
const x = Ze({
|
|
1639
1660
|
values: t,
|
|
1640
1661
|
fields: e,
|
|
1641
1662
|
fieldName: m === "active_id" ? "id" : m
|
|
1642
1663
|
});
|
|
1643
|
-
f[c[0].replace(/'/g, "")] =
|
|
1664
|
+
f[c[0].replace(/'/g, "")] = x || void 0;
|
|
1644
1665
|
} else
|
|
1645
1666
|
c[1] === "true" ? f[c[0].replace(/'/g, "")] = !0 : c[1] === "false" ? f[c[0].replace(/'/g, "")] = !1 : f[c[0].replace(/'/g, "")] = c[1].replace(
|
|
1646
1667
|
/'/g,
|
|
@@ -1650,7 +1671,7 @@ const te = ({
|
|
|
1650
1671
|
} catch {
|
|
1651
1672
|
return;
|
|
1652
1673
|
}
|
|
1653
|
-
},
|
|
1674
|
+
}, kt = (i) => {
|
|
1654
1675
|
const t = [];
|
|
1655
1676
|
try {
|
|
1656
1677
|
return !i || se(i) || typeof i != "string" ? t : ie(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) => {
|
|
@@ -1670,26 +1691,26 @@ function ie(i) {
|
|
|
1670
1691
|
function se(i) {
|
|
1671
1692
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1672
1693
|
}
|
|
1673
|
-
const
|
|
1694
|
+
const et = (i) => {
|
|
1674
1695
|
const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1675
1696
|
return {
|
|
1676
1697
|
method: e,
|
|
1677
1698
|
args: r
|
|
1678
1699
|
};
|
|
1679
1700
|
};
|
|
1680
|
-
function
|
|
1701
|
+
function tt(i) {
|
|
1681
1702
|
const t = [];
|
|
1682
1703
|
function e(s) {
|
|
1683
1704
|
const r = [];
|
|
1684
1705
|
for (const a of s)
|
|
1685
|
-
a instanceof
|
|
1706
|
+
a instanceof p ? e(a._container.rows.flat()) : r.push(a);
|
|
1686
1707
|
r.length > 0 && t.push(r);
|
|
1687
1708
|
}
|
|
1688
1709
|
for (const s of i)
|
|
1689
1710
|
e(s);
|
|
1690
1711
|
return t.flat();
|
|
1691
1712
|
}
|
|
1692
|
-
class
|
|
1713
|
+
class Ot {
|
|
1693
1714
|
constructor(t, e = 4) {
|
|
1694
1715
|
/**
|
|
1695
1716
|
* Object containing fields specification of the form.
|
|
@@ -1740,7 +1761,7 @@ class kt {
|
|
|
1740
1761
|
* Context for each field in the form
|
|
1741
1762
|
*/
|
|
1742
1763
|
n(this, "_contextForFields", {});
|
|
1743
|
-
this._fields = t, this._container = new
|
|
1764
|
+
this._fields = t, this._container = new z(e, 6, !1, "root");
|
|
1744
1765
|
}
|
|
1745
1766
|
get fields() {
|
|
1746
1767
|
return this._fields;
|
|
@@ -1797,7 +1818,7 @@ class kt {
|
|
|
1797
1818
|
fields: a.children,
|
|
1798
1819
|
container: this._container,
|
|
1799
1820
|
values: s
|
|
1800
|
-
}),
|
|
1821
|
+
}), tt(this._container._rows).forEach((h) => {
|
|
1801
1822
|
const _ = h;
|
|
1802
1823
|
_._id && _._context && (this._contextForFields[_._id] = h._context);
|
|
1803
1824
|
});
|
|
@@ -1836,10 +1857,10 @@ class kt {
|
|
|
1836
1857
|
widgetType: l
|
|
1837
1858
|
});
|
|
1838
1859
|
let f;
|
|
1839
|
-
l === "button" && u.states ? f =
|
|
1860
|
+
l === "button" && u.states ? f = Ke({
|
|
1840
1861
|
states: u.states,
|
|
1841
1862
|
values: s
|
|
1842
|
-
}) : f =
|
|
1863
|
+
}) : f = Ue({
|
|
1843
1864
|
fieldName: u.name,
|
|
1844
1865
|
values: s,
|
|
1845
1866
|
fields: this._fields
|
|
@@ -1849,21 +1870,21 @@ class kt {
|
|
|
1849
1870
|
values: s,
|
|
1850
1871
|
fields: this._fields
|
|
1851
1872
|
});
|
|
1852
|
-
u.on_change && (this._onChangeFields[u.name] =
|
|
1873
|
+
u.on_change && (this._onChangeFields[u.name] = et(
|
|
1853
1874
|
u.on_change
|
|
1854
1875
|
));
|
|
1855
1876
|
let m;
|
|
1856
1877
|
q(u.domain) ? m = u.domain : q((F = this._fields[u.name]) == null ? void 0 : F.domain) && (m = this._fields[u.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1857
|
-
const
|
|
1878
|
+
const x = {
|
|
1858
1879
|
...d,
|
|
1859
1880
|
...f,
|
|
1860
1881
|
context: c,
|
|
1861
1882
|
domain: m,
|
|
1862
1883
|
key: `${this._keyIdx}`
|
|
1863
1884
|
};
|
|
1864
|
-
e.readOnly && (
|
|
1865
|
-
const y = r.createWidget(_,
|
|
1866
|
-
y.invisible && y instanceof g && this._invisibleFields.push(
|
|
1885
|
+
e.readOnly && (x.readonly = !0);
|
|
1886
|
+
const y = r.createWidget(_, x);
|
|
1887
|
+
y.invisible && y instanceof g && this._invisibleFields.push(x.name), y instanceof p && this.parseNode({
|
|
1867
1888
|
fields: h,
|
|
1868
1889
|
container: y.container,
|
|
1869
1890
|
values: s
|
|
@@ -1881,7 +1902,7 @@ class kt {
|
|
|
1881
1902
|
function q(i) {
|
|
1882
1903
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1883
1904
|
}
|
|
1884
|
-
class
|
|
1905
|
+
class Tt {
|
|
1885
1906
|
constructor(t) {
|
|
1886
1907
|
/**
|
|
1887
1908
|
* Object containing fields specification of the form.
|
|
@@ -1987,7 +2008,7 @@ class Ot {
|
|
|
1987
2008
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
1988
2009
|
}
|
|
1989
2010
|
}
|
|
1990
|
-
const
|
|
2011
|
+
const it = {
|
|
1991
2012
|
text: "text",
|
|
1992
2013
|
many2one: "many2one",
|
|
1993
2014
|
char: "char",
|
|
@@ -2000,7 +2021,7 @@ const tt = {
|
|
|
2000
2021
|
date: "date",
|
|
2001
2022
|
datetime: "datetime"
|
|
2002
2023
|
};
|
|
2003
|
-
class
|
|
2024
|
+
class Pt {
|
|
2004
2025
|
constructor(t, e, s = 8) {
|
|
2005
2026
|
/**
|
|
2006
2027
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -2012,7 +2033,7 @@ class Tt {
|
|
|
2012
2033
|
n(this, "_fields");
|
|
2013
2034
|
n(this, "_simpleSearchContainer");
|
|
2014
2035
|
n(this, "_advancedSearchContainer");
|
|
2015
|
-
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new
|
|
2036
|
+
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new z(s), this._advancedSearchContainer = new z(s);
|
|
2016
2037
|
}
|
|
2017
2038
|
get searchFields() {
|
|
2018
2039
|
return this._searchFields;
|
|
@@ -2048,7 +2069,7 @@ class Tt {
|
|
|
2048
2069
|
colspan: 2
|
|
2049
2070
|
}, { type: a, widget: l } = r;
|
|
2050
2071
|
let o = l ?? a;
|
|
2051
|
-
return
|
|
2072
|
+
return it[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
2052
2073
|
});
|
|
2053
2074
|
}
|
|
2054
2075
|
/**
|
|
@@ -2059,7 +2080,7 @@ class Tt {
|
|
|
2059
2080
|
return this.advancedSearchContainer.findById(t);
|
|
2060
2081
|
}
|
|
2061
2082
|
}
|
|
2062
|
-
const
|
|
2083
|
+
const Wt = ({
|
|
2063
2084
|
domain: i,
|
|
2064
2085
|
widgetFieldName: t
|
|
2065
2086
|
}) => {
|
|
@@ -2074,8 +2095,8 @@ const Pt = ({
|
|
|
2074
2095
|
r.length - 1
|
|
2075
2096
|
)) : (o = r, h = "id"), o === t && e.push([h, a, l]);
|
|
2076
2097
|
}), e;
|
|
2077
|
-
},
|
|
2078
|
-
class
|
|
2098
|
+
}, Et = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2099
|
+
class st {
|
|
2079
2100
|
constructor(t) {
|
|
2080
2101
|
n(this, "_action_id", null);
|
|
2081
2102
|
n(this, "_position", null);
|
|
@@ -2088,7 +2109,7 @@ class it {
|
|
|
2088
2109
|
return this._position;
|
|
2089
2110
|
}
|
|
2090
2111
|
}
|
|
2091
|
-
class
|
|
2112
|
+
class It {
|
|
2092
2113
|
constructor(t) {
|
|
2093
2114
|
n(this, "_string", null);
|
|
2094
2115
|
n(this, "_items", []);
|
|
@@ -2096,7 +2117,7 @@ class Et {
|
|
|
2096
2117
|
this._string = e.attributes.string || null;
|
|
2097
2118
|
const { children: s } = e;
|
|
2098
2119
|
s.forEach((r) => {
|
|
2099
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
2120
|
+
r.tagName === "dashboard_item" && this._items.push(new st(r.attributes));
|
|
2100
2121
|
});
|
|
2101
2122
|
}
|
|
2102
2123
|
get string() {
|
|
@@ -2134,7 +2155,7 @@ class ne {
|
|
|
2134
2155
|
return this._y_range;
|
|
2135
2156
|
}
|
|
2136
2157
|
}
|
|
2137
|
-
const
|
|
2158
|
+
const nt = (i) => i === 1 || i === "1" || i === !0 || i === "True";
|
|
2138
2159
|
class re extends ne {
|
|
2139
2160
|
constructor(e, s) {
|
|
2140
2161
|
super(s);
|
|
@@ -2143,7 +2164,7 @@ class re extends ne {
|
|
|
2143
2164
|
n(this, "_totalDomain", null);
|
|
2144
2165
|
n(this, "_showPercent", !1);
|
|
2145
2166
|
n(this, "_suffix", null);
|
|
2146
|
-
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 =
|
|
2167
|
+
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 = nt(s.attributes.showPercent);
|
|
2147
2168
|
}
|
|
2148
2169
|
get color() {
|
|
2149
2170
|
return this._color;
|
|
@@ -2161,7 +2182,7 @@ class re extends ne {
|
|
|
2161
2182
|
return this._suffix;
|
|
2162
2183
|
}
|
|
2163
2184
|
}
|
|
2164
|
-
class
|
|
2185
|
+
class rt extends re {
|
|
2165
2186
|
constructor(e, s) {
|
|
2166
2187
|
super(e, s);
|
|
2167
2188
|
n(this, "_field");
|
|
@@ -2181,7 +2202,7 @@ class nt extends re {
|
|
|
2181
2202
|
return this._operator;
|
|
2182
2203
|
}
|
|
2183
2204
|
}
|
|
2184
|
-
const
|
|
2205
|
+
const at = (i) => {
|
|
2185
2206
|
const t = [];
|
|
2186
2207
|
let e;
|
|
2187
2208
|
if (i.forEach((s) => {
|
|
@@ -2191,10 +2212,10 @@ const rt = (i) => {
|
|
|
2191
2212
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2192
2213
|
if (!l)
|
|
2193
2214
|
throw new Error("Missing name attribute for field");
|
|
2194
|
-
r === "x" ? e = new
|
|
2215
|
+
r === "x" ? e = new ct({
|
|
2195
2216
|
name: l
|
|
2196
2217
|
}) : r === "y" && t.push(
|
|
2197
|
-
new
|
|
2218
|
+
new ot({
|
|
2198
2219
|
name: l,
|
|
2199
2220
|
operator: a,
|
|
2200
2221
|
label: o,
|
|
@@ -2217,7 +2238,7 @@ class D extends ne {
|
|
|
2217
2238
|
n(this, "_x");
|
|
2218
2239
|
n(this, "_y");
|
|
2219
2240
|
this._type = e;
|
|
2220
|
-
const r =
|
|
2241
|
+
const r = at(s.children);
|
|
2221
2242
|
this._x = r.x, this._y = r.y;
|
|
2222
2243
|
}
|
|
2223
2244
|
get x() {
|
|
@@ -2227,17 +2248,17 @@ class D extends ne {
|
|
|
2227
2248
|
return this._y;
|
|
2228
2249
|
}
|
|
2229
2250
|
}
|
|
2230
|
-
const
|
|
2251
|
+
const lt = {
|
|
2231
2252
|
indicator: re,
|
|
2232
|
-
indicatorField:
|
|
2253
|
+
indicatorField: rt,
|
|
2233
2254
|
line: D,
|
|
2234
2255
|
bar: D,
|
|
2235
2256
|
pie: D
|
|
2236
|
-
},
|
|
2257
|
+
}, St = (i) => {
|
|
2237
2258
|
const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2238
2259
|
if (!e)
|
|
2239
2260
|
throw new Error(`${e} is not a valid graph`);
|
|
2240
|
-
const s =
|
|
2261
|
+
const s = lt[e];
|
|
2241
2262
|
if (!s)
|
|
2242
2263
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2243
2264
|
return new s(e, t);
|
|
@@ -2255,7 +2276,7 @@ class ae {
|
|
|
2255
2276
|
return this._axis;
|
|
2256
2277
|
}
|
|
2257
2278
|
}
|
|
2258
|
-
class
|
|
2279
|
+
class ot extends ae {
|
|
2259
2280
|
constructor({
|
|
2260
2281
|
name: e,
|
|
2261
2282
|
operator: s,
|
|
@@ -2278,12 +2299,12 @@ class lt extends ae {
|
|
|
2278
2299
|
return this._stacked;
|
|
2279
2300
|
}
|
|
2280
2301
|
}
|
|
2281
|
-
class
|
|
2302
|
+
class ct extends ae {
|
|
2282
2303
|
constructor({ name: t }) {
|
|
2283
2304
|
super({ name: t, axis: "x" });
|
|
2284
2305
|
}
|
|
2285
2306
|
}
|
|
2286
|
-
const
|
|
2307
|
+
const dt = ({ ooui: i }) => {
|
|
2287
2308
|
const e = [i.x.name];
|
|
2288
2309
|
return i.y ? (i.y.forEach((s) => {
|
|
2289
2310
|
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
@@ -2307,25 +2328,25 @@ function G({
|
|
|
2307
2328
|
}
|
|
2308
2329
|
const zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2309
2330
|
__proto__: null,
|
|
2310
|
-
getFieldsToRetrieve:
|
|
2331
|
+
getFieldsToRetrieve: dt,
|
|
2311
2332
|
getValueAndLabelForField: G
|
|
2312
2333
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2313
|
-
function
|
|
2334
|
+
function ut({
|
|
2314
2335
|
values: i,
|
|
2315
2336
|
timerange: t,
|
|
2316
2337
|
interval: e = 1
|
|
2317
2338
|
}) {
|
|
2318
|
-
const s =
|
|
2339
|
+
const s = ft({
|
|
2319
2340
|
values: i,
|
|
2320
2341
|
timerange: t
|
|
2321
2342
|
});
|
|
2322
|
-
return
|
|
2343
|
+
return ht({
|
|
2323
2344
|
values: s,
|
|
2324
2345
|
timerange: t,
|
|
2325
2346
|
interval: e
|
|
2326
2347
|
});
|
|
2327
2348
|
}
|
|
2328
|
-
function
|
|
2349
|
+
function ht({
|
|
2329
2350
|
values: i,
|
|
2330
2351
|
timerange: t,
|
|
2331
2352
|
interval: e = 1
|
|
@@ -2343,7 +2364,7 @@ function ut({
|
|
|
2343
2364
|
return;
|
|
2344
2365
|
const d = u.x, f = h[_ + 1].x;
|
|
2345
2366
|
if (!le([d, f], a)) {
|
|
2346
|
-
const c =
|
|
2367
|
+
const c = _t({
|
|
2347
2368
|
dates: [d, f],
|
|
2348
2369
|
timerange: t,
|
|
2349
2370
|
interval: e
|
|
@@ -2360,7 +2381,7 @@ function ut({
|
|
|
2360
2381
|
}
|
|
2361
2382
|
}), s.sort((o, h) => o.x < h.x ? -1 : o.x > h.x ? 1 : 0);
|
|
2362
2383
|
}
|
|
2363
|
-
function
|
|
2384
|
+
function _t({
|
|
2364
2385
|
dates: i,
|
|
2365
2386
|
timerange: t,
|
|
2366
2387
|
interval: e = 1
|
|
@@ -2372,21 +2393,21 @@ function ht({
|
|
|
2372
2393
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2373
2394
|
const o = a[l], h = a[l + 1];
|
|
2374
2395
|
if (!le([o, h], r)) {
|
|
2375
|
-
const _ = P(o,
|
|
2396
|
+
const _ = P(o, S(r)).add(
|
|
2376
2397
|
e,
|
|
2377
2398
|
r
|
|
2378
|
-
), u = P(h,
|
|
2399
|
+
), u = P(h, S(r));
|
|
2379
2400
|
for (; _.isBefore(u); )
|
|
2380
|
-
s.push(_.format(
|
|
2401
|
+
s.push(_.format(S(r))), _.add(e, r);
|
|
2381
2402
|
}
|
|
2382
2403
|
}
|
|
2383
2404
|
return s;
|
|
2384
2405
|
}
|
|
2385
|
-
function
|
|
2406
|
+
function ft({
|
|
2386
2407
|
values: i,
|
|
2387
2408
|
timerange: t
|
|
2388
2409
|
}) {
|
|
2389
|
-
const e =
|
|
2410
|
+
const e = gt({
|
|
2390
2411
|
values: i,
|
|
2391
2412
|
timerange: t
|
|
2392
2413
|
}), s = [], r = oe({
|
|
@@ -2404,23 +2425,23 @@ function _t({
|
|
|
2404
2425
|
});
|
|
2405
2426
|
}), s;
|
|
2406
2427
|
}
|
|
2407
|
-
function
|
|
2428
|
+
function gt({
|
|
2408
2429
|
values: i,
|
|
2409
2430
|
timerange: t
|
|
2410
2431
|
}) {
|
|
2411
2432
|
return i.map((e) => ({
|
|
2412
2433
|
...e,
|
|
2413
|
-
x:
|
|
2434
|
+
x: mt({
|
|
2414
2435
|
date: e.x,
|
|
2415
2436
|
timerange: t
|
|
2416
2437
|
})
|
|
2417
2438
|
}));
|
|
2418
2439
|
}
|
|
2419
|
-
function
|
|
2440
|
+
function mt({
|
|
2420
2441
|
date: i,
|
|
2421
2442
|
timerange: t
|
|
2422
2443
|
}) {
|
|
2423
|
-
let e =
|
|
2444
|
+
let e = bt(i);
|
|
2424
2445
|
const s = P(i, e);
|
|
2425
2446
|
switch (t) {
|
|
2426
2447
|
case "hour": {
|
|
@@ -2446,12 +2467,12 @@ function gt({
|
|
|
2446
2467
|
}
|
|
2447
2468
|
return s.format(e);
|
|
2448
2469
|
}
|
|
2449
|
-
function
|
|
2470
|
+
function bt(i) {
|
|
2450
2471
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2451
2472
|
}
|
|
2452
2473
|
function le(i, t) {
|
|
2453
2474
|
let e = !1;
|
|
2454
|
-
const s =
|
|
2475
|
+
const s = S(t);
|
|
2455
2476
|
if (i.length === 0)
|
|
2456
2477
|
return !1;
|
|
2457
2478
|
if (i.length === 1)
|
|
@@ -2472,7 +2493,7 @@ function oe({
|
|
|
2472
2493
|
e[o] || (e[o] = []), e[o].push(s);
|
|
2473
2494
|
}), e;
|
|
2474
2495
|
}
|
|
2475
|
-
function
|
|
2496
|
+
function S(i) {
|
|
2476
2497
|
switch (i) {
|
|
2477
2498
|
case "days":
|
|
2478
2499
|
return "YYYY-MM-DD";
|
|
@@ -2487,7 +2508,7 @@ function z(i) {
|
|
|
2487
2508
|
return "YYYY-MM-DD HH:mm";
|
|
2488
2509
|
}
|
|
2489
2510
|
}
|
|
2490
|
-
const
|
|
2511
|
+
const yt = {
|
|
2491
2512
|
count: "count",
|
|
2492
2513
|
"+": "sum",
|
|
2493
2514
|
"-": "subtract",
|
|
@@ -2495,7 +2516,7 @@ const bt = {
|
|
|
2495
2516
|
avg: "average",
|
|
2496
2517
|
min: "min",
|
|
2497
2518
|
max: "max"
|
|
2498
|
-
},
|
|
2519
|
+
}, xt = ({
|
|
2499
2520
|
ooui: i,
|
|
2500
2521
|
values: t,
|
|
2501
2522
|
fields: e,
|
|
@@ -2508,7 +2529,7 @@ const bt = {
|
|
|
2508
2529
|
}), a = [];
|
|
2509
2530
|
i.y.forEach((c) => {
|
|
2510
2531
|
Object.keys(r).forEach((m) => {
|
|
2511
|
-
const
|
|
2532
|
+
const x = r[m].label, y = r[m].entries;
|
|
2512
2533
|
if (c.label) {
|
|
2513
2534
|
const w = N({
|
|
2514
2535
|
fieldName: c.label,
|
|
@@ -2525,7 +2546,7 @@ const bt = {
|
|
|
2525
2546
|
operator: c.operator
|
|
2526
2547
|
});
|
|
2527
2548
|
a.push({
|
|
2528
|
-
x:
|
|
2549
|
+
x: x || !1,
|
|
2529
2550
|
value: he,
|
|
2530
2551
|
type: E,
|
|
2531
2552
|
operator: c.operator,
|
|
@@ -2542,7 +2563,7 @@ const bt = {
|
|
|
2542
2563
|
operator: c.operator
|
|
2543
2564
|
});
|
|
2544
2565
|
a.push({
|
|
2545
|
-
x:
|
|
2566
|
+
x: x || !1,
|
|
2546
2567
|
value: F,
|
|
2547
2568
|
type: ce({
|
|
2548
2569
|
yAxis: c,
|
|
@@ -2562,7 +2583,7 @@ const bt = {
|
|
|
2562
2583
|
(c) => c.x !== !1
|
|
2563
2584
|
));
|
|
2564
2585
|
let d = u;
|
|
2565
|
-
i.timerange ? d =
|
|
2586
|
+
i.timerange ? d = ut({
|
|
2566
2587
|
values: d,
|
|
2567
2588
|
timerange: i.timerange,
|
|
2568
2589
|
interval: i.interval
|
|
@@ -2667,7 +2688,7 @@ function de(i, t = 0.1) {
|
|
|
2667
2688
|
max: r + a
|
|
2668
2689
|
};
|
|
2669
2690
|
}
|
|
2670
|
-
const
|
|
2691
|
+
const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2671
2692
|
__proto__: null,
|
|
2672
2693
|
getAllObjectsInGroupedValues: pt,
|
|
2673
2694
|
getMinMax: de,
|
|
@@ -2675,8 +2696,8 @@ const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2675
2696
|
getValuesForYField: M,
|
|
2676
2697
|
getValuesGroupedByField: N,
|
|
2677
2698
|
getYAxisFieldname: ce,
|
|
2678
|
-
labelsForOperator:
|
|
2679
|
-
processGraphData:
|
|
2699
|
+
labelsForOperator: yt,
|
|
2700
|
+
processGraphData: xt
|
|
2680
2701
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2681
2702
|
export {
|
|
2682
2703
|
Je as Alert,
|
|
@@ -2688,24 +2709,24 @@ export {
|
|
|
2688
2709
|
$ as Char,
|
|
2689
2710
|
ee as CodeEditor,
|
|
2690
2711
|
He as Comments,
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2712
|
+
z as Container,
|
|
2713
|
+
p as ContainerWidget,
|
|
2714
|
+
It as Dashboard,
|
|
2715
|
+
st as DashboardItem,
|
|
2716
|
+
Se as Date,
|
|
2717
|
+
ze as DateTime,
|
|
2697
2718
|
Qe as Email,
|
|
2698
2719
|
g as Field,
|
|
2699
2720
|
B as Float,
|
|
2700
2721
|
We as FloatTime,
|
|
2701
|
-
|
|
2722
|
+
Ot as Form,
|
|
2702
2723
|
ne as Graph,
|
|
2703
2724
|
ae as GraphAxis,
|
|
2704
2725
|
D as GraphChart,
|
|
2705
2726
|
re as GraphIndicator,
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2727
|
+
rt as GraphIndicatorField,
|
|
2728
|
+
ct as GraphXAxis,
|
|
2729
|
+
ot as GraphYAxis,
|
|
2709
2730
|
Ce as Group,
|
|
2710
2731
|
Ee as HTMLPreview,
|
|
2711
2732
|
je as Image,
|
|
@@ -2723,10 +2744,11 @@ export {
|
|
|
2723
2744
|
Ie as ProgressBar,
|
|
2724
2745
|
Ge as Radio,
|
|
2725
2746
|
Ye as Reference,
|
|
2726
|
-
|
|
2727
|
-
|
|
2747
|
+
it as SearchFieldTypes,
|
|
2748
|
+
Pt as SearchFilter,
|
|
2728
2749
|
W as Selection,
|
|
2729
2750
|
Ve as Separator,
|
|
2751
|
+
Xe as Spinner,
|
|
2730
2752
|
Re as Steps,
|
|
2731
2753
|
$e as Switch,
|
|
2732
2754
|
Le as Tag,
|
|
@@ -2734,14 +2756,14 @@ export {
|
|
|
2734
2756
|
A as Text,
|
|
2735
2757
|
qe as Time,
|
|
2736
2758
|
Ne as Timeline,
|
|
2737
|
-
|
|
2759
|
+
Tt as Tree,
|
|
2738
2760
|
C as Widget,
|
|
2739
2761
|
zt as graphFieldUtils,
|
|
2740
|
-
|
|
2762
|
+
Vt as graphProcessor,
|
|
2741
2763
|
te as parseContext,
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2764
|
+
kt as parseContextFields,
|
|
2765
|
+
Et as parseDomainFields,
|
|
2766
|
+
St as parseGraph,
|
|
2767
|
+
Wt as transformDomainForChildWidget
|
|
2746
2768
|
};
|
|
2747
2769
|
//# sourceMappingURL=ooui.es.js.map
|