@gisce/ooui 2.24.0 → 2.26.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Carousel.d.ts +11 -0
- package/dist/Carousel.d.ts.map +1 -0
- package/dist/Group.d.ts +3 -0
- package/dist/Group.d.ts.map +1 -1
- 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 +219 -187
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Carousel.ts +30 -0
- package/src/Group.ts +17 -0
- package/src/WidgetFactory.ts +4 -0
- package/src/index.ts +2 -0
- package/src/spec/Carousel.spec.ts +75 -0
- package/src/spec/Group.spec.ts +9 -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);
|
|
@@ -683,7 +683,13 @@ class Pe extends B {
|
|
|
683
683
|
constructor(e) {
|
|
684
684
|
super(e);
|
|
685
685
|
n(this, "_icon", null);
|
|
686
|
-
|
|
686
|
+
n(this, "_height");
|
|
687
|
+
if (e && (e.icon && (this._icon = e.icon), e.height))
|
|
688
|
+
try {
|
|
689
|
+
this._height = parseInt(e.height);
|
|
690
|
+
} catch {
|
|
691
|
+
console.log("Error parsing height"), this._height = void 0;
|
|
692
|
+
}
|
|
687
693
|
}
|
|
688
694
|
get icon() {
|
|
689
695
|
return this._icon;
|
|
@@ -691,6 +697,12 @@ class Pe extends B {
|
|
|
691
697
|
set icon(e) {
|
|
692
698
|
this._icon = e;
|
|
693
699
|
}
|
|
700
|
+
get height() {
|
|
701
|
+
return this._height;
|
|
702
|
+
}
|
|
703
|
+
set height(e) {
|
|
704
|
+
this._height = e;
|
|
705
|
+
}
|
|
694
706
|
}
|
|
695
707
|
class Z extends f {
|
|
696
708
|
constructor(e) {
|
|
@@ -764,7 +776,7 @@ class Z extends f {
|
|
|
764
776
|
this._danger = e;
|
|
765
777
|
}
|
|
766
778
|
}
|
|
767
|
-
class Te extends
|
|
779
|
+
class Te extends w {
|
|
768
780
|
constructor(e) {
|
|
769
781
|
super(e);
|
|
770
782
|
n(this, "_defaultName", "");
|
|
@@ -902,7 +914,7 @@ class L extends f {
|
|
|
902
914
|
this._translatable = e;
|
|
903
915
|
}
|
|
904
916
|
}
|
|
905
|
-
class
|
|
917
|
+
class E extends f {
|
|
906
918
|
constructor(e) {
|
|
907
919
|
super(e);
|
|
908
920
|
/**
|
|
@@ -1125,7 +1137,7 @@ class je extends C {
|
|
|
1125
1137
|
return null;
|
|
1126
1138
|
}
|
|
1127
1139
|
}
|
|
1128
|
-
class Me extends
|
|
1140
|
+
class Me extends E {
|
|
1129
1141
|
}
|
|
1130
1142
|
class Ne extends f {
|
|
1131
1143
|
constructor(e) {
|
|
@@ -1186,7 +1198,7 @@ class Le extends te {
|
|
|
1186
1198
|
return this.parsedWidgetProps.colorField;
|
|
1187
1199
|
}
|
|
1188
1200
|
}
|
|
1189
|
-
class Ge extends
|
|
1201
|
+
class Ge extends E {
|
|
1190
1202
|
constructor(e) {
|
|
1191
1203
|
super(e);
|
|
1192
1204
|
n(this, "_nolabel", !0);
|
|
@@ -1291,12 +1303,12 @@ class ie extends f {
|
|
|
1291
1303
|
}
|
|
1292
1304
|
class Re extends ie {
|
|
1293
1305
|
}
|
|
1294
|
-
class $e extends
|
|
1306
|
+
class $e extends E {
|
|
1295
1307
|
get colors() {
|
|
1296
1308
|
return this._parsedWidgetProps.colors || {};
|
|
1297
1309
|
}
|
|
1298
1310
|
}
|
|
1299
|
-
class qe extends
|
|
1311
|
+
class qe extends E {
|
|
1300
1312
|
constructor(e) {
|
|
1301
1313
|
super(e);
|
|
1302
1314
|
/**
|
|
@@ -1362,7 +1374,7 @@ class Qe extends f {
|
|
|
1362
1374
|
super(t);
|
|
1363
1375
|
}
|
|
1364
1376
|
}
|
|
1365
|
-
class Xe extends
|
|
1377
|
+
class Xe extends w {
|
|
1366
1378
|
constructor(e) {
|
|
1367
1379
|
super(e);
|
|
1368
1380
|
/**
|
|
@@ -1447,6 +1459,22 @@ class Ke extends f {
|
|
|
1447
1459
|
this._size = e;
|
|
1448
1460
|
}
|
|
1449
1461
|
}
|
|
1462
|
+
class Ze extends w {
|
|
1463
|
+
constructor(e) {
|
|
1464
|
+
super(e);
|
|
1465
|
+
n(this, "_autoPlay", !0);
|
|
1466
|
+
e && "auto_play" in e && (this._autoPlay = W(e.auto_play));
|
|
1467
|
+
}
|
|
1468
|
+
get autoPlay() {
|
|
1469
|
+
return this._autoPlay;
|
|
1470
|
+
}
|
|
1471
|
+
set autoPlay(e) {
|
|
1472
|
+
this._autoPlay = e;
|
|
1473
|
+
}
|
|
1474
|
+
get items() {
|
|
1475
|
+
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1450
1478
|
class R {
|
|
1451
1479
|
constructor() {
|
|
1452
1480
|
/**
|
|
@@ -1481,7 +1509,7 @@ class R {
|
|
|
1481
1509
|
this._widgetClass = Te;
|
|
1482
1510
|
break;
|
|
1483
1511
|
case "selection":
|
|
1484
|
-
this._widgetClass =
|
|
1512
|
+
this._widgetClass = E;
|
|
1485
1513
|
break;
|
|
1486
1514
|
case "many2one":
|
|
1487
1515
|
this._widgetClass = We;
|
|
@@ -1590,6 +1618,9 @@ class R {
|
|
|
1590
1618
|
case "spinner":
|
|
1591
1619
|
this._widgetClass = B;
|
|
1592
1620
|
break;
|
|
1621
|
+
case "carousel":
|
|
1622
|
+
this._widgetClass = Ze;
|
|
1623
|
+
break;
|
|
1593
1624
|
}
|
|
1594
1625
|
}
|
|
1595
1626
|
createWidget(t, e) {
|
|
@@ -1611,7 +1642,7 @@ class R {
|
|
|
1611
1642
|
}
|
|
1612
1643
|
}
|
|
1613
1644
|
}
|
|
1614
|
-
const
|
|
1645
|
+
const et = ({
|
|
1615
1646
|
fieldName: i,
|
|
1616
1647
|
values: t,
|
|
1617
1648
|
fields: e
|
|
@@ -1625,18 +1656,18 @@ const Ze = ({
|
|
|
1625
1656
|
const r = {}, a = {};
|
|
1626
1657
|
for (const o of Object.keys(s))
|
|
1627
1658
|
if (t.state === o) {
|
|
1628
|
-
const
|
|
1629
|
-
for (const _ of
|
|
1630
|
-
const [h,
|
|
1631
|
-
a[h] || (a[h] = []), a[h].push(
|
|
1659
|
+
const u = s[o];
|
|
1660
|
+
for (const _ of u) {
|
|
1661
|
+
const [h, d] = _;
|
|
1662
|
+
a[h] || (a[h] = []), a[h].push(d);
|
|
1632
1663
|
}
|
|
1633
1664
|
}
|
|
1634
1665
|
for (const o of Object.keys(a)) {
|
|
1635
|
-
const
|
|
1636
|
-
r[o] =
|
|
1666
|
+
const u = a[o];
|
|
1667
|
+
r[o] = u.some((_) => _);
|
|
1637
1668
|
}
|
|
1638
1669
|
return r;
|
|
1639
|
-
},
|
|
1670
|
+
}, tt = ({
|
|
1640
1671
|
states: i,
|
|
1641
1672
|
values: t
|
|
1642
1673
|
}) => {
|
|
@@ -1645,7 +1676,7 @@ const Ze = ({
|
|
|
1645
1676
|
const e = i.split(",");
|
|
1646
1677
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1647
1678
|
};
|
|
1648
|
-
function
|
|
1679
|
+
function it({
|
|
1649
1680
|
values: i = {},
|
|
1650
1681
|
fieldName: t,
|
|
1651
1682
|
fields: e = {}
|
|
@@ -1669,11 +1700,11 @@ const ne = ({
|
|
|
1669
1700
|
return s;
|
|
1670
1701
|
if (i.trim().length === 0)
|
|
1671
1702
|
return;
|
|
1672
|
-
const
|
|
1673
|
-
return
|
|
1703
|
+
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 = {};
|
|
1704
|
+
return d.forEach((c) => {
|
|
1674
1705
|
const m = c[1];
|
|
1675
1706
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1676
|
-
const p =
|
|
1707
|
+
const p = it({
|
|
1677
1708
|
values: t,
|
|
1678
1709
|
fields: e,
|
|
1679
1710
|
fieldName: m === "active_id" ? "id" : m
|
|
@@ -1688,11 +1719,11 @@ const ne = ({
|
|
|
1688
1719
|
} catch {
|
|
1689
1720
|
return;
|
|
1690
1721
|
}
|
|
1691
|
-
},
|
|
1722
|
+
}, Pt = (i) => {
|
|
1692
1723
|
const t = [];
|
|
1693
1724
|
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
|
-
!
|
|
1725
|
+
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) => {
|
|
1726
|
+
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1696
1727
|
}), t);
|
|
1697
1728
|
} catch {
|
|
1698
1729
|
}
|
|
@@ -1708,26 +1739,26 @@ function re(i) {
|
|
|
1708
1739
|
function ae(i) {
|
|
1709
1740
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1710
1741
|
}
|
|
1711
|
-
const
|
|
1742
|
+
const st = (i) => {
|
|
1712
1743
|
const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1713
1744
|
return {
|
|
1714
1745
|
method: e,
|
|
1715
1746
|
args: r
|
|
1716
1747
|
};
|
|
1717
1748
|
};
|
|
1718
|
-
function
|
|
1749
|
+
function nt(i) {
|
|
1719
1750
|
const t = [];
|
|
1720
1751
|
function e(s) {
|
|
1721
1752
|
const r = [];
|
|
1722
1753
|
for (const a of s)
|
|
1723
|
-
a instanceof
|
|
1754
|
+
a instanceof w ? e(a._container.rows.flat()) : r.push(a);
|
|
1724
1755
|
r.length > 0 && t.push(r);
|
|
1725
1756
|
}
|
|
1726
1757
|
for (const s of i)
|
|
1727
1758
|
e(s);
|
|
1728
1759
|
return t.flat();
|
|
1729
1760
|
}
|
|
1730
|
-
class
|
|
1761
|
+
class Tt {
|
|
1731
1762
|
constructor(t, e = 4) {
|
|
1732
1763
|
/**
|
|
1733
1764
|
* Object containing fields specification of the form.
|
|
@@ -1782,7 +1813,7 @@ class Pt {
|
|
|
1782
1813
|
* Context for each field in the form
|
|
1783
1814
|
*/
|
|
1784
1815
|
n(this, "_contextForFields", {});
|
|
1785
|
-
this._fields = t, this._container = new
|
|
1816
|
+
this._fields = t, this._container = new V(e, 6, !1, "root");
|
|
1786
1817
|
}
|
|
1787
1818
|
get fields() {
|
|
1788
1819
|
return this._fields;
|
|
@@ -1837,17 +1868,17 @@ class Pt {
|
|
|
1837
1868
|
}
|
|
1838
1869
|
parse(t, e) {
|
|
1839
1870
|
var o;
|
|
1840
|
-
const { values: s = {}, readOnly: r = !1 } = e || {}, a =
|
|
1871
|
+
const { values: s = {}, readOnly: r = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
|
|
1841
1872
|
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
1873
|
fields: a.children,
|
|
1843
1874
|
container: this._container,
|
|
1844
1875
|
values: s
|
|
1845
1876
|
});
|
|
1846
|
-
const l =
|
|
1847
|
-
l.forEach((
|
|
1848
|
-
const _ =
|
|
1849
|
-
_._id && _._context && (this._contextForFields[_._id] =
|
|
1850
|
-
}), this._autorefreshableFields = l.filter((
|
|
1877
|
+
const l = nt(this._container._rows);
|
|
1878
|
+
l.forEach((u) => {
|
|
1879
|
+
const _ = u;
|
|
1880
|
+
_._id && _._context && (this._contextForFields[_._id] = u._context);
|
|
1881
|
+
}), this._autorefreshableFields = l.filter((u) => u instanceof f && u.autoRefresh).map((u) => u._id);
|
|
1851
1882
|
}
|
|
1852
1883
|
parseNode({
|
|
1853
1884
|
fields: t,
|
|
@@ -1856,13 +1887,13 @@ class Pt {
|
|
|
1856
1887
|
}) {
|
|
1857
1888
|
const r = new R();
|
|
1858
1889
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
1859
|
-
var
|
|
1860
|
-
const { tagName: l, attributes: o, children:
|
|
1890
|
+
var v, F;
|
|
1891
|
+
const { tagName: l, attributes: o, children: u } = a;
|
|
1861
1892
|
let _ = l, h = o;
|
|
1862
1893
|
if (l === "field") {
|
|
1863
|
-
const { name: x, widget:
|
|
1864
|
-
if (
|
|
1865
|
-
_ =
|
|
1894
|
+
const { name: x, widget: I } = o;
|
|
1895
|
+
if (I)
|
|
1896
|
+
_ = I;
|
|
1866
1897
|
else if (x) {
|
|
1867
1898
|
if (!this._fields[x])
|
|
1868
1899
|
throw new Error(
|
|
@@ -1879,33 +1910,33 @@ class Pt {
|
|
|
1879
1910
|
fieldsWidgetType: this._fields[x].type
|
|
1880
1911
|
};
|
|
1881
1912
|
}
|
|
1882
|
-
const
|
|
1913
|
+
const d = Ce({
|
|
1883
1914
|
tagAttributes: h,
|
|
1884
1915
|
values: s,
|
|
1885
1916
|
fields: this._fields,
|
|
1886
1917
|
widgetType: l
|
|
1887
1918
|
});
|
|
1888
1919
|
let g;
|
|
1889
|
-
l === "button" && h.states ? g =
|
|
1920
|
+
l === "button" && h.states ? g = tt({
|
|
1890
1921
|
states: h.states,
|
|
1891
1922
|
values: s
|
|
1892
|
-
}) : g =
|
|
1923
|
+
}) : g = et({
|
|
1893
1924
|
fieldName: h.name,
|
|
1894
1925
|
values: s,
|
|
1895
1926
|
fields: this._fields
|
|
1896
1927
|
});
|
|
1897
1928
|
const c = ne({
|
|
1898
|
-
context: h.context || ((
|
|
1929
|
+
context: h.context || ((v = this._fields[h.name]) == null ? void 0 : v.context),
|
|
1899
1930
|
values: s,
|
|
1900
1931
|
fields: this._fields
|
|
1901
1932
|
});
|
|
1902
|
-
h.on_change && (this._onChangeFields[h.name] =
|
|
1933
|
+
h.on_change && (this._onChangeFields[h.name] = st(
|
|
1903
1934
|
h.on_change
|
|
1904
1935
|
));
|
|
1905
1936
|
let m;
|
|
1906
1937
|
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
1938
|
const p = {
|
|
1908
|
-
...
|
|
1939
|
+
...d,
|
|
1909
1940
|
...g,
|
|
1910
1941
|
context: c,
|
|
1911
1942
|
domain: m,
|
|
@@ -1913,8 +1944,8 @@ class Pt {
|
|
|
1913
1944
|
};
|
|
1914
1945
|
e.readOnly && (p.readonly = !0);
|
|
1915
1946
|
const y = r.createWidget(_, p);
|
|
1916
|
-
y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof
|
|
1917
|
-
fields:
|
|
1947
|
+
y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof w && this.parseNode({
|
|
1948
|
+
fields: u,
|
|
1918
1949
|
container: y.container,
|
|
1919
1950
|
values: s
|
|
1920
1951
|
}), y instanceof Z && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
@@ -1931,7 +1962,7 @@ class Pt {
|
|
|
1931
1962
|
function H(i) {
|
|
1932
1963
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1933
1964
|
}
|
|
1934
|
-
class
|
|
1965
|
+
class Wt {
|
|
1935
1966
|
constructor(t) {
|
|
1936
1967
|
/**
|
|
1937
1968
|
* Object containing fields specification of the form.
|
|
@@ -2003,37 +2034,37 @@ class Tt {
|
|
|
2003
2034
|
this._infinite = t;
|
|
2004
2035
|
}
|
|
2005
2036
|
parse(t) {
|
|
2006
|
-
const e =
|
|
2037
|
+
const e = D.parse(t).filter((r) => r.tagName === "tree")[0];
|
|
2007
2038
|
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
2039
|
const s = new R();
|
|
2009
2040
|
e.children.forEach((r) => {
|
|
2010
2041
|
const { tagName: a, attributes: l } = r;
|
|
2011
2042
|
let o = null;
|
|
2012
2043
|
if (a === "field") {
|
|
2013
|
-
const { name:
|
|
2044
|
+
const { name: u, widget: _ } = l;
|
|
2014
2045
|
let h = l;
|
|
2015
|
-
if (
|
|
2016
|
-
if (!this._fields[
|
|
2017
|
-
throw new Error(`Field ${
|
|
2018
|
-
const
|
|
2019
|
-
o =
|
|
2046
|
+
if (u) {
|
|
2047
|
+
if (!this._fields[u])
|
|
2048
|
+
throw new Error(`Field ${u} doesn't exist in fields defintion`);
|
|
2049
|
+
const d = this._fields[u];
|
|
2050
|
+
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
2051
|
const g = ne({
|
|
2021
|
-
context: l.context ||
|
|
2052
|
+
context: l.context || d.context,
|
|
2022
2053
|
values: {},
|
|
2023
2054
|
fields: this._fields
|
|
2024
2055
|
});
|
|
2025
2056
|
h = {
|
|
2026
|
-
...
|
|
2057
|
+
...d,
|
|
2027
2058
|
...l,
|
|
2028
|
-
fieldsWidgetType:
|
|
2059
|
+
fieldsWidgetType: d == null ? void 0 : d.type,
|
|
2029
2060
|
context: g
|
|
2030
|
-
}, this._contextForFields[
|
|
2061
|
+
}, this._contextForFields[u] = g;
|
|
2031
2062
|
}
|
|
2032
2063
|
if (_ && (o = _), !h.invisible) {
|
|
2033
|
-
const
|
|
2034
|
-
this._columns.push(
|
|
2064
|
+
const d = s.createWidget(o, h);
|
|
2065
|
+
this._columns.push(d);
|
|
2035
2066
|
}
|
|
2036
|
-
|
|
2067
|
+
W(h.autorefresh) && this._autorefreshableFields.push(u);
|
|
2037
2068
|
}
|
|
2038
2069
|
});
|
|
2039
2070
|
}
|
|
@@ -2045,7 +2076,7 @@ class Tt {
|
|
|
2045
2076
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
2046
2077
|
}
|
|
2047
2078
|
}
|
|
2048
|
-
const
|
|
2079
|
+
const rt = {
|
|
2049
2080
|
text: "text",
|
|
2050
2081
|
many2one: "many2one",
|
|
2051
2082
|
char: "char",
|
|
@@ -2058,7 +2089,7 @@ const nt = {
|
|
|
2058
2089
|
date: "date",
|
|
2059
2090
|
datetime: "datetime"
|
|
2060
2091
|
};
|
|
2061
|
-
class
|
|
2092
|
+
class Et {
|
|
2062
2093
|
constructor(t, e, s = 8) {
|
|
2063
2094
|
/**
|
|
2064
2095
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -2070,7 +2101,7 @@ class Wt {
|
|
|
2070
2101
|
n(this, "_fields");
|
|
2071
2102
|
n(this, "_simpleSearchContainer");
|
|
2072
2103
|
n(this, "_advancedSearchContainer");
|
|
2073
|
-
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new
|
|
2104
|
+
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new V(s), this._advancedSearchContainer = new V(s);
|
|
2074
2105
|
}
|
|
2075
2106
|
get searchFields() {
|
|
2076
2107
|
return this._searchFields;
|
|
@@ -2106,7 +2137,7 @@ class Wt {
|
|
|
2106
2137
|
colspan: 2
|
|
2107
2138
|
}, { type: a, widget: l } = r;
|
|
2108
2139
|
let o = l ?? a;
|
|
2109
|
-
return
|
|
2140
|
+
return rt[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
2110
2141
|
});
|
|
2111
2142
|
}
|
|
2112
2143
|
/**
|
|
@@ -2117,7 +2148,7 @@ class Wt {
|
|
|
2117
2148
|
return this.advancedSearchContainer.findById(t);
|
|
2118
2149
|
}
|
|
2119
2150
|
}
|
|
2120
|
-
const
|
|
2151
|
+
const It = ({
|
|
2121
2152
|
domain: i,
|
|
2122
2153
|
widgetFieldName: t
|
|
2123
2154
|
}) => {
|
|
@@ -2126,14 +2157,14 @@ const Et = ({
|
|
|
2126
2157
|
if (!Array.isArray(s))
|
|
2127
2158
|
return;
|
|
2128
2159
|
const [r, a, l] = s;
|
|
2129
|
-
let o,
|
|
2130
|
-
r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")),
|
|
2160
|
+
let o, u;
|
|
2161
|
+
r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), u = r.substr(
|
|
2131
2162
|
r.indexOf(".") + 1,
|
|
2132
2163
|
r.length - 1
|
|
2133
|
-
)) : (o = r,
|
|
2164
|
+
)) : (o = r, u = "id"), o === t && e.push([u, a, l]);
|
|
2134
2165
|
}), e;
|
|
2135
|
-
},
|
|
2136
|
-
class
|
|
2166
|
+
}, St = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2167
|
+
class at {
|
|
2137
2168
|
constructor(t) {
|
|
2138
2169
|
n(this, "_action_id", null);
|
|
2139
2170
|
n(this, "_position", null);
|
|
@@ -2146,15 +2177,15 @@ class rt {
|
|
|
2146
2177
|
return this._position;
|
|
2147
2178
|
}
|
|
2148
2179
|
}
|
|
2149
|
-
class
|
|
2180
|
+
class zt {
|
|
2150
2181
|
constructor(t) {
|
|
2151
2182
|
n(this, "_string", null);
|
|
2152
2183
|
n(this, "_items", []);
|
|
2153
|
-
const e =
|
|
2184
|
+
const e = D.parse(t).filter((r) => r.tagName === "dashboard")[0];
|
|
2154
2185
|
this._string = e.attributes.string || null;
|
|
2155
2186
|
const { children: s } = e;
|
|
2156
2187
|
s.forEach((r) => {
|
|
2157
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
2188
|
+
r.tagName === "dashboard_item" && this._items.push(new at(r.attributes));
|
|
2158
2189
|
});
|
|
2159
2190
|
}
|
|
2160
2191
|
get string() {
|
|
@@ -2200,7 +2231,7 @@ class oe extends le {
|
|
|
2200
2231
|
n(this, "_totalDomain", null);
|
|
2201
2232
|
n(this, "_showPercent", !1);
|
|
2202
2233
|
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 =
|
|
2234
|
+
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
2235
|
}
|
|
2205
2236
|
get color() {
|
|
2206
2237
|
return this._color;
|
|
@@ -2218,7 +2249,7 @@ class oe extends le {
|
|
|
2218
2249
|
return this._suffix;
|
|
2219
2250
|
}
|
|
2220
2251
|
}
|
|
2221
|
-
class
|
|
2252
|
+
class lt extends oe {
|
|
2222
2253
|
constructor(e, s) {
|
|
2223
2254
|
super(e, s);
|
|
2224
2255
|
n(this, "_field");
|
|
@@ -2238,12 +2269,12 @@ class at extends oe {
|
|
|
2238
2269
|
return this._operator;
|
|
2239
2270
|
}
|
|
2240
2271
|
}
|
|
2241
|
-
const
|
|
2272
|
+
const ot = (i) => {
|
|
2242
2273
|
const t = [];
|
|
2243
2274
|
let e;
|
|
2244
2275
|
if (i.forEach((s) => {
|
|
2245
2276
|
if (s.tagName === "field") {
|
|
2246
|
-
const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0,
|
|
2277
|
+
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
2278
|
if (!r)
|
|
2248
2279
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2249
2280
|
if (!l)
|
|
@@ -2251,11 +2282,11 @@ const lt = (i) => {
|
|
|
2251
2282
|
r === "x" ? e = new dt({
|
|
2252
2283
|
name: l
|
|
2253
2284
|
}) : r === "y" && t.push(
|
|
2254
|
-
new
|
|
2285
|
+
new ut({
|
|
2255
2286
|
name: l,
|
|
2256
2287
|
operator: a,
|
|
2257
2288
|
label: o,
|
|
2258
|
-
stacked:
|
|
2289
|
+
stacked: u
|
|
2259
2290
|
})
|
|
2260
2291
|
);
|
|
2261
2292
|
}
|
|
@@ -2274,7 +2305,7 @@ class j extends le {
|
|
|
2274
2305
|
n(this, "_x");
|
|
2275
2306
|
n(this, "_y");
|
|
2276
2307
|
this._type = e;
|
|
2277
|
-
const r =
|
|
2308
|
+
const r = ot(s.children);
|
|
2278
2309
|
this._x = r.x, this._y = r.y;
|
|
2279
2310
|
}
|
|
2280
2311
|
get x() {
|
|
@@ -2284,17 +2315,17 @@ class j extends le {
|
|
|
2284
2315
|
return this._y;
|
|
2285
2316
|
}
|
|
2286
2317
|
}
|
|
2287
|
-
const
|
|
2318
|
+
const ct = {
|
|
2288
2319
|
indicator: oe,
|
|
2289
|
-
indicatorField:
|
|
2320
|
+
indicatorField: lt,
|
|
2290
2321
|
line: j,
|
|
2291
2322
|
bar: j,
|
|
2292
2323
|
pie: j
|
|
2293
|
-
},
|
|
2294
|
-
const t =
|
|
2324
|
+
}, Vt = (i) => {
|
|
2325
|
+
const t = D.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2295
2326
|
if (!e)
|
|
2296
2327
|
throw new Error(`${e} is not a valid graph`);
|
|
2297
|
-
const s =
|
|
2328
|
+
const s = ct[e];
|
|
2298
2329
|
if (!s)
|
|
2299
2330
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2300
2331
|
return new s(e, t);
|
|
@@ -2312,7 +2343,7 @@ class ce {
|
|
|
2312
2343
|
return this._axis;
|
|
2313
2344
|
}
|
|
2314
2345
|
}
|
|
2315
|
-
class
|
|
2346
|
+
class ut extends ce {
|
|
2316
2347
|
constructor({
|
|
2317
2348
|
name: e,
|
|
2318
2349
|
operator: s,
|
|
@@ -2340,7 +2371,7 @@ class dt extends ce {
|
|
|
2340
2371
|
super({ name: t, axis: "x" });
|
|
2341
2372
|
}
|
|
2342
2373
|
}
|
|
2343
|
-
const
|
|
2374
|
+
const ht = ({ ooui: i }) => {
|
|
2344
2375
|
const e = [i.x.name];
|
|
2345
2376
|
return i.y ? (i.y.forEach((s) => {
|
|
2346
2377
|
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
@@ -2362,46 +2393,46 @@ function $({
|
|
|
2362
2393
|
}
|
|
2363
2394
|
return { value: r, label: r };
|
|
2364
2395
|
}
|
|
2365
|
-
const
|
|
2396
|
+
const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2366
2397
|
__proto__: null,
|
|
2367
|
-
getFieldsToRetrieve:
|
|
2398
|
+
getFieldsToRetrieve: ht,
|
|
2368
2399
|
getValueAndLabelForField: $
|
|
2369
2400
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2370
|
-
function
|
|
2401
|
+
function _t({
|
|
2371
2402
|
values: i,
|
|
2372
2403
|
timerange: t,
|
|
2373
2404
|
interval: e = 1
|
|
2374
2405
|
}) {
|
|
2375
|
-
const s =
|
|
2406
|
+
const s = mt({
|
|
2376
2407
|
values: i,
|
|
2377
2408
|
timerange: t
|
|
2378
2409
|
});
|
|
2379
|
-
return
|
|
2410
|
+
return ft({
|
|
2380
2411
|
values: s,
|
|
2381
2412
|
timerange: t,
|
|
2382
2413
|
interval: e
|
|
2383
2414
|
});
|
|
2384
2415
|
}
|
|
2385
|
-
function
|
|
2416
|
+
function ft({
|
|
2386
2417
|
values: i,
|
|
2387
2418
|
timerange: t,
|
|
2388
2419
|
interval: e = 1
|
|
2389
2420
|
}) {
|
|
2390
2421
|
let s = [];
|
|
2391
|
-
const r =
|
|
2422
|
+
const r = de({
|
|
2392
2423
|
values: i,
|
|
2393
2424
|
groupBy: "type-stacked"
|
|
2394
2425
|
}), a = `${t}s`;
|
|
2395
2426
|
return Object.keys(r).forEach((o) => {
|
|
2396
|
-
const
|
|
2397
|
-
for (let _ = 0; _ <
|
|
2398
|
-
const h =
|
|
2399
|
-
if (s.push(h), _ ===
|
|
2427
|
+
const u = r[o];
|
|
2428
|
+
for (let _ = 0; _ < u.length; _++) {
|
|
2429
|
+
const h = u[_];
|
|
2430
|
+
if (s.push(h), _ === u.length - 1)
|
|
2400
2431
|
return;
|
|
2401
|
-
const
|
|
2402
|
-
if (!
|
|
2403
|
-
const c =
|
|
2404
|
-
dates: [
|
|
2432
|
+
const d = h.x, g = u[_ + 1].x;
|
|
2433
|
+
if (!ue([d, g], a)) {
|
|
2434
|
+
const c = gt({
|
|
2435
|
+
dates: [d, g],
|
|
2405
2436
|
timerange: t,
|
|
2406
2437
|
interval: e
|
|
2407
2438
|
});
|
|
@@ -2415,9 +2446,9 @@ function _t({
|
|
|
2415
2446
|
);
|
|
2416
2447
|
}
|
|
2417
2448
|
}
|
|
2418
|
-
}), s.sort((o,
|
|
2449
|
+
}), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
|
|
2419
2450
|
}
|
|
2420
|
-
function
|
|
2451
|
+
function gt({
|
|
2421
2452
|
dates: i,
|
|
2422
2453
|
timerange: t,
|
|
2423
2454
|
interval: e = 1
|
|
@@ -2427,57 +2458,57 @@ function ft({
|
|
|
2427
2458
|
return i;
|
|
2428
2459
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2429
2460
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2430
|
-
const o = a[l],
|
|
2431
|
-
if (!
|
|
2432
|
-
const _ = T(o,
|
|
2461
|
+
const o = a[l], u = a[l + 1];
|
|
2462
|
+
if (!ue([o, u], r)) {
|
|
2463
|
+
const _ = T(o, z(r)).add(
|
|
2433
2464
|
e,
|
|
2434
2465
|
r
|
|
2435
|
-
), h = T(
|
|
2466
|
+
), h = T(u, z(r));
|
|
2436
2467
|
for (; _.isBefore(h); )
|
|
2437
|
-
s.push(_.format(
|
|
2468
|
+
s.push(_.format(z(r))), _.add(e, r);
|
|
2438
2469
|
}
|
|
2439
2470
|
}
|
|
2440
2471
|
return s;
|
|
2441
2472
|
}
|
|
2442
|
-
function
|
|
2473
|
+
function mt({
|
|
2443
2474
|
values: i,
|
|
2444
2475
|
timerange: t
|
|
2445
2476
|
}) {
|
|
2446
|
-
const e =
|
|
2477
|
+
const e = bt({
|
|
2447
2478
|
values: i,
|
|
2448
2479
|
timerange: t
|
|
2449
|
-
}), s = [], r =
|
|
2480
|
+
}), s = [], r = de({
|
|
2450
2481
|
values: e,
|
|
2451
2482
|
groupBy: "all"
|
|
2452
2483
|
});
|
|
2453
2484
|
return Object.keys(r).forEach((a) => {
|
|
2454
|
-
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator,
|
|
2485
|
+
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
|
|
2455
2486
|
values: l.map((_) => _.value),
|
|
2456
2487
|
operator: o
|
|
2457
2488
|
});
|
|
2458
2489
|
s.push({
|
|
2459
2490
|
...l[0],
|
|
2460
|
-
value:
|
|
2491
|
+
value: u
|
|
2461
2492
|
});
|
|
2462
2493
|
}), s;
|
|
2463
2494
|
}
|
|
2464
|
-
function
|
|
2495
|
+
function bt({
|
|
2465
2496
|
values: i,
|
|
2466
2497
|
timerange: t
|
|
2467
2498
|
}) {
|
|
2468
2499
|
return i.map((e) => ({
|
|
2469
2500
|
...e,
|
|
2470
|
-
x:
|
|
2501
|
+
x: yt({
|
|
2471
2502
|
date: e.x,
|
|
2472
2503
|
timerange: t
|
|
2473
2504
|
})
|
|
2474
2505
|
}));
|
|
2475
2506
|
}
|
|
2476
|
-
function
|
|
2507
|
+
function yt({
|
|
2477
2508
|
date: i,
|
|
2478
2509
|
timerange: t
|
|
2479
2510
|
}) {
|
|
2480
|
-
let e =
|
|
2511
|
+
let e = pt(i);
|
|
2481
2512
|
const s = T(i, e);
|
|
2482
2513
|
switch (t) {
|
|
2483
2514
|
case "hour": {
|
|
@@ -2503,12 +2534,12 @@ function bt({
|
|
|
2503
2534
|
}
|
|
2504
2535
|
return s.format(e);
|
|
2505
2536
|
}
|
|
2506
|
-
function
|
|
2537
|
+
function pt(i) {
|
|
2507
2538
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2508
2539
|
}
|
|
2509
|
-
function
|
|
2540
|
+
function ue(i, t) {
|
|
2510
2541
|
let e = !1;
|
|
2511
|
-
const s =
|
|
2542
|
+
const s = z(t);
|
|
2512
2543
|
if (i.length === 0)
|
|
2513
2544
|
return !1;
|
|
2514
2545
|
if (i.length === 1)
|
|
@@ -2519,7 +2550,7 @@ function de(i, t) {
|
|
|
2519
2550
|
}
|
|
2520
2551
|
return e;
|
|
2521
2552
|
}
|
|
2522
|
-
function
|
|
2553
|
+
function de({
|
|
2523
2554
|
values: i,
|
|
2524
2555
|
groupBy: t
|
|
2525
2556
|
}) {
|
|
@@ -2529,7 +2560,7 @@ function ue({
|
|
|
2529
2560
|
e[o] || (e[o] = []), e[o].push(s);
|
|
2530
2561
|
}), e;
|
|
2531
2562
|
}
|
|
2532
|
-
function
|
|
2563
|
+
function z(i) {
|
|
2533
2564
|
switch (i) {
|
|
2534
2565
|
case "days":
|
|
2535
2566
|
return "YYYY-MM-DD";
|
|
@@ -2544,7 +2575,7 @@ function S(i) {
|
|
|
2544
2575
|
return "YYYY-MM-DD HH:mm";
|
|
2545
2576
|
}
|
|
2546
2577
|
}
|
|
2547
|
-
const
|
|
2578
|
+
const xt = {
|
|
2548
2579
|
count: "count",
|
|
2549
2580
|
"+": "sum",
|
|
2550
2581
|
"-": "subtract",
|
|
@@ -2552,7 +2583,7 @@ const pt = {
|
|
|
2552
2583
|
avg: "average",
|
|
2553
2584
|
min: "min",
|
|
2554
2585
|
max: "max"
|
|
2555
|
-
},
|
|
2586
|
+
}, wt = ({
|
|
2556
2587
|
ooui: i,
|
|
2557
2588
|
values: t,
|
|
2558
2589
|
fields: e,
|
|
@@ -2567,35 +2598,35 @@ const pt = {
|
|
|
2567
2598
|
Object.keys(r).forEach((m) => {
|
|
2568
2599
|
const p = r[m].label, y = r[m].entries;
|
|
2569
2600
|
if (c.label) {
|
|
2570
|
-
const
|
|
2601
|
+
const v = A({
|
|
2571
2602
|
fieldName: c.label,
|
|
2572
2603
|
values: y,
|
|
2573
2604
|
fields: e
|
|
2574
2605
|
});
|
|
2575
|
-
Object.keys(
|
|
2576
|
-
const x =
|
|
2606
|
+
Object.keys(v).forEach((F) => {
|
|
2607
|
+
const x = v[F].entries, I = v[F].label, fe = N({
|
|
2577
2608
|
entries: x,
|
|
2578
2609
|
fields: e,
|
|
2579
2610
|
fieldName: c.name
|
|
2580
|
-
}), ge =
|
|
2611
|
+
}), ge = Y({
|
|
2581
2612
|
values: fe,
|
|
2582
2613
|
operator: c.operator
|
|
2583
2614
|
});
|
|
2584
2615
|
a.push({
|
|
2585
2616
|
x: p || !1,
|
|
2586
2617
|
value: ge,
|
|
2587
|
-
type:
|
|
2618
|
+
type: I,
|
|
2588
2619
|
operator: c.operator,
|
|
2589
2620
|
stacked: c.stacked
|
|
2590
2621
|
});
|
|
2591
2622
|
});
|
|
2592
2623
|
} else {
|
|
2593
|
-
const
|
|
2624
|
+
const v = N({
|
|
2594
2625
|
entries: y,
|
|
2595
2626
|
fields: e,
|
|
2596
2627
|
fieldName: c.name
|
|
2597
|
-
}), F =
|
|
2598
|
-
values:
|
|
2628
|
+
}), F = Y({
|
|
2629
|
+
values: v,
|
|
2599
2630
|
operator: c.operator
|
|
2600
2631
|
});
|
|
2601
2632
|
a.push({
|
|
@@ -2618,21 +2649,21 @@ const pt = {
|
|
|
2618
2649
|
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
2650
|
(c) => c.x !== !1
|
|
2620
2651
|
));
|
|
2621
|
-
let
|
|
2622
|
-
i.timerange ?
|
|
2623
|
-
values:
|
|
2652
|
+
let d = h;
|
|
2653
|
+
i.timerange ? d = _t({
|
|
2654
|
+
values: d,
|
|
2624
2655
|
timerange: i.timerange,
|
|
2625
2656
|
interval: i.interval
|
|
2626
|
-
}) : i.type == "pie" && (
|
|
2657
|
+
}) : i.type == "pie" && (d = h.sort((c, m) => m.value - c.value));
|
|
2627
2658
|
const g = {
|
|
2628
|
-
data:
|
|
2659
|
+
data: d,
|
|
2629
2660
|
isGroup: o || l,
|
|
2630
2661
|
isStack: o
|
|
2631
2662
|
};
|
|
2632
2663
|
if (i.type === "line" && i.y_range && (g.yAxisOpts = {
|
|
2633
2664
|
mode: i.y_range
|
|
2634
2665
|
}, i.y_range === "auto")) {
|
|
2635
|
-
const { min: c, max: m } = _e(
|
|
2666
|
+
const { min: c, max: m } = _e(d);
|
|
2636
2667
|
g.yAxisOpts.valueOpts = { min: c, max: m };
|
|
2637
2668
|
}
|
|
2638
2669
|
return g;
|
|
@@ -2648,7 +2679,7 @@ function N({
|
|
|
2648
2679
|
fields: e
|
|
2649
2680
|
})).map(({ value: s, label: r }) => r);
|
|
2650
2681
|
}
|
|
2651
|
-
function
|
|
2682
|
+
function Y({
|
|
2652
2683
|
operator: i,
|
|
2653
2684
|
values: t
|
|
2654
2685
|
}) {
|
|
@@ -2656,26 +2687,26 @@ function V({
|
|
|
2656
2687
|
case "count":
|
|
2657
2688
|
return t.length;
|
|
2658
2689
|
case "+":
|
|
2659
|
-
return
|
|
2690
|
+
return S(
|
|
2660
2691
|
t.reduce(function(e, s) {
|
|
2661
2692
|
return e + s;
|
|
2662
2693
|
})
|
|
2663
2694
|
);
|
|
2664
2695
|
case "-":
|
|
2665
|
-
return
|
|
2696
|
+
return S(
|
|
2666
2697
|
t.reduce(function(e, s) {
|
|
2667
2698
|
return e - s;
|
|
2668
2699
|
})
|
|
2669
2700
|
);
|
|
2670
2701
|
case "*":
|
|
2671
|
-
return
|
|
2702
|
+
return S(
|
|
2672
2703
|
t.reduce(function(e, s) {
|
|
2673
2704
|
return e * s;
|
|
2674
2705
|
})
|
|
2675
2706
|
);
|
|
2676
2707
|
case "avg": {
|
|
2677
2708
|
const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
|
|
2678
|
-
return
|
|
2709
|
+
return S(s);
|
|
2679
2710
|
}
|
|
2680
2711
|
case "min":
|
|
2681
2712
|
return Math.min(...t);
|
|
@@ -2683,7 +2714,7 @@ function V({
|
|
|
2683
2714
|
return Math.max(...t);
|
|
2684
2715
|
}
|
|
2685
2716
|
}
|
|
2686
|
-
function
|
|
2717
|
+
function S(i) {
|
|
2687
2718
|
return Math.round((i + Number.EPSILON) * 100) / 100;
|
|
2688
2719
|
}
|
|
2689
2720
|
function A({
|
|
@@ -2701,7 +2732,7 @@ function A({
|
|
|
2701
2732
|
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
|
|
2702
2733
|
}), s;
|
|
2703
2734
|
}
|
|
2704
|
-
function
|
|
2735
|
+
function vt(i) {
|
|
2705
2736
|
let t = [];
|
|
2706
2737
|
return Object.keys(i).forEach((e) => {
|
|
2707
2738
|
const s = i[e];
|
|
@@ -2724,16 +2755,16 @@ function _e(i, t = 0.1) {
|
|
|
2724
2755
|
max: r + a
|
|
2725
2756
|
};
|
|
2726
2757
|
}
|
|
2727
|
-
const
|
|
2758
|
+
const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2728
2759
|
__proto__: null,
|
|
2729
|
-
getAllObjectsInGroupedValues:
|
|
2760
|
+
getAllObjectsInGroupedValues: vt,
|
|
2730
2761
|
getMinMax: _e,
|
|
2731
|
-
getValueForOperator:
|
|
2762
|
+
getValueForOperator: Y,
|
|
2732
2763
|
getValuesForYField: N,
|
|
2733
2764
|
getValuesGroupedByField: A,
|
|
2734
2765
|
getYAxisFieldname: he,
|
|
2735
|
-
labelsForOperator:
|
|
2736
|
-
processGraphData:
|
|
2766
|
+
labelsForOperator: xt,
|
|
2767
|
+
processGraphData: wt
|
|
2737
2768
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2738
2769
|
export {
|
|
2739
2770
|
Xe as Alert,
|
|
@@ -2742,27 +2773,28 @@ export {
|
|
|
2742
2773
|
ee as Boolean,
|
|
2743
2774
|
Z as Button,
|
|
2744
2775
|
Te as ButtonGroup,
|
|
2776
|
+
Ze as Carousel,
|
|
2745
2777
|
q as Char,
|
|
2746
2778
|
se as CodeEditor,
|
|
2747
2779
|
Ue as Comments,
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2780
|
+
V as Container,
|
|
2781
|
+
w as ContainerWidget,
|
|
2782
|
+
zt as Dashboard,
|
|
2783
|
+
at as DashboardItem,
|
|
2752
2784
|
Ye as Date,
|
|
2753
2785
|
De as DateTime,
|
|
2754
2786
|
Ke as Email,
|
|
2755
2787
|
f as Field,
|
|
2756
2788
|
G as Float,
|
|
2757
2789
|
Se as FloatTime,
|
|
2758
|
-
|
|
2790
|
+
Tt as Form,
|
|
2759
2791
|
le as Graph,
|
|
2760
2792
|
ce as GraphAxis,
|
|
2761
2793
|
j as GraphChart,
|
|
2762
2794
|
oe as GraphIndicator,
|
|
2763
|
-
|
|
2795
|
+
lt as GraphIndicatorField,
|
|
2764
2796
|
dt as GraphXAxis,
|
|
2765
|
-
|
|
2797
|
+
ut as GraphYAxis,
|
|
2766
2798
|
Pe as Group,
|
|
2767
2799
|
ze as HTMLPreview,
|
|
2768
2800
|
Ae as Image,
|
|
@@ -2780,9 +2812,9 @@ export {
|
|
|
2780
2812
|
Ve as ProgressBar,
|
|
2781
2813
|
qe as Radio,
|
|
2782
2814
|
Me as Reference,
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2815
|
+
rt as SearchFieldTypes,
|
|
2816
|
+
Et as SearchFilter,
|
|
2817
|
+
E as Selection,
|
|
2786
2818
|
je as Separator,
|
|
2787
2819
|
B as Spinner,
|
|
2788
2820
|
He as Steps,
|
|
@@ -2792,14 +2824,14 @@ export {
|
|
|
2792
2824
|
L as Text,
|
|
2793
2825
|
Qe as Time,
|
|
2794
2826
|
Le as Timeline,
|
|
2795
|
-
|
|
2827
|
+
Wt as Tree,
|
|
2796
2828
|
C as Widget,
|
|
2797
|
-
|
|
2798
|
-
|
|
2829
|
+
Yt as graphFieldUtils,
|
|
2830
|
+
Dt as graphProcessor,
|
|
2799
2831
|
ne as parseContext,
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2832
|
+
Pt as parseContextFields,
|
|
2833
|
+
St as parseDomainFields,
|
|
2834
|
+
Vt as parseGraph,
|
|
2835
|
+
It as transformDomainForChildWidget
|
|
2804
2836
|
};
|
|
2805
2837
|
//# sourceMappingURL=ooui.es.js.map
|