@gisce/ooui 2.14.0-alpha.1 → 2.14.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/JSONField.d.ts +6 -0
- package/dist/JSONField.d.ts.map +1 -0
- package/dist/WidgetFactory.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/ooui.es.js +251 -237
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/JSONField.ts +7 -0
- package/src/WidgetFactory.ts +8 -0
- package/src/index.ts +2 -0
- package/src/spec/Form.spec.ts +30 -0
- package/src/spec/JSONField.spec.ts +22 -0
- package/src/spec/WidgetFactory.spec.ts +10 -1
package/dist/ooui.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var n = (i, t, e) => (
|
|
4
|
-
import { decode as
|
|
5
|
-
import { evaluateCondition as
|
|
1
|
+
var _e = Object.defineProperty;
|
|
2
|
+
var fe = (i, t, e) => t in i ? _e(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var n = (i, t, e) => (fe(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { decode as ge } from "html-entities";
|
|
5
|
+
import { evaluateCondition as me } from "@gisce/conscheck";
|
|
6
6
|
import * as Y from "txml";
|
|
7
7
|
import P from "moment";
|
|
8
8
|
const k = class k {
|
|
@@ -115,13 +115,13 @@ const k = class k {
|
|
|
115
115
|
*/
|
|
116
116
|
n(k, "_defaultColspan", 1);
|
|
117
117
|
let C = k;
|
|
118
|
-
const
|
|
118
|
+
const be = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ye = ({
|
|
119
119
|
entry: i,
|
|
120
120
|
values: t,
|
|
121
121
|
fields: e
|
|
122
122
|
}) => {
|
|
123
123
|
let [s, r, a] = i, l = t[s];
|
|
124
|
-
const o =
|
|
124
|
+
const o = J({
|
|
125
125
|
fieldName: s,
|
|
126
126
|
valueInObject: l,
|
|
127
127
|
expectedValue: a,
|
|
@@ -151,7 +151,7 @@ const ge = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), me
|
|
|
151
151
|
default:
|
|
152
152
|
return !1;
|
|
153
153
|
}
|
|
154
|
-
}, b = (i) =>
|
|
154
|
+
}, b = (i) => ge(i, { level: "xml" }), J = ({
|
|
155
155
|
fieldName: i,
|
|
156
156
|
valueInObject: t,
|
|
157
157
|
expectedValue: e,
|
|
@@ -171,7 +171,7 @@ const ge = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), me
|
|
|
171
171
|
modifiedExpectedValue: null,
|
|
172
172
|
directOutcome: !1
|
|
173
173
|
} : (r.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject = r.modifiedValueInObject === void 0 ? !1 : r.modifiedValueInObject, r.modifiedValueInObject = r.modifiedValueInObject === null ? !1 : r.modifiedValueInObject), s[i].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
|
|
174
|
-
},
|
|
174
|
+
}, xe = ({
|
|
175
175
|
attrs: i,
|
|
176
176
|
values: t,
|
|
177
177
|
fields: e,
|
|
@@ -179,11 +179,11 @@ const ge = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), me
|
|
|
179
179
|
}) => {
|
|
180
180
|
const h = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(h), u = JSON.parse(_), d = {};
|
|
181
181
|
for (const f of Object.keys(u)) {
|
|
182
|
-
const x = u[f].map((y) =>
|
|
182
|
+
const x = u[f].map((y) => ye({ entry: y, values: t, fields: e })).every((y) => y);
|
|
183
183
|
x ? d[f] = !0 : f === "readonly" && !x && s === "button" && (d[f] = !1);
|
|
184
184
|
}
|
|
185
185
|
return d;
|
|
186
|
-
},
|
|
186
|
+
}, pe = ({
|
|
187
187
|
attrs: i,
|
|
188
188
|
values: t,
|
|
189
189
|
fields: e,
|
|
@@ -194,14 +194,14 @@ const ge = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), me
|
|
|
194
194
|
r.replace(/'/g, '"')
|
|
195
195
|
), l = {};
|
|
196
196
|
for (const o of Object.keys(a)) {
|
|
197
|
-
const h =
|
|
197
|
+
const h = me({
|
|
198
198
|
object: t,
|
|
199
199
|
condition: a[o],
|
|
200
200
|
evaluateFieldComparison: ({
|
|
201
201
|
fieldName: _,
|
|
202
202
|
valueInObject: u,
|
|
203
203
|
expectedValue: d
|
|
204
|
-
}) =>
|
|
204
|
+
}) => J({
|
|
205
205
|
fieldName: _,
|
|
206
206
|
valueInObject: u,
|
|
207
207
|
expectedValue: d,
|
|
@@ -216,7 +216,7 @@ const ge = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), me
|
|
|
216
216
|
"Error parsing new json_attrs. Original string: " + i
|
|
217
217
|
) : r;
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, we = ({
|
|
220
220
|
tagAttributes: i,
|
|
221
221
|
values: t,
|
|
222
222
|
fields: e,
|
|
@@ -224,14 +224,14 @@ const ge = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), me
|
|
|
224
224
|
fallbackMode: r = !0
|
|
225
225
|
}) => {
|
|
226
226
|
let a = {}, l = {};
|
|
227
|
-
if (i.attrs && (l =
|
|
227
|
+
if (i.attrs && (l = xe({
|
|
228
228
|
attrs: i.attrs,
|
|
229
229
|
values: t,
|
|
230
230
|
fields: e,
|
|
231
231
|
widgetType: s
|
|
232
232
|
})), i.json_attrs)
|
|
233
233
|
try {
|
|
234
|
-
a =
|
|
234
|
+
a = pe({
|
|
235
235
|
attrs: i.json_attrs,
|
|
236
236
|
values: t,
|
|
237
237
|
fields: e,
|
|
@@ -298,7 +298,7 @@ class g extends C {
|
|
|
298
298
|
* Values and keys
|
|
299
299
|
*/
|
|
300
300
|
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
301
|
-
this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(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 = b(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline =
|
|
301
|
+
this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(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 = b(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = be(e.help_inline)));
|
|
302
302
|
}
|
|
303
303
|
get id() {
|
|
304
304
|
return this._id;
|
|
@@ -362,14 +362,14 @@ class g extends C {
|
|
|
362
362
|
return this._id === e ? this : null;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
class
|
|
365
|
+
class ve extends g {
|
|
366
366
|
}
|
|
367
|
-
class
|
|
367
|
+
class H extends C {
|
|
368
368
|
findById(t) {
|
|
369
369
|
return null;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
class
|
|
372
|
+
class Q extends g {
|
|
373
373
|
constructor(e) {
|
|
374
374
|
super({ ...e, nolabel: !0 });
|
|
375
375
|
/**
|
|
@@ -492,13 +492,13 @@ class z {
|
|
|
492
492
|
}
|
|
493
493
|
addWidget(t, e) {
|
|
494
494
|
const s = [], r = e ? e.addLabel : !0;
|
|
495
|
-
if (t instanceof
|
|
495
|
+
if (t instanceof H) {
|
|
496
496
|
this._rows.push([]), this._index++;
|
|
497
497
|
return;
|
|
498
498
|
}
|
|
499
499
|
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof g && !t.nolabel) {
|
|
500
500
|
t.colspan > 1 && (t.colspan -= 1);
|
|
501
|
-
const l = new
|
|
501
|
+
const l = new Q({
|
|
502
502
|
name: t.id + "_label",
|
|
503
503
|
string: t.label,
|
|
504
504
|
invisible: t.invisible,
|
|
@@ -627,7 +627,7 @@ const T = class T extends p {
|
|
|
627
627
|
};
|
|
628
628
|
n(T, "_defaultColspan", 3);
|
|
629
629
|
let M = T;
|
|
630
|
-
class
|
|
630
|
+
class Fe extends p {
|
|
631
631
|
constructor(e) {
|
|
632
632
|
super(e);
|
|
633
633
|
n(this, "_icon", null);
|
|
@@ -640,7 +640,7 @@ class we extends p {
|
|
|
640
640
|
this._icon = e;
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
class
|
|
643
|
+
class Ce extends p {
|
|
644
644
|
constructor(e) {
|
|
645
645
|
super(e);
|
|
646
646
|
n(this, "_icon", null);
|
|
@@ -653,7 +653,7 @@ class ve extends p {
|
|
|
653
653
|
this._icon = e;
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
class
|
|
656
|
+
class X extends g {
|
|
657
657
|
constructor(e) {
|
|
658
658
|
super({
|
|
659
659
|
...e,
|
|
@@ -725,7 +725,7 @@ class Q extends g {
|
|
|
725
725
|
this._danger = e;
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
class
|
|
728
|
+
class ke extends p {
|
|
729
729
|
constructor(e) {
|
|
730
730
|
super(e);
|
|
731
731
|
n(this, "_defaultName", "");
|
|
@@ -879,7 +879,7 @@ class E extends g {
|
|
|
879
879
|
this._size = e;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
class
|
|
882
|
+
class Oe extends g {
|
|
883
883
|
constructor(e) {
|
|
884
884
|
super(e);
|
|
885
885
|
/**
|
|
@@ -905,14 +905,14 @@ class Ce extends g {
|
|
|
905
905
|
this._relation = e;
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
|
-
class
|
|
908
|
+
class Te extends B {
|
|
909
909
|
}
|
|
910
|
-
class
|
|
910
|
+
class U extends g {
|
|
911
911
|
constructor(t) {
|
|
912
912
|
super(t);
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
|
-
class
|
|
915
|
+
class Pe extends g {
|
|
916
916
|
constructor(t) {
|
|
917
917
|
super(t);
|
|
918
918
|
}
|
|
@@ -950,23 +950,23 @@ class L extends g {
|
|
|
950
950
|
this._decimalDigits = e;
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
|
-
class Te extends L {
|
|
954
|
-
}
|
|
955
|
-
class Pe extends g {
|
|
956
|
-
}
|
|
957
953
|
class Ee extends L {
|
|
958
954
|
}
|
|
959
955
|
class Ie extends g {
|
|
956
|
+
}
|
|
957
|
+
class We extends L {
|
|
958
|
+
}
|
|
959
|
+
class Se extends g {
|
|
960
960
|
constructor(t) {
|
|
961
961
|
super(t);
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
class
|
|
964
|
+
class ze extends g {
|
|
965
965
|
constructor(t) {
|
|
966
966
|
super(t);
|
|
967
967
|
}
|
|
968
968
|
}
|
|
969
|
-
class
|
|
969
|
+
class K extends g {
|
|
970
970
|
constructor(e) {
|
|
971
971
|
super(e);
|
|
972
972
|
/**
|
|
@@ -1060,7 +1060,7 @@ class U extends g {
|
|
|
1060
1060
|
this._infinite = e;
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
|
-
class
|
|
1063
|
+
class Ve extends C {
|
|
1064
1064
|
constructor(e) {
|
|
1065
1065
|
super(e);
|
|
1066
1066
|
/**
|
|
@@ -1086,9 +1086,9 @@ class Se extends C {
|
|
|
1086
1086
|
return null;
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
|
-
class
|
|
1089
|
+
class Ye extends E {
|
|
1090
1090
|
}
|
|
1091
|
-
class
|
|
1091
|
+
class De extends g {
|
|
1092
1092
|
constructor(e) {
|
|
1093
1093
|
super(e);
|
|
1094
1094
|
/**
|
|
@@ -1104,14 +1104,14 @@ class Ve extends g {
|
|
|
1104
1104
|
this._filenameField = e;
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
class
|
|
1107
|
+
class je extends g {
|
|
1108
1108
|
}
|
|
1109
|
-
class
|
|
1109
|
+
class Me extends g {
|
|
1110
1110
|
constructor(t) {
|
|
1111
1111
|
super(t);
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
|
-
class
|
|
1114
|
+
class Ne extends K {
|
|
1115
1115
|
constructor(e) {
|
|
1116
1116
|
super(e);
|
|
1117
1117
|
/**
|
|
@@ -1143,7 +1143,7 @@ class je extends U {
|
|
|
1143
1143
|
return this.parsedWidgetProps.colorField;
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
|
-
class
|
|
1146
|
+
class Ae extends E {
|
|
1147
1147
|
constructor(e) {
|
|
1148
1148
|
super(e);
|
|
1149
1149
|
n(this, "_nolabel", !0);
|
|
@@ -1181,7 +1181,7 @@ class Me extends E {
|
|
|
1181
1181
|
this._actionId = e;
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
|
-
class
|
|
1184
|
+
class Z extends g {
|
|
1185
1185
|
constructor(e) {
|
|
1186
1186
|
super(e);
|
|
1187
1187
|
/**
|
|
@@ -1234,14 +1234,14 @@ class K extends g {
|
|
|
1234
1234
|
this._columns = e;
|
|
1235
1235
|
}
|
|
1236
1236
|
}
|
|
1237
|
-
class
|
|
1237
|
+
class Be extends Z {
|
|
1238
1238
|
}
|
|
1239
|
-
class
|
|
1239
|
+
class Le extends E {
|
|
1240
1240
|
get colors() {
|
|
1241
1241
|
return this._parsedWidgetProps.colors || {};
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
class
|
|
1244
|
+
class Ge extends E {
|
|
1245
1245
|
constructor(e) {
|
|
1246
1246
|
super(e);
|
|
1247
1247
|
/**
|
|
@@ -1257,9 +1257,9 @@ class Be extends E {
|
|
|
1257
1257
|
this._direction = e;
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
class
|
|
1260
|
+
class $e extends U {
|
|
1261
1261
|
}
|
|
1262
|
-
class
|
|
1262
|
+
class Re extends g {
|
|
1263
1263
|
constructor(e) {
|
|
1264
1264
|
super(e);
|
|
1265
1265
|
/**
|
|
@@ -1282,7 +1282,7 @@ class Ge extends g {
|
|
|
1282
1282
|
this._errorField = e;
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
|
-
class
|
|
1285
|
+
class ee extends B {
|
|
1286
1286
|
constructor(e) {
|
|
1287
1287
|
super(e);
|
|
1288
1288
|
n(this, "_lang", null);
|
|
@@ -1295,12 +1295,12 @@ class $e extends B {
|
|
|
1295
1295
|
this._lang = e;
|
|
1296
1296
|
}
|
|
1297
1297
|
}
|
|
1298
|
-
class
|
|
1298
|
+
class qe extends g {
|
|
1299
1299
|
constructor(t) {
|
|
1300
1300
|
super(t);
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
|
-
class
|
|
1303
|
+
class Je extends p {
|
|
1304
1304
|
constructor(e) {
|
|
1305
1305
|
super(e);
|
|
1306
1306
|
/**
|
|
@@ -1340,7 +1340,7 @@ class qe extends p {
|
|
|
1340
1340
|
return this._container.rows.flat().filter((e) => !e.invisible);
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
|
-
class
|
|
1343
|
+
class He extends g {
|
|
1344
1344
|
constructor(e) {
|
|
1345
1345
|
super(e);
|
|
1346
1346
|
/**
|
|
@@ -1359,6 +1359,12 @@ class Je extends g {
|
|
|
1359
1359
|
this._height = e;
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
|
+
class R extends ee {
|
|
1363
|
+
constructor() {
|
|
1364
|
+
super(...arguments);
|
|
1365
|
+
n(this, "_lang", "json");
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1362
1368
|
class G {
|
|
1363
1369
|
constructor() {
|
|
1364
1370
|
/**
|
|
@@ -1372,13 +1378,13 @@ class G {
|
|
|
1372
1378
|
this._widgetClass = M;
|
|
1373
1379
|
break;
|
|
1374
1380
|
case "page":
|
|
1375
|
-
this._widgetClass =
|
|
1381
|
+
this._widgetClass = Fe;
|
|
1376
1382
|
break;
|
|
1377
1383
|
case "group":
|
|
1378
|
-
this._widgetClass =
|
|
1384
|
+
this._widgetClass = Ce;
|
|
1379
1385
|
break;
|
|
1380
1386
|
case "label":
|
|
1381
|
-
this._widgetClass =
|
|
1387
|
+
this._widgetClass = Q;
|
|
1382
1388
|
break;
|
|
1383
1389
|
case "char":
|
|
1384
1390
|
this._widgetClass = D;
|
|
@@ -1387,51 +1393,51 @@ class G {
|
|
|
1387
1393
|
this._widgetClass = B;
|
|
1388
1394
|
break;
|
|
1389
1395
|
case "button":
|
|
1390
|
-
this._widgetClass =
|
|
1396
|
+
this._widgetClass = X;
|
|
1391
1397
|
break;
|
|
1392
1398
|
case "buttonGroup":
|
|
1393
|
-
this._widgetClass =
|
|
1399
|
+
this._widgetClass = ke;
|
|
1394
1400
|
break;
|
|
1395
1401
|
case "selection":
|
|
1396
1402
|
this._widgetClass = E;
|
|
1397
1403
|
break;
|
|
1398
1404
|
case "many2one":
|
|
1399
|
-
this._widgetClass =
|
|
1405
|
+
this._widgetClass = Oe;
|
|
1400
1406
|
break;
|
|
1401
1407
|
case "boolean":
|
|
1402
|
-
this._widgetClass =
|
|
1408
|
+
this._widgetClass = U;
|
|
1403
1409
|
break;
|
|
1404
1410
|
case "integer":
|
|
1405
|
-
this._widgetClass =
|
|
1411
|
+
this._widgetClass = Pe;
|
|
1406
1412
|
break;
|
|
1407
1413
|
case "float":
|
|
1408
1414
|
this._widgetClass = L;
|
|
1409
1415
|
break;
|
|
1410
1416
|
case "float_time":
|
|
1411
|
-
this._widgetClass =
|
|
1417
|
+
this._widgetClass = Ee;
|
|
1412
1418
|
break;
|
|
1413
1419
|
case "date":
|
|
1414
|
-
this._widgetClass =
|
|
1420
|
+
this._widgetClass = Se;
|
|
1415
1421
|
break;
|
|
1416
1422
|
case "datetime":
|
|
1417
|
-
this._widgetClass =
|
|
1423
|
+
this._widgetClass = ze;
|
|
1418
1424
|
break;
|
|
1419
1425
|
case "progressbar":
|
|
1420
|
-
this._widgetClass =
|
|
1426
|
+
this._widgetClass = We;
|
|
1421
1427
|
break;
|
|
1422
1428
|
case "markdown":
|
|
1423
|
-
this._widgetClass =
|
|
1429
|
+
this._widgetClass = Te;
|
|
1424
1430
|
break;
|
|
1425
1431
|
case "many2many":
|
|
1426
1432
|
case "one2many":
|
|
1427
1433
|
case "one2many_list":
|
|
1428
|
-
this._widgetClass =
|
|
1434
|
+
this._widgetClass = K;
|
|
1429
1435
|
break;
|
|
1430
1436
|
case "newline":
|
|
1431
|
-
this._widgetClass =
|
|
1437
|
+
this._widgetClass = H;
|
|
1432
1438
|
break;
|
|
1433
1439
|
case "separator":
|
|
1434
|
-
this._widgetClass =
|
|
1440
|
+
this._widgetClass = Ve;
|
|
1435
1441
|
break;
|
|
1436
1442
|
case "url":
|
|
1437
1443
|
this._widgetClass = D;
|
|
@@ -1440,62 +1446,69 @@ class G {
|
|
|
1440
1446
|
this._widgetClass = D;
|
|
1441
1447
|
break;
|
|
1442
1448
|
case "reference":
|
|
1443
|
-
this._widgetClass =
|
|
1449
|
+
this._widgetClass = Ye;
|
|
1444
1450
|
break;
|
|
1445
1451
|
case "binary":
|
|
1446
|
-
this._widgetClass =
|
|
1452
|
+
this._widgetClass = De;
|
|
1447
1453
|
break;
|
|
1448
1454
|
case "image":
|
|
1449
|
-
this._widgetClass =
|
|
1455
|
+
this._widgetClass = je;
|
|
1450
1456
|
break;
|
|
1451
1457
|
case "fiber_grid":
|
|
1452
|
-
this._widgetClass =
|
|
1458
|
+
this._widgetClass = Me;
|
|
1453
1459
|
break;
|
|
1454
1460
|
case "timeline":
|
|
1455
|
-
this._widgetClass =
|
|
1461
|
+
this._widgetClass = Ne;
|
|
1456
1462
|
break;
|
|
1457
1463
|
case "indicator":
|
|
1458
|
-
this._widgetClass =
|
|
1464
|
+
this._widgetClass = Ae;
|
|
1459
1465
|
break;
|
|
1460
1466
|
case "tags":
|
|
1461
|
-
this._widgetClass =
|
|
1467
|
+
this._widgetClass = Be;
|
|
1462
1468
|
break;
|
|
1463
1469
|
case "tag":
|
|
1464
|
-
this._widgetClass =
|
|
1470
|
+
this._widgetClass = Le;
|
|
1465
1471
|
break;
|
|
1466
1472
|
case "avatar":
|
|
1467
|
-
this._widgetClass =
|
|
1473
|
+
this._widgetClass = ve;
|
|
1468
1474
|
break;
|
|
1469
1475
|
case "radio":
|
|
1470
|
-
this._widgetClass =
|
|
1476
|
+
this._widgetClass = Ge;
|
|
1471
1477
|
break;
|
|
1472
1478
|
case "multicheckbox":
|
|
1473
|
-
this._widgetClass =
|
|
1479
|
+
this._widgetClass = Z;
|
|
1474
1480
|
break;
|
|
1475
1481
|
case "switch":
|
|
1476
|
-
this._widgetClass =
|
|
1482
|
+
this._widgetClass = $e;
|
|
1477
1483
|
break;
|
|
1478
1484
|
case "steps":
|
|
1479
|
-
this._widgetClass =
|
|
1485
|
+
this._widgetClass = Re;
|
|
1480
1486
|
break;
|
|
1481
1487
|
case "codeeditor":
|
|
1482
|
-
this._widgetClass =
|
|
1488
|
+
this._widgetClass = ee;
|
|
1483
1489
|
break;
|
|
1484
1490
|
case "time":
|
|
1485
|
-
this._widgetClass =
|
|
1491
|
+
this._widgetClass = qe;
|
|
1486
1492
|
break;
|
|
1487
1493
|
case "html_preview":
|
|
1488
|
-
this._widgetClass =
|
|
1494
|
+
this._widgetClass = Ie;
|
|
1489
1495
|
break;
|
|
1490
1496
|
case "alert":
|
|
1491
|
-
this._widgetClass =
|
|
1497
|
+
this._widgetClass = Je;
|
|
1492
1498
|
break;
|
|
1493
1499
|
case "comments_timeline":
|
|
1494
|
-
this._widgetClass =
|
|
1500
|
+
this._widgetClass = He;
|
|
1501
|
+
break;
|
|
1502
|
+
case "json":
|
|
1503
|
+
this._widgetClass = R;
|
|
1504
|
+
break;
|
|
1505
|
+
case "arrow_steps":
|
|
1506
|
+
this._widgetClass = R;
|
|
1495
1507
|
break;
|
|
1496
1508
|
}
|
|
1497
1509
|
}
|
|
1498
1510
|
createWidget(t, e) {
|
|
1511
|
+
this._widgetClass = void 0;
|
|
1499
1512
|
let s = t;
|
|
1500
1513
|
switch (this.setWidgetClass(t), this._widgetClass === void 0 && (s = e.fieldsWidgetType, this.setWidgetClass(e.fieldsWidgetType)), this._widgetClass === void 0 && (this._widgetClass = C), t) {
|
|
1501
1514
|
case "notebook":
|
|
@@ -1513,7 +1526,7 @@ class G {
|
|
|
1513
1526
|
}
|
|
1514
1527
|
}
|
|
1515
1528
|
}
|
|
1516
|
-
const
|
|
1529
|
+
const Qe = ({
|
|
1517
1530
|
fieldName: i,
|
|
1518
1531
|
values: t,
|
|
1519
1532
|
fields: e
|
|
@@ -1538,7 +1551,7 @@ const He = ({
|
|
|
1538
1551
|
r[o] = h.some((_) => _);
|
|
1539
1552
|
}
|
|
1540
1553
|
return r;
|
|
1541
|
-
},
|
|
1554
|
+
}, Xe = ({
|
|
1542
1555
|
states: i,
|
|
1543
1556
|
values: t
|
|
1544
1557
|
}) => {
|
|
@@ -1547,7 +1560,7 @@ const He = ({
|
|
|
1547
1560
|
const e = i.split(",");
|
|
1548
1561
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1549
1562
|
};
|
|
1550
|
-
function
|
|
1563
|
+
function Ue({
|
|
1551
1564
|
values: i = {},
|
|
1552
1565
|
fieldName: t,
|
|
1553
1566
|
fields: e = {}
|
|
@@ -1556,7 +1569,7 @@ function Xe({
|
|
|
1556
1569
|
const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
|
|
1557
1570
|
return s === "many2one" ? i[t] ? i[t][0] || null : !1 : s === "one2many" || s === "many2many" ? i[t].map((a) => a.id) : i != null && i[t] ? i == null ? void 0 : i[t] : t.includes("'") ? t : parseInt(t);
|
|
1558
1571
|
}
|
|
1559
|
-
const
|
|
1572
|
+
const te = ({
|
|
1560
1573
|
context: i,
|
|
1561
1574
|
values: t,
|
|
1562
1575
|
fields: e
|
|
@@ -1564,9 +1577,9 @@ const Z = ({
|
|
|
1564
1577
|
try {
|
|
1565
1578
|
if (!i)
|
|
1566
1579
|
return;
|
|
1567
|
-
if (
|
|
1580
|
+
if (se(i) || typeof i != "string")
|
|
1568
1581
|
return i;
|
|
1569
|
-
const s =
|
|
1582
|
+
const s = ie(i);
|
|
1570
1583
|
if (s !== null)
|
|
1571
1584
|
return s;
|
|
1572
1585
|
if (i.trim().length === 0)
|
|
@@ -1575,7 +1588,7 @@ const Z = ({
|
|
|
1575
1588
|
return d.forEach((c) => {
|
|
1576
1589
|
const m = c[1];
|
|
1577
1590
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1578
|
-
const x =
|
|
1591
|
+
const x = Ue({
|
|
1579
1592
|
values: t,
|
|
1580
1593
|
fields: e,
|
|
1581
1594
|
fieldName: m === "active_id" ? "id" : m
|
|
@@ -1590,34 +1603,34 @@ const Z = ({
|
|
|
1590
1603
|
} catch {
|
|
1591
1604
|
return;
|
|
1592
1605
|
}
|
|
1593
|
-
},
|
|
1606
|
+
}, Ft = (i) => {
|
|
1594
1607
|
const t = [];
|
|
1595
1608
|
try {
|
|
1596
|
-
return !i ||
|
|
1609
|
+
return !i || se(i) || typeof i != "string" ? t : ie(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) => {
|
|
1597
1610
|
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1598
1611
|
}), t);
|
|
1599
1612
|
} catch {
|
|
1600
1613
|
}
|
|
1601
1614
|
return t;
|
|
1602
1615
|
};
|
|
1603
|
-
function
|
|
1616
|
+
function ie(i) {
|
|
1604
1617
|
try {
|
|
1605
1618
|
return JSON.parse(i.replace(/'/g, '"'));
|
|
1606
1619
|
} catch {
|
|
1607
1620
|
return null;
|
|
1608
1621
|
}
|
|
1609
1622
|
}
|
|
1610
|
-
function
|
|
1623
|
+
function se(i) {
|
|
1611
1624
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1612
1625
|
}
|
|
1613
|
-
const
|
|
1626
|
+
const Ke = (i) => {
|
|
1614
1627
|
const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1615
1628
|
return {
|
|
1616
1629
|
method: e,
|
|
1617
1630
|
args: r
|
|
1618
1631
|
};
|
|
1619
1632
|
};
|
|
1620
|
-
function
|
|
1633
|
+
function Ze(i) {
|
|
1621
1634
|
const t = [];
|
|
1622
1635
|
function e(s) {
|
|
1623
1636
|
const r = [];
|
|
@@ -1629,7 +1642,7 @@ function Ke(i) {
|
|
|
1629
1642
|
e(s);
|
|
1630
1643
|
return t.flat();
|
|
1631
1644
|
}
|
|
1632
|
-
class
|
|
1645
|
+
class Ct {
|
|
1633
1646
|
constructor(t, e = 4) {
|
|
1634
1647
|
/**
|
|
1635
1648
|
* Object containing fields specification of the form.
|
|
@@ -1737,7 +1750,7 @@ class Ft {
|
|
|
1737
1750
|
fields: a.children,
|
|
1738
1751
|
container: this._container,
|
|
1739
1752
|
values: s
|
|
1740
|
-
}),
|
|
1753
|
+
}), Ze(this._container._rows).forEach((h) => {
|
|
1741
1754
|
const _ = h;
|
|
1742
1755
|
_._id && _._context && (this._contextForFields[_._id] = h._context);
|
|
1743
1756
|
});
|
|
@@ -1769,31 +1782,31 @@ class Ft {
|
|
|
1769
1782
|
fieldsWidgetType: this._fields[v].type
|
|
1770
1783
|
};
|
|
1771
1784
|
}
|
|
1772
|
-
const d =
|
|
1785
|
+
const d = we({
|
|
1773
1786
|
tagAttributes: u,
|
|
1774
1787
|
values: s,
|
|
1775
1788
|
fields: this._fields,
|
|
1776
1789
|
widgetType: l
|
|
1777
1790
|
});
|
|
1778
1791
|
let f;
|
|
1779
|
-
l === "button" && u.states ? f =
|
|
1792
|
+
l === "button" && u.states ? f = Xe({
|
|
1780
1793
|
states: u.states,
|
|
1781
1794
|
values: s
|
|
1782
|
-
}) : f =
|
|
1795
|
+
}) : f = Qe({
|
|
1783
1796
|
fieldName: u.name,
|
|
1784
1797
|
values: s,
|
|
1785
1798
|
fields: this._fields
|
|
1786
1799
|
});
|
|
1787
|
-
const c =
|
|
1800
|
+
const c = te({
|
|
1788
1801
|
context: u.context || ((w = this._fields[u.name]) == null ? void 0 : w.context),
|
|
1789
1802
|
values: s,
|
|
1790
1803
|
fields: this._fields
|
|
1791
1804
|
});
|
|
1792
|
-
u.on_change && (this._onChangeFields[u.name] =
|
|
1805
|
+
u.on_change && (this._onChangeFields[u.name] = Ke(
|
|
1793
1806
|
u.on_change
|
|
1794
1807
|
));
|
|
1795
1808
|
let m;
|
|
1796
|
-
|
|
1809
|
+
q(u.domain) ? m = u.domain : q((F = this._fields[u.name]) == null ? void 0 : F.domain) && (m = this._fields[u.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1797
1810
|
const x = {
|
|
1798
1811
|
...d,
|
|
1799
1812
|
...f,
|
|
@@ -1807,7 +1820,7 @@ class Ft {
|
|
|
1807
1820
|
fields: h,
|
|
1808
1821
|
container: y.container,
|
|
1809
1822
|
values: s
|
|
1810
|
-
}), y instanceof
|
|
1823
|
+
}), y instanceof X && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
1811
1824
|
});
|
|
1812
1825
|
}
|
|
1813
1826
|
/**
|
|
@@ -1818,10 +1831,10 @@ class Ft {
|
|
|
1818
1831
|
return this.container.findById(t);
|
|
1819
1832
|
}
|
|
1820
1833
|
}
|
|
1821
|
-
function
|
|
1834
|
+
function q(i) {
|
|
1822
1835
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1823
1836
|
}
|
|
1824
|
-
class
|
|
1837
|
+
class kt {
|
|
1825
1838
|
constructor(t) {
|
|
1826
1839
|
/**
|
|
1827
1840
|
* Object containing fields specification of the form.
|
|
@@ -1900,7 +1913,7 @@ class Ct {
|
|
|
1900
1913
|
throw new Error(`Field ${h} doesn't exist in fields defintion`);
|
|
1901
1914
|
const d = this._fields[h];
|
|
1902
1915
|
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;
|
|
1903
|
-
const f =
|
|
1916
|
+
const f = te({
|
|
1904
1917
|
context: l.context || d.context,
|
|
1905
1918
|
values: {},
|
|
1906
1919
|
fields: this._fields
|
|
@@ -1927,7 +1940,7 @@ class Ct {
|
|
|
1927
1940
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
1928
1941
|
}
|
|
1929
1942
|
}
|
|
1930
|
-
const
|
|
1943
|
+
const et = {
|
|
1931
1944
|
text: "text",
|
|
1932
1945
|
many2one: "many2one",
|
|
1933
1946
|
char: "char",
|
|
@@ -1940,7 +1953,7 @@ const Ze = {
|
|
|
1940
1953
|
date: "date",
|
|
1941
1954
|
datetime: "datetime"
|
|
1942
1955
|
};
|
|
1943
|
-
class
|
|
1956
|
+
class Ot {
|
|
1944
1957
|
constructor(t, e, s = 8) {
|
|
1945
1958
|
/**
|
|
1946
1959
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -1988,7 +2001,7 @@ class kt {
|
|
|
1988
2001
|
colspan: 2
|
|
1989
2002
|
}, { type: a, widget: l } = r;
|
|
1990
2003
|
let o = l ?? a;
|
|
1991
|
-
return
|
|
2004
|
+
return et[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
1992
2005
|
});
|
|
1993
2006
|
}
|
|
1994
2007
|
/**
|
|
@@ -1999,7 +2012,7 @@ class kt {
|
|
|
1999
2012
|
return this.advancedSearchContainer.findById(t);
|
|
2000
2013
|
}
|
|
2001
2014
|
}
|
|
2002
|
-
const
|
|
2015
|
+
const Tt = ({
|
|
2003
2016
|
domain: i,
|
|
2004
2017
|
widgetFieldName: t
|
|
2005
2018
|
}) => {
|
|
@@ -2014,8 +2027,8 @@ const Ot = ({
|
|
|
2014
2027
|
r.length - 1
|
|
2015
2028
|
)) : (o = r, h = "id"), o === t && e.push([h, a, l]);
|
|
2016
2029
|
}), e;
|
|
2017
|
-
},
|
|
2018
|
-
class
|
|
2030
|
+
}, Pt = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2031
|
+
class tt {
|
|
2019
2032
|
constructor(t) {
|
|
2020
2033
|
n(this, "_action_id", null);
|
|
2021
2034
|
n(this, "_position", null);
|
|
@@ -2028,7 +2041,7 @@ class et {
|
|
|
2028
2041
|
return this._position;
|
|
2029
2042
|
}
|
|
2030
2043
|
}
|
|
2031
|
-
class
|
|
2044
|
+
class Et {
|
|
2032
2045
|
constructor(t) {
|
|
2033
2046
|
n(this, "_string", null);
|
|
2034
2047
|
n(this, "_items", []);
|
|
@@ -2036,7 +2049,7 @@ class Pt {
|
|
|
2036
2049
|
this._string = e.attributes.string || null;
|
|
2037
2050
|
const { children: s } = e;
|
|
2038
2051
|
s.forEach((r) => {
|
|
2039
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
2052
|
+
r.tagName === "dashboard_item" && this._items.push(new tt(r.attributes));
|
|
2040
2053
|
});
|
|
2041
2054
|
}
|
|
2042
2055
|
get string() {
|
|
@@ -2046,7 +2059,7 @@ class Pt {
|
|
|
2046
2059
|
return this._items;
|
|
2047
2060
|
}
|
|
2048
2061
|
}
|
|
2049
|
-
class
|
|
2062
|
+
class ne {
|
|
2050
2063
|
constructor(t) {
|
|
2051
2064
|
n(this, "_string", null);
|
|
2052
2065
|
n(this, "_type");
|
|
@@ -2074,8 +2087,8 @@ class ie {
|
|
|
2074
2087
|
return this._y_range;
|
|
2075
2088
|
}
|
|
2076
2089
|
}
|
|
2077
|
-
const
|
|
2078
|
-
class
|
|
2090
|
+
const it = (i) => i === 1 || i === "1" || i === !0 || i === "True";
|
|
2091
|
+
class re extends ne {
|
|
2079
2092
|
constructor(e, s) {
|
|
2080
2093
|
super(s);
|
|
2081
2094
|
n(this, "_color", null);
|
|
@@ -2083,7 +2096,7 @@ class se extends ie {
|
|
|
2083
2096
|
n(this, "_totalDomain", null);
|
|
2084
2097
|
n(this, "_showPercent", !1);
|
|
2085
2098
|
n(this, "_suffix", null);
|
|
2086
|
-
this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent =
|
|
2099
|
+
this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent = it(s.attributes.showPercent);
|
|
2087
2100
|
}
|
|
2088
2101
|
get color() {
|
|
2089
2102
|
return this._color;
|
|
@@ -2101,7 +2114,7 @@ class se extends ie {
|
|
|
2101
2114
|
return this._suffix;
|
|
2102
2115
|
}
|
|
2103
2116
|
}
|
|
2104
|
-
class
|
|
2117
|
+
class st extends re {
|
|
2105
2118
|
constructor(e, s) {
|
|
2106
2119
|
super(e, s);
|
|
2107
2120
|
n(this, "_field");
|
|
@@ -2121,7 +2134,7 @@ class it extends se {
|
|
|
2121
2134
|
return this._operator;
|
|
2122
2135
|
}
|
|
2123
2136
|
}
|
|
2124
|
-
const
|
|
2137
|
+
const nt = (i) => {
|
|
2125
2138
|
const t = [];
|
|
2126
2139
|
let e;
|
|
2127
2140
|
if (i.forEach((s) => {
|
|
@@ -2131,10 +2144,10 @@ const st = (i) => {
|
|
|
2131
2144
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2132
2145
|
if (!l)
|
|
2133
2146
|
throw new Error("Missing name attribute for field");
|
|
2134
|
-
r === "x" ? e = new
|
|
2147
|
+
r === "x" ? e = new lt({
|
|
2135
2148
|
name: l
|
|
2136
2149
|
}) : r === "y" && t.push(
|
|
2137
|
-
new
|
|
2150
|
+
new at({
|
|
2138
2151
|
name: l,
|
|
2139
2152
|
operator: a,
|
|
2140
2153
|
label: o,
|
|
@@ -2151,13 +2164,13 @@ const st = (i) => {
|
|
|
2151
2164
|
y: t
|
|
2152
2165
|
};
|
|
2153
2166
|
};
|
|
2154
|
-
class j extends
|
|
2167
|
+
class j extends ne {
|
|
2155
2168
|
constructor(e, s) {
|
|
2156
2169
|
super(s);
|
|
2157
2170
|
n(this, "_x");
|
|
2158
2171
|
n(this, "_y");
|
|
2159
2172
|
this._type = e;
|
|
2160
|
-
const r =
|
|
2173
|
+
const r = nt(s.children);
|
|
2161
2174
|
this._x = r.x, this._y = r.y;
|
|
2162
2175
|
}
|
|
2163
2176
|
get x() {
|
|
@@ -2167,22 +2180,22 @@ class j extends ie {
|
|
|
2167
2180
|
return this._y;
|
|
2168
2181
|
}
|
|
2169
2182
|
}
|
|
2170
|
-
const
|
|
2171
|
-
indicator:
|
|
2172
|
-
indicatorField:
|
|
2183
|
+
const rt = {
|
|
2184
|
+
indicator: re,
|
|
2185
|
+
indicatorField: st,
|
|
2173
2186
|
line: j,
|
|
2174
2187
|
bar: j,
|
|
2175
2188
|
pie: j
|
|
2176
|
-
},
|
|
2189
|
+
}, It = (i) => {
|
|
2177
2190
|
const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2178
2191
|
if (!e)
|
|
2179
2192
|
throw new Error(`${e} is not a valid graph`);
|
|
2180
|
-
const s =
|
|
2193
|
+
const s = rt[e];
|
|
2181
2194
|
if (!s)
|
|
2182
2195
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2183
2196
|
return new s(e, t);
|
|
2184
2197
|
};
|
|
2185
|
-
class
|
|
2198
|
+
class ae {
|
|
2186
2199
|
constructor({ name: t, axis: e }) {
|
|
2187
2200
|
n(this, "_name");
|
|
2188
2201
|
n(this, "_axis");
|
|
@@ -2195,7 +2208,7 @@ class ne {
|
|
|
2195
2208
|
return this._axis;
|
|
2196
2209
|
}
|
|
2197
2210
|
}
|
|
2198
|
-
class
|
|
2211
|
+
class at extends ae {
|
|
2199
2212
|
constructor({
|
|
2200
2213
|
name: e,
|
|
2201
2214
|
operator: s,
|
|
@@ -2218,12 +2231,12 @@ class rt extends ne {
|
|
|
2218
2231
|
return this._stacked;
|
|
2219
2232
|
}
|
|
2220
2233
|
}
|
|
2221
|
-
class
|
|
2234
|
+
class lt extends ae {
|
|
2222
2235
|
constructor({ name: t }) {
|
|
2223
2236
|
super({ name: t, axis: "x" });
|
|
2224
2237
|
}
|
|
2225
2238
|
}
|
|
2226
|
-
const
|
|
2239
|
+
const ot = ({ ooui: i }) => {
|
|
2227
2240
|
const e = [i.x.name];
|
|
2228
2241
|
return i.y ? (i.y.forEach((s) => {
|
|
2229
2242
|
s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
|
|
@@ -2245,33 +2258,33 @@ function $({
|
|
|
2245
2258
|
}
|
|
2246
2259
|
return { value: r, label: r };
|
|
2247
2260
|
}
|
|
2248
|
-
const
|
|
2261
|
+
const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2249
2262
|
__proto__: null,
|
|
2250
|
-
getFieldsToRetrieve:
|
|
2263
|
+
getFieldsToRetrieve: ot,
|
|
2251
2264
|
getValueAndLabelForField: $
|
|
2252
2265
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2253
|
-
function
|
|
2266
|
+
function ct({
|
|
2254
2267
|
values: i,
|
|
2255
2268
|
timerange: t,
|
|
2256
2269
|
interval: e = 1
|
|
2257
2270
|
}) {
|
|
2258
|
-
const s =
|
|
2271
|
+
const s = ht({
|
|
2259
2272
|
values: i,
|
|
2260
2273
|
timerange: t
|
|
2261
2274
|
});
|
|
2262
|
-
return
|
|
2275
|
+
return dt({
|
|
2263
2276
|
values: s,
|
|
2264
2277
|
timerange: t,
|
|
2265
2278
|
interval: e
|
|
2266
2279
|
});
|
|
2267
2280
|
}
|
|
2268
|
-
function
|
|
2281
|
+
function dt({
|
|
2269
2282
|
values: i,
|
|
2270
2283
|
timerange: t,
|
|
2271
2284
|
interval: e = 1
|
|
2272
2285
|
}) {
|
|
2273
2286
|
let s = [];
|
|
2274
|
-
const r =
|
|
2287
|
+
const r = oe({
|
|
2275
2288
|
values: i,
|
|
2276
2289
|
groupBy: "type-stacked"
|
|
2277
2290
|
}), a = `${t}s`;
|
|
@@ -2282,8 +2295,8 @@ function ct({
|
|
|
2282
2295
|
if (s.push(u), _ === h.length - 1)
|
|
2283
2296
|
return;
|
|
2284
2297
|
const d = u.x, f = h[_ + 1].x;
|
|
2285
|
-
if (!
|
|
2286
|
-
const c =
|
|
2298
|
+
if (!le([d, f], a)) {
|
|
2299
|
+
const c = ut({
|
|
2287
2300
|
dates: [d, f],
|
|
2288
2301
|
timerange: t,
|
|
2289
2302
|
interval: e
|
|
@@ -2300,7 +2313,7 @@ function ct({
|
|
|
2300
2313
|
}
|
|
2301
2314
|
}), s.sort((o, h) => o.x < h.x ? -1 : o.x > h.x ? 1 : 0);
|
|
2302
2315
|
}
|
|
2303
|
-
function
|
|
2316
|
+
function ut({
|
|
2304
2317
|
dates: i,
|
|
2305
2318
|
timerange: t,
|
|
2306
2319
|
interval: e = 1
|
|
@@ -2311,7 +2324,7 @@ function dt({
|
|
|
2311
2324
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2312
2325
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2313
2326
|
const o = a[l], h = a[l + 1];
|
|
2314
|
-
if (!
|
|
2327
|
+
if (!le([o, h], r)) {
|
|
2315
2328
|
const _ = P(o, S(r)).add(
|
|
2316
2329
|
e,
|
|
2317
2330
|
r
|
|
@@ -2322,14 +2335,14 @@ function dt({
|
|
|
2322
2335
|
}
|
|
2323
2336
|
return s;
|
|
2324
2337
|
}
|
|
2325
|
-
function
|
|
2338
|
+
function ht({
|
|
2326
2339
|
values: i,
|
|
2327
2340
|
timerange: t
|
|
2328
2341
|
}) {
|
|
2329
|
-
const e =
|
|
2342
|
+
const e = _t({
|
|
2330
2343
|
values: i,
|
|
2331
2344
|
timerange: t
|
|
2332
|
-
}), s = [], r =
|
|
2345
|
+
}), s = [], r = oe({
|
|
2333
2346
|
values: e,
|
|
2334
2347
|
groupBy: "all"
|
|
2335
2348
|
});
|
|
@@ -2344,23 +2357,23 @@ function ut({
|
|
|
2344
2357
|
});
|
|
2345
2358
|
}), s;
|
|
2346
2359
|
}
|
|
2347
|
-
function
|
|
2360
|
+
function _t({
|
|
2348
2361
|
values: i,
|
|
2349
2362
|
timerange: t
|
|
2350
2363
|
}) {
|
|
2351
2364
|
return i.map((e) => ({
|
|
2352
2365
|
...e,
|
|
2353
|
-
x:
|
|
2366
|
+
x: ft({
|
|
2354
2367
|
date: e.x,
|
|
2355
2368
|
timerange: t
|
|
2356
2369
|
})
|
|
2357
2370
|
}));
|
|
2358
2371
|
}
|
|
2359
|
-
function
|
|
2372
|
+
function ft({
|
|
2360
2373
|
date: i,
|
|
2361
2374
|
timerange: t
|
|
2362
2375
|
}) {
|
|
2363
|
-
let e =
|
|
2376
|
+
let e = gt(i);
|
|
2364
2377
|
const s = P(i, e);
|
|
2365
2378
|
switch (t) {
|
|
2366
2379
|
case "hour": {
|
|
@@ -2386,10 +2399,10 @@ function _t({
|
|
|
2386
2399
|
}
|
|
2387
2400
|
return s.format(e);
|
|
2388
2401
|
}
|
|
2389
|
-
function
|
|
2402
|
+
function gt(i) {
|
|
2390
2403
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2391
2404
|
}
|
|
2392
|
-
function
|
|
2405
|
+
function le(i, t) {
|
|
2393
2406
|
let e = !1;
|
|
2394
2407
|
const s = S(t);
|
|
2395
2408
|
if (i.length === 0)
|
|
@@ -2402,7 +2415,7 @@ function re(i, t) {
|
|
|
2402
2415
|
}
|
|
2403
2416
|
return e;
|
|
2404
2417
|
}
|
|
2405
|
-
function
|
|
2418
|
+
function oe({
|
|
2406
2419
|
values: i,
|
|
2407
2420
|
groupBy: t
|
|
2408
2421
|
}) {
|
|
@@ -2427,7 +2440,7 @@ function S(i) {
|
|
|
2427
2440
|
return "YYYY-MM-DD HH:mm";
|
|
2428
2441
|
}
|
|
2429
2442
|
}
|
|
2430
|
-
const
|
|
2443
|
+
const mt = {
|
|
2431
2444
|
count: "count",
|
|
2432
2445
|
"+": "sum",
|
|
2433
2446
|
"-": "subtract",
|
|
@@ -2435,13 +2448,13 @@ const gt = {
|
|
|
2435
2448
|
avg: "average",
|
|
2436
2449
|
min: "min",
|
|
2437
2450
|
max: "max"
|
|
2438
|
-
},
|
|
2451
|
+
}, bt = ({
|
|
2439
2452
|
ooui: i,
|
|
2440
2453
|
values: t,
|
|
2441
2454
|
fields: e,
|
|
2442
2455
|
options: s
|
|
2443
2456
|
}) => {
|
|
2444
|
-
const r =
|
|
2457
|
+
const r = A({
|
|
2445
2458
|
fieldName: i.x.name,
|
|
2446
2459
|
values: t,
|
|
2447
2460
|
fields: e
|
|
@@ -2450,30 +2463,30 @@ const gt = {
|
|
|
2450
2463
|
Object.keys(r).forEach((m) => {
|
|
2451
2464
|
const x = r[m].label, y = r[m].entries;
|
|
2452
2465
|
if (c.label) {
|
|
2453
|
-
const w =
|
|
2466
|
+
const w = A({
|
|
2454
2467
|
fieldName: c.label,
|
|
2455
2468
|
values: y,
|
|
2456
2469
|
fields: e
|
|
2457
2470
|
});
|
|
2458
2471
|
Object.keys(w).forEach((F) => {
|
|
2459
|
-
const v = w[F].entries, I = w[F].label,
|
|
2472
|
+
const v = w[F].entries, I = w[F].label, ue = N({
|
|
2460
2473
|
entries: v,
|
|
2461
2474
|
fields: e,
|
|
2462
2475
|
fieldName: c.name
|
|
2463
|
-
}),
|
|
2464
|
-
values:
|
|
2476
|
+
}), he = V({
|
|
2477
|
+
values: ue,
|
|
2465
2478
|
operator: c.operator
|
|
2466
2479
|
});
|
|
2467
2480
|
a.push({
|
|
2468
2481
|
x: x || !1,
|
|
2469
|
-
value:
|
|
2482
|
+
value: he,
|
|
2470
2483
|
type: I,
|
|
2471
2484
|
operator: c.operator,
|
|
2472
2485
|
stacked: c.stacked
|
|
2473
2486
|
});
|
|
2474
2487
|
});
|
|
2475
2488
|
} else {
|
|
2476
|
-
const w =
|
|
2489
|
+
const w = N({
|
|
2477
2490
|
entries: y,
|
|
2478
2491
|
fields: e,
|
|
2479
2492
|
fieldName: c.name
|
|
@@ -2484,7 +2497,7 @@ const gt = {
|
|
|
2484
2497
|
a.push({
|
|
2485
2498
|
x: x || !1,
|
|
2486
2499
|
value: F,
|
|
2487
|
-
type:
|
|
2500
|
+
type: ce({
|
|
2488
2501
|
yAxis: c,
|
|
2489
2502
|
fields: e
|
|
2490
2503
|
}),
|
|
@@ -2502,7 +2515,7 @@ const gt = {
|
|
|
2502
2515
|
(c) => c.x !== !1
|
|
2503
2516
|
));
|
|
2504
2517
|
let d = u;
|
|
2505
|
-
i.timerange ? d =
|
|
2518
|
+
i.timerange ? d = ct({
|
|
2506
2519
|
values: d,
|
|
2507
2520
|
timerange: i.timerange,
|
|
2508
2521
|
interval: i.interval
|
|
@@ -2515,12 +2528,12 @@ const gt = {
|
|
|
2515
2528
|
if (i.type === "line" && i.y_range && (f.yAxisOpts = {
|
|
2516
2529
|
mode: i.y_range
|
|
2517
2530
|
}, i.y_range === "auto")) {
|
|
2518
|
-
const { min: c, max: m } =
|
|
2531
|
+
const { min: c, max: m } = de(d);
|
|
2519
2532
|
f.yAxisOpts.valueOpts = { min: c, max: m };
|
|
2520
2533
|
}
|
|
2521
2534
|
return f;
|
|
2522
2535
|
};
|
|
2523
|
-
function
|
|
2536
|
+
function N({
|
|
2524
2537
|
entries: i,
|
|
2525
2538
|
fieldName: t,
|
|
2526
2539
|
fields: e
|
|
@@ -2569,7 +2582,7 @@ function V({
|
|
|
2569
2582
|
function W(i) {
|
|
2570
2583
|
return Math.round((i + Number.EPSILON) * 100) / 100;
|
|
2571
2584
|
}
|
|
2572
|
-
function
|
|
2585
|
+
function A({
|
|
2573
2586
|
fieldName: i,
|
|
2574
2587
|
fields: t,
|
|
2575
2588
|
values: e
|
|
@@ -2584,21 +2597,21 @@ function N({
|
|
|
2584
2597
|
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
|
|
2585
2598
|
}), s;
|
|
2586
2599
|
}
|
|
2587
|
-
function
|
|
2600
|
+
function yt(i) {
|
|
2588
2601
|
let t = [];
|
|
2589
2602
|
return Object.keys(i).forEach((e) => {
|
|
2590
2603
|
const s = i[e];
|
|
2591
2604
|
t = t.concat(s.entries);
|
|
2592
2605
|
}), t;
|
|
2593
2606
|
}
|
|
2594
|
-
function
|
|
2607
|
+
function ce({
|
|
2595
2608
|
yAxis: i,
|
|
2596
2609
|
fields: t
|
|
2597
2610
|
}) {
|
|
2598
2611
|
const e = t[i.name];
|
|
2599
2612
|
return e != null && e.string ? e.string : i.name;
|
|
2600
2613
|
}
|
|
2601
|
-
function
|
|
2614
|
+
function de(i, t = 0.1) {
|
|
2602
2615
|
if (i.length === 0)
|
|
2603
2616
|
throw new Error("The values array cannot be empty.");
|
|
2604
2617
|
const e = i.map((l) => l.value), s = Math.min(...e), r = Math.max(...e), a = (r - s) * t;
|
|
@@ -2607,79 +2620,80 @@ function oe(i, t = 0.1) {
|
|
|
2607
2620
|
max: r + a
|
|
2608
2621
|
};
|
|
2609
2622
|
}
|
|
2610
|
-
const
|
|
2623
|
+
const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2611
2624
|
__proto__: null,
|
|
2612
|
-
getAllObjectsInGroupedValues:
|
|
2613
|
-
getMinMax:
|
|
2625
|
+
getAllObjectsInGroupedValues: yt,
|
|
2626
|
+
getMinMax: de,
|
|
2614
2627
|
getValueForOperator: V,
|
|
2615
|
-
getValuesForYField:
|
|
2616
|
-
getValuesGroupedByField:
|
|
2617
|
-
getYAxisFieldname:
|
|
2618
|
-
labelsForOperator:
|
|
2619
|
-
processGraphData:
|
|
2628
|
+
getValuesForYField: N,
|
|
2629
|
+
getValuesGroupedByField: A,
|
|
2630
|
+
getYAxisFieldname: ce,
|
|
2631
|
+
labelsForOperator: mt,
|
|
2632
|
+
processGraphData: bt
|
|
2620
2633
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2621
2634
|
export {
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2635
|
+
Je as Alert,
|
|
2636
|
+
ve as Avatar,
|
|
2637
|
+
De as Binary,
|
|
2638
|
+
U as Boolean,
|
|
2639
|
+
X as Button,
|
|
2640
|
+
ke as ButtonGroup,
|
|
2628
2641
|
D as Char,
|
|
2629
|
-
|
|
2630
|
-
|
|
2642
|
+
ee as CodeEditor,
|
|
2643
|
+
He as Comments,
|
|
2631
2644
|
z as Container,
|
|
2632
2645
|
p as ContainerWidget,
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2646
|
+
Et as Dashboard,
|
|
2647
|
+
tt as DashboardItem,
|
|
2648
|
+
Se as Date,
|
|
2649
|
+
ze as DateTime,
|
|
2637
2650
|
g as Field,
|
|
2638
2651
|
L as Float,
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2652
|
+
Ee as FloatTime,
|
|
2653
|
+
Ct as Form,
|
|
2654
|
+
ne as Graph,
|
|
2655
|
+
ae as GraphAxis,
|
|
2643
2656
|
j as GraphChart,
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2657
|
+
re as GraphIndicator,
|
|
2658
|
+
st as GraphIndicatorField,
|
|
2659
|
+
lt as GraphXAxis,
|
|
2660
|
+
at as GraphYAxis,
|
|
2661
|
+
Ce as Group,
|
|
2662
|
+
Ie as HTMLPreview,
|
|
2663
|
+
je as Image,
|
|
2664
|
+
Ae as Indicator,
|
|
2665
|
+
Pe as Integer,
|
|
2666
|
+
R as JSONField,
|
|
2667
|
+
Q as Label,
|
|
2668
|
+
Oe as Many2one,
|
|
2669
|
+
Te as Markdown,
|
|
2670
|
+
Z as MultiCheckbox,
|
|
2671
|
+
H as NewLine,
|
|
2658
2672
|
M as Notebook,
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2673
|
+
K as One2many,
|
|
2674
|
+
Fe as Page,
|
|
2675
|
+
We as ProgressBar,
|
|
2676
|
+
Ge as Radio,
|
|
2677
|
+
Ye as Reference,
|
|
2678
|
+
et as SearchFieldTypes,
|
|
2679
|
+
Ot as SearchFilter,
|
|
2666
2680
|
E as Selection,
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2681
|
+
Ve as Separator,
|
|
2682
|
+
Re as Steps,
|
|
2683
|
+
$e as Switch,
|
|
2684
|
+
Le as Tag,
|
|
2685
|
+
Be as Tags,
|
|
2672
2686
|
B as Text,
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2687
|
+
qe as Time,
|
|
2688
|
+
Ne as Timeline,
|
|
2689
|
+
kt as Tree,
|
|
2676
2690
|
C as Widget,
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2691
|
+
Wt as graphFieldUtils,
|
|
2692
|
+
St as graphProcessor,
|
|
2693
|
+
te as parseContext,
|
|
2694
|
+
Ft as parseContextFields,
|
|
2695
|
+
Pt as parseDomainFields,
|
|
2696
|
+
It as parseGraph,
|
|
2697
|
+
Tt as transformDomainForChildWidget
|
|
2684
2698
|
};
|
|
2685
2699
|
//# sourceMappingURL=ooui.es.js.map
|