@gisce/ooui 2.5.0 → 2.6.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/Alert.d.ts +22 -0
- package/dist/Alert.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 +142 -101
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Alert.ts +65 -0
- package/src/WidgetFactory.ts +4 -0
- package/src/index.ts +2 -0
- package/src/spec/Alert.spec.ts +50 -0
package/dist/ooui.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var n = (s, t, e) => (de(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
|
4
4
|
import { decode as ue } from "html-entities";
|
|
5
5
|
import { evaluateCondition as he } from "@gisce/conscheck";
|
|
6
6
|
import * as Y from "txml";
|
|
7
|
-
import
|
|
7
|
+
import T from "moment";
|
|
8
8
|
const C = class C {
|
|
9
9
|
constructor(t) {
|
|
10
10
|
/**
|
|
@@ -829,7 +829,7 @@ class B extends g {
|
|
|
829
829
|
this._translatable = e;
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
|
-
class
|
|
832
|
+
class E extends g {
|
|
833
833
|
constructor(e) {
|
|
834
834
|
super(e);
|
|
835
835
|
/**
|
|
@@ -920,9 +920,9 @@ class ke extends L {
|
|
|
920
920
|
}
|
|
921
921
|
class Oe extends g {
|
|
922
922
|
}
|
|
923
|
-
class
|
|
923
|
+
class Te extends L {
|
|
924
924
|
}
|
|
925
|
-
class
|
|
925
|
+
class Ee extends g {
|
|
926
926
|
constructor(t) {
|
|
927
927
|
super(t);
|
|
928
928
|
}
|
|
@@ -1075,7 +1075,7 @@ class We extends F {
|
|
|
1075
1075
|
return null;
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
|
-
class ze extends
|
|
1078
|
+
class ze extends E {
|
|
1079
1079
|
}
|
|
1080
1080
|
class Ie extends g {
|
|
1081
1081
|
constructor(e) {
|
|
@@ -1132,7 +1132,7 @@ class De extends U {
|
|
|
1132
1132
|
return this.parsedWidgetProps.colorField;
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
|
-
class je extends
|
|
1135
|
+
class je extends E {
|
|
1136
1136
|
constructor(e) {
|
|
1137
1137
|
super(e);
|
|
1138
1138
|
n(this, "_nolabel", !0);
|
|
@@ -1215,12 +1215,12 @@ class K extends g {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
class Me extends K {
|
|
1217
1217
|
}
|
|
1218
|
-
class
|
|
1218
|
+
class Ae extends E {
|
|
1219
1219
|
get colors() {
|
|
1220
1220
|
return this._parsedWidgetProps.colors || {};
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
|
-
class
|
|
1223
|
+
class Ne extends E {
|
|
1224
1224
|
constructor(e) {
|
|
1225
1225
|
super(e);
|
|
1226
1226
|
/**
|
|
@@ -1279,6 +1279,43 @@ class $e extends g {
|
|
|
1279
1279
|
super(t);
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
|
+
class Re extends g {
|
|
1283
|
+
constructor(e) {
|
|
1284
|
+
super(e);
|
|
1285
|
+
/**
|
|
1286
|
+
* Alert type
|
|
1287
|
+
*/
|
|
1288
|
+
n(this, "_alertType", "info");
|
|
1289
|
+
n(this, "_title", "");
|
|
1290
|
+
n(this, "_text", "");
|
|
1291
|
+
n(this, "_icon", null);
|
|
1292
|
+
e && (this._nolabel = !0, e.alert_type && (this._alertType = e.alert_type), e.title && (this._title = e.title), e.text && (this._text = e.text), e.icon && (this._icon = e.icon));
|
|
1293
|
+
}
|
|
1294
|
+
get alertType() {
|
|
1295
|
+
return this._alertType;
|
|
1296
|
+
}
|
|
1297
|
+
set alertType(e) {
|
|
1298
|
+
this._alertType = e;
|
|
1299
|
+
}
|
|
1300
|
+
get title() {
|
|
1301
|
+
return this._title;
|
|
1302
|
+
}
|
|
1303
|
+
set title(e) {
|
|
1304
|
+
this._title = e;
|
|
1305
|
+
}
|
|
1306
|
+
get text() {
|
|
1307
|
+
return this._text;
|
|
1308
|
+
}
|
|
1309
|
+
set text(e) {
|
|
1310
|
+
this._text = e;
|
|
1311
|
+
}
|
|
1312
|
+
get icon() {
|
|
1313
|
+
return this._icon;
|
|
1314
|
+
}
|
|
1315
|
+
set icon(e) {
|
|
1316
|
+
this._icon = e;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1282
1319
|
class G {
|
|
1283
1320
|
constructor() {
|
|
1284
1321
|
/**
|
|
@@ -1313,7 +1350,7 @@ class G {
|
|
|
1313
1350
|
this._widgetClass = we;
|
|
1314
1351
|
break;
|
|
1315
1352
|
case "selection":
|
|
1316
|
-
this._widgetClass =
|
|
1353
|
+
this._widgetClass = E;
|
|
1317
1354
|
break;
|
|
1318
1355
|
case "many2one":
|
|
1319
1356
|
this._widgetClass = ve;
|
|
@@ -1331,13 +1368,13 @@ class G {
|
|
|
1331
1368
|
this._widgetClass = ke;
|
|
1332
1369
|
break;
|
|
1333
1370
|
case "date":
|
|
1334
|
-
this._widgetClass =
|
|
1371
|
+
this._widgetClass = Ee;
|
|
1335
1372
|
break;
|
|
1336
1373
|
case "datetime":
|
|
1337
1374
|
this._widgetClass = Pe;
|
|
1338
1375
|
break;
|
|
1339
1376
|
case "progressbar":
|
|
1340
|
-
this._widgetClass =
|
|
1377
|
+
this._widgetClass = Te;
|
|
1341
1378
|
break;
|
|
1342
1379
|
case "many2many":
|
|
1343
1380
|
this._widgetClass = Se;
|
|
@@ -1383,13 +1420,13 @@ class G {
|
|
|
1383
1420
|
this._widgetClass = Me;
|
|
1384
1421
|
break;
|
|
1385
1422
|
case "tag":
|
|
1386
|
-
this._widgetClass =
|
|
1423
|
+
this._widgetClass = Ae;
|
|
1387
1424
|
break;
|
|
1388
1425
|
case "avatar":
|
|
1389
1426
|
this._widgetClass = ye;
|
|
1390
1427
|
break;
|
|
1391
1428
|
case "radio":
|
|
1392
|
-
this._widgetClass =
|
|
1429
|
+
this._widgetClass = Ne;
|
|
1393
1430
|
break;
|
|
1394
1431
|
case "multicheckbox":
|
|
1395
1432
|
this._widgetClass = K;
|
|
@@ -1409,6 +1446,9 @@ class G {
|
|
|
1409
1446
|
case "html_preview":
|
|
1410
1447
|
this._widgetClass = Oe;
|
|
1411
1448
|
break;
|
|
1449
|
+
case "alert":
|
|
1450
|
+
this._widgetClass = Re;
|
|
1451
|
+
break;
|
|
1412
1452
|
}
|
|
1413
1453
|
}
|
|
1414
1454
|
createWidget(t, e) {
|
|
@@ -1429,7 +1469,7 @@ class G {
|
|
|
1429
1469
|
}
|
|
1430
1470
|
}
|
|
1431
1471
|
}
|
|
1432
|
-
const
|
|
1472
|
+
const qe = ({
|
|
1433
1473
|
fieldName: s,
|
|
1434
1474
|
values: t,
|
|
1435
1475
|
fields: e
|
|
@@ -1454,7 +1494,7 @@ const Re = ({
|
|
|
1454
1494
|
r[o] = u.some((_) => _);
|
|
1455
1495
|
}
|
|
1456
1496
|
return r;
|
|
1457
|
-
},
|
|
1497
|
+
}, Je = ({
|
|
1458
1498
|
states: s,
|
|
1459
1499
|
values: t
|
|
1460
1500
|
}) => {
|
|
@@ -1463,7 +1503,7 @@ const Re = ({
|
|
|
1463
1503
|
const e = s.split(",");
|
|
1464
1504
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1465
1505
|
};
|
|
1466
|
-
function
|
|
1506
|
+
function He({
|
|
1467
1507
|
values: s = {},
|
|
1468
1508
|
fieldName: t,
|
|
1469
1509
|
fields: e = {}
|
|
@@ -1491,7 +1531,7 @@ const Z = ({
|
|
|
1491
1531
|
return d.forEach((f) => {
|
|
1492
1532
|
const y = f[1];
|
|
1493
1533
|
if (!f[1].includes("'") && f[1] !== "true" && f[1] !== "false") {
|
|
1494
|
-
const x =
|
|
1534
|
+
const x = He({
|
|
1495
1535
|
values: t,
|
|
1496
1536
|
fields: e,
|
|
1497
1537
|
fieldName: y === "active_id" ? "id" : y
|
|
@@ -1506,7 +1546,7 @@ const Z = ({
|
|
|
1506
1546
|
} catch {
|
|
1507
1547
|
return;
|
|
1508
1548
|
}
|
|
1509
|
-
},
|
|
1549
|
+
}, pt = (s) => {
|
|
1510
1550
|
const t = [];
|
|
1511
1551
|
try {
|
|
1512
1552
|
return !s || te(s) || typeof s != "string" ? t : ee(s) !== null ? [] : (s.trim().length === 0 || s.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
|
|
@@ -1526,14 +1566,14 @@ function ee(s) {
|
|
|
1526
1566
|
function te(s) {
|
|
1527
1567
|
return typeof s == "object" && s !== null && typeof s != "string";
|
|
1528
1568
|
}
|
|
1529
|
-
const
|
|
1569
|
+
const Qe = (s) => {
|
|
1530
1570
|
const t = s.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1531
1571
|
return {
|
|
1532
1572
|
method: e,
|
|
1533
1573
|
args: r
|
|
1534
1574
|
};
|
|
1535
1575
|
};
|
|
1536
|
-
function
|
|
1576
|
+
function Xe(s) {
|
|
1537
1577
|
const t = [];
|
|
1538
1578
|
function e(i) {
|
|
1539
1579
|
const r = [];
|
|
@@ -1545,7 +1585,7 @@ function Qe(s) {
|
|
|
1545
1585
|
e(i);
|
|
1546
1586
|
return t.flat();
|
|
1547
1587
|
}
|
|
1548
|
-
class
|
|
1588
|
+
class wt {
|
|
1549
1589
|
constructor(t, e = 4) {
|
|
1550
1590
|
/**
|
|
1551
1591
|
* Object containing fields specification of the form.
|
|
@@ -1653,7 +1693,7 @@ class pt {
|
|
|
1653
1693
|
fields: a.children,
|
|
1654
1694
|
container: this._container,
|
|
1655
1695
|
values: i
|
|
1656
|
-
}),
|
|
1696
|
+
}), Xe(this._container._rows).forEach((u) => {
|
|
1657
1697
|
const _ = u;
|
|
1658
1698
|
_._id && _._context && (this._contextForFields[_._id] = u._context);
|
|
1659
1699
|
}), console.log(this._contextForFields);
|
|
@@ -1692,10 +1732,10 @@ class pt {
|
|
|
1692
1732
|
widgetType: l
|
|
1693
1733
|
});
|
|
1694
1734
|
let c;
|
|
1695
|
-
l === "button" && h.states ? c =
|
|
1735
|
+
l === "button" && h.states ? c = Je({
|
|
1696
1736
|
states: h.states,
|
|
1697
1737
|
values: i
|
|
1698
|
-
}) : c =
|
|
1738
|
+
}) : c = qe({
|
|
1699
1739
|
fieldName: h.name,
|
|
1700
1740
|
values: i,
|
|
1701
1741
|
fields: this._fields
|
|
@@ -1705,7 +1745,7 @@ class pt {
|
|
|
1705
1745
|
values: i,
|
|
1706
1746
|
fields: this._fields
|
|
1707
1747
|
});
|
|
1708
|
-
h.on_change && (this._onChangeFields[h.name] =
|
|
1748
|
+
h.on_change && (this._onChangeFields[h.name] = Qe(
|
|
1709
1749
|
h.on_change
|
|
1710
1750
|
));
|
|
1711
1751
|
let y;
|
|
@@ -1737,7 +1777,7 @@ class pt {
|
|
|
1737
1777
|
function R(s) {
|
|
1738
1778
|
return s ? Array.isArray(s) && s.length > 0 ? !0 : typeof s == "string" && s !== "" && s !== "[]" : !1;
|
|
1739
1779
|
}
|
|
1740
|
-
class
|
|
1780
|
+
class vt {
|
|
1741
1781
|
constructor(t) {
|
|
1742
1782
|
/**
|
|
1743
1783
|
* Object containing fields specification of the form.
|
|
@@ -1833,7 +1873,7 @@ class wt {
|
|
|
1833
1873
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
1834
1874
|
}
|
|
1835
1875
|
}
|
|
1836
|
-
const
|
|
1876
|
+
const Ue = {
|
|
1837
1877
|
text: "text",
|
|
1838
1878
|
many2one: "many2one",
|
|
1839
1879
|
char: "char",
|
|
@@ -1846,7 +1886,7 @@ const Xe = {
|
|
|
1846
1886
|
date: "date",
|
|
1847
1887
|
datetime: "datetime"
|
|
1848
1888
|
};
|
|
1849
|
-
class
|
|
1889
|
+
class Ft {
|
|
1850
1890
|
constructor(t, e, i = 8) {
|
|
1851
1891
|
/**
|
|
1852
1892
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -1894,7 +1934,7 @@ class vt {
|
|
|
1894
1934
|
colspan: 2
|
|
1895
1935
|
}, { type: a, widget: l } = r;
|
|
1896
1936
|
let o = l ?? a;
|
|
1897
|
-
return
|
|
1937
|
+
return Ue[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
1898
1938
|
});
|
|
1899
1939
|
}
|
|
1900
1940
|
/**
|
|
@@ -1905,7 +1945,7 @@ class vt {
|
|
|
1905
1945
|
return this.advancedSearchContainer.findById(t);
|
|
1906
1946
|
}
|
|
1907
1947
|
}
|
|
1908
|
-
const
|
|
1948
|
+
const Ct = ({
|
|
1909
1949
|
domain: s,
|
|
1910
1950
|
widgetFieldName: t
|
|
1911
1951
|
}) => {
|
|
@@ -1920,8 +1960,8 @@ const Ft = ({
|
|
|
1920
1960
|
r.length - 1
|
|
1921
1961
|
)) : (o = r, u = "id"), o === t && e.push([u, a, l]);
|
|
1922
1962
|
}), e;
|
|
1923
|
-
},
|
|
1924
|
-
class
|
|
1963
|
+
}, kt = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
1964
|
+
class Ke {
|
|
1925
1965
|
constructor(t) {
|
|
1926
1966
|
n(this, "_action_id", null);
|
|
1927
1967
|
n(this, "_position", null);
|
|
@@ -1934,7 +1974,7 @@ class Ue {
|
|
|
1934
1974
|
return this._position;
|
|
1935
1975
|
}
|
|
1936
1976
|
}
|
|
1937
|
-
class
|
|
1977
|
+
class Ot {
|
|
1938
1978
|
constructor(t) {
|
|
1939
1979
|
n(this, "_string", null);
|
|
1940
1980
|
n(this, "_items", []);
|
|
@@ -1942,7 +1982,7 @@ class kt {
|
|
|
1942
1982
|
this._string = e.attributes.string || null;
|
|
1943
1983
|
const { children: i } = e;
|
|
1944
1984
|
i.forEach((r) => {
|
|
1945
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
1985
|
+
r.tagName === "dashboard_item" && this._items.push(new Ke(r.attributes));
|
|
1946
1986
|
});
|
|
1947
1987
|
}
|
|
1948
1988
|
get string() {
|
|
@@ -1973,7 +2013,7 @@ class se {
|
|
|
1973
2013
|
return this._interval;
|
|
1974
2014
|
}
|
|
1975
2015
|
}
|
|
1976
|
-
const
|
|
2016
|
+
const Ze = (s) => s === 1 || s === "1" || s === !0 || s === "True";
|
|
1977
2017
|
class ie extends se {
|
|
1978
2018
|
constructor(e, i) {
|
|
1979
2019
|
super(i);
|
|
@@ -1982,7 +2022,7 @@ class ie extends se {
|
|
|
1982
2022
|
n(this, "_totalDomain", null);
|
|
1983
2023
|
n(this, "_showPercent", !1);
|
|
1984
2024
|
n(this, "_suffix", null);
|
|
1985
|
-
this._type = e, this._color = i.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = i.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = i.attributes.suffix || null, this._totalDomain = b(i.attributes.totalDomain) || null, this._showPercent =
|
|
2025
|
+
this._type = e, this._color = i.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = i.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = i.attributes.suffix || null, this._totalDomain = b(i.attributes.totalDomain) || null, this._showPercent = Ze(i.attributes.showPercent);
|
|
1986
2026
|
}
|
|
1987
2027
|
get color() {
|
|
1988
2028
|
return this._color;
|
|
@@ -2000,7 +2040,7 @@ class ie extends se {
|
|
|
2000
2040
|
return this._suffix;
|
|
2001
2041
|
}
|
|
2002
2042
|
}
|
|
2003
|
-
class
|
|
2043
|
+
class et extends ie {
|
|
2004
2044
|
constructor(e, i) {
|
|
2005
2045
|
super(e, i);
|
|
2006
2046
|
n(this, "_field");
|
|
@@ -2020,7 +2060,7 @@ class Ze extends ie {
|
|
|
2020
2060
|
return this._operator;
|
|
2021
2061
|
}
|
|
2022
2062
|
}
|
|
2023
|
-
const
|
|
2063
|
+
const tt = (s) => {
|
|
2024
2064
|
const t = [];
|
|
2025
2065
|
let e;
|
|
2026
2066
|
if (s.forEach((i) => {
|
|
@@ -2030,10 +2070,10 @@ const et = (s) => {
|
|
|
2030
2070
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2031
2071
|
if (!l)
|
|
2032
2072
|
throw new Error("Missing name attribute for field");
|
|
2033
|
-
r === "x" ? e = new
|
|
2073
|
+
r === "x" ? e = new nt({
|
|
2034
2074
|
name: l
|
|
2035
2075
|
}) : r === "y" && t.push(
|
|
2036
|
-
new
|
|
2076
|
+
new it({
|
|
2037
2077
|
name: l,
|
|
2038
2078
|
operator: a,
|
|
2039
2079
|
label: o,
|
|
@@ -2056,7 +2096,7 @@ class j extends se {
|
|
|
2056
2096
|
n(this, "_x");
|
|
2057
2097
|
n(this, "_y");
|
|
2058
2098
|
this._type = e;
|
|
2059
|
-
const r =
|
|
2099
|
+
const r = tt(i.children);
|
|
2060
2100
|
this._x = r.x, this._y = r.y;
|
|
2061
2101
|
}
|
|
2062
2102
|
get x() {
|
|
@@ -2066,17 +2106,17 @@ class j extends se {
|
|
|
2066
2106
|
return this._y;
|
|
2067
2107
|
}
|
|
2068
2108
|
}
|
|
2069
|
-
const
|
|
2109
|
+
const st = {
|
|
2070
2110
|
indicator: ie,
|
|
2071
|
-
indicatorField:
|
|
2111
|
+
indicatorField: et,
|
|
2072
2112
|
line: j,
|
|
2073
2113
|
bar: j,
|
|
2074
2114
|
pie: j
|
|
2075
|
-
},
|
|
2115
|
+
}, Tt = (s) => {
|
|
2076
2116
|
const t = Y.parse(s).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2077
2117
|
if (!e)
|
|
2078
2118
|
throw new Error(`${e} is not a valid graph`);
|
|
2079
|
-
const i =
|
|
2119
|
+
const i = st[e];
|
|
2080
2120
|
if (!i)
|
|
2081
2121
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2082
2122
|
return new i(e, t);
|
|
@@ -2094,7 +2134,7 @@ class ne {
|
|
|
2094
2134
|
return this._axis;
|
|
2095
2135
|
}
|
|
2096
2136
|
}
|
|
2097
|
-
class
|
|
2137
|
+
class it extends ne {
|
|
2098
2138
|
constructor({
|
|
2099
2139
|
name: e,
|
|
2100
2140
|
operator: i,
|
|
@@ -2117,12 +2157,12 @@ class st extends ne {
|
|
|
2117
2157
|
return this._stacked;
|
|
2118
2158
|
}
|
|
2119
2159
|
}
|
|
2120
|
-
class
|
|
2160
|
+
class nt extends ne {
|
|
2121
2161
|
constructor({ name: t }) {
|
|
2122
2162
|
super({ name: t, axis: "x" });
|
|
2123
2163
|
}
|
|
2124
2164
|
}
|
|
2125
|
-
const
|
|
2165
|
+
const rt = ({ ooui: s }) => {
|
|
2126
2166
|
const e = [s.x.name];
|
|
2127
2167
|
return s.y ? (s.y.forEach((i) => {
|
|
2128
2168
|
i.operator !== "count" && !e.includes(i.name) && e.push(i.name), i.label && !e.includes(i.label) && e.push(i.label);
|
|
@@ -2146,25 +2186,25 @@ function $({
|
|
|
2146
2186
|
}
|
|
2147
2187
|
const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2148
2188
|
__proto__: null,
|
|
2149
|
-
getFieldsToRetrieve:
|
|
2189
|
+
getFieldsToRetrieve: rt,
|
|
2150
2190
|
getValueAndLabelForField: $
|
|
2151
2191
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2152
|
-
function
|
|
2192
|
+
function at({
|
|
2153
2193
|
values: s,
|
|
2154
2194
|
timerange: t,
|
|
2155
2195
|
interval: e = 1
|
|
2156
2196
|
}) {
|
|
2157
|
-
const i =
|
|
2197
|
+
const i = ct({
|
|
2158
2198
|
values: s,
|
|
2159
2199
|
timerange: t
|
|
2160
2200
|
});
|
|
2161
|
-
return
|
|
2201
|
+
return lt({
|
|
2162
2202
|
values: i,
|
|
2163
2203
|
timerange: t,
|
|
2164
2204
|
interval: e
|
|
2165
2205
|
});
|
|
2166
2206
|
}
|
|
2167
|
-
function
|
|
2207
|
+
function lt({
|
|
2168
2208
|
values: s,
|
|
2169
2209
|
timerange: t,
|
|
2170
2210
|
interval: e = 1
|
|
@@ -2182,7 +2222,7 @@ function at({
|
|
|
2182
2222
|
return;
|
|
2183
2223
|
const d = h.x, c = u[_ + 1].x;
|
|
2184
2224
|
if (!re([d, c], a)) {
|
|
2185
|
-
const f =
|
|
2225
|
+
const f = ot({
|
|
2186
2226
|
dates: [d, c],
|
|
2187
2227
|
timerange: t,
|
|
2188
2228
|
interval: e
|
|
@@ -2199,7 +2239,7 @@ function at({
|
|
|
2199
2239
|
}
|
|
2200
2240
|
}), i.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
|
|
2201
2241
|
}
|
|
2202
|
-
function
|
|
2242
|
+
function ot({
|
|
2203
2243
|
dates: s,
|
|
2204
2244
|
timerange: t,
|
|
2205
2245
|
interval: e = 1
|
|
@@ -2211,21 +2251,21 @@ function lt({
|
|
|
2211
2251
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2212
2252
|
const o = a[l], u = a[l + 1];
|
|
2213
2253
|
if (!re([o, u], r)) {
|
|
2214
|
-
const _ =
|
|
2254
|
+
const _ = T(o, z(r)).add(
|
|
2215
2255
|
e,
|
|
2216
2256
|
r
|
|
2217
|
-
), h =
|
|
2257
|
+
), h = T(u, z(r));
|
|
2218
2258
|
for (; _.isBefore(h); )
|
|
2219
2259
|
i.push(_.format(z(r))), _.add(e, r);
|
|
2220
2260
|
}
|
|
2221
2261
|
}
|
|
2222
2262
|
return i;
|
|
2223
2263
|
}
|
|
2224
|
-
function
|
|
2264
|
+
function ct({
|
|
2225
2265
|
values: s,
|
|
2226
2266
|
timerange: t
|
|
2227
2267
|
}) {
|
|
2228
|
-
const e =
|
|
2268
|
+
const e = dt({
|
|
2229
2269
|
values: s,
|
|
2230
2270
|
timerange: t
|
|
2231
2271
|
}), i = [], r = ae({
|
|
@@ -2243,24 +2283,24 @@ function ot({
|
|
|
2243
2283
|
});
|
|
2244
2284
|
}), i;
|
|
2245
2285
|
}
|
|
2246
|
-
function
|
|
2286
|
+
function dt({
|
|
2247
2287
|
values: s,
|
|
2248
2288
|
timerange: t
|
|
2249
2289
|
}) {
|
|
2250
2290
|
return s.map((e) => ({
|
|
2251
2291
|
...e,
|
|
2252
|
-
x:
|
|
2292
|
+
x: ut({
|
|
2253
2293
|
date: e.x,
|
|
2254
2294
|
timerange: t
|
|
2255
2295
|
})
|
|
2256
2296
|
}));
|
|
2257
2297
|
}
|
|
2258
|
-
function
|
|
2298
|
+
function ut({
|
|
2259
2299
|
date: s,
|
|
2260
2300
|
timerange: t
|
|
2261
2301
|
}) {
|
|
2262
|
-
let e =
|
|
2263
|
-
const i =
|
|
2302
|
+
let e = ht(s);
|
|
2303
|
+
const i = T(s, e);
|
|
2264
2304
|
switch (t) {
|
|
2265
2305
|
case "hour": {
|
|
2266
2306
|
e = "YYYY-MM-DD HH:00";
|
|
@@ -2285,7 +2325,7 @@ function dt({
|
|
|
2285
2325
|
}
|
|
2286
2326
|
return i.format(e);
|
|
2287
2327
|
}
|
|
2288
|
-
function
|
|
2328
|
+
function ht(s) {
|
|
2289
2329
|
return s.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2290
2330
|
}
|
|
2291
2331
|
function re(s, t) {
|
|
@@ -2296,7 +2336,7 @@ function re(s, t) {
|
|
|
2296
2336
|
if (s.length === 1)
|
|
2297
2337
|
return !0;
|
|
2298
2338
|
for (let r = 0; r < s.length - 1; r++) {
|
|
2299
|
-
const a =
|
|
2339
|
+
const a = T(s[r], i), o = T(s[r + 1], i).diff(a, t);
|
|
2300
2340
|
Math.abs(o) === 1 ? e = !0 : e = !1;
|
|
2301
2341
|
}
|
|
2302
2342
|
return e;
|
|
@@ -2326,7 +2366,7 @@ function z(s) {
|
|
|
2326
2366
|
return "YYYY-MM-DD HH:mm";
|
|
2327
2367
|
}
|
|
2328
2368
|
}
|
|
2329
|
-
const
|
|
2369
|
+
const _t = {
|
|
2330
2370
|
count: "count",
|
|
2331
2371
|
"+": "sum",
|
|
2332
2372
|
"-": "subtract",
|
|
@@ -2334,13 +2374,13 @@ const ht = {
|
|
|
2334
2374
|
avg: "average",
|
|
2335
2375
|
min: "min",
|
|
2336
2376
|
max: "max"
|
|
2337
|
-
},
|
|
2377
|
+
}, ft = ({
|
|
2338
2378
|
ooui: s,
|
|
2339
2379
|
values: t,
|
|
2340
2380
|
fields: e,
|
|
2341
2381
|
options: i
|
|
2342
2382
|
}) => {
|
|
2343
|
-
const r =
|
|
2383
|
+
const r = N({
|
|
2344
2384
|
fieldName: s.x.name,
|
|
2345
2385
|
values: t,
|
|
2346
2386
|
fields: e
|
|
@@ -2349,13 +2389,13 @@ const ht = {
|
|
|
2349
2389
|
Object.keys(r).forEach((f) => {
|
|
2350
2390
|
const y = r[f].label, x = r[f].entries;
|
|
2351
2391
|
if (c.label) {
|
|
2352
|
-
const m =
|
|
2392
|
+
const m = N({
|
|
2353
2393
|
fieldName: c.label,
|
|
2354
2394
|
values: x,
|
|
2355
2395
|
fields: e
|
|
2356
2396
|
});
|
|
2357
2397
|
Object.keys(m).forEach((v) => {
|
|
2358
|
-
const P = m[v].entries, p = m[v].label, S =
|
|
2398
|
+
const P = m[v].entries, p = m[v].label, S = A({
|
|
2359
2399
|
entries: P,
|
|
2360
2400
|
fields: e,
|
|
2361
2401
|
fieldName: c.name
|
|
@@ -2372,7 +2412,7 @@ const ht = {
|
|
|
2372
2412
|
});
|
|
2373
2413
|
});
|
|
2374
2414
|
} else {
|
|
2375
|
-
const m =
|
|
2415
|
+
const m = A({
|
|
2376
2416
|
entries: x,
|
|
2377
2417
|
fields: e,
|
|
2378
2418
|
fieldName: c.name
|
|
@@ -2401,7 +2441,7 @@ const ht = {
|
|
|
2401
2441
|
(c) => c.x !== !1
|
|
2402
2442
|
));
|
|
2403
2443
|
let d = h;
|
|
2404
|
-
return s.timerange ? d =
|
|
2444
|
+
return s.timerange ? d = at({
|
|
2405
2445
|
values: d,
|
|
2406
2446
|
timerange: s.timerange,
|
|
2407
2447
|
interval: s.interval
|
|
@@ -2411,7 +2451,7 @@ const ht = {
|
|
|
2411
2451
|
isStack: o
|
|
2412
2452
|
};
|
|
2413
2453
|
};
|
|
2414
|
-
function
|
|
2454
|
+
function A({
|
|
2415
2455
|
entries: s,
|
|
2416
2456
|
fieldName: t,
|
|
2417
2457
|
fields: e
|
|
@@ -2460,7 +2500,7 @@ function V({
|
|
|
2460
2500
|
function W(s) {
|
|
2461
2501
|
return Math.round((s + Number.EPSILON) * 100) / 100;
|
|
2462
2502
|
}
|
|
2463
|
-
function
|
|
2503
|
+
function N({
|
|
2464
2504
|
fieldName: s,
|
|
2465
2505
|
fields: t,
|
|
2466
2506
|
values: e
|
|
@@ -2475,7 +2515,7 @@ function A({
|
|
|
2475
2515
|
i[a] || (i[a] = { label: l, entries: [] }), i[a].entries.push(r);
|
|
2476
2516
|
}), i;
|
|
2477
2517
|
}
|
|
2478
|
-
function
|
|
2518
|
+
function gt(s) {
|
|
2479
2519
|
let t = [];
|
|
2480
2520
|
return Object.keys(s).forEach((e) => {
|
|
2481
2521
|
const i = s[e];
|
|
@@ -2489,17 +2529,18 @@ function le({
|
|
|
2489
2529
|
const e = t[s.name];
|
|
2490
2530
|
return e != null && e.string ? e.string : s.name;
|
|
2491
2531
|
}
|
|
2492
|
-
const
|
|
2532
|
+
const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2493
2533
|
__proto__: null,
|
|
2494
|
-
getAllObjectsInGroupedValues:
|
|
2534
|
+
getAllObjectsInGroupedValues: gt,
|
|
2495
2535
|
getValueForOperator: V,
|
|
2496
|
-
getValuesForYField:
|
|
2497
|
-
getValuesGroupedByField:
|
|
2536
|
+
getValuesForYField: A,
|
|
2537
|
+
getValuesGroupedByField: N,
|
|
2498
2538
|
getYAxisFieldname: le,
|
|
2499
|
-
labelsForOperator:
|
|
2500
|
-
processGraphData:
|
|
2539
|
+
labelsForOperator: _t,
|
|
2540
|
+
processGraphData: ft
|
|
2501
2541
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2502
2542
|
export {
|
|
2543
|
+
Re as Alert,
|
|
2503
2544
|
ye as Avatar,
|
|
2504
2545
|
Ie as Binary,
|
|
2505
2546
|
X as Boolean,
|
|
@@ -2509,21 +2550,21 @@ export {
|
|
|
2509
2550
|
Ge as CodeEditor,
|
|
2510
2551
|
I as Container,
|
|
2511
2552
|
w as ContainerWidget,
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2553
|
+
Ot as Dashboard,
|
|
2554
|
+
Ke as DashboardItem,
|
|
2555
|
+
Ee as Date,
|
|
2515
2556
|
Pe as DateTime,
|
|
2516
2557
|
g as Field,
|
|
2517
2558
|
L as Float,
|
|
2518
2559
|
ke as FloatTime,
|
|
2519
|
-
|
|
2560
|
+
wt as Form,
|
|
2520
2561
|
se as Graph,
|
|
2521
2562
|
ne as GraphAxis,
|
|
2522
2563
|
j as GraphChart,
|
|
2523
2564
|
ie as GraphIndicator,
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2565
|
+
et as GraphIndicatorField,
|
|
2566
|
+
nt as GraphXAxis,
|
|
2567
|
+
it as GraphYAxis,
|
|
2527
2568
|
pe as Group,
|
|
2528
2569
|
Oe as HTMLPreview,
|
|
2529
2570
|
Ve as Image,
|
|
@@ -2538,28 +2579,28 @@ export {
|
|
|
2538
2579
|
M as Notebook,
|
|
2539
2580
|
U as One2many,
|
|
2540
2581
|
xe as Page,
|
|
2541
|
-
|
|
2542
|
-
|
|
2582
|
+
Te as ProgressBar,
|
|
2583
|
+
Ne as Radio,
|
|
2543
2584
|
ze as Reference,
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2585
|
+
Ue as SearchFieldTypes,
|
|
2586
|
+
Ft as SearchFilter,
|
|
2587
|
+
E as Selection,
|
|
2547
2588
|
We as Separator,
|
|
2548
2589
|
Le as Steps,
|
|
2549
2590
|
Be as Switch,
|
|
2550
|
-
|
|
2591
|
+
Ae as Tag,
|
|
2551
2592
|
Me as Tags,
|
|
2552
2593
|
B as Text,
|
|
2553
2594
|
$e as Time,
|
|
2554
2595
|
De as Timeline,
|
|
2555
|
-
|
|
2596
|
+
vt as Tree,
|
|
2556
2597
|
F as Widget,
|
|
2557
2598
|
Et as graphFieldUtils,
|
|
2558
|
-
|
|
2599
|
+
Pt as graphProcessor,
|
|
2559
2600
|
Z as parseContext,
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2601
|
+
pt as parseContextFields,
|
|
2602
|
+
kt as parseDomainFields,
|
|
2603
|
+
Tt as parseGraph,
|
|
2604
|
+
Ct as transformDomainForChildWidget
|
|
2564
2605
|
};
|
|
2565
2606
|
//# sourceMappingURL=ooui.es.js.map
|