@gisce/ooui 2.41.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/ooui.es.js +139 -131
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Graph/GraphIndicator.ts +15 -0
- package/src/spec/Graph.spec.ts +60 -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) {
|
|
@@ -942,7 +942,7 @@ class L extends f {
|
|
|
942
942
|
this._translatable = e;
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
class
|
|
945
|
+
class z extends f {
|
|
946
946
|
constructor(e) {
|
|
947
947
|
super(e);
|
|
948
948
|
/**
|
|
@@ -958,7 +958,7 @@ class T extends f {
|
|
|
958
958
|
this._size = e;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
|
-
class
|
|
961
|
+
class ze extends f {
|
|
962
962
|
constructor(e) {
|
|
963
963
|
super(e);
|
|
964
964
|
/**
|
|
@@ -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
|
/**
|
|
@@ -1182,7 +1182,7 @@ class Me extends C {
|
|
|
1182
1182
|
return null;
|
|
1183
1183
|
}
|
|
1184
1184
|
}
|
|
1185
|
-
class Ne extends
|
|
1185
|
+
class Ne extends z {
|
|
1186
1186
|
}
|
|
1187
1187
|
class Ae extends f {
|
|
1188
1188
|
constructor(e) {
|
|
@@ -1306,7 +1306,7 @@ class Ge extends ie {
|
|
|
1306
1306
|
return this.parsedWidgetProps.colorField;
|
|
1307
1307
|
}
|
|
1308
1308
|
}
|
|
1309
|
-
class $e extends
|
|
1309
|
+
class $e extends z {
|
|
1310
1310
|
constructor(e) {
|
|
1311
1311
|
super(e);
|
|
1312
1312
|
r(this, "_nolabel", !0);
|
|
@@ -1331,7 +1331,7 @@ class $e extends T {
|
|
|
1331
1331
|
} catch (s) {
|
|
1332
1332
|
console.error(s);
|
|
1333
1333
|
}
|
|
1334
|
-
this._autoRefresh =
|
|
1334
|
+
this._autoRefresh = w(e.autorefresh);
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
1337
|
get card() {
|
|
@@ -1435,7 +1435,7 @@ class se extends f {
|
|
|
1435
1435
|
}
|
|
1436
1436
|
class qe extends se {
|
|
1437
1437
|
}
|
|
1438
|
-
class Je extends
|
|
1438
|
+
class Je extends z {
|
|
1439
1439
|
get colors() {
|
|
1440
1440
|
return this._parsedWidgetProps.colors || {};
|
|
1441
1441
|
}
|
|
@@ -1444,7 +1444,7 @@ class Je extends T {
|
|
|
1444
1444
|
return ((t = this._parsedWidgetProps) == null ? void 0 : t.colorField) || null;
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
|
-
class He extends
|
|
1447
|
+
class He extends z {
|
|
1448
1448
|
constructor(e) {
|
|
1449
1449
|
super(e);
|
|
1450
1450
|
/**
|
|
@@ -1510,7 +1510,7 @@ class Ue extends f {
|
|
|
1510
1510
|
super(t);
|
|
1511
1511
|
}
|
|
1512
1512
|
}
|
|
1513
|
-
class Ke extends
|
|
1513
|
+
class Ke extends v {
|
|
1514
1514
|
constructor(e) {
|
|
1515
1515
|
super(e);
|
|
1516
1516
|
/**
|
|
@@ -1595,11 +1595,11 @@ class et extends f {
|
|
|
1595
1595
|
this._size = e;
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
|
-
class tt extends
|
|
1598
|
+
class tt extends v {
|
|
1599
1599
|
constructor(e) {
|
|
1600
1600
|
super(e);
|
|
1601
1601
|
r(this, "_autoPlay", !0);
|
|
1602
|
-
e && "auto_play" in e && (this._autoPlay =
|
|
1602
|
+
e && "auto_play" in e && (this._autoPlay = w(e.auto_play));
|
|
1603
1603
|
}
|
|
1604
1604
|
get autoPlay() {
|
|
1605
1605
|
return this._autoPlay;
|
|
@@ -1697,16 +1697,16 @@ class $ {
|
|
|
1697
1697
|
this._widgetClass = ee;
|
|
1698
1698
|
break;
|
|
1699
1699
|
case "buttonGroup":
|
|
1700
|
-
this._widgetClass =
|
|
1700
|
+
this._widgetClass = Te;
|
|
1701
1701
|
break;
|
|
1702
1702
|
case "action_buttons":
|
|
1703
|
-
this._widgetClass =
|
|
1703
|
+
this._widgetClass = We;
|
|
1704
1704
|
break;
|
|
1705
1705
|
case "selection":
|
|
1706
|
-
this._widgetClass =
|
|
1706
|
+
this._widgetClass = z;
|
|
1707
1707
|
break;
|
|
1708
1708
|
case "many2one":
|
|
1709
|
-
this._widgetClass =
|
|
1709
|
+
this._widgetClass = ze;
|
|
1710
1710
|
break;
|
|
1711
1711
|
case "boolean":
|
|
1712
1712
|
this._widgetClass = te;
|
|
@@ -1829,7 +1829,7 @@ class $ {
|
|
|
1829
1829
|
createWidget(t, e) {
|
|
1830
1830
|
this._widgetClass = void 0;
|
|
1831
1831
|
let s = t;
|
|
1832
|
-
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) {
|
|
1833
1833
|
case "notebook":
|
|
1834
1834
|
case "page":
|
|
1835
1835
|
case "group":
|
|
@@ -1860,15 +1860,15 @@ const nt = ({
|
|
|
1860
1860
|
const n = {}, a = {};
|
|
1861
1861
|
for (const o of Object.keys(s))
|
|
1862
1862
|
if (t.state === o) {
|
|
1863
|
-
const
|
|
1864
|
-
for (const _ of
|
|
1865
|
-
const [u,
|
|
1866
|
-
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);
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
1869
|
for (const o of Object.keys(a)) {
|
|
1870
|
-
const
|
|
1871
|
-
n[o] =
|
|
1870
|
+
const h = a[o];
|
|
1871
|
+
n[o] = h.some((_) => _);
|
|
1872
1872
|
}
|
|
1873
1873
|
return n;
|
|
1874
1874
|
}, at = ({
|
|
@@ -1904,8 +1904,8 @@ const ne = ({
|
|
|
1904
1904
|
return s;
|
|
1905
1905
|
if (i.trim().length === 0)
|
|
1906
1906
|
return;
|
|
1907
|
-
const
|
|
1908
|
-
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) => {
|
|
1909
1909
|
const b = c[1];
|
|
1910
1910
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1911
1911
|
const x = lt({
|
|
@@ -1926,8 +1926,8 @@ const ne = ({
|
|
|
1926
1926
|
}, St = (i) => {
|
|
1927
1927
|
const t = [];
|
|
1928
1928
|
try {
|
|
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((
|
|
1930
|
-
!
|
|
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, ""));
|
|
1931
1931
|
}), t);
|
|
1932
1932
|
} catch {
|
|
1933
1933
|
}
|
|
@@ -1955,7 +1955,7 @@ function ct(i) {
|
|
|
1955
1955
|
function e(s) {
|
|
1956
1956
|
const n = [];
|
|
1957
1957
|
for (const a of s)
|
|
1958
|
-
a instanceof
|
|
1958
|
+
a instanceof v ? e(a._container.rows.flat()) : n.push(a);
|
|
1959
1959
|
n.length > 0 && t.push(n);
|
|
1960
1960
|
}
|
|
1961
1961
|
for (const s of i)
|
|
@@ -2072,17 +2072,17 @@ class Et {
|
|
|
2072
2072
|
}
|
|
2073
2073
|
parse(t, e) {
|
|
2074
2074
|
var o;
|
|
2075
|
-
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];
|
|
2076
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({
|
|
2077
2077
|
fields: a.children,
|
|
2078
2078
|
container: this._container,
|
|
2079
2079
|
values: s
|
|
2080
2080
|
});
|
|
2081
2081
|
const l = ct(this._container._rows);
|
|
2082
|
-
l.forEach((
|
|
2083
|
-
const _ =
|
|
2084
|
-
_._id && _._context && (this._contextForFields[_._id] =
|
|
2085
|
-
}), this._autorefreshableFields = l.filter((
|
|
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);
|
|
2086
2086
|
}
|
|
2087
2087
|
parseNode({
|
|
2088
2088
|
fields: t,
|
|
@@ -2091,8 +2091,8 @@ class Et {
|
|
|
2091
2091
|
}) {
|
|
2092
2092
|
const n = new $();
|
|
2093
2093
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
2094
|
-
var
|
|
2095
|
-
const { tagName: l, attributes: o, children:
|
|
2094
|
+
var F, C;
|
|
2095
|
+
const { tagName: l, attributes: o, children: h } = a;
|
|
2096
2096
|
let _ = l, u = o;
|
|
2097
2097
|
if (l === "field") {
|
|
2098
2098
|
const { name: p, widget: I } = o;
|
|
@@ -2114,7 +2114,7 @@ class Et {
|
|
|
2114
2114
|
fieldsWidgetType: this._fields[p].type
|
|
2115
2115
|
};
|
|
2116
2116
|
}
|
|
2117
|
-
const
|
|
2117
|
+
const d = Ce({
|
|
2118
2118
|
tagAttributes: u,
|
|
2119
2119
|
values: s,
|
|
2120
2120
|
fields: this._fields,
|
|
@@ -2130,7 +2130,7 @@ class Et {
|
|
|
2130
2130
|
fields: this._fields
|
|
2131
2131
|
});
|
|
2132
2132
|
const c = ne({
|
|
2133
|
-
context: u.context || ((
|
|
2133
|
+
context: u.context || ((F = this._fields[u.name]) == null ? void 0 : F.context),
|
|
2134
2134
|
values: s,
|
|
2135
2135
|
fields: this._fields
|
|
2136
2136
|
});
|
|
@@ -2138,9 +2138,9 @@ class Et {
|
|
|
2138
2138
|
u.on_change
|
|
2139
2139
|
));
|
|
2140
2140
|
let b;
|
|
2141
|
-
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;
|
|
2142
2142
|
const x = {
|
|
2143
|
-
...
|
|
2143
|
+
...d,
|
|
2144
2144
|
...g,
|
|
2145
2145
|
context: c,
|
|
2146
2146
|
domain: b,
|
|
@@ -2148,8 +2148,8 @@ class Et {
|
|
|
2148
2148
|
};
|
|
2149
2149
|
e.readOnly && (x.readonly = !0);
|
|
2150
2150
|
const y = n.createWidget(_, x);
|
|
2151
|
-
y.invisible && y instanceof f && this._invisibleFields.push(x.name), y instanceof
|
|
2152
|
-
fields:
|
|
2151
|
+
y.invisible && y instanceof f && this._invisibleFields.push(x.name), y instanceof v && this.parseNode({
|
|
2152
|
+
fields: h,
|
|
2153
2153
|
container: y.container,
|
|
2154
2154
|
values: s
|
|
2155
2155
|
}), y instanceof ee && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
@@ -2245,30 +2245,30 @@ class Vt {
|
|
|
2245
2245
|
const { tagName: a, attributes: l } = n;
|
|
2246
2246
|
let o = null;
|
|
2247
2247
|
if (a === "field") {
|
|
2248
|
-
const { name:
|
|
2248
|
+
const { name: h, widget: _ } = l;
|
|
2249
2249
|
let u = l;
|
|
2250
|
-
if (
|
|
2251
|
-
if (!this._fields[
|
|
2252
|
-
throw new Error(`Field ${
|
|
2253
|
-
const
|
|
2254
|
-
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;
|
|
2255
2255
|
const g = ne({
|
|
2256
|
-
context: l.context ||
|
|
2256
|
+
context: l.context || d.context,
|
|
2257
2257
|
values: {},
|
|
2258
2258
|
fields: this._fields
|
|
2259
2259
|
});
|
|
2260
2260
|
u = {
|
|
2261
|
-
...
|
|
2261
|
+
...d,
|
|
2262
2262
|
...l,
|
|
2263
|
-
fieldsWidgetType:
|
|
2263
|
+
fieldsWidgetType: d == null ? void 0 : d.type,
|
|
2264
2264
|
context: g
|
|
2265
|
-
}, this._contextForFields[
|
|
2265
|
+
}, this._contextForFields[h] = g;
|
|
2266
2266
|
}
|
|
2267
2267
|
if (_ && (o = _), !u.invisible) {
|
|
2268
|
-
const
|
|
2269
|
-
this._columns.push(
|
|
2268
|
+
const d = s.createWidget(o, u);
|
|
2269
|
+
this._columns.push(d);
|
|
2270
2270
|
}
|
|
2271
|
-
|
|
2271
|
+
w(u.autorefresh) && this._autorefreshableFields.push(h);
|
|
2272
2272
|
}
|
|
2273
2273
|
});
|
|
2274
2274
|
}
|
|
@@ -2280,7 +2280,7 @@ class Vt {
|
|
|
2280
2280
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
2283
|
-
const
|
|
2283
|
+
const ht = {
|
|
2284
2284
|
text: "text",
|
|
2285
2285
|
many2one: "many2one",
|
|
2286
2286
|
char: "char",
|
|
@@ -2341,7 +2341,7 @@ class Yt {
|
|
|
2341
2341
|
colspan: 2
|
|
2342
2342
|
}, { type: a, widget: l } = n;
|
|
2343
2343
|
let o = l ?? a;
|
|
2344
|
-
return
|
|
2344
|
+
return ht[o] === void 0 && (o = a), e.createWidget(o, n);
|
|
2345
2345
|
});
|
|
2346
2346
|
}
|
|
2347
2347
|
/**
|
|
@@ -2361,14 +2361,14 @@ const Dt = ({
|
|
|
2361
2361
|
if (!Array.isArray(s))
|
|
2362
2362
|
return;
|
|
2363
2363
|
const [n, a, l] = s;
|
|
2364
|
-
let o,
|
|
2365
|
-
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(
|
|
2366
2366
|
n.indexOf(".") + 1,
|
|
2367
2367
|
n.length - 1
|
|
2368
|
-
)) : (o = n,
|
|
2368
|
+
)) : (o = n, h = "id"), o === t && e.push([h, a, l]);
|
|
2369
2369
|
}), e;
|
|
2370
2370
|
}, jt = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2371
|
-
class
|
|
2371
|
+
class dt {
|
|
2372
2372
|
constructor(t) {
|
|
2373
2373
|
r(this, "_action_id", null);
|
|
2374
2374
|
r(this, "_position", null);
|
|
@@ -2389,7 +2389,7 @@ class Mt {
|
|
|
2389
2389
|
this._string = e.attributes.string || null;
|
|
2390
2390
|
const { children: s } = e;
|
|
2391
2391
|
s.forEach((n) => {
|
|
2392
|
-
n.tagName === "dashboard_item" && this._items.push(new
|
|
2392
|
+
n.tagName === "dashboard_item" && this._items.push(new dt(n.attributes));
|
|
2393
2393
|
});
|
|
2394
2394
|
}
|
|
2395
2395
|
get string() {
|
|
@@ -2434,8 +2434,10 @@ class ce extends oe {
|
|
|
2434
2434
|
r(this, "_icon", null);
|
|
2435
2435
|
r(this, "_totalDomain", null);
|
|
2436
2436
|
r(this, "_showPercent", !1);
|
|
2437
|
+
r(this, "_progressbar", !1);
|
|
2438
|
+
r(this, "_showTotal", !0);
|
|
2437
2439
|
r(this, "_suffix", null);
|
|
2438
|
-
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;
|
|
2439
2441
|
}
|
|
2440
2442
|
get color() {
|
|
2441
2443
|
return this._color;
|
|
@@ -2449,6 +2451,12 @@ class ce extends oe {
|
|
|
2449
2451
|
get showPercent() {
|
|
2450
2452
|
return this._showPercent;
|
|
2451
2453
|
}
|
|
2454
|
+
get progressbar() {
|
|
2455
|
+
return this._progressbar;
|
|
2456
|
+
}
|
|
2457
|
+
get showTotal() {
|
|
2458
|
+
return this._showTotal;
|
|
2459
|
+
}
|
|
2452
2460
|
get suffix() {
|
|
2453
2461
|
return this._suffix;
|
|
2454
2462
|
}
|
|
@@ -2478,7 +2486,7 @@ const _t = (i) => {
|
|
|
2478
2486
|
let e;
|
|
2479
2487
|
if (i.forEach((s) => {
|
|
2480
2488
|
if (s.tagName === "field") {
|
|
2481
|
-
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;
|
|
2482
2490
|
if (!n)
|
|
2483
2491
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2484
2492
|
if (!l)
|
|
@@ -2490,7 +2498,7 @@ const _t = (i) => {
|
|
|
2490
2498
|
name: l,
|
|
2491
2499
|
operator: a,
|
|
2492
2500
|
label: o,
|
|
2493
|
-
stacked:
|
|
2501
|
+
stacked: h
|
|
2494
2502
|
})
|
|
2495
2503
|
);
|
|
2496
2504
|
}
|
|
@@ -2534,7 +2542,7 @@ const ft = {
|
|
|
2534
2542
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2535
2543
|
return new s(e, t);
|
|
2536
2544
|
};
|
|
2537
|
-
class
|
|
2545
|
+
class he {
|
|
2538
2546
|
constructor({ name: t, axis: e }) {
|
|
2539
2547
|
r(this, "_name");
|
|
2540
2548
|
r(this, "_axis");
|
|
@@ -2547,7 +2555,7 @@ class de {
|
|
|
2547
2555
|
return this._axis;
|
|
2548
2556
|
}
|
|
2549
2557
|
}
|
|
2550
|
-
class gt extends
|
|
2558
|
+
class gt extends he {
|
|
2551
2559
|
constructor({
|
|
2552
2560
|
name: e,
|
|
2553
2561
|
operator: s,
|
|
@@ -2570,7 +2578,7 @@ class gt extends de {
|
|
|
2570
2578
|
return this._stacked;
|
|
2571
2579
|
}
|
|
2572
2580
|
}
|
|
2573
|
-
class mt extends
|
|
2581
|
+
class mt extends he {
|
|
2574
2582
|
constructor({ name: t }) {
|
|
2575
2583
|
super({ name: t, axis: "x" });
|
|
2576
2584
|
}
|
|
@@ -2628,15 +2636,15 @@ function xt({
|
|
|
2628
2636
|
groupBy: "type-stacked"
|
|
2629
2637
|
}), a = `${t}s`;
|
|
2630
2638
|
return Object.keys(n).forEach((o) => {
|
|
2631
|
-
const
|
|
2632
|
-
for (let _ = 0; _ <
|
|
2633
|
-
const u =
|
|
2634
|
-
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)
|
|
2635
2643
|
return;
|
|
2636
|
-
const
|
|
2637
|
-
if (!
|
|
2644
|
+
const d = u.x, g = h[_ + 1].x;
|
|
2645
|
+
if (!de([d, g], a)) {
|
|
2638
2646
|
const c = pt({
|
|
2639
|
-
dates: [
|
|
2647
|
+
dates: [d, g],
|
|
2640
2648
|
timerange: t,
|
|
2641
2649
|
interval: e
|
|
2642
2650
|
});
|
|
@@ -2650,7 +2658,7 @@ function xt({
|
|
|
2650
2658
|
);
|
|
2651
2659
|
}
|
|
2652
2660
|
}
|
|
2653
|
-
}), s.sort((o,
|
|
2661
|
+
}), s.sort((o, h) => o.x < h.x ? -1 : o.x > h.x ? 1 : 0);
|
|
2654
2662
|
}
|
|
2655
2663
|
function pt({
|
|
2656
2664
|
dates: i,
|
|
@@ -2662,12 +2670,12 @@ function pt({
|
|
|
2662
2670
|
return i;
|
|
2663
2671
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2664
2672
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2665
|
-
const o = a[l],
|
|
2666
|
-
if (!
|
|
2667
|
-
const _ =
|
|
2673
|
+
const o = a[l], h = a[l + 1];
|
|
2674
|
+
if (!de([o, h], n)) {
|
|
2675
|
+
const _ = W(o, E(n)).add(
|
|
2668
2676
|
e,
|
|
2669
2677
|
n
|
|
2670
|
-
), u =
|
|
2678
|
+
), u = W(h, E(n));
|
|
2671
2679
|
for (; _.isBefore(u); )
|
|
2672
2680
|
s.push(_.format(E(n))), _.add(e, n);
|
|
2673
2681
|
}
|
|
@@ -2686,13 +2694,13 @@ function wt({
|
|
|
2686
2694
|
groupBy: "all"
|
|
2687
2695
|
});
|
|
2688
2696
|
return Object.keys(n).forEach((a) => {
|
|
2689
|
-
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({
|
|
2690
2698
|
values: l.map((_) => _.value),
|
|
2691
2699
|
operator: o
|
|
2692
2700
|
});
|
|
2693
2701
|
s.push({
|
|
2694
2702
|
...l[0],
|
|
2695
|
-
value:
|
|
2703
|
+
value: h
|
|
2696
2704
|
});
|
|
2697
2705
|
}), s;
|
|
2698
2706
|
}
|
|
@@ -2713,7 +2721,7 @@ function Ft({
|
|
|
2713
2721
|
timerange: t
|
|
2714
2722
|
}) {
|
|
2715
2723
|
let e = Ct(i);
|
|
2716
|
-
const s =
|
|
2724
|
+
const s = W(i, e);
|
|
2717
2725
|
switch (t) {
|
|
2718
2726
|
case "hour": {
|
|
2719
2727
|
e = "YYYY-MM-DD HH:00";
|
|
@@ -2741,7 +2749,7 @@ function Ft({
|
|
|
2741
2749
|
function Ct(i) {
|
|
2742
2750
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2743
2751
|
}
|
|
2744
|
-
function
|
|
2752
|
+
function de(i, t) {
|
|
2745
2753
|
let e = !1;
|
|
2746
2754
|
const s = E(t);
|
|
2747
2755
|
if (i.length === 0)
|
|
@@ -2749,7 +2757,7 @@ function he(i, t) {
|
|
|
2749
2757
|
if (i.length === 1)
|
|
2750
2758
|
return !0;
|
|
2751
2759
|
for (let n = 0; n < i.length - 1; n++) {
|
|
2752
|
-
const a =
|
|
2760
|
+
const a = W(i[n], s), o = W(i[n + 1], s).diff(a, t);
|
|
2753
2761
|
Math.abs(o) === 1 ? e = !0 : e = !1;
|
|
2754
2762
|
}
|
|
2755
2763
|
return e;
|
|
@@ -2802,13 +2810,13 @@ const kt = {
|
|
|
2802
2810
|
Object.keys(n).forEach((b) => {
|
|
2803
2811
|
const x = n[b].label, y = n[b].entries;
|
|
2804
2812
|
if (c.label) {
|
|
2805
|
-
const
|
|
2813
|
+
const F = R({
|
|
2806
2814
|
fieldName: c.label,
|
|
2807
2815
|
values: y,
|
|
2808
2816
|
fields: e
|
|
2809
2817
|
});
|
|
2810
|
-
Object.keys(
|
|
2811
|
-
const p =
|
|
2818
|
+
Object.keys(F).forEach((C) => {
|
|
2819
|
+
const p = F[C].entries, I = F[C].label, ge = B({
|
|
2812
2820
|
entries: p,
|
|
2813
2821
|
fields: e,
|
|
2814
2822
|
fieldName: c.name
|
|
@@ -2825,17 +2833,17 @@ const kt = {
|
|
|
2825
2833
|
});
|
|
2826
2834
|
});
|
|
2827
2835
|
} else {
|
|
2828
|
-
const
|
|
2836
|
+
const F = B({
|
|
2829
2837
|
entries: y,
|
|
2830
2838
|
fields: e,
|
|
2831
2839
|
fieldName: c.name
|
|
2832
|
-
}),
|
|
2833
|
-
values:
|
|
2840
|
+
}), C = Y({
|
|
2841
|
+
values: F,
|
|
2834
2842
|
operator: c.operator
|
|
2835
2843
|
});
|
|
2836
2844
|
a.push({
|
|
2837
2845
|
x: x || !1,
|
|
2838
|
-
value:
|
|
2846
|
+
value: C,
|
|
2839
2847
|
type: _e({
|
|
2840
2848
|
yAxis: c,
|
|
2841
2849
|
fields: e
|
|
@@ -2853,21 +2861,21 @@ const kt = {
|
|
|
2853
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(
|
|
2854
2862
|
(c) => c.x !== !1
|
|
2855
2863
|
));
|
|
2856
|
-
let
|
|
2857
|
-
i.timerange ?
|
|
2858
|
-
values:
|
|
2864
|
+
let d = u;
|
|
2865
|
+
i.timerange ? d = yt({
|
|
2866
|
+
values: d,
|
|
2859
2867
|
timerange: i.timerange,
|
|
2860
2868
|
interval: i.interval
|
|
2861
|
-
}) : i.type == "pie" && (
|
|
2869
|
+
}) : i.type == "pie" && (d = u.sort((c, b) => b.value - c.value));
|
|
2862
2870
|
const g = {
|
|
2863
|
-
data:
|
|
2871
|
+
data: d,
|
|
2864
2872
|
isGroup: o || l,
|
|
2865
2873
|
isStack: o
|
|
2866
2874
|
};
|
|
2867
2875
|
if (i.type === "line" && i.y_range && (g.yAxisOpts = {
|
|
2868
2876
|
mode: i.y_range
|
|
2869
2877
|
}, i.y_range === "auto")) {
|
|
2870
|
-
const { min: c, max: b } = fe(
|
|
2878
|
+
const { min: c, max: b } = fe(d);
|
|
2871
2879
|
g.yAxisOpts.valueOpts = { min: c, max: b };
|
|
2872
2880
|
}
|
|
2873
2881
|
return g;
|
|
@@ -2971,13 +2979,13 @@ const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2971
2979
|
processGraphData: Pt
|
|
2972
2980
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2973
2981
|
export {
|
|
2974
|
-
|
|
2982
|
+
We as ActionButtons,
|
|
2975
2983
|
Ke as Alert,
|
|
2976
2984
|
ke as Avatar,
|
|
2977
2985
|
Ae as Binary,
|
|
2978
2986
|
te as Boolean,
|
|
2979
2987
|
ee as Button,
|
|
2980
|
-
|
|
2988
|
+
Te as ButtonGroup,
|
|
2981
2989
|
rt as Card,
|
|
2982
2990
|
tt as Carousel,
|
|
2983
2991
|
A as Char,
|
|
@@ -2985,9 +2993,9 @@ export {
|
|
|
2985
2993
|
it as ColorPicker,
|
|
2986
2994
|
Ze as Comments,
|
|
2987
2995
|
V as Container,
|
|
2988
|
-
|
|
2996
|
+
v as ContainerWidget,
|
|
2989
2997
|
Mt as Dashboard,
|
|
2990
|
-
|
|
2998
|
+
dt as DashboardItem,
|
|
2991
2999
|
De as Date,
|
|
2992
3000
|
je as DateTime,
|
|
2993
3001
|
et as Email,
|
|
@@ -2996,7 +3004,7 @@ export {
|
|
|
2996
3004
|
Ee as FloatTime,
|
|
2997
3005
|
Et as Form,
|
|
2998
3006
|
oe as Graph,
|
|
2999
|
-
|
|
3007
|
+
he as GraphAxis,
|
|
3000
3008
|
M as GraphChart,
|
|
3001
3009
|
ce as GraphIndicator,
|
|
3002
3010
|
ut as GraphIndicatorField,
|
|
@@ -3010,7 +3018,7 @@ export {
|
|
|
3010
3018
|
Se as Integer,
|
|
3011
3019
|
H as JSONField,
|
|
3012
3020
|
Z as Label,
|
|
3013
|
-
|
|
3021
|
+
ze as Many2one,
|
|
3014
3022
|
Ie as Markdown,
|
|
3015
3023
|
se as MultiCheckbox,
|
|
3016
3024
|
K as NewLine,
|
|
@@ -3021,9 +3029,9 @@ export {
|
|
|
3021
3029
|
st as QRCode,
|
|
3022
3030
|
He as Radio,
|
|
3023
3031
|
Ne as Reference,
|
|
3024
|
-
|
|
3032
|
+
ht as SearchFieldTypes,
|
|
3025
3033
|
Yt as SearchFilter,
|
|
3026
|
-
|
|
3034
|
+
z as Selection,
|
|
3027
3035
|
Me as Separator,
|
|
3028
3036
|
j as Spinner,
|
|
3029
3037
|
Xe as Steps,
|
|
@@ -3034,7 +3042,7 @@ export {
|
|
|
3034
3042
|
Ue as Time,
|
|
3035
3043
|
Ge as Timeline,
|
|
3036
3044
|
Vt as Tree,
|
|
3037
|
-
|
|
3045
|
+
k as Widget,
|
|
3038
3046
|
At as graphFieldUtils,
|
|
3039
3047
|
Bt as graphProcessor,
|
|
3040
3048
|
ne as parseContext,
|