@gisce/ooui 1.0.0-alpha.2 → 1.0.0-alpha.20
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/Field.d.ts +6 -0
- package/dist/Field.d.ts.map +1 -1
- package/dist/Form.d.ts.map +1 -1
- package/dist/Widget.d.ts +4 -4
- package/dist/Widget.d.ts.map +1 -1
- package/dist/helpers/attributeParser.d.ts +9 -1
- package/dist/helpers/attributeParser.d.ts.map +1 -1
- package/dist/ooui.es.js +501 -408
- package/dist/ooui.es.js.map +1 -1
- package/package.json +5 -3
- package/src/Field.ts +17 -1
- package/src/Form.ts +11 -2
- package/src/Widget.ts +11 -6
- package/src/helpers/attributeParser.ts +192 -50
- package/src/spec/Form.spec.ts +116 -21
- package/src/spec/Widget.spec.ts +0 -6
- package/src/spec/attributeParser.spec.ts +301 -2
package/dist/ooui.es.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var n = (s, t, e) => (
|
|
4
|
-
import { decode as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
var oe = Object.defineProperty;
|
|
2
|
+
var ce = (s, t, e) => t in s ? oe(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var n = (s, t, e) => (ce(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { decode as de } from "html-entities";
|
|
5
|
+
import { evaluateCondition as ue } from "@gisce/conscheck";
|
|
6
|
+
import * as Y from "txml";
|
|
7
|
+
import E from "moment";
|
|
7
8
|
const F = class F {
|
|
8
9
|
constructor(t) {
|
|
9
10
|
/**
|
|
10
|
-
* Determines if widget is read only (default is
|
|
11
|
+
* Determines if widget is read only (default is undefined)
|
|
11
12
|
*/
|
|
12
13
|
n(this, "_readOnly");
|
|
13
14
|
/**
|
|
@@ -35,8 +36,8 @@ const F = class F {
|
|
|
35
36
|
*/
|
|
36
37
|
n(this, "_key");
|
|
37
38
|
n(this, "_parsedWidgetProps", {});
|
|
38
|
-
if (this._colspan = F._defaultColspan, this.
|
|
39
|
-
if (t.colspan && (this._colspan = +t.colspan), t.readonly && (t.readonly === "1" || t.readonly === 1 || t.readonly === !0) && (this._readOnly = !
|
|
39
|
+
if (this._colspan = F._defaultColspan, this._invisible = !1, t) {
|
|
40
|
+
if (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (t.readonly === "1" || t.readonly === 1 || t.readonly === !0 ? this._readOnly = !0 : (t.readonly === "0" || t.readonly === 0 || t.readonly === !1) && (this._readOnly = !1)), 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 = JSON.stringify(t.domain) : this._domain = t.domain), t.widget_props)
|
|
40
41
|
try {
|
|
41
42
|
this._parsedWidgetProps = JSON.parse(
|
|
42
43
|
t.widget_props.replace(/'/g, '"')
|
|
@@ -107,57 +108,138 @@ const F = class F {
|
|
|
107
108
|
*/
|
|
108
109
|
n(F, "_defaultColspan", 1);
|
|
109
110
|
let v = F;
|
|
110
|
-
const
|
|
111
|
+
const he = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), _e = ({
|
|
111
112
|
entry: s,
|
|
112
113
|
values: t,
|
|
113
114
|
fields: e
|
|
114
115
|
}) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
let [i, r, a] = s, l = t[i];
|
|
117
|
+
const o = q({
|
|
118
|
+
fieldName: i,
|
|
119
|
+
valueInObject: l,
|
|
120
|
+
expectedValue: a,
|
|
121
|
+
fields: e
|
|
122
|
+
});
|
|
123
|
+
if (o.directOutcome !== void 0)
|
|
124
|
+
return o.directOutcome;
|
|
125
|
+
switch (o.modifiedValueInObject !== null && (l = o.modifiedValueInObject), o.modifiedExpectedValue !== null && (a = o.modifiedExpectedValue), r.toLowerCase()) {
|
|
120
126
|
case "=":
|
|
121
127
|
case "==":
|
|
122
|
-
return
|
|
128
|
+
return l == a;
|
|
123
129
|
case "<>":
|
|
124
130
|
case "!=":
|
|
125
|
-
return
|
|
131
|
+
return l != a;
|
|
126
132
|
case ">":
|
|
127
|
-
return
|
|
133
|
+
return l > a;
|
|
128
134
|
case ">=":
|
|
129
|
-
return
|
|
135
|
+
return l >= a;
|
|
130
136
|
case "<":
|
|
131
|
-
return
|
|
137
|
+
return l < a;
|
|
132
138
|
case "<=":
|
|
133
|
-
return
|
|
139
|
+
return l <= a;
|
|
134
140
|
case "in":
|
|
135
|
-
return
|
|
141
|
+
return a.includes(l);
|
|
136
142
|
case "not in":
|
|
137
|
-
return !
|
|
143
|
+
return !a.includes(l);
|
|
138
144
|
default:
|
|
139
145
|
return !1;
|
|
140
146
|
}
|
|
141
|
-
},
|
|
147
|
+
}, b = (s) => de(s, { level: "xml" }), q = ({
|
|
148
|
+
fieldName: s,
|
|
149
|
+
valueInObject: t,
|
|
150
|
+
expectedValue: e,
|
|
151
|
+
fields: i = {}
|
|
152
|
+
}) => {
|
|
153
|
+
const r = {
|
|
154
|
+
modifiedValueInObject: t,
|
|
155
|
+
modifiedExpectedValue: null,
|
|
156
|
+
directOutcome: void 0
|
|
157
|
+
};
|
|
158
|
+
return i[s] === void 0 ? {
|
|
159
|
+
modifiedValueInObject: null,
|
|
160
|
+
modifiedExpectedValue: null,
|
|
161
|
+
directOutcome: !1
|
|
162
|
+
} : t === void 0 && i[s].type !== "boolean" && i[s].type !== "many2one" ? {
|
|
163
|
+
modifiedValueInObject: null,
|
|
164
|
+
modifiedExpectedValue: null,
|
|
165
|
+
directOutcome: !1
|
|
166
|
+
} : (r.modifiedValueInObject = i[s].type === "boolean" ? !!t : t, i[s].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), i[s].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), i[s].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
|
|
167
|
+
}, fe = ({
|
|
142
168
|
attrs: s,
|
|
143
169
|
values: t,
|
|
144
|
-
fields: e
|
|
170
|
+
fields: e,
|
|
171
|
+
widgetType: i
|
|
145
172
|
}) => {
|
|
146
|
-
const
|
|
147
|
-
for (const
|
|
148
|
-
|
|
173
|
+
const h = s.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(h), u = JSON.parse(_), d = {};
|
|
174
|
+
for (const c of Object.keys(u)) {
|
|
175
|
+
const p = u[c].map((m) => _e({ entry: m, values: t, fields: e })).every((m) => m);
|
|
176
|
+
p ? d[c] = !0 : c === "readonly" && !p && i === "button" && (d[c] = !1);
|
|
177
|
+
}
|
|
149
178
|
return d;
|
|
150
|
-
},
|
|
151
|
-
|
|
179
|
+
}, ge = ({
|
|
180
|
+
attrs: s,
|
|
152
181
|
values: t,
|
|
153
182
|
fields: e
|
|
154
183
|
}) => {
|
|
155
|
-
|
|
184
|
+
try {
|
|
185
|
+
const i = b(s), r = JSON.parse(
|
|
186
|
+
i.replace(/'/g, '"')
|
|
187
|
+
), a = {};
|
|
188
|
+
for (const l of Object.keys(r))
|
|
189
|
+
a[l] = ue({
|
|
190
|
+
object: t,
|
|
191
|
+
condition: r[l],
|
|
192
|
+
evaluateFieldComparison: ({
|
|
193
|
+
fieldName: o,
|
|
194
|
+
valueInObject: h,
|
|
195
|
+
expectedValue: _
|
|
196
|
+
}) => q({
|
|
197
|
+
fieldName: o,
|
|
198
|
+
valueInObject: h,
|
|
199
|
+
expectedValue: _,
|
|
200
|
+
fields: e
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
return a;
|
|
204
|
+
} catch (i) {
|
|
205
|
+
throw console.error(i), i instanceof SyntaxError ? new Error(
|
|
206
|
+
"Error parsing new json_attrs. Original string: " + s
|
|
207
|
+
) : i;
|
|
208
|
+
}
|
|
209
|
+
}, me = ({
|
|
210
|
+
tagAttributes: s,
|
|
211
|
+
values: t,
|
|
212
|
+
fields: e,
|
|
213
|
+
widgetType: i,
|
|
214
|
+
fallbackMode: r = !0
|
|
215
|
+
}) => {
|
|
216
|
+
let a = {}, l = {};
|
|
217
|
+
if (s.attrs && (l = fe({
|
|
156
218
|
attrs: s.attrs,
|
|
157
219
|
values: t,
|
|
158
|
-
fields: e
|
|
159
|
-
|
|
160
|
-
|
|
220
|
+
fields: e,
|
|
221
|
+
widgetType: i
|
|
222
|
+
})), s.json_attrs)
|
|
223
|
+
try {
|
|
224
|
+
a = ge({
|
|
225
|
+
attrs: s.json_attrs,
|
|
226
|
+
values: t,
|
|
227
|
+
fields: e
|
|
228
|
+
});
|
|
229
|
+
} catch (o) {
|
|
230
|
+
if (r && s.attrs)
|
|
231
|
+
a = l;
|
|
232
|
+
else
|
|
233
|
+
throw o;
|
|
234
|
+
}
|
|
235
|
+
else
|
|
236
|
+
s.attrs && (a = l);
|
|
237
|
+
return {
|
|
238
|
+
...s,
|
|
239
|
+
...a,
|
|
240
|
+
attrs: void 0,
|
|
241
|
+
json_attrs: void 0
|
|
242
|
+
};
|
|
161
243
|
};
|
|
162
244
|
class g extends v {
|
|
163
245
|
constructor(e) {
|
|
@@ -189,6 +271,10 @@ class g extends v {
|
|
|
189
271
|
* Tooltip
|
|
190
272
|
*/
|
|
191
273
|
n(this, "_tooltip");
|
|
274
|
+
/**
|
|
275
|
+
* Tooltip inline
|
|
276
|
+
*/
|
|
277
|
+
n(this, "_tooltipInline", !1);
|
|
192
278
|
/**
|
|
193
279
|
* Activated (default is true)
|
|
194
280
|
*/
|
|
@@ -201,7 +287,7 @@ class g extends v {
|
|
|
201
287
|
* Values and keys
|
|
202
288
|
*/
|
|
203
289
|
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
204
|
-
this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label =
|
|
290
|
+
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 = e.sum), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = he(e.help_inline)));
|
|
205
291
|
}
|
|
206
292
|
get id() {
|
|
207
293
|
return this._id;
|
|
@@ -233,6 +319,12 @@ class g extends v {
|
|
|
233
319
|
set tooltip(e) {
|
|
234
320
|
this._tooltip = e;
|
|
235
321
|
}
|
|
322
|
+
get tooltipInline() {
|
|
323
|
+
return this._tooltipInline;
|
|
324
|
+
}
|
|
325
|
+
set tooltipInline(e) {
|
|
326
|
+
this._tooltipInline = e;
|
|
327
|
+
}
|
|
236
328
|
get activated() {
|
|
237
329
|
return this._activated;
|
|
238
330
|
}
|
|
@@ -259,14 +351,14 @@ class g extends v {
|
|
|
259
351
|
return this._id === e ? this : null;
|
|
260
352
|
}
|
|
261
353
|
}
|
|
262
|
-
class
|
|
354
|
+
class be extends g {
|
|
263
355
|
}
|
|
264
|
-
class
|
|
356
|
+
class J extends v {
|
|
265
357
|
findById(t) {
|
|
266
358
|
return null;
|
|
267
359
|
}
|
|
268
360
|
}
|
|
269
|
-
class
|
|
361
|
+
class H extends g {
|
|
270
362
|
constructor(e) {
|
|
271
363
|
super({ ...e, nolabel: !0 });
|
|
272
364
|
/**
|
|
@@ -322,7 +414,7 @@ class J extends g {
|
|
|
322
414
|
this._fieldForLabel = e;
|
|
323
415
|
}
|
|
324
416
|
}
|
|
325
|
-
class
|
|
417
|
+
class I {
|
|
326
418
|
constructor(t = 4, e = 6, i = !1, r = void 0) {
|
|
327
419
|
/**
|
|
328
420
|
* Number of columns the container is divided
|
|
@@ -389,13 +481,13 @@ class Y {
|
|
|
389
481
|
}
|
|
390
482
|
addWidget(t, e) {
|
|
391
483
|
const i = [], r = e ? e.addLabel : !0;
|
|
392
|
-
if (t instanceof
|
|
484
|
+
if (t instanceof J) {
|
|
393
485
|
this._rows.push([]), this._index++;
|
|
394
486
|
return;
|
|
395
487
|
}
|
|
396
488
|
if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof g && !t.nolabel) {
|
|
397
489
|
t.colspan > 1 && (t.colspan -= 1);
|
|
398
|
-
const l = new
|
|
490
|
+
const l = new H({
|
|
399
491
|
name: t.id + "_label",
|
|
400
492
|
string: t.label,
|
|
401
493
|
invisible: t.invisible,
|
|
@@ -407,7 +499,7 @@ class Y {
|
|
|
407
499
|
} else
|
|
408
500
|
i.push(t);
|
|
409
501
|
i.reduce(
|
|
410
|
-
(l,
|
|
502
|
+
(l, o) => l + o.colspan,
|
|
411
503
|
0
|
|
412
504
|
) > this.freePosition() && (this._rows.push([]), this._index++), this._rows[this._index] = this._rows[this._index].concat(i);
|
|
413
505
|
}
|
|
@@ -419,8 +511,8 @@ class Y {
|
|
|
419
511
|
var i;
|
|
420
512
|
let e = null;
|
|
421
513
|
return (i = this._rows) != null && i.length && this._rows.forEach((r) => {
|
|
422
|
-
e || r != null && r.length && r.forEach((
|
|
423
|
-
e ||
|
|
514
|
+
e || r != null && r.length && r.forEach((a) => {
|
|
515
|
+
e || a && (e = a.findById(t));
|
|
424
516
|
});
|
|
425
517
|
}), e;
|
|
426
518
|
}
|
|
@@ -446,12 +538,12 @@ const k = class k extends v {
|
|
|
446
538
|
* Container label
|
|
447
539
|
*/
|
|
448
540
|
n(this, "_label", "");
|
|
449
|
-
this._container = new
|
|
541
|
+
this._container = new I(
|
|
450
542
|
e == null ? void 0 : e.col,
|
|
451
543
|
k._defaultColspan,
|
|
452
544
|
this.readOnly,
|
|
453
545
|
e == null ? void 0 : e.key
|
|
454
|
-
), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label =
|
|
546
|
+
), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label = b(e.string)));
|
|
455
547
|
}
|
|
456
548
|
get id() {
|
|
457
549
|
return this._id;
|
|
@@ -499,18 +591,18 @@ const k = class k extends v {
|
|
|
499
591
|
};
|
|
500
592
|
n(k, "_defaultColspan", 6);
|
|
501
593
|
let C = k;
|
|
502
|
-
const
|
|
594
|
+
const O = class O extends C {
|
|
503
595
|
constructor(e) {
|
|
504
596
|
super(e);
|
|
505
597
|
n(this, "_tabPosition", "top");
|
|
506
598
|
n(this, "_pages", []);
|
|
507
|
-
this.colspan =
|
|
599
|
+
this.colspan = O._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
|
|
508
600
|
}
|
|
509
601
|
static get defaultColspan() {
|
|
510
|
-
return
|
|
602
|
+
return O._defaultColspan;
|
|
511
603
|
}
|
|
512
604
|
static set defaultColspan(e) {
|
|
513
|
-
|
|
605
|
+
O._defaultColspan = e;
|
|
514
606
|
}
|
|
515
607
|
get tabPosition() {
|
|
516
608
|
return this._tabPosition;
|
|
@@ -522,9 +614,9 @@ const T = class T extends C {
|
|
|
522
614
|
return [].concat.apply([], this._container.rows);
|
|
523
615
|
}
|
|
524
616
|
};
|
|
525
|
-
n(
|
|
526
|
-
let
|
|
527
|
-
class
|
|
617
|
+
n(O, "_defaultColspan", 3);
|
|
618
|
+
let M = O;
|
|
619
|
+
class ye extends C {
|
|
528
620
|
constructor(e) {
|
|
529
621
|
super(e);
|
|
530
622
|
n(this, "_icon", null);
|
|
@@ -537,7 +629,7 @@ class _e extends C {
|
|
|
537
629
|
this._icon = e;
|
|
538
630
|
}
|
|
539
631
|
}
|
|
540
|
-
class
|
|
632
|
+
class pe extends C {
|
|
541
633
|
constructor(e) {
|
|
542
634
|
super(e);
|
|
543
635
|
n(this, "_icon", null);
|
|
@@ -550,7 +642,7 @@ class fe extends C {
|
|
|
550
642
|
this._icon = e;
|
|
551
643
|
}
|
|
552
644
|
}
|
|
553
|
-
class
|
|
645
|
+
class Q extends g {
|
|
554
646
|
constructor(e) {
|
|
555
647
|
super({
|
|
556
648
|
...e,
|
|
@@ -575,7 +667,7 @@ class ge extends g {
|
|
|
575
667
|
n(this, "_primary", !1);
|
|
576
668
|
n(this, "_danger", !1);
|
|
577
669
|
if (e) {
|
|
578
|
-
if (e.string && (this._caption =
|
|
670
|
+
if (e.string && (this._caption = b(e.string)), e.buttonType && (this._buttonType = e.buttonType), e.confirm && (this._confirmMessage = b(e.confirm)), e.special && e.special === "cancel" && (this._buttonType = "cancel"), e.icon && (this._icon = e.icon), e.primary) {
|
|
579
671
|
const i = e.primary;
|
|
580
672
|
(i === "1" || i === 1 || i === !0) && (this._primary = !0);
|
|
581
673
|
}
|
|
@@ -622,7 +714,7 @@ class ge extends g {
|
|
|
622
714
|
this._danger = e;
|
|
623
715
|
}
|
|
624
716
|
}
|
|
625
|
-
class
|
|
717
|
+
class xe extends C {
|
|
626
718
|
constructor(e) {
|
|
627
719
|
super(e);
|
|
628
720
|
n(this, "_defaultName", "");
|
|
@@ -646,7 +738,7 @@ class me extends C {
|
|
|
646
738
|
return this._container.rows[0].filter((e) => !e.invisible);
|
|
647
739
|
}
|
|
648
740
|
}
|
|
649
|
-
class
|
|
741
|
+
class D extends g {
|
|
650
742
|
constructor(e) {
|
|
651
743
|
super(e);
|
|
652
744
|
/**
|
|
@@ -686,7 +778,7 @@ class I extends g {
|
|
|
686
778
|
this._translatable = e;
|
|
687
779
|
}
|
|
688
780
|
}
|
|
689
|
-
class
|
|
781
|
+
class B extends g {
|
|
690
782
|
constructor(e) {
|
|
691
783
|
super(e);
|
|
692
784
|
/**
|
|
@@ -703,7 +795,7 @@ class G extends g {
|
|
|
703
795
|
n(this, "_height");
|
|
704
796
|
n(this, "_translatable", !1);
|
|
705
797
|
if (e) {
|
|
706
|
-
if (e.placeholder && (this._placeholder =
|
|
798
|
+
if (e.placeholder && (this._placeholder = b(e.placeholder)), e.colspan || (this._mustExpand = !0), e.height)
|
|
707
799
|
try {
|
|
708
800
|
this._height = parseInt(e.height);
|
|
709
801
|
} catch {
|
|
@@ -737,7 +829,7 @@ class G extends g {
|
|
|
737
829
|
this._translatable = e;
|
|
738
830
|
}
|
|
739
831
|
}
|
|
740
|
-
class
|
|
832
|
+
class T extends g {
|
|
741
833
|
constructor(e) {
|
|
742
834
|
super(e);
|
|
743
835
|
/**
|
|
@@ -753,7 +845,7 @@ class E extends g {
|
|
|
753
845
|
this._size = e;
|
|
754
846
|
}
|
|
755
847
|
}
|
|
756
|
-
class
|
|
848
|
+
class we extends g {
|
|
757
849
|
constructor(e) {
|
|
758
850
|
super(e);
|
|
759
851
|
/**
|
|
@@ -779,19 +871,19 @@ class be extends g {
|
|
|
779
871
|
this._relation = e;
|
|
780
872
|
}
|
|
781
873
|
}
|
|
782
|
-
class
|
|
874
|
+
class ve extends B {
|
|
783
875
|
}
|
|
784
|
-
class
|
|
876
|
+
class X extends g {
|
|
785
877
|
constructor(t) {
|
|
786
878
|
super(t);
|
|
787
879
|
}
|
|
788
880
|
}
|
|
789
|
-
class
|
|
881
|
+
class Ce extends g {
|
|
790
882
|
constructor(t) {
|
|
791
883
|
super(t);
|
|
792
884
|
}
|
|
793
885
|
}
|
|
794
|
-
class
|
|
886
|
+
class G extends g {
|
|
795
887
|
constructor(e) {
|
|
796
888
|
super(e);
|
|
797
889
|
/**
|
|
@@ -824,21 +916,21 @@ class L extends g {
|
|
|
824
916
|
this._decimalDigits = e;
|
|
825
917
|
}
|
|
826
918
|
}
|
|
827
|
-
class
|
|
919
|
+
class Fe extends G {
|
|
828
920
|
}
|
|
829
|
-
class
|
|
921
|
+
class ke extends G {
|
|
830
922
|
}
|
|
831
|
-
class
|
|
923
|
+
class Oe extends g {
|
|
832
924
|
constructor(t) {
|
|
833
925
|
super(t);
|
|
834
926
|
}
|
|
835
927
|
}
|
|
836
|
-
class
|
|
928
|
+
class Ee extends g {
|
|
837
929
|
constructor(t) {
|
|
838
930
|
super(t);
|
|
839
931
|
}
|
|
840
932
|
}
|
|
841
|
-
class
|
|
933
|
+
class Te extends g {
|
|
842
934
|
constructor(e) {
|
|
843
935
|
super(e);
|
|
844
936
|
/**
|
|
@@ -874,7 +966,7 @@ class Fe extends g {
|
|
|
874
966
|
this._mustExpand = e;
|
|
875
967
|
}
|
|
876
968
|
}
|
|
877
|
-
class
|
|
969
|
+
class U extends g {
|
|
878
970
|
constructor(e) {
|
|
879
971
|
super(e);
|
|
880
972
|
/**
|
|
@@ -940,7 +1032,7 @@ class Q extends g {
|
|
|
940
1032
|
this._mustExpand = e;
|
|
941
1033
|
}
|
|
942
1034
|
}
|
|
943
|
-
class
|
|
1035
|
+
class Pe extends v {
|
|
944
1036
|
constructor(e) {
|
|
945
1037
|
super(e);
|
|
946
1038
|
/**
|
|
@@ -948,7 +1040,7 @@ class ke extends v {
|
|
|
948
1040
|
*/
|
|
949
1041
|
n(this, "_label", "");
|
|
950
1042
|
n(this, "_icon", null);
|
|
951
|
-
e && (e.string && (this._label =
|
|
1043
|
+
e && (e.string && (this._label = b(e.string)), e.icon && (this._icon = e.icon));
|
|
952
1044
|
}
|
|
953
1045
|
get label() {
|
|
954
1046
|
return this._label;
|
|
@@ -966,9 +1058,9 @@ class ke extends v {
|
|
|
966
1058
|
return null;
|
|
967
1059
|
}
|
|
968
1060
|
}
|
|
969
|
-
class
|
|
1061
|
+
class ze extends T {
|
|
970
1062
|
}
|
|
971
|
-
class
|
|
1063
|
+
class Se extends g {
|
|
972
1064
|
constructor(e) {
|
|
973
1065
|
super(e);
|
|
974
1066
|
/**
|
|
@@ -984,14 +1076,14 @@ class Pe extends g {
|
|
|
984
1076
|
this._filenameField = e;
|
|
985
1077
|
}
|
|
986
1078
|
}
|
|
987
|
-
class
|
|
1079
|
+
class We extends g {
|
|
988
1080
|
}
|
|
989
|
-
class
|
|
1081
|
+
class Ie extends g {
|
|
990
1082
|
constructor(t) {
|
|
991
1083
|
super(t);
|
|
992
1084
|
}
|
|
993
1085
|
}
|
|
994
|
-
class
|
|
1086
|
+
class Ve extends U {
|
|
995
1087
|
constructor(e) {
|
|
996
1088
|
super(e);
|
|
997
1089
|
/**
|
|
@@ -1023,7 +1115,7 @@ class ze extends Q {
|
|
|
1023
1115
|
return this.parsedWidgetProps.colorField;
|
|
1024
1116
|
}
|
|
1025
1117
|
}
|
|
1026
|
-
class
|
|
1118
|
+
class Ye extends T {
|
|
1027
1119
|
constructor(e) {
|
|
1028
1120
|
super(e);
|
|
1029
1121
|
n(this, "_nolabel", !0);
|
|
@@ -1051,7 +1143,7 @@ class We extends E {
|
|
|
1051
1143
|
this._suffix = e;
|
|
1052
1144
|
}
|
|
1053
1145
|
}
|
|
1054
|
-
class
|
|
1146
|
+
class K extends g {
|
|
1055
1147
|
constructor(e) {
|
|
1056
1148
|
super(e);
|
|
1057
1149
|
/**
|
|
@@ -1104,14 +1196,14 @@ class X extends g {
|
|
|
1104
1196
|
this._columns = e;
|
|
1105
1197
|
}
|
|
1106
1198
|
}
|
|
1107
|
-
class
|
|
1199
|
+
class De extends K {
|
|
1108
1200
|
}
|
|
1109
|
-
class
|
|
1201
|
+
class je extends T {
|
|
1110
1202
|
get colors() {
|
|
1111
1203
|
return this._parsedWidgetProps.colors || {};
|
|
1112
1204
|
}
|
|
1113
1205
|
}
|
|
1114
|
-
class
|
|
1206
|
+
class Me extends T {
|
|
1115
1207
|
constructor(e) {
|
|
1116
1208
|
super(e);
|
|
1117
1209
|
/**
|
|
@@ -1127,9 +1219,9 @@ class De extends E {
|
|
|
1127
1219
|
this._direction = e;
|
|
1128
1220
|
}
|
|
1129
1221
|
}
|
|
1130
|
-
class Ne extends
|
|
1222
|
+
class Ne extends X {
|
|
1131
1223
|
}
|
|
1132
|
-
class
|
|
1224
|
+
class Ae extends g {
|
|
1133
1225
|
constructor(e) {
|
|
1134
1226
|
super(e);
|
|
1135
1227
|
/**
|
|
@@ -1152,7 +1244,7 @@ class Ie extends g {
|
|
|
1152
1244
|
this._errorField = e;
|
|
1153
1245
|
}
|
|
1154
1246
|
}
|
|
1155
|
-
class
|
|
1247
|
+
class Be extends B {
|
|
1156
1248
|
constructor(e) {
|
|
1157
1249
|
super(e);
|
|
1158
1250
|
n(this, "_lang", null);
|
|
@@ -1165,12 +1257,12 @@ class Me extends G {
|
|
|
1165
1257
|
this._lang = e;
|
|
1166
1258
|
}
|
|
1167
1259
|
}
|
|
1168
|
-
class
|
|
1260
|
+
class Ge extends g {
|
|
1169
1261
|
constructor(t) {
|
|
1170
1262
|
super(t);
|
|
1171
1263
|
}
|
|
1172
1264
|
}
|
|
1173
|
-
class
|
|
1265
|
+
class L {
|
|
1174
1266
|
constructor() {
|
|
1175
1267
|
/**
|
|
1176
1268
|
* Widget class
|
|
@@ -1180,122 +1272,122 @@ class j {
|
|
|
1180
1272
|
setWidgetClass(t) {
|
|
1181
1273
|
switch (t) {
|
|
1182
1274
|
case "notebook":
|
|
1183
|
-
this._widgetClass =
|
|
1275
|
+
this._widgetClass = M;
|
|
1184
1276
|
break;
|
|
1185
1277
|
case "page":
|
|
1186
|
-
this._widgetClass =
|
|
1278
|
+
this._widgetClass = ye;
|
|
1187
1279
|
break;
|
|
1188
1280
|
case "group":
|
|
1189
|
-
this._widgetClass =
|
|
1281
|
+
this._widgetClass = pe;
|
|
1190
1282
|
break;
|
|
1191
1283
|
case "label":
|
|
1192
|
-
this._widgetClass =
|
|
1284
|
+
this._widgetClass = H;
|
|
1193
1285
|
break;
|
|
1194
1286
|
case "char":
|
|
1195
|
-
this._widgetClass =
|
|
1287
|
+
this._widgetClass = D;
|
|
1196
1288
|
break;
|
|
1197
1289
|
case "text":
|
|
1198
|
-
this._widgetClass =
|
|
1290
|
+
this._widgetClass = B;
|
|
1199
1291
|
break;
|
|
1200
1292
|
case "button":
|
|
1201
|
-
this._widgetClass =
|
|
1293
|
+
this._widgetClass = Q;
|
|
1202
1294
|
break;
|
|
1203
1295
|
case "buttonGroup":
|
|
1204
|
-
this._widgetClass =
|
|
1296
|
+
this._widgetClass = xe;
|
|
1205
1297
|
break;
|
|
1206
1298
|
case "selection":
|
|
1207
|
-
this._widgetClass =
|
|
1299
|
+
this._widgetClass = T;
|
|
1208
1300
|
break;
|
|
1209
1301
|
case "many2one":
|
|
1210
|
-
this._widgetClass =
|
|
1302
|
+
this._widgetClass = we;
|
|
1211
1303
|
break;
|
|
1212
1304
|
case "boolean":
|
|
1213
|
-
this._widgetClass =
|
|
1305
|
+
this._widgetClass = X;
|
|
1214
1306
|
break;
|
|
1215
1307
|
case "integer":
|
|
1216
|
-
this._widgetClass =
|
|
1308
|
+
this._widgetClass = Ce;
|
|
1217
1309
|
break;
|
|
1218
1310
|
case "float":
|
|
1219
|
-
this._widgetClass =
|
|
1311
|
+
this._widgetClass = G;
|
|
1220
1312
|
break;
|
|
1221
1313
|
case "float_time":
|
|
1222
|
-
this._widgetClass =
|
|
1314
|
+
this._widgetClass = Fe;
|
|
1223
1315
|
break;
|
|
1224
1316
|
case "date":
|
|
1225
|
-
this._widgetClass =
|
|
1317
|
+
this._widgetClass = Oe;
|
|
1226
1318
|
break;
|
|
1227
1319
|
case "datetime":
|
|
1228
|
-
this._widgetClass =
|
|
1320
|
+
this._widgetClass = Ee;
|
|
1229
1321
|
break;
|
|
1230
1322
|
case "progressbar":
|
|
1231
|
-
this._widgetClass =
|
|
1323
|
+
this._widgetClass = ke;
|
|
1232
1324
|
break;
|
|
1233
1325
|
case "many2many":
|
|
1234
|
-
this._widgetClass =
|
|
1326
|
+
this._widgetClass = Te;
|
|
1235
1327
|
break;
|
|
1236
1328
|
case "markdown":
|
|
1237
|
-
this._widgetClass =
|
|
1329
|
+
this._widgetClass = ve;
|
|
1238
1330
|
break;
|
|
1239
1331
|
case "one2many":
|
|
1240
1332
|
case "one2many_list":
|
|
1241
|
-
this._widgetClass =
|
|
1333
|
+
this._widgetClass = U;
|
|
1242
1334
|
break;
|
|
1243
1335
|
case "newline":
|
|
1244
|
-
this._widgetClass =
|
|
1336
|
+
this._widgetClass = J;
|
|
1245
1337
|
break;
|
|
1246
1338
|
case "separator":
|
|
1247
|
-
this._widgetClass =
|
|
1339
|
+
this._widgetClass = Pe;
|
|
1248
1340
|
break;
|
|
1249
1341
|
case "url":
|
|
1250
|
-
this._widgetClass =
|
|
1342
|
+
this._widgetClass = D;
|
|
1251
1343
|
break;
|
|
1252
1344
|
case "email":
|
|
1253
|
-
this._widgetClass =
|
|
1345
|
+
this._widgetClass = D;
|
|
1254
1346
|
break;
|
|
1255
1347
|
case "reference":
|
|
1256
|
-
this._widgetClass =
|
|
1348
|
+
this._widgetClass = ze;
|
|
1257
1349
|
break;
|
|
1258
1350
|
case "binary":
|
|
1259
|
-
this._widgetClass =
|
|
1351
|
+
this._widgetClass = Se;
|
|
1260
1352
|
break;
|
|
1261
1353
|
case "image":
|
|
1262
|
-
this._widgetClass =
|
|
1354
|
+
this._widgetClass = We;
|
|
1263
1355
|
break;
|
|
1264
1356
|
case "fiber_grid":
|
|
1265
|
-
this._widgetClass =
|
|
1357
|
+
this._widgetClass = Ie;
|
|
1266
1358
|
break;
|
|
1267
1359
|
case "timeline":
|
|
1268
|
-
this._widgetClass =
|
|
1360
|
+
this._widgetClass = Ve;
|
|
1269
1361
|
break;
|
|
1270
1362
|
case "indicator":
|
|
1271
|
-
this._widgetClass =
|
|
1363
|
+
this._widgetClass = Ye;
|
|
1272
1364
|
break;
|
|
1273
1365
|
case "tags":
|
|
1274
|
-
this._widgetClass =
|
|
1366
|
+
this._widgetClass = De;
|
|
1275
1367
|
break;
|
|
1276
1368
|
case "tag":
|
|
1277
|
-
this._widgetClass =
|
|
1369
|
+
this._widgetClass = je;
|
|
1278
1370
|
break;
|
|
1279
1371
|
case "avatar":
|
|
1280
|
-
this._widgetClass =
|
|
1372
|
+
this._widgetClass = be;
|
|
1281
1373
|
break;
|
|
1282
1374
|
case "radio":
|
|
1283
|
-
this._widgetClass =
|
|
1375
|
+
this._widgetClass = Me;
|
|
1284
1376
|
break;
|
|
1285
1377
|
case "multicheckbox":
|
|
1286
|
-
this._widgetClass =
|
|
1378
|
+
this._widgetClass = K;
|
|
1287
1379
|
break;
|
|
1288
1380
|
case "switch":
|
|
1289
1381
|
this._widgetClass = Ne;
|
|
1290
1382
|
break;
|
|
1291
1383
|
case "steps":
|
|
1292
|
-
this._widgetClass =
|
|
1384
|
+
this._widgetClass = Ae;
|
|
1293
1385
|
break;
|
|
1294
1386
|
case "codeeditor":
|
|
1295
|
-
this._widgetClass =
|
|
1387
|
+
this._widgetClass = Be;
|
|
1296
1388
|
break;
|
|
1297
1389
|
case "time":
|
|
1298
|
-
this._widgetClass =
|
|
1390
|
+
this._widgetClass = Ge;
|
|
1299
1391
|
break;
|
|
1300
1392
|
}
|
|
1301
1393
|
}
|
|
@@ -1317,7 +1409,7 @@ class j {
|
|
|
1317
1409
|
}
|
|
1318
1410
|
}
|
|
1319
1411
|
}
|
|
1320
|
-
const
|
|
1412
|
+
const Le = ({
|
|
1321
1413
|
fieldName: s,
|
|
1322
1414
|
values: t,
|
|
1323
1415
|
fields: e
|
|
@@ -1328,21 +1420,21 @@ const Ae = ({
|
|
|
1328
1420
|
const i = (l = e[s]) == null ? void 0 : l.states;
|
|
1329
1421
|
if (!i)
|
|
1330
1422
|
return {};
|
|
1331
|
-
const r = {},
|
|
1332
|
-
for (const
|
|
1333
|
-
if (t.state ===
|
|
1334
|
-
const h = i[
|
|
1423
|
+
const r = {}, a = {};
|
|
1424
|
+
for (const o of Object.keys(i))
|
|
1425
|
+
if (t.state === o) {
|
|
1426
|
+
const h = i[o];
|
|
1335
1427
|
for (const _ of h) {
|
|
1336
|
-
const [
|
|
1337
|
-
|
|
1428
|
+
const [u, d] = _;
|
|
1429
|
+
a[u] || (a[u] = []), a[u].push(d);
|
|
1338
1430
|
}
|
|
1339
1431
|
}
|
|
1340
|
-
for (const
|
|
1341
|
-
const h = o
|
|
1342
|
-
r[
|
|
1432
|
+
for (const o of Object.keys(a)) {
|
|
1433
|
+
const h = a[o];
|
|
1434
|
+
r[o] = h.some((_) => _);
|
|
1343
1435
|
}
|
|
1344
1436
|
return r;
|
|
1345
|
-
},
|
|
1437
|
+
}, $e = ({
|
|
1346
1438
|
states: s,
|
|
1347
1439
|
values: t
|
|
1348
1440
|
}) => {
|
|
@@ -1351,16 +1443,16 @@ const Ae = ({
|
|
|
1351
1443
|
const e = s.split(",");
|
|
1352
1444
|
return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
|
|
1353
1445
|
};
|
|
1354
|
-
function
|
|
1446
|
+
function Re({
|
|
1355
1447
|
values: s = {},
|
|
1356
1448
|
fieldName: t,
|
|
1357
1449
|
fields: e = {}
|
|
1358
1450
|
}) {
|
|
1359
1451
|
var r;
|
|
1360
1452
|
const i = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
|
|
1361
|
-
return i === "many2one" ? s[t] ? s[t][0] || null : !1 : i === "one2many" || i === "many2many" ? s[t].map((
|
|
1453
|
+
return i === "many2one" ? s[t] ? s[t][0] || null : !1 : i === "one2many" || i === "many2many" ? s[t].map((a) => a.id) : s != null && s[t] ? s == null ? void 0 : s[t] : t.includes("'") ? t : parseInt(t);
|
|
1362
1454
|
}
|
|
1363
|
-
const
|
|
1455
|
+
const qe = ({
|
|
1364
1456
|
context: s,
|
|
1365
1457
|
values: t,
|
|
1366
1458
|
fields: e
|
|
@@ -1368,23 +1460,23 @@ const Le = ({
|
|
|
1368
1460
|
try {
|
|
1369
1461
|
if (!s)
|
|
1370
1462
|
return;
|
|
1371
|
-
if (
|
|
1463
|
+
if (ee(s) || typeof s != "string")
|
|
1372
1464
|
return s;
|
|
1373
|
-
const i =
|
|
1465
|
+
const i = Z(s);
|
|
1374
1466
|
if (i !== null)
|
|
1375
1467
|
return i;
|
|
1376
1468
|
if (s.trim().length === 0)
|
|
1377
1469
|
return;
|
|
1378
|
-
const
|
|
1379
|
-
return
|
|
1380
|
-
const
|
|
1470
|
+
const d = s.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((f) => f.split(":")), c = {};
|
|
1471
|
+
return d.forEach((f) => {
|
|
1472
|
+
const y = f[1];
|
|
1381
1473
|
if (!f[1].includes("'") && f[1] !== "true" && f[1] !== "false") {
|
|
1382
|
-
const
|
|
1474
|
+
const p = Re({
|
|
1383
1475
|
values: t,
|
|
1384
1476
|
fields: e,
|
|
1385
|
-
fieldName:
|
|
1477
|
+
fieldName: y === "active_id" ? "id" : y
|
|
1386
1478
|
});
|
|
1387
|
-
c[f[0].replace(/'/g, "")] =
|
|
1479
|
+
c[f[0].replace(/'/g, "")] = p || void 0;
|
|
1388
1480
|
} else
|
|
1389
1481
|
f[1] === "true" ? c[f[0].replace(/'/g, "")] = !0 : f[1] === "false" ? c[f[0].replace(/'/g, "")] = !1 : c[f[0].replace(/'/g, "")] = f[1].replace(
|
|
1390
1482
|
/'/g,
|
|
@@ -1394,34 +1486,34 @@ const Le = ({
|
|
|
1394
1486
|
} catch {
|
|
1395
1487
|
return;
|
|
1396
1488
|
}
|
|
1397
|
-
},
|
|
1489
|
+
}, bt = (s) => {
|
|
1398
1490
|
const t = [];
|
|
1399
1491
|
try {
|
|
1400
|
-
return !s ||
|
|
1401
|
-
!
|
|
1492
|
+
return !s || ee(s) || typeof s != "string" ? t : Z(s) !== null ? [] : (s.trim().length === 0 || s.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
|
|
1493
|
+
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1402
1494
|
}), t);
|
|
1403
1495
|
} catch {
|
|
1404
1496
|
}
|
|
1405
1497
|
return t;
|
|
1406
1498
|
};
|
|
1407
|
-
function
|
|
1499
|
+
function Z(s) {
|
|
1408
1500
|
try {
|
|
1409
1501
|
return JSON.parse(s.replace(/'/g, '"'));
|
|
1410
1502
|
} catch {
|
|
1411
1503
|
return null;
|
|
1412
1504
|
}
|
|
1413
1505
|
}
|
|
1414
|
-
function
|
|
1506
|
+
function ee(s) {
|
|
1415
1507
|
return typeof s == "object" && s !== null && typeof s != "string";
|
|
1416
1508
|
}
|
|
1417
|
-
const
|
|
1418
|
-
const t = s.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((
|
|
1509
|
+
const Je = (s) => {
|
|
1510
|
+
const t = s.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
|
|
1419
1511
|
return {
|
|
1420
1512
|
method: e,
|
|
1421
1513
|
args: r
|
|
1422
1514
|
};
|
|
1423
1515
|
};
|
|
1424
|
-
class
|
|
1516
|
+
class yt {
|
|
1425
1517
|
constructor(t, e = 4) {
|
|
1426
1518
|
/**
|
|
1427
1519
|
* Object containing fields specification of the form.
|
|
@@ -1468,7 +1560,7 @@ class _t {
|
|
|
1468
1560
|
* List of invisible fields
|
|
1469
1561
|
*/
|
|
1470
1562
|
n(this, "_invisibleFields", []);
|
|
1471
|
-
this._fields = t, this._container = new
|
|
1563
|
+
this._fields = t, this._container = new I(e, 6, !1, "root");
|
|
1472
1564
|
}
|
|
1473
1565
|
get fields() {
|
|
1474
1566
|
return this._fields;
|
|
@@ -1514,9 +1606,9 @@ class _t {
|
|
|
1514
1606
|
}
|
|
1515
1607
|
parse(t, e) {
|
|
1516
1608
|
var l;
|
|
1517
|
-
const { values: i = {}, readOnly: r = !1 } = e || {},
|
|
1518
|
-
this._string = ((l =
|
|
1519
|
-
fields:
|
|
1609
|
+
const { values: i = {}, readOnly: r = !1 } = e || {}, a = Y.parse(t).filter((o) => o.tagName === "form")[0];
|
|
1610
|
+
this._string = ((l = a.attributes) == null ? void 0 : l.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
1611
|
+
fields: a.children,
|
|
1520
1612
|
container: this._container,
|
|
1521
1613
|
values: i
|
|
1522
1614
|
});
|
|
@@ -1526,13 +1618,13 @@ class _t {
|
|
|
1526
1618
|
container: e,
|
|
1527
1619
|
values: i
|
|
1528
1620
|
}) {
|
|
1529
|
-
const r = new
|
|
1530
|
-
t.filter((
|
|
1531
|
-
var w,
|
|
1532
|
-
const { tagName: l, attributes:
|
|
1533
|
-
let _ = l,
|
|
1621
|
+
const r = new L();
|
|
1622
|
+
t.filter((a) => typeof a == "object").forEach((a) => {
|
|
1623
|
+
var w, P;
|
|
1624
|
+
const { tagName: l, attributes: o, children: h } = a;
|
|
1625
|
+
let _ = l, u = o;
|
|
1534
1626
|
if (l === "field") {
|
|
1535
|
-
const { name: x, widget: z } =
|
|
1627
|
+
const { name: x, widget: z } = o;
|
|
1536
1628
|
if (z)
|
|
1537
1629
|
_ = z;
|
|
1538
1630
|
else if (x) {
|
|
@@ -1542,48 +1634,49 @@ class _t {
|
|
|
1542
1634
|
);
|
|
1543
1635
|
_ = this._fields[x].type;
|
|
1544
1636
|
}
|
|
1545
|
-
|
|
1637
|
+
u = {
|
|
1546
1638
|
...this._fields[x],
|
|
1547
|
-
...
|
|
1639
|
+
...o,
|
|
1548
1640
|
fieldsWidgetType: this._fields[x].type
|
|
1549
1641
|
};
|
|
1550
1642
|
}
|
|
1551
|
-
const
|
|
1552
|
-
tagAttributes:
|
|
1643
|
+
const d = me({
|
|
1644
|
+
tagAttributes: u,
|
|
1553
1645
|
values: i,
|
|
1554
|
-
fields: this._fields
|
|
1646
|
+
fields: this._fields,
|
|
1647
|
+
widgetType: l
|
|
1555
1648
|
});
|
|
1556
1649
|
let c;
|
|
1557
|
-
l === "button" &&
|
|
1558
|
-
states:
|
|
1650
|
+
l === "button" && u.states ? c = $e({
|
|
1651
|
+
states: u.states,
|
|
1559
1652
|
values: i
|
|
1560
|
-
}) : c =
|
|
1561
|
-
fieldName:
|
|
1653
|
+
}) : c = Le({
|
|
1654
|
+
fieldName: u.name,
|
|
1562
1655
|
values: i,
|
|
1563
1656
|
fields: this._fields
|
|
1564
1657
|
});
|
|
1565
|
-
const f =
|
|
1566
|
-
context:
|
|
1658
|
+
const f = qe({
|
|
1659
|
+
context: u.context || ((w = this._fields[u.name]) == null ? void 0 : w.context),
|
|
1567
1660
|
values: i,
|
|
1568
1661
|
fields: this._fields
|
|
1569
1662
|
});
|
|
1570
|
-
|
|
1571
|
-
|
|
1663
|
+
u.on_change && (this._onChangeFields[u.name] = Je(
|
|
1664
|
+
u.on_change
|
|
1572
1665
|
));
|
|
1573
|
-
let
|
|
1574
|
-
|
|
1575
|
-
const
|
|
1576
|
-
...
|
|
1666
|
+
let y;
|
|
1667
|
+
R(u.domain) && (y = u.domain), R((P = this._fields[u.name]) == null ? void 0 : P.domain) && (y = this._fields[u.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1668
|
+
const p = {
|
|
1669
|
+
...d,
|
|
1577
1670
|
...c,
|
|
1578
1671
|
context: f,
|
|
1579
|
-
domain:
|
|
1672
|
+
domain: y,
|
|
1580
1673
|
key: `${this._keyIdx}`
|
|
1581
|
-
},
|
|
1582
|
-
|
|
1674
|
+
}, m = r.createWidget(_, p);
|
|
1675
|
+
m.invisible && m instanceof g && this._invisibleFields.push(p.name), m instanceof C && this.parseNode({
|
|
1583
1676
|
fields: h,
|
|
1584
|
-
container:
|
|
1677
|
+
container: m.container,
|
|
1585
1678
|
values: i
|
|
1586
|
-
}),
|
|
1679
|
+
}), m instanceof Q && m.readOnly !== void 0 || (m.readOnly = m.readOnly || this.readOnly), e.addWidget(m);
|
|
1587
1680
|
});
|
|
1588
1681
|
}
|
|
1589
1682
|
/**
|
|
@@ -1594,10 +1687,10 @@ class _t {
|
|
|
1594
1687
|
return this.container.findById(t);
|
|
1595
1688
|
}
|
|
1596
1689
|
}
|
|
1597
|
-
function
|
|
1690
|
+
function R(s) {
|
|
1598
1691
|
return s ? Array.isArray(s) && s.length > 0 ? !0 : typeof s == "string" && s !== "" && s !== "[]" : !1;
|
|
1599
1692
|
}
|
|
1600
|
-
class
|
|
1693
|
+
class pt {
|
|
1601
1694
|
constructor(t) {
|
|
1602
1695
|
/**
|
|
1603
1696
|
* Object containing fields specification of the form.
|
|
@@ -1642,28 +1735,28 @@ class ft {
|
|
|
1642
1735
|
return this._editable;
|
|
1643
1736
|
}
|
|
1644
1737
|
parse(t) {
|
|
1645
|
-
const e =
|
|
1646
|
-
this._string = e.attributes.string || null, this._string && (this._string =
|
|
1647
|
-
const i = new
|
|
1738
|
+
const e = Y.parse(t).filter((r) => r.tagName === "tree")[0];
|
|
1739
|
+
this._string = e.attributes.string || null, this._string && (this._string = b(this._string)), this._colors = e.attributes.colors || null, this._colors && (this._colors = b(this._colors)), this._status = e.attributes.status || null, this._status && (this._status = b(this._status)), this._editable = e.attributes.editable || null;
|
|
1740
|
+
const i = new L();
|
|
1648
1741
|
e.children.forEach((r) => {
|
|
1649
|
-
const { tagName:
|
|
1650
|
-
let
|
|
1651
|
-
if (
|
|
1742
|
+
const { tagName: a, attributes: l } = r;
|
|
1743
|
+
let o = null;
|
|
1744
|
+
if (a === "field") {
|
|
1652
1745
|
const { name: h, widget: _ } = l;
|
|
1653
|
-
let
|
|
1746
|
+
let u = l;
|
|
1654
1747
|
if (h) {
|
|
1655
1748
|
if (!this._fields[h])
|
|
1656
1749
|
throw new Error(`Field ${h} doesn't exist in fields defintion`);
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1659
|
-
...
|
|
1750
|
+
const d = this._fields[h];
|
|
1751
|
+
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, u = {
|
|
1752
|
+
...d,
|
|
1660
1753
|
...l,
|
|
1661
|
-
fieldsWidgetType:
|
|
1754
|
+
fieldsWidgetType: d == null ? void 0 : d.type
|
|
1662
1755
|
};
|
|
1663
1756
|
}
|
|
1664
|
-
if (_ && (
|
|
1665
|
-
const
|
|
1666
|
-
this._columns.push(
|
|
1757
|
+
if (_ && (o = _), !u.invisible) {
|
|
1758
|
+
const d = i.createWidget(o, u);
|
|
1759
|
+
this._columns.push(d);
|
|
1667
1760
|
}
|
|
1668
1761
|
}
|
|
1669
1762
|
});
|
|
@@ -1676,7 +1769,7 @@ class ft {
|
|
|
1676
1769
|
return this._columns.find((e) => e.findById ? e.findById(t) : !1);
|
|
1677
1770
|
}
|
|
1678
1771
|
}
|
|
1679
|
-
const
|
|
1772
|
+
const He = {
|
|
1680
1773
|
text: "text",
|
|
1681
1774
|
many2one: "many2one",
|
|
1682
1775
|
char: "char",
|
|
@@ -1689,7 +1782,7 @@ const $e = {
|
|
|
1689
1782
|
date: "date",
|
|
1690
1783
|
datetime: "datetime"
|
|
1691
1784
|
};
|
|
1692
|
-
class
|
|
1785
|
+
class xt {
|
|
1693
1786
|
constructor(t, e, i = 8) {
|
|
1694
1787
|
/**
|
|
1695
1788
|
* Object containing the specific fields for primary and secondary search fields
|
|
@@ -1701,7 +1794,7 @@ class gt {
|
|
|
1701
1794
|
n(this, "_fields");
|
|
1702
1795
|
n(this, "_simpleSearchContainer");
|
|
1703
1796
|
n(this, "_advancedSearchContainer");
|
|
1704
|
-
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new
|
|
1797
|
+
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new I(i), this._advancedSearchContainer = new I(i);
|
|
1705
1798
|
}
|
|
1706
1799
|
get searchFields() {
|
|
1707
1800
|
return this._searchFields;
|
|
@@ -1716,7 +1809,7 @@ class gt {
|
|
|
1716
1809
|
return this._advancedSearchContainer;
|
|
1717
1810
|
}
|
|
1718
1811
|
parse() {
|
|
1719
|
-
const t = new
|
|
1812
|
+
const t = new L();
|
|
1720
1813
|
this.parseFields(
|
|
1721
1814
|
this.searchFields.primary,
|
|
1722
1815
|
t
|
|
@@ -1735,9 +1828,9 @@ class gt {
|
|
|
1735
1828
|
...this.fields[i],
|
|
1736
1829
|
name: i,
|
|
1737
1830
|
colspan: 2
|
|
1738
|
-
}, { type:
|
|
1739
|
-
let
|
|
1740
|
-
return
|
|
1831
|
+
}, { type: a, widget: l } = r;
|
|
1832
|
+
let o = l ?? a;
|
|
1833
|
+
return He[o] === void 0 && (o = a), e.createWidget(o, r);
|
|
1741
1834
|
});
|
|
1742
1835
|
}
|
|
1743
1836
|
/**
|
|
@@ -1748,7 +1841,7 @@ class gt {
|
|
|
1748
1841
|
return this.advancedSearchContainer.findById(t);
|
|
1749
1842
|
}
|
|
1750
1843
|
}
|
|
1751
|
-
const
|
|
1844
|
+
const wt = ({
|
|
1752
1845
|
domain: s,
|
|
1753
1846
|
widgetFieldName: t
|
|
1754
1847
|
}) => {
|
|
@@ -1756,15 +1849,15 @@ const mt = ({
|
|
|
1756
1849
|
return s.forEach((i) => {
|
|
1757
1850
|
if (!Array.isArray(i))
|
|
1758
1851
|
return;
|
|
1759
|
-
const [r,
|
|
1760
|
-
let
|
|
1761
|
-
r.indexOf(".") !== -1 ? (
|
|
1852
|
+
const [r, a, l] = i;
|
|
1853
|
+
let o, h;
|
|
1854
|
+
r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), h = r.substr(
|
|
1762
1855
|
r.indexOf(".") + 1,
|
|
1763
1856
|
r.length - 1
|
|
1764
|
-
)) : (
|
|
1857
|
+
)) : (o = r, h = "id"), o === t && e.push([h, a, l]);
|
|
1765
1858
|
}), e;
|
|
1766
|
-
},
|
|
1767
|
-
class
|
|
1859
|
+
}, vt = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
|
|
1860
|
+
class Qe {
|
|
1768
1861
|
constructor(t) {
|
|
1769
1862
|
n(this, "_action_id", null);
|
|
1770
1863
|
n(this, "_position", null);
|
|
@@ -1777,15 +1870,15 @@ class qe {
|
|
|
1777
1870
|
return this._position;
|
|
1778
1871
|
}
|
|
1779
1872
|
}
|
|
1780
|
-
class
|
|
1873
|
+
class Ct {
|
|
1781
1874
|
constructor(t) {
|
|
1782
1875
|
n(this, "_string", null);
|
|
1783
1876
|
n(this, "_items", []);
|
|
1784
|
-
const e =
|
|
1877
|
+
const e = Y.parse(t).filter((r) => r.tagName === "dashboard")[0];
|
|
1785
1878
|
this._string = e.attributes.string || null;
|
|
1786
1879
|
const { children: i } = e;
|
|
1787
1880
|
i.forEach((r) => {
|
|
1788
|
-
r.tagName === "dashboard_item" && this._items.push(new
|
|
1881
|
+
r.tagName === "dashboard_item" && this._items.push(new Qe(r.attributes));
|
|
1789
1882
|
});
|
|
1790
1883
|
}
|
|
1791
1884
|
get string() {
|
|
@@ -1795,7 +1888,7 @@ class yt {
|
|
|
1795
1888
|
return this._items;
|
|
1796
1889
|
}
|
|
1797
1890
|
}
|
|
1798
|
-
class
|
|
1891
|
+
class te {
|
|
1799
1892
|
constructor(t) {
|
|
1800
1893
|
n(this, "_string", null);
|
|
1801
1894
|
n(this, "_type");
|
|
@@ -1812,8 +1905,8 @@ class Z {
|
|
|
1812
1905
|
return this._timerange;
|
|
1813
1906
|
}
|
|
1814
1907
|
}
|
|
1815
|
-
const
|
|
1816
|
-
class
|
|
1908
|
+
const Xe = (s) => s === 1 || s === "1" || s === !0 || s === "True";
|
|
1909
|
+
class se extends te {
|
|
1817
1910
|
constructor(e, i) {
|
|
1818
1911
|
super(i);
|
|
1819
1912
|
n(this, "_color", null);
|
|
@@ -1821,7 +1914,7 @@ class ee extends Z {
|
|
|
1821
1914
|
n(this, "_totalDomain", null);
|
|
1822
1915
|
n(this, "_showPercent", !1);
|
|
1823
1916
|
n(this, "_suffix", null);
|
|
1824
|
-
this._type = e, this._color = i.attributes.color || null, this._color && (this._color =
|
|
1917
|
+
this._type = e, this._color = i.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = i.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = i.attributes.suffix || null, this._totalDomain = b(i.attributes.totalDomain) || null, this._showPercent = Xe(i.attributes.showPercent);
|
|
1825
1918
|
}
|
|
1826
1919
|
get color() {
|
|
1827
1920
|
return this._color;
|
|
@@ -1839,16 +1932,16 @@ class ee extends Z {
|
|
|
1839
1932
|
return this._suffix;
|
|
1840
1933
|
}
|
|
1841
1934
|
}
|
|
1842
|
-
class
|
|
1935
|
+
class Ue extends se {
|
|
1843
1936
|
constructor(e, i) {
|
|
1844
1937
|
super(e, i);
|
|
1845
1938
|
n(this, "_field");
|
|
1846
1939
|
n(this, "_operator");
|
|
1847
1940
|
const { children: r } = i;
|
|
1848
|
-
r.forEach((
|
|
1849
|
-
if (
|
|
1850
|
-
const l =
|
|
1851
|
-
this._field = l || void 0, this._operator =
|
|
1941
|
+
r.forEach((a) => {
|
|
1942
|
+
if (a.tagName === "field") {
|
|
1943
|
+
const l = a.attributes.name, o = a.attributes.operator;
|
|
1944
|
+
this._field = l || void 0, this._operator = o;
|
|
1852
1945
|
}
|
|
1853
1946
|
});
|
|
1854
1947
|
}
|
|
@@ -1859,23 +1952,23 @@ class Je extends ee {
|
|
|
1859
1952
|
return this._operator;
|
|
1860
1953
|
}
|
|
1861
1954
|
}
|
|
1862
|
-
const
|
|
1955
|
+
const Ke = (s) => {
|
|
1863
1956
|
const t = [];
|
|
1864
1957
|
let e;
|
|
1865
1958
|
if (s.forEach((i) => {
|
|
1866
1959
|
if (i.tagName === "field") {
|
|
1867
|
-
const r = i.attributes.axis,
|
|
1960
|
+
const r = i.attributes.axis, a = i.attributes.operator, l = i.attributes.name, o = i.attributes.label || void 0, h = i.attributes.stacked || void 0;
|
|
1868
1961
|
if (!r)
|
|
1869
1962
|
throw new Error(`Field ${l} doesn't have an axis`);
|
|
1870
1963
|
if (!l)
|
|
1871
1964
|
throw new Error("Missing name attribute for field");
|
|
1872
|
-
r === "x" ? e = new
|
|
1965
|
+
r === "x" ? e = new tt({
|
|
1873
1966
|
name: l
|
|
1874
1967
|
}) : r === "y" && t.push(
|
|
1875
|
-
new
|
|
1968
|
+
new et({
|
|
1876
1969
|
name: l,
|
|
1877
|
-
operator:
|
|
1878
|
-
label:
|
|
1970
|
+
operator: a,
|
|
1971
|
+
label: o,
|
|
1879
1972
|
stacked: h
|
|
1880
1973
|
})
|
|
1881
1974
|
);
|
|
@@ -1889,13 +1982,13 @@ const He = (s) => {
|
|
|
1889
1982
|
y: t
|
|
1890
1983
|
};
|
|
1891
1984
|
};
|
|
1892
|
-
class
|
|
1985
|
+
class j extends te {
|
|
1893
1986
|
constructor(e, i) {
|
|
1894
1987
|
super(i);
|
|
1895
1988
|
n(this, "_x");
|
|
1896
1989
|
n(this, "_y");
|
|
1897
1990
|
this._type = e;
|
|
1898
|
-
const r =
|
|
1991
|
+
const r = Ke(i.children);
|
|
1899
1992
|
this._x = r.x, this._y = r.y;
|
|
1900
1993
|
}
|
|
1901
1994
|
get x() {
|
|
@@ -1905,22 +1998,22 @@ class M extends Z {
|
|
|
1905
1998
|
return this._y;
|
|
1906
1999
|
}
|
|
1907
2000
|
}
|
|
1908
|
-
const
|
|
1909
|
-
indicator:
|
|
1910
|
-
indicatorField:
|
|
1911
|
-
line:
|
|
1912
|
-
bar:
|
|
1913
|
-
pie:
|
|
1914
|
-
},
|
|
1915
|
-
const t =
|
|
2001
|
+
const Ze = {
|
|
2002
|
+
indicator: se,
|
|
2003
|
+
indicatorField: Ue,
|
|
2004
|
+
line: j,
|
|
2005
|
+
bar: j,
|
|
2006
|
+
pie: j
|
|
2007
|
+
}, Ft = (s) => {
|
|
2008
|
+
const t = Y.parse(s).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
1916
2009
|
if (!e)
|
|
1917
2010
|
throw new Error(`${e} is not a valid graph`);
|
|
1918
|
-
const i =
|
|
2011
|
+
const i = Ze[e];
|
|
1919
2012
|
if (!i)
|
|
1920
2013
|
throw new Error(`${e} not found as a GraphModel`);
|
|
1921
2014
|
return new i(e, t);
|
|
1922
2015
|
};
|
|
1923
|
-
class
|
|
2016
|
+
class ie {
|
|
1924
2017
|
constructor({ name: t, axis: e }) {
|
|
1925
2018
|
n(this, "_name");
|
|
1926
2019
|
n(this, "_axis");
|
|
@@ -1933,18 +2026,18 @@ class te {
|
|
|
1933
2026
|
return this._axis;
|
|
1934
2027
|
}
|
|
1935
2028
|
}
|
|
1936
|
-
class
|
|
2029
|
+
class et extends ie {
|
|
1937
2030
|
constructor({
|
|
1938
2031
|
name: e,
|
|
1939
2032
|
operator: i,
|
|
1940
2033
|
label: r,
|
|
1941
|
-
stacked:
|
|
2034
|
+
stacked: a
|
|
1942
2035
|
}) {
|
|
1943
2036
|
super({ name: e, axis: "y" });
|
|
1944
2037
|
n(this, "_operator");
|
|
1945
2038
|
n(this, "_label");
|
|
1946
2039
|
n(this, "_stacked");
|
|
1947
|
-
this._operator = i, this._label = r, this._stacked =
|
|
2040
|
+
this._operator = i, this._label = r, this._stacked = a;
|
|
1948
2041
|
}
|
|
1949
2042
|
get operator() {
|
|
1950
2043
|
return this._operator;
|
|
@@ -1956,12 +2049,12 @@ class Xe extends te {
|
|
|
1956
2049
|
return this._stacked;
|
|
1957
2050
|
}
|
|
1958
2051
|
}
|
|
1959
|
-
class
|
|
2052
|
+
class tt extends ie {
|
|
1960
2053
|
constructor({ name: t }) {
|
|
1961
2054
|
super({ name: t, axis: "x" });
|
|
1962
2055
|
}
|
|
1963
2056
|
}
|
|
1964
|
-
const
|
|
2057
|
+
const st = ({ ooui: s }) => {
|
|
1965
2058
|
const e = [s.x.name];
|
|
1966
2059
|
return s.y ? (s.y.forEach((i) => {
|
|
1967
2060
|
i.operator !== "count" && !e.includes(i.name) && e.push(i.name), i.label && !e.includes(i.label) && e.push(i.label);
|
|
@@ -1978,48 +2071,48 @@ function $({
|
|
|
1978
2071
|
if (i.type === "many2one")
|
|
1979
2072
|
return r ? { value: r[0], label: r[1] } : { value: !1, label: void 0 };
|
|
1980
2073
|
if (i.type === "selection") {
|
|
1981
|
-
const l = i.selection.find((
|
|
2074
|
+
const l = i.selection.find((o) => o[0] === r);
|
|
1982
2075
|
return l ? { value: r, label: l[1] } : { value: !1, label: void 0 };
|
|
1983
2076
|
}
|
|
1984
2077
|
return { value: r, label: r };
|
|
1985
2078
|
}
|
|
1986
|
-
const
|
|
2079
|
+
const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1987
2080
|
__proto__: null,
|
|
1988
|
-
getFieldsToRetrieve:
|
|
2081
|
+
getFieldsToRetrieve: st,
|
|
1989
2082
|
getValueAndLabelForField: $
|
|
1990
2083
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1991
|
-
function
|
|
2084
|
+
function it({
|
|
1992
2085
|
values: s,
|
|
1993
2086
|
timerange: t
|
|
1994
2087
|
}) {
|
|
1995
|
-
const e =
|
|
2088
|
+
const e = at({
|
|
1996
2089
|
values: s,
|
|
1997
2090
|
timerange: t
|
|
1998
2091
|
});
|
|
1999
|
-
return
|
|
2092
|
+
return nt({
|
|
2000
2093
|
values: e,
|
|
2001
2094
|
timerange: t
|
|
2002
2095
|
});
|
|
2003
2096
|
}
|
|
2004
|
-
function
|
|
2097
|
+
function nt({
|
|
2005
2098
|
values: s,
|
|
2006
2099
|
timerange: t
|
|
2007
2100
|
}) {
|
|
2008
2101
|
let e = [];
|
|
2009
|
-
const i =
|
|
2102
|
+
const i = re({
|
|
2010
2103
|
values: s,
|
|
2011
2104
|
groupBy: "type-stacked"
|
|
2012
2105
|
}), r = `${t}s`;
|
|
2013
2106
|
return Object.keys(i).forEach((l) => {
|
|
2014
|
-
const
|
|
2015
|
-
for (let h = 0; h <
|
|
2016
|
-
const _ =
|
|
2017
|
-
if (e.push(_), h ===
|
|
2107
|
+
const o = i[l];
|
|
2108
|
+
for (let h = 0; h < o.length; h++) {
|
|
2109
|
+
const _ = o[h];
|
|
2110
|
+
if (e.push(_), h === o.length - 1)
|
|
2018
2111
|
return;
|
|
2019
|
-
const
|
|
2020
|
-
if (!
|
|
2021
|
-
const c =
|
|
2022
|
-
dates: [
|
|
2112
|
+
const u = _.x, d = o[h + 1].x;
|
|
2113
|
+
if (!ne([u, d], r)) {
|
|
2114
|
+
const c = rt({
|
|
2115
|
+
dates: [u, d],
|
|
2023
2116
|
timerange: t
|
|
2024
2117
|
});
|
|
2025
2118
|
e = e.concat(
|
|
@@ -2032,41 +2125,41 @@ function et({
|
|
|
2032
2125
|
);
|
|
2033
2126
|
}
|
|
2034
2127
|
}
|
|
2035
|
-
}), e.sort((l,
|
|
2128
|
+
}), e.sort((l, o) => l.x < o.x ? -1 : l.x > o.x ? 1 : 0);
|
|
2036
2129
|
}
|
|
2037
|
-
function
|
|
2130
|
+
function rt({
|
|
2038
2131
|
dates: s,
|
|
2039
2132
|
timerange: t
|
|
2040
2133
|
}) {
|
|
2041
2134
|
const e = [], i = `${t}s`;
|
|
2042
2135
|
if (s.length === 1)
|
|
2043
2136
|
return s;
|
|
2044
|
-
const r = s.sort((
|
|
2045
|
-
for (let
|
|
2046
|
-
const l = r[
|
|
2047
|
-
if (!
|
|
2048
|
-
const h =
|
|
2137
|
+
const r = s.sort((a, l) => a < l ? -1 : a > l ? 1 : 0);
|
|
2138
|
+
for (let a = 0; a < r.length - 1; a++) {
|
|
2139
|
+
const l = r[a], o = r[a + 1];
|
|
2140
|
+
if (!ne([l, o], i)) {
|
|
2141
|
+
const h = E(l, W(i)).add(1, i), _ = E(o, W(i));
|
|
2049
2142
|
for (; h.isBefore(_); )
|
|
2050
|
-
e.push(h.format(
|
|
2143
|
+
e.push(h.format(W(i))), h.add(1, i);
|
|
2051
2144
|
}
|
|
2052
2145
|
}
|
|
2053
2146
|
return e;
|
|
2054
2147
|
}
|
|
2055
|
-
function
|
|
2148
|
+
function at({
|
|
2056
2149
|
values: s,
|
|
2057
2150
|
timerange: t
|
|
2058
2151
|
}) {
|
|
2059
|
-
const e =
|
|
2152
|
+
const e = lt({
|
|
2060
2153
|
values: s,
|
|
2061
2154
|
timerange: t
|
|
2062
|
-
}), i = [], r =
|
|
2155
|
+
}), i = [], r = re({
|
|
2063
2156
|
values: e,
|
|
2064
2157
|
groupBy: "all"
|
|
2065
2158
|
});
|
|
2066
|
-
return Object.keys(r).forEach((
|
|
2067
|
-
const l = r[
|
|
2159
|
+
return Object.keys(r).forEach((a) => {
|
|
2160
|
+
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, h = V({
|
|
2068
2161
|
values: l.map((_) => _.value),
|
|
2069
|
-
operator:
|
|
2162
|
+
operator: o
|
|
2070
2163
|
});
|
|
2071
2164
|
i.push({
|
|
2072
2165
|
...l[0],
|
|
@@ -2074,24 +2167,24 @@ function st({
|
|
|
2074
2167
|
});
|
|
2075
2168
|
}), i;
|
|
2076
2169
|
}
|
|
2077
|
-
function
|
|
2170
|
+
function lt({
|
|
2078
2171
|
values: s,
|
|
2079
2172
|
timerange: t
|
|
2080
2173
|
}) {
|
|
2081
2174
|
return s.map((e) => ({
|
|
2082
2175
|
...e,
|
|
2083
|
-
x:
|
|
2176
|
+
x: ot({
|
|
2084
2177
|
date: e.x,
|
|
2085
2178
|
timerange: t
|
|
2086
2179
|
})
|
|
2087
2180
|
}));
|
|
2088
2181
|
}
|
|
2089
|
-
function
|
|
2182
|
+
function ot({
|
|
2090
2183
|
date: s,
|
|
2091
2184
|
timerange: t
|
|
2092
2185
|
}) {
|
|
2093
|
-
let e =
|
|
2094
|
-
const i =
|
|
2186
|
+
let e = ct(s);
|
|
2187
|
+
const i = E(s, e);
|
|
2095
2188
|
switch (t) {
|
|
2096
2189
|
case "hour": {
|
|
2097
2190
|
e = "YYYY-MM-DD HH:00";
|
|
@@ -2116,33 +2209,33 @@ function nt({
|
|
|
2116
2209
|
}
|
|
2117
2210
|
return i.format(e);
|
|
2118
2211
|
}
|
|
2119
|
-
function
|
|
2212
|
+
function ct(s) {
|
|
2120
2213
|
return s.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2121
2214
|
}
|
|
2122
|
-
function
|
|
2215
|
+
function ne(s, t) {
|
|
2123
2216
|
let e = !1;
|
|
2124
|
-
const i =
|
|
2217
|
+
const i = W(t);
|
|
2125
2218
|
if (s.length === 0)
|
|
2126
2219
|
return !1;
|
|
2127
2220
|
if (s.length === 1)
|
|
2128
2221
|
return !0;
|
|
2129
2222
|
for (let r = 0; r < s.length - 1; r++) {
|
|
2130
|
-
const
|
|
2131
|
-
Math.abs(
|
|
2223
|
+
const a = E(s[r], i), o = E(s[r + 1], i).diff(a, t);
|
|
2224
|
+
Math.abs(o) === 1 ? e = !0 : e = !1;
|
|
2132
2225
|
}
|
|
2133
2226
|
return e;
|
|
2134
2227
|
}
|
|
2135
|
-
function
|
|
2228
|
+
function re({
|
|
2136
2229
|
values: s,
|
|
2137
2230
|
groupBy: t
|
|
2138
2231
|
}) {
|
|
2139
2232
|
const e = {};
|
|
2140
2233
|
return s.forEach((i) => {
|
|
2141
|
-
const r = i.x,
|
|
2142
|
-
e[
|
|
2234
|
+
const r = i.x, a = i.type, l = i.stacked, o = t === "all" ? `${r}-${a}-${l}` : `${a}-${l}`;
|
|
2235
|
+
e[o] || (e[o] = []), e[o].push(i);
|
|
2143
2236
|
}), e;
|
|
2144
2237
|
}
|
|
2145
|
-
function
|
|
2238
|
+
function W(s) {
|
|
2146
2239
|
switch (s) {
|
|
2147
2240
|
case "days":
|
|
2148
2241
|
return "YYYY-MM-DD";
|
|
@@ -2157,7 +2250,7 @@ function S(s) {
|
|
|
2157
2250
|
return "YYYY-MM-DD HH:mm";
|
|
2158
2251
|
}
|
|
2159
2252
|
}
|
|
2160
|
-
const
|
|
2253
|
+
const dt = {
|
|
2161
2254
|
count: "count",
|
|
2162
2255
|
"+": "sum",
|
|
2163
2256
|
"-": "subtract",
|
|
@@ -2165,56 +2258,56 @@ const at = {
|
|
|
2165
2258
|
avg: "average",
|
|
2166
2259
|
min: "min",
|
|
2167
2260
|
max: "max"
|
|
2168
|
-
},
|
|
2261
|
+
}, ut = ({
|
|
2169
2262
|
ooui: s,
|
|
2170
2263
|
values: t,
|
|
2171
2264
|
fields: e,
|
|
2172
2265
|
options: i
|
|
2173
2266
|
}) => {
|
|
2174
|
-
const r =
|
|
2267
|
+
const r = A({
|
|
2175
2268
|
fieldName: s.x.name,
|
|
2176
2269
|
values: t,
|
|
2177
2270
|
fields: e
|
|
2178
|
-
}),
|
|
2271
|
+
}), a = [];
|
|
2179
2272
|
s.y.forEach((c) => {
|
|
2180
2273
|
Object.keys(r).forEach((f) => {
|
|
2181
|
-
const
|
|
2274
|
+
const y = r[f].label, p = r[f].entries;
|
|
2182
2275
|
if (c.label) {
|
|
2183
|
-
const
|
|
2276
|
+
const m = A({
|
|
2184
2277
|
fieldName: c.label,
|
|
2185
|
-
values:
|
|
2278
|
+
values: p,
|
|
2186
2279
|
fields: e
|
|
2187
2280
|
});
|
|
2188
|
-
Object.keys(
|
|
2189
|
-
const
|
|
2190
|
-
entries:
|
|
2281
|
+
Object.keys(m).forEach((w) => {
|
|
2282
|
+
const P = m[w].entries, x = m[w].label, z = N({
|
|
2283
|
+
entries: P,
|
|
2191
2284
|
fields: e,
|
|
2192
2285
|
fieldName: c.name
|
|
2193
|
-
}),
|
|
2286
|
+
}), le = V({
|
|
2194
2287
|
values: z,
|
|
2195
2288
|
operator: c.operator
|
|
2196
2289
|
});
|
|
2197
|
-
|
|
2198
|
-
x:
|
|
2199
|
-
value:
|
|
2290
|
+
a.push({
|
|
2291
|
+
x: y || !1,
|
|
2292
|
+
value: le,
|
|
2200
2293
|
type: x,
|
|
2201
2294
|
operator: c.operator,
|
|
2202
2295
|
stacked: c.stacked
|
|
2203
2296
|
});
|
|
2204
2297
|
});
|
|
2205
2298
|
} else {
|
|
2206
|
-
const
|
|
2207
|
-
entries:
|
|
2299
|
+
const m = N({
|
|
2300
|
+
entries: p,
|
|
2208
2301
|
fields: e,
|
|
2209
2302
|
fieldName: c.name
|
|
2210
|
-
}), w =
|
|
2211
|
-
values:
|
|
2303
|
+
}), w = V({
|
|
2304
|
+
values: m,
|
|
2212
2305
|
operator: c.operator
|
|
2213
2306
|
});
|
|
2214
|
-
|
|
2215
|
-
x:
|
|
2307
|
+
a.push({
|
|
2308
|
+
x: y || !1,
|
|
2216
2309
|
value: w,
|
|
2217
|
-
type:
|
|
2310
|
+
type: ae({
|
|
2218
2311
|
yAxis: c,
|
|
2219
2312
|
fields: e
|
|
2220
2313
|
}),
|
|
@@ -2224,24 +2317,24 @@ const at = {
|
|
|
2224
2317
|
}
|
|
2225
2318
|
});
|
|
2226
2319
|
});
|
|
2227
|
-
const l = s.y.some((c) => c.label !== void 0),
|
|
2228
|
-
let _ = [...
|
|
2229
|
-
|
|
2230
|
-
let
|
|
2231
|
-
s.type === "pie" &&
|
|
2320
|
+
const l = s.y.some((c) => c.label !== void 0), o = s.y.some((c) => c.stacked !== void 0);
|
|
2321
|
+
let _ = [...a.sort((c, f) => c.x < f.x ? -1 : c.x > f.x ? 1 : 0)];
|
|
2322
|
+
o && s.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
|
|
2323
|
+
let u = [..._];
|
|
2324
|
+
s.type === "pie" && u.some((c) => c.x === !1) ? u = u.map((c) => c.x === !1 ? { ...c, x: (i == null ? void 0 : i.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (u = u.filter(
|
|
2232
2325
|
(c) => c.x !== !1
|
|
2233
2326
|
));
|
|
2234
|
-
let
|
|
2235
|
-
return s.timerange ?
|
|
2236
|
-
values:
|
|
2327
|
+
let d = u;
|
|
2328
|
+
return s.timerange ? d = it({
|
|
2329
|
+
values: d,
|
|
2237
2330
|
timerange: s.timerange
|
|
2238
|
-
}) : s.type == "pie" && (
|
|
2239
|
-
data:
|
|
2240
|
-
isGroup:
|
|
2241
|
-
isStack:
|
|
2331
|
+
}) : s.type == "pie" && (d = u.sort((c, f) => f.value - c.value)), {
|
|
2332
|
+
data: d,
|
|
2333
|
+
isGroup: o || l,
|
|
2334
|
+
isStack: o
|
|
2242
2335
|
};
|
|
2243
2336
|
};
|
|
2244
|
-
function
|
|
2337
|
+
function N({
|
|
2245
2338
|
entries: s,
|
|
2246
2339
|
fieldName: t,
|
|
2247
2340
|
fields: e
|
|
@@ -2252,7 +2345,7 @@ function A({
|
|
|
2252
2345
|
fields: e
|
|
2253
2346
|
})).map(({ value: i, label: r }) => r);
|
|
2254
2347
|
}
|
|
2255
|
-
function
|
|
2348
|
+
function V({
|
|
2256
2349
|
operator: s,
|
|
2257
2350
|
values: t
|
|
2258
2351
|
}) {
|
|
@@ -2260,26 +2353,26 @@ function D({
|
|
|
2260
2353
|
case "count":
|
|
2261
2354
|
return t.length;
|
|
2262
2355
|
case "+":
|
|
2263
|
-
return
|
|
2356
|
+
return S(
|
|
2264
2357
|
t.reduce(function(e, i) {
|
|
2265
2358
|
return e + i;
|
|
2266
2359
|
})
|
|
2267
2360
|
);
|
|
2268
2361
|
case "-":
|
|
2269
|
-
return
|
|
2362
|
+
return S(
|
|
2270
2363
|
t.reduce(function(e, i) {
|
|
2271
2364
|
return e - i;
|
|
2272
2365
|
})
|
|
2273
2366
|
);
|
|
2274
2367
|
case "*":
|
|
2275
|
-
return
|
|
2368
|
+
return S(
|
|
2276
2369
|
t.reduce(function(e, i) {
|
|
2277
2370
|
return e * i;
|
|
2278
2371
|
})
|
|
2279
2372
|
);
|
|
2280
2373
|
case "avg": {
|
|
2281
|
-
const i = t.reduce((r,
|
|
2282
|
-
return
|
|
2374
|
+
const i = t.reduce((r, a) => r + a, 0) / t.length || 0;
|
|
2375
|
+
return S(i);
|
|
2283
2376
|
}
|
|
2284
2377
|
case "min":
|
|
2285
2378
|
return Math.min(...t);
|
|
@@ -2287,108 +2380,108 @@ function D({
|
|
|
2287
2380
|
return Math.max(...t);
|
|
2288
2381
|
}
|
|
2289
2382
|
}
|
|
2290
|
-
function
|
|
2383
|
+
function S(s) {
|
|
2291
2384
|
return Math.round((s + Number.EPSILON) * 100) / 100;
|
|
2292
2385
|
}
|
|
2293
|
-
function
|
|
2386
|
+
function A({
|
|
2294
2387
|
fieldName: s,
|
|
2295
2388
|
fields: t,
|
|
2296
2389
|
values: e
|
|
2297
2390
|
}) {
|
|
2298
2391
|
const i = {};
|
|
2299
2392
|
return e.forEach((r) => {
|
|
2300
|
-
const { value:
|
|
2393
|
+
const { value: a, label: l } = $({
|
|
2301
2394
|
fields: t,
|
|
2302
2395
|
values: r,
|
|
2303
2396
|
fieldName: s
|
|
2304
2397
|
});
|
|
2305
|
-
i[
|
|
2398
|
+
i[a] || (i[a] = { label: l, entries: [] }), i[a].entries.push(r);
|
|
2306
2399
|
}), i;
|
|
2307
2400
|
}
|
|
2308
|
-
function
|
|
2401
|
+
function ht(s) {
|
|
2309
2402
|
let t = [];
|
|
2310
2403
|
return Object.keys(s).forEach((e) => {
|
|
2311
2404
|
const i = s[e];
|
|
2312
2405
|
t = t.concat(i.entries);
|
|
2313
2406
|
}), t;
|
|
2314
2407
|
}
|
|
2315
|
-
function
|
|
2408
|
+
function ae({
|
|
2316
2409
|
yAxis: s,
|
|
2317
2410
|
fields: t
|
|
2318
2411
|
}) {
|
|
2319
2412
|
const e = t[s.name];
|
|
2320
2413
|
return e != null && e.string ? e.string : s.name;
|
|
2321
2414
|
}
|
|
2322
|
-
const
|
|
2415
|
+
const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2323
2416
|
__proto__: null,
|
|
2324
|
-
getAllObjectsInGroupedValues:
|
|
2325
|
-
getValueForOperator:
|
|
2326
|
-
getValuesForYField:
|
|
2327
|
-
getValuesGroupedByField:
|
|
2328
|
-
getYAxisFieldname:
|
|
2329
|
-
labelsForOperator:
|
|
2330
|
-
processGraphData:
|
|
2417
|
+
getAllObjectsInGroupedValues: ht,
|
|
2418
|
+
getValueForOperator: V,
|
|
2419
|
+
getValuesForYField: N,
|
|
2420
|
+
getValuesGroupedByField: A,
|
|
2421
|
+
getYAxisFieldname: ae,
|
|
2422
|
+
labelsForOperator: dt,
|
|
2423
|
+
processGraphData: ut
|
|
2331
2424
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2332
2425
|
export {
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2426
|
+
be as Avatar,
|
|
2427
|
+
Se as Binary,
|
|
2428
|
+
X as Boolean,
|
|
2429
|
+
Q as Button,
|
|
2430
|
+
xe as ButtonGroup,
|
|
2431
|
+
D as Char,
|
|
2432
|
+
Be as CodeEditor,
|
|
2433
|
+
I as Container,
|
|
2341
2434
|
C as ContainerWidget,
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2435
|
+
Ct as Dashboard,
|
|
2436
|
+
Qe as DashboardItem,
|
|
2437
|
+
Oe as Date,
|
|
2438
|
+
Ee as DateTime,
|
|
2346
2439
|
g as Field,
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2440
|
+
G as Float,
|
|
2441
|
+
Fe as FloatTime,
|
|
2442
|
+
yt as Form,
|
|
2443
|
+
te as Graph,
|
|
2444
|
+
ie as GraphAxis,
|
|
2445
|
+
j as GraphChart,
|
|
2446
|
+
se as GraphIndicator,
|
|
2447
|
+
Ue as GraphIndicatorField,
|
|
2448
|
+
tt as GraphXAxis,
|
|
2449
|
+
et as GraphYAxis,
|
|
2450
|
+
pe as Group,
|
|
2451
|
+
We as Image,
|
|
2452
|
+
Ye as Indicator,
|
|
2453
|
+
Ce as Integer,
|
|
2454
|
+
H as Label,
|
|
2455
|
+
Te as Many2many,
|
|
2456
|
+
we as Many2one,
|
|
2457
|
+
ve as Markdown,
|
|
2458
|
+
K as MultiCheckbox,
|
|
2459
|
+
J as NewLine,
|
|
2460
|
+
M as Notebook,
|
|
2461
|
+
U as One2many,
|
|
2462
|
+
ye as Page,
|
|
2463
|
+
ke as ProgressBar,
|
|
2464
|
+
Me as Radio,
|
|
2465
|
+
ze as Reference,
|
|
2466
|
+
He as SearchFieldTypes,
|
|
2467
|
+
xt as SearchFilter,
|
|
2468
|
+
T as Selection,
|
|
2469
|
+
Pe as Separator,
|
|
2470
|
+
Ae as Steps,
|
|
2378
2471
|
Ne as Switch,
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2472
|
+
je as Tag,
|
|
2473
|
+
De as Tags,
|
|
2474
|
+
B as Text,
|
|
2475
|
+
Ge as Time,
|
|
2476
|
+
Ve as Timeline,
|
|
2477
|
+
pt as Tree,
|
|
2385
2478
|
v as Widget,
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2479
|
+
kt as graphFieldUtils,
|
|
2480
|
+
Ot as graphProcessor,
|
|
2481
|
+
qe as parseContext,
|
|
2482
|
+
bt as parseContextFields,
|
|
2483
|
+
vt as parseDomainFields,
|
|
2484
|
+
Ft as parseGraph,
|
|
2485
|
+
wt as transformDomainForChildWidget
|
|
2393
2486
|
};
|
|
2394
2487
|
//# sourceMappingURL=ooui.es.js.map
|