@gisce/ooui 2.40.0 → 2.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Graph/GraphIndicator.d.ts +4 -0
- package/dist/Graph/GraphIndicator.d.ts.map +1 -1
- package/dist/Icon.d.ts +24 -0
- package/dist/Icon.d.ts.map +1 -0
- package/dist/WidgetFactory.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/ooui.es.js +272 -224
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Graph/GraphIndicator.ts +15 -0
- package/src/Icon.ts +59 -0
- package/src/WidgetFactory.ts +4 -0
- package/src/index.ts +2 -0
- package/src/spec/Graph.spec.ts +60 -0
- package/src/spec/Icon.spec.ts +93 -0
package/dist/ooui.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var r = (i, t, e) => (ye(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
|
4
4
|
import { decode as xe } from "html-entities";
|
|
5
5
|
import { evaluateCondition as pe } from "@gisce/conscheck";
|
|
6
6
|
import * as D from "txml";
|
|
7
|
-
import
|
|
7
|
+
import W from "moment";
|
|
8
8
|
const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve = ({
|
|
9
9
|
entry: i,
|
|
10
10
|
values: t,
|
|
@@ -67,12 +67,12 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
|
|
|
67
67
|
fields: e,
|
|
68
68
|
widgetType: s
|
|
69
69
|
}) => {
|
|
70
|
-
const
|
|
70
|
+
const h = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = m(h), u = JSON.parse(_), d = {};
|
|
71
71
|
for (const g of Object.keys(u)) {
|
|
72
72
|
const x = u[g].map((y) => ve({ entry: y, values: t, fields: e })).every((y) => y);
|
|
73
|
-
x ?
|
|
73
|
+
x ? d[g] = !0 : g === "readonly" && !x && s === "button" && (d[g] = !1);
|
|
74
74
|
}
|
|
75
|
-
return
|
|
75
|
+
return d;
|
|
76
76
|
}, U = (i) => {
|
|
77
77
|
if (i === void 0)
|
|
78
78
|
return {};
|
|
@@ -95,21 +95,21 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
|
|
|
95
95
|
n.replace(/'/g, '"')
|
|
96
96
|
), l = {};
|
|
97
97
|
for (const o of Object.keys(a)) {
|
|
98
|
-
const
|
|
98
|
+
const h = pe({
|
|
99
99
|
object: t,
|
|
100
100
|
condition: a[o],
|
|
101
101
|
evaluateFieldComparison: ({
|
|
102
102
|
fieldName: _,
|
|
103
103
|
valueInObject: u,
|
|
104
|
-
expectedValue:
|
|
104
|
+
expectedValue: d
|
|
105
105
|
}) => X({
|
|
106
106
|
fieldName: _,
|
|
107
107
|
valueInObject: u,
|
|
108
|
-
expectedValue:
|
|
108
|
+
expectedValue: d,
|
|
109
109
|
fields: e
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
|
-
|
|
112
|
+
h ? l[o] = !0 : o === "readonly" && !h && s === "button" && (l[o] = !1);
|
|
113
113
|
}
|
|
114
114
|
return l;
|
|
115
115
|
} catch (n) {
|
|
@@ -157,7 +157,7 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
|
|
|
157
157
|
attrs: void 0,
|
|
158
158
|
json_attrs: void 0
|
|
159
159
|
};
|
|
160
|
-
},
|
|
160
|
+
}, w = (i) => i === 1 || i === "1" || i === !0 || i === "True" || i === "true", P = class P {
|
|
161
161
|
constructor(t) {
|
|
162
162
|
/**
|
|
163
163
|
* Determines if widget is read only (default is undefined)
|
|
@@ -194,7 +194,7 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
|
|
|
194
194
|
* Base type of the field
|
|
195
195
|
*/
|
|
196
196
|
r(this, "_fieldType", "");
|
|
197
|
-
this._colspan = P._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly =
|
|
197
|
+
this._colspan = P._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 = m(JSON.stringify(t.domain)) : this._domain = m(t.domain)), t.type && (this._fieldType = t.fieldsWidgetType), t.widget_props && (this._parsedWidgetProps = U(t.widget_props)), t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function), t.is_sortable && (this._isSortable = t.is_sortable));
|
|
198
198
|
}
|
|
199
199
|
static get defaultColspan() {
|
|
200
200
|
return P._defaultColspan;
|
|
@@ -267,8 +267,8 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
|
|
|
267
267
|
* Default colspan
|
|
268
268
|
*/
|
|
269
269
|
r(P, "_defaultColspan", 1);
|
|
270
|
-
let
|
|
271
|
-
class f extends
|
|
270
|
+
let k = P;
|
|
271
|
+
class f extends k {
|
|
272
272
|
constructor(e) {
|
|
273
273
|
super(e);
|
|
274
274
|
/**
|
|
@@ -316,7 +316,7 @@ class f extends C {
|
|
|
316
316
|
r(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
317
317
|
r(this, "_autoRefresh", !1);
|
|
318
318
|
r(this, "_raw_props");
|
|
319
|
-
this._activated = !0, e && (this._raw_props = e, e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = m(e.string)), e.help && (this._tooltip = m(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 = m(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = we(e.help_inline)), e.autorefresh && (this.autoRefresh =
|
|
319
|
+
this._activated = !0, e && (this._raw_props = e, e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = m(e.string)), e.help && (this._tooltip = m(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 = m(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = we(e.help_inline)), e.autorefresh && (this.autoRefresh = w(e.autorefresh)));
|
|
320
320
|
}
|
|
321
321
|
get id() {
|
|
322
322
|
return this._id;
|
|
@@ -403,7 +403,7 @@ class f extends C {
|
|
|
403
403
|
}
|
|
404
404
|
class ke extends f {
|
|
405
405
|
}
|
|
406
|
-
class K extends
|
|
406
|
+
class K extends k {
|
|
407
407
|
findById(t) {
|
|
408
408
|
return null;
|
|
409
409
|
}
|
|
@@ -459,7 +459,7 @@ class Z extends f {
|
|
|
459
459
|
}
|
|
460
460
|
get humanDate() {
|
|
461
461
|
var e;
|
|
462
|
-
return
|
|
462
|
+
return w(((e = this._parsedWidgetProps) == null ? void 0 : e.human_date) ?? !1);
|
|
463
463
|
}
|
|
464
464
|
get fieldForLabel() {
|
|
465
465
|
return this._fieldForLabel;
|
|
@@ -571,7 +571,7 @@ class V {
|
|
|
571
571
|
}), e;
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
const O = class O extends
|
|
574
|
+
const O = class O extends k {
|
|
575
575
|
constructor(e) {
|
|
576
576
|
super(e);
|
|
577
577
|
/**
|
|
@@ -644,19 +644,19 @@ const O = class O extends C {
|
|
|
644
644
|
}
|
|
645
645
|
};
|
|
646
646
|
r(O, "_defaultColspan", 6);
|
|
647
|
-
let
|
|
648
|
-
const
|
|
647
|
+
let v = O;
|
|
648
|
+
const T = class T extends v {
|
|
649
649
|
constructor(e) {
|
|
650
650
|
super(e);
|
|
651
651
|
r(this, "_tabPosition", "top");
|
|
652
652
|
r(this, "_pages", []);
|
|
653
|
-
this.colspan =
|
|
653
|
+
this.colspan = T._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
|
|
654
654
|
}
|
|
655
655
|
static get defaultColspan() {
|
|
656
|
-
return
|
|
656
|
+
return T._defaultColspan;
|
|
657
657
|
}
|
|
658
658
|
static set defaultColspan(e) {
|
|
659
|
-
|
|
659
|
+
T._defaultColspan = e;
|
|
660
660
|
}
|
|
661
661
|
get tabPosition() {
|
|
662
662
|
return this._tabPosition;
|
|
@@ -668,9 +668,9 @@ const W = class W extends w {
|
|
|
668
668
|
return [].concat.apply([], this._container.rows);
|
|
669
669
|
}
|
|
670
670
|
};
|
|
671
|
-
r(
|
|
672
|
-
let N =
|
|
673
|
-
class j extends
|
|
671
|
+
r(T, "_defaultColspan", 3);
|
|
672
|
+
let N = T;
|
|
673
|
+
class j extends v {
|
|
674
674
|
constructor(e) {
|
|
675
675
|
super(e);
|
|
676
676
|
r(this, "_loading", !1);
|
|
@@ -802,7 +802,7 @@ class ee extends f {
|
|
|
802
802
|
this._danger = e;
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
class
|
|
805
|
+
class Te extends v {
|
|
806
806
|
constructor(e) {
|
|
807
807
|
super(e);
|
|
808
808
|
r(this, "_defaultName", "");
|
|
@@ -833,7 +833,7 @@ class We extends w {
|
|
|
833
833
|
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
class
|
|
836
|
+
class We extends f {
|
|
837
837
|
}
|
|
838
838
|
class A extends f {
|
|
839
839
|
constructor(e) {
|
|
@@ -1156,7 +1156,7 @@ class ie extends f {
|
|
|
1156
1156
|
this._infinite = e;
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
|
-
class Me extends
|
|
1159
|
+
class Me extends k {
|
|
1160
1160
|
constructor(e) {
|
|
1161
1161
|
super(e);
|
|
1162
1162
|
/**
|
|
@@ -1234,11 +1234,47 @@ class Be extends f {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
1236
|
class Re extends f {
|
|
1237
|
+
constructor(e) {
|
|
1238
|
+
super({ ...e, nolabel: !0 });
|
|
1239
|
+
/**
|
|
1240
|
+
* Icon name
|
|
1241
|
+
*/
|
|
1242
|
+
r(this, "_name", "");
|
|
1243
|
+
/**
|
|
1244
|
+
* Icon size
|
|
1245
|
+
*/
|
|
1246
|
+
r(this, "_size", 16);
|
|
1247
|
+
/**
|
|
1248
|
+
* Icon color
|
|
1249
|
+
*/
|
|
1250
|
+
r(this, "_color", "");
|
|
1251
|
+
e && (e.name && (this._name = e.name), e.size && (this._size = e.size), e.color && (this._color = e.color));
|
|
1252
|
+
}
|
|
1253
|
+
get name() {
|
|
1254
|
+
return this._name;
|
|
1255
|
+
}
|
|
1256
|
+
set name(e) {
|
|
1257
|
+
this._name = e;
|
|
1258
|
+
}
|
|
1259
|
+
get size() {
|
|
1260
|
+
return this._size;
|
|
1261
|
+
}
|
|
1262
|
+
set size(e) {
|
|
1263
|
+
this._size = e;
|
|
1264
|
+
}
|
|
1265
|
+
get color() {
|
|
1266
|
+
return this._color;
|
|
1267
|
+
}
|
|
1268
|
+
set color(e) {
|
|
1269
|
+
this._color = e;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
class Le extends f {
|
|
1237
1273
|
constructor(t) {
|
|
1238
1274
|
super(t);
|
|
1239
1275
|
}
|
|
1240
1276
|
}
|
|
1241
|
-
class
|
|
1277
|
+
class Ge extends ie {
|
|
1242
1278
|
constructor(e) {
|
|
1243
1279
|
super(e);
|
|
1244
1280
|
/**
|
|
@@ -1270,7 +1306,7 @@ class Le extends ie {
|
|
|
1270
1306
|
return this.parsedWidgetProps.colorField;
|
|
1271
1307
|
}
|
|
1272
1308
|
}
|
|
1273
|
-
class
|
|
1309
|
+
class $e extends z {
|
|
1274
1310
|
constructor(e) {
|
|
1275
1311
|
super(e);
|
|
1276
1312
|
r(this, "_nolabel", !0);
|
|
@@ -1295,7 +1331,7 @@ class Ge extends z {
|
|
|
1295
1331
|
} catch (s) {
|
|
1296
1332
|
console.error(s);
|
|
1297
1333
|
}
|
|
1298
|
-
this._autoRefresh =
|
|
1334
|
+
this._autoRefresh = w(e.autorefresh);
|
|
1299
1335
|
}
|
|
1300
1336
|
}
|
|
1301
1337
|
get card() {
|
|
@@ -1397,9 +1433,9 @@ class se extends f {
|
|
|
1397
1433
|
this._columns = e;
|
|
1398
1434
|
}
|
|
1399
1435
|
}
|
|
1400
|
-
class
|
|
1436
|
+
class qe extends se {
|
|
1401
1437
|
}
|
|
1402
|
-
class
|
|
1438
|
+
class Je extends z {
|
|
1403
1439
|
get colors() {
|
|
1404
1440
|
return this._parsedWidgetProps.colors || {};
|
|
1405
1441
|
}
|
|
@@ -1408,7 +1444,7 @@ class qe extends z {
|
|
|
1408
1444
|
return ((t = this._parsedWidgetProps) == null ? void 0 : t.colorField) || null;
|
|
1409
1445
|
}
|
|
1410
1446
|
}
|
|
1411
|
-
class
|
|
1447
|
+
class He extends z {
|
|
1412
1448
|
constructor(e) {
|
|
1413
1449
|
super(e);
|
|
1414
1450
|
/**
|
|
@@ -1424,9 +1460,9 @@ class Je extends z {
|
|
|
1424
1460
|
this._direction = e;
|
|
1425
1461
|
}
|
|
1426
1462
|
}
|
|
1427
|
-
class
|
|
1463
|
+
class Qe extends te {
|
|
1428
1464
|
}
|
|
1429
|
-
class
|
|
1465
|
+
class Xe extends f {
|
|
1430
1466
|
constructor(e) {
|
|
1431
1467
|
super(e);
|
|
1432
1468
|
/**
|
|
@@ -1469,12 +1505,12 @@ class re extends L {
|
|
|
1469
1505
|
this._lang = e;
|
|
1470
1506
|
}
|
|
1471
1507
|
}
|
|
1472
|
-
class
|
|
1508
|
+
class Ue extends f {
|
|
1473
1509
|
constructor(t) {
|
|
1474
1510
|
super(t);
|
|
1475
1511
|
}
|
|
1476
1512
|
}
|
|
1477
|
-
class
|
|
1513
|
+
class Ke extends v {
|
|
1478
1514
|
constructor(e) {
|
|
1479
1515
|
super(e);
|
|
1480
1516
|
/**
|
|
@@ -1514,7 +1550,7 @@ class Ue extends w {
|
|
|
1514
1550
|
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
1515
1551
|
}
|
|
1516
1552
|
}
|
|
1517
|
-
class
|
|
1553
|
+
class Ze extends f {
|
|
1518
1554
|
constructor(e) {
|
|
1519
1555
|
super(e);
|
|
1520
1556
|
/**
|
|
@@ -1539,7 +1575,7 @@ class H extends re {
|
|
|
1539
1575
|
r(this, "_lang", "json");
|
|
1540
1576
|
}
|
|
1541
1577
|
}
|
|
1542
|
-
class
|
|
1578
|
+
class et extends f {
|
|
1543
1579
|
constructor(e) {
|
|
1544
1580
|
super(e);
|
|
1545
1581
|
r(this, "_multi", !1);
|
|
@@ -1559,11 +1595,11 @@ class Ze extends f {
|
|
|
1559
1595
|
this._size = e;
|
|
1560
1596
|
}
|
|
1561
1597
|
}
|
|
1562
|
-
class
|
|
1598
|
+
class tt extends v {
|
|
1563
1599
|
constructor(e) {
|
|
1564
1600
|
super(e);
|
|
1565
1601
|
r(this, "_autoPlay", !0);
|
|
1566
|
-
e && "auto_play" in e && (this._autoPlay =
|
|
1602
|
+
e && "auto_play" in e && (this._autoPlay = w(e.auto_play));
|
|
1567
1603
|
}
|
|
1568
1604
|
get autoPlay() {
|
|
1569
1605
|
return this._autoPlay;
|
|
@@ -1575,12 +1611,12 @@ class et extends w {
|
|
|
1575
1611
|
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
1576
1612
|
}
|
|
1577
1613
|
}
|
|
1578
|
-
class
|
|
1614
|
+
class it extends A {
|
|
1579
1615
|
get showText() {
|
|
1580
1616
|
return this.parsedWidgetProps.show_text ?? !0;
|
|
1581
1617
|
}
|
|
1582
1618
|
}
|
|
1583
|
-
class
|
|
1619
|
+
class st extends f {
|
|
1584
1620
|
get width() {
|
|
1585
1621
|
var t;
|
|
1586
1622
|
return (t = this.parsedWidgetProps) == null ? void 0 : t.width;
|
|
@@ -1594,7 +1630,7 @@ class it extends f {
|
|
|
1594
1630
|
return console.log(this.parsedWidgetProps), ((t = this.parsedWidgetProps) == null ? void 0 : t.showValue) ?? !1;
|
|
1595
1631
|
}
|
|
1596
1632
|
}
|
|
1597
|
-
class
|
|
1633
|
+
class rt extends j {
|
|
1598
1634
|
constructor(e) {
|
|
1599
1635
|
super(e);
|
|
1600
1636
|
r(this, "_title", null);
|
|
@@ -1646,7 +1682,7 @@ class $ {
|
|
|
1646
1682
|
this._widgetClass = Oe;
|
|
1647
1683
|
break;
|
|
1648
1684
|
case "card":
|
|
1649
|
-
this._widgetClass =
|
|
1685
|
+
this._widgetClass = rt;
|
|
1650
1686
|
break;
|
|
1651
1687
|
case "label":
|
|
1652
1688
|
this._widgetClass = Z;
|
|
@@ -1661,10 +1697,10 @@ class $ {
|
|
|
1661
1697
|
this._widgetClass = ee;
|
|
1662
1698
|
break;
|
|
1663
1699
|
case "buttonGroup":
|
|
1664
|
-
this._widgetClass =
|
|
1700
|
+
this._widgetClass = Te;
|
|
1665
1701
|
break;
|
|
1666
1702
|
case "action_buttons":
|
|
1667
|
-
this._widgetClass =
|
|
1703
|
+
this._widgetClass = We;
|
|
1668
1704
|
break;
|
|
1669
1705
|
case "selection":
|
|
1670
1706
|
this._widgetClass = z;
|
|
@@ -1711,7 +1747,7 @@ class $ {
|
|
|
1711
1747
|
this._widgetClass = A;
|
|
1712
1748
|
break;
|
|
1713
1749
|
case "email":
|
|
1714
|
-
this._widgetClass =
|
|
1750
|
+
this._widgetClass = et;
|
|
1715
1751
|
break;
|
|
1716
1752
|
case "reference":
|
|
1717
1753
|
this._widgetClass = Ne;
|
|
@@ -1722,50 +1758,53 @@ class $ {
|
|
|
1722
1758
|
case "image":
|
|
1723
1759
|
this._widgetClass = Be;
|
|
1724
1760
|
break;
|
|
1725
|
-
case "
|
|
1761
|
+
case "icon":
|
|
1726
1762
|
this._widgetClass = Re;
|
|
1727
1763
|
break;
|
|
1728
|
-
case "
|
|
1764
|
+
case "fiber_grid":
|
|
1729
1765
|
this._widgetClass = Le;
|
|
1730
1766
|
break;
|
|
1731
|
-
case "
|
|
1767
|
+
case "timeline":
|
|
1732
1768
|
this._widgetClass = Ge;
|
|
1733
1769
|
break;
|
|
1734
|
-
case "
|
|
1770
|
+
case "indicator":
|
|
1735
1771
|
this._widgetClass = $e;
|
|
1736
1772
|
break;
|
|
1737
|
-
case "
|
|
1773
|
+
case "tags":
|
|
1738
1774
|
this._widgetClass = qe;
|
|
1739
1775
|
break;
|
|
1776
|
+
case "tag":
|
|
1777
|
+
this._widgetClass = Je;
|
|
1778
|
+
break;
|
|
1740
1779
|
case "avatar":
|
|
1741
1780
|
this._widgetClass = ke;
|
|
1742
1781
|
break;
|
|
1743
1782
|
case "radio":
|
|
1744
|
-
this._widgetClass =
|
|
1783
|
+
this._widgetClass = He;
|
|
1745
1784
|
break;
|
|
1746
1785
|
case "multicheckbox":
|
|
1747
1786
|
this._widgetClass = se;
|
|
1748
1787
|
break;
|
|
1749
1788
|
case "switch":
|
|
1750
|
-
this._widgetClass =
|
|
1789
|
+
this._widgetClass = Qe;
|
|
1751
1790
|
break;
|
|
1752
1791
|
case "steps":
|
|
1753
|
-
this._widgetClass =
|
|
1792
|
+
this._widgetClass = Xe;
|
|
1754
1793
|
break;
|
|
1755
1794
|
case "codeeditor":
|
|
1756
1795
|
this._widgetClass = re;
|
|
1757
1796
|
break;
|
|
1758
1797
|
case "time":
|
|
1759
|
-
this._widgetClass =
|
|
1798
|
+
this._widgetClass = Ue;
|
|
1760
1799
|
break;
|
|
1761
1800
|
case "html_preview":
|
|
1762
1801
|
this._widgetClass = Ve;
|
|
1763
1802
|
break;
|
|
1764
1803
|
case "alert":
|
|
1765
|
-
this._widgetClass =
|
|
1804
|
+
this._widgetClass = Ke;
|
|
1766
1805
|
break;
|
|
1767
1806
|
case "comments_timeline":
|
|
1768
|
-
this._widgetClass =
|
|
1807
|
+
this._widgetClass = Ze;
|
|
1769
1808
|
break;
|
|
1770
1809
|
case "json":
|
|
1771
1810
|
this._widgetClass = H;
|
|
@@ -1777,20 +1816,20 @@ class $ {
|
|
|
1777
1816
|
this._widgetClass = j;
|
|
1778
1817
|
break;
|
|
1779
1818
|
case "carousel":
|
|
1780
|
-
this._widgetClass =
|
|
1819
|
+
this._widgetClass = tt;
|
|
1781
1820
|
break;
|
|
1782
1821
|
case "colorPicker":
|
|
1783
|
-
this._widgetClass =
|
|
1822
|
+
this._widgetClass = it;
|
|
1784
1823
|
break;
|
|
1785
1824
|
case "qrcode":
|
|
1786
|
-
this._widgetClass =
|
|
1825
|
+
this._widgetClass = st;
|
|
1787
1826
|
break;
|
|
1788
1827
|
}
|
|
1789
1828
|
}
|
|
1790
1829
|
createWidget(t, e) {
|
|
1791
1830
|
this._widgetClass = void 0;
|
|
1792
1831
|
let s = t;
|
|
1793
|
-
switch (this.setWidgetClass(t), this._widgetClass === void 0 && (s = e.fieldsWidgetType, this.setWidgetClass(e.fieldsWidgetType)), this._widgetClass === void 0 && (this._widgetClass =
|
|
1832
|
+
switch (this.setWidgetClass(t), this._widgetClass === void 0 && (s = e.fieldsWidgetType, this.setWidgetClass(e.fieldsWidgetType)), this._widgetClass === void 0 && (this._widgetClass = k), t) {
|
|
1794
1833
|
case "notebook":
|
|
1795
1834
|
case "page":
|
|
1796
1835
|
case "group":
|
|
@@ -1807,7 +1846,7 @@ class $ {
|
|
|
1807
1846
|
}
|
|
1808
1847
|
}
|
|
1809
1848
|
}
|
|
1810
|
-
const
|
|
1849
|
+
const nt = ({
|
|
1811
1850
|
fieldName: i,
|
|
1812
1851
|
values: t,
|
|
1813
1852
|
fields: e
|
|
@@ -1821,18 +1860,18 @@ const rt = ({
|
|
|
1821
1860
|
const n = {}, a = {};
|
|
1822
1861
|
for (const o of Object.keys(s))
|
|
1823
1862
|
if (t.state === o) {
|
|
1824
|
-
const
|
|
1825
|
-
for (const _ of
|
|
1826
|
-
const [u,
|
|
1827
|
-
a[u] || (a[u] = []), a[u].push(
|
|
1863
|
+
const h = s[o];
|
|
1864
|
+
for (const _ of h) {
|
|
1865
|
+
const [u, d] = _;
|
|
1866
|
+
a[u] || (a[u] = []), a[u].push(d);
|
|
1828
1867
|
}
|
|
1829
1868
|
}
|
|
1830
1869
|
for (const o of Object.keys(a)) {
|
|
1831
|
-
const
|
|
1832
|
-
n[o] =
|
|
1870
|
+
const h = a[o];
|
|
1871
|
+
n[o] = h.some((_) => _);
|
|
1833
1872
|
}
|
|
1834
1873
|
return n;
|
|
1835
|
-
},
|
|
1874
|
+
}, at = ({
|
|
1836
1875
|
states: i,
|
|
1837
1876
|
values: t
|
|
1838
1877
|
}) => {
|
|
@@ -1841,7 +1880,7 @@ const rt = ({
|
|
|
1841
1880
|
const e = i.split(",");
|
|
1842
1881
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1843
1882
|
};
|
|
1844
|
-
function
|
|
1883
|
+
function lt({
|
|
1845
1884
|
values: i = {},
|
|
1846
1885
|
fieldName: t,
|
|
1847
1886
|
fields: e = {}
|
|
@@ -1865,11 +1904,11 @@ const ne = ({
|
|
|
1865
1904
|
return s;
|
|
1866
1905
|
if (i.trim().length === 0)
|
|
1867
1906
|
return;
|
|
1868
|
-
const
|
|
1869
|
-
return
|
|
1907
|
+
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 = {};
|
|
1908
|
+
return d.forEach((c) => {
|
|
1870
1909
|
const b = c[1];
|
|
1871
1910
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1872
|
-
const x =
|
|
1911
|
+
const x = lt({
|
|
1873
1912
|
values: t,
|
|
1874
1913
|
fields: e,
|
|
1875
1914
|
fieldName: b === "active_id" ? "id" : b
|
|
@@ -1884,11 +1923,11 @@ const ne = ({
|
|
|
1884
1923
|
} catch {
|
|
1885
1924
|
return;
|
|
1886
1925
|
}
|
|
1887
|
-
},
|
|
1926
|
+
}, St = (i) => {
|
|
1888
1927
|
const t = [];
|
|
1889
1928
|
try {
|
|
1890
|
-
return !i || le(i) || typeof i != "string" ? t : ae(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((
|
|
1891
|
-
!
|
|
1929
|
+
return !i || le(i) || typeof i != "string" ? t : ae(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) => {
|
|
1930
|
+
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1892
1931
|
}), t);
|
|
1893
1932
|
} catch {
|
|
1894
1933
|
}
|
|
@@ -1904,26 +1943,26 @@ function ae(i) {
|
|
|
1904
1943
|
function le(i) {
|
|
1905
1944
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1906
1945
|
}
|
|
1907
|
-
const
|
|
1946
|
+
const ot = (i) => {
|
|
1908
1947
|
const t = i.trim().replace(")", "").split("("), e = t[0], n = t[1].split(",").map((a) => a.trim());
|
|
1909
1948
|
return {
|
|
1910
1949
|
method: e,
|
|
1911
1950
|
args: n
|
|
1912
1951
|
};
|
|
1913
1952
|
};
|
|
1914
|
-
function
|
|
1953
|
+
function ct(i) {
|
|
1915
1954
|
const t = [];
|
|
1916
1955
|
function e(s) {
|
|
1917
1956
|
const n = [];
|
|
1918
1957
|
for (const a of s)
|
|
1919
|
-
a instanceof
|
|
1958
|
+
a instanceof v ? e(a._container.rows.flat()) : n.push(a);
|
|
1920
1959
|
n.length > 0 && t.push(n);
|
|
1921
1960
|
}
|
|
1922
1961
|
for (const s of i)
|
|
1923
1962
|
e(s);
|
|
1924
1963
|
return t.flat();
|
|
1925
1964
|
}
|
|
1926
|
-
class
|
|
1965
|
+
class Et {
|
|
1927
1966
|
constructor(t, e = 4) {
|
|
1928
1967
|
/**
|
|
1929
1968
|
* Object containing fields specification of the form.
|
|
@@ -2033,17 +2072,17 @@ class St {
|
|
|
2033
2072
|
}
|
|
2034
2073
|
parse(t, e) {
|
|
2035
2074
|
var o;
|
|
2036
|
-
const { values: s = {}, readOnly: n = !1 } = e || {}, a = D.parse(t).filter((
|
|
2075
|
+
const { values: s = {}, readOnly: n = !1 } = e || {}, a = D.parse(t).filter((h) => h.tagName === "form")[0];
|
|
2037
2076
|
this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = m(this._string)), this._readOnly = n, this._context = s.id ? { active_id: s.id, active_ids: [s.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
2038
2077
|
fields: a.children,
|
|
2039
2078
|
container: this._container,
|
|
2040
2079
|
values: s
|
|
2041
2080
|
});
|
|
2042
|
-
const l =
|
|
2043
|
-
l.forEach((
|
|
2044
|
-
const _ =
|
|
2045
|
-
_._id && _._context && (this._contextForFields[_._id] =
|
|
2046
|
-
}), this._autorefreshableFields = l.filter((
|
|
2081
|
+
const l = ct(this._container._rows);
|
|
2082
|
+
l.forEach((h) => {
|
|
2083
|
+
const _ = h;
|
|
2084
|
+
_._id && _._context && (this._contextForFields[_._id] = h._context);
|
|
2085
|
+
}), this._autorefreshableFields = l.filter((h) => h instanceof f && h.autoRefresh).map((h) => h._id);
|
|
2047
2086
|
}
|
|
2048
2087
|
parseNode({
|
|
2049
2088
|
fields: t,
|
|
@@ -2052,8 +2091,8 @@ class St {
|
|
|
2052
2091
|
}) {
|
|
2053
2092
|
const n = new $();
|
|
2054
2093
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
2055
|
-
var
|
|
2056
|
-
const { tagName: l, attributes: o, children:
|
|
2094
|
+
var F, C;
|
|
2095
|
+
const { tagName: l, attributes: o, children: h } = a;
|
|
2057
2096
|
let _ = l, u = o;
|
|
2058
2097
|
if (l === "field") {
|
|
2059
2098
|
const { name: p, widget: I } = o;
|
|
@@ -2075,33 +2114,33 @@ class St {
|
|
|
2075
2114
|
fieldsWidgetType: this._fields[p].type
|
|
2076
2115
|
};
|
|
2077
2116
|
}
|
|
2078
|
-
const
|
|
2117
|
+
const d = Ce({
|
|
2079
2118
|
tagAttributes: u,
|
|
2080
2119
|
values: s,
|
|
2081
2120
|
fields: this._fields,
|
|
2082
2121
|
widgetType: l
|
|
2083
2122
|
});
|
|
2084
2123
|
let g;
|
|
2085
|
-
l === "button" && u.states ? g =
|
|
2124
|
+
l === "button" && u.states ? g = at({
|
|
2086
2125
|
states: u.states,
|
|
2087
2126
|
values: s
|
|
2088
|
-
}) : g =
|
|
2127
|
+
}) : g = nt({
|
|
2089
2128
|
fieldName: u.name,
|
|
2090
2129
|
values: s,
|
|
2091
2130
|
fields: this._fields
|
|
2092
2131
|
});
|
|
2093
2132
|
const c = ne({
|
|
2094
|
-
context: u.context || ((
|
|
2133
|
+
context: u.context || ((F = this._fields[u.name]) == null ? void 0 : F.context),
|
|
2095
2134
|
values: s,
|
|
2096
2135
|
fields: this._fields
|
|
2097
2136
|
});
|
|
2098
|
-
u.on_change && (this._onChangeFields[u.name] =
|
|
2137
|
+
u.on_change && (this._onChangeFields[u.name] = ot(
|
|
2099
2138
|
u.on_change
|
|
2100
2139
|
));
|
|
2101
2140
|
let b;
|
|
2102
|
-
Q(u.domain) ? b = u.domain : Q((
|
|
2141
|
+
Q(u.domain) ? b = u.domain : Q((C = this._fields[u.name]) == null ? void 0 : C.domain) && (b = this._fields[u.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
2103
2142
|
const x = {
|
|
2104
|
-
...
|
|
2143
|
+
...d,
|
|
2105
2144
|
...g,
|
|
2106
2145
|
context: c,
|
|
2107
2146
|
domain: b,
|
|
@@ -2109,8 +2148,8 @@ class St {
|
|
|
2109
2148
|
};
|
|
2110
2149
|
e.readOnly && (x.readonly = !0);
|
|
2111
2150
|
const y = n.createWidget(_, x);
|
|
2112
|
-
y.invisible && y instanceof f && this._invisibleFields.push(x.name), y instanceof
|
|
2113
|
-
fields:
|
|
2151
|
+
y.invisible && y instanceof f && this._invisibleFields.push(x.name), y instanceof v && this.parseNode({
|
|
2152
|
+
fields: h,
|
|
2114
2153
|
container: y.container,
|
|
2115
2154
|
values: s
|
|
2116
2155
|
}), y instanceof ee && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
@@ -2127,7 +2166,7 @@ class St {
|
|
|
2127
2166
|
function Q(i) {
|
|
2128
2167
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
2129
2168
|
}
|
|
2130
|
-
class
|
|
2169
|
+
class Vt {
|
|
2131
2170
|
constructor(t) {
|
|
2132
2171
|
/**
|
|
2133
2172
|
* Object containing fields specification of the form.
|
|
@@ -2206,30 +2245,30 @@ class Et {
|
|
|
2206
2245
|
const { tagName: a, attributes: l } = n;
|
|
2207
2246
|
let o = null;
|
|
2208
2247
|
if (a === "field") {
|
|
2209
|
-
const { name:
|
|
2248
|
+
const { name: h, widget: _ } = l;
|
|
2210
2249
|
let u = l;
|
|
2211
|
-
if (
|
|
2212
|
-
if (!this._fields[
|
|
2213
|
-
throw new Error(`Field ${
|
|
2214
|
-
const
|
|
2215
|
-
o =
|
|
2250
|
+
if (h) {
|
|
2251
|
+
if (!this._fields[h])
|
|
2252
|
+
throw new Error(`Field ${h} doesn't exist in fields defintion`);
|
|
2253
|
+
const d = this._fields[h];
|
|
2254
|
+
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;
|
|
2216
2255
|
const g = ne({
|
|
2217
|
-
context: l.context ||
|
|
2256
|
+
context: l.context || d.context,
|
|
2218
2257
|
values: {},
|
|
2219
2258
|
fields: this._fields
|
|
2220
2259
|
});
|
|
2221
2260
|
u = {
|
|
2222
|
-
...
|
|
2261
|
+
...d,
|
|
2223
2262
|
...l,
|
|
2224
|
-
fieldsWidgetType:
|
|
2263
|
+
fieldsWidgetType: d == null ? void 0 : d.type,
|
|
2225
2264
|
context: g
|
|
2226
|
-
}, this._contextForFields[
|
|
2265
|
+
}, this._contextForFields[h] = g;
|
|
2227
2266
|
}
|
|
2228
2267
|
if (_ && (o = _), !u.invisible) {
|
|
2229
|
-
const
|
|
2230
|
-
this._columns.push(
|
|
2268
|
+
const d = s.createWidget(o, u);
|
|
2269
|
+
this._columns.push(d);
|
|
2231
2270
|
}
|
|
2232
|
-
|
|
2271
|
+
w(u.autorefresh) && this._autorefreshableFields.push(h);
|
|
2233
2272
|
}
|
|
2234
2273
|
});
|
|
2235
2274
|
}
|
|
@@ -2241,7 +2280,7 @@ class Et {
|
|
|
2241
2280
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
2242
2281
|
}
|
|
2243
2282
|
}
|
|
2244
|
-
const
|
|
2283
|
+
const ht = {
|
|
2245
2284
|
text: "text",
|
|
2246
2285
|
many2one: "many2one",
|
|
2247
2286
|
char: "char",
|
|
@@ -2254,7 +2293,7 @@ const ct = {
|
|
|
2254
2293
|
date: "date",
|
|
2255
2294
|
datetime: "datetime"
|
|
2256
2295
|
};
|
|
2257
|
-
class
|
|
2296
|
+
class Yt {
|
|
2258
2297
|
constructor(t, e, s = 8) {
|
|
2259
2298
|
/**
|
|
2260
2299
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -2302,7 +2341,7 @@ class Vt {
|
|
|
2302
2341
|
colspan: 2
|
|
2303
2342
|
}, { type: a, widget: l } = n;
|
|
2304
2343
|
let o = l ?? a;
|
|
2305
|
-
return
|
|
2344
|
+
return ht[o] === void 0 && (o = a), e.createWidget(o, n);
|
|
2306
2345
|
});
|
|
2307
2346
|
}
|
|
2308
2347
|
/**
|
|
@@ -2313,7 +2352,7 @@ class Vt {
|
|
|
2313
2352
|
return this.advancedSearchContainer.findById(t);
|
|
2314
2353
|
}
|
|
2315
2354
|
}
|
|
2316
|
-
const
|
|
2355
|
+
const Dt = ({
|
|
2317
2356
|
domain: i,
|
|
2318
2357
|
widgetFieldName: t
|
|
2319
2358
|
}) => {
|
|
@@ -2322,13 +2361,13 @@ const Yt = ({
|
|
|
2322
2361
|
if (!Array.isArray(s))
|
|
2323
2362
|
return;
|
|
2324
2363
|
const [n, a, l] = s;
|
|
2325
|
-
let o,
|
|
2326
|
-
n.indexOf(".") !== -1 ? (o = n.substr(0, n.indexOf(".")),
|
|
2364
|
+
let o, h;
|
|
2365
|
+
n.indexOf(".") !== -1 ? (o = n.substr(0, n.indexOf(".")), h = n.substr(
|
|
2327
2366
|
n.indexOf(".") + 1,
|
|
2328
2367
|
n.length - 1
|
|
2329
|
-
)) : (o = n,
|
|
2368
|
+
)) : (o = n, h = "id"), o === t && e.push([h, a, l]);
|
|
2330
2369
|
}), e;
|
|
2331
|
-
},
|
|
2370
|
+
}, jt = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2332
2371
|
class dt {
|
|
2333
2372
|
constructor(t) {
|
|
2334
2373
|
r(this, "_action_id", null);
|
|
@@ -2342,7 +2381,7 @@ class dt {
|
|
|
2342
2381
|
return this._position;
|
|
2343
2382
|
}
|
|
2344
2383
|
}
|
|
2345
|
-
class
|
|
2384
|
+
class Mt {
|
|
2346
2385
|
constructor(t) {
|
|
2347
2386
|
r(this, "_string", null);
|
|
2348
2387
|
r(this, "_items", []);
|
|
@@ -2395,8 +2434,10 @@ class ce extends oe {
|
|
|
2395
2434
|
r(this, "_icon", null);
|
|
2396
2435
|
r(this, "_totalDomain", null);
|
|
2397
2436
|
r(this, "_showPercent", !1);
|
|
2437
|
+
r(this, "_progressbar", !1);
|
|
2438
|
+
r(this, "_showTotal", !0);
|
|
2398
2439
|
r(this, "_suffix", null);
|
|
2399
|
-
this._type = e, this._color = s.attributes.color || null, this._color && (this._color = m(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = m(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = m(s.attributes.totalDomain) || null, this._showPercent =
|
|
2440
|
+
this._type = e, this._color = s.attributes.color || null, this._color && (this._color = m(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = m(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = m(s.attributes.totalDomain) || null, this._showPercent = w(s.attributes.showPercent), this._progressbar = w(s.attributes.progressbar), this._showTotal = s.attributes.showTotal !== void 0 ? w(s.attributes.showTotal) : !!this._totalDomain;
|
|
2400
2441
|
}
|
|
2401
2442
|
get color() {
|
|
2402
2443
|
return this._color;
|
|
@@ -2410,11 +2451,17 @@ class ce extends oe {
|
|
|
2410
2451
|
get showPercent() {
|
|
2411
2452
|
return this._showPercent;
|
|
2412
2453
|
}
|
|
2454
|
+
get progressbar() {
|
|
2455
|
+
return this._progressbar;
|
|
2456
|
+
}
|
|
2457
|
+
get showTotal() {
|
|
2458
|
+
return this._showTotal;
|
|
2459
|
+
}
|
|
2413
2460
|
get suffix() {
|
|
2414
2461
|
return this._suffix;
|
|
2415
2462
|
}
|
|
2416
2463
|
}
|
|
2417
|
-
class
|
|
2464
|
+
class ut extends ce {
|
|
2418
2465
|
constructor(e, s) {
|
|
2419
2466
|
super(e, s);
|
|
2420
2467
|
r(this, "_field");
|
|
@@ -2434,24 +2481,24 @@ class ht extends ce {
|
|
|
2434
2481
|
return this._operator;
|
|
2435
2482
|
}
|
|
2436
2483
|
}
|
|
2437
|
-
const
|
|
2484
|
+
const _t = (i) => {
|
|
2438
2485
|
const t = [];
|
|
2439
2486
|
let e;
|
|
2440
2487
|
if (i.forEach((s) => {
|
|
2441
2488
|
if (s.tagName === "field") {
|
|
2442
|
-
const n = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0,
|
|
2489
|
+
const n = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, h = s.attributes.stacked || void 0;
|
|
2443
2490
|
if (!n)
|
|
2444
2491
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2445
2492
|
if (!l)
|
|
2446
2493
|
throw new Error("Missing name attribute for field");
|
|
2447
|
-
n === "x" ? e = new
|
|
2494
|
+
n === "x" ? e = new mt({
|
|
2448
2495
|
name: l
|
|
2449
2496
|
}) : n === "y" && t.push(
|
|
2450
|
-
new
|
|
2497
|
+
new gt({
|
|
2451
2498
|
name: l,
|
|
2452
2499
|
operator: a,
|
|
2453
2500
|
label: o,
|
|
2454
|
-
stacked:
|
|
2501
|
+
stacked: h
|
|
2455
2502
|
})
|
|
2456
2503
|
);
|
|
2457
2504
|
}
|
|
@@ -2470,7 +2517,7 @@ class M extends oe {
|
|
|
2470
2517
|
r(this, "_x");
|
|
2471
2518
|
r(this, "_y");
|
|
2472
2519
|
this._type = e;
|
|
2473
|
-
const n =
|
|
2520
|
+
const n = _t(s.children);
|
|
2474
2521
|
this._x = n.x, this._y = n.y;
|
|
2475
2522
|
}
|
|
2476
2523
|
get x() {
|
|
@@ -2480,22 +2527,22 @@ class M extends oe {
|
|
|
2480
2527
|
return this._y;
|
|
2481
2528
|
}
|
|
2482
2529
|
}
|
|
2483
|
-
const
|
|
2530
|
+
const ft = {
|
|
2484
2531
|
indicator: ce,
|
|
2485
|
-
indicatorField:
|
|
2532
|
+
indicatorField: ut,
|
|
2486
2533
|
line: M,
|
|
2487
2534
|
bar: M,
|
|
2488
2535
|
pie: M
|
|
2489
|
-
},
|
|
2536
|
+
}, Nt = (i) => {
|
|
2490
2537
|
const t = D.parse(i).filter((n) => n.tagName === "graph")[0], e = t.attributes.type;
|
|
2491
2538
|
if (!e)
|
|
2492
2539
|
throw new Error(`${e} is not a valid graph`);
|
|
2493
|
-
const s =
|
|
2540
|
+
const s = ft[e];
|
|
2494
2541
|
if (!s)
|
|
2495
2542
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2496
2543
|
return new s(e, t);
|
|
2497
2544
|
};
|
|
2498
|
-
class
|
|
2545
|
+
class he {
|
|
2499
2546
|
constructor({ name: t, axis: e }) {
|
|
2500
2547
|
r(this, "_name");
|
|
2501
2548
|
r(this, "_axis");
|
|
@@ -2508,7 +2555,7 @@ class de {
|
|
|
2508
2555
|
return this._axis;
|
|
2509
2556
|
}
|
|
2510
2557
|
}
|
|
2511
|
-
class
|
|
2558
|
+
class gt extends he {
|
|
2512
2559
|
constructor({
|
|
2513
2560
|
name: e,
|
|
2514
2561
|
operator: s,
|
|
@@ -2531,12 +2578,12 @@ class ft extends de {
|
|
|
2531
2578
|
return this._stacked;
|
|
2532
2579
|
}
|
|
2533
2580
|
}
|
|
2534
|
-
class
|
|
2581
|
+
class mt extends he {
|
|
2535
2582
|
constructor({ name: t }) {
|
|
2536
2583
|
super({ name: t, axis: "x" });
|
|
2537
2584
|
}
|
|
2538
2585
|
}
|
|
2539
|
-
const
|
|
2586
|
+
const bt = ({ ooui: i }) => {
|
|
2540
2587
|
const e = [i.x.name];
|
|
2541
2588
|
return i.y ? (i.y.forEach((s) => {
|
|
2542
2589
|
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
@@ -2558,27 +2605,27 @@ function q({
|
|
|
2558
2605
|
}
|
|
2559
2606
|
return { value: n, label: n };
|
|
2560
2607
|
}
|
|
2561
|
-
const
|
|
2608
|
+
const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2562
2609
|
__proto__: null,
|
|
2563
|
-
getFieldsToRetrieve:
|
|
2610
|
+
getFieldsToRetrieve: bt,
|
|
2564
2611
|
getValueAndLabelForField: q
|
|
2565
2612
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2566
|
-
function
|
|
2613
|
+
function yt({
|
|
2567
2614
|
values: i,
|
|
2568
2615
|
timerange: t,
|
|
2569
2616
|
interval: e = 1
|
|
2570
2617
|
}) {
|
|
2571
|
-
const s =
|
|
2618
|
+
const s = wt({
|
|
2572
2619
|
values: i,
|
|
2573
2620
|
timerange: t
|
|
2574
2621
|
});
|
|
2575
|
-
return
|
|
2622
|
+
return xt({
|
|
2576
2623
|
values: s,
|
|
2577
2624
|
timerange: t,
|
|
2578
2625
|
interval: e
|
|
2579
2626
|
});
|
|
2580
2627
|
}
|
|
2581
|
-
function
|
|
2628
|
+
function xt({
|
|
2582
2629
|
values: i,
|
|
2583
2630
|
timerange: t,
|
|
2584
2631
|
interval: e = 1
|
|
@@ -2589,15 +2636,15 @@ function yt({
|
|
|
2589
2636
|
groupBy: "type-stacked"
|
|
2590
2637
|
}), a = `${t}s`;
|
|
2591
2638
|
return Object.keys(n).forEach((o) => {
|
|
2592
|
-
const
|
|
2593
|
-
for (let _ = 0; _ <
|
|
2594
|
-
const u =
|
|
2595
|
-
if (s.push(u), _ ===
|
|
2639
|
+
const h = n[o];
|
|
2640
|
+
for (let _ = 0; _ < h.length; _++) {
|
|
2641
|
+
const u = h[_];
|
|
2642
|
+
if (s.push(u), _ === h.length - 1)
|
|
2596
2643
|
return;
|
|
2597
|
-
const
|
|
2598
|
-
if (!
|
|
2599
|
-
const c =
|
|
2600
|
-
dates: [
|
|
2644
|
+
const d = u.x, g = h[_ + 1].x;
|
|
2645
|
+
if (!de([d, g], a)) {
|
|
2646
|
+
const c = pt({
|
|
2647
|
+
dates: [d, g],
|
|
2601
2648
|
timerange: t,
|
|
2602
2649
|
interval: e
|
|
2603
2650
|
});
|
|
@@ -2611,9 +2658,9 @@ function yt({
|
|
|
2611
2658
|
);
|
|
2612
2659
|
}
|
|
2613
2660
|
}
|
|
2614
|
-
}), s.sort((o,
|
|
2661
|
+
}), s.sort((o, h) => o.x < h.x ? -1 : o.x > h.x ? 1 : 0);
|
|
2615
2662
|
}
|
|
2616
|
-
function
|
|
2663
|
+
function pt({
|
|
2617
2664
|
dates: i,
|
|
2618
2665
|
timerange: t,
|
|
2619
2666
|
interval: e = 1
|
|
@@ -2623,23 +2670,23 @@ function xt({
|
|
|
2623
2670
|
return i;
|
|
2624
2671
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2625
2672
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2626
|
-
const o = a[l],
|
|
2627
|
-
if (!
|
|
2628
|
-
const _ =
|
|
2673
|
+
const o = a[l], h = a[l + 1];
|
|
2674
|
+
if (!de([o, h], n)) {
|
|
2675
|
+
const _ = W(o, E(n)).add(
|
|
2629
2676
|
e,
|
|
2630
2677
|
n
|
|
2631
|
-
), u =
|
|
2678
|
+
), u = W(h, E(n));
|
|
2632
2679
|
for (; _.isBefore(u); )
|
|
2633
2680
|
s.push(_.format(E(n))), _.add(e, n);
|
|
2634
2681
|
}
|
|
2635
2682
|
}
|
|
2636
2683
|
return s;
|
|
2637
2684
|
}
|
|
2638
|
-
function
|
|
2685
|
+
function wt({
|
|
2639
2686
|
values: i,
|
|
2640
2687
|
timerange: t
|
|
2641
2688
|
}) {
|
|
2642
|
-
const e =
|
|
2689
|
+
const e = vt({
|
|
2643
2690
|
values: i,
|
|
2644
2691
|
timerange: t
|
|
2645
2692
|
}), s = [], n = ue({
|
|
@@ -2647,34 +2694,34 @@ function pt({
|
|
|
2647
2694
|
groupBy: "all"
|
|
2648
2695
|
});
|
|
2649
2696
|
return Object.keys(n).forEach((a) => {
|
|
2650
|
-
const l = n[a], o = l[0].operator === "count" ? "+" : l[0].operator,
|
|
2697
|
+
const l = n[a], o = l[0].operator === "count" ? "+" : l[0].operator, h = Y({
|
|
2651
2698
|
values: l.map((_) => _.value),
|
|
2652
2699
|
operator: o
|
|
2653
2700
|
});
|
|
2654
2701
|
s.push({
|
|
2655
2702
|
...l[0],
|
|
2656
|
-
value:
|
|
2703
|
+
value: h
|
|
2657
2704
|
});
|
|
2658
2705
|
}), s;
|
|
2659
2706
|
}
|
|
2660
|
-
function
|
|
2707
|
+
function vt({
|
|
2661
2708
|
values: i,
|
|
2662
2709
|
timerange: t
|
|
2663
2710
|
}) {
|
|
2664
2711
|
return i.map((e) => ({
|
|
2665
2712
|
...e,
|
|
2666
|
-
x:
|
|
2713
|
+
x: Ft({
|
|
2667
2714
|
date: e.x,
|
|
2668
2715
|
timerange: t
|
|
2669
2716
|
})
|
|
2670
2717
|
}));
|
|
2671
2718
|
}
|
|
2672
|
-
function
|
|
2719
|
+
function Ft({
|
|
2673
2720
|
date: i,
|
|
2674
2721
|
timerange: t
|
|
2675
2722
|
}) {
|
|
2676
|
-
let e =
|
|
2677
|
-
const s =
|
|
2723
|
+
let e = Ct(i);
|
|
2724
|
+
const s = W(i, e);
|
|
2678
2725
|
switch (t) {
|
|
2679
2726
|
case "hour": {
|
|
2680
2727
|
e = "YYYY-MM-DD HH:00";
|
|
@@ -2699,10 +2746,10 @@ function vt({
|
|
|
2699
2746
|
}
|
|
2700
2747
|
return s.format(e);
|
|
2701
2748
|
}
|
|
2702
|
-
function
|
|
2749
|
+
function Ct(i) {
|
|
2703
2750
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2704
2751
|
}
|
|
2705
|
-
function
|
|
2752
|
+
function de(i, t) {
|
|
2706
2753
|
let e = !1;
|
|
2707
2754
|
const s = E(t);
|
|
2708
2755
|
if (i.length === 0)
|
|
@@ -2710,7 +2757,7 @@ function he(i, t) {
|
|
|
2710
2757
|
if (i.length === 1)
|
|
2711
2758
|
return !0;
|
|
2712
2759
|
for (let n = 0; n < i.length - 1; n++) {
|
|
2713
|
-
const a =
|
|
2760
|
+
const a = W(i[n], s), o = W(i[n + 1], s).diff(a, t);
|
|
2714
2761
|
Math.abs(o) === 1 ? e = !0 : e = !1;
|
|
2715
2762
|
}
|
|
2716
2763
|
return e;
|
|
@@ -2740,7 +2787,7 @@ function E(i) {
|
|
|
2740
2787
|
return "YYYY-MM-DD HH:mm";
|
|
2741
2788
|
}
|
|
2742
2789
|
}
|
|
2743
|
-
const
|
|
2790
|
+
const kt = {
|
|
2744
2791
|
count: "count",
|
|
2745
2792
|
"+": "sum",
|
|
2746
2793
|
"-": "subtract",
|
|
@@ -2748,7 +2795,7 @@ const Ct = {
|
|
|
2748
2795
|
avg: "average",
|
|
2749
2796
|
min: "min",
|
|
2750
2797
|
max: "max"
|
|
2751
|
-
},
|
|
2798
|
+
}, Pt = ({
|
|
2752
2799
|
ooui: i,
|
|
2753
2800
|
values: t,
|
|
2754
2801
|
fields: e,
|
|
@@ -2763,13 +2810,13 @@ const Ct = {
|
|
|
2763
2810
|
Object.keys(n).forEach((b) => {
|
|
2764
2811
|
const x = n[b].label, y = n[b].entries;
|
|
2765
2812
|
if (c.label) {
|
|
2766
|
-
const
|
|
2813
|
+
const F = R({
|
|
2767
2814
|
fieldName: c.label,
|
|
2768
2815
|
values: y,
|
|
2769
2816
|
fields: e
|
|
2770
2817
|
});
|
|
2771
|
-
Object.keys(
|
|
2772
|
-
const p =
|
|
2818
|
+
Object.keys(F).forEach((C) => {
|
|
2819
|
+
const p = F[C].entries, I = F[C].label, ge = B({
|
|
2773
2820
|
entries: p,
|
|
2774
2821
|
fields: e,
|
|
2775
2822
|
fieldName: c.name
|
|
@@ -2786,17 +2833,17 @@ const Ct = {
|
|
|
2786
2833
|
});
|
|
2787
2834
|
});
|
|
2788
2835
|
} else {
|
|
2789
|
-
const
|
|
2836
|
+
const F = B({
|
|
2790
2837
|
entries: y,
|
|
2791
2838
|
fields: e,
|
|
2792
2839
|
fieldName: c.name
|
|
2793
|
-
}),
|
|
2794
|
-
values:
|
|
2840
|
+
}), C = Y({
|
|
2841
|
+
values: F,
|
|
2795
2842
|
operator: c.operator
|
|
2796
2843
|
});
|
|
2797
2844
|
a.push({
|
|
2798
2845
|
x: x || !1,
|
|
2799
|
-
value:
|
|
2846
|
+
value: C,
|
|
2800
2847
|
type: _e({
|
|
2801
2848
|
yAxis: c,
|
|
2802
2849
|
fields: e
|
|
@@ -2814,21 +2861,21 @@ const Ct = {
|
|
|
2814
2861
|
i.type === "pie" && u.some((c) => c.x === !1) ? u = u.map((c) => c.x === !1 ? { ...c, x: (s == null ? void 0 : s.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (u = u.filter(
|
|
2815
2862
|
(c) => c.x !== !1
|
|
2816
2863
|
));
|
|
2817
|
-
let
|
|
2818
|
-
i.timerange ?
|
|
2819
|
-
values:
|
|
2864
|
+
let d = u;
|
|
2865
|
+
i.timerange ? d = yt({
|
|
2866
|
+
values: d,
|
|
2820
2867
|
timerange: i.timerange,
|
|
2821
2868
|
interval: i.interval
|
|
2822
|
-
}) : i.type == "pie" && (
|
|
2869
|
+
}) : i.type == "pie" && (d = u.sort((c, b) => b.value - c.value));
|
|
2823
2870
|
const g = {
|
|
2824
|
-
data:
|
|
2871
|
+
data: d,
|
|
2825
2872
|
isGroup: o || l,
|
|
2826
2873
|
isStack: o
|
|
2827
2874
|
};
|
|
2828
2875
|
if (i.type === "line" && i.y_range && (g.yAxisOpts = {
|
|
2829
2876
|
mode: i.y_range
|
|
2830
2877
|
}, i.y_range === "auto")) {
|
|
2831
|
-
const { min: c, max: b } = fe(
|
|
2878
|
+
const { min: c, max: b } = fe(d);
|
|
2832
2879
|
g.yAxisOpts.valueOpts = { min: c, max: b };
|
|
2833
2880
|
}
|
|
2834
2881
|
return g;
|
|
@@ -2897,7 +2944,7 @@ function R({
|
|
|
2897
2944
|
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(n);
|
|
2898
2945
|
}), s;
|
|
2899
2946
|
}
|
|
2900
|
-
function
|
|
2947
|
+
function Ot(i) {
|
|
2901
2948
|
let t = [];
|
|
2902
2949
|
return Object.keys(i).forEach((e) => {
|
|
2903
2950
|
const s = i[e];
|
|
@@ -2920,53 +2967,54 @@ function fe(i, t = 0.1) {
|
|
|
2920
2967
|
max: n + a
|
|
2921
2968
|
};
|
|
2922
2969
|
}
|
|
2923
|
-
const
|
|
2970
|
+
const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2924
2971
|
__proto__: null,
|
|
2925
|
-
getAllObjectsInGroupedValues:
|
|
2972
|
+
getAllObjectsInGroupedValues: Ot,
|
|
2926
2973
|
getMinMax: fe,
|
|
2927
2974
|
getValueForOperator: Y,
|
|
2928
2975
|
getValuesForYField: B,
|
|
2929
2976
|
getValuesGroupedByField: R,
|
|
2930
2977
|
getYAxisFieldname: _e,
|
|
2931
|
-
labelsForOperator:
|
|
2932
|
-
processGraphData:
|
|
2978
|
+
labelsForOperator: kt,
|
|
2979
|
+
processGraphData: Pt
|
|
2933
2980
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2934
2981
|
export {
|
|
2935
|
-
|
|
2936
|
-
|
|
2982
|
+
We as ActionButtons,
|
|
2983
|
+
Ke as Alert,
|
|
2937
2984
|
ke as Avatar,
|
|
2938
2985
|
Ae as Binary,
|
|
2939
2986
|
te as Boolean,
|
|
2940
2987
|
ee as Button,
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2988
|
+
Te as ButtonGroup,
|
|
2989
|
+
rt as Card,
|
|
2990
|
+
tt as Carousel,
|
|
2944
2991
|
A as Char,
|
|
2945
2992
|
re as CodeEditor,
|
|
2946
|
-
|
|
2947
|
-
|
|
2993
|
+
it as ColorPicker,
|
|
2994
|
+
Ze as Comments,
|
|
2948
2995
|
V as Container,
|
|
2949
|
-
|
|
2950
|
-
|
|
2996
|
+
v as ContainerWidget,
|
|
2997
|
+
Mt as Dashboard,
|
|
2951
2998
|
dt as DashboardItem,
|
|
2952
2999
|
De as Date,
|
|
2953
3000
|
je as DateTime,
|
|
2954
|
-
|
|
3001
|
+
et as Email,
|
|
2955
3002
|
f as Field,
|
|
2956
3003
|
G as Float,
|
|
2957
3004
|
Ee as FloatTime,
|
|
2958
|
-
|
|
3005
|
+
Et as Form,
|
|
2959
3006
|
oe as Graph,
|
|
2960
|
-
|
|
3007
|
+
he as GraphAxis,
|
|
2961
3008
|
M as GraphChart,
|
|
2962
3009
|
ce as GraphIndicator,
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
3010
|
+
ut as GraphIndicatorField,
|
|
3011
|
+
mt as GraphXAxis,
|
|
3012
|
+
gt as GraphYAxis,
|
|
2966
3013
|
Oe as Group,
|
|
2967
3014
|
Ve as HTMLPreview,
|
|
3015
|
+
Re as Icon,
|
|
2968
3016
|
Be as Image,
|
|
2969
|
-
|
|
3017
|
+
$e as Indicator,
|
|
2970
3018
|
Se as Integer,
|
|
2971
3019
|
H as JSONField,
|
|
2972
3020
|
Z as Label,
|
|
@@ -2978,29 +3026,29 @@ export {
|
|
|
2978
3026
|
ie as One2many,
|
|
2979
3027
|
Pe as Page,
|
|
2980
3028
|
Ye as ProgressBar,
|
|
2981
|
-
|
|
2982
|
-
|
|
3029
|
+
st as QRCode,
|
|
3030
|
+
He as Radio,
|
|
2983
3031
|
Ne as Reference,
|
|
2984
|
-
|
|
2985
|
-
|
|
3032
|
+
ht as SearchFieldTypes,
|
|
3033
|
+
Yt as SearchFilter,
|
|
2986
3034
|
z as Selection,
|
|
2987
3035
|
Me as Separator,
|
|
2988
3036
|
j as Spinner,
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
3037
|
+
Xe as Steps,
|
|
3038
|
+
Qe as Switch,
|
|
3039
|
+
Je as Tag,
|
|
3040
|
+
qe as Tags,
|
|
2993
3041
|
L as Text,
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3042
|
+
Ue as Time,
|
|
3043
|
+
Ge as Timeline,
|
|
3044
|
+
Vt as Tree,
|
|
3045
|
+
k as Widget,
|
|
3046
|
+
At as graphFieldUtils,
|
|
3047
|
+
Bt as graphProcessor,
|
|
3000
3048
|
ne as parseContext,
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3049
|
+
St as parseContextFields,
|
|
3050
|
+
jt as parseDomainFields,
|
|
3051
|
+
Nt as parseGraph,
|
|
3052
|
+
Dt as transformDomainForChildWidget
|
|
3005
3053
|
};
|
|
3006
3054
|
//# sourceMappingURL=ooui.es.js.map
|