@gisce/ooui 2.6.1 → 2.6.2
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/One2many.d.ts +6 -0
- package/dist/One2many.d.ts.map +1 -1
- package/dist/ooui.es.js +269 -256
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/One2many.ts +22 -0
package/dist/ooui.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var ce = Object.defineProperty;
|
|
2
|
-
var de = (
|
|
3
|
-
var n = (
|
|
2
|
+
var de = (i, t, e) => t in i ? ce(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var n = (i, t, e) => (de(i, 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";
|
|
@@ -108,14 +108,14 @@ const C = class C {
|
|
|
108
108
|
*/
|
|
109
109
|
n(C, "_defaultColspan", 1);
|
|
110
110
|
let F = C;
|
|
111
|
-
const _e = (
|
|
112
|
-
entry:
|
|
111
|
+
const _e = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), fe = ({
|
|
112
|
+
entry: i,
|
|
113
113
|
values: t,
|
|
114
114
|
fields: e
|
|
115
115
|
}) => {
|
|
116
|
-
let [
|
|
116
|
+
let [s, r, a] = i, l = t[s];
|
|
117
117
|
const o = q({
|
|
118
|
-
fieldName:
|
|
118
|
+
fieldName: s,
|
|
119
119
|
valueInObject: l,
|
|
120
120
|
expectedValue: a,
|
|
121
121
|
fields: e
|
|
@@ -144,46 +144,46 @@ const _e = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), fe
|
|
|
144
144
|
default:
|
|
145
145
|
return !1;
|
|
146
146
|
}
|
|
147
|
-
}, b = (
|
|
148
|
-
fieldName:
|
|
147
|
+
}, b = (i) => ue(i, { level: "xml" }), q = ({
|
|
148
|
+
fieldName: i,
|
|
149
149
|
valueInObject: t,
|
|
150
150
|
expectedValue: e,
|
|
151
|
-
fields:
|
|
151
|
+
fields: s = {}
|
|
152
152
|
}) => {
|
|
153
153
|
const r = {
|
|
154
154
|
modifiedValueInObject: t,
|
|
155
155
|
modifiedExpectedValue: null,
|
|
156
156
|
directOutcome: void 0
|
|
157
157
|
};
|
|
158
|
-
return i
|
|
158
|
+
return s[i] === void 0 ? {
|
|
159
159
|
modifiedValueInObject: null,
|
|
160
160
|
modifiedExpectedValue: null,
|
|
161
161
|
directOutcome: !1
|
|
162
|
-
} : t === void 0 && i
|
|
162
|
+
} : t === void 0 && s[i].type !== "boolean" && s[i].type !== "many2one" && s[i].type !== "selection" ? {
|
|
163
163
|
modifiedValueInObject: null,
|
|
164
164
|
modifiedExpectedValue: null,
|
|
165
165
|
directOutcome: !1
|
|
166
|
-
} : (r.modifiedValueInObject = i
|
|
166
|
+
} : (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);
|
|
167
167
|
}, ge = ({
|
|
168
|
-
attrs:
|
|
168
|
+
attrs: i,
|
|
169
169
|
values: t,
|
|
170
170
|
fields: e,
|
|
171
|
-
widgetType:
|
|
171
|
+
widgetType: s
|
|
172
172
|
}) => {
|
|
173
|
-
const u =
|
|
173
|
+
const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(u), h = JSON.parse(_), d = {};
|
|
174
174
|
for (const c of Object.keys(h)) {
|
|
175
175
|
const x = h[c].map((m) => fe({ entry: m, values: t, fields: e })).every((m) => m);
|
|
176
|
-
x ? d[c] = !0 : c === "readonly" && !x &&
|
|
176
|
+
x ? d[c] = !0 : c === "readonly" && !x && s === "button" && (d[c] = !1);
|
|
177
177
|
}
|
|
178
178
|
return d;
|
|
179
179
|
}, me = ({
|
|
180
|
-
attrs:
|
|
180
|
+
attrs: i,
|
|
181
181
|
values: t,
|
|
182
182
|
fields: e
|
|
183
183
|
}) => {
|
|
184
184
|
try {
|
|
185
|
-
const
|
|
186
|
-
|
|
185
|
+
const s = b(i), r = JSON.parse(
|
|
186
|
+
s.replace(/'/g, '"')
|
|
187
187
|
), a = {};
|
|
188
188
|
for (const l of Object.keys(r))
|
|
189
189
|
a[l] = he({
|
|
@@ -201,41 +201,41 @@ const _e = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), fe
|
|
|
201
201
|
})
|
|
202
202
|
});
|
|
203
203
|
return a;
|
|
204
|
-
} catch (
|
|
205
|
-
throw console.error(
|
|
206
|
-
"Error parsing new json_attrs. Original string: " +
|
|
207
|
-
) :
|
|
204
|
+
} catch (s) {
|
|
205
|
+
throw console.error(s), s instanceof SyntaxError ? new Error(
|
|
206
|
+
"Error parsing new json_attrs. Original string: " + i
|
|
207
|
+
) : s;
|
|
208
208
|
}
|
|
209
209
|
}, be = ({
|
|
210
|
-
tagAttributes:
|
|
210
|
+
tagAttributes: i,
|
|
211
211
|
values: t,
|
|
212
212
|
fields: e,
|
|
213
|
-
widgetType:
|
|
213
|
+
widgetType: s,
|
|
214
214
|
fallbackMode: r = !0
|
|
215
215
|
}) => {
|
|
216
216
|
let a = {}, l = {};
|
|
217
|
-
if (
|
|
218
|
-
attrs:
|
|
217
|
+
if (i.attrs && (l = ge({
|
|
218
|
+
attrs: i.attrs,
|
|
219
219
|
values: t,
|
|
220
220
|
fields: e,
|
|
221
|
-
widgetType:
|
|
222
|
-
})),
|
|
221
|
+
widgetType: s
|
|
222
|
+
})), i.json_attrs)
|
|
223
223
|
try {
|
|
224
224
|
a = me({
|
|
225
|
-
attrs:
|
|
225
|
+
attrs: i.json_attrs,
|
|
226
226
|
values: t,
|
|
227
227
|
fields: e
|
|
228
228
|
});
|
|
229
229
|
} catch (o) {
|
|
230
|
-
if (r &&
|
|
230
|
+
if (r && i.attrs)
|
|
231
231
|
a = l;
|
|
232
232
|
else
|
|
233
233
|
throw o;
|
|
234
234
|
}
|
|
235
235
|
else
|
|
236
|
-
|
|
236
|
+
i.attrs && (a = l);
|
|
237
237
|
return {
|
|
238
|
-
...
|
|
238
|
+
...i,
|
|
239
239
|
...a,
|
|
240
240
|
attrs: void 0,
|
|
241
241
|
json_attrs: void 0
|
|
@@ -415,7 +415,7 @@ class H extends g {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
class I {
|
|
418
|
-
constructor(t = 4, e = 6,
|
|
418
|
+
constructor(t = 4, e = 6, s = !1, r = void 0) {
|
|
419
419
|
/**
|
|
420
420
|
* Number of columns the container is divided
|
|
421
421
|
*/
|
|
@@ -437,7 +437,7 @@ class I {
|
|
|
437
437
|
* Unique key for container
|
|
438
438
|
*/
|
|
439
439
|
n(this, "_key");
|
|
440
|
-
this._columns = t, this._colspan = e, this._rows = [[]], this._index = 0, this._readOnly =
|
|
440
|
+
this._columns = t, this._colspan = e, this._rows = [[]], this._index = 0, this._readOnly = s, this._key = r;
|
|
441
441
|
}
|
|
442
442
|
get columns() {
|
|
443
443
|
return this._columns;
|
|
@@ -476,11 +476,11 @@ class I {
|
|
|
476
476
|
* Returns the next free position
|
|
477
477
|
*/
|
|
478
478
|
freePosition() {
|
|
479
|
-
const t = this._rows[this._index].filter((e) => !e.invisible).reduce((e,
|
|
479
|
+
const t = this._rows[this._index].filter((e) => !e.invisible).reduce((e, s) => e + s.colspan, 0);
|
|
480
480
|
return this._columns - t;
|
|
481
481
|
}
|
|
482
482
|
addWidget(t, e) {
|
|
483
|
-
const
|
|
483
|
+
const s = [], r = e ? e.addLabel : !0;
|
|
484
484
|
if (t instanceof J) {
|
|
485
485
|
this._rows.push([]), this._index++;
|
|
486
486
|
return;
|
|
@@ -495,22 +495,22 @@ class I {
|
|
|
495
495
|
fieldForLabel: t.id,
|
|
496
496
|
key: `${t.key}-label`
|
|
497
497
|
});
|
|
498
|
-
l.type = "label",
|
|
498
|
+
l.type = "label", s.push(l), s.push(t);
|
|
499
499
|
} else
|
|
500
|
-
|
|
501
|
-
|
|
500
|
+
s.push(t);
|
|
501
|
+
s.reduce(
|
|
502
502
|
(l, o) => l + o.colspan,
|
|
503
503
|
0
|
|
504
|
-
) > this.freePosition() && (this._rows.push([]), this._index++), this._rows[this._index] = this._rows[this._index].concat(
|
|
504
|
+
) > this.freePosition() && (this._rows.push([]), this._index++), this._rows[this._index] = this._rows[this._index].concat(s);
|
|
505
505
|
}
|
|
506
506
|
/**
|
|
507
507
|
* Traverses children to find a matching container or widget with the exact same id.
|
|
508
508
|
* @param {string} id id (name) of the field or container to find
|
|
509
509
|
*/
|
|
510
510
|
findById(t) {
|
|
511
|
-
var
|
|
511
|
+
var s;
|
|
512
512
|
let e = null;
|
|
513
|
-
return (
|
|
513
|
+
return (s = this._rows) != null && s.length && this._rows.forEach((r) => {
|
|
514
514
|
e || r != null && r.length && r.forEach((a) => {
|
|
515
515
|
e || a && (e = a.findById(t));
|
|
516
516
|
});
|
|
@@ -668,12 +668,12 @@ class Q extends g {
|
|
|
668
668
|
n(this, "_danger", !1);
|
|
669
669
|
if (e) {
|
|
670
670
|
if (e.string && (this._caption = b(e.string)), e.buttonType && (this._buttonType = e.buttonType), e.confirm && (this._confirmMessage = b(e.confirm)), e.special && e.special === "cancel" && (this._buttonType = "cancel"), e.icon && (this._icon = e.icon), e.primary) {
|
|
671
|
-
const
|
|
672
|
-
(
|
|
671
|
+
const s = e.primary;
|
|
672
|
+
(s === "1" || s === 1 || s === !0) && (this._primary = !0);
|
|
673
673
|
}
|
|
674
674
|
if (e.danger) {
|
|
675
|
-
const
|
|
676
|
-
(
|
|
675
|
+
const s = e.danger;
|
|
676
|
+
(s === "1" || s === 1 || s === !0) && (this._danger = !0);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
}
|
|
@@ -724,13 +724,13 @@ class we extends w {
|
|
|
724
724
|
return this._defaultName;
|
|
725
725
|
}
|
|
726
726
|
get defaultButton() {
|
|
727
|
-
return this.buttons.find((
|
|
727
|
+
return this.buttons.find((s) => s.id === this.defaultName) || this.buttons[0];
|
|
728
728
|
}
|
|
729
729
|
get secondaryButtons() {
|
|
730
730
|
return this.buttons.filter(
|
|
731
|
-
(
|
|
731
|
+
(s) => {
|
|
732
732
|
var r;
|
|
733
|
-
return
|
|
733
|
+
return s.id !== ((r = this.defaultButton) == null ? void 0 : r.id);
|
|
734
734
|
}
|
|
735
735
|
);
|
|
736
736
|
}
|
|
@@ -899,8 +899,8 @@ class L extends g {
|
|
|
899
899
|
*/
|
|
900
900
|
n(this, "_decimalDigits", 2);
|
|
901
901
|
if (e != null && e.digits) {
|
|
902
|
-
const [
|
|
903
|
-
this._integerDigits =
|
|
902
|
+
const [s, r] = e.digits;
|
|
903
|
+
this._integerDigits = s, this._decimalDigits = r;
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
get integerDigits() {
|
|
@@ -932,7 +932,7 @@ class Pe extends g {
|
|
|
932
932
|
super(t);
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
|
-
class
|
|
935
|
+
class We extends g {
|
|
936
936
|
constructor(e) {
|
|
937
937
|
super(e);
|
|
938
938
|
/**
|
|
@@ -999,12 +999,19 @@ class U extends g {
|
|
|
999
999
|
* Height
|
|
1000
1000
|
*/
|
|
1001
1001
|
n(this, "_height");
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1002
|
+
/**
|
|
1003
|
+
* Infinite mode
|
|
1004
|
+
*/
|
|
1005
|
+
n(this, "_infinite", !1);
|
|
1006
|
+
if (e) {
|
|
1007
|
+
if (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.mode && (this._mode = e.mode.split(",")), e.views && (this._views = e.views), e.colspan ? this.colspan = e.colspan : this._mustExpand = !0, e.inv_field && (this._inv_field = e.inv_field), e.height)
|
|
1008
|
+
try {
|
|
1009
|
+
this._height = parseInt(e.height);
|
|
1010
|
+
} catch {
|
|
1011
|
+
this._height = void 0;
|
|
1012
|
+
}
|
|
1013
|
+
e.widget_props && (this.parsedWidgetProps.infinite === "1" || this.parsedWidgetProps.infinite === 1 || this.parsedWidgetProps.infinite === !0) && (this._infinite = !0);
|
|
1014
|
+
}
|
|
1008
1015
|
}
|
|
1009
1016
|
get size() {
|
|
1010
1017
|
return this._size;
|
|
@@ -1048,8 +1055,14 @@ class U extends g {
|
|
|
1048
1055
|
set height(e) {
|
|
1049
1056
|
this._height = e;
|
|
1050
1057
|
}
|
|
1058
|
+
get infinite() {
|
|
1059
|
+
return this._infinite;
|
|
1060
|
+
}
|
|
1061
|
+
set infinite(e) {
|
|
1062
|
+
this._infinite = e;
|
|
1063
|
+
}
|
|
1051
1064
|
}
|
|
1052
|
-
class
|
|
1065
|
+
class Se extends F {
|
|
1053
1066
|
constructor(e) {
|
|
1054
1067
|
super(e);
|
|
1055
1068
|
/**
|
|
@@ -1377,7 +1390,7 @@ class G {
|
|
|
1377
1390
|
this._widgetClass = Te;
|
|
1378
1391
|
break;
|
|
1379
1392
|
case "many2many":
|
|
1380
|
-
this._widgetClass =
|
|
1393
|
+
this._widgetClass = We;
|
|
1381
1394
|
break;
|
|
1382
1395
|
case "markdown":
|
|
1383
1396
|
this._widgetClass = Fe;
|
|
@@ -1390,7 +1403,7 @@ class G {
|
|
|
1390
1403
|
this._widgetClass = J;
|
|
1391
1404
|
break;
|
|
1392
1405
|
case "separator":
|
|
1393
|
-
this._widgetClass =
|
|
1406
|
+
this._widgetClass = Se;
|
|
1394
1407
|
break;
|
|
1395
1408
|
case "url":
|
|
1396
1409
|
this._widgetClass = D;
|
|
@@ -1452,12 +1465,12 @@ class G {
|
|
|
1452
1465
|
}
|
|
1453
1466
|
}
|
|
1454
1467
|
createWidget(t, e) {
|
|
1455
|
-
let
|
|
1456
|
-
switch (this.setWidgetClass(t), this._widgetClass === void 0 && (
|
|
1468
|
+
let s = t;
|
|
1469
|
+
switch (this.setWidgetClass(t), this._widgetClass === void 0 && (s = e.fieldsWidgetType, this.setWidgetClass(e.fieldsWidgetType)), this._widgetClass === void 0 && (this._widgetClass = F), t) {
|
|
1457
1470
|
case "notebook":
|
|
1458
1471
|
case "page":
|
|
1459
1472
|
case "group":
|
|
1460
|
-
return new this._widgetClass({ ...e, type:
|
|
1473
|
+
return new this._widgetClass({ ...e, type: s });
|
|
1461
1474
|
case "button":
|
|
1462
1475
|
return new this._widgetClass({
|
|
1463
1476
|
...e,
|
|
@@ -1465,25 +1478,25 @@ class G {
|
|
|
1465
1478
|
buttonType: e.type
|
|
1466
1479
|
});
|
|
1467
1480
|
default:
|
|
1468
|
-
return new this._widgetClass({ ...e, type:
|
|
1481
|
+
return new this._widgetClass({ ...e, type: s });
|
|
1469
1482
|
}
|
|
1470
1483
|
}
|
|
1471
1484
|
}
|
|
1472
1485
|
const qe = ({
|
|
1473
|
-
fieldName:
|
|
1486
|
+
fieldName: i,
|
|
1474
1487
|
values: t,
|
|
1475
1488
|
fields: e
|
|
1476
1489
|
}) => {
|
|
1477
1490
|
var l;
|
|
1478
|
-
if (!s)
|
|
1479
|
-
return {};
|
|
1480
|
-
const i = (l = e[s]) == null ? void 0 : l.states;
|
|
1481
1491
|
if (!i)
|
|
1482
1492
|
return {};
|
|
1493
|
+
const s = (l = e[i]) == null ? void 0 : l.states;
|
|
1494
|
+
if (!s)
|
|
1495
|
+
return {};
|
|
1483
1496
|
const r = {}, a = {};
|
|
1484
|
-
for (const o of Object.keys(
|
|
1497
|
+
for (const o of Object.keys(s))
|
|
1485
1498
|
if (t.state === o) {
|
|
1486
|
-
const u =
|
|
1499
|
+
const u = s[o];
|
|
1487
1500
|
for (const _ of u) {
|
|
1488
1501
|
const [h, d] = _;
|
|
1489
1502
|
a[h] || (a[h] = []), a[h].push(d);
|
|
@@ -1495,39 +1508,39 @@ const qe = ({
|
|
|
1495
1508
|
}
|
|
1496
1509
|
return r;
|
|
1497
1510
|
}, Je = ({
|
|
1498
|
-
states:
|
|
1511
|
+
states: i,
|
|
1499
1512
|
values: t
|
|
1500
1513
|
}) => {
|
|
1501
1514
|
if (!(t != null && t.state))
|
|
1502
1515
|
return {};
|
|
1503
|
-
const e =
|
|
1516
|
+
const e = i.split(",");
|
|
1504
1517
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1505
1518
|
};
|
|
1506
1519
|
function He({
|
|
1507
|
-
values:
|
|
1520
|
+
values: i = {},
|
|
1508
1521
|
fieldName: t,
|
|
1509
1522
|
fields: e = {}
|
|
1510
1523
|
}) {
|
|
1511
1524
|
var r;
|
|
1512
|
-
const
|
|
1513
|
-
return
|
|
1525
|
+
const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
|
|
1526
|
+
return s === "many2one" ? i[t] ? i[t][0] || null : !1 : s === "one2many" || s === "many2many" ? i[t].map((a) => a.id) : i != null && i[t] ? i == null ? void 0 : i[t] : t.includes("'") ? t : parseInt(t);
|
|
1514
1527
|
}
|
|
1515
1528
|
const Z = ({
|
|
1516
|
-
context:
|
|
1529
|
+
context: i,
|
|
1517
1530
|
values: t,
|
|
1518
1531
|
fields: e
|
|
1519
1532
|
}) => {
|
|
1520
1533
|
try {
|
|
1521
|
-
if (!
|
|
1534
|
+
if (!i)
|
|
1522
1535
|
return;
|
|
1523
|
-
if (te(
|
|
1524
|
-
return s;
|
|
1525
|
-
const i = ee(s);
|
|
1526
|
-
if (i !== null)
|
|
1536
|
+
if (te(i) || typeof i != "string")
|
|
1527
1537
|
return i;
|
|
1528
|
-
|
|
1538
|
+
const s = ee(i);
|
|
1539
|
+
if (s !== null)
|
|
1540
|
+
return s;
|
|
1541
|
+
if (i.trim().length === 0)
|
|
1529
1542
|
return;
|
|
1530
|
-
const d =
|
|
1543
|
+
const d = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((f) => f.split(":")), c = {};
|
|
1531
1544
|
return d.forEach((f) => {
|
|
1532
1545
|
const y = f[1];
|
|
1533
1546
|
if (!f[1].includes("'") && f[1] !== "true" && f[1] !== "false") {
|
|
@@ -1546,43 +1559,43 @@ const Z = ({
|
|
|
1546
1559
|
} catch {
|
|
1547
1560
|
return;
|
|
1548
1561
|
}
|
|
1549
|
-
}, pt = (
|
|
1562
|
+
}, pt = (i) => {
|
|
1550
1563
|
const t = [];
|
|
1551
1564
|
try {
|
|
1552
|
-
return !
|
|
1565
|
+
return !i || te(i) || typeof i != "string" ? t : ee(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) => {
|
|
1553
1566
|
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1554
1567
|
}), t);
|
|
1555
1568
|
} catch {
|
|
1556
1569
|
}
|
|
1557
1570
|
return t;
|
|
1558
1571
|
};
|
|
1559
|
-
function ee(
|
|
1572
|
+
function ee(i) {
|
|
1560
1573
|
try {
|
|
1561
|
-
return JSON.parse(
|
|
1574
|
+
return JSON.parse(i.replace(/'/g, '"'));
|
|
1562
1575
|
} catch {
|
|
1563
1576
|
return null;
|
|
1564
1577
|
}
|
|
1565
1578
|
}
|
|
1566
|
-
function te(
|
|
1567
|
-
return typeof
|
|
1579
|
+
function te(i) {
|
|
1580
|
+
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1568
1581
|
}
|
|
1569
|
-
const Qe = (
|
|
1570
|
-
const t =
|
|
1582
|
+
const Qe = (i) => {
|
|
1583
|
+
const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1571
1584
|
return {
|
|
1572
1585
|
method: e,
|
|
1573
1586
|
args: r
|
|
1574
1587
|
};
|
|
1575
1588
|
};
|
|
1576
|
-
function Xe(
|
|
1589
|
+
function Xe(i) {
|
|
1577
1590
|
const t = [];
|
|
1578
|
-
function e(
|
|
1591
|
+
function e(s) {
|
|
1579
1592
|
const r = [];
|
|
1580
|
-
for (const a of
|
|
1593
|
+
for (const a of s)
|
|
1581
1594
|
a instanceof w ? e(a._container.rows.flat()) : r.push(a);
|
|
1582
1595
|
r.length > 0 && t.push(r);
|
|
1583
1596
|
}
|
|
1584
|
-
for (const
|
|
1585
|
-
e(
|
|
1597
|
+
for (const s of i)
|
|
1598
|
+
e(s);
|
|
1586
1599
|
return t.flat();
|
|
1587
1600
|
}
|
|
1588
1601
|
class wt {
|
|
@@ -1688,11 +1701,11 @@ class wt {
|
|
|
1688
1701
|
}
|
|
1689
1702
|
parse(t, e) {
|
|
1690
1703
|
var o;
|
|
1691
|
-
const { values:
|
|
1692
|
-
this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context =
|
|
1704
|
+
const { values: s = {}, readOnly: r = !1 } = e || {}, a = Y.parse(t).filter((u) => u.tagName === "form")[0];
|
|
1705
|
+
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({
|
|
1693
1706
|
fields: a.children,
|
|
1694
1707
|
container: this._container,
|
|
1695
|
-
values:
|
|
1708
|
+
values: s
|
|
1696
1709
|
}), Xe(this._container._rows).forEach((u) => {
|
|
1697
1710
|
const _ = u;
|
|
1698
1711
|
_._id && _._context && (this._contextForFields[_._id] = u._context);
|
|
@@ -1701,7 +1714,7 @@ class wt {
|
|
|
1701
1714
|
parseNode({
|
|
1702
1715
|
fields: t,
|
|
1703
1716
|
container: e,
|
|
1704
|
-
values:
|
|
1717
|
+
values: s
|
|
1705
1718
|
}) {
|
|
1706
1719
|
const r = new G();
|
|
1707
1720
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
@@ -1709,9 +1722,9 @@ class wt {
|
|
|
1709
1722
|
const { tagName: l, attributes: o, children: u } = a;
|
|
1710
1723
|
let _ = l, h = o;
|
|
1711
1724
|
if (l === "field") {
|
|
1712
|
-
const { name: p, widget:
|
|
1713
|
-
if (
|
|
1714
|
-
_ =
|
|
1725
|
+
const { name: p, widget: W } = o;
|
|
1726
|
+
if (W)
|
|
1727
|
+
_ = W;
|
|
1715
1728
|
else if (p) {
|
|
1716
1729
|
if (!this._fields[p])
|
|
1717
1730
|
throw new Error(
|
|
@@ -1727,22 +1740,22 @@ class wt {
|
|
|
1727
1740
|
}
|
|
1728
1741
|
const d = be({
|
|
1729
1742
|
tagAttributes: h,
|
|
1730
|
-
values:
|
|
1743
|
+
values: s,
|
|
1731
1744
|
fields: this._fields,
|
|
1732
1745
|
widgetType: l
|
|
1733
1746
|
});
|
|
1734
1747
|
let c;
|
|
1735
1748
|
l === "button" && h.states ? c = Je({
|
|
1736
1749
|
states: h.states,
|
|
1737
|
-
values:
|
|
1750
|
+
values: s
|
|
1738
1751
|
}) : c = qe({
|
|
1739
1752
|
fieldName: h.name,
|
|
1740
|
-
values:
|
|
1753
|
+
values: s,
|
|
1741
1754
|
fields: this._fields
|
|
1742
1755
|
});
|
|
1743
1756
|
const f = Z({
|
|
1744
1757
|
context: h.context || ((v = this._fields[h.name]) == null ? void 0 : v.context),
|
|
1745
|
-
values:
|
|
1758
|
+
values: s,
|
|
1746
1759
|
fields: this._fields
|
|
1747
1760
|
});
|
|
1748
1761
|
h.on_change && (this._onChangeFields[h.name] = Qe(
|
|
@@ -1762,7 +1775,7 @@ class wt {
|
|
|
1762
1775
|
m.invisible && m instanceof g && this._invisibleFields.push(x.name), m instanceof w && this.parseNode({
|
|
1763
1776
|
fields: u,
|
|
1764
1777
|
container: m.container,
|
|
1765
|
-
values:
|
|
1778
|
+
values: s
|
|
1766
1779
|
}), m instanceof Q && m.readOnly !== void 0 || (m.readOnly = m.readOnly || this.readOnly), e.addWidget(m);
|
|
1767
1780
|
});
|
|
1768
1781
|
}
|
|
@@ -1774,8 +1787,8 @@ class wt {
|
|
|
1774
1787
|
return this.container.findById(t);
|
|
1775
1788
|
}
|
|
1776
1789
|
}
|
|
1777
|
-
function R(
|
|
1778
|
-
return
|
|
1790
|
+
function R(i) {
|
|
1791
|
+
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1779
1792
|
}
|
|
1780
1793
|
class vt {
|
|
1781
1794
|
constructor(t) {
|
|
@@ -1834,7 +1847,7 @@ class vt {
|
|
|
1834
1847
|
parse(t) {
|
|
1835
1848
|
const e = Y.parse(t).filter((r) => r.tagName === "tree")[0];
|
|
1836
1849
|
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;
|
|
1837
|
-
const
|
|
1850
|
+
const s = new G();
|
|
1838
1851
|
e.children.forEach((r) => {
|
|
1839
1852
|
const { tagName: a, attributes: l } = r;
|
|
1840
1853
|
let o = null;
|
|
@@ -1859,7 +1872,7 @@ class vt {
|
|
|
1859
1872
|
}, this._contextForFields[u] = c;
|
|
1860
1873
|
}
|
|
1861
1874
|
if (_ && (o = _), !h.invisible) {
|
|
1862
|
-
const d =
|
|
1875
|
+
const d = s.createWidget(o, h);
|
|
1863
1876
|
this._columns.push(d);
|
|
1864
1877
|
}
|
|
1865
1878
|
}
|
|
@@ -1887,7 +1900,7 @@ const Ue = {
|
|
|
1887
1900
|
datetime: "datetime"
|
|
1888
1901
|
};
|
|
1889
1902
|
class Ft {
|
|
1890
|
-
constructor(t, e,
|
|
1903
|
+
constructor(t, e, s = 8) {
|
|
1891
1904
|
/**
|
|
1892
1905
|
* Object containing the specific fields for primary and secondary search fields
|
|
1893
1906
|
*/
|
|
@@ -1898,7 +1911,7 @@ class Ft {
|
|
|
1898
1911
|
n(this, "_fields");
|
|
1899
1912
|
n(this, "_simpleSearchContainer");
|
|
1900
1913
|
n(this, "_advancedSearchContainer");
|
|
1901
|
-
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new I(
|
|
1914
|
+
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new I(s), this._advancedSearchContainer = new I(s);
|
|
1902
1915
|
}
|
|
1903
1916
|
get searchFields() {
|
|
1904
1917
|
return this._searchFields;
|
|
@@ -1927,10 +1940,10 @@ class Ft {
|
|
|
1927
1940
|
});
|
|
1928
1941
|
}
|
|
1929
1942
|
parseFields(t, e) {
|
|
1930
|
-
return t.map((
|
|
1943
|
+
return t.map((s) => {
|
|
1931
1944
|
const r = {
|
|
1932
|
-
...this.fields[
|
|
1933
|
-
name:
|
|
1945
|
+
...this.fields[s],
|
|
1946
|
+
name: s,
|
|
1934
1947
|
colspan: 2
|
|
1935
1948
|
}, { type: a, widget: l } = r;
|
|
1936
1949
|
let o = l ?? a;
|
|
@@ -1946,21 +1959,21 @@ class Ft {
|
|
|
1946
1959
|
}
|
|
1947
1960
|
}
|
|
1948
1961
|
const Ct = ({
|
|
1949
|
-
domain:
|
|
1962
|
+
domain: i,
|
|
1950
1963
|
widgetFieldName: t
|
|
1951
1964
|
}) => {
|
|
1952
1965
|
const e = [];
|
|
1953
|
-
return
|
|
1954
|
-
if (!Array.isArray(
|
|
1966
|
+
return i.forEach((s) => {
|
|
1967
|
+
if (!Array.isArray(s))
|
|
1955
1968
|
return;
|
|
1956
|
-
const [r, a, l] =
|
|
1969
|
+
const [r, a, l] = s;
|
|
1957
1970
|
let o, u;
|
|
1958
1971
|
r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), u = r.substr(
|
|
1959
1972
|
r.indexOf(".") + 1,
|
|
1960
1973
|
r.length - 1
|
|
1961
1974
|
)) : (o = r, u = "id"), o === t && e.push([u, a, l]);
|
|
1962
1975
|
}), e;
|
|
1963
|
-
}, kt = (
|
|
1976
|
+
}, kt = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
1964
1977
|
class Ke {
|
|
1965
1978
|
constructor(t) {
|
|
1966
1979
|
n(this, "_action_id", null);
|
|
@@ -1980,8 +1993,8 @@ class Ot {
|
|
|
1980
1993
|
n(this, "_items", []);
|
|
1981
1994
|
const e = Y.parse(t).filter((r) => r.tagName === "dashboard")[0];
|
|
1982
1995
|
this._string = e.attributes.string || null;
|
|
1983
|
-
const { children:
|
|
1984
|
-
|
|
1996
|
+
const { children: s } = e;
|
|
1997
|
+
s.forEach((r) => {
|
|
1985
1998
|
r.tagName === "dashboard_item" && this._items.push(new Ke(r.attributes));
|
|
1986
1999
|
});
|
|
1987
2000
|
}
|
|
@@ -1992,7 +2005,7 @@ class Ot {
|
|
|
1992
2005
|
return this._items;
|
|
1993
2006
|
}
|
|
1994
2007
|
}
|
|
1995
|
-
class
|
|
2008
|
+
class ie {
|
|
1996
2009
|
constructor(t) {
|
|
1997
2010
|
n(this, "_string", null);
|
|
1998
2011
|
n(this, "_type");
|
|
@@ -2013,16 +2026,16 @@ class se {
|
|
|
2013
2026
|
return this._interval;
|
|
2014
2027
|
}
|
|
2015
2028
|
}
|
|
2016
|
-
const Ze = (
|
|
2017
|
-
class
|
|
2018
|
-
constructor(e,
|
|
2019
|
-
super(
|
|
2029
|
+
const Ze = (i) => i === 1 || i === "1" || i === !0 || i === "True";
|
|
2030
|
+
class se extends ie {
|
|
2031
|
+
constructor(e, s) {
|
|
2032
|
+
super(s);
|
|
2020
2033
|
n(this, "_color", null);
|
|
2021
2034
|
n(this, "_icon", null);
|
|
2022
2035
|
n(this, "_totalDomain", null);
|
|
2023
2036
|
n(this, "_showPercent", !1);
|
|
2024
2037
|
n(this, "_suffix", null);
|
|
2025
|
-
this._type = e, this._color =
|
|
2038
|
+
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 = Ze(s.attributes.showPercent);
|
|
2026
2039
|
}
|
|
2027
2040
|
get color() {
|
|
2028
2041
|
return this._color;
|
|
@@ -2040,12 +2053,12 @@ class ie extends se {
|
|
|
2040
2053
|
return this._suffix;
|
|
2041
2054
|
}
|
|
2042
2055
|
}
|
|
2043
|
-
class et extends
|
|
2044
|
-
constructor(e,
|
|
2045
|
-
super(e,
|
|
2056
|
+
class et extends se {
|
|
2057
|
+
constructor(e, s) {
|
|
2058
|
+
super(e, s);
|
|
2046
2059
|
n(this, "_field");
|
|
2047
2060
|
n(this, "_operator");
|
|
2048
|
-
const { children: r } =
|
|
2061
|
+
const { children: r } = s;
|
|
2049
2062
|
r.forEach((a) => {
|
|
2050
2063
|
if (a.tagName === "field") {
|
|
2051
2064
|
const l = a.attributes.name, o = a.attributes.operator;
|
|
@@ -2060,12 +2073,12 @@ class et extends ie {
|
|
|
2060
2073
|
return this._operator;
|
|
2061
2074
|
}
|
|
2062
2075
|
}
|
|
2063
|
-
const tt = (
|
|
2076
|
+
const tt = (i) => {
|
|
2064
2077
|
const t = [];
|
|
2065
2078
|
let e;
|
|
2066
|
-
if (
|
|
2067
|
-
if (
|
|
2068
|
-
const r =
|
|
2079
|
+
if (i.forEach((s) => {
|
|
2080
|
+
if (s.tagName === "field") {
|
|
2081
|
+
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;
|
|
2069
2082
|
if (!r)
|
|
2070
2083
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2071
2084
|
if (!l)
|
|
@@ -2073,7 +2086,7 @@ const tt = (s) => {
|
|
|
2073
2086
|
r === "x" ? e = new nt({
|
|
2074
2087
|
name: l
|
|
2075
2088
|
}) : r === "y" && t.push(
|
|
2076
|
-
new
|
|
2089
|
+
new st({
|
|
2077
2090
|
name: l,
|
|
2078
2091
|
operator: a,
|
|
2079
2092
|
label: o,
|
|
@@ -2090,13 +2103,13 @@ const tt = (s) => {
|
|
|
2090
2103
|
y: t
|
|
2091
2104
|
};
|
|
2092
2105
|
};
|
|
2093
|
-
class j extends
|
|
2094
|
-
constructor(e,
|
|
2095
|
-
super(
|
|
2106
|
+
class j extends ie {
|
|
2107
|
+
constructor(e, s) {
|
|
2108
|
+
super(s);
|
|
2096
2109
|
n(this, "_x");
|
|
2097
2110
|
n(this, "_y");
|
|
2098
2111
|
this._type = e;
|
|
2099
|
-
const r = tt(
|
|
2112
|
+
const r = tt(s.children);
|
|
2100
2113
|
this._x = r.x, this._y = r.y;
|
|
2101
2114
|
}
|
|
2102
2115
|
get x() {
|
|
@@ -2106,20 +2119,20 @@ class j extends se {
|
|
|
2106
2119
|
return this._y;
|
|
2107
2120
|
}
|
|
2108
2121
|
}
|
|
2109
|
-
const
|
|
2110
|
-
indicator:
|
|
2122
|
+
const it = {
|
|
2123
|
+
indicator: se,
|
|
2111
2124
|
indicatorField: et,
|
|
2112
2125
|
line: j,
|
|
2113
2126
|
bar: j,
|
|
2114
2127
|
pie: j
|
|
2115
|
-
}, Tt = (
|
|
2116
|
-
const t = Y.parse(
|
|
2128
|
+
}, Tt = (i) => {
|
|
2129
|
+
const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2117
2130
|
if (!e)
|
|
2118
2131
|
throw new Error(`${e} is not a valid graph`);
|
|
2119
|
-
const
|
|
2120
|
-
if (!
|
|
2132
|
+
const s = it[e];
|
|
2133
|
+
if (!s)
|
|
2121
2134
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2122
|
-
return new
|
|
2135
|
+
return new s(e, t);
|
|
2123
2136
|
};
|
|
2124
2137
|
class ne {
|
|
2125
2138
|
constructor({ name: t, axis: e }) {
|
|
@@ -2134,10 +2147,10 @@ class ne {
|
|
|
2134
2147
|
return this._axis;
|
|
2135
2148
|
}
|
|
2136
2149
|
}
|
|
2137
|
-
class
|
|
2150
|
+
class st extends ne {
|
|
2138
2151
|
constructor({
|
|
2139
2152
|
name: e,
|
|
2140
|
-
operator:
|
|
2153
|
+
operator: s,
|
|
2141
2154
|
label: r,
|
|
2142
2155
|
stacked: a
|
|
2143
2156
|
}) {
|
|
@@ -2145,7 +2158,7 @@ class it extends ne {
|
|
|
2145
2158
|
n(this, "_operator");
|
|
2146
2159
|
n(this, "_label");
|
|
2147
2160
|
n(this, "_stacked");
|
|
2148
|
-
this._operator =
|
|
2161
|
+
this._operator = s, this._label = r, this._stacked = a;
|
|
2149
2162
|
}
|
|
2150
2163
|
get operator() {
|
|
2151
2164
|
return this._operator;
|
|
@@ -2162,24 +2175,24 @@ class nt extends ne {
|
|
|
2162
2175
|
super({ name: t, axis: "x" });
|
|
2163
2176
|
}
|
|
2164
2177
|
}
|
|
2165
|
-
const rt = ({ ooui:
|
|
2166
|
-
const e = [
|
|
2167
|
-
return
|
|
2168
|
-
|
|
2178
|
+
const rt = ({ ooui: i }) => {
|
|
2179
|
+
const e = [i.x.name];
|
|
2180
|
+
return i.y ? (i.y.forEach((s) => {
|
|
2181
|
+
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
2169
2182
|
}), e) : [];
|
|
2170
2183
|
};
|
|
2171
2184
|
function $({
|
|
2172
|
-
fields:
|
|
2185
|
+
fields: i,
|
|
2173
2186
|
values: t,
|
|
2174
2187
|
fieldName: e
|
|
2175
2188
|
}) {
|
|
2176
|
-
const
|
|
2177
|
-
if (!
|
|
2189
|
+
const s = i[e], r = t[e];
|
|
2190
|
+
if (!s)
|
|
2178
2191
|
throw new Error(`Field ${e} not found`);
|
|
2179
|
-
if (
|
|
2192
|
+
if (s.type === "many2one")
|
|
2180
2193
|
return r ? { value: r[0], label: r[1] } : { value: !1, label: void 0 };
|
|
2181
|
-
if (
|
|
2182
|
-
const l =
|
|
2194
|
+
if (s.type === "selection") {
|
|
2195
|
+
const l = s.selection.find((o) => o[0] === r);
|
|
2183
2196
|
return l ? { value: r, label: l[1] } : { value: !1, label: void 0 };
|
|
2184
2197
|
}
|
|
2185
2198
|
return { value: r, label: r };
|
|
@@ -2190,35 +2203,35 @@ const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2190
2203
|
getValueAndLabelForField: $
|
|
2191
2204
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2192
2205
|
function at({
|
|
2193
|
-
values:
|
|
2206
|
+
values: i,
|
|
2194
2207
|
timerange: t,
|
|
2195
2208
|
interval: e = 1
|
|
2196
2209
|
}) {
|
|
2197
|
-
const
|
|
2198
|
-
values:
|
|
2210
|
+
const s = ct({
|
|
2211
|
+
values: i,
|
|
2199
2212
|
timerange: t
|
|
2200
2213
|
});
|
|
2201
2214
|
return lt({
|
|
2202
|
-
values:
|
|
2215
|
+
values: s,
|
|
2203
2216
|
timerange: t,
|
|
2204
2217
|
interval: e
|
|
2205
2218
|
});
|
|
2206
2219
|
}
|
|
2207
2220
|
function lt({
|
|
2208
|
-
values:
|
|
2221
|
+
values: i,
|
|
2209
2222
|
timerange: t,
|
|
2210
2223
|
interval: e = 1
|
|
2211
2224
|
}) {
|
|
2212
|
-
let
|
|
2225
|
+
let s = [];
|
|
2213
2226
|
const r = ae({
|
|
2214
|
-
values:
|
|
2227
|
+
values: i,
|
|
2215
2228
|
groupBy: "type-stacked"
|
|
2216
2229
|
}), a = `${t}s`;
|
|
2217
2230
|
return Object.keys(r).forEach((o) => {
|
|
2218
2231
|
const u = r[o];
|
|
2219
2232
|
for (let _ = 0; _ < u.length; _++) {
|
|
2220
2233
|
const h = u[_];
|
|
2221
|
-
if (
|
|
2234
|
+
if (s.push(h), _ === u.length - 1)
|
|
2222
2235
|
return;
|
|
2223
2236
|
const d = h.x, c = u[_ + 1].x;
|
|
2224
2237
|
if (!re([d, c], a)) {
|
|
@@ -2227,7 +2240,7 @@ function lt({
|
|
|
2227
2240
|
timerange: t,
|
|
2228
2241
|
interval: e
|
|
2229
2242
|
});
|
|
2230
|
-
|
|
2243
|
+
s = s.concat(
|
|
2231
2244
|
f.map((y) => ({
|
|
2232
2245
|
x: y,
|
|
2233
2246
|
value: 0,
|
|
@@ -2237,17 +2250,17 @@ function lt({
|
|
|
2237
2250
|
);
|
|
2238
2251
|
}
|
|
2239
2252
|
}
|
|
2240
|
-
}),
|
|
2253
|
+
}), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
|
|
2241
2254
|
}
|
|
2242
2255
|
function ot({
|
|
2243
|
-
dates:
|
|
2256
|
+
dates: i,
|
|
2244
2257
|
timerange: t,
|
|
2245
2258
|
interval: e = 1
|
|
2246
2259
|
}) {
|
|
2247
|
-
const
|
|
2248
|
-
if (
|
|
2249
|
-
return
|
|
2250
|
-
const a =
|
|
2260
|
+
const s = [], r = `${t}s`;
|
|
2261
|
+
if (i.length === 1)
|
|
2262
|
+
return i;
|
|
2263
|
+
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2251
2264
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2252
2265
|
const o = a[l], u = a[l + 1];
|
|
2253
2266
|
if (!re([o, u], r)) {
|
|
@@ -2256,19 +2269,19 @@ function ot({
|
|
|
2256
2269
|
r
|
|
2257
2270
|
), h = T(u, z(r));
|
|
2258
2271
|
for (; _.isBefore(h); )
|
|
2259
|
-
|
|
2272
|
+
s.push(_.format(z(r))), _.add(e, r);
|
|
2260
2273
|
}
|
|
2261
2274
|
}
|
|
2262
|
-
return
|
|
2275
|
+
return s;
|
|
2263
2276
|
}
|
|
2264
2277
|
function ct({
|
|
2265
|
-
values:
|
|
2278
|
+
values: i,
|
|
2266
2279
|
timerange: t
|
|
2267
2280
|
}) {
|
|
2268
2281
|
const e = dt({
|
|
2269
|
-
values:
|
|
2282
|
+
values: i,
|
|
2270
2283
|
timerange: t
|
|
2271
|
-
}),
|
|
2284
|
+
}), s = [], r = ae({
|
|
2272
2285
|
values: e,
|
|
2273
2286
|
groupBy: "all"
|
|
2274
2287
|
});
|
|
@@ -2277,17 +2290,17 @@ function ct({
|
|
|
2277
2290
|
values: l.map((_) => _.value),
|
|
2278
2291
|
operator: o
|
|
2279
2292
|
});
|
|
2280
|
-
|
|
2293
|
+
s.push({
|
|
2281
2294
|
...l[0],
|
|
2282
2295
|
value: u
|
|
2283
2296
|
});
|
|
2284
|
-
}),
|
|
2297
|
+
}), s;
|
|
2285
2298
|
}
|
|
2286
2299
|
function dt({
|
|
2287
|
-
values:
|
|
2300
|
+
values: i,
|
|
2288
2301
|
timerange: t
|
|
2289
2302
|
}) {
|
|
2290
|
-
return
|
|
2303
|
+
return i.map((e) => ({
|
|
2291
2304
|
...e,
|
|
2292
2305
|
x: ut({
|
|
2293
2306
|
date: e.x,
|
|
@@ -2296,11 +2309,11 @@ function dt({
|
|
|
2296
2309
|
}));
|
|
2297
2310
|
}
|
|
2298
2311
|
function ut({
|
|
2299
|
-
date:
|
|
2312
|
+
date: i,
|
|
2300
2313
|
timerange: t
|
|
2301
2314
|
}) {
|
|
2302
|
-
let e = ht(
|
|
2303
|
-
const
|
|
2315
|
+
let e = ht(i);
|
|
2316
|
+
const s = T(i, e);
|
|
2304
2317
|
switch (t) {
|
|
2305
2318
|
case "hour": {
|
|
2306
2319
|
e = "YYYY-MM-DD HH:00";
|
|
@@ -2323,36 +2336,36 @@ function ut({
|
|
|
2323
2336
|
break;
|
|
2324
2337
|
}
|
|
2325
2338
|
}
|
|
2326
|
-
return
|
|
2339
|
+
return s.format(e);
|
|
2327
2340
|
}
|
|
2328
|
-
function ht(
|
|
2329
|
-
return
|
|
2341
|
+
function ht(i) {
|
|
2342
|
+
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2330
2343
|
}
|
|
2331
|
-
function re(
|
|
2344
|
+
function re(i, t) {
|
|
2332
2345
|
let e = !1;
|
|
2333
|
-
const
|
|
2334
|
-
if (
|
|
2346
|
+
const s = z(t);
|
|
2347
|
+
if (i.length === 0)
|
|
2335
2348
|
return !1;
|
|
2336
|
-
if (
|
|
2349
|
+
if (i.length === 1)
|
|
2337
2350
|
return !0;
|
|
2338
|
-
for (let r = 0; r <
|
|
2339
|
-
const a = T(
|
|
2351
|
+
for (let r = 0; r < i.length - 1; r++) {
|
|
2352
|
+
const a = T(i[r], s), o = T(i[r + 1], s).diff(a, t);
|
|
2340
2353
|
Math.abs(o) === 1 ? e = !0 : e = !1;
|
|
2341
2354
|
}
|
|
2342
2355
|
return e;
|
|
2343
2356
|
}
|
|
2344
2357
|
function ae({
|
|
2345
|
-
values:
|
|
2358
|
+
values: i,
|
|
2346
2359
|
groupBy: t
|
|
2347
2360
|
}) {
|
|
2348
2361
|
const e = {};
|
|
2349
|
-
return
|
|
2350
|
-
const r =
|
|
2351
|
-
e[o] || (e[o] = []), e[o].push(
|
|
2362
|
+
return i.forEach((s) => {
|
|
2363
|
+
const r = s.x, a = s.type, l = s.stacked, o = t === "all" ? `${r}-${a}-${l}` : `${a}-${l}`;
|
|
2364
|
+
e[o] || (e[o] = []), e[o].push(s);
|
|
2352
2365
|
}), e;
|
|
2353
2366
|
}
|
|
2354
|
-
function z(
|
|
2355
|
-
switch (
|
|
2367
|
+
function z(i) {
|
|
2368
|
+
switch (i) {
|
|
2356
2369
|
case "days":
|
|
2357
2370
|
return "YYYY-MM-DD";
|
|
2358
2371
|
case "weeks":
|
|
@@ -2375,17 +2388,17 @@ const _t = {
|
|
|
2375
2388
|
min: "min",
|
|
2376
2389
|
max: "max"
|
|
2377
2390
|
}, ft = ({
|
|
2378
|
-
ooui:
|
|
2391
|
+
ooui: i,
|
|
2379
2392
|
values: t,
|
|
2380
2393
|
fields: e,
|
|
2381
|
-
options:
|
|
2394
|
+
options: s
|
|
2382
2395
|
}) => {
|
|
2383
2396
|
const r = N({
|
|
2384
|
-
fieldName:
|
|
2397
|
+
fieldName: i.x.name,
|
|
2385
2398
|
values: t,
|
|
2386
2399
|
fields: e
|
|
2387
2400
|
}), a = [];
|
|
2388
|
-
|
|
2401
|
+
i.y.forEach((c) => {
|
|
2389
2402
|
Object.keys(r).forEach((f) => {
|
|
2390
2403
|
const y = r[f].label, x = r[f].entries;
|
|
2391
2404
|
if (c.label) {
|
|
@@ -2395,12 +2408,12 @@ const _t = {
|
|
|
2395
2408
|
fields: e
|
|
2396
2409
|
});
|
|
2397
2410
|
Object.keys(m).forEach((v) => {
|
|
2398
|
-
const P = m[v].entries, p = m[v].label,
|
|
2411
|
+
const P = m[v].entries, p = m[v].label, W = A({
|
|
2399
2412
|
entries: P,
|
|
2400
2413
|
fields: e,
|
|
2401
2414
|
fieldName: c.name
|
|
2402
2415
|
}), oe = V({
|
|
2403
|
-
values:
|
|
2416
|
+
values: W,
|
|
2404
2417
|
operator: c.operator
|
|
2405
2418
|
});
|
|
2406
2419
|
a.push({
|
|
@@ -2433,63 +2446,63 @@ const _t = {
|
|
|
2433
2446
|
}
|
|
2434
2447
|
});
|
|
2435
2448
|
});
|
|
2436
|
-
const l =
|
|
2449
|
+
const l = i.y.some((c) => c.label !== void 0), o = i.y.some((c) => c.stacked !== void 0);
|
|
2437
2450
|
let _ = [...a.sort((c, f) => c.x < f.x ? -1 : c.x > f.x ? 1 : 0)];
|
|
2438
|
-
o &&
|
|
2451
|
+
o && i.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
|
|
2439
2452
|
let h = [..._];
|
|
2440
|
-
|
|
2453
|
+
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(
|
|
2441
2454
|
(c) => c.x !== !1
|
|
2442
2455
|
));
|
|
2443
2456
|
let d = h;
|
|
2444
|
-
return
|
|
2457
|
+
return i.timerange ? d = at({
|
|
2445
2458
|
values: d,
|
|
2446
|
-
timerange:
|
|
2447
|
-
interval:
|
|
2448
|
-
}) :
|
|
2459
|
+
timerange: i.timerange,
|
|
2460
|
+
interval: i.interval
|
|
2461
|
+
}) : i.type == "pie" && (d = h.sort((c, f) => f.value - c.value)), {
|
|
2449
2462
|
data: d,
|
|
2450
2463
|
isGroup: o || l,
|
|
2451
2464
|
isStack: o
|
|
2452
2465
|
};
|
|
2453
2466
|
};
|
|
2454
2467
|
function A({
|
|
2455
|
-
entries:
|
|
2468
|
+
entries: i,
|
|
2456
2469
|
fieldName: t,
|
|
2457
2470
|
fields: e
|
|
2458
2471
|
}) {
|
|
2459
|
-
return
|
|
2472
|
+
return i.map((s) => $({
|
|
2460
2473
|
fieldName: t,
|
|
2461
|
-
values:
|
|
2474
|
+
values: s,
|
|
2462
2475
|
fields: e
|
|
2463
|
-
})).map(({ value:
|
|
2476
|
+
})).map(({ value: s, label: r }) => r);
|
|
2464
2477
|
}
|
|
2465
2478
|
function V({
|
|
2466
|
-
operator:
|
|
2479
|
+
operator: i,
|
|
2467
2480
|
values: t
|
|
2468
2481
|
}) {
|
|
2469
|
-
switch (
|
|
2482
|
+
switch (i) {
|
|
2470
2483
|
case "count":
|
|
2471
2484
|
return t.length;
|
|
2472
2485
|
case "+":
|
|
2473
|
-
return
|
|
2474
|
-
t.reduce(function(e,
|
|
2475
|
-
return e +
|
|
2486
|
+
return S(
|
|
2487
|
+
t.reduce(function(e, s) {
|
|
2488
|
+
return e + s;
|
|
2476
2489
|
})
|
|
2477
2490
|
);
|
|
2478
2491
|
case "-":
|
|
2479
|
-
return
|
|
2480
|
-
t.reduce(function(e,
|
|
2481
|
-
return e -
|
|
2492
|
+
return S(
|
|
2493
|
+
t.reduce(function(e, s) {
|
|
2494
|
+
return e - s;
|
|
2482
2495
|
})
|
|
2483
2496
|
);
|
|
2484
2497
|
case "*":
|
|
2485
|
-
return
|
|
2486
|
-
t.reduce(function(e,
|
|
2487
|
-
return e *
|
|
2498
|
+
return S(
|
|
2499
|
+
t.reduce(function(e, s) {
|
|
2500
|
+
return e * s;
|
|
2488
2501
|
})
|
|
2489
2502
|
);
|
|
2490
2503
|
case "avg": {
|
|
2491
|
-
const
|
|
2492
|
-
return
|
|
2504
|
+
const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
|
|
2505
|
+
return S(s);
|
|
2493
2506
|
}
|
|
2494
2507
|
case "min":
|
|
2495
2508
|
return Math.min(...t);
|
|
@@ -2497,37 +2510,37 @@ function V({
|
|
|
2497
2510
|
return Math.max(...t);
|
|
2498
2511
|
}
|
|
2499
2512
|
}
|
|
2500
|
-
function
|
|
2501
|
-
return Math.round((
|
|
2513
|
+
function S(i) {
|
|
2514
|
+
return Math.round((i + Number.EPSILON) * 100) / 100;
|
|
2502
2515
|
}
|
|
2503
2516
|
function N({
|
|
2504
|
-
fieldName:
|
|
2517
|
+
fieldName: i,
|
|
2505
2518
|
fields: t,
|
|
2506
2519
|
values: e
|
|
2507
2520
|
}) {
|
|
2508
|
-
const
|
|
2521
|
+
const s = {};
|
|
2509
2522
|
return e.forEach((r) => {
|
|
2510
2523
|
const { value: a, label: l } = $({
|
|
2511
2524
|
fields: t,
|
|
2512
2525
|
values: r,
|
|
2513
|
-
fieldName:
|
|
2526
|
+
fieldName: i
|
|
2514
2527
|
});
|
|
2515
|
-
|
|
2516
|
-
}),
|
|
2528
|
+
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
|
|
2529
|
+
}), s;
|
|
2517
2530
|
}
|
|
2518
|
-
function gt(
|
|
2531
|
+
function gt(i) {
|
|
2519
2532
|
let t = [];
|
|
2520
|
-
return Object.keys(
|
|
2521
|
-
const
|
|
2522
|
-
t = t.concat(
|
|
2533
|
+
return Object.keys(i).forEach((e) => {
|
|
2534
|
+
const s = i[e];
|
|
2535
|
+
t = t.concat(s.entries);
|
|
2523
2536
|
}), t;
|
|
2524
2537
|
}
|
|
2525
2538
|
function le({
|
|
2526
|
-
yAxis:
|
|
2539
|
+
yAxis: i,
|
|
2527
2540
|
fields: t
|
|
2528
2541
|
}) {
|
|
2529
|
-
const e = t[
|
|
2530
|
-
return e != null && e.string ? e.string :
|
|
2542
|
+
const e = t[i.name];
|
|
2543
|
+
return e != null && e.string ? e.string : i.name;
|
|
2531
2544
|
}
|
|
2532
2545
|
const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2533
2546
|
__proto__: null,
|
|
@@ -2558,20 +2571,20 @@ export {
|
|
|
2558
2571
|
L as Float,
|
|
2559
2572
|
ke as FloatTime,
|
|
2560
2573
|
wt as Form,
|
|
2561
|
-
|
|
2574
|
+
ie as Graph,
|
|
2562
2575
|
ne as GraphAxis,
|
|
2563
2576
|
j as GraphChart,
|
|
2564
|
-
|
|
2577
|
+
se as GraphIndicator,
|
|
2565
2578
|
et as GraphIndicatorField,
|
|
2566
2579
|
nt as GraphXAxis,
|
|
2567
|
-
|
|
2580
|
+
st as GraphYAxis,
|
|
2568
2581
|
pe as Group,
|
|
2569
2582
|
Oe as HTMLPreview,
|
|
2570
2583
|
Ve as Image,
|
|
2571
2584
|
je as Indicator,
|
|
2572
2585
|
Ce as Integer,
|
|
2573
2586
|
H as Label,
|
|
2574
|
-
|
|
2587
|
+
We as Many2many,
|
|
2575
2588
|
ve as Many2one,
|
|
2576
2589
|
Fe as Markdown,
|
|
2577
2590
|
K as MultiCheckbox,
|
|
@@ -2585,7 +2598,7 @@ export {
|
|
|
2585
2598
|
Ue as SearchFieldTypes,
|
|
2586
2599
|
Ft as SearchFilter,
|
|
2587
2600
|
E as Selection,
|
|
2588
|
-
|
|
2601
|
+
Se as Separator,
|
|
2589
2602
|
Le as Steps,
|
|
2590
2603
|
Be as Switch,
|
|
2591
2604
|
Ae as Tag,
|