@gisce/ooui 1.0.0-alpha.13 → 1.0.0-alpha.15
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/ooui.es.js +100 -100
- package/dist/ooui.es.js.map +1 -1
- package/package.json +2 -2
- package/src/helpers/attributeParser.ts +2 -2
- package/src/spec/attributeParser.spec.ts +16 -0
package/dist/ooui.es.js
CHANGED
|
@@ -113,29 +113,29 @@ const ue = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), he
|
|
|
113
113
|
values: t,
|
|
114
114
|
fields: e
|
|
115
115
|
}) => {
|
|
116
|
-
const [i, r,
|
|
116
|
+
const [i, r, l] = s;
|
|
117
117
|
if (e[i] === void 0 || t[i] === void 0 && e[i].type !== "boolean" && e[i].type !== "many2one")
|
|
118
118
|
return !1;
|
|
119
|
-
let
|
|
120
|
-
switch (e[i].type === "many2one" &&
|
|
119
|
+
let o = l, a = e[i].type === "boolean" ? !!t[i] : t[i];
|
|
120
|
+
switch (e[i].type === "many2one" && l === !1 && t[i] === void 0 ? o = void 0 : (a = a === void 0 ? !1 : a, a = a === null ? !1 : a), e[i].type === "many2one" && Array.isArray(a) && a[0] === void 0 && (a = !1), e[i].type === "boolean" && (l === 0 || l === 1) && (o = l !== 0), r.toLowerCase()) {
|
|
121
121
|
case "=":
|
|
122
122
|
case "==":
|
|
123
|
-
return a ==
|
|
123
|
+
return a == o;
|
|
124
124
|
case "<>":
|
|
125
125
|
case "!=":
|
|
126
|
-
return a !=
|
|
126
|
+
return a != o;
|
|
127
127
|
case ">":
|
|
128
|
-
return a >
|
|
128
|
+
return a > o;
|
|
129
129
|
case ">=":
|
|
130
|
-
return a >=
|
|
130
|
+
return a >= o;
|
|
131
131
|
case "<":
|
|
132
|
-
return a <
|
|
132
|
+
return a < o;
|
|
133
133
|
case "<=":
|
|
134
|
-
return a <=
|
|
134
|
+
return a <= o;
|
|
135
135
|
case "in":
|
|
136
|
-
return
|
|
136
|
+
return o.includes(a);
|
|
137
137
|
case "not in":
|
|
138
|
-
return !
|
|
138
|
+
return !o.includes(a);
|
|
139
139
|
default:
|
|
140
140
|
return !1;
|
|
141
141
|
}
|
|
@@ -156,15 +156,15 @@ const ue = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), he
|
|
|
156
156
|
values: t
|
|
157
157
|
}) => {
|
|
158
158
|
try {
|
|
159
|
-
const e = JSON.parse(
|
|
160
|
-
|
|
161
|
-
),
|
|
162
|
-
for (const
|
|
163
|
-
|
|
159
|
+
const e = b(s), i = JSON.parse(
|
|
160
|
+
e.replace(/'/g, '"')
|
|
161
|
+
), r = {};
|
|
162
|
+
for (const l of Object.keys(i))
|
|
163
|
+
r[l] = de(
|
|
164
164
|
t,
|
|
165
|
-
|
|
165
|
+
i[l]
|
|
166
166
|
);
|
|
167
|
-
return
|
|
167
|
+
return r;
|
|
168
168
|
} catch (e) {
|
|
169
169
|
throw console.error(e), new Error("Error parsing new json_attrs. Original string: " + s);
|
|
170
170
|
}
|
|
@@ -302,12 +302,12 @@ class g extends v {
|
|
|
302
302
|
}
|
|
303
303
|
class me extends g {
|
|
304
304
|
}
|
|
305
|
-
class
|
|
305
|
+
class R extends v {
|
|
306
306
|
findById(t) {
|
|
307
307
|
return null;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
class
|
|
310
|
+
class J extends g {
|
|
311
311
|
constructor(e) {
|
|
312
312
|
super({ ...e, nolabel: !0 });
|
|
313
313
|
/**
|
|
@@ -430,13 +430,13 @@ class Y {
|
|
|
430
430
|
}
|
|
431
431
|
addWidget(t, e) {
|
|
432
432
|
const i = [], r = e ? e.addLabel : !0;
|
|
433
|
-
if (t instanceof
|
|
433
|
+
if (t instanceof R) {
|
|
434
434
|
this._rows.push([]), this._index++;
|
|
435
435
|
return;
|
|
436
436
|
}
|
|
437
437
|
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof g && !t.nolabel) {
|
|
438
438
|
t.colspan > 1 && (t.colspan -= 1);
|
|
439
|
-
const
|
|
439
|
+
const o = new J({
|
|
440
440
|
name: t.id + "_label",
|
|
441
441
|
string: t.label,
|
|
442
442
|
invisible: t.invisible,
|
|
@@ -444,11 +444,11 @@ class Y {
|
|
|
444
444
|
fieldForLabel: t.id,
|
|
445
445
|
key: `${t.key}-label`
|
|
446
446
|
});
|
|
447
|
-
|
|
447
|
+
o.type = "label", i.push(o), i.push(t);
|
|
448
448
|
} else
|
|
449
449
|
i.push(t);
|
|
450
450
|
i.reduce(
|
|
451
|
-
(
|
|
451
|
+
(o, a) => o + a.colspan,
|
|
452
452
|
0
|
|
453
453
|
) > this.freePosition() && (this._rows.push([]), this._index++), this._rows[this._index] = this._rows[this._index].concat(i);
|
|
454
454
|
}
|
|
@@ -460,8 +460,8 @@ class Y {
|
|
|
460
460
|
var i;
|
|
461
461
|
let e = null;
|
|
462
462
|
return (i = this._rows) != null && i.length && this._rows.forEach((r) => {
|
|
463
|
-
e || r != null && r.length && r.forEach((
|
|
464
|
-
e ||
|
|
463
|
+
e || r != null && r.length && r.forEach((l) => {
|
|
464
|
+
e || l && (e = l.findById(t));
|
|
465
465
|
});
|
|
466
466
|
}), e;
|
|
467
467
|
}
|
|
@@ -1230,7 +1230,7 @@ class L {
|
|
|
1230
1230
|
this._widgetClass = ye;
|
|
1231
1231
|
break;
|
|
1232
1232
|
case "label":
|
|
1233
|
-
this._widgetClass =
|
|
1233
|
+
this._widgetClass = J;
|
|
1234
1234
|
break;
|
|
1235
1235
|
case "char":
|
|
1236
1236
|
this._widgetClass = N;
|
|
@@ -1282,7 +1282,7 @@ class L {
|
|
|
1282
1282
|
this._widgetClass = X;
|
|
1283
1283
|
break;
|
|
1284
1284
|
case "newline":
|
|
1285
|
-
this._widgetClass =
|
|
1285
|
+
this._widgetClass = R;
|
|
1286
1286
|
break;
|
|
1287
1287
|
case "separator":
|
|
1288
1288
|
this._widgetClass = Ee;
|
|
@@ -1363,23 +1363,23 @@ const Ge = ({
|
|
|
1363
1363
|
values: t,
|
|
1364
1364
|
fields: e
|
|
1365
1365
|
}) => {
|
|
1366
|
-
var
|
|
1366
|
+
var o;
|
|
1367
1367
|
if (!s)
|
|
1368
1368
|
return {};
|
|
1369
|
-
const i = (
|
|
1369
|
+
const i = (o = e[s]) == null ? void 0 : o.states;
|
|
1370
1370
|
if (!i)
|
|
1371
1371
|
return {};
|
|
1372
|
-
const r = {},
|
|
1372
|
+
const r = {}, l = {};
|
|
1373
1373
|
for (const a of Object.keys(i))
|
|
1374
1374
|
if (t.state === a) {
|
|
1375
1375
|
const h = i[a];
|
|
1376
1376
|
for (const _ of h) {
|
|
1377
1377
|
const [u, d] = _;
|
|
1378
|
-
|
|
1378
|
+
l[u] || (l[u] = []), l[u].push(d);
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
|
-
for (const a of Object.keys(
|
|
1382
|
-
const h =
|
|
1381
|
+
for (const a of Object.keys(l)) {
|
|
1382
|
+
const h = l[a];
|
|
1383
1383
|
r[a] = h.some((_) => _);
|
|
1384
1384
|
}
|
|
1385
1385
|
return r;
|
|
@@ -1399,7 +1399,7 @@ function $e({
|
|
|
1399
1399
|
}) {
|
|
1400
1400
|
var r;
|
|
1401
1401
|
const i = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
|
|
1402
|
-
return i === "many2one" ? s[t] ? s[t][0] || null : !1 : i === "one2many" || i === "many2many" ? s[t].map((
|
|
1402
|
+
return i === "many2one" ? s[t] ? s[t][0] || null : !1 : i === "one2many" || i === "many2many" ? s[t].map((l) => l.id) : s != null && s[t] ? s == null ? void 0 : s[t] : t.includes("'") ? t : parseInt(t);
|
|
1403
1403
|
}
|
|
1404
1404
|
const qe = ({
|
|
1405
1405
|
context: s,
|
|
@@ -1455,8 +1455,8 @@ function K(s) {
|
|
|
1455
1455
|
function Z(s) {
|
|
1456
1456
|
return typeof s == "object" && s !== null && typeof s != "string";
|
|
1457
1457
|
}
|
|
1458
|
-
const
|
|
1459
|
-
const t = s.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((
|
|
1458
|
+
const Re = (s) => {
|
|
1459
|
+
const t = s.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((l) => l.trim());
|
|
1460
1460
|
return {
|
|
1461
1461
|
method: e,
|
|
1462
1462
|
args: r
|
|
@@ -1554,10 +1554,10 @@ class bt {
|
|
|
1554
1554
|
this._invisibleFields = t;
|
|
1555
1555
|
}
|
|
1556
1556
|
parse(t, e) {
|
|
1557
|
-
var
|
|
1558
|
-
const { values: i = {}, readOnly: r = !1 } = e || {},
|
|
1559
|
-
this._string = ((
|
|
1560
|
-
fields:
|
|
1557
|
+
var o;
|
|
1558
|
+
const { values: i = {}, readOnly: r = !1 } = e || {}, l = I.parse(t).filter((a) => a.tagName === "form")[0];
|
|
1559
|
+
this._string = ((o = l.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
1560
|
+
fields: l.children,
|
|
1561
1561
|
container: this._container,
|
|
1562
1562
|
values: i
|
|
1563
1563
|
});
|
|
@@ -1568,11 +1568,11 @@ class bt {
|
|
|
1568
1568
|
values: i
|
|
1569
1569
|
}) {
|
|
1570
1570
|
const r = new L();
|
|
1571
|
-
t.filter((
|
|
1571
|
+
t.filter((l) => typeof l == "object").forEach((l) => {
|
|
1572
1572
|
var w, P;
|
|
1573
|
-
const { tagName:
|
|
1574
|
-
let _ =
|
|
1575
|
-
if (
|
|
1573
|
+
const { tagName: o, attributes: a, children: h } = l;
|
|
1574
|
+
let _ = o, u = a;
|
|
1575
|
+
if (o === "field") {
|
|
1576
1576
|
const { name: x, widget: z } = a;
|
|
1577
1577
|
if (z)
|
|
1578
1578
|
_ = z;
|
|
@@ -1593,10 +1593,10 @@ class bt {
|
|
|
1593
1593
|
tagAttributes: u,
|
|
1594
1594
|
values: i,
|
|
1595
1595
|
fields: this._fields,
|
|
1596
|
-
widgetType:
|
|
1596
|
+
widgetType: o
|
|
1597
1597
|
});
|
|
1598
1598
|
let c;
|
|
1599
|
-
|
|
1599
|
+
o === "button" && u.states ? c = Le({
|
|
1600
1600
|
states: u.states,
|
|
1601
1601
|
values: i
|
|
1602
1602
|
}) : c = Ge({
|
|
@@ -1609,7 +1609,7 @@ class bt {
|
|
|
1609
1609
|
values: i,
|
|
1610
1610
|
fields: this._fields
|
|
1611
1611
|
});
|
|
1612
|
-
u.on_change && (this._onChangeFields[u.name] =
|
|
1612
|
+
u.on_change && (this._onChangeFields[u.name] = Re(
|
|
1613
1613
|
u.on_change
|
|
1614
1614
|
));
|
|
1615
1615
|
let y;
|
|
@@ -1688,18 +1688,18 @@ class yt {
|
|
|
1688
1688
|
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;
|
|
1689
1689
|
const i = new L();
|
|
1690
1690
|
e.children.forEach((r) => {
|
|
1691
|
-
const { tagName:
|
|
1691
|
+
const { tagName: l, attributes: o } = r;
|
|
1692
1692
|
let a = null;
|
|
1693
|
-
if (
|
|
1694
|
-
const { name: h, widget: _ } =
|
|
1695
|
-
let u =
|
|
1693
|
+
if (l === "field") {
|
|
1694
|
+
const { name: h, widget: _ } = o;
|
|
1695
|
+
let u = o;
|
|
1696
1696
|
if (h) {
|
|
1697
1697
|
if (!this._fields[h])
|
|
1698
1698
|
throw new Error(`Field ${h} doesn't exist in fields defintion`);
|
|
1699
1699
|
const d = this._fields[h];
|
|
1700
|
-
a = 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) &&
|
|
1700
|
+
a = 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) && o.domain && o.domain.length > 0 && delete d.domain, u = {
|
|
1701
1701
|
...d,
|
|
1702
|
-
...
|
|
1702
|
+
...o,
|
|
1703
1703
|
fieldsWidgetType: d == null ? void 0 : d.type
|
|
1704
1704
|
};
|
|
1705
1705
|
}
|
|
@@ -1718,7 +1718,7 @@ class yt {
|
|
|
1718
1718
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
|
-
const
|
|
1721
|
+
const Je = {
|
|
1722
1722
|
text: "text",
|
|
1723
1723
|
many2one: "many2one",
|
|
1724
1724
|
char: "char",
|
|
@@ -1777,9 +1777,9 @@ class pt {
|
|
|
1777
1777
|
...this.fields[i],
|
|
1778
1778
|
name: i,
|
|
1779
1779
|
colspan: 2
|
|
1780
|
-
}, { type:
|
|
1781
|
-
let a =
|
|
1782
|
-
return
|
|
1780
|
+
}, { type: l, widget: o } = r;
|
|
1781
|
+
let a = o ?? l;
|
|
1782
|
+
return Je[a] === void 0 && (a = l), e.createWidget(a, r);
|
|
1783
1783
|
});
|
|
1784
1784
|
}
|
|
1785
1785
|
/**
|
|
@@ -1798,12 +1798,12 @@ const xt = ({
|
|
|
1798
1798
|
return s.forEach((i) => {
|
|
1799
1799
|
if (!Array.isArray(i))
|
|
1800
1800
|
return;
|
|
1801
|
-
const [r,
|
|
1801
|
+
const [r, l, o] = i;
|
|
1802
1802
|
let a, h;
|
|
1803
1803
|
r.indexOf(".") !== -1 ? (a = r.substr(0, r.indexOf(".")), h = r.substr(
|
|
1804
1804
|
r.indexOf(".") + 1,
|
|
1805
1805
|
r.length - 1
|
|
1806
|
-
)) : (a = r, h = "id"), a === t && e.push([h,
|
|
1806
|
+
)) : (a = r, h = "id"), a === t && e.push([h, l, o]);
|
|
1807
1807
|
}), e;
|
|
1808
1808
|
}, wt = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
1809
1809
|
class He {
|
|
@@ -1887,10 +1887,10 @@ class Xe extends te {
|
|
|
1887
1887
|
n(this, "_field");
|
|
1888
1888
|
n(this, "_operator");
|
|
1889
1889
|
const { children: r } = i;
|
|
1890
|
-
r.forEach((
|
|
1891
|
-
if (
|
|
1892
|
-
const
|
|
1893
|
-
this._field =
|
|
1890
|
+
r.forEach((l) => {
|
|
1891
|
+
if (l.tagName === "field") {
|
|
1892
|
+
const o = l.attributes.name, a = l.attributes.operator;
|
|
1893
|
+
this._field = o || void 0, this._operator = a;
|
|
1894
1894
|
}
|
|
1895
1895
|
});
|
|
1896
1896
|
}
|
|
@@ -1906,17 +1906,17 @@ const Ue = (s) => {
|
|
|
1906
1906
|
let e;
|
|
1907
1907
|
if (s.forEach((i) => {
|
|
1908
1908
|
if (i.tagName === "field") {
|
|
1909
|
-
const r = i.attributes.axis,
|
|
1909
|
+
const r = i.attributes.axis, l = i.attributes.operator, o = i.attributes.name, a = i.attributes.label || void 0, h = i.attributes.stacked || void 0;
|
|
1910
1910
|
if (!r)
|
|
1911
|
-
throw new Error(`Field ${
|
|
1912
|
-
if (!
|
|
1911
|
+
throw new Error(`Field ${o} doesn't have an axis`);
|
|
1912
|
+
if (!o)
|
|
1913
1913
|
throw new Error("Missing name attribute for field");
|
|
1914
1914
|
r === "x" ? e = new et({
|
|
1915
|
-
name:
|
|
1915
|
+
name: o
|
|
1916
1916
|
}) : r === "y" && t.push(
|
|
1917
1917
|
new Ze({
|
|
1918
|
-
name:
|
|
1919
|
-
operator:
|
|
1918
|
+
name: o,
|
|
1919
|
+
operator: l,
|
|
1920
1920
|
label: a,
|
|
1921
1921
|
stacked: h
|
|
1922
1922
|
})
|
|
@@ -1980,13 +1980,13 @@ class Ze extends se {
|
|
|
1980
1980
|
name: e,
|
|
1981
1981
|
operator: i,
|
|
1982
1982
|
label: r,
|
|
1983
|
-
stacked:
|
|
1983
|
+
stacked: l
|
|
1984
1984
|
}) {
|
|
1985
1985
|
super({ name: e, axis: "y" });
|
|
1986
1986
|
n(this, "_operator");
|
|
1987
1987
|
n(this, "_label");
|
|
1988
1988
|
n(this, "_stacked");
|
|
1989
|
-
this._operator = i, this._label = r, this._stacked =
|
|
1989
|
+
this._operator = i, this._label = r, this._stacked = l;
|
|
1990
1990
|
}
|
|
1991
1991
|
get operator() {
|
|
1992
1992
|
return this._operator;
|
|
@@ -2020,8 +2020,8 @@ function $({
|
|
|
2020
2020
|
if (i.type === "many2one")
|
|
2021
2021
|
return r ? { value: r[0], label: r[1] } : { value: !1, label: void 0 };
|
|
2022
2022
|
if (i.type === "selection") {
|
|
2023
|
-
const
|
|
2024
|
-
return
|
|
2023
|
+
const o = i.selection.find((a) => a[0] === r);
|
|
2024
|
+
return o ? { value: r, label: o[1] } : { value: !1, label: void 0 };
|
|
2025
2025
|
}
|
|
2026
2026
|
return { value: r, label: r };
|
|
2027
2027
|
}
|
|
@@ -2052,8 +2052,8 @@ function it({
|
|
|
2052
2052
|
values: s,
|
|
2053
2053
|
groupBy: "type-stacked"
|
|
2054
2054
|
}), r = `${t}s`;
|
|
2055
|
-
return Object.keys(i).forEach((
|
|
2056
|
-
const a = i[
|
|
2055
|
+
return Object.keys(i).forEach((o) => {
|
|
2056
|
+
const a = i[o];
|
|
2057
2057
|
for (let h = 0; h < a.length; h++) {
|
|
2058
2058
|
const _ = a[h];
|
|
2059
2059
|
if (e.push(_), h === a.length - 1)
|
|
@@ -2074,7 +2074,7 @@ function it({
|
|
|
2074
2074
|
);
|
|
2075
2075
|
}
|
|
2076
2076
|
}
|
|
2077
|
-
}), e.sort((
|
|
2077
|
+
}), e.sort((o, a) => o.x < a.x ? -1 : o.x > a.x ? 1 : 0);
|
|
2078
2078
|
}
|
|
2079
2079
|
function nt({
|
|
2080
2080
|
dates: s,
|
|
@@ -2083,11 +2083,11 @@ function nt({
|
|
|
2083
2083
|
const e = [], i = `${t}s`;
|
|
2084
2084
|
if (s.length === 1)
|
|
2085
2085
|
return s;
|
|
2086
|
-
const r = s.sort((
|
|
2087
|
-
for (let
|
|
2088
|
-
const
|
|
2089
|
-
if (!ie([
|
|
2090
|
-
const h = T(
|
|
2086
|
+
const r = s.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2087
|
+
for (let l = 0; l < r.length - 1; l++) {
|
|
2088
|
+
const o = r[l], a = r[l + 1];
|
|
2089
|
+
if (!ie([o, a], i)) {
|
|
2090
|
+
const h = T(o, W(i)).add(1, i), _ = T(a, W(i));
|
|
2091
2091
|
for (; h.isBefore(_); )
|
|
2092
2092
|
e.push(h.format(W(i))), h.add(1, i);
|
|
2093
2093
|
}
|
|
@@ -2105,13 +2105,13 @@ function rt({
|
|
|
2105
2105
|
values: e,
|
|
2106
2106
|
groupBy: "all"
|
|
2107
2107
|
});
|
|
2108
|
-
return Object.keys(r).forEach((
|
|
2109
|
-
const
|
|
2110
|
-
values:
|
|
2108
|
+
return Object.keys(r).forEach((l) => {
|
|
2109
|
+
const o = r[l], a = o[0].operator === "count" ? "+" : o[0].operator, h = D({
|
|
2110
|
+
values: o.map((_) => _.value),
|
|
2111
2111
|
operator: a
|
|
2112
2112
|
});
|
|
2113
2113
|
i.push({
|
|
2114
|
-
...
|
|
2114
|
+
...o[0],
|
|
2115
2115
|
value: h
|
|
2116
2116
|
});
|
|
2117
2117
|
}), i;
|
|
@@ -2169,7 +2169,7 @@ function ie(s, t) {
|
|
|
2169
2169
|
if (s.length === 1)
|
|
2170
2170
|
return !0;
|
|
2171
2171
|
for (let r = 0; r < s.length - 1; r++) {
|
|
2172
|
-
const
|
|
2172
|
+
const l = T(s[r], i), a = T(s[r + 1], i).diff(l, t);
|
|
2173
2173
|
Math.abs(a) === 1 ? e = !0 : e = !1;
|
|
2174
2174
|
}
|
|
2175
2175
|
return e;
|
|
@@ -2180,7 +2180,7 @@ function ne({
|
|
|
2180
2180
|
}) {
|
|
2181
2181
|
const e = {};
|
|
2182
2182
|
return s.forEach((i) => {
|
|
2183
|
-
const r = i.x,
|
|
2183
|
+
const r = i.x, l = i.type, o = i.stacked, a = t === "all" ? `${r}-${l}-${o}` : `${l}-${o}`;
|
|
2184
2184
|
e[a] || (e[a] = []), e[a].push(i);
|
|
2185
2185
|
}), e;
|
|
2186
2186
|
}
|
|
@@ -2217,7 +2217,7 @@ const ct = {
|
|
|
2217
2217
|
fieldName: s.x.name,
|
|
2218
2218
|
values: t,
|
|
2219
2219
|
fields: e
|
|
2220
|
-
}),
|
|
2220
|
+
}), l = [];
|
|
2221
2221
|
s.y.forEach((c) => {
|
|
2222
2222
|
Object.keys(r).forEach((f) => {
|
|
2223
2223
|
const y = r[f].label, p = r[f].entries;
|
|
@@ -2236,7 +2236,7 @@ const ct = {
|
|
|
2236
2236
|
values: z,
|
|
2237
2237
|
operator: c.operator
|
|
2238
2238
|
});
|
|
2239
|
-
|
|
2239
|
+
l.push({
|
|
2240
2240
|
x: y || !1,
|
|
2241
2241
|
value: ae,
|
|
2242
2242
|
type: x,
|
|
@@ -2253,7 +2253,7 @@ const ct = {
|
|
|
2253
2253
|
values: m,
|
|
2254
2254
|
operator: c.operator
|
|
2255
2255
|
});
|
|
2256
|
-
|
|
2256
|
+
l.push({
|
|
2257
2257
|
x: y || !1,
|
|
2258
2258
|
value: w,
|
|
2259
2259
|
type: re({
|
|
@@ -2266,8 +2266,8 @@ const ct = {
|
|
|
2266
2266
|
}
|
|
2267
2267
|
});
|
|
2268
2268
|
});
|
|
2269
|
-
const
|
|
2270
|
-
let _ = [...
|
|
2269
|
+
const o = s.y.some((c) => c.label !== void 0), a = s.y.some((c) => c.stacked !== void 0);
|
|
2270
|
+
let _ = [...l.sort((c, f) => c.x < f.x ? -1 : c.x > f.x ? 1 : 0)];
|
|
2271
2271
|
a && s.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
|
|
2272
2272
|
let u = [..._];
|
|
2273
2273
|
s.type === "pie" && u.some((c) => c.x === !1) ? u = u.map((c) => c.x === !1 ? { ...c, x: (i == null ? void 0 : i.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (u = u.filter(
|
|
@@ -2279,7 +2279,7 @@ const ct = {
|
|
|
2279
2279
|
timerange: s.timerange
|
|
2280
2280
|
}) : s.type == "pie" && (d = u.sort((c, f) => f.value - c.value)), {
|
|
2281
2281
|
data: d,
|
|
2282
|
-
isGroup: a ||
|
|
2282
|
+
isGroup: a || o,
|
|
2283
2283
|
isStack: a
|
|
2284
2284
|
};
|
|
2285
2285
|
};
|
|
@@ -2320,7 +2320,7 @@ function D({
|
|
|
2320
2320
|
})
|
|
2321
2321
|
);
|
|
2322
2322
|
case "avg": {
|
|
2323
|
-
const i = t.reduce((r,
|
|
2323
|
+
const i = t.reduce((r, l) => r + l, 0) / t.length || 0;
|
|
2324
2324
|
return S(i);
|
|
2325
2325
|
}
|
|
2326
2326
|
case "min":
|
|
@@ -2339,12 +2339,12 @@ function B({
|
|
|
2339
2339
|
}) {
|
|
2340
2340
|
const i = {};
|
|
2341
2341
|
return e.forEach((r) => {
|
|
2342
|
-
const { value:
|
|
2342
|
+
const { value: l, label: o } = $({
|
|
2343
2343
|
fields: t,
|
|
2344
2344
|
values: r,
|
|
2345
2345
|
fieldName: s
|
|
2346
2346
|
});
|
|
2347
|
-
i[
|
|
2347
|
+
i[l] || (i[l] = { label: o, entries: [] }), i[l].entries.push(r);
|
|
2348
2348
|
}), i;
|
|
2349
2349
|
}
|
|
2350
2350
|
function ut(s) {
|
|
@@ -2400,19 +2400,19 @@ export {
|
|
|
2400
2400
|
Se as Image,
|
|
2401
2401
|
De as Indicator,
|
|
2402
2402
|
ve as Integer,
|
|
2403
|
-
|
|
2403
|
+
J as Label,
|
|
2404
2404
|
Te as Many2many,
|
|
2405
2405
|
xe as Many2one,
|
|
2406
2406
|
we as Markdown,
|
|
2407
2407
|
U as MultiCheckbox,
|
|
2408
|
-
|
|
2408
|
+
R as NewLine,
|
|
2409
2409
|
V as Notebook,
|
|
2410
2410
|
X as One2many,
|
|
2411
2411
|
be as Page,
|
|
2412
2412
|
Fe as ProgressBar,
|
|
2413
2413
|
Me as Radio,
|
|
2414
2414
|
Pe as Reference,
|
|
2415
|
-
|
|
2415
|
+
Je as SearchFieldTypes,
|
|
2416
2416
|
pt as SearchFilter,
|
|
2417
2417
|
E as Selection,
|
|
2418
2418
|
Ee as Separator,
|