@gisce/ooui 2.43.0-alpha.1 → 2.43.0-alpha.3
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/SearchFilter.d.ts.map +1 -1
- package/dist/ooui.es.js +132 -129
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/SearchFilter.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchFilter.d.ts","sourceRoot":"","sources":["../src/SearchFilter.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,eAAO,MAAM,gBAAgB,EAAE,GAY9B,CAAC;AAEF,cAAM,YAAY;IAChB;;OAEG;IACH,aAAa,EAAE,GAAG,CAAC;IACnB,IAAI,YAAY,QAEf;IAED;;OAEG;IACH,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,MAAM,QAET;IAED,sBAAsB,EAAE,SAAS,CAAC;IAClC,IAAI,qBAAqB,IAAI,SAAS,CAErC;IAED,wBAAwB,EAAE,SAAS,CAAC;IACpC,IAAI,uBAAuB,IAAI,SAAS,CAEvC;gBAEW,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAU;IAOrE,KAAK;IAqBL,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"SearchFilter.d.ts","sourceRoot":"","sources":["../src/SearchFilter.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,eAAO,MAAM,gBAAgB,EAAE,GAY9B,CAAC;AAEF,cAAM,YAAY;IAChB;;OAEG;IACH,aAAa,EAAE,GAAG,CAAC;IACnB,IAAI,YAAY,QAEf;IAED;;OAEG;IACH,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,MAAM,QAET;IAED,sBAAsB,EAAE,SAAS,CAAC;IAClC,IAAI,qBAAqB,IAAI,SAAS,CAErC;IAED,wBAAwB,EAAE,SAAS,CAAC;IACpC,IAAI,uBAAuB,IAAI,SAAS,CAEvC;gBAEW,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAU;IAOrE,KAAK;IAqBL,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,aAAa;IAoBhE;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAGpC;AAED,eAAe,YAAY,CAAC"}
|
package/dist/ooui.es.js
CHANGED
|
@@ -10,34 +10,34 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
|
|
|
10
10
|
values: e,
|
|
11
11
|
fields: t
|
|
12
12
|
}) => {
|
|
13
|
-
let [i, r,
|
|
14
|
-
const
|
|
13
|
+
let [i, r, a] = s, o = e[i];
|
|
14
|
+
const l = U({
|
|
15
15
|
fieldName: i,
|
|
16
16
|
valueInObject: o,
|
|
17
|
-
expectedValue:
|
|
17
|
+
expectedValue: a,
|
|
18
18
|
fields: t
|
|
19
19
|
});
|
|
20
|
-
if (
|
|
21
|
-
return
|
|
22
|
-
switch (
|
|
20
|
+
if (l.directOutcome !== void 0)
|
|
21
|
+
return l.directOutcome;
|
|
22
|
+
switch (l.modifiedValueInObject !== null && (o = l.modifiedValueInObject), l.modifiedExpectedValue !== null && (a = l.modifiedExpectedValue), r.toLowerCase()) {
|
|
23
23
|
case "=":
|
|
24
24
|
case "==":
|
|
25
|
-
return o ==
|
|
25
|
+
return o == a;
|
|
26
26
|
case "<>":
|
|
27
27
|
case "!=":
|
|
28
|
-
return o !=
|
|
28
|
+
return o != a;
|
|
29
29
|
case ">":
|
|
30
|
-
return o >
|
|
30
|
+
return o > a;
|
|
31
31
|
case ">=":
|
|
32
|
-
return o >=
|
|
32
|
+
return o >= a;
|
|
33
33
|
case "<":
|
|
34
|
-
return o <
|
|
34
|
+
return o < a;
|
|
35
35
|
case "<=":
|
|
36
|
-
return o <=
|
|
36
|
+
return o <= a;
|
|
37
37
|
case "in":
|
|
38
|
-
return
|
|
38
|
+
return a.includes(o);
|
|
39
39
|
case "not in":
|
|
40
|
-
return !
|
|
40
|
+
return !a.includes(o);
|
|
41
41
|
default:
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
@@ -91,13 +91,13 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
|
|
|
91
91
|
widgetType: i
|
|
92
92
|
}) => {
|
|
93
93
|
try {
|
|
94
|
-
const r = g(s),
|
|
94
|
+
const r = g(s), a = JSON.parse(
|
|
95
95
|
r.replace(/'/g, '"')
|
|
96
96
|
), o = {};
|
|
97
|
-
for (const
|
|
97
|
+
for (const l of Object.keys(a)) {
|
|
98
98
|
const c = vt({
|
|
99
99
|
object: e,
|
|
100
|
-
condition: l
|
|
100
|
+
condition: a[l],
|
|
101
101
|
evaluateFieldComparison: ({
|
|
102
102
|
fieldName: _,
|
|
103
103
|
valueInObject: u,
|
|
@@ -109,7 +109,7 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
|
|
|
109
109
|
fields: t
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
|
-
c ? o[
|
|
112
|
+
c ? o[l] = !0 : l === "readonly" && !c && i === "button" && (o[l] = !1);
|
|
113
113
|
}
|
|
114
114
|
return o;
|
|
115
115
|
} catch (r) {
|
|
@@ -124,10 +124,10 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
|
|
|
124
124
|
widgetType: i,
|
|
125
125
|
fallbackMode: r = !0
|
|
126
126
|
}) => {
|
|
127
|
-
let
|
|
127
|
+
let a = {};
|
|
128
128
|
if (s.json_attrs)
|
|
129
129
|
try {
|
|
130
|
-
|
|
130
|
+
a = Pt({
|
|
131
131
|
attrs: s.json_attrs,
|
|
132
132
|
values: e,
|
|
133
133
|
fields: t,
|
|
@@ -135,7 +135,7 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
|
|
|
135
135
|
});
|
|
136
136
|
} catch (o) {
|
|
137
137
|
if (r && s.attrs)
|
|
138
|
-
|
|
138
|
+
a = Q({
|
|
139
139
|
attrs: s.attrs,
|
|
140
140
|
values: e,
|
|
141
141
|
fields: t,
|
|
@@ -145,7 +145,7 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
|
|
|
145
145
|
throw o;
|
|
146
146
|
}
|
|
147
147
|
else
|
|
148
|
-
s.attrs && (
|
|
148
|
+
s.attrs && (a = Q({
|
|
149
149
|
attrs: s.attrs,
|
|
150
150
|
values: e,
|
|
151
151
|
fields: t,
|
|
@@ -153,7 +153,7 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
|
|
|
153
153
|
}));
|
|
154
154
|
return {
|
|
155
155
|
...s,
|
|
156
|
-
...
|
|
156
|
+
...a,
|
|
157
157
|
attrs: void 0,
|
|
158
158
|
json_attrs: void 0
|
|
159
159
|
};
|
|
@@ -553,7 +553,7 @@ class z {
|
|
|
553
553
|
} else
|
|
554
554
|
i.push(e);
|
|
555
555
|
i.reduce(
|
|
556
|
-
(o,
|
|
556
|
+
(o, l) => o + l.colspan,
|
|
557
557
|
0
|
|
558
558
|
) > this.freePosition() && (this._rows.push([]), this._index++), this._rows[this._index] = this._rows[this._index].concat(i);
|
|
559
559
|
}
|
|
@@ -565,8 +565,8 @@ class z {
|
|
|
565
565
|
var i;
|
|
566
566
|
let t = null;
|
|
567
567
|
return (i = this._rows) != null && i.length && this._rows.forEach((r) => {
|
|
568
|
-
t || r != null && r.length && r.forEach((
|
|
569
|
-
t ||
|
|
568
|
+
t || r != null && r.length && r.forEach((a) => {
|
|
569
|
+
t || a && (t = a.findById(e));
|
|
570
570
|
});
|
|
571
571
|
}), t;
|
|
572
572
|
}
|
|
@@ -1858,18 +1858,18 @@ const le = ({
|
|
|
1858
1858
|
const i = (o = t[s]) == null ? void 0 : o.states;
|
|
1859
1859
|
if (!i)
|
|
1860
1860
|
return {};
|
|
1861
|
-
const r = {},
|
|
1862
|
-
for (const
|
|
1863
|
-
if (e.state ===
|
|
1864
|
-
const c = i[
|
|
1861
|
+
const r = {}, a = {};
|
|
1862
|
+
for (const l of Object.keys(i))
|
|
1863
|
+
if (e.state === l) {
|
|
1864
|
+
const c = i[l];
|
|
1865
1865
|
for (const _ of c) {
|
|
1866
1866
|
const [u, h] = _;
|
|
1867
|
-
|
|
1867
|
+
a[u] || (a[u] = []), a[u].push(h);
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
|
1870
|
-
for (const
|
|
1871
|
-
const c = l
|
|
1872
|
-
r[
|
|
1870
|
+
for (const l of Object.keys(a)) {
|
|
1871
|
+
const c = a[l];
|
|
1872
|
+
r[l] = c.some((_) => _);
|
|
1873
1873
|
}
|
|
1874
1874
|
return r;
|
|
1875
1875
|
}, lt = ({
|
|
@@ -1888,7 +1888,7 @@ function oe({
|
|
|
1888
1888
|
}) {
|
|
1889
1889
|
var r;
|
|
1890
1890
|
const i = ((r = t[e]) == null ? void 0 : r.type) || "passthrough";
|
|
1891
|
-
return i === "many2one" ? s[e] ? s[e][0] || null : !1 : i === "one2many" || i === "many2many" ? s[e].map((
|
|
1891
|
+
return i === "many2one" ? s[e] ? s[e][0] || null : !1 : i === "one2many" || i === "many2many" ? s[e].map((a) => a.id) : s != null && s[e] ? s == null ? void 0 : s[e] : e.includes("'") ? e : parseInt(e);
|
|
1892
1892
|
}
|
|
1893
1893
|
const J = ({
|
|
1894
1894
|
context: s,
|
|
@@ -1945,7 +1945,7 @@ function ct(s) {
|
|
|
1945
1945
|
return typeof s == "object" && s !== null && typeof s != "string";
|
|
1946
1946
|
}
|
|
1947
1947
|
const dt = (s) => {
|
|
1948
|
-
const e = s.trim().replace(")", "").split("("), t = e[0], i = e[1], r = i ? i.split(",").map((
|
|
1948
|
+
const e = s.trim().replace(")", "").split("("), t = e[0], i = e[1], r = i ? i.split(",").map((a) => a.trim()).filter((a) => a.length > 0) : [];
|
|
1949
1949
|
return {
|
|
1950
1950
|
method: t,
|
|
1951
1951
|
args: r
|
|
@@ -1955,8 +1955,8 @@ function ce(s) {
|
|
|
1955
1955
|
const e = [];
|
|
1956
1956
|
function t(i) {
|
|
1957
1957
|
const r = [];
|
|
1958
|
-
for (const
|
|
1959
|
-
|
|
1958
|
+
for (const a of i)
|
|
1959
|
+
a instanceof F ? t(a._container.rows.flat()) : r.push(a);
|
|
1960
1960
|
r.length > 0 && e.push(r);
|
|
1961
1961
|
}
|
|
1962
1962
|
for (const i of s)
|
|
@@ -2072,10 +2072,10 @@ class Ee {
|
|
|
2072
2072
|
this._contextForFields = e;
|
|
2073
2073
|
}
|
|
2074
2074
|
parse(e, t) {
|
|
2075
|
-
var
|
|
2076
|
-
const { values: i = {}, readOnly: r = !1 } = t || {},
|
|
2077
|
-
this._string = ((
|
|
2078
|
-
fields:
|
|
2075
|
+
var l;
|
|
2076
|
+
const { values: i = {}, readOnly: r = !1 } = t || {}, a = I.parse(e).filter((c) => c.tagName === "form")[0];
|
|
2077
|
+
this._string = ((l = a.attributes) == null ? void 0 : l.string) || null, this._string && (this._string = g(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
2078
|
+
fields: a.children,
|
|
2079
2079
|
container: this._container,
|
|
2080
2080
|
values: i
|
|
2081
2081
|
});
|
|
@@ -2091,12 +2091,12 @@ class Ee {
|
|
|
2091
2091
|
values: i
|
|
2092
2092
|
}) {
|
|
2093
2093
|
const r = new E();
|
|
2094
|
-
e.filter((
|
|
2094
|
+
e.filter((a) => typeof a == "object").forEach((a) => {
|
|
2095
2095
|
var v, C;
|
|
2096
|
-
const { tagName: o, attributes:
|
|
2097
|
-
let _ = o, u =
|
|
2096
|
+
const { tagName: o, attributes: l, children: c } = a;
|
|
2097
|
+
let _ = o, u = l;
|
|
2098
2098
|
if (o === "field") {
|
|
2099
|
-
const { name: w, widget: V } =
|
|
2099
|
+
const { name: w, widget: V } = l;
|
|
2100
2100
|
if (V)
|
|
2101
2101
|
_ = V;
|
|
2102
2102
|
else if (w) {
|
|
@@ -2104,14 +2104,14 @@ class Ee {
|
|
|
2104
2104
|
throw new Error(
|
|
2105
2105
|
`Field ${w} doesn't exist in fields defintion`
|
|
2106
2106
|
);
|
|
2107
|
-
_ = this._fields[w].type,
|
|
2108
|
-
...Z(
|
|
2107
|
+
_ = this._fields[w].type, l.widget_props = {
|
|
2108
|
+
...Z(l.widget_props),
|
|
2109
2109
|
...this._fields[w].widget_props || {}
|
|
2110
2110
|
};
|
|
2111
2111
|
}
|
|
2112
2112
|
u = {
|
|
2113
2113
|
...this._fields[w],
|
|
2114
|
-
...
|
|
2114
|
+
...l,
|
|
2115
2115
|
fieldsWidgetType: this._fields[w].type
|
|
2116
2116
|
};
|
|
2117
2117
|
}
|
|
@@ -2243,16 +2243,16 @@ class Ve {
|
|
|
2243
2243
|
this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors)), this._status = t.attributes.status || null, this._status && (this._status = g(this._status)), this._editable = t.attributes.editable || null, this._infinite = t.attributes.infinite || !1;
|
|
2244
2244
|
const i = new E();
|
|
2245
2245
|
t.children.forEach((r) => {
|
|
2246
|
-
const { tagName:
|
|
2247
|
-
let
|
|
2248
|
-
if (
|
|
2246
|
+
const { tagName: a, attributes: o } = r;
|
|
2247
|
+
let l = null;
|
|
2248
|
+
if (a === "field") {
|
|
2249
2249
|
const { name: c, widget: _ } = o;
|
|
2250
2250
|
let u = o;
|
|
2251
2251
|
if (c) {
|
|
2252
2252
|
if (!this._fields[c])
|
|
2253
2253
|
throw new Error(`Field ${c} doesn't exist in fields defintion`);
|
|
2254
2254
|
const h = this._fields[c];
|
|
2255
|
-
|
|
2255
|
+
l = h.type, (Array.isArray(h == null ? void 0 : h.domain) && (h == null ? void 0 : h.domain.length) === 0 || (h == null ? void 0 : h.domain) === !1) && o.domain && o.domain.length > 0 && delete h.domain;
|
|
2256
2256
|
const m = J({
|
|
2257
2257
|
context: o.context || h.context,
|
|
2258
2258
|
values: {},
|
|
@@ -2265,8 +2265,8 @@ class Ve {
|
|
|
2265
2265
|
context: m
|
|
2266
2266
|
}, this._contextForFields[c] = m;
|
|
2267
2267
|
}
|
|
2268
|
-
if (_ && (
|
|
2269
|
-
const h = i.createWidget(
|
|
2268
|
+
if (_ && (l = _), !u.invisible) {
|
|
2269
|
+
const h = i.createWidget(l, u);
|
|
2270
2270
|
this._columns.push(h);
|
|
2271
2271
|
}
|
|
2272
2272
|
p(u.autorefresh) && this._autorefreshableFields.push(c);
|
|
@@ -2396,30 +2396,30 @@ class Ye {
|
|
|
2396
2396
|
this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._column_field = t.attributes.column_field || "state", this._column_domain = t.attributes.column_domain || null, this._drag = t.attributes.drag !== void 0 ? p(t.attributes.drag) : !0, this._sort = t.attributes.sort || void 0, this._set_max_cards = t.attributes.set_max_cards !== void 0 ? p(t.attributes.set_max_cards) : !1, this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors)), this._status = t.attributes.status || null, this._status && (this._status = g(this._status)), t.attributes.on_change_column && (this._on_change_column = dt(t.attributes.on_change_column));
|
|
2397
2397
|
const i = new E();
|
|
2398
2398
|
t.children.forEach((r) => {
|
|
2399
|
-
const { tagName:
|
|
2400
|
-
|
|
2399
|
+
const { tagName: a, attributes: o } = r;
|
|
2400
|
+
a === "field" ? this._parseField(r, o, i) : a === "button" && this._parseButton(r, o);
|
|
2401
2401
|
});
|
|
2402
2402
|
}
|
|
2403
2403
|
_parseField(e, t, i) {
|
|
2404
|
-
const { name: r, widget:
|
|
2404
|
+
const { name: r, widget: a, sum: o } = t;
|
|
2405
2405
|
if (!r)
|
|
2406
2406
|
return;
|
|
2407
2407
|
if (!this._fields[r])
|
|
2408
2408
|
throw new Error(`Field ${r} doesn't exist in fields definition`);
|
|
2409
|
-
const
|
|
2410
|
-
let c =
|
|
2411
|
-
(Array.isArray(
|
|
2409
|
+
const l = this._fields[r];
|
|
2410
|
+
let c = l.type;
|
|
2411
|
+
(Array.isArray(l == null ? void 0 : l.domain) && (l == null ? void 0 : l.domain.length) === 0 || (l == null ? void 0 : l.domain) === !1) && t.domain && t.domain.length > 0 && delete l.domain;
|
|
2412
2412
|
const _ = J({
|
|
2413
|
-
context: t.context ||
|
|
2413
|
+
context: t.context || l.context,
|
|
2414
2414
|
values: {},
|
|
2415
2415
|
fields: this._fields
|
|
2416
2416
|
}), u = {
|
|
2417
|
-
...
|
|
2417
|
+
...l,
|
|
2418
2418
|
...t,
|
|
2419
|
-
fieldsWidgetType:
|
|
2419
|
+
fieldsWidgetType: l == null ? void 0 : l.type,
|
|
2420
2420
|
context: _
|
|
2421
2421
|
};
|
|
2422
|
-
if (this._contextForFields[r] = _,
|
|
2422
|
+
if (this._contextForFields[r] = _, a && (c = a), !u.invisible) {
|
|
2423
2423
|
const h = i.createWidget(
|
|
2424
2424
|
c,
|
|
2425
2425
|
u
|
|
@@ -2428,15 +2428,15 @@ class Ye {
|
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
2430
2430
|
_parseButton(e, t) {
|
|
2431
|
-
const { name: i, type: r, string:
|
|
2431
|
+
const { name: i, type: r, string: a, states: o } = t;
|
|
2432
2432
|
if (!i)
|
|
2433
2433
|
return;
|
|
2434
|
-
const
|
|
2434
|
+
const l = {
|
|
2435
2435
|
...t,
|
|
2436
2436
|
name: i,
|
|
2437
2437
|
buttonType: r || "object",
|
|
2438
|
-
string:
|
|
2439
|
-
}, c = new A(
|
|
2438
|
+
string: a || ""
|
|
2439
|
+
}, c = new A(l);
|
|
2440
2440
|
o && (c.states = o), this._buttons.push(c);
|
|
2441
2441
|
}
|
|
2442
2442
|
/**
|
|
@@ -2457,30 +2457,30 @@ class De {
|
|
|
2457
2457
|
return this._kanbanDef;
|
|
2458
2458
|
}
|
|
2459
2459
|
parse(e, t) {
|
|
2460
|
-
const i = (t == null ? void 0 : t.readOnly) ?? !1, r = new z(1, 12, i),
|
|
2460
|
+
const i = (t == null ? void 0 : t.readOnly) ?? !1, r = new z(1, 12, i), a = new E();
|
|
2461
2461
|
let o = 0;
|
|
2462
|
-
return this._kanbanDef.card_fields.forEach((
|
|
2462
|
+
return this._kanbanDef.card_fields.forEach((l) => {
|
|
2463
2463
|
o++;
|
|
2464
2464
|
const c = tt({
|
|
2465
|
-
tagAttributes:
|
|
2465
|
+
tagAttributes: l.raw_props || {},
|
|
2466
2466
|
values: e,
|
|
2467
2467
|
fields: this._kanbanDef.fields,
|
|
2468
|
-
widgetType:
|
|
2468
|
+
widgetType: l.type || "field"
|
|
2469
2469
|
}), _ = {
|
|
2470
|
-
...
|
|
2470
|
+
...l.raw_props || {},
|
|
2471
2471
|
...c,
|
|
2472
2472
|
key: `field_${o}`
|
|
2473
2473
|
};
|
|
2474
2474
|
i && (_.readonly = !0);
|
|
2475
|
-
const u =
|
|
2476
|
-
r.addWidget(h, { addLabel: !
|
|
2477
|
-
}), this._kanbanDef.buttons.forEach((
|
|
2475
|
+
const u = l.type || "field", h = a.createWidget(u, _);
|
|
2476
|
+
r.addWidget(h, { addLabel: !l.nolabel });
|
|
2477
|
+
}), this._kanbanDef.buttons.forEach((l) => {
|
|
2478
2478
|
o++;
|
|
2479
|
-
const c =
|
|
2480
|
-
states:
|
|
2479
|
+
const c = l.states ? lt({
|
|
2480
|
+
states: l.states,
|
|
2481
2481
|
values: e
|
|
2482
2482
|
}) : {}, _ = {
|
|
2483
|
-
...
|
|
2483
|
+
...l.raw_props || {},
|
|
2484
2484
|
...c,
|
|
2485
2485
|
key: `button_${o}`
|
|
2486
2486
|
};
|
|
@@ -2548,10 +2548,13 @@ class je {
|
|
|
2548
2548
|
const r = {
|
|
2549
2549
|
...this.fields[i],
|
|
2550
2550
|
name: i,
|
|
2551
|
-
colspan: 2
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2551
|
+
colspan: 2,
|
|
2552
|
+
fieldsWidgetType: this.fields[i].type
|
|
2553
|
+
}, { type: a, widget: o } = r;
|
|
2554
|
+
let l = o ?? a;
|
|
2555
|
+
return de[l] === void 0 && (console.error(
|
|
2556
|
+
`[SearchFilter] Field "${i}" has unsupported type "${a}"`
|
|
2557
|
+
), l = a), t.createWidget(l, r);
|
|
2555
2558
|
});
|
|
2556
2559
|
}
|
|
2557
2560
|
/**
|
|
@@ -2570,12 +2573,12 @@ const Ne = ({
|
|
|
2570
2573
|
return s.forEach((i) => {
|
|
2571
2574
|
if (!Array.isArray(i))
|
|
2572
2575
|
return;
|
|
2573
|
-
const [r,
|
|
2574
|
-
let
|
|
2575
|
-
r.indexOf(".") !== -1 ? (
|
|
2576
|
+
const [r, a, o] = i;
|
|
2577
|
+
let l, c;
|
|
2578
|
+
r.indexOf(".") !== -1 ? (l = r.substr(0, r.indexOf(".")), c = r.substr(
|
|
2576
2579
|
r.indexOf(".") + 1,
|
|
2577
2580
|
r.length - 1
|
|
2578
|
-
)) : (
|
|
2581
|
+
)) : (l = r, c = "id"), l === e && t.push([c, a, o]);
|
|
2579
2582
|
}), t;
|
|
2580
2583
|
}, Ae = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((e) => e.trim()).filter((e) => !e.includes("'"));
|
|
2581
2584
|
class ue {
|
|
@@ -2677,10 +2680,10 @@ class he extends ht {
|
|
|
2677
2680
|
n(this, "_field");
|
|
2678
2681
|
n(this, "_operator");
|
|
2679
2682
|
const { children: r } = i;
|
|
2680
|
-
r.forEach((
|
|
2681
|
-
if (
|
|
2682
|
-
const o =
|
|
2683
|
-
this._field = o || void 0, this._operator =
|
|
2683
|
+
r.forEach((a) => {
|
|
2684
|
+
if (a.tagName === "field") {
|
|
2685
|
+
const o = a.attributes.name, l = a.attributes.operator;
|
|
2686
|
+
this._field = o || void 0, this._operator = l;
|
|
2684
2687
|
}
|
|
2685
2688
|
});
|
|
2686
2689
|
}
|
|
@@ -2696,7 +2699,7 @@ const _e = (s) => {
|
|
|
2696
2699
|
let t;
|
|
2697
2700
|
if (s.forEach((i) => {
|
|
2698
2701
|
if (i.tagName === "field") {
|
|
2699
|
-
const r = i.attributes.axis,
|
|
2702
|
+
const r = i.attributes.axis, a = i.attributes.operator, o = i.attributes.name, l = i.attributes.label || void 0, c = i.attributes.stacked || void 0;
|
|
2700
2703
|
if (!r)
|
|
2701
2704
|
throw new Error(`Field ${o} doesn't have an axis`);
|
|
2702
2705
|
if (!o)
|
|
@@ -2706,8 +2709,8 @@ const _e = (s) => {
|
|
|
2706
2709
|
}) : r === "y" && e.push(
|
|
2707
2710
|
new ge({
|
|
2708
2711
|
name: o,
|
|
2709
|
-
operator:
|
|
2710
|
-
label:
|
|
2712
|
+
operator: a,
|
|
2713
|
+
label: l,
|
|
2711
2714
|
stacked: c
|
|
2712
2715
|
})
|
|
2713
2716
|
);
|
|
@@ -2770,13 +2773,13 @@ class ge extends _t {
|
|
|
2770
2773
|
name: t,
|
|
2771
2774
|
operator: i,
|
|
2772
2775
|
label: r,
|
|
2773
|
-
stacked:
|
|
2776
|
+
stacked: a
|
|
2774
2777
|
}) {
|
|
2775
2778
|
super({ name: t, axis: "y" });
|
|
2776
2779
|
n(this, "_operator");
|
|
2777
2780
|
n(this, "_label");
|
|
2778
2781
|
n(this, "_stacked");
|
|
2779
|
-
this._operator = i, this._label = r, this._stacked =
|
|
2782
|
+
this._operator = i, this._label = r, this._stacked = a;
|
|
2780
2783
|
}
|
|
2781
2784
|
get operator() {
|
|
2782
2785
|
return this._operator;
|
|
@@ -2810,7 +2813,7 @@ function H({
|
|
|
2810
2813
|
if (i.type === "many2one")
|
|
2811
2814
|
return r ? { value: r[0], label: r[1] } : { value: !1, label: void 0 };
|
|
2812
2815
|
if (i.type === "selection") {
|
|
2813
|
-
const o = i.selection.find((
|
|
2816
|
+
const o = i.selection.find((l) => l[0] === r);
|
|
2814
2817
|
return o ? { value: r, label: o[1] } : { value: !1, label: void 0 };
|
|
2815
2818
|
}
|
|
2816
2819
|
return { value: r, label: r };
|
|
@@ -2844,15 +2847,15 @@ function xe({
|
|
|
2844
2847
|
const r = gt({
|
|
2845
2848
|
values: s,
|
|
2846
2849
|
groupBy: "type-stacked"
|
|
2847
|
-
}),
|
|
2848
|
-
return Object.keys(r).forEach((
|
|
2849
|
-
const c = r[
|
|
2850
|
+
}), a = `${e}s`;
|
|
2851
|
+
return Object.keys(r).forEach((l) => {
|
|
2852
|
+
const c = r[l];
|
|
2850
2853
|
for (let _ = 0; _ < c.length; _++) {
|
|
2851
2854
|
const u = c[_];
|
|
2852
2855
|
if (i.push(u), _ === c.length - 1)
|
|
2853
2856
|
return;
|
|
2854
2857
|
const h = u.x, m = c[_ + 1].x;
|
|
2855
|
-
if (!ft([h, m],
|
|
2858
|
+
if (!ft([h, m], a)) {
|
|
2856
2859
|
const d = pe({
|
|
2857
2860
|
dates: [h, m],
|
|
2858
2861
|
timerange: e,
|
|
@@ -2868,7 +2871,7 @@ function xe({
|
|
|
2868
2871
|
);
|
|
2869
2872
|
}
|
|
2870
2873
|
}
|
|
2871
|
-
}), i.sort((
|
|
2874
|
+
}), i.sort((l, c) => l.x < c.x ? -1 : l.x > c.x ? 1 : 0);
|
|
2872
2875
|
}
|
|
2873
2876
|
function pe({
|
|
2874
2877
|
dates: s,
|
|
@@ -2878,11 +2881,11 @@ function pe({
|
|
|
2878
2881
|
const i = [], r = `${e}s`;
|
|
2879
2882
|
if (s.length === 1)
|
|
2880
2883
|
return s;
|
|
2881
|
-
const
|
|
2882
|
-
for (let o = 0; o <
|
|
2883
|
-
const
|
|
2884
|
-
if (!ft([
|
|
2885
|
-
const _ = T(
|
|
2884
|
+
const a = s.sort((o, l) => o < l ? -1 : o > l ? 1 : 0);
|
|
2885
|
+
for (let o = 0; o < a.length - 1; o++) {
|
|
2886
|
+
const l = a[o], c = a[o + 1];
|
|
2887
|
+
if (!ft([l, c], r)) {
|
|
2888
|
+
const _ = T(l, D(r)).add(
|
|
2886
2889
|
t,
|
|
2887
2890
|
r
|
|
2888
2891
|
), u = T(c, D(r));
|
|
@@ -2903,10 +2906,10 @@ function we({
|
|
|
2903
2906
|
values: t,
|
|
2904
2907
|
groupBy: "all"
|
|
2905
2908
|
});
|
|
2906
|
-
return Object.keys(r).forEach((
|
|
2907
|
-
const o = r[
|
|
2909
|
+
return Object.keys(r).forEach((a) => {
|
|
2910
|
+
const o = r[a], l = o[0].operator === "count" ? "+" : o[0].operator, c = j({
|
|
2908
2911
|
values: o.map((_) => _.value),
|
|
2909
|
-
operator:
|
|
2912
|
+
operator: l
|
|
2910
2913
|
});
|
|
2911
2914
|
i.push({
|
|
2912
2915
|
...o[0],
|
|
@@ -2967,8 +2970,8 @@ function ft(s, e) {
|
|
|
2967
2970
|
if (s.length === 1)
|
|
2968
2971
|
return !0;
|
|
2969
2972
|
for (let r = 0; r < s.length - 1; r++) {
|
|
2970
|
-
const
|
|
2971
|
-
Math.abs(
|
|
2973
|
+
const a = T(s[r], i), l = T(s[r + 1], i).diff(a, e);
|
|
2974
|
+
Math.abs(l) === 1 ? t = !0 : t = !1;
|
|
2972
2975
|
}
|
|
2973
2976
|
return t;
|
|
2974
2977
|
}
|
|
@@ -2978,8 +2981,8 @@ function gt({
|
|
|
2978
2981
|
}) {
|
|
2979
2982
|
const t = {};
|
|
2980
2983
|
return s.forEach((i) => {
|
|
2981
|
-
const r = i.x,
|
|
2982
|
-
t[
|
|
2984
|
+
const r = i.x, a = i.type, o = i.stacked, l = e === "all" ? `${r}-${a}-${o}` : `${a}-${o}`;
|
|
2985
|
+
t[l] || (t[l] = []), t[l].push(i);
|
|
2983
2986
|
}), t;
|
|
2984
2987
|
}
|
|
2985
2988
|
function D(s) {
|
|
@@ -3015,7 +3018,7 @@ const ke = {
|
|
|
3015
3018
|
fieldName: s.x.name,
|
|
3016
3019
|
values: e,
|
|
3017
3020
|
fields: t
|
|
3018
|
-
}),
|
|
3021
|
+
}), a = [];
|
|
3019
3022
|
s.y.forEach((d) => {
|
|
3020
3023
|
Object.keys(r).forEach((b) => {
|
|
3021
3024
|
const x = r[b].label, y = r[b].entries;
|
|
@@ -3034,7 +3037,7 @@ const ke = {
|
|
|
3034
3037
|
values: yt,
|
|
3035
3038
|
operator: d.operator
|
|
3036
3039
|
});
|
|
3037
|
-
|
|
3040
|
+
a.push({
|
|
3038
3041
|
x: x || !1,
|
|
3039
3042
|
value: xt,
|
|
3040
3043
|
type: V,
|
|
@@ -3051,7 +3054,7 @@ const ke = {
|
|
|
3051
3054
|
values: v,
|
|
3052
3055
|
operator: d.operator
|
|
3053
3056
|
});
|
|
3054
|
-
|
|
3057
|
+
a.push({
|
|
3055
3058
|
x: x || !1,
|
|
3056
3059
|
value: C,
|
|
3057
3060
|
type: mt({
|
|
@@ -3064,9 +3067,9 @@ const ke = {
|
|
|
3064
3067
|
}
|
|
3065
3068
|
});
|
|
3066
3069
|
});
|
|
3067
|
-
const o = s.y.some((d) => d.label !== void 0),
|
|
3068
|
-
let _ = [...
|
|
3069
|
-
|
|
3070
|
+
const o = s.y.some((d) => d.label !== void 0), l = s.y.some((d) => d.stacked !== void 0);
|
|
3071
|
+
let _ = [...a.sort((d, b) => d.x < b.x ? -1 : d.x > b.x ? 1 : 0)];
|
|
3072
|
+
l && s.y.filter((d) => d.stacked !== void 0).length > 1 && (_ = _.map((d) => ({ ...d, type: `${d.type} - ${d.stacked}` })));
|
|
3070
3073
|
let u = [..._];
|
|
3071
3074
|
s.type === "pie" && u.some((d) => d.x === !1) ? u = u.map((d) => d.x === !1 ? { ...d, x: (i == null ? void 0 : i.uninformedString) || "Not informed" } : d) : _.some((d) => d.x === !1) && (u = u.filter(
|
|
3072
3075
|
(d) => d.x !== !1
|
|
@@ -3079,8 +3082,8 @@ const ke = {
|
|
|
3079
3082
|
}) : s.type == "pie" && (h = u.sort((d, b) => b.value - d.value));
|
|
3080
3083
|
const m = {
|
|
3081
3084
|
data: h,
|
|
3082
|
-
isGroup:
|
|
3083
|
-
isStack:
|
|
3085
|
+
isGroup: l || o,
|
|
3086
|
+
isStack: l
|
|
3084
3087
|
};
|
|
3085
3088
|
if (s.type === "line" && s.y_range && (m.yAxisOpts = {
|
|
3086
3089
|
mode: s.y_range
|
|
@@ -3127,7 +3130,7 @@ function j({
|
|
|
3127
3130
|
})
|
|
3128
3131
|
);
|
|
3129
3132
|
case "avg": {
|
|
3130
|
-
const i = e.reduce((r,
|
|
3133
|
+
const i = e.reduce((r, a) => r + a, 0) / e.length || 0;
|
|
3131
3134
|
return Y(i);
|
|
3132
3135
|
}
|
|
3133
3136
|
case "min":
|
|
@@ -3146,12 +3149,12 @@ function G({
|
|
|
3146
3149
|
}) {
|
|
3147
3150
|
const i = {};
|
|
3148
3151
|
return t.forEach((r) => {
|
|
3149
|
-
const { value:
|
|
3152
|
+
const { value: a, label: o } = H({
|
|
3150
3153
|
fields: e,
|
|
3151
3154
|
values: r,
|
|
3152
3155
|
fieldName: s
|
|
3153
3156
|
});
|
|
3154
|
-
i[
|
|
3157
|
+
i[a] || (i[a] = { label: o, entries: [] }), i[a].entries.push(r);
|
|
3155
3158
|
}), i;
|
|
3156
3159
|
}
|
|
3157
3160
|
function Oe(s) {
|
|
@@ -3171,10 +3174,10 @@ function mt({
|
|
|
3171
3174
|
function bt(s, e = 0.1) {
|
|
3172
3175
|
if (s.length === 0)
|
|
3173
3176
|
throw new Error("The values array cannot be empty.");
|
|
3174
|
-
const t = s.map((o) => o.value), i = Math.min(...t), r = Math.max(...t),
|
|
3177
|
+
const t = s.map((o) => o.value), i = Math.min(...t), r = Math.max(...t), a = (r - i) * e;
|
|
3175
3178
|
return {
|
|
3176
|
-
min: i -
|
|
3177
|
-
max: r +
|
|
3179
|
+
min: i - a,
|
|
3180
|
+
max: r + a
|
|
3178
3181
|
};
|
|
3179
3182
|
}
|
|
3180
3183
|
const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|