@gisce/ooui 2.29.0 → 2.30.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Indicator.d.ts +2 -0
- package/dist/Indicator.d.ts.map +1 -1
- package/dist/helpers/attributeParser.d.ts.map +1 -1
- package/dist/ooui.es.js +366 -357
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Indicator.ts +8 -1
- package/src/helpers/attributeParser.ts +12 -11
- package/src/spec/Indicator.spec.ts +16 -0
package/dist/ooui.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { decode as
|
|
5
|
-
import { evaluateCondition as
|
|
1
|
+
var be = Object.defineProperty;
|
|
2
|
+
var ye = (i, t, e) => t in i ? be(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var r = (i, t, e) => (ye(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { decode as pe } from "html-entities";
|
|
5
|
+
import { evaluateCondition as xe } from "@gisce/conscheck";
|
|
6
6
|
import * as D from "txml";
|
|
7
7
|
import W from "moment";
|
|
8
|
-
const
|
|
8
|
+
const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve = ({
|
|
9
9
|
entry: i,
|
|
10
10
|
values: t,
|
|
11
11
|
fields: e
|
|
12
12
|
}) => {
|
|
13
|
-
let [s,
|
|
14
|
-
const o =
|
|
13
|
+
let [s, n, a] = i, l = t[s];
|
|
14
|
+
const o = X({
|
|
15
15
|
fieldName: s,
|
|
16
16
|
valueInObject: l,
|
|
17
17
|
expectedValue: a,
|
|
@@ -19,7 +19,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
19
19
|
});
|
|
20
20
|
if (o.directOutcome !== void 0)
|
|
21
21
|
return o.directOutcome;
|
|
22
|
-
switch (o.modifiedValueInObject !== null && (l = o.modifiedValueInObject), o.modifiedExpectedValue !== null && (a = o.modifiedExpectedValue),
|
|
22
|
+
switch (o.modifiedValueInObject !== null && (l = o.modifiedValueInObject), o.modifiedExpectedValue !== null && (a = o.modifiedExpectedValue), n.toLowerCase()) {
|
|
23
23
|
case "=":
|
|
24
24
|
case "==":
|
|
25
25
|
return l == a;
|
|
@@ -41,13 +41,13 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
41
41
|
default:
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, m = (i) => pe(i, { level: "xml" }), X = ({
|
|
45
45
|
fieldName: i,
|
|
46
46
|
valueInObject: t,
|
|
47
47
|
expectedValue: e,
|
|
48
48
|
fields: s = {}
|
|
49
49
|
}) => {
|
|
50
|
-
const
|
|
50
|
+
const n = {
|
|
51
51
|
modifiedValueInObject: t,
|
|
52
52
|
modifiedExpectedValue: null,
|
|
53
53
|
directOutcome: void 0
|
|
@@ -60,20 +60,20 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
60
60
|
modifiedValueInObject: null,
|
|
61
61
|
modifiedExpectedValue: null,
|
|
62
62
|
directOutcome: !1
|
|
63
|
-
} : (
|
|
64
|
-
},
|
|
63
|
+
} : (n.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? n.modifiedExpectedValue = void 0 : (n.modifiedValueInObject === void 0 ? n.modifiedValueInObject = !1 : Array.isArray(n.modifiedValueInObject) && n.modifiedValueInObject[0] !== void 0 && (n.modifiedValueInObject = n.modifiedValueInObject[0]), n.modifiedValueInObject === null && (n.modifiedValueInObject = !1)), s[i].type === "many2one" && Array.isArray(n.modifiedValueInObject) && n.modifiedValueInObject[0] === void 0 && (n.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (n.modifiedExpectedValue = e !== 0), n);
|
|
64
|
+
}, J = ({
|
|
65
65
|
attrs: i,
|
|
66
66
|
values: t,
|
|
67
67
|
fields: e,
|
|
68
68
|
widgetType: s
|
|
69
69
|
}) => {
|
|
70
|
-
const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ =
|
|
70
|
+
const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = m(u), h = JSON.parse(_), d = {};
|
|
71
71
|
for (const g of Object.keys(h)) {
|
|
72
|
-
const p = h[g].map((y) =>
|
|
72
|
+
const p = h[g].map((y) => ve({ entry: y, values: t, fields: e })).every((y) => y);
|
|
73
73
|
p ? d[g] = !0 : g === "readonly" && !p && s === "button" && (d[g] = !1);
|
|
74
74
|
}
|
|
75
75
|
return d;
|
|
76
|
-
},
|
|
76
|
+
}, U = (i) => {
|
|
77
77
|
if (i === void 0)
|
|
78
78
|
return {};
|
|
79
79
|
if (typeof i == "string")
|
|
@@ -91,18 +91,18 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
91
91
|
widgetType: s
|
|
92
92
|
}) => {
|
|
93
93
|
try {
|
|
94
|
-
const
|
|
95
|
-
|
|
94
|
+
const n = m(i), a = JSON.parse(
|
|
95
|
+
n.replace(/'/g, '"')
|
|
96
96
|
), l = {};
|
|
97
97
|
for (const o of Object.keys(a)) {
|
|
98
|
-
const u =
|
|
98
|
+
const u = xe({
|
|
99
99
|
object: t,
|
|
100
100
|
condition: a[o],
|
|
101
101
|
evaluateFieldComparison: ({
|
|
102
102
|
fieldName: _,
|
|
103
103
|
valueInObject: h,
|
|
104
104
|
expectedValue: d
|
|
105
|
-
}) =>
|
|
105
|
+
}) => X({
|
|
106
106
|
fieldName: _,
|
|
107
107
|
valueInObject: h,
|
|
108
108
|
expectedValue: d,
|
|
@@ -112,25 +112,20 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
112
112
|
u ? l[o] = !0 : o === "readonly" && !u && s === "button" && (l[o] = !1);
|
|
113
113
|
}
|
|
114
114
|
return l;
|
|
115
|
-
} catch (
|
|
116
|
-
throw console.error(
|
|
115
|
+
} catch (n) {
|
|
116
|
+
throw console.error(n), n instanceof SyntaxError ? new Error(
|
|
117
117
|
"Error parsing new json_attrs. Original string: " + i
|
|
118
|
-
) :
|
|
118
|
+
) : n;
|
|
119
119
|
}
|
|
120
120
|
}, Ce = ({
|
|
121
121
|
tagAttributes: i,
|
|
122
122
|
values: t,
|
|
123
123
|
fields: e,
|
|
124
124
|
widgetType: s,
|
|
125
|
-
fallbackMode:
|
|
125
|
+
fallbackMode: n = !0
|
|
126
126
|
}) => {
|
|
127
|
-
let a = {}
|
|
128
|
-
if (i.
|
|
129
|
-
attrs: i.attrs,
|
|
130
|
-
values: t,
|
|
131
|
-
fields: e,
|
|
132
|
-
widgetType: s
|
|
133
|
-
})), i.json_attrs)
|
|
127
|
+
let a = {};
|
|
128
|
+
if (i.json_attrs)
|
|
134
129
|
try {
|
|
135
130
|
a = Fe({
|
|
136
131
|
attrs: i.json_attrs,
|
|
@@ -138,14 +133,24 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
138
133
|
fields: e,
|
|
139
134
|
widgetType: s
|
|
140
135
|
});
|
|
141
|
-
} catch (
|
|
142
|
-
if (
|
|
143
|
-
a =
|
|
136
|
+
} catch (l) {
|
|
137
|
+
if (n && i.attrs)
|
|
138
|
+
a = J({
|
|
139
|
+
attrs: i.attrs,
|
|
140
|
+
values: t,
|
|
141
|
+
fields: e,
|
|
142
|
+
widgetType: s
|
|
143
|
+
});
|
|
144
144
|
else
|
|
145
|
-
throw
|
|
145
|
+
throw l;
|
|
146
146
|
}
|
|
147
147
|
else
|
|
148
|
-
i.attrs && (a =
|
|
148
|
+
i.attrs && (a = J({
|
|
149
|
+
attrs: i.attrs,
|
|
150
|
+
values: t,
|
|
151
|
+
fields: e,
|
|
152
|
+
widgetType: s
|
|
153
|
+
}));
|
|
149
154
|
return {
|
|
150
155
|
...i,
|
|
151
156
|
...a,
|
|
@@ -157,38 +162,38 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
157
162
|
/**
|
|
158
163
|
* Determines if widget is read only (default is undefined)
|
|
159
164
|
*/
|
|
160
|
-
|
|
165
|
+
r(this, "_readOnly");
|
|
161
166
|
/**
|
|
162
167
|
* Column span (default is 1)
|
|
163
168
|
*/
|
|
164
|
-
|
|
169
|
+
r(this, "_colspan");
|
|
165
170
|
/**
|
|
166
171
|
* Invisible fields (default is false)
|
|
167
172
|
*/
|
|
168
|
-
|
|
173
|
+
r(this, "_invisible");
|
|
169
174
|
/**
|
|
170
175
|
* Widget type
|
|
171
176
|
*/
|
|
172
|
-
|
|
177
|
+
r(this, "_type", "");
|
|
173
178
|
/**
|
|
174
179
|
* Context
|
|
175
180
|
*/
|
|
176
|
-
|
|
181
|
+
r(this, "_context");
|
|
177
182
|
/**
|
|
178
183
|
* Domain
|
|
179
184
|
*/
|
|
180
|
-
|
|
185
|
+
r(this, "_domain");
|
|
181
186
|
/**
|
|
182
187
|
* Unique key for widget
|
|
183
188
|
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
189
|
+
r(this, "_key");
|
|
190
|
+
r(this, "_parsedWidgetProps", {});
|
|
191
|
+
r(this, "_isFunction");
|
|
187
192
|
/**
|
|
188
193
|
* Base type of the field
|
|
189
194
|
*/
|
|
190
|
-
|
|
191
|
-
this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = T(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 =
|
|
195
|
+
r(this, "_fieldType", "");
|
|
196
|
+
this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = T(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));
|
|
192
197
|
}
|
|
193
198
|
static get defaultColspan() {
|
|
194
199
|
return k._defaultColspan;
|
|
@@ -257,7 +262,7 @@ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we
|
|
|
257
262
|
/**
|
|
258
263
|
* Default colspan
|
|
259
264
|
*/
|
|
260
|
-
|
|
265
|
+
r(k, "_defaultColspan", 1);
|
|
261
266
|
let C = k;
|
|
262
267
|
class f extends C {
|
|
263
268
|
constructor(e) {
|
|
@@ -267,47 +272,47 @@ class f extends C {
|
|
|
267
272
|
*
|
|
268
273
|
* Corresponds to the field's name attribute from xml
|
|
269
274
|
*/
|
|
270
|
-
|
|
275
|
+
r(this, "_id", "");
|
|
271
276
|
/**
|
|
272
277
|
* Label
|
|
273
278
|
*/
|
|
274
|
-
|
|
279
|
+
r(this, "_label", "");
|
|
275
280
|
/**
|
|
276
281
|
* No label
|
|
277
282
|
*
|
|
278
283
|
* This field hasn't got to show the label
|
|
279
284
|
*
|
|
280
285
|
*/
|
|
281
|
-
|
|
286
|
+
r(this, "_nolabel", !1);
|
|
282
287
|
/**
|
|
283
288
|
*
|
|
284
289
|
* Required field
|
|
285
290
|
*
|
|
286
291
|
*/
|
|
287
|
-
|
|
292
|
+
r(this, "_required", !1);
|
|
288
293
|
/**
|
|
289
294
|
* Tooltip
|
|
290
295
|
*/
|
|
291
|
-
|
|
296
|
+
r(this, "_tooltip");
|
|
292
297
|
/**
|
|
293
298
|
* Tooltip inline
|
|
294
299
|
*/
|
|
295
|
-
|
|
300
|
+
r(this, "_tooltipInline", !1);
|
|
296
301
|
/**
|
|
297
302
|
* Activated (default is true)
|
|
298
303
|
*/
|
|
299
|
-
|
|
304
|
+
r(this, "_activated", !0);
|
|
300
305
|
/**
|
|
301
306
|
* Sum - sum parameter (label), this will mean that we have to sum this field in the tree
|
|
302
307
|
*/
|
|
303
|
-
|
|
308
|
+
r(this, "_sum");
|
|
304
309
|
/**
|
|
305
310
|
* Values and keys
|
|
306
311
|
*/
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
this._activated = !0, e && (this._raw_props = e, e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label =
|
|
312
|
+
r(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
313
|
+
r(this, "_autoRefresh", !1);
|
|
314
|
+
r(this, "_raw_props");
|
|
315
|
+
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 = T(e.autorefresh)));
|
|
311
316
|
}
|
|
312
317
|
get id() {
|
|
313
318
|
return this._id;
|
|
@@ -394,34 +399,34 @@ class f extends C {
|
|
|
394
399
|
}
|
|
395
400
|
class ke extends f {
|
|
396
401
|
}
|
|
397
|
-
class
|
|
402
|
+
class K extends C {
|
|
398
403
|
findById(t) {
|
|
399
404
|
return null;
|
|
400
405
|
}
|
|
401
406
|
}
|
|
402
|
-
class
|
|
407
|
+
class Z extends f {
|
|
403
408
|
constructor(e) {
|
|
404
409
|
super({ ...e, nolabel: !0 });
|
|
405
410
|
/**
|
|
406
411
|
* Label text
|
|
407
412
|
*/
|
|
408
|
-
|
|
413
|
+
r(this, "_text", "");
|
|
409
414
|
/**
|
|
410
415
|
* Align text
|
|
411
416
|
*/
|
|
412
|
-
|
|
417
|
+
r(this, "_align", "left");
|
|
413
418
|
/**
|
|
414
419
|
* Label type
|
|
415
420
|
*/
|
|
416
|
-
|
|
421
|
+
r(this, "_labelType", "default");
|
|
417
422
|
/**
|
|
418
423
|
* Label size
|
|
419
424
|
*/
|
|
420
|
-
|
|
425
|
+
r(this, "_labelSize");
|
|
421
426
|
/**
|
|
422
427
|
* Id of the field that this label goes with. Null if it's an independent label
|
|
423
428
|
*/
|
|
424
|
-
|
|
429
|
+
r(this, "_fieldForLabel", null);
|
|
425
430
|
e != null && e.fieldForLabel && (this._fieldForLabel = e.fieldForLabel), e.widget_props && (this.parsedWidgetProps.label_type && (this.labelType = this.parsedWidgetProps.label_type), this.parsedWidgetProps.label_size && (this.labelSize = this.parsedWidgetProps.label_size));
|
|
426
431
|
}
|
|
427
432
|
get text() {
|
|
@@ -460,29 +465,29 @@ class K extends f {
|
|
|
460
465
|
}
|
|
461
466
|
}
|
|
462
467
|
class V {
|
|
463
|
-
constructor(t = 4, e = 6, s = !1,
|
|
468
|
+
constructor(t = 4, e = 6, s = !1, n = void 0) {
|
|
464
469
|
/**
|
|
465
470
|
* Number of columns the container is divided
|
|
466
471
|
*/
|
|
467
|
-
|
|
472
|
+
r(this, "_columns");
|
|
468
473
|
/**
|
|
469
474
|
* Number of columns to use
|
|
470
475
|
*/
|
|
471
|
-
|
|
476
|
+
r(this, "_colspan");
|
|
472
477
|
/**
|
|
473
478
|
* Number of rows
|
|
474
479
|
*/
|
|
475
|
-
|
|
476
|
-
|
|
480
|
+
r(this, "_rows");
|
|
481
|
+
r(this, "_index");
|
|
477
482
|
/**
|
|
478
483
|
* Determines if widget is read only (default is false)
|
|
479
484
|
*/
|
|
480
|
-
|
|
485
|
+
r(this, "_readOnly");
|
|
481
486
|
/**
|
|
482
487
|
* Unique key for container
|
|
483
488
|
*/
|
|
484
|
-
|
|
485
|
-
this._columns = t, this._colspan = e, this._rows = [[]], this._index = 0, this._readOnly = s, this._key =
|
|
489
|
+
r(this, "_key");
|
|
490
|
+
this._columns = t, this._colspan = e, this._rows = [[]], this._index = 0, this._readOnly = s, this._key = n;
|
|
486
491
|
}
|
|
487
492
|
get columns() {
|
|
488
493
|
return this._columns;
|
|
@@ -525,14 +530,14 @@ class V {
|
|
|
525
530
|
return this._columns - t;
|
|
526
531
|
}
|
|
527
532
|
addWidget(t, e) {
|
|
528
|
-
const s = [],
|
|
529
|
-
if (t instanceof
|
|
533
|
+
const s = [], n = e ? e.addLabel : !0;
|
|
534
|
+
if (t instanceof K) {
|
|
530
535
|
this._rows.push([]), this._index++;
|
|
531
536
|
return;
|
|
532
537
|
}
|
|
533
|
-
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly,
|
|
538
|
+
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, n && t instanceof f && !t.nolabel) {
|
|
534
539
|
t.colspan > 1 && (t.colspan -= 1);
|
|
535
|
-
const l = new
|
|
540
|
+
const l = new Z({
|
|
536
541
|
name: t.id + "_label",
|
|
537
542
|
string: t.label,
|
|
538
543
|
invisible: t.invisible,
|
|
@@ -555,8 +560,8 @@ class V {
|
|
|
555
560
|
findById(t) {
|
|
556
561
|
var s;
|
|
557
562
|
let e = null;
|
|
558
|
-
return (s = this._rows) != null && s.length && this._rows.forEach((
|
|
559
|
-
e ||
|
|
563
|
+
return (s = this._rows) != null && s.length && this._rows.forEach((n) => {
|
|
564
|
+
e || n != null && n.length && n.forEach((a) => {
|
|
560
565
|
e || a && (e = a.findById(t));
|
|
561
566
|
});
|
|
562
567
|
}), e;
|
|
@@ -570,25 +575,25 @@ const O = class O extends C {
|
|
|
570
575
|
*
|
|
571
576
|
* Corresponds to the field's name attribute from xml
|
|
572
577
|
*/
|
|
573
|
-
|
|
578
|
+
r(this, "_id", "");
|
|
574
579
|
/**
|
|
575
580
|
* Container
|
|
576
581
|
*/
|
|
577
|
-
|
|
582
|
+
r(this, "_container");
|
|
578
583
|
/**
|
|
579
584
|
* Must expand widget
|
|
580
585
|
*/
|
|
581
|
-
|
|
586
|
+
r(this, "_mustExpand", !1);
|
|
582
587
|
/**
|
|
583
588
|
* Container label
|
|
584
589
|
*/
|
|
585
|
-
|
|
590
|
+
r(this, "_label", "");
|
|
586
591
|
this._container = new V(
|
|
587
592
|
e == null ? void 0 : e.col,
|
|
588
593
|
O._defaultColspan,
|
|
589
594
|
this.readOnly,
|
|
590
595
|
e == null ? void 0 : e.key
|
|
591
|
-
), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label =
|
|
596
|
+
), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label = m(e.string)));
|
|
592
597
|
}
|
|
593
598
|
get id() {
|
|
594
599
|
return this._id;
|
|
@@ -634,13 +639,13 @@ const O = class O extends C {
|
|
|
634
639
|
return e === this.id ? this : this.container.findById(e);
|
|
635
640
|
}
|
|
636
641
|
};
|
|
637
|
-
|
|
642
|
+
r(O, "_defaultColspan", 6);
|
|
638
643
|
let w = O;
|
|
639
644
|
const P = class P extends w {
|
|
640
645
|
constructor(e) {
|
|
641
646
|
super(e);
|
|
642
|
-
|
|
643
|
-
|
|
647
|
+
r(this, "_tabPosition", "top");
|
|
648
|
+
r(this, "_pages", []);
|
|
644
649
|
this.colspan = P._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
|
|
645
650
|
}
|
|
646
651
|
static get defaultColspan() {
|
|
@@ -659,12 +664,12 @@ const P = class P extends w {
|
|
|
659
664
|
return [].concat.apply([], this._container.rows);
|
|
660
665
|
}
|
|
661
666
|
};
|
|
662
|
-
|
|
667
|
+
r(P, "_defaultColspan", 3);
|
|
663
668
|
let M = P;
|
|
664
669
|
class L extends w {
|
|
665
670
|
constructor(e) {
|
|
666
671
|
super(e);
|
|
667
|
-
|
|
672
|
+
r(this, "_loading", !1);
|
|
668
673
|
e && e.loading && (this._loading = e.loading);
|
|
669
674
|
}
|
|
670
675
|
get loading() {
|
|
@@ -677,7 +682,7 @@ class L extends w {
|
|
|
677
682
|
class Oe extends L {
|
|
678
683
|
constructor(e) {
|
|
679
684
|
super(e);
|
|
680
|
-
|
|
685
|
+
r(this, "_icon", null);
|
|
681
686
|
e.icon && (this._icon = e.icon);
|
|
682
687
|
}
|
|
683
688
|
get icon() {
|
|
@@ -690,8 +695,8 @@ class Oe extends L {
|
|
|
690
695
|
class Pe extends L {
|
|
691
696
|
constructor(e) {
|
|
692
697
|
super(e);
|
|
693
|
-
|
|
694
|
-
|
|
698
|
+
r(this, "_icon", null);
|
|
699
|
+
r(this, "_height");
|
|
695
700
|
if (e && (e.icon && (this._icon = e.icon), e.height))
|
|
696
701
|
try {
|
|
697
702
|
this._height = parseInt(e.height);
|
|
@@ -712,7 +717,7 @@ class Pe extends L {
|
|
|
712
717
|
this._height = e;
|
|
713
718
|
}
|
|
714
719
|
}
|
|
715
|
-
class
|
|
720
|
+
class ee extends f {
|
|
716
721
|
constructor(e) {
|
|
717
722
|
super({
|
|
718
723
|
...e,
|
|
@@ -721,23 +726,23 @@ class Z extends f {
|
|
|
721
726
|
/**
|
|
722
727
|
* Type
|
|
723
728
|
*/
|
|
724
|
-
|
|
729
|
+
r(this, "_buttonType", "workflow");
|
|
725
730
|
/**
|
|
726
731
|
* Button caption
|
|
727
732
|
*/
|
|
728
|
-
|
|
733
|
+
r(this, "_caption", "");
|
|
729
734
|
/**
|
|
730
735
|
* Button icon
|
|
731
736
|
*/
|
|
732
|
-
|
|
737
|
+
r(this, "_icon");
|
|
733
738
|
/**
|
|
734
739
|
* Confirm string for modal in button types workflow
|
|
735
740
|
*/
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
741
|
+
r(this, "_confirmMessage", "");
|
|
742
|
+
r(this, "_primary", !1);
|
|
743
|
+
r(this, "_danger", !1);
|
|
739
744
|
if (e) {
|
|
740
|
-
if (e.string && (this._caption =
|
|
745
|
+
if (e.string && (this._caption = m(e.string)), e.buttonType && (this._buttonType = e.buttonType), e.confirm && (this._confirmMessage = m(e.confirm)), e.special && e.special === "cancel" && (this._buttonType = "cancel"), e.icon && (this._icon = e.icon), e.primary) {
|
|
741
746
|
const s = e.primary;
|
|
742
747
|
(s === "1" || s === 1 || s === !0) && (this._primary = !0);
|
|
743
748
|
}
|
|
@@ -787,7 +792,7 @@ class Z extends f {
|
|
|
787
792
|
class Te extends w {
|
|
788
793
|
constructor(e) {
|
|
789
794
|
super(e);
|
|
790
|
-
|
|
795
|
+
r(this, "_defaultName", "");
|
|
791
796
|
e.default && (this._defaultName = e.default);
|
|
792
797
|
}
|
|
793
798
|
get defaultName() {
|
|
@@ -806,8 +811,8 @@ class Te extends w {
|
|
|
806
811
|
get secondaryButtons() {
|
|
807
812
|
return this.buttons.filter(
|
|
808
813
|
(s) => {
|
|
809
|
-
var
|
|
810
|
-
return s.id !== ((
|
|
814
|
+
var n;
|
|
815
|
+
return s.id !== ((n = this.defaultButton) == null ? void 0 : n.id);
|
|
811
816
|
}
|
|
812
817
|
);
|
|
813
818
|
}
|
|
@@ -821,13 +826,13 @@ class A extends f {
|
|
|
821
826
|
/**
|
|
822
827
|
* Field place holder
|
|
823
828
|
*/
|
|
824
|
-
|
|
829
|
+
r(this, "_placeholder", "");
|
|
825
830
|
/**
|
|
826
831
|
* Field size
|
|
827
832
|
*/
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
833
|
+
r(this, "_size");
|
|
834
|
+
r(this, "_isPassword", !1);
|
|
835
|
+
r(this, "_translatable", !1);
|
|
831
836
|
e && (e.size && (this._size = e.size), e.password && (this.isPassword = e.password === "True"), e.translate && (this.translatable = e.translate === "True" || e.translate === !0));
|
|
832
837
|
}
|
|
833
838
|
get placeholder() {
|
|
@@ -864,22 +869,22 @@ class G extends f {
|
|
|
864
869
|
/**
|
|
865
870
|
* Field place holder
|
|
866
871
|
*/
|
|
867
|
-
|
|
872
|
+
r(this, "_placeholder", "");
|
|
868
873
|
/**
|
|
869
874
|
* Field size
|
|
870
875
|
*/
|
|
871
|
-
|
|
876
|
+
r(this, "_size");
|
|
872
877
|
/**
|
|
873
878
|
* Must expand widget
|
|
874
879
|
*/
|
|
875
|
-
|
|
880
|
+
r(this, "_mustExpand", !1);
|
|
876
881
|
/**
|
|
877
882
|
* Height
|
|
878
883
|
*/
|
|
879
|
-
|
|
880
|
-
|
|
884
|
+
r(this, "_height");
|
|
885
|
+
r(this, "_translatable", !1);
|
|
881
886
|
if (e) {
|
|
882
|
-
if (e.placeholder && (this._placeholder =
|
|
887
|
+
if (e.placeholder && (this._placeholder = m(e.placeholder)), e.colspan || (this._mustExpand = !0), e.height)
|
|
883
888
|
try {
|
|
884
889
|
this._height = parseInt(e.height);
|
|
885
890
|
} catch {
|
|
@@ -928,7 +933,7 @@ class I extends f {
|
|
|
928
933
|
/**
|
|
929
934
|
* Field size
|
|
930
935
|
*/
|
|
931
|
-
|
|
936
|
+
r(this, "_size", 150);
|
|
932
937
|
e && e.size && (this._size = e.size);
|
|
933
938
|
}
|
|
934
939
|
get size() {
|
|
@@ -944,11 +949,11 @@ class We extends f {
|
|
|
944
949
|
/**
|
|
945
950
|
* Field size
|
|
946
951
|
*/
|
|
947
|
-
|
|
952
|
+
r(this, "_size", 150);
|
|
948
953
|
/**
|
|
949
954
|
* Relation
|
|
950
955
|
*/
|
|
951
|
-
|
|
956
|
+
r(this, "_relation", "");
|
|
952
957
|
e && (e.size && (this._size = e.size), e.relation && (this._relation = e.relation));
|
|
953
958
|
}
|
|
954
959
|
get size() {
|
|
@@ -966,7 +971,7 @@ class We extends f {
|
|
|
966
971
|
}
|
|
967
972
|
class Ie extends G {
|
|
968
973
|
}
|
|
969
|
-
class
|
|
974
|
+
class te extends f {
|
|
970
975
|
constructor(t) {
|
|
971
976
|
super(t);
|
|
972
977
|
}
|
|
@@ -984,16 +989,16 @@ class R extends f {
|
|
|
984
989
|
*
|
|
985
990
|
* Number of integer digits that will be part of the float
|
|
986
991
|
*/
|
|
987
|
-
|
|
992
|
+
r(this, "_integerDigits", 16);
|
|
988
993
|
/**
|
|
989
994
|
* Decimal digits
|
|
990
995
|
*
|
|
991
996
|
* Number of decimal digits that will be part of the float
|
|
992
997
|
*/
|
|
993
|
-
|
|
998
|
+
r(this, "_decimalDigits", 2);
|
|
994
999
|
if (e != null && e.digits) {
|
|
995
|
-
const [s,
|
|
996
|
-
this._integerDigits = s, this._decimalDigits =
|
|
1000
|
+
const [s, n] = e.digits;
|
|
1001
|
+
this._integerDigits = s, this._decimalDigits = n;
|
|
997
1002
|
}
|
|
998
1003
|
}
|
|
999
1004
|
get integerDigits() {
|
|
@@ -1025,41 +1030,41 @@ class De extends f {
|
|
|
1025
1030
|
super(t);
|
|
1026
1031
|
}
|
|
1027
1032
|
}
|
|
1028
|
-
class
|
|
1033
|
+
class ie extends f {
|
|
1029
1034
|
constructor(e) {
|
|
1030
1035
|
super(e);
|
|
1031
1036
|
/**
|
|
1032
1037
|
* Field size
|
|
1033
1038
|
*/
|
|
1034
|
-
|
|
1039
|
+
r(this, "_size", 150);
|
|
1035
1040
|
/**
|
|
1036
1041
|
* Relation
|
|
1037
1042
|
*/
|
|
1038
|
-
|
|
1043
|
+
r(this, "_relation", "");
|
|
1039
1044
|
/**
|
|
1040
1045
|
* Inv_field
|
|
1041
1046
|
*/
|
|
1042
|
-
|
|
1047
|
+
r(this, "_inv_field");
|
|
1043
1048
|
/**
|
|
1044
1049
|
* Views
|
|
1045
1050
|
*/
|
|
1046
|
-
|
|
1051
|
+
r(this, "_views", null);
|
|
1047
1052
|
/**
|
|
1048
1053
|
* Mode
|
|
1049
1054
|
*/
|
|
1050
|
-
|
|
1055
|
+
r(this, "_mode", []);
|
|
1051
1056
|
/**
|
|
1052
1057
|
* Must expand widget
|
|
1053
1058
|
*/
|
|
1054
|
-
|
|
1059
|
+
r(this, "_mustExpand", !1);
|
|
1055
1060
|
/**
|
|
1056
1061
|
* Height
|
|
1057
1062
|
*/
|
|
1058
|
-
|
|
1063
|
+
r(this, "_height");
|
|
1059
1064
|
/**
|
|
1060
1065
|
* Infinite mode
|
|
1061
1066
|
*/
|
|
1062
|
-
|
|
1067
|
+
r(this, "_infinite", !1);
|
|
1063
1068
|
if (e) {
|
|
1064
1069
|
if (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.mode && (this._mode = e.mode.split(",")), e.views && (this._views = e.views), e.colspan ? this.colspan = e.colspan : this._mustExpand = !0, e.inv_field && (this._inv_field = e.inv_field), e.height)
|
|
1065
1070
|
try {
|
|
@@ -1125,9 +1130,9 @@ class je extends C {
|
|
|
1125
1130
|
/**
|
|
1126
1131
|
* Label
|
|
1127
1132
|
*/
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
e && (e.string && (this._label =
|
|
1133
|
+
r(this, "_label", "");
|
|
1134
|
+
r(this, "_icon", null);
|
|
1135
|
+
e && (e.string && (this._label = m(e.string)), e.icon && (this._icon = e.icon));
|
|
1131
1136
|
}
|
|
1132
1137
|
get label() {
|
|
1133
1138
|
return this._label;
|
|
@@ -1153,7 +1158,7 @@ class Ae extends f {
|
|
|
1153
1158
|
/**
|
|
1154
1159
|
* Filename field name
|
|
1155
1160
|
*/
|
|
1156
|
-
|
|
1161
|
+
r(this, "_filenameField", "");
|
|
1157
1162
|
e && e.filename && (this._filenameField = e.filename);
|
|
1158
1163
|
}
|
|
1159
1164
|
get filenameField() {
|
|
@@ -1174,17 +1179,17 @@ class Be extends f {
|
|
|
1174
1179
|
super(t);
|
|
1175
1180
|
}
|
|
1176
1181
|
}
|
|
1177
|
-
class Le extends
|
|
1182
|
+
class Le extends ie {
|
|
1178
1183
|
constructor(e) {
|
|
1179
1184
|
super(e);
|
|
1180
1185
|
/**
|
|
1181
1186
|
* Title field
|
|
1182
1187
|
*/
|
|
1183
|
-
|
|
1188
|
+
r(this, "_titleField");
|
|
1184
1189
|
/**
|
|
1185
1190
|
* Summary field
|
|
1186
1191
|
*/
|
|
1187
|
-
|
|
1192
|
+
r(this, "_summaryField");
|
|
1188
1193
|
this._titleField = "", this._summaryField = "", this._parsedWidgetProps && (this._titleField = this._parsedWidgetProps.titleField, this._summaryField = this.parsedWidgetProps.summaryField);
|
|
1189
1194
|
}
|
|
1190
1195
|
get titleField() {
|
|
@@ -1209,16 +1214,17 @@ class Le extends te {
|
|
|
1209
1214
|
class Ge extends I {
|
|
1210
1215
|
constructor(e) {
|
|
1211
1216
|
super(e);
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1217
|
+
r(this, "_nolabel", !0);
|
|
1218
|
+
r(this, "_card");
|
|
1219
|
+
r(this, "_icon");
|
|
1220
|
+
r(this, "_suffix");
|
|
1221
|
+
r(this, "_color");
|
|
1216
1222
|
/**
|
|
1217
1223
|
* Action id
|
|
1218
1224
|
*/
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
if (this._card = !1, this._icon = "", this._suffix = "", this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = this._parsedWidgetProps.icon || "", this._suffix = this._parsedWidgetProps.suffix || ""), e && (e.action_id && (this._actionId = parseInt(e.action_id)), e.height))
|
|
1225
|
+
r(this, "_actionId");
|
|
1226
|
+
r(this, "_height");
|
|
1227
|
+
if (this._card = !1, this._icon = "", this._suffix = "", this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = m(this._parsedWidgetProps.icon) || "", this._suffix = this._parsedWidgetProps.suffix || "", this._color = m(this._parsedWidgetProps.color) || ""), e && (e.action_id && (this._actionId = parseInt(e.action_id)), e.height))
|
|
1222
1228
|
try {
|
|
1223
1229
|
this._height = parseInt(e.height);
|
|
1224
1230
|
} catch (s) {
|
|
@@ -1243,6 +1249,9 @@ class Ge extends I {
|
|
|
1243
1249
|
set suffix(e) {
|
|
1244
1250
|
this._suffix = e;
|
|
1245
1251
|
}
|
|
1252
|
+
get color() {
|
|
1253
|
+
return this._color;
|
|
1254
|
+
}
|
|
1246
1255
|
get actionId() {
|
|
1247
1256
|
return this._actionId;
|
|
1248
1257
|
}
|
|
@@ -1256,26 +1265,26 @@ class Ge extends I {
|
|
|
1256
1265
|
this._height = e;
|
|
1257
1266
|
}
|
|
1258
1267
|
}
|
|
1259
|
-
class
|
|
1268
|
+
class se extends f {
|
|
1260
1269
|
constructor(e) {
|
|
1261
1270
|
super(e);
|
|
1262
1271
|
/**
|
|
1263
1272
|
* Field size
|
|
1264
1273
|
*/
|
|
1265
|
-
|
|
1274
|
+
r(this, "_size", 150);
|
|
1266
1275
|
/**
|
|
1267
1276
|
* Relation
|
|
1268
1277
|
*/
|
|
1269
|
-
|
|
1278
|
+
r(this, "_relation", "");
|
|
1270
1279
|
/**
|
|
1271
1280
|
* Inv_field
|
|
1272
1281
|
*/
|
|
1273
|
-
|
|
1282
|
+
r(this, "_inv_field");
|
|
1274
1283
|
/**
|
|
1275
1284
|
* field to define the value to show
|
|
1276
1285
|
*/
|
|
1277
|
-
|
|
1278
|
-
|
|
1286
|
+
r(this, "_field", "name");
|
|
1287
|
+
r(this, "_columns", 4);
|
|
1279
1288
|
e && (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.inv_field && (this._inv_field = e.inv_field), this.parsedWidgetProps.hasOwnProperty("field") && (this._field = this.parsedWidgetProps.field), this.parsedWidgetProps.columns && (this._columns = this.parsedWidgetProps.columns));
|
|
1280
1289
|
}
|
|
1281
1290
|
get size() {
|
|
@@ -1309,7 +1318,7 @@ class ie extends f {
|
|
|
1309
1318
|
this._columns = e;
|
|
1310
1319
|
}
|
|
1311
1320
|
}
|
|
1312
|
-
class Re extends
|
|
1321
|
+
class Re extends se {
|
|
1313
1322
|
}
|
|
1314
1323
|
class $e extends I {
|
|
1315
1324
|
get colors() {
|
|
@@ -1326,7 +1335,7 @@ class qe extends I {
|
|
|
1326
1335
|
/**
|
|
1327
1336
|
* Define the direction
|
|
1328
1337
|
*/
|
|
1329
|
-
|
|
1338
|
+
r(this, "_direction", "horizontal");
|
|
1330
1339
|
e && this.parsedWidgetProps.hasOwnProperty("direction") && (this._direction = this.parsedWidgetProps.direction);
|
|
1331
1340
|
}
|
|
1332
1341
|
get direction() {
|
|
@@ -1336,7 +1345,7 @@ class qe extends I {
|
|
|
1336
1345
|
this._direction = e;
|
|
1337
1346
|
}
|
|
1338
1347
|
}
|
|
1339
|
-
class Je extends
|
|
1348
|
+
class Je extends te {
|
|
1340
1349
|
}
|
|
1341
1350
|
class He extends f {
|
|
1342
1351
|
constructor(e) {
|
|
@@ -1344,9 +1353,9 @@ class He extends f {
|
|
|
1344
1353
|
/**
|
|
1345
1354
|
* Relation
|
|
1346
1355
|
*/
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1356
|
+
r(this, "_relation", "");
|
|
1357
|
+
r(this, "_errorField", null);
|
|
1358
|
+
r(this, "_lastStep", !0);
|
|
1350
1359
|
e && (e.relation && (this._relation = e.relation), this.parsedWidgetProps.hasOwnProperty("error_field") && (this._errorField = this.parsedWidgetProps.error_field), this.parsedWidgetProps.hasOwnProperty("last_step") && (this._lastStep = this.parsedWidgetProps.last_step));
|
|
1351
1360
|
}
|
|
1352
1361
|
get relation() {
|
|
@@ -1368,10 +1377,10 @@ class He extends f {
|
|
|
1368
1377
|
this._lastStep = e;
|
|
1369
1378
|
}
|
|
1370
1379
|
}
|
|
1371
|
-
class
|
|
1380
|
+
class re extends G {
|
|
1372
1381
|
constructor(e) {
|
|
1373
1382
|
super(e);
|
|
1374
|
-
|
|
1383
|
+
r(this, "_lang", null);
|
|
1375
1384
|
e && this.parsedWidgetProps.lang && (this._lang = this.parsedWidgetProps.lang);
|
|
1376
1385
|
}
|
|
1377
1386
|
get lang() {
|
|
@@ -1392,10 +1401,10 @@ class Xe extends w {
|
|
|
1392
1401
|
/**
|
|
1393
1402
|
* Alert type
|
|
1394
1403
|
*/
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1404
|
+
r(this, "_alertType", "info");
|
|
1405
|
+
r(this, "_title", "");
|
|
1406
|
+
r(this, "_text", "");
|
|
1407
|
+
r(this, "_icon", null);
|
|
1399
1408
|
e && (e.alert_type && (this._alertType = e.alert_type), e.title && (this._title = e.title), e.text && (this._text = e.text), e.icon && (this._icon = e.icon));
|
|
1400
1409
|
}
|
|
1401
1410
|
get alertType() {
|
|
@@ -1432,7 +1441,7 @@ class Ue extends f {
|
|
|
1432
1441
|
/**
|
|
1433
1442
|
* Height of the comments component
|
|
1434
1443
|
*/
|
|
1435
|
-
|
|
1444
|
+
r(this, "_height");
|
|
1436
1445
|
if (e.height) {
|
|
1437
1446
|
const s = parseInt(e.height);
|
|
1438
1447
|
this._height = isNaN(s) ? void 0 : s;
|
|
@@ -1445,17 +1454,17 @@ class Ue extends f {
|
|
|
1445
1454
|
this._height = e;
|
|
1446
1455
|
}
|
|
1447
1456
|
}
|
|
1448
|
-
class
|
|
1457
|
+
class H extends re {
|
|
1449
1458
|
constructor() {
|
|
1450
1459
|
super(...arguments);
|
|
1451
|
-
|
|
1460
|
+
r(this, "_lang", "json");
|
|
1452
1461
|
}
|
|
1453
1462
|
}
|
|
1454
1463
|
class Ke extends f {
|
|
1455
1464
|
constructor(e) {
|
|
1456
1465
|
super(e);
|
|
1457
|
-
|
|
1458
|
-
|
|
1466
|
+
r(this, "_multi", !1);
|
|
1467
|
+
r(this, "_size");
|
|
1459
1468
|
e && e.size && (this.size = e.size), this.parsedWidgetProps.multi && (this.multi = this.parsedWidgetProps.multi);
|
|
1460
1469
|
}
|
|
1461
1470
|
get multi() {
|
|
@@ -1474,7 +1483,7 @@ class Ke extends f {
|
|
|
1474
1483
|
class Ze extends w {
|
|
1475
1484
|
constructor(e) {
|
|
1476
1485
|
super(e);
|
|
1477
|
-
|
|
1486
|
+
r(this, "_autoPlay", !0);
|
|
1478
1487
|
e && "auto_play" in e && (this._autoPlay = T(e.auto_play));
|
|
1479
1488
|
}
|
|
1480
1489
|
get autoPlay() {
|
|
@@ -1497,7 +1506,7 @@ class $ {
|
|
|
1497
1506
|
/**
|
|
1498
1507
|
* Widget class
|
|
1499
1508
|
*/
|
|
1500
|
-
|
|
1509
|
+
r(this, "_widgetClass");
|
|
1501
1510
|
}
|
|
1502
1511
|
setWidgetClass(t) {
|
|
1503
1512
|
switch (t) {
|
|
@@ -1511,7 +1520,7 @@ class $ {
|
|
|
1511
1520
|
this._widgetClass = Pe;
|
|
1512
1521
|
break;
|
|
1513
1522
|
case "label":
|
|
1514
|
-
this._widgetClass =
|
|
1523
|
+
this._widgetClass = Z;
|
|
1515
1524
|
break;
|
|
1516
1525
|
case "char":
|
|
1517
1526
|
this._widgetClass = A;
|
|
@@ -1520,7 +1529,7 @@ class $ {
|
|
|
1520
1529
|
this._widgetClass = G;
|
|
1521
1530
|
break;
|
|
1522
1531
|
case "button":
|
|
1523
|
-
this._widgetClass =
|
|
1532
|
+
this._widgetClass = ee;
|
|
1524
1533
|
break;
|
|
1525
1534
|
case "buttonGroup":
|
|
1526
1535
|
this._widgetClass = Te;
|
|
@@ -1532,7 +1541,7 @@ class $ {
|
|
|
1532
1541
|
this._widgetClass = We;
|
|
1533
1542
|
break;
|
|
1534
1543
|
case "boolean":
|
|
1535
|
-
this._widgetClass =
|
|
1544
|
+
this._widgetClass = te;
|
|
1536
1545
|
break;
|
|
1537
1546
|
case "integer":
|
|
1538
1547
|
this._widgetClass = Ee;
|
|
@@ -1558,10 +1567,10 @@ class $ {
|
|
|
1558
1567
|
case "many2many":
|
|
1559
1568
|
case "one2many":
|
|
1560
1569
|
case "one2many_list":
|
|
1561
|
-
this._widgetClass =
|
|
1570
|
+
this._widgetClass = ie;
|
|
1562
1571
|
break;
|
|
1563
1572
|
case "newline":
|
|
1564
|
-
this._widgetClass =
|
|
1573
|
+
this._widgetClass = K;
|
|
1565
1574
|
break;
|
|
1566
1575
|
case "separator":
|
|
1567
1576
|
this._widgetClass = je;
|
|
@@ -1603,7 +1612,7 @@ class $ {
|
|
|
1603
1612
|
this._widgetClass = qe;
|
|
1604
1613
|
break;
|
|
1605
1614
|
case "multicheckbox":
|
|
1606
|
-
this._widgetClass =
|
|
1615
|
+
this._widgetClass = se;
|
|
1607
1616
|
break;
|
|
1608
1617
|
case "switch":
|
|
1609
1618
|
this._widgetClass = Je;
|
|
@@ -1612,7 +1621,7 @@ class $ {
|
|
|
1612
1621
|
this._widgetClass = He;
|
|
1613
1622
|
break;
|
|
1614
1623
|
case "codeeditor":
|
|
1615
|
-
this._widgetClass =
|
|
1624
|
+
this._widgetClass = re;
|
|
1616
1625
|
break;
|
|
1617
1626
|
case "time":
|
|
1618
1627
|
this._widgetClass = Qe;
|
|
@@ -1627,10 +1636,10 @@ class $ {
|
|
|
1627
1636
|
this._widgetClass = Ue;
|
|
1628
1637
|
break;
|
|
1629
1638
|
case "json":
|
|
1630
|
-
this._widgetClass =
|
|
1639
|
+
this._widgetClass = H;
|
|
1631
1640
|
break;
|
|
1632
1641
|
case "arrow_steps":
|
|
1633
|
-
this._widgetClass =
|
|
1642
|
+
this._widgetClass = H;
|
|
1634
1643
|
break;
|
|
1635
1644
|
case "spinner":
|
|
1636
1645
|
this._widgetClass = L;
|
|
@@ -1673,7 +1682,7 @@ const tt = ({
|
|
|
1673
1682
|
const s = (l = e[i]) == null ? void 0 : l.states;
|
|
1674
1683
|
if (!s)
|
|
1675
1684
|
return {};
|
|
1676
|
-
const
|
|
1685
|
+
const n = {}, a = {};
|
|
1677
1686
|
for (const o of Object.keys(s))
|
|
1678
1687
|
if (t.state === o) {
|
|
1679
1688
|
const u = s[o];
|
|
@@ -1684,9 +1693,9 @@ const tt = ({
|
|
|
1684
1693
|
}
|
|
1685
1694
|
for (const o of Object.keys(a)) {
|
|
1686
1695
|
const u = a[o];
|
|
1687
|
-
|
|
1696
|
+
n[o] = u.some((_) => _);
|
|
1688
1697
|
}
|
|
1689
|
-
return
|
|
1698
|
+
return n;
|
|
1690
1699
|
}, it = ({
|
|
1691
1700
|
states: i,
|
|
1692
1701
|
values: t
|
|
@@ -1701,8 +1710,8 @@ function st({
|
|
|
1701
1710
|
fieldName: t,
|
|
1702
1711
|
fields: e = {}
|
|
1703
1712
|
}) {
|
|
1704
|
-
var
|
|
1705
|
-
const s = ((
|
|
1713
|
+
var n;
|
|
1714
|
+
const s = ((n = e[t]) == null ? void 0 : n.type) || "passthrough";
|
|
1706
1715
|
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);
|
|
1707
1716
|
}
|
|
1708
1717
|
const ne = ({
|
|
@@ -1713,21 +1722,21 @@ const ne = ({
|
|
|
1713
1722
|
try {
|
|
1714
1723
|
if (!i)
|
|
1715
1724
|
return;
|
|
1716
|
-
if (
|
|
1725
|
+
if (le(i) || typeof i != "string")
|
|
1717
1726
|
return i;
|
|
1718
|
-
const s =
|
|
1727
|
+
const s = ae(i);
|
|
1719
1728
|
if (s !== null)
|
|
1720
1729
|
return s;
|
|
1721
1730
|
if (i.trim().length === 0)
|
|
1722
1731
|
return;
|
|
1723
1732
|
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 = {};
|
|
1724
1733
|
return d.forEach((c) => {
|
|
1725
|
-
const
|
|
1734
|
+
const b = c[1];
|
|
1726
1735
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1727
1736
|
const p = st({
|
|
1728
1737
|
values: t,
|
|
1729
1738
|
fields: e,
|
|
1730
|
-
fieldName:
|
|
1739
|
+
fieldName: b === "active_id" ? "id" : b
|
|
1731
1740
|
});
|
|
1732
1741
|
g[c[0].replace(/'/g, "")] = p || void 0;
|
|
1733
1742
|
} else
|
|
@@ -1742,37 +1751,37 @@ const ne = ({
|
|
|
1742
1751
|
}, Tt = (i) => {
|
|
1743
1752
|
const t = [];
|
|
1744
1753
|
try {
|
|
1745
|
-
return !i ||
|
|
1754
|
+
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) => {
|
|
1746
1755
|
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1747
1756
|
}), t);
|
|
1748
1757
|
} catch {
|
|
1749
1758
|
}
|
|
1750
1759
|
return t;
|
|
1751
1760
|
};
|
|
1752
|
-
function
|
|
1761
|
+
function ae(i) {
|
|
1753
1762
|
try {
|
|
1754
1763
|
return JSON.parse(i.replace(/'/g, '"'));
|
|
1755
1764
|
} catch {
|
|
1756
1765
|
return null;
|
|
1757
1766
|
}
|
|
1758
1767
|
}
|
|
1759
|
-
function
|
|
1768
|
+
function le(i) {
|
|
1760
1769
|
return typeof i == "object" && i !== null && typeof i != "string";
|
|
1761
1770
|
}
|
|
1762
|
-
const
|
|
1763
|
-
const t = i.trim().replace(")", "").split("("), e = t[0],
|
|
1771
|
+
const rt = (i) => {
|
|
1772
|
+
const t = i.trim().replace(")", "").split("("), e = t[0], n = t[1].split(",").map((a) => a.trim());
|
|
1764
1773
|
return {
|
|
1765
1774
|
method: e,
|
|
1766
|
-
args:
|
|
1775
|
+
args: n
|
|
1767
1776
|
};
|
|
1768
1777
|
};
|
|
1769
|
-
function
|
|
1778
|
+
function nt(i) {
|
|
1770
1779
|
const t = [];
|
|
1771
1780
|
function e(s) {
|
|
1772
|
-
const
|
|
1781
|
+
const n = [];
|
|
1773
1782
|
for (const a of s)
|
|
1774
|
-
a instanceof w ? e(a._container.rows.flat()) :
|
|
1775
|
-
|
|
1783
|
+
a instanceof w ? e(a._container.rows.flat()) : n.push(a);
|
|
1784
|
+
n.length > 0 && t.push(n);
|
|
1776
1785
|
}
|
|
1777
1786
|
for (const s of i)
|
|
1778
1787
|
e(s);
|
|
@@ -1783,25 +1792,25 @@ class Wt {
|
|
|
1783
1792
|
/**
|
|
1784
1793
|
* Object containing fields specification of the form.
|
|
1785
1794
|
*/
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1795
|
+
r(this, "_fields");
|
|
1796
|
+
r(this, "_container");
|
|
1797
|
+
r(this, "_string", null);
|
|
1789
1798
|
/**
|
|
1790
1799
|
* Widget type
|
|
1791
1800
|
*/
|
|
1792
|
-
|
|
1801
|
+
r(this, "_type", "form");
|
|
1793
1802
|
/**
|
|
1794
1803
|
* Determines if form is read only (default is false)
|
|
1795
1804
|
*/
|
|
1796
|
-
|
|
1805
|
+
r(this, "_readOnly", !1);
|
|
1797
1806
|
/**
|
|
1798
1807
|
* Context
|
|
1799
1808
|
*/
|
|
1800
|
-
|
|
1809
|
+
r(this, "_context", {});
|
|
1801
1810
|
/**
|
|
1802
1811
|
* Collection of onChange actions for fields
|
|
1803
1812
|
*/
|
|
1804
|
-
|
|
1813
|
+
r(this, "_onChangeFields", {});
|
|
1805
1814
|
/*
|
|
1806
1815
|
_widgets = {
|
|
1807
1816
|
*[Symbol.iterator]() {
|
|
@@ -1820,19 +1829,19 @@ class Wt {
|
|
|
1820
1829
|
/**
|
|
1821
1830
|
* Unique key for container
|
|
1822
1831
|
*/
|
|
1823
|
-
|
|
1832
|
+
r(this, "_keyIdx", 0);
|
|
1824
1833
|
/**
|
|
1825
1834
|
* List of invisible fields
|
|
1826
1835
|
*/
|
|
1827
|
-
|
|
1836
|
+
r(this, "_invisibleFields", []);
|
|
1828
1837
|
/**
|
|
1829
1838
|
* List of autorefreshable fields
|
|
1830
1839
|
*/
|
|
1831
|
-
|
|
1840
|
+
r(this, "_autorefreshableFields", []);
|
|
1832
1841
|
/**
|
|
1833
1842
|
* Context for each field in the form
|
|
1834
1843
|
*/
|
|
1835
|
-
|
|
1844
|
+
r(this, "_contextForFields", {});
|
|
1836
1845
|
this._fields = t, this._container = new V(e, 6, !1, "root");
|
|
1837
1846
|
}
|
|
1838
1847
|
get fields() {
|
|
@@ -1888,13 +1897,13 @@ class Wt {
|
|
|
1888
1897
|
}
|
|
1889
1898
|
parse(t, e) {
|
|
1890
1899
|
var o;
|
|
1891
|
-
const { values: s = {}, readOnly:
|
|
1892
|
-
this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string =
|
|
1900
|
+
const { values: s = {}, readOnly: n = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
|
|
1901
|
+
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({
|
|
1893
1902
|
fields: a.children,
|
|
1894
1903
|
container: this._container,
|
|
1895
1904
|
values: s
|
|
1896
1905
|
});
|
|
1897
|
-
const l =
|
|
1906
|
+
const l = nt(this._container._rows);
|
|
1898
1907
|
l.forEach((u) => {
|
|
1899
1908
|
const _ = u;
|
|
1900
1909
|
_._id && _._context && (this._contextForFields[_._id] = u._context);
|
|
@@ -1905,7 +1914,7 @@ class Wt {
|
|
|
1905
1914
|
container: e,
|
|
1906
1915
|
values: s
|
|
1907
1916
|
}) {
|
|
1908
|
-
const
|
|
1917
|
+
const n = new $();
|
|
1909
1918
|
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
1910
1919
|
var v, F;
|
|
1911
1920
|
const { tagName: l, attributes: o, children: u } = a;
|
|
@@ -1920,7 +1929,7 @@ class Wt {
|
|
|
1920
1929
|
`Field ${x} doesn't exist in fields defintion`
|
|
1921
1930
|
);
|
|
1922
1931
|
_ = this._fields[x].type, o.widget_props = {
|
|
1923
|
-
...
|
|
1932
|
+
...U(o.widget_props),
|
|
1924
1933
|
...this._fields[x].widget_props || {}
|
|
1925
1934
|
};
|
|
1926
1935
|
}
|
|
@@ -1950,25 +1959,25 @@ class Wt {
|
|
|
1950
1959
|
values: s,
|
|
1951
1960
|
fields: this._fields
|
|
1952
1961
|
});
|
|
1953
|
-
h.on_change && (this._onChangeFields[h.name] =
|
|
1962
|
+
h.on_change && (this._onChangeFields[h.name] = rt(
|
|
1954
1963
|
h.on_change
|
|
1955
1964
|
));
|
|
1956
|
-
let
|
|
1957
|
-
|
|
1965
|
+
let b;
|
|
1966
|
+
Q(h.domain) ? b = h.domain : Q((F = this._fields[h.name]) == null ? void 0 : F.domain) && (b = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1958
1967
|
const p = {
|
|
1959
1968
|
...d,
|
|
1960
1969
|
...g,
|
|
1961
1970
|
context: c,
|
|
1962
|
-
domain:
|
|
1971
|
+
domain: b,
|
|
1963
1972
|
key: `${this._keyIdx}`
|
|
1964
1973
|
};
|
|
1965
1974
|
e.readOnly && (p.readonly = !0);
|
|
1966
|
-
const y =
|
|
1975
|
+
const y = n.createWidget(_, p);
|
|
1967
1976
|
y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof w && this.parseNode({
|
|
1968
1977
|
fields: u,
|
|
1969
1978
|
container: y.container,
|
|
1970
1979
|
values: s
|
|
1971
|
-
}), y instanceof
|
|
1980
|
+
}), y instanceof ee && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
|
|
1972
1981
|
});
|
|
1973
1982
|
}
|
|
1974
1983
|
/**
|
|
@@ -1979,7 +1988,7 @@ class Wt {
|
|
|
1979
1988
|
return this.container.findById(t);
|
|
1980
1989
|
}
|
|
1981
1990
|
}
|
|
1982
|
-
function
|
|
1991
|
+
function Q(i) {
|
|
1983
1992
|
return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
|
|
1984
1993
|
}
|
|
1985
1994
|
class It {
|
|
@@ -1987,34 +1996,34 @@ class It {
|
|
|
1987
1996
|
/**
|
|
1988
1997
|
* Object containing fields specification of the form.
|
|
1989
1998
|
*/
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1999
|
+
r(this, "_fields");
|
|
2000
|
+
r(this, "_columns", []);
|
|
2001
|
+
r(this, "_string", null);
|
|
1993
2002
|
/**
|
|
1994
2003
|
* Widget type
|
|
1995
2004
|
*/
|
|
1996
|
-
|
|
2005
|
+
r(this, "_type", "tree");
|
|
1997
2006
|
/**
|
|
1998
2007
|
* Color expression value
|
|
1999
2008
|
*/
|
|
2000
|
-
|
|
2001
|
-
|
|
2009
|
+
r(this, "_colors", null);
|
|
2010
|
+
r(this, "_status", null);
|
|
2002
2011
|
/**
|
|
2003
2012
|
* Editable value
|
|
2004
2013
|
*/
|
|
2005
|
-
|
|
2014
|
+
r(this, "_editable", null);
|
|
2006
2015
|
/**
|
|
2007
2016
|
* Context for each field in the form
|
|
2008
2017
|
*/
|
|
2009
|
-
|
|
2018
|
+
r(this, "_contextForFields", {});
|
|
2010
2019
|
/**
|
|
2011
2020
|
* List of autorefreshable fields
|
|
2012
2021
|
*/
|
|
2013
|
-
|
|
2022
|
+
r(this, "_autorefreshableFields", []);
|
|
2014
2023
|
/**
|
|
2015
2024
|
* Is infinite
|
|
2016
2025
|
*/
|
|
2017
|
-
|
|
2026
|
+
r(this, "_infinite", !1);
|
|
2018
2027
|
this._fields = t;
|
|
2019
2028
|
}
|
|
2020
2029
|
get fields() {
|
|
@@ -2054,11 +2063,11 @@ class It {
|
|
|
2054
2063
|
this._infinite = t;
|
|
2055
2064
|
}
|
|
2056
2065
|
parse(t) {
|
|
2057
|
-
const e = D.parse(t).filter((
|
|
2058
|
-
this._string = e.attributes.string || null, this._string && (this._string =
|
|
2066
|
+
const e = D.parse(t).filter((n) => n.tagName === "tree")[0];
|
|
2067
|
+
this._string = e.attributes.string || null, this._string && (this._string = m(this._string)), this._colors = e.attributes.colors || null, this._colors && (this._colors = m(this._colors)), this._status = e.attributes.status || null, this._status && (this._status = m(this._status)), this._editable = e.attributes.editable || null, this._infinite = e.attributes.infinite || !1;
|
|
2059
2068
|
const s = new $();
|
|
2060
|
-
e.children.forEach((
|
|
2061
|
-
const { tagName: a, attributes: l } =
|
|
2069
|
+
e.children.forEach((n) => {
|
|
2070
|
+
const { tagName: a, attributes: l } = n;
|
|
2062
2071
|
let o = null;
|
|
2063
2072
|
if (a === "field") {
|
|
2064
2073
|
const { name: u, widget: _ } = l;
|
|
@@ -2114,13 +2123,13 @@ class Et {
|
|
|
2114
2123
|
/**
|
|
2115
2124
|
* Object containing the specific fields for primary and secondary search fields
|
|
2116
2125
|
*/
|
|
2117
|
-
|
|
2126
|
+
r(this, "_searchFields");
|
|
2118
2127
|
/**
|
|
2119
2128
|
* Object containing all the fields specification of the whole form
|
|
2120
2129
|
*/
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2130
|
+
r(this, "_fields");
|
|
2131
|
+
r(this, "_simpleSearchContainer");
|
|
2132
|
+
r(this, "_advancedSearchContainer");
|
|
2124
2133
|
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new V(s), this._advancedSearchContainer = new V(s);
|
|
2125
2134
|
}
|
|
2126
2135
|
get searchFields() {
|
|
@@ -2140,24 +2149,24 @@ class Et {
|
|
|
2140
2149
|
this.parseFields(
|
|
2141
2150
|
this.searchFields.primary,
|
|
2142
2151
|
t
|
|
2143
|
-
).forEach((
|
|
2144
|
-
this.simpleSearchContainer.addWidget(
|
|
2152
|
+
).forEach((n) => {
|
|
2153
|
+
this.simpleSearchContainer.addWidget(n, { addLabel: !1 }), this.advancedSearchContainer.addWidget(n, { addLabel: !1 });
|
|
2145
2154
|
}), this.parseFields(
|
|
2146
2155
|
this.searchFields.secondary,
|
|
2147
2156
|
t
|
|
2148
|
-
).forEach((
|
|
2149
|
-
this.advancedSearchContainer.addWidget(
|
|
2157
|
+
).forEach((n) => {
|
|
2158
|
+
this.advancedSearchContainer.addWidget(n, { addLabel: !1 });
|
|
2150
2159
|
});
|
|
2151
2160
|
}
|
|
2152
2161
|
parseFields(t, e) {
|
|
2153
2162
|
return t.map((s) => {
|
|
2154
|
-
const
|
|
2163
|
+
const n = {
|
|
2155
2164
|
...this.fields[s],
|
|
2156
2165
|
name: s,
|
|
2157
2166
|
colspan: 2
|
|
2158
|
-
}, { type: a, widget: l } =
|
|
2167
|
+
}, { type: a, widget: l } = n;
|
|
2159
2168
|
let o = l ?? a;
|
|
2160
|
-
return at[o] === void 0 && (o = a), e.createWidget(o,
|
|
2169
|
+
return at[o] === void 0 && (o = a), e.createWidget(o, n);
|
|
2161
2170
|
});
|
|
2162
2171
|
}
|
|
2163
2172
|
/**
|
|
@@ -2176,18 +2185,18 @@ const St = ({
|
|
|
2176
2185
|
return i.forEach((s) => {
|
|
2177
2186
|
if (!Array.isArray(s))
|
|
2178
2187
|
return;
|
|
2179
|
-
const [
|
|
2188
|
+
const [n, a, l] = s;
|
|
2180
2189
|
let o, u;
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
)) : (o =
|
|
2190
|
+
n.indexOf(".") !== -1 ? (o = n.substr(0, n.indexOf(".")), u = n.substr(
|
|
2191
|
+
n.indexOf(".") + 1,
|
|
2192
|
+
n.length - 1
|
|
2193
|
+
)) : (o = n, u = "id"), o === t && e.push([u, a, l]);
|
|
2185
2194
|
}), e;
|
|
2186
2195
|
}, zt = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
2187
2196
|
class lt {
|
|
2188
2197
|
constructor(t) {
|
|
2189
|
-
|
|
2190
|
-
|
|
2198
|
+
r(this, "_action_id", null);
|
|
2199
|
+
r(this, "_position", null);
|
|
2191
2200
|
t.action_id && (this._action_id = t.action_id), t.position && (this._position = t.position);
|
|
2192
2201
|
}
|
|
2193
2202
|
get action_id() {
|
|
@@ -2199,13 +2208,13 @@ class lt {
|
|
|
2199
2208
|
}
|
|
2200
2209
|
class Vt {
|
|
2201
2210
|
constructor(t) {
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
const e = D.parse(t).filter((
|
|
2211
|
+
r(this, "_string", null);
|
|
2212
|
+
r(this, "_items", []);
|
|
2213
|
+
const e = D.parse(t).filter((n) => n.tagName === "dashboard")[0];
|
|
2205
2214
|
this._string = e.attributes.string || null;
|
|
2206
2215
|
const { children: s } = e;
|
|
2207
|
-
s.forEach((
|
|
2208
|
-
|
|
2216
|
+
s.forEach((n) => {
|
|
2217
|
+
n.tagName === "dashboard_item" && this._items.push(new lt(n.attributes));
|
|
2209
2218
|
});
|
|
2210
2219
|
}
|
|
2211
2220
|
get string() {
|
|
@@ -2215,13 +2224,13 @@ class Vt {
|
|
|
2215
2224
|
return this._items;
|
|
2216
2225
|
}
|
|
2217
2226
|
}
|
|
2218
|
-
class
|
|
2227
|
+
class oe {
|
|
2219
2228
|
constructor(t) {
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2229
|
+
r(this, "_string", null);
|
|
2230
|
+
r(this, "_type");
|
|
2231
|
+
r(this, "_timerange", null);
|
|
2232
|
+
r(this, "_interval", 1);
|
|
2233
|
+
r(this, "_y_range", "default");
|
|
2225
2234
|
if (this._string = t.attributes.string || null, this._timerange = t.attributes.timerange || null, t.attributes.interval && (this._interval = parseInt(t.attributes.interval)), t.attributes.y_range) {
|
|
2226
2235
|
const e = t.attributes.y_range;
|
|
2227
2236
|
(e === "auto" || e === "full" || e === "default") && (this._y_range = e);
|
|
@@ -2243,15 +2252,15 @@ class le {
|
|
|
2243
2252
|
return this._y_range;
|
|
2244
2253
|
}
|
|
2245
2254
|
}
|
|
2246
|
-
class
|
|
2255
|
+
class ce extends oe {
|
|
2247
2256
|
constructor(e, s) {
|
|
2248
2257
|
super(s);
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
this._type = e, this._color = s.attributes.color || null, this._color && (this._color =
|
|
2258
|
+
r(this, "_color", null);
|
|
2259
|
+
r(this, "_icon", null);
|
|
2260
|
+
r(this, "_totalDomain", null);
|
|
2261
|
+
r(this, "_showPercent", !1);
|
|
2262
|
+
r(this, "_suffix", null);
|
|
2263
|
+
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 = T(s.attributes.showPercent);
|
|
2255
2264
|
}
|
|
2256
2265
|
get color() {
|
|
2257
2266
|
return this._color;
|
|
@@ -2269,13 +2278,13 @@ class oe extends le {
|
|
|
2269
2278
|
return this._suffix;
|
|
2270
2279
|
}
|
|
2271
2280
|
}
|
|
2272
|
-
class ot extends
|
|
2281
|
+
class ot extends ce {
|
|
2273
2282
|
constructor(e, s) {
|
|
2274
2283
|
super(e, s);
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
const { children:
|
|
2278
|
-
|
|
2284
|
+
r(this, "_field");
|
|
2285
|
+
r(this, "_operator");
|
|
2286
|
+
const { children: n } = s;
|
|
2287
|
+
n.forEach((a) => {
|
|
2279
2288
|
if (a.tagName === "field") {
|
|
2280
2289
|
const l = a.attributes.name, o = a.attributes.operator;
|
|
2281
2290
|
this._field = l || void 0, this._operator = o;
|
|
@@ -2294,14 +2303,14 @@ const ct = (i) => {
|
|
|
2294
2303
|
let e;
|
|
2295
2304
|
if (i.forEach((s) => {
|
|
2296
2305
|
if (s.tagName === "field") {
|
|
2297
|
-
const
|
|
2298
|
-
if (!
|
|
2306
|
+
const n = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, u = s.attributes.stacked || void 0;
|
|
2307
|
+
if (!n)
|
|
2299
2308
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
2300
2309
|
if (!l)
|
|
2301
2310
|
throw new Error("Missing name attribute for field");
|
|
2302
|
-
|
|
2311
|
+
n === "x" ? e = new ht({
|
|
2303
2312
|
name: l
|
|
2304
|
-
}) :
|
|
2313
|
+
}) : n === "y" && t.push(
|
|
2305
2314
|
new dt({
|
|
2306
2315
|
name: l,
|
|
2307
2316
|
operator: a,
|
|
@@ -2319,14 +2328,14 @@ const ct = (i) => {
|
|
|
2319
2328
|
y: t
|
|
2320
2329
|
};
|
|
2321
2330
|
};
|
|
2322
|
-
class j extends
|
|
2331
|
+
class j extends oe {
|
|
2323
2332
|
constructor(e, s) {
|
|
2324
2333
|
super(s);
|
|
2325
|
-
|
|
2326
|
-
|
|
2334
|
+
r(this, "_x");
|
|
2335
|
+
r(this, "_y");
|
|
2327
2336
|
this._type = e;
|
|
2328
|
-
const
|
|
2329
|
-
this._x =
|
|
2337
|
+
const n = ct(s.children);
|
|
2338
|
+
this._x = n.x, this._y = n.y;
|
|
2330
2339
|
}
|
|
2331
2340
|
get x() {
|
|
2332
2341
|
return this._x;
|
|
@@ -2336,13 +2345,13 @@ class j extends le {
|
|
|
2336
2345
|
}
|
|
2337
2346
|
}
|
|
2338
2347
|
const ut = {
|
|
2339
|
-
indicator:
|
|
2348
|
+
indicator: ce,
|
|
2340
2349
|
indicatorField: ot,
|
|
2341
2350
|
line: j,
|
|
2342
2351
|
bar: j,
|
|
2343
2352
|
pie: j
|
|
2344
2353
|
}, Yt = (i) => {
|
|
2345
|
-
const t = D.parse(i).filter((
|
|
2354
|
+
const t = D.parse(i).filter((n) => n.tagName === "graph")[0], e = t.attributes.type;
|
|
2346
2355
|
if (!e)
|
|
2347
2356
|
throw new Error(`${e} is not a valid graph`);
|
|
2348
2357
|
const s = ut[e];
|
|
@@ -2350,10 +2359,10 @@ const ut = {
|
|
|
2350
2359
|
throw new Error(`${e} not found as a GraphModel`);
|
|
2351
2360
|
return new s(e, t);
|
|
2352
2361
|
};
|
|
2353
|
-
class
|
|
2362
|
+
class ue {
|
|
2354
2363
|
constructor({ name: t, axis: e }) {
|
|
2355
|
-
|
|
2356
|
-
|
|
2364
|
+
r(this, "_name");
|
|
2365
|
+
r(this, "_axis");
|
|
2357
2366
|
this._name = t, this._axis = e;
|
|
2358
2367
|
}
|
|
2359
2368
|
get name() {
|
|
@@ -2363,18 +2372,18 @@ class ce {
|
|
|
2363
2372
|
return this._axis;
|
|
2364
2373
|
}
|
|
2365
2374
|
}
|
|
2366
|
-
class dt extends
|
|
2375
|
+
class dt extends ue {
|
|
2367
2376
|
constructor({
|
|
2368
2377
|
name: e,
|
|
2369
2378
|
operator: s,
|
|
2370
|
-
label:
|
|
2379
|
+
label: n,
|
|
2371
2380
|
stacked: a
|
|
2372
2381
|
}) {
|
|
2373
2382
|
super({ name: e, axis: "y" });
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
this._operator = s, this._label =
|
|
2383
|
+
r(this, "_operator");
|
|
2384
|
+
r(this, "_label");
|
|
2385
|
+
r(this, "_stacked");
|
|
2386
|
+
this._operator = s, this._label = n, this._stacked = a;
|
|
2378
2387
|
}
|
|
2379
2388
|
get operator() {
|
|
2380
2389
|
return this._operator;
|
|
@@ -2386,7 +2395,7 @@ class dt extends ce {
|
|
|
2386
2395
|
return this._stacked;
|
|
2387
2396
|
}
|
|
2388
2397
|
}
|
|
2389
|
-
class ht extends
|
|
2398
|
+
class ht extends ue {
|
|
2390
2399
|
constructor({ name: t }) {
|
|
2391
2400
|
super({ name: t, axis: "x" });
|
|
2392
2401
|
}
|
|
@@ -2402,16 +2411,16 @@ function q({
|
|
|
2402
2411
|
values: t,
|
|
2403
2412
|
fieldName: e
|
|
2404
2413
|
}) {
|
|
2405
|
-
const s = i[e],
|
|
2414
|
+
const s = i[e], n = t[e];
|
|
2406
2415
|
if (!s)
|
|
2407
2416
|
throw new Error(`Field ${e} not found`);
|
|
2408
2417
|
if (s.type === "many2one")
|
|
2409
|
-
return
|
|
2418
|
+
return n ? { value: n[0], label: n[1] } : { value: !1, label: void 0 };
|
|
2410
2419
|
if (s.type === "selection") {
|
|
2411
|
-
const l = s.selection.find((o) => o[0] ===
|
|
2412
|
-
return l ? { value:
|
|
2420
|
+
const l = s.selection.find((o) => o[0] === n);
|
|
2421
|
+
return l ? { value: n, label: l[1] } : { value: !1, label: void 0 };
|
|
2413
2422
|
}
|
|
2414
|
-
return { value:
|
|
2423
|
+
return { value: n, label: n };
|
|
2415
2424
|
}
|
|
2416
2425
|
const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2417
2426
|
__proto__: null,
|
|
@@ -2439,26 +2448,26 @@ function gt({
|
|
|
2439
2448
|
interval: e = 1
|
|
2440
2449
|
}) {
|
|
2441
2450
|
let s = [];
|
|
2442
|
-
const
|
|
2451
|
+
const n = he({
|
|
2443
2452
|
values: i,
|
|
2444
2453
|
groupBy: "type-stacked"
|
|
2445
2454
|
}), a = `${t}s`;
|
|
2446
|
-
return Object.keys(
|
|
2447
|
-
const u =
|
|
2455
|
+
return Object.keys(n).forEach((o) => {
|
|
2456
|
+
const u = n[o];
|
|
2448
2457
|
for (let _ = 0; _ < u.length; _++) {
|
|
2449
2458
|
const h = u[_];
|
|
2450
2459
|
if (s.push(h), _ === u.length - 1)
|
|
2451
2460
|
return;
|
|
2452
2461
|
const d = h.x, g = u[_ + 1].x;
|
|
2453
|
-
if (!
|
|
2462
|
+
if (!de([d, g], a)) {
|
|
2454
2463
|
const c = mt({
|
|
2455
2464
|
dates: [d, g],
|
|
2456
2465
|
timerange: t,
|
|
2457
2466
|
interval: e
|
|
2458
2467
|
});
|
|
2459
2468
|
s = s.concat(
|
|
2460
|
-
c.map((
|
|
2461
|
-
x:
|
|
2469
|
+
c.map((b) => ({
|
|
2470
|
+
x: b,
|
|
2462
2471
|
value: 0,
|
|
2463
2472
|
type: h.type,
|
|
2464
2473
|
stacked: h.stacked
|
|
@@ -2473,19 +2482,19 @@ function mt({
|
|
|
2473
2482
|
timerange: t,
|
|
2474
2483
|
interval: e = 1
|
|
2475
2484
|
}) {
|
|
2476
|
-
const s = [],
|
|
2485
|
+
const s = [], n = `${t}s`;
|
|
2477
2486
|
if (i.length === 1)
|
|
2478
2487
|
return i;
|
|
2479
2488
|
const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
|
|
2480
2489
|
for (let l = 0; l < a.length - 1; l++) {
|
|
2481
2490
|
const o = a[l], u = a[l + 1];
|
|
2482
|
-
if (!
|
|
2483
|
-
const _ = W(o, z(
|
|
2491
|
+
if (!de([o, u], n)) {
|
|
2492
|
+
const _ = W(o, z(n)).add(
|
|
2484
2493
|
e,
|
|
2485
|
-
|
|
2486
|
-
), h = W(u, z(
|
|
2494
|
+
n
|
|
2495
|
+
), h = W(u, z(n));
|
|
2487
2496
|
for (; _.isBefore(h); )
|
|
2488
|
-
s.push(_.format(z(
|
|
2497
|
+
s.push(_.format(z(n))), _.add(e, n);
|
|
2489
2498
|
}
|
|
2490
2499
|
}
|
|
2491
2500
|
return s;
|
|
@@ -2497,12 +2506,12 @@ function bt({
|
|
|
2497
2506
|
const e = yt({
|
|
2498
2507
|
values: i,
|
|
2499
2508
|
timerange: t
|
|
2500
|
-
}), s = [],
|
|
2509
|
+
}), s = [], n = he({
|
|
2501
2510
|
values: e,
|
|
2502
2511
|
groupBy: "all"
|
|
2503
2512
|
});
|
|
2504
|
-
return Object.keys(
|
|
2505
|
-
const l =
|
|
2513
|
+
return Object.keys(n).forEach((a) => {
|
|
2514
|
+
const l = n[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
|
|
2506
2515
|
values: l.map((_) => _.value),
|
|
2507
2516
|
operator: o
|
|
2508
2517
|
});
|
|
@@ -2557,26 +2566,26 @@ function pt({
|
|
|
2557
2566
|
function xt(i) {
|
|
2558
2567
|
return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2559
2568
|
}
|
|
2560
|
-
function
|
|
2569
|
+
function de(i, t) {
|
|
2561
2570
|
let e = !1;
|
|
2562
2571
|
const s = z(t);
|
|
2563
2572
|
if (i.length === 0)
|
|
2564
2573
|
return !1;
|
|
2565
2574
|
if (i.length === 1)
|
|
2566
2575
|
return !0;
|
|
2567
|
-
for (let
|
|
2568
|
-
const a = W(i[
|
|
2576
|
+
for (let n = 0; n < i.length - 1; n++) {
|
|
2577
|
+
const a = W(i[n], s), o = W(i[n + 1], s).diff(a, t);
|
|
2569
2578
|
Math.abs(o) === 1 ? e = !0 : e = !1;
|
|
2570
2579
|
}
|
|
2571
2580
|
return e;
|
|
2572
2581
|
}
|
|
2573
|
-
function
|
|
2582
|
+
function he({
|
|
2574
2583
|
values: i,
|
|
2575
2584
|
groupBy: t
|
|
2576
2585
|
}) {
|
|
2577
2586
|
const e = {};
|
|
2578
2587
|
return i.forEach((s) => {
|
|
2579
|
-
const
|
|
2588
|
+
const n = s.x, a = s.type, l = s.stacked, o = t === "all" ? `${n}-${a}-${l}` : `${a}-${l}`;
|
|
2580
2589
|
e[o] || (e[o] = []), e[o].push(s);
|
|
2581
2590
|
}), e;
|
|
2582
2591
|
}
|
|
@@ -2609,14 +2618,14 @@ const wt = {
|
|
|
2609
2618
|
fields: e,
|
|
2610
2619
|
options: s
|
|
2611
2620
|
}) => {
|
|
2612
|
-
const
|
|
2621
|
+
const n = B({
|
|
2613
2622
|
fieldName: i.x.name,
|
|
2614
2623
|
values: t,
|
|
2615
2624
|
fields: e
|
|
2616
2625
|
}), a = [];
|
|
2617
2626
|
i.y.forEach((c) => {
|
|
2618
|
-
Object.keys(
|
|
2619
|
-
const p =
|
|
2627
|
+
Object.keys(n).forEach((b) => {
|
|
2628
|
+
const p = n[b].label, y = n[b].entries;
|
|
2620
2629
|
if (c.label) {
|
|
2621
2630
|
const v = B({
|
|
2622
2631
|
fieldName: c.label,
|
|
@@ -2624,17 +2633,17 @@ const wt = {
|
|
|
2624
2633
|
fields: e
|
|
2625
2634
|
});
|
|
2626
2635
|
Object.keys(v).forEach((F) => {
|
|
2627
|
-
const x = v[F].entries, E = v[F].label,
|
|
2636
|
+
const x = v[F].entries, E = v[F].label, ge = N({
|
|
2628
2637
|
entries: x,
|
|
2629
2638
|
fields: e,
|
|
2630
2639
|
fieldName: c.name
|
|
2631
|
-
}),
|
|
2632
|
-
values:
|
|
2640
|
+
}), me = Y({
|
|
2641
|
+
values: ge,
|
|
2633
2642
|
operator: c.operator
|
|
2634
2643
|
});
|
|
2635
2644
|
a.push({
|
|
2636
2645
|
x: p || !1,
|
|
2637
|
-
value:
|
|
2646
|
+
value: me,
|
|
2638
2647
|
type: E,
|
|
2639
2648
|
operator: c.operator,
|
|
2640
2649
|
stacked: c.stacked
|
|
@@ -2652,7 +2661,7 @@ const wt = {
|
|
|
2652
2661
|
a.push({
|
|
2653
2662
|
x: p || !1,
|
|
2654
2663
|
value: F,
|
|
2655
|
-
type:
|
|
2664
|
+
type: _e({
|
|
2656
2665
|
yAxis: c,
|
|
2657
2666
|
fields: e
|
|
2658
2667
|
}),
|
|
@@ -2663,7 +2672,7 @@ const wt = {
|
|
|
2663
2672
|
});
|
|
2664
2673
|
});
|
|
2665
2674
|
const l = i.y.some((c) => c.label !== void 0), o = i.y.some((c) => c.stacked !== void 0);
|
|
2666
|
-
let _ = [...a.sort((c,
|
|
2675
|
+
let _ = [...a.sort((c, b) => c.x < b.x ? -1 : c.x > b.x ? 1 : 0)];
|
|
2667
2676
|
o && i.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
|
|
2668
2677
|
let h = [..._];
|
|
2669
2678
|
i.type === "pie" && h.some((c) => c.x === !1) ? h = h.map((c) => c.x === !1 ? { ...c, x: (s == null ? void 0 : s.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (h = h.filter(
|
|
@@ -2674,7 +2683,7 @@ const wt = {
|
|
|
2674
2683
|
values: d,
|
|
2675
2684
|
timerange: i.timerange,
|
|
2676
2685
|
interval: i.interval
|
|
2677
|
-
}) : i.type == "pie" && (d = h.sort((c,
|
|
2686
|
+
}) : i.type == "pie" && (d = h.sort((c, b) => b.value - c.value));
|
|
2678
2687
|
const g = {
|
|
2679
2688
|
data: d,
|
|
2680
2689
|
isGroup: o || l,
|
|
@@ -2683,8 +2692,8 @@ const wt = {
|
|
|
2683
2692
|
if (i.type === "line" && i.y_range && (g.yAxisOpts = {
|
|
2684
2693
|
mode: i.y_range
|
|
2685
2694
|
}, i.y_range === "auto")) {
|
|
2686
|
-
const { min: c, max:
|
|
2687
|
-
g.yAxisOpts.valueOpts = { min: c, max:
|
|
2695
|
+
const { min: c, max: b } = fe(d);
|
|
2696
|
+
g.yAxisOpts.valueOpts = { min: c, max: b };
|
|
2688
2697
|
}
|
|
2689
2698
|
return g;
|
|
2690
2699
|
};
|
|
@@ -2697,7 +2706,7 @@ function N({
|
|
|
2697
2706
|
fieldName: t,
|
|
2698
2707
|
values: s,
|
|
2699
2708
|
fields: e
|
|
2700
|
-
})).map(({ value: s, label:
|
|
2709
|
+
})).map(({ value: s, label: n }) => n);
|
|
2701
2710
|
}
|
|
2702
2711
|
function Y({
|
|
2703
2712
|
operator: i,
|
|
@@ -2725,7 +2734,7 @@ function Y({
|
|
|
2725
2734
|
})
|
|
2726
2735
|
);
|
|
2727
2736
|
case "avg": {
|
|
2728
|
-
const s = t.reduce((
|
|
2737
|
+
const s = t.reduce((n, a) => n + a, 0) / t.length || 0;
|
|
2729
2738
|
return S(s);
|
|
2730
2739
|
}
|
|
2731
2740
|
case "min":
|
|
@@ -2743,13 +2752,13 @@ function B({
|
|
|
2743
2752
|
values: e
|
|
2744
2753
|
}) {
|
|
2745
2754
|
const s = {};
|
|
2746
|
-
return e.forEach((
|
|
2755
|
+
return e.forEach((n) => {
|
|
2747
2756
|
const { value: a, label: l } = q({
|
|
2748
2757
|
fields: t,
|
|
2749
|
-
values:
|
|
2758
|
+
values: n,
|
|
2750
2759
|
fieldName: i
|
|
2751
2760
|
});
|
|
2752
|
-
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(
|
|
2761
|
+
s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(n);
|
|
2753
2762
|
}), s;
|
|
2754
2763
|
}
|
|
2755
2764
|
function Ft(i) {
|
|
@@ -2759,30 +2768,30 @@ function Ft(i) {
|
|
|
2759
2768
|
t = t.concat(s.entries);
|
|
2760
2769
|
}), t;
|
|
2761
2770
|
}
|
|
2762
|
-
function
|
|
2771
|
+
function _e({
|
|
2763
2772
|
yAxis: i,
|
|
2764
2773
|
fields: t
|
|
2765
2774
|
}) {
|
|
2766
2775
|
const e = t[i.name];
|
|
2767
2776
|
return e != null && e.string ? e.string : i.name;
|
|
2768
2777
|
}
|
|
2769
|
-
function
|
|
2778
|
+
function fe(i, t = 0.1) {
|
|
2770
2779
|
if (i.length === 0)
|
|
2771
2780
|
throw new Error("The values array cannot be empty.");
|
|
2772
|
-
const e = i.map((l) => l.value), s = Math.min(...e),
|
|
2781
|
+
const e = i.map((l) => l.value), s = Math.min(...e), n = Math.max(...e), a = (n - s) * t;
|
|
2773
2782
|
return {
|
|
2774
2783
|
min: s - a,
|
|
2775
|
-
max:
|
|
2784
|
+
max: n + a
|
|
2776
2785
|
};
|
|
2777
2786
|
}
|
|
2778
2787
|
const jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2779
2788
|
__proto__: null,
|
|
2780
2789
|
getAllObjectsInGroupedValues: Ft,
|
|
2781
|
-
getMinMax:
|
|
2790
|
+
getMinMax: fe,
|
|
2782
2791
|
getValueForOperator: Y,
|
|
2783
2792
|
getValuesForYField: N,
|
|
2784
2793
|
getValuesGroupedByField: B,
|
|
2785
|
-
getYAxisFieldname:
|
|
2794
|
+
getYAxisFieldname: _e,
|
|
2786
2795
|
labelsForOperator: wt,
|
|
2787
2796
|
processGraphData: vt
|
|
2788
2797
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -2790,12 +2799,12 @@ export {
|
|
|
2790
2799
|
Xe as Alert,
|
|
2791
2800
|
ke as Avatar,
|
|
2792
2801
|
Ae as Binary,
|
|
2793
|
-
|
|
2794
|
-
|
|
2802
|
+
te as Boolean,
|
|
2803
|
+
ee as Button,
|
|
2795
2804
|
Te as ButtonGroup,
|
|
2796
2805
|
Ze as Carousel,
|
|
2797
2806
|
A as Char,
|
|
2798
|
-
|
|
2807
|
+
re as CodeEditor,
|
|
2799
2808
|
et as ColorPicker,
|
|
2800
2809
|
Ue as Comments,
|
|
2801
2810
|
V as Container,
|
|
@@ -2809,10 +2818,10 @@ export {
|
|
|
2809
2818
|
R as Float,
|
|
2810
2819
|
Se as FloatTime,
|
|
2811
2820
|
Wt as Form,
|
|
2812
|
-
|
|
2813
|
-
|
|
2821
|
+
oe as Graph,
|
|
2822
|
+
ue as GraphAxis,
|
|
2814
2823
|
j as GraphChart,
|
|
2815
|
-
|
|
2824
|
+
ce as GraphIndicator,
|
|
2816
2825
|
ot as GraphIndicatorField,
|
|
2817
2826
|
ht as GraphXAxis,
|
|
2818
2827
|
dt as GraphYAxis,
|
|
@@ -2821,14 +2830,14 @@ export {
|
|
|
2821
2830
|
Ne as Image,
|
|
2822
2831
|
Ge as Indicator,
|
|
2823
2832
|
Ee as Integer,
|
|
2824
|
-
|
|
2825
|
-
|
|
2833
|
+
H as JSONField,
|
|
2834
|
+
Z as Label,
|
|
2826
2835
|
We as Many2one,
|
|
2827
2836
|
Ie as Markdown,
|
|
2828
|
-
|
|
2829
|
-
|
|
2837
|
+
se as MultiCheckbox,
|
|
2838
|
+
K as NewLine,
|
|
2830
2839
|
M as Notebook,
|
|
2831
|
-
|
|
2840
|
+
ie as One2many,
|
|
2832
2841
|
Oe as Page,
|
|
2833
2842
|
Ve as ProgressBar,
|
|
2834
2843
|
qe as Radio,
|