@gisce/ooui 2.35.0 → 2.36.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/Indicator.d.ts +3 -0
- package/dist/Indicator.d.ts.map +1 -1
- package/dist/ooui.es.js +161 -151
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Indicator.ts +12 -0
package/dist/ooui.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var be = Object.defineProperty;
|
|
2
2
|
var ye = (i, t, e) => t in i ? be(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var r = (i, t, e) => (ye(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import { decode as
|
|
5
|
-
import { evaluateCondition as
|
|
4
|
+
import { decode as xe } from "html-entities";
|
|
5
|
+
import { evaluateCondition as pe } from "@gisce/conscheck";
|
|
6
6
|
import * as D from "txml";
|
|
7
7
|
import T from "moment";
|
|
8
8
|
const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), Fe = ({
|
|
@@ -41,7 +41,7 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), Fe
|
|
|
41
41
|
default:
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
44
|
-
}, m = (i) =>
|
|
44
|
+
}, m = (i) => xe(i, { level: "xml" }), X = ({
|
|
45
45
|
fieldName: i,
|
|
46
46
|
valueInObject: t,
|
|
47
47
|
expectedValue: e,
|
|
@@ -67,12 +67,12 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), Fe
|
|
|
67
67
|
fields: e,
|
|
68
68
|
widgetType: s
|
|
69
69
|
}) => {
|
|
70
|
-
const
|
|
70
|
+
const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = m(u), h = JSON.parse(_), d = {};
|
|
71
71
|
for (const g of Object.keys(h)) {
|
|
72
|
-
const
|
|
73
|
-
|
|
72
|
+
const x = h[g].map((y) => Fe({ entry: y, values: t, fields: e })).every((y) => y);
|
|
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), Fe
|
|
|
95
95
|
n.replace(/'/g, '"')
|
|
96
96
|
), l = {};
|
|
97
97
|
for (const o of Object.keys(a)) {
|
|
98
|
-
const
|
|
98
|
+
const u = pe({
|
|
99
99
|
object: t,
|
|
100
100
|
condition: a[o],
|
|
101
101
|
evaluateFieldComparison: ({
|
|
102
102
|
fieldName: _,
|
|
103
103
|
valueInObject: h,
|
|
104
|
-
expectedValue:
|
|
104
|
+
expectedValue: d
|
|
105
105
|
}) => X({
|
|
106
106
|
fieldName: _,
|
|
107
107
|
valueInObject: h,
|
|
108
|
-
expectedValue:
|
|
108
|
+
expectedValue: d,
|
|
109
109
|
fields: e
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
|
-
|
|
112
|
+
u ? l[o] = !0 : o === "readonly" && !u && s === "button" && (l[o] = !1);
|
|
113
113
|
}
|
|
114
114
|
return l;
|
|
115
115
|
} catch (n) {
|
|
@@ -157,7 +157,7 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), Fe
|
|
|
157
157
|
attrs: void 0,
|
|
158
158
|
json_attrs: void 0
|
|
159
159
|
};
|
|
160
|
-
},
|
|
160
|
+
}, k = (i) => i === 1 || i === "1" || i === !0 || i === "True" || i === "true", O = class O {
|
|
161
161
|
constructor(t) {
|
|
162
162
|
/**
|
|
163
163
|
* Determines if widget is read only (default is undefined)
|
|
@@ -194,13 +194,13 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), Fe
|
|
|
194
194
|
* Base type of the field
|
|
195
195
|
*/
|
|
196
196
|
r(this, "_fieldType", "");
|
|
197
|
-
this._colspan =
|
|
197
|
+
this._colspan = O._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = k(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
|
-
return
|
|
200
|
+
return O._defaultColspan;
|
|
201
201
|
}
|
|
202
202
|
static set defaultColspan(t) {
|
|
203
|
-
|
|
203
|
+
O._defaultColspan = t;
|
|
204
204
|
}
|
|
205
205
|
get readOnly() {
|
|
206
206
|
return this._readOnly;
|
|
@@ -266,8 +266,8 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), Fe
|
|
|
266
266
|
/**
|
|
267
267
|
* Default colspan
|
|
268
268
|
*/
|
|
269
|
-
r(
|
|
270
|
-
let C =
|
|
269
|
+
r(O, "_defaultColspan", 1);
|
|
270
|
+
let C = O;
|
|
271
271
|
class f extends C {
|
|
272
272
|
constructor(e) {
|
|
273
273
|
super(e);
|
|
@@ -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 = k(e.autorefresh)));
|
|
320
320
|
}
|
|
321
321
|
get id() {
|
|
322
322
|
return this._id;
|
|
@@ -459,7 +459,7 @@ class Z extends f {
|
|
|
459
459
|
}
|
|
460
460
|
get humanDate() {
|
|
461
461
|
var e;
|
|
462
|
-
return
|
|
462
|
+
return k(((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
|
|
574
|
+
const P = class P extends C {
|
|
575
575
|
constructor(e) {
|
|
576
576
|
super(e);
|
|
577
577
|
/**
|
|
@@ -594,7 +594,7 @@ const O = class O extends C {
|
|
|
594
594
|
r(this, "_label", "");
|
|
595
595
|
this._container = new V(
|
|
596
596
|
e == null ? void 0 : e.col,
|
|
597
|
-
|
|
597
|
+
P._defaultColspan,
|
|
598
598
|
this.readOnly,
|
|
599
599
|
e == null ? void 0 : e.key
|
|
600
600
|
), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label = m(e.string)));
|
|
@@ -606,10 +606,10 @@ const O = class O extends C {
|
|
|
606
606
|
this._id = e;
|
|
607
607
|
}
|
|
608
608
|
static get defaultColspan() {
|
|
609
|
-
return
|
|
609
|
+
return P._defaultColspan;
|
|
610
610
|
}
|
|
611
611
|
static set defaultColspan(e) {
|
|
612
|
-
|
|
612
|
+
P._defaultColspan = e;
|
|
613
613
|
}
|
|
614
614
|
get container() {
|
|
615
615
|
return this._container;
|
|
@@ -643,20 +643,20 @@ const O = class O extends C {
|
|
|
643
643
|
return e === this.id ? this : this.container.findById(e);
|
|
644
644
|
}
|
|
645
645
|
};
|
|
646
|
-
r(
|
|
647
|
-
let w =
|
|
648
|
-
const
|
|
646
|
+
r(P, "_defaultColspan", 6);
|
|
647
|
+
let w = P;
|
|
648
|
+
const W = class W extends w {
|
|
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 = W._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 W._defaultColspan;
|
|
657
657
|
}
|
|
658
658
|
static set defaultColspan(e) {
|
|
659
|
-
|
|
659
|
+
W._defaultColspan = e;
|
|
660
660
|
}
|
|
661
661
|
get tabPosition() {
|
|
662
662
|
return this._tabPosition;
|
|
@@ -668,9 +668,9 @@ const P = class P extends w {
|
|
|
668
668
|
return [].concat.apply([], this._container.rows);
|
|
669
669
|
}
|
|
670
670
|
};
|
|
671
|
-
r(
|
|
672
|
-
let M =
|
|
673
|
-
class
|
|
671
|
+
r(W, "_defaultColspan", 3);
|
|
672
|
+
let M = W;
|
|
673
|
+
class R extends w {
|
|
674
674
|
constructor(e) {
|
|
675
675
|
super(e);
|
|
676
676
|
r(this, "_loading", !1);
|
|
@@ -683,7 +683,7 @@ class L extends w {
|
|
|
683
683
|
this._loading = e;
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
|
-
class Oe extends
|
|
686
|
+
class Oe extends R {
|
|
687
687
|
constructor(e) {
|
|
688
688
|
super(e);
|
|
689
689
|
r(this, "_icon", null);
|
|
@@ -696,7 +696,7 @@ class Oe extends L {
|
|
|
696
696
|
this._icon = e;
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
|
-
class Pe extends
|
|
699
|
+
class Pe extends R {
|
|
700
700
|
constructor(e) {
|
|
701
701
|
var s;
|
|
702
702
|
super(e);
|
|
@@ -876,7 +876,7 @@ class A extends f {
|
|
|
876
876
|
this._translatable = e;
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
|
-
class
|
|
879
|
+
class L extends f {
|
|
880
880
|
constructor(e) {
|
|
881
881
|
super(e);
|
|
882
882
|
/**
|
|
@@ -991,7 +991,7 @@ class Te extends f {
|
|
|
991
991
|
return this.parsedWidgetProps.showMenu;
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
|
-
class ze extends
|
|
994
|
+
class ze extends L {
|
|
995
995
|
}
|
|
996
996
|
class te extends f {
|
|
997
997
|
constructor(t) {
|
|
@@ -1003,7 +1003,7 @@ class Se extends f {
|
|
|
1003
1003
|
super(t);
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
|
-
class
|
|
1006
|
+
class G extends f {
|
|
1007
1007
|
constructor(e) {
|
|
1008
1008
|
super(e);
|
|
1009
1009
|
/**
|
|
@@ -1036,11 +1036,11 @@ class R extends f {
|
|
|
1036
1036
|
this._decimalDigits = e;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
class Ie extends
|
|
1039
|
+
class Ie extends G {
|
|
1040
1040
|
}
|
|
1041
1041
|
class Ee extends f {
|
|
1042
1042
|
}
|
|
1043
|
-
class Ve extends
|
|
1043
|
+
class Ve extends G {
|
|
1044
1044
|
}
|
|
1045
1045
|
class Ye extends f {
|
|
1046
1046
|
constructor(t) {
|
|
@@ -1209,7 +1209,7 @@ class Be extends f {
|
|
|
1209
1209
|
super(t);
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
class
|
|
1212
|
+
class Re extends ie {
|
|
1213
1213
|
constructor(e) {
|
|
1214
1214
|
super(e);
|
|
1215
1215
|
/**
|
|
@@ -1241,7 +1241,7 @@ class Le extends ie {
|
|
|
1241
1241
|
return this.parsedWidgetProps.colorField;
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
class
|
|
1244
|
+
class Le extends z {
|
|
1245
1245
|
constructor(e) {
|
|
1246
1246
|
super(e);
|
|
1247
1247
|
r(this, "_nolabel", !0);
|
|
@@ -1258,12 +1258,16 @@ class Ge extends z {
|
|
|
1258
1258
|
*/
|
|
1259
1259
|
r(this, "_actionField");
|
|
1260
1260
|
r(this, "_height");
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1261
|
+
r(this, "_autoRefresh");
|
|
1262
|
+
if (this._card = !1, this._icon = "", this._suffix = "", this._autoRefresh = !1, this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = m(this._parsedWidgetProps.icon) || "", this._suffix = this._parsedWidgetProps.suffix || "", this._color = m(this._parsedWidgetProps.color) || ""), e) {
|
|
1263
|
+
if (e.action_id && (this._actionId = parseInt(e.action_id)), e.action_field && (this._actionField = e.action_field), e.height)
|
|
1264
|
+
try {
|
|
1265
|
+
this._height = parseInt(e.height);
|
|
1266
|
+
} catch (s) {
|
|
1267
|
+
console.error(s);
|
|
1268
|
+
}
|
|
1269
|
+
this._autoRefresh = k(e.autorefresh);
|
|
1270
|
+
}
|
|
1267
1271
|
}
|
|
1268
1272
|
get card() {
|
|
1269
1273
|
return this._card;
|
|
@@ -1304,6 +1308,12 @@ class Ge extends z {
|
|
|
1304
1308
|
set height(e) {
|
|
1305
1309
|
this._height = e;
|
|
1306
1310
|
}
|
|
1311
|
+
get autoRefresh() {
|
|
1312
|
+
return this._autoRefresh;
|
|
1313
|
+
}
|
|
1314
|
+
set autoRefresh(e) {
|
|
1315
|
+
this._autoRefresh = e;
|
|
1316
|
+
}
|
|
1307
1317
|
}
|
|
1308
1318
|
class se extends f {
|
|
1309
1319
|
constructor(e) {
|
|
@@ -1358,7 +1368,7 @@ class se extends f {
|
|
|
1358
1368
|
this._columns = e;
|
|
1359
1369
|
}
|
|
1360
1370
|
}
|
|
1361
|
-
class
|
|
1371
|
+
class Ge extends se {
|
|
1362
1372
|
}
|
|
1363
1373
|
class $e extends z {
|
|
1364
1374
|
get colors() {
|
|
@@ -1417,7 +1427,7 @@ class He extends f {
|
|
|
1417
1427
|
this._lastStep = e;
|
|
1418
1428
|
}
|
|
1419
1429
|
}
|
|
1420
|
-
class re extends
|
|
1430
|
+
class re extends L {
|
|
1421
1431
|
constructor(e) {
|
|
1422
1432
|
super(e);
|
|
1423
1433
|
r(this, "_lang", null);
|
|
@@ -1524,7 +1534,7 @@ class Ze extends w {
|
|
|
1524
1534
|
constructor(e) {
|
|
1525
1535
|
super(e);
|
|
1526
1536
|
r(this, "_autoPlay", !0);
|
|
1527
|
-
e && "auto_play" in e && (this._autoPlay =
|
|
1537
|
+
e && "auto_play" in e && (this._autoPlay = k(e.auto_play));
|
|
1528
1538
|
}
|
|
1529
1539
|
get autoPlay() {
|
|
1530
1540
|
return this._autoPlay;
|
|
@@ -1566,7 +1576,7 @@ class $ {
|
|
|
1566
1576
|
this._widgetClass = A;
|
|
1567
1577
|
break;
|
|
1568
1578
|
case "text":
|
|
1569
|
-
this._widgetClass =
|
|
1579
|
+
this._widgetClass = L;
|
|
1570
1580
|
break;
|
|
1571
1581
|
case "button":
|
|
1572
1582
|
this._widgetClass = ee;
|
|
@@ -1587,7 +1597,7 @@ class $ {
|
|
|
1587
1597
|
this._widgetClass = Se;
|
|
1588
1598
|
break;
|
|
1589
1599
|
case "float":
|
|
1590
|
-
this._widgetClass =
|
|
1600
|
+
this._widgetClass = G;
|
|
1591
1601
|
break;
|
|
1592
1602
|
case "float_time":
|
|
1593
1603
|
this._widgetClass = Ie;
|
|
@@ -1634,13 +1644,13 @@ class $ {
|
|
|
1634
1644
|
this._widgetClass = Be;
|
|
1635
1645
|
break;
|
|
1636
1646
|
case "timeline":
|
|
1637
|
-
this._widgetClass =
|
|
1647
|
+
this._widgetClass = Re;
|
|
1638
1648
|
break;
|
|
1639
1649
|
case "indicator":
|
|
1640
|
-
this._widgetClass =
|
|
1650
|
+
this._widgetClass = Le;
|
|
1641
1651
|
break;
|
|
1642
1652
|
case "tags":
|
|
1643
|
-
this._widgetClass =
|
|
1653
|
+
this._widgetClass = Ge;
|
|
1644
1654
|
break;
|
|
1645
1655
|
case "tag":
|
|
1646
1656
|
this._widgetClass = $e;
|
|
@@ -1682,7 +1692,7 @@ class $ {
|
|
|
1682
1692
|
this._widgetClass = H;
|
|
1683
1693
|
break;
|
|
1684
1694
|
case "spinner":
|
|
1685
|
-
this._widgetClass =
|
|
1695
|
+
this._widgetClass = R;
|
|
1686
1696
|
break;
|
|
1687
1697
|
case "carousel":
|
|
1688
1698
|
this._widgetClass = Ze;
|
|
@@ -1725,15 +1735,15 @@ const tt = ({
|
|
|
1725
1735
|
const n = {}, a = {};
|
|
1726
1736
|
for (const o of Object.keys(s))
|
|
1727
1737
|
if (t.state === o) {
|
|
1728
|
-
const
|
|
1729
|
-
for (const _ of
|
|
1730
|
-
const [h,
|
|
1731
|
-
a[h] || (a[h] = []), a[h].push(
|
|
1738
|
+
const u = s[o];
|
|
1739
|
+
for (const _ of u) {
|
|
1740
|
+
const [h, d] = _;
|
|
1741
|
+
a[h] || (a[h] = []), a[h].push(d);
|
|
1732
1742
|
}
|
|
1733
1743
|
}
|
|
1734
1744
|
for (const o of Object.keys(a)) {
|
|
1735
|
-
const
|
|
1736
|
-
n[o] =
|
|
1745
|
+
const u = a[o];
|
|
1746
|
+
n[o] = u.some((_) => _);
|
|
1737
1747
|
}
|
|
1738
1748
|
return n;
|
|
1739
1749
|
}, it = ({
|
|
@@ -1769,16 +1779,16 @@ const ne = ({
|
|
|
1769
1779
|
return s;
|
|
1770
1780
|
if (i.trim().length === 0)
|
|
1771
1781
|
return;
|
|
1772
|
-
const
|
|
1773
|
-
return
|
|
1782
|
+
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 = {};
|
|
1783
|
+
return d.forEach((c) => {
|
|
1774
1784
|
const b = c[1];
|
|
1775
1785
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1776
|
-
const
|
|
1786
|
+
const x = st({
|
|
1777
1787
|
values: t,
|
|
1778
1788
|
fields: e,
|
|
1779
1789
|
fieldName: b === "active_id" ? "id" : b
|
|
1780
1790
|
});
|
|
1781
|
-
g[c[0].replace(/'/g, "")] =
|
|
1791
|
+
g[c[0].replace(/'/g, "")] = x || void 0;
|
|
1782
1792
|
} else
|
|
1783
1793
|
c[1] === "true" ? g[c[0].replace(/'/g, "")] = !0 : c[1] === "false" ? g[c[0].replace(/'/g, "")] = !1 : g[c[0].replace(/'/g, "")] = c[1].replace(
|
|
1784
1794
|
/'/g,
|
|
@@ -1791,8 +1801,8 @@ const ne = ({
|
|
|
1791
1801
|
}, Wt = (i) => {
|
|
1792
1802
|
const t = [];
|
|
1793
1803
|
try {
|
|
1794
|
-
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((
|
|
1795
|
-
!
|
|
1804
|
+
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) => {
|
|
1805
|
+
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1796
1806
|
}), t);
|
|
1797
1807
|
} catch {
|
|
1798
1808
|
}
|
|
@@ -1937,17 +1947,17 @@ class Tt {
|
|
|
1937
1947
|
}
|
|
1938
1948
|
parse(t, e) {
|
|
1939
1949
|
var o;
|
|
1940
|
-
const { values: s = {}, readOnly: n = !1 } = e || {}, a = D.parse(t).filter((
|
|
1950
|
+
const { values: s = {}, readOnly: n = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
|
|
1941
1951
|
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({
|
|
1942
1952
|
fields: a.children,
|
|
1943
1953
|
container: this._container,
|
|
1944
1954
|
values: s
|
|
1945
1955
|
});
|
|
1946
1956
|
const l = nt(this._container._rows);
|
|
1947
|
-
l.forEach((
|
|
1948
|
-
const _ =
|
|
1949
|
-
_._id && _._context && (this._contextForFields[_._id] =
|
|
1950
|
-
}), this._autorefreshableFields = l.filter((
|
|
1957
|
+
l.forEach((u) => {
|
|
1958
|
+
const _ = u;
|
|
1959
|
+
_._id && _._context && (this._contextForFields[_._id] = u._context);
|
|
1960
|
+
}), this._autorefreshableFields = l.filter((u) => u instanceof f && u.autoRefresh).map((u) => u._id);
|
|
1951
1961
|
}
|
|
1952
1962
|
parseNode({
|
|
1953
1963
|
fields: t,
|
|
@@ -1957,29 +1967,29 @@ class Tt {
|
|
|
1957
1967
|
const n = new $();
|
|
1958
1968
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
1959
1969
|
var F, v;
|
|
1960
|
-
const { tagName: l, attributes: o, children:
|
|
1970
|
+
const { tagName: l, attributes: o, children: u } = a;
|
|
1961
1971
|
let _ = l, h = o;
|
|
1962
1972
|
if (l === "field") {
|
|
1963
|
-
const { name:
|
|
1973
|
+
const { name: p, widget: S } = o;
|
|
1964
1974
|
if (S)
|
|
1965
1975
|
_ = S;
|
|
1966
|
-
else if (
|
|
1967
|
-
if (!this._fields[
|
|
1976
|
+
else if (p) {
|
|
1977
|
+
if (!this._fields[p])
|
|
1968
1978
|
throw new Error(
|
|
1969
|
-
`Field ${
|
|
1979
|
+
`Field ${p} doesn't exist in fields defintion`
|
|
1970
1980
|
);
|
|
1971
|
-
_ = this._fields[
|
|
1981
|
+
_ = this._fields[p].type, o.widget_props = {
|
|
1972
1982
|
...U(o.widget_props),
|
|
1973
|
-
...this._fields[
|
|
1983
|
+
...this._fields[p].widget_props || {}
|
|
1974
1984
|
};
|
|
1975
1985
|
}
|
|
1976
1986
|
h = {
|
|
1977
|
-
...this._fields[
|
|
1987
|
+
...this._fields[p],
|
|
1978
1988
|
...o,
|
|
1979
|
-
fieldsWidgetType: this._fields[
|
|
1989
|
+
fieldsWidgetType: this._fields[p].type
|
|
1980
1990
|
};
|
|
1981
1991
|
}
|
|
1982
|
-
const
|
|
1992
|
+
const d = Ce({
|
|
1983
1993
|
tagAttributes: h,
|
|
1984
1994
|
values: s,
|
|
1985
1995
|
fields: this._fields,
|
|
@@ -2004,17 +2014,17 @@ class Tt {
|
|
|
2004
2014
|
));
|
|
2005
2015
|
let b;
|
|
2006
2016
|
Q(h.domain) ? b = h.domain : Q((v = this._fields[h.name]) == null ? void 0 : v.domain) && (b = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
2007
|
-
const
|
|
2008
|
-
...
|
|
2017
|
+
const x = {
|
|
2018
|
+
...d,
|
|
2009
2019
|
...g,
|
|
2010
2020
|
context: c,
|
|
2011
2021
|
domain: b,
|
|
2012
2022
|
key: `${this._keyIdx}`
|
|
2013
2023
|
};
|
|
2014
|
-
e.readOnly && (
|
|
2015
|
-
const y = n.createWidget(_,
|
|
2016
|
-
y.invisible && y instanceof f && this._invisibleFields.push(
|
|
2017
|
-
fields:
|
|
2024
|
+
e.readOnly && (x.readonly = !0);
|
|
2025
|
+
const y = n.createWidget(_, x);
|
|
2026
|
+
y.invisible && y instanceof f && this._invisibleFields.push(x.name), y instanceof w && this.parseNode({
|
|
2027
|
+
fields: u,
|
|
2018
2028
|
container: y.container,
|
|
2019
2029
|
values: s
|
|
2020
2030
|
}), y instanceof ee && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
@@ -2110,30 +2120,30 @@ class zt {
|
|
|
2110
2120
|
const { tagName: a, attributes: l } = n;
|
|
2111
2121
|
let o = null;
|
|
2112
2122
|
if (a === "field") {
|
|
2113
|
-
const { name:
|
|
2123
|
+
const { name: u, widget: _ } = l;
|
|
2114
2124
|
let h = l;
|
|
2115
|
-
if (
|
|
2116
|
-
if (!this._fields[
|
|
2117
|
-
throw new Error(`Field ${
|
|
2118
|
-
const
|
|
2119
|
-
o =
|
|
2125
|
+
if (u) {
|
|
2126
|
+
if (!this._fields[u])
|
|
2127
|
+
throw new Error(`Field ${u} doesn't exist in fields defintion`);
|
|
2128
|
+
const d = this._fields[u];
|
|
2129
|
+
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;
|
|
2120
2130
|
const g = ne({
|
|
2121
|
-
context: l.context ||
|
|
2131
|
+
context: l.context || d.context,
|
|
2122
2132
|
values: {},
|
|
2123
2133
|
fields: this._fields
|
|
2124
2134
|
});
|
|
2125
2135
|
h = {
|
|
2126
|
-
...
|
|
2136
|
+
...d,
|
|
2127
2137
|
...l,
|
|
2128
|
-
fieldsWidgetType:
|
|
2138
|
+
fieldsWidgetType: d == null ? void 0 : d.type,
|
|
2129
2139
|
context: g
|
|
2130
|
-
}, this._contextForFields[
|
|
2140
|
+
}, this._contextForFields[u] = g;
|
|
2131
2141
|
}
|
|
2132
2142
|
if (_ && (o = _), !h.invisible) {
|
|
2133
|
-
const
|
|
2134
|
-
this._columns.push(
|
|
2143
|
+
const d = s.createWidget(o, h);
|
|
2144
|
+
this._columns.push(d);
|
|
2135
2145
|
}
|
|
2136
|
-
|
|
2146
|
+
k(h.autorefresh) && this._autorefreshableFields.push(u);
|
|
2137
2147
|
}
|
|
2138
2148
|
});
|
|
2139
2149
|
}
|
|
@@ -2226,11 +2236,11 @@ const It = ({
|
|
|
2226
2236
|
if (!Array.isArray(s))
|
|
2227
2237
|
return;
|
|
2228
2238
|
const [n, a, l] = s;
|
|
2229
|
-
let o,
|
|
2230
|
-
n.indexOf(".") !== -1 ? (o = n.substr(0, n.indexOf(".")),
|
|
2239
|
+
let o, u;
|
|
2240
|
+
n.indexOf(".") !== -1 ? (o = n.substr(0, n.indexOf(".")), u = n.substr(
|
|
2231
2241
|
n.indexOf(".") + 1,
|
|
2232
2242
|
n.length - 1
|
|
2233
|
-
)) : (o = n,
|
|
2243
|
+
)) : (o = n, u = "id"), o === t && e.push([u, a, l]);
|
|
2234
2244
|
}), e;
|
|
2235
2245
|
}, Et = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2236
2246
|
class lt {
|
|
@@ -2300,7 +2310,7 @@ class ce extends oe {
|
|
|
2300
2310
|
r(this, "_totalDomain", null);
|
|
2301
2311
|
r(this, "_showPercent", !1);
|
|
2302
2312
|
r(this, "_suffix", null);
|
|
2303
|
-
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 =
|
|
2313
|
+
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 = k(s.attributes.showPercent);
|
|
2304
2314
|
}
|
|
2305
2315
|
get color() {
|
|
2306
2316
|
return this._color;
|
|
@@ -2343,7 +2353,7 @@ const ct = (i) => {
|
|
|
2343
2353
|
let e;
|
|
2344
2354
|
if (i.forEach((s) => {
|
|
2345
2355
|
if (s.tagName === "field") {
|
|
2346
|
-
const n = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0,
|
|
2356
|
+
const n = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, u = s.attributes.stacked || void 0;
|
|
2347
2357
|
if (!n)
|
|
2348
2358
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2349
2359
|
if (!l)
|
|
@@ -2351,11 +2361,11 @@ const ct = (i) => {
|
|
|
2351
2361
|
n === "x" ? e = new ht({
|
|
2352
2362
|
name: l
|
|
2353
2363
|
}) : n === "y" && t.push(
|
|
2354
|
-
new
|
|
2364
|
+
new dt({
|
|
2355
2365
|
name: l,
|
|
2356
2366
|
operator: a,
|
|
2357
2367
|
label: o,
|
|
2358
|
-
stacked:
|
|
2368
|
+
stacked: u
|
|
2359
2369
|
})
|
|
2360
2370
|
);
|
|
2361
2371
|
}
|
|
@@ -2384,7 +2394,7 @@ class j extends oe {
|
|
|
2384
2394
|
return this._y;
|
|
2385
2395
|
}
|
|
2386
2396
|
}
|
|
2387
|
-
const
|
|
2397
|
+
const ut = {
|
|
2388
2398
|
indicator: ce,
|
|
2389
2399
|
indicatorField: ot,
|
|
2390
2400
|
line: j,
|
|
@@ -2394,12 +2404,12 @@ const dt = {
|
|
|
2394
2404
|
const t = D.parse(i).filter((n) => n.tagName === "graph")[0], e = t.attributes.type;
|
|
2395
2405
|
if (!e)
|
|
2396
2406
|
throw new Error(`${e} is not a valid graph`);
|
|
2397
|
-
const s =
|
|
2407
|
+
const s = ut[e];
|
|
2398
2408
|
if (!s)
|
|
2399
2409
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2400
2410
|
return new s(e, t);
|
|
2401
2411
|
};
|
|
2402
|
-
class
|
|
2412
|
+
class ue {
|
|
2403
2413
|
constructor({ name: t, axis: e }) {
|
|
2404
2414
|
r(this, "_name");
|
|
2405
2415
|
r(this, "_axis");
|
|
@@ -2412,7 +2422,7 @@ class de {
|
|
|
2412
2422
|
return this._axis;
|
|
2413
2423
|
}
|
|
2414
2424
|
}
|
|
2415
|
-
class
|
|
2425
|
+
class dt extends ue {
|
|
2416
2426
|
constructor({
|
|
2417
2427
|
name: e,
|
|
2418
2428
|
operator: s,
|
|
@@ -2435,7 +2445,7 @@ class ut extends de {
|
|
|
2435
2445
|
return this._stacked;
|
|
2436
2446
|
}
|
|
2437
2447
|
}
|
|
2438
|
-
class ht extends
|
|
2448
|
+
class ht extends ue {
|
|
2439
2449
|
constructor({ name: t }) {
|
|
2440
2450
|
super({ name: t, axis: "x" });
|
|
2441
2451
|
}
|
|
@@ -2493,15 +2503,15 @@ function gt({
|
|
|
2493
2503
|
groupBy: "type-stacked"
|
|
2494
2504
|
}), a = `${t}s`;
|
|
2495
2505
|
return Object.keys(n).forEach((o) => {
|
|
2496
|
-
const
|
|
2497
|
-
for (let _ = 0; _ <
|
|
2498
|
-
const h =
|
|
2499
|
-
if (s.push(h), _ ===
|
|
2506
|
+
const u = n[o];
|
|
2507
|
+
for (let _ = 0; _ < u.length; _++) {
|
|
2508
|
+
const h = u[_];
|
|
2509
|
+
if (s.push(h), _ === u.length - 1)
|
|
2500
2510
|
return;
|
|
2501
|
-
const
|
|
2502
|
-
if (!
|
|
2511
|
+
const d = h.x, g = u[_ + 1].x;
|
|
2512
|
+
if (!de([d, g], a)) {
|
|
2503
2513
|
const c = mt({
|
|
2504
|
-
dates: [
|
|
2514
|
+
dates: [d, g],
|
|
2505
2515
|
timerange: t,
|
|
2506
2516
|
interval: e
|
|
2507
2517
|
});
|
|
@@ -2515,7 +2525,7 @@ function gt({
|
|
|
2515
2525
|
);
|
|
2516
2526
|
}
|
|
2517
2527
|
}
|
|
2518
|
-
}), s.sort((o,
|
|
2528
|
+
}), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
|
|
2519
2529
|
}
|
|
2520
2530
|
function mt({
|
|
2521
2531
|
dates: i,
|
|
@@ -2527,12 +2537,12 @@ function mt({
|
|
|
2527
2537
|
return i;
|
|
2528
2538
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2529
2539
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2530
|
-
const o = a[l],
|
|
2531
|
-
if (!
|
|
2540
|
+
const o = a[l], u = a[l + 1];
|
|
2541
|
+
if (!de([o, u], n)) {
|
|
2532
2542
|
const _ = T(o, E(n)).add(
|
|
2533
2543
|
e,
|
|
2534
2544
|
n
|
|
2535
|
-
), h = T(
|
|
2545
|
+
), h = T(u, E(n));
|
|
2536
2546
|
for (; _.isBefore(h); )
|
|
2537
2547
|
s.push(_.format(E(n))), _.add(e, n);
|
|
2538
2548
|
}
|
|
@@ -2551,13 +2561,13 @@ function bt({
|
|
|
2551
2561
|
groupBy: "all"
|
|
2552
2562
|
});
|
|
2553
2563
|
return Object.keys(n).forEach((a) => {
|
|
2554
|
-
const l = n[a], o = l[0].operator === "count" ? "+" : l[0].operator,
|
|
2564
|
+
const l = n[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
|
|
2555
2565
|
values: l.map((_) => _.value),
|
|
2556
2566
|
operator: o
|
|
2557
2567
|
});
|
|
2558
2568
|
s.push({
|
|
2559
2569
|
...l[0],
|
|
2560
|
-
value:
|
|
2570
|
+
value: u
|
|
2561
2571
|
});
|
|
2562
2572
|
}), s;
|
|
2563
2573
|
}
|
|
@@ -2567,17 +2577,17 @@ function yt({
|
|
|
2567
2577
|
}) {
|
|
2568
2578
|
return i.map((e) => ({
|
|
2569
2579
|
...e,
|
|
2570
|
-
x:
|
|
2580
|
+
x: xt({
|
|
2571
2581
|
date: e.x,
|
|
2572
2582
|
timerange: t
|
|
2573
2583
|
})
|
|
2574
2584
|
}));
|
|
2575
2585
|
}
|
|
2576
|
-
function
|
|
2586
|
+
function xt({
|
|
2577
2587
|
date: i,
|
|
2578
2588
|
timerange: t
|
|
2579
2589
|
}) {
|
|
2580
|
-
let e =
|
|
2590
|
+
let e = pt(i);
|
|
2581
2591
|
const s = T(i, e);
|
|
2582
2592
|
switch (t) {
|
|
2583
2593
|
case "hour": {
|
|
@@ -2603,10 +2613,10 @@ function pt({
|
|
|
2603
2613
|
}
|
|
2604
2614
|
return s.format(e);
|
|
2605
2615
|
}
|
|
2606
|
-
function
|
|
2616
|
+
function pt(i) {
|
|
2607
2617
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2608
2618
|
}
|
|
2609
|
-
function
|
|
2619
|
+
function de(i, t) {
|
|
2610
2620
|
let e = !1;
|
|
2611
2621
|
const s = E(t);
|
|
2612
2622
|
if (i.length === 0)
|
|
@@ -2665,7 +2675,7 @@ const wt = {
|
|
|
2665
2675
|
}), a = [];
|
|
2666
2676
|
i.y.forEach((c) => {
|
|
2667
2677
|
Object.keys(n).forEach((b) => {
|
|
2668
|
-
const
|
|
2678
|
+
const x = n[b].label, y = n[b].entries;
|
|
2669
2679
|
if (c.label) {
|
|
2670
2680
|
const F = B({
|
|
2671
2681
|
fieldName: c.label,
|
|
@@ -2673,8 +2683,8 @@ const wt = {
|
|
|
2673
2683
|
fields: e
|
|
2674
2684
|
});
|
|
2675
2685
|
Object.keys(F).forEach((v) => {
|
|
2676
|
-
const
|
|
2677
|
-
entries:
|
|
2686
|
+
const p = F[v].entries, S = F[v].label, ge = N({
|
|
2687
|
+
entries: p,
|
|
2678
2688
|
fields: e,
|
|
2679
2689
|
fieldName: c.name
|
|
2680
2690
|
}), me = Y({
|
|
@@ -2682,7 +2692,7 @@ const wt = {
|
|
|
2682
2692
|
operator: c.operator
|
|
2683
2693
|
});
|
|
2684
2694
|
a.push({
|
|
2685
|
-
x:
|
|
2695
|
+
x: x || !1,
|
|
2686
2696
|
value: me,
|
|
2687
2697
|
type: S,
|
|
2688
2698
|
operator: c.operator,
|
|
@@ -2699,7 +2709,7 @@ const wt = {
|
|
|
2699
2709
|
operator: c.operator
|
|
2700
2710
|
});
|
|
2701
2711
|
a.push({
|
|
2702
|
-
x:
|
|
2712
|
+
x: x || !1,
|
|
2703
2713
|
value: v,
|
|
2704
2714
|
type: _e({
|
|
2705
2715
|
yAxis: c,
|
|
@@ -2718,21 +2728,21 @@ const wt = {
|
|
|
2718
2728
|
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(
|
|
2719
2729
|
(c) => c.x !== !1
|
|
2720
2730
|
));
|
|
2721
|
-
let
|
|
2722
|
-
i.timerange ?
|
|
2723
|
-
values:
|
|
2731
|
+
let d = h;
|
|
2732
|
+
i.timerange ? d = ft({
|
|
2733
|
+
values: d,
|
|
2724
2734
|
timerange: i.timerange,
|
|
2725
2735
|
interval: i.interval
|
|
2726
|
-
}) : i.type == "pie" && (
|
|
2736
|
+
}) : i.type == "pie" && (d = h.sort((c, b) => b.value - c.value));
|
|
2727
2737
|
const g = {
|
|
2728
|
-
data:
|
|
2738
|
+
data: d,
|
|
2729
2739
|
isGroup: o || l,
|
|
2730
2740
|
isStack: o
|
|
2731
2741
|
};
|
|
2732
2742
|
if (i.type === "line" && i.y_range && (g.yAxisOpts = {
|
|
2733
2743
|
mode: i.y_range
|
|
2734
2744
|
}, i.y_range === "auto")) {
|
|
2735
|
-
const { min: c, max: b } = fe(
|
|
2745
|
+
const { min: c, max: b } = fe(d);
|
|
2736
2746
|
g.yAxisOpts.valueOpts = { min: c, max: b };
|
|
2737
2747
|
}
|
|
2738
2748
|
return g;
|
|
@@ -2855,20 +2865,20 @@ export {
|
|
|
2855
2865
|
De as DateTime,
|
|
2856
2866
|
Ke as Email,
|
|
2857
2867
|
f as Field,
|
|
2858
|
-
|
|
2868
|
+
G as Float,
|
|
2859
2869
|
Ie as FloatTime,
|
|
2860
2870
|
Tt as Form,
|
|
2861
2871
|
oe as Graph,
|
|
2862
|
-
|
|
2872
|
+
ue as GraphAxis,
|
|
2863
2873
|
j as GraphChart,
|
|
2864
2874
|
ce as GraphIndicator,
|
|
2865
2875
|
ot as GraphIndicatorField,
|
|
2866
2876
|
ht as GraphXAxis,
|
|
2867
|
-
|
|
2877
|
+
dt as GraphYAxis,
|
|
2868
2878
|
Pe as Group,
|
|
2869
2879
|
Ee as HTMLPreview,
|
|
2870
2880
|
Ne as Image,
|
|
2871
|
-
|
|
2881
|
+
Le as Indicator,
|
|
2872
2882
|
Se as Integer,
|
|
2873
2883
|
H as JSONField,
|
|
2874
2884
|
Z as Label,
|
|
@@ -2886,14 +2896,14 @@ export {
|
|
|
2886
2896
|
St as SearchFilter,
|
|
2887
2897
|
z as Selection,
|
|
2888
2898
|
je as Separator,
|
|
2889
|
-
|
|
2899
|
+
R as Spinner,
|
|
2890
2900
|
He as Steps,
|
|
2891
2901
|
Je as Switch,
|
|
2892
2902
|
$e as Tag,
|
|
2893
|
-
|
|
2894
|
-
|
|
2903
|
+
Ge as Tags,
|
|
2904
|
+
L as Text,
|
|
2895
2905
|
Qe as Time,
|
|
2896
|
-
|
|
2906
|
+
Re as Timeline,
|
|
2897
2907
|
zt as Tree,
|
|
2898
2908
|
C as Widget,
|
|
2899
2909
|
Dt as graphFieldUtils,
|