@gisce/ooui 2.40.0-alpha.7 → 2.40.0-alpha.8
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/Kanban.d.ts +13 -0
- package/dist/Kanban.d.ts.map +1 -1
- package/dist/helpers/onChangeParser.d.ts.map +1 -1
- package/dist/ooui.es.js +452 -443
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Kanban.ts +16 -0
- package/src/helpers/onChangeParser.ts +8 -1
- package/src/spec/Kanban.spec.ts +39 -0
package/dist/ooui.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { decode as
|
|
5
|
-
import { evaluateCondition as
|
|
1
|
+
var pt = Object.defineProperty;
|
|
2
|
+
var wt = (s, e, t) => e in s ? pt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var n = (s, e, t) => (wt(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { decode as Ft } from "html-entities";
|
|
5
|
+
import { evaluateCondition as vt } from "@gisce/conscheck";
|
|
6
6
|
import * as I from "txml";
|
|
7
7
|
import T from "moment";
|
|
8
|
-
const
|
|
8
|
+
const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt = ({
|
|
9
9
|
entry: s,
|
|
10
10
|
values: e,
|
|
11
11
|
fields: t
|
|
12
12
|
}) => {
|
|
13
|
-
let [i,
|
|
13
|
+
let [i, r, l] = s, o = e[i];
|
|
14
14
|
const a = U({
|
|
15
15
|
fieldName: i,
|
|
16
16
|
valueInObject: o,
|
|
@@ -19,7 +19,7 @@ const vt = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), Ct
|
|
|
19
19
|
});
|
|
20
20
|
if (a.directOutcome !== void 0)
|
|
21
21
|
return a.directOutcome;
|
|
22
|
-
switch (a.modifiedValueInObject !== null && (o = a.modifiedValueInObject), a.modifiedExpectedValue !== null && (l = a.modifiedExpectedValue),
|
|
22
|
+
switch (a.modifiedValueInObject !== null && (o = a.modifiedValueInObject), a.modifiedExpectedValue !== null && (l = a.modifiedExpectedValue), r.toLowerCase()) {
|
|
23
23
|
case "=":
|
|
24
24
|
case "==":
|
|
25
25
|
return o == l;
|
|
@@ -41,13 +41,13 @@ const vt = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), Ct
|
|
|
41
41
|
default:
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
44
|
-
}, g = (s) =>
|
|
44
|
+
}, g = (s) => Ft(s, { level: "xml" }), U = ({
|
|
45
45
|
fieldName: s,
|
|
46
46
|
valueInObject: e,
|
|
47
47
|
expectedValue: t,
|
|
48
48
|
fields: i = {}
|
|
49
49
|
}) => {
|
|
50
|
-
const
|
|
50
|
+
const r = {
|
|
51
51
|
modifiedValueInObject: e,
|
|
52
52
|
modifiedExpectedValue: null,
|
|
53
53
|
directOutcome: void 0
|
|
@@ -60,7 +60,7 @@ const vt = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), Ct
|
|
|
60
60
|
modifiedValueInObject: null,
|
|
61
61
|
modifiedExpectedValue: null,
|
|
62
62
|
directOutcome: !1
|
|
63
|
-
} : (
|
|
63
|
+
} : (r.modifiedValueInObject = i[s].type === "boolean" ? !!e : e, i[s].type === "many2one" && t === !1 && e === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject === void 0 ? r.modifiedValueInObject = !1 : Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] !== void 0 && (r.modifiedValueInObject = r.modifiedValueInObject[0]), r.modifiedValueInObject === null && (r.modifiedValueInObject = !1)), i[s].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), i[s].type === "boolean" && (t === 0 || t === 1) && (r.modifiedExpectedValue = t !== 0), r);
|
|
64
64
|
}, Q = ({
|
|
65
65
|
attrs: s,
|
|
66
66
|
values: e,
|
|
@@ -69,7 +69,7 @@ const vt = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), Ct
|
|
|
69
69
|
}) => {
|
|
70
70
|
const c = s.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = g(c), u = JSON.parse(_), h = {};
|
|
71
71
|
for (const m of Object.keys(u)) {
|
|
72
|
-
const x = u[m].map((y) =>
|
|
72
|
+
const x = u[m].map((y) => kt({ entry: y, values: e, fields: t })).every((y) => y);
|
|
73
73
|
x ? h[m] = !0 : m === "readonly" && !x && i === "button" && (h[m] = !1);
|
|
74
74
|
}
|
|
75
75
|
return h;
|
|
@@ -84,18 +84,18 @@ const vt = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), Ct
|
|
|
84
84
|
}
|
|
85
85
|
else
|
|
86
86
|
return s;
|
|
87
|
-
},
|
|
87
|
+
}, Pt = ({
|
|
88
88
|
attrs: s,
|
|
89
89
|
values: e,
|
|
90
90
|
fields: t,
|
|
91
91
|
widgetType: i
|
|
92
92
|
}) => {
|
|
93
93
|
try {
|
|
94
|
-
const
|
|
95
|
-
|
|
94
|
+
const r = g(s), l = JSON.parse(
|
|
95
|
+
r.replace(/'/g, '"')
|
|
96
96
|
), o = {};
|
|
97
97
|
for (const a of Object.keys(l)) {
|
|
98
|
-
const c =
|
|
98
|
+
const c = vt({
|
|
99
99
|
object: e,
|
|
100
100
|
condition: l[a],
|
|
101
101
|
evaluateFieldComparison: ({
|
|
@@ -112,29 +112,29 @@ const vt = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), Ct
|
|
|
112
112
|
c ? o[a] = !0 : a === "readonly" && !c && i === "button" && (o[a] = !1);
|
|
113
113
|
}
|
|
114
114
|
return o;
|
|
115
|
-
} catch (
|
|
116
|
-
throw console.error(
|
|
115
|
+
} catch (r) {
|
|
116
|
+
throw console.error(r), r instanceof SyntaxError ? new Error(
|
|
117
117
|
"Error parsing new json_attrs. Original string: " + s
|
|
118
|
-
) :
|
|
118
|
+
) : r;
|
|
119
119
|
}
|
|
120
120
|
}, tt = ({
|
|
121
121
|
tagAttributes: s,
|
|
122
122
|
values: e,
|
|
123
123
|
fields: t,
|
|
124
124
|
widgetType: i,
|
|
125
|
-
fallbackMode:
|
|
125
|
+
fallbackMode: r = !0
|
|
126
126
|
}) => {
|
|
127
127
|
let l = {};
|
|
128
128
|
if (s.json_attrs)
|
|
129
129
|
try {
|
|
130
|
-
l =
|
|
130
|
+
l = Pt({
|
|
131
131
|
attrs: s.json_attrs,
|
|
132
132
|
values: e,
|
|
133
133
|
fields: t,
|
|
134
134
|
widgetType: i
|
|
135
135
|
});
|
|
136
136
|
} catch (o) {
|
|
137
|
-
if (
|
|
137
|
+
if (r && s.attrs)
|
|
138
138
|
l = Q({
|
|
139
139
|
attrs: s.attrs,
|
|
140
140
|
values: e,
|
|
@@ -162,38 +162,38 @@ const vt = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), Ct
|
|
|
162
162
|
/**
|
|
163
163
|
* Determines if widget is read only (default is undefined)
|
|
164
164
|
*/
|
|
165
|
-
|
|
165
|
+
n(this, "_readOnly");
|
|
166
166
|
/**
|
|
167
167
|
* Column span (default is 1)
|
|
168
168
|
*/
|
|
169
|
-
|
|
169
|
+
n(this, "_colspan");
|
|
170
170
|
/**
|
|
171
171
|
* Invisible fields (default is false)
|
|
172
172
|
*/
|
|
173
|
-
|
|
173
|
+
n(this, "_invisible");
|
|
174
174
|
/**
|
|
175
175
|
* Widget type
|
|
176
176
|
*/
|
|
177
|
-
|
|
177
|
+
n(this, "_type", "");
|
|
178
178
|
/**
|
|
179
179
|
* Context
|
|
180
180
|
*/
|
|
181
|
-
|
|
181
|
+
n(this, "_context");
|
|
182
182
|
/**
|
|
183
183
|
* Domain
|
|
184
184
|
*/
|
|
185
|
-
|
|
185
|
+
n(this, "_domain");
|
|
186
186
|
/**
|
|
187
187
|
* Unique key for widget
|
|
188
188
|
*/
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
189
|
+
n(this, "_key");
|
|
190
|
+
n(this, "_parsedWidgetProps", {});
|
|
191
|
+
n(this, "_isFunction");
|
|
192
|
+
n(this, "_isSortable", !1);
|
|
193
193
|
/**
|
|
194
194
|
* Base type of the field
|
|
195
195
|
*/
|
|
196
|
-
|
|
196
|
+
n(this, "_fieldType", "");
|
|
197
197
|
this._colspan = P._defaultColspan, this._invisible = !1, e && (e.colspan && (this._colspan = +e.colspan), e.readonly !== void 0 && (this._readOnly = p(e.readonly)), e.invisible && (e.invisible === 1 || e.invisible === "1" || e.invisible === !0) && (this._invisible = !0), e.type && (this._type = e.type), e.context && (this._context = e.context), e.domain && (typeof e.domain != "string" ? this._domain = g(JSON.stringify(e.domain)) : this._domain = g(e.domain)), e.type && (this._fieldType = e.fieldsWidgetType), e.widget_props && (this._parsedWidgetProps = Z(e.widget_props)), e.key && (this._key = e.key), e.is_function && (this._isFunction = e.is_function), e.is_sortable && (this._isSortable = e.is_sortable));
|
|
198
198
|
}
|
|
199
199
|
static get defaultColspan() {
|
|
@@ -266,7 +266,7 @@ const vt = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), Ct
|
|
|
266
266
|
/**
|
|
267
267
|
* Default colspan
|
|
268
268
|
*/
|
|
269
|
-
|
|
269
|
+
n(P, "_defaultColspan", 1);
|
|
270
270
|
let k = P;
|
|
271
271
|
class f extends k {
|
|
272
272
|
constructor(t) {
|
|
@@ -276,47 +276,47 @@ class f extends k {
|
|
|
276
276
|
*
|
|
277
277
|
* Corresponds to the field's name attribute from xml
|
|
278
278
|
*/
|
|
279
|
-
|
|
279
|
+
n(this, "_id", "");
|
|
280
280
|
/**
|
|
281
281
|
* Label
|
|
282
282
|
*/
|
|
283
|
-
|
|
283
|
+
n(this, "_label", "");
|
|
284
284
|
/**
|
|
285
285
|
* No label
|
|
286
286
|
*
|
|
287
287
|
* This field hasn't got to show the label
|
|
288
288
|
*
|
|
289
289
|
*/
|
|
290
|
-
|
|
290
|
+
n(this, "_nolabel", !1);
|
|
291
291
|
/**
|
|
292
292
|
*
|
|
293
293
|
* Required field
|
|
294
294
|
*
|
|
295
295
|
*/
|
|
296
|
-
|
|
296
|
+
n(this, "_required", !1);
|
|
297
297
|
/**
|
|
298
298
|
* Tooltip
|
|
299
299
|
*/
|
|
300
|
-
|
|
300
|
+
n(this, "_tooltip");
|
|
301
301
|
/**
|
|
302
302
|
* Tooltip inline
|
|
303
303
|
*/
|
|
304
|
-
|
|
304
|
+
n(this, "_tooltipInline", !1);
|
|
305
305
|
/**
|
|
306
306
|
* Activated (default is true)
|
|
307
307
|
*/
|
|
308
|
-
|
|
308
|
+
n(this, "_activated", !0);
|
|
309
309
|
/**
|
|
310
310
|
* Sum - sum parameter (label), this will mean that we have to sum this field in the tree
|
|
311
311
|
*/
|
|
312
|
-
|
|
312
|
+
n(this, "_sum");
|
|
313
313
|
/**
|
|
314
314
|
* Values and keys
|
|
315
315
|
*/
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
this._activated = !0, t && (this._raw_props = t, t.name && (this._id = t.name), t.activated && (this._activated = t.activated), t.string && (this._label = g(t.string)), t.help && (this._tooltip = g(t.help)), t.nolabel && (t.nolabel === "1" || typeof t.nolabel == "boolean" && t.nolabel === !0) && (this._nolabel = !0), t.required && (t.required === "1" || t.required === !0 || t.required === "True") && (this._required = !0), t.sum && (this._sum = g(t.sum)), t.selection && (this._selectionValues = new Map(t.selection)), t.help_inline && (this.tooltipInline =
|
|
316
|
+
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
317
|
+
n(this, "_autoRefresh", !1);
|
|
318
|
+
n(this, "_raw_props");
|
|
319
|
+
this._activated = !0, t && (this._raw_props = t, t.name && (this._id = t.name), t.activated && (this._activated = t.activated), t.string && (this._label = g(t.string)), t.help && (this._tooltip = g(t.help)), t.nolabel && (t.nolabel === "1" || typeof t.nolabel == "boolean" && t.nolabel === !0) && (this._nolabel = !0), t.required && (t.required === "1" || t.required === !0 || t.required === "True") && (this._required = !0), t.sum && (this._sum = g(t.sum)), t.selection && (this._selectionValues = new Map(t.selection)), t.help_inline && (this.tooltipInline = Ct(t.help_inline)), t.autorefresh && (this.autoRefresh = p(t.autorefresh)));
|
|
320
320
|
}
|
|
321
321
|
get id() {
|
|
322
322
|
return this._id;
|
|
@@ -401,7 +401,7 @@ class f extends k {
|
|
|
401
401
|
return this._id === t ? this : null;
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
class
|
|
404
|
+
class Ot extends f {
|
|
405
405
|
}
|
|
406
406
|
class et extends k {
|
|
407
407
|
findById(e) {
|
|
@@ -414,23 +414,23 @@ class st extends f {
|
|
|
414
414
|
/**
|
|
415
415
|
* Label text
|
|
416
416
|
*/
|
|
417
|
-
|
|
417
|
+
n(this, "_text", "");
|
|
418
418
|
/**
|
|
419
419
|
* Align text
|
|
420
420
|
*/
|
|
421
|
-
|
|
421
|
+
n(this, "_align", "left");
|
|
422
422
|
/**
|
|
423
423
|
* Label type
|
|
424
424
|
*/
|
|
425
|
-
|
|
425
|
+
n(this, "_labelType", "default");
|
|
426
426
|
/**
|
|
427
427
|
* Label size
|
|
428
428
|
*/
|
|
429
|
-
|
|
429
|
+
n(this, "_labelSize");
|
|
430
430
|
/**
|
|
431
431
|
* Id of the field that this label goes with. Null if it's an independent label
|
|
432
432
|
*/
|
|
433
|
-
|
|
433
|
+
n(this, "_fieldForLabel", null);
|
|
434
434
|
t != null && t.fieldForLabel && (this._fieldForLabel = t.fieldForLabel), t.widget_props && (this.parsedWidgetProps.label_type && (this.labelType = this.parsedWidgetProps.label_type), this.parsedWidgetProps.label_size && (this.labelSize = this.parsedWidgetProps.label_size)), t != null && t.align && (this.align = t.align);
|
|
435
435
|
}
|
|
436
436
|
get text() {
|
|
@@ -469,29 +469,29 @@ class st extends f {
|
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
class z {
|
|
472
|
-
constructor(e = 4, t = 6, i = !1,
|
|
472
|
+
constructor(e = 4, t = 6, i = !1, r = void 0) {
|
|
473
473
|
/**
|
|
474
474
|
* Number of columns the container is divided
|
|
475
475
|
*/
|
|
476
|
-
|
|
476
|
+
n(this, "_columns");
|
|
477
477
|
/**
|
|
478
478
|
* Number of columns to use
|
|
479
479
|
*/
|
|
480
|
-
|
|
480
|
+
n(this, "_colspan");
|
|
481
481
|
/**
|
|
482
482
|
* Number of rows
|
|
483
483
|
*/
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
n(this, "_rows");
|
|
485
|
+
n(this, "_index");
|
|
486
486
|
/**
|
|
487
487
|
* Determines if widget is read only (default is false)
|
|
488
488
|
*/
|
|
489
|
-
|
|
489
|
+
n(this, "_readOnly");
|
|
490
490
|
/**
|
|
491
491
|
* Unique key for container
|
|
492
492
|
*/
|
|
493
|
-
|
|
494
|
-
this._columns = e, this._colspan = t, this._rows = [[]], this._index = 0, this._readOnly = i, this._key =
|
|
493
|
+
n(this, "_key");
|
|
494
|
+
this._columns = e, this._colspan = t, this._rows = [[]], this._index = 0, this._readOnly = i, this._key = r;
|
|
495
495
|
}
|
|
496
496
|
get columns() {
|
|
497
497
|
return this._columns;
|
|
@@ -534,12 +534,12 @@ class z {
|
|
|
534
534
|
return this._columns - e;
|
|
535
535
|
}
|
|
536
536
|
addWidget(e, t) {
|
|
537
|
-
const i = [],
|
|
537
|
+
const i = [], r = t ? t.addLabel : !0;
|
|
538
538
|
if (e instanceof et) {
|
|
539
539
|
this._rows.push([]), this._index++;
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
|
-
if (e.colspan > this._columns && (e.colspan = this._columns), e.readOnly = e.readOnly || this.readOnly,
|
|
542
|
+
if (e.colspan > this._columns && (e.colspan = this._columns), e.readOnly = e.readOnly || this.readOnly, r && e instanceof f && !e.nolabel) {
|
|
543
543
|
e.colspan > 1 && (e.colspan -= 1);
|
|
544
544
|
const o = new st({
|
|
545
545
|
name: e.id + "_label",
|
|
@@ -564,8 +564,8 @@ class z {
|
|
|
564
564
|
findById(e) {
|
|
565
565
|
var i;
|
|
566
566
|
let t = null;
|
|
567
|
-
return (i = this._rows) != null && i.length && this._rows.forEach((
|
|
568
|
-
t ||
|
|
567
|
+
return (i = this._rows) != null && i.length && this._rows.forEach((r) => {
|
|
568
|
+
t || r != null && r.length && r.forEach((l) => {
|
|
569
569
|
t || l && (t = l.findById(e));
|
|
570
570
|
});
|
|
571
571
|
}), t;
|
|
@@ -579,19 +579,19 @@ const O = class O extends k {
|
|
|
579
579
|
*
|
|
580
580
|
* Corresponds to the field's name attribute from xml
|
|
581
581
|
*/
|
|
582
|
-
|
|
582
|
+
n(this, "_id", "");
|
|
583
583
|
/**
|
|
584
584
|
* Container
|
|
585
585
|
*/
|
|
586
|
-
|
|
586
|
+
n(this, "_container");
|
|
587
587
|
/**
|
|
588
588
|
* Must expand widget
|
|
589
589
|
*/
|
|
590
|
-
|
|
590
|
+
n(this, "_mustExpand", !1);
|
|
591
591
|
/**
|
|
592
592
|
* Container label
|
|
593
593
|
*/
|
|
594
|
-
|
|
594
|
+
n(this, "_label", "");
|
|
595
595
|
this._container = new z(
|
|
596
596
|
t == null ? void 0 : t.col,
|
|
597
597
|
O._defaultColspan,
|
|
@@ -643,13 +643,13 @@ const O = class O extends k {
|
|
|
643
643
|
return t === this.id ? this : this.container.findById(t);
|
|
644
644
|
}
|
|
645
645
|
};
|
|
646
|
-
|
|
646
|
+
n(O, "_defaultColspan", 6);
|
|
647
647
|
let F = O;
|
|
648
648
|
const W = class W extends F {
|
|
649
649
|
constructor(t) {
|
|
650
650
|
super(t);
|
|
651
|
-
|
|
652
|
-
|
|
651
|
+
n(this, "_tabPosition", "top");
|
|
652
|
+
n(this, "_pages", []);
|
|
653
653
|
this.colspan = W._defaultColspan, t && (t.colspan && (this.colspan = t.colspan), t.tabpos && (this._tabPosition = t.tabpos));
|
|
654
654
|
}
|
|
655
655
|
static get defaultColspan() {
|
|
@@ -668,12 +668,12 @@ const W = class W extends F {
|
|
|
668
668
|
return [].concat.apply([], this._container.rows);
|
|
669
669
|
}
|
|
670
670
|
};
|
|
671
|
-
|
|
671
|
+
n(W, "_defaultColspan", 3);
|
|
672
672
|
let B = W;
|
|
673
673
|
class N extends F {
|
|
674
674
|
constructor(t) {
|
|
675
675
|
super(t);
|
|
676
|
-
|
|
676
|
+
n(this, "_loading", !1);
|
|
677
677
|
t && t.loading && (this._loading = t.loading);
|
|
678
678
|
}
|
|
679
679
|
get loading() {
|
|
@@ -683,10 +683,10 @@ class N extends F {
|
|
|
683
683
|
this._loading = t;
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
|
-
class
|
|
686
|
+
class Wt extends N {
|
|
687
687
|
constructor(t) {
|
|
688
688
|
super(t);
|
|
689
|
-
|
|
689
|
+
n(this, "_icon", null);
|
|
690
690
|
t.icon && (this._icon = t.icon);
|
|
691
691
|
}
|
|
692
692
|
get icon() {
|
|
@@ -696,13 +696,13 @@ class Ot extends N {
|
|
|
696
696
|
this._icon = t;
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
|
-
class
|
|
699
|
+
class Tt extends N {
|
|
700
700
|
constructor(t) {
|
|
701
701
|
var i;
|
|
702
702
|
super(t);
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
703
|
+
n(this, "_icon", null);
|
|
704
|
+
n(this, "_height");
|
|
705
|
+
n(this, "_backgroundColor");
|
|
706
706
|
if (t && (t.icon && (this._icon = t.icon), t.height))
|
|
707
707
|
try {
|
|
708
708
|
this._height = parseInt(t.height);
|
|
@@ -739,21 +739,21 @@ class A extends f {
|
|
|
739
739
|
/**
|
|
740
740
|
* Type
|
|
741
741
|
*/
|
|
742
|
-
|
|
742
|
+
n(this, "_buttonType", "workflow");
|
|
743
743
|
/**
|
|
744
744
|
* Button caption
|
|
745
745
|
*/
|
|
746
|
-
|
|
746
|
+
n(this, "_caption", "");
|
|
747
747
|
/**
|
|
748
748
|
* Button icon
|
|
749
749
|
*/
|
|
750
|
-
|
|
750
|
+
n(this, "_icon");
|
|
751
751
|
/**
|
|
752
752
|
* Confirm string for modal in button types workflow
|
|
753
753
|
*/
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
754
|
+
n(this, "_confirmMessage", "");
|
|
755
|
+
n(this, "_primary", !1);
|
|
756
|
+
n(this, "_danger", !1);
|
|
757
757
|
if (t) {
|
|
758
758
|
if (t.string && (this._caption = g(t.string)), t.buttonType && (this._buttonType = t.buttonType), t.confirm && (this._confirmMessage = g(t.confirm)), t.special && t.special === "cancel" && (this._buttonType = "cancel"), t.icon && (this._icon = t.icon), t.primary) {
|
|
759
759
|
const i = t.primary;
|
|
@@ -802,10 +802,10 @@ class A extends f {
|
|
|
802
802
|
this._danger = t;
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
class
|
|
805
|
+
class zt extends F {
|
|
806
806
|
constructor(t) {
|
|
807
807
|
super(t);
|
|
808
|
-
|
|
808
|
+
n(this, "_defaultName", "");
|
|
809
809
|
t.default && (this._defaultName = t.default);
|
|
810
810
|
}
|
|
811
811
|
get defaultName() {
|
|
@@ -824,8 +824,8 @@ class Tt extends F {
|
|
|
824
824
|
get secondaryButtons() {
|
|
825
825
|
return this.buttons.filter(
|
|
826
826
|
(i) => {
|
|
827
|
-
var
|
|
828
|
-
return i.id !== ((
|
|
827
|
+
var r;
|
|
828
|
+
return i.id !== ((r = this.defaultButton) == null ? void 0 : r.id);
|
|
829
829
|
}
|
|
830
830
|
);
|
|
831
831
|
}
|
|
@@ -833,7 +833,7 @@ class Tt extends F {
|
|
|
833
833
|
return this._container.rows.flat().filter((t) => !t.invisible);
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
class
|
|
836
|
+
class It extends f {
|
|
837
837
|
}
|
|
838
838
|
class R extends f {
|
|
839
839
|
constructor(t) {
|
|
@@ -841,13 +841,13 @@ class R extends f {
|
|
|
841
841
|
/**
|
|
842
842
|
* Field place holder
|
|
843
843
|
*/
|
|
844
|
-
|
|
844
|
+
n(this, "_placeholder", "");
|
|
845
845
|
/**
|
|
846
846
|
* Field size
|
|
847
847
|
*/
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
848
|
+
n(this, "_size");
|
|
849
|
+
n(this, "_isPassword", !1);
|
|
850
|
+
n(this, "_translatable", !1);
|
|
851
851
|
t && (t.size && (this._size = t.size), t.password && (this.isPassword = t.password === "True"), t.translate && (this.translatable = t.translate === "True" || t.translate === !0));
|
|
852
852
|
}
|
|
853
853
|
get placeholder() {
|
|
@@ -884,20 +884,20 @@ class $ extends f {
|
|
|
884
884
|
/**
|
|
885
885
|
* Field place holder
|
|
886
886
|
*/
|
|
887
|
-
|
|
887
|
+
n(this, "_placeholder", "");
|
|
888
888
|
/**
|
|
889
889
|
* Field size
|
|
890
890
|
*/
|
|
891
|
-
|
|
891
|
+
n(this, "_size");
|
|
892
892
|
/**
|
|
893
893
|
* Must expand widget
|
|
894
894
|
*/
|
|
895
|
-
|
|
895
|
+
n(this, "_mustExpand", !1);
|
|
896
896
|
/**
|
|
897
897
|
* Height
|
|
898
898
|
*/
|
|
899
|
-
|
|
900
|
-
|
|
899
|
+
n(this, "_height");
|
|
900
|
+
n(this, "_translatable", !1);
|
|
901
901
|
if (t) {
|
|
902
902
|
if (t.placeholder && (this._placeholder = g(t.placeholder)), t.colspan || (this._mustExpand = !0), t.height)
|
|
903
903
|
try {
|
|
@@ -948,7 +948,7 @@ class S extends f {
|
|
|
948
948
|
/**
|
|
949
949
|
* Field size
|
|
950
950
|
*/
|
|
951
|
-
|
|
951
|
+
n(this, "_size", 150);
|
|
952
952
|
t && t.size && (this._size = t.size);
|
|
953
953
|
}
|
|
954
954
|
get size() {
|
|
@@ -958,17 +958,17 @@ class S extends f {
|
|
|
958
958
|
this._size = t;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
|
-
class
|
|
961
|
+
class St extends f {
|
|
962
962
|
constructor(t) {
|
|
963
963
|
super(t);
|
|
964
964
|
/**
|
|
965
965
|
* Field size
|
|
966
966
|
*/
|
|
967
|
-
|
|
967
|
+
n(this, "_size", 150);
|
|
968
968
|
/**
|
|
969
969
|
* Relation
|
|
970
970
|
*/
|
|
971
|
-
|
|
971
|
+
n(this, "_relation", "");
|
|
972
972
|
t && (t.size && (this._size = t.size), t.relation && (this._relation = t.relation));
|
|
973
973
|
}
|
|
974
974
|
get size() {
|
|
@@ -993,14 +993,14 @@ class It extends f {
|
|
|
993
993
|
return this.parsedWidgetProps.showMenu;
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
class
|
|
996
|
+
class Et extends $ {
|
|
997
997
|
}
|
|
998
998
|
class it extends f {
|
|
999
999
|
constructor(e) {
|
|
1000
1000
|
super(e);
|
|
1001
1001
|
}
|
|
1002
1002
|
}
|
|
1003
|
-
class
|
|
1003
|
+
class Vt extends f {
|
|
1004
1004
|
constructor(e) {
|
|
1005
1005
|
super(e);
|
|
1006
1006
|
}
|
|
@@ -1013,16 +1013,16 @@ class q extends f {
|
|
|
1013
1013
|
*
|
|
1014
1014
|
* Number of integer digits that will be part of the float
|
|
1015
1015
|
*/
|
|
1016
|
-
|
|
1016
|
+
n(this, "_integerDigits", 16);
|
|
1017
1017
|
/**
|
|
1018
1018
|
* Decimal digits
|
|
1019
1019
|
*
|
|
1020
1020
|
* Number of decimal digits that will be part of the float
|
|
1021
1021
|
*/
|
|
1022
|
-
|
|
1022
|
+
n(this, "_decimalDigits", 2);
|
|
1023
1023
|
if (t != null && t.digits) {
|
|
1024
|
-
const [i,
|
|
1025
|
-
this._integerDigits = i, this._decimalDigits =
|
|
1024
|
+
const [i, r] = t.digits;
|
|
1025
|
+
this._integerDigits = i, this._decimalDigits = r;
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
1028
|
get integerDigits() {
|
|
@@ -1038,21 +1038,21 @@ class q extends f {
|
|
|
1038
1038
|
this._decimalDigits = t;
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
|
-
class
|
|
1041
|
+
class Yt extends q {
|
|
1042
1042
|
}
|
|
1043
|
-
class
|
|
1043
|
+
class Dt extends f {
|
|
1044
1044
|
}
|
|
1045
|
-
class
|
|
1045
|
+
class jt extends q {
|
|
1046
1046
|
}
|
|
1047
|
-
class
|
|
1047
|
+
class Nt extends f {
|
|
1048
1048
|
constructor(e) {
|
|
1049
1049
|
super(e);
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
|
-
class
|
|
1052
|
+
class At extends f {
|
|
1053
1053
|
constructor(t) {
|
|
1054
1054
|
super(t);
|
|
1055
|
-
|
|
1055
|
+
n(this, "_timezone");
|
|
1056
1056
|
this._timezone = (t == null ? void 0 : t.timezone) || void 0;
|
|
1057
1057
|
}
|
|
1058
1058
|
get timezone() {
|
|
@@ -1062,41 +1062,41 @@ class Nt extends f {
|
|
|
1062
1062
|
this._timezone = t;
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
class
|
|
1065
|
+
class nt extends f {
|
|
1066
1066
|
constructor(t) {
|
|
1067
1067
|
super(t);
|
|
1068
1068
|
/**
|
|
1069
1069
|
* Field size
|
|
1070
1070
|
*/
|
|
1071
|
-
|
|
1071
|
+
n(this, "_size", 150);
|
|
1072
1072
|
/**
|
|
1073
1073
|
* Relation
|
|
1074
1074
|
*/
|
|
1075
|
-
|
|
1075
|
+
n(this, "_relation", "");
|
|
1076
1076
|
/**
|
|
1077
1077
|
* Inv_field
|
|
1078
1078
|
*/
|
|
1079
|
-
|
|
1079
|
+
n(this, "_inv_field");
|
|
1080
1080
|
/**
|
|
1081
1081
|
* Views
|
|
1082
1082
|
*/
|
|
1083
|
-
|
|
1083
|
+
n(this, "_views", null);
|
|
1084
1084
|
/**
|
|
1085
1085
|
* Mode
|
|
1086
1086
|
*/
|
|
1087
|
-
|
|
1087
|
+
n(this, "_mode", []);
|
|
1088
1088
|
/**
|
|
1089
1089
|
* Must expand widget
|
|
1090
1090
|
*/
|
|
1091
|
-
|
|
1091
|
+
n(this, "_mustExpand", !1);
|
|
1092
1092
|
/**
|
|
1093
1093
|
* Height
|
|
1094
1094
|
*/
|
|
1095
|
-
|
|
1095
|
+
n(this, "_height");
|
|
1096
1096
|
/**
|
|
1097
1097
|
* Infinite mode
|
|
1098
1098
|
*/
|
|
1099
|
-
|
|
1099
|
+
n(this, "_infinite");
|
|
1100
1100
|
if (t) {
|
|
1101
1101
|
if (t.size && (this._size = t.size), t.relation && (this._relation = t.relation), t.mode && (this._mode = t.mode.split(",")), t.views && (this._views = t.views), t.colspan ? this.colspan = t.colspan : this._mustExpand = !0, t.inv_field && (this._inv_field = t.inv_field), t.height)
|
|
1102
1102
|
try {
|
|
@@ -1156,14 +1156,14 @@ class rt extends f {
|
|
|
1156
1156
|
this._infinite = t;
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
|
-
class
|
|
1159
|
+
class Mt extends k {
|
|
1160
1160
|
constructor(t) {
|
|
1161
1161
|
super(t);
|
|
1162
1162
|
/**
|
|
1163
1163
|
* Label
|
|
1164
1164
|
*/
|
|
1165
|
-
|
|
1166
|
-
|
|
1165
|
+
n(this, "_label", "");
|
|
1166
|
+
n(this, "_icon", null);
|
|
1167
1167
|
t && (t.string && (this._label = g(t.string)), t.icon && (this._icon = t.icon));
|
|
1168
1168
|
}
|
|
1169
1169
|
get label() {
|
|
@@ -1182,15 +1182,15 @@ class At extends k {
|
|
|
1182
1182
|
return null;
|
|
1183
1183
|
}
|
|
1184
1184
|
}
|
|
1185
|
-
class
|
|
1185
|
+
class Bt extends S {
|
|
1186
1186
|
}
|
|
1187
|
-
class
|
|
1187
|
+
class Rt extends f {
|
|
1188
1188
|
constructor(t) {
|
|
1189
1189
|
super(t);
|
|
1190
1190
|
/**
|
|
1191
1191
|
* Filename field name
|
|
1192
1192
|
*/
|
|
1193
|
-
|
|
1193
|
+
n(this, "_filenameField", "");
|
|
1194
1194
|
t && t.filename && (this._filenameField = t.filename);
|
|
1195
1195
|
}
|
|
1196
1196
|
get filenameField() {
|
|
@@ -1200,11 +1200,11 @@ class Bt extends f {
|
|
|
1200
1200
|
this._filenameField = t;
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
|
-
class
|
|
1203
|
+
class Lt extends f {
|
|
1204
1204
|
constructor(t) {
|
|
1205
1205
|
super(t);
|
|
1206
|
-
|
|
1207
|
-
|
|
1206
|
+
n(this, "_width");
|
|
1207
|
+
n(this, "_height");
|
|
1208
1208
|
if (t) {
|
|
1209
1209
|
if (t.width) {
|
|
1210
1210
|
const i = parseInt(t.width);
|
|
@@ -1233,21 +1233,21 @@ class Rt extends f {
|
|
|
1233
1233
|
return ((t = this.parsedWidgetProps) == null ? void 0 : t.showControls) ?? !0;
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
class
|
|
1236
|
+
class Gt extends f {
|
|
1237
1237
|
constructor(t) {
|
|
1238
1238
|
super({ ...t, nolabel: !0 });
|
|
1239
1239
|
/**
|
|
1240
1240
|
* Icon name
|
|
1241
1241
|
*/
|
|
1242
|
-
|
|
1242
|
+
n(this, "_name", "");
|
|
1243
1243
|
/**
|
|
1244
1244
|
* Icon size
|
|
1245
1245
|
*/
|
|
1246
|
-
|
|
1246
|
+
n(this, "_size", 16);
|
|
1247
1247
|
/**
|
|
1248
1248
|
* Icon color
|
|
1249
1249
|
*/
|
|
1250
|
-
|
|
1250
|
+
n(this, "_color", "");
|
|
1251
1251
|
t && (t.name && (this._name = t.name), t.size && (this._size = t.size), t.color && (this._color = t.color));
|
|
1252
1252
|
}
|
|
1253
1253
|
get name() {
|
|
@@ -1269,22 +1269,22 @@ class Lt extends f {
|
|
|
1269
1269
|
this._color = t;
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
|
-
class
|
|
1272
|
+
class $t extends f {
|
|
1273
1273
|
constructor(e) {
|
|
1274
1274
|
super(e);
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
class
|
|
1277
|
+
class qt extends nt {
|
|
1278
1278
|
constructor(t) {
|
|
1279
1279
|
super(t);
|
|
1280
1280
|
/**
|
|
1281
1281
|
* Title field
|
|
1282
1282
|
*/
|
|
1283
|
-
|
|
1283
|
+
n(this, "_titleField");
|
|
1284
1284
|
/**
|
|
1285
1285
|
* Summary field
|
|
1286
1286
|
*/
|
|
1287
|
-
|
|
1287
|
+
n(this, "_summaryField");
|
|
1288
1288
|
this._titleField = "", this._summaryField = "", this._parsedWidgetProps && (this._titleField = this._parsedWidgetProps.titleField, this._summaryField = this.parsedWidgetProps.summaryField);
|
|
1289
1289
|
}
|
|
1290
1290
|
get titleField() {
|
|
@@ -1306,24 +1306,24 @@ class $t extends rt {
|
|
|
1306
1306
|
return this.parsedWidgetProps.colorField;
|
|
1307
1307
|
}
|
|
1308
1308
|
}
|
|
1309
|
-
class
|
|
1309
|
+
class Jt extends S {
|
|
1310
1310
|
constructor(t) {
|
|
1311
1311
|
super(t);
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1312
|
+
n(this, "_nolabel", !0);
|
|
1313
|
+
n(this, "_card");
|
|
1314
|
+
n(this, "_icon");
|
|
1315
|
+
n(this, "_suffix");
|
|
1316
|
+
n(this, "_color", "");
|
|
1317
1317
|
/**
|
|
1318
1318
|
* Action id
|
|
1319
1319
|
*/
|
|
1320
|
-
|
|
1320
|
+
n(this, "_actionId");
|
|
1321
1321
|
/**
|
|
1322
1322
|
* Action field
|
|
1323
1323
|
*/
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1324
|
+
n(this, "_actionField");
|
|
1325
|
+
n(this, "_height");
|
|
1326
|
+
n(this, "_autoRefresh");
|
|
1327
1327
|
if (this._card = !1, this._icon = "", this._suffix = "", this._autoRefresh = !1, this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = g(this._parsedWidgetProps.icon) || "", this._suffix = this._parsedWidgetProps.suffix || "", this._color = g(this._parsedWidgetProps.color) || ""), t) {
|
|
1328
1328
|
if (t.action_id && (this._actionId = parseInt(t.action_id)), t.action_field && (this._actionField = t.action_field), t.height)
|
|
1329
1329
|
try {
|
|
@@ -1380,26 +1380,26 @@ class qt extends S {
|
|
|
1380
1380
|
this._autoRefresh = t;
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
|
-
class
|
|
1383
|
+
class rt extends f {
|
|
1384
1384
|
constructor(t) {
|
|
1385
1385
|
super(t);
|
|
1386
1386
|
/**
|
|
1387
1387
|
* Field size
|
|
1388
1388
|
*/
|
|
1389
|
-
|
|
1389
|
+
n(this, "_size", 150);
|
|
1390
1390
|
/**
|
|
1391
1391
|
* Relation
|
|
1392
1392
|
*/
|
|
1393
|
-
|
|
1393
|
+
n(this, "_relation", "");
|
|
1394
1394
|
/**
|
|
1395
1395
|
* Inv_field
|
|
1396
1396
|
*/
|
|
1397
|
-
|
|
1397
|
+
n(this, "_inv_field");
|
|
1398
1398
|
/**
|
|
1399
1399
|
* field to define the value to show
|
|
1400
1400
|
*/
|
|
1401
|
-
|
|
1402
|
-
|
|
1401
|
+
n(this, "_field", "name");
|
|
1402
|
+
n(this, "_columns", 4);
|
|
1403
1403
|
t && (t.size && (this._size = t.size), t.relation && (this._relation = t.relation), t.inv_field && (this._inv_field = t.inv_field), this.parsedWidgetProps.hasOwnProperty("field") && (this._field = this.parsedWidgetProps.field), this.parsedWidgetProps.columns && (this._columns = this.parsedWidgetProps.columns));
|
|
1404
1404
|
}
|
|
1405
1405
|
get size() {
|
|
@@ -1433,9 +1433,9 @@ class nt extends f {
|
|
|
1433
1433
|
this._columns = t;
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
|
-
class
|
|
1436
|
+
class Ht extends rt {
|
|
1437
1437
|
}
|
|
1438
|
-
class
|
|
1438
|
+
class Qt extends S {
|
|
1439
1439
|
get colors() {
|
|
1440
1440
|
return this._parsedWidgetProps.colors || {};
|
|
1441
1441
|
}
|
|
@@ -1444,13 +1444,13 @@ class Ht extends S {
|
|
|
1444
1444
|
return ((e = this._parsedWidgetProps) == null ? void 0 : e.colorField) || null;
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
|
-
class
|
|
1447
|
+
class Kt extends S {
|
|
1448
1448
|
constructor(t) {
|
|
1449
1449
|
super(t);
|
|
1450
1450
|
/**
|
|
1451
1451
|
* Define the direction
|
|
1452
1452
|
*/
|
|
1453
|
-
|
|
1453
|
+
n(this, "_direction", "horizontal");
|
|
1454
1454
|
t && this.parsedWidgetProps.hasOwnProperty("direction") && (this._direction = this.parsedWidgetProps.direction);
|
|
1455
1455
|
}
|
|
1456
1456
|
get direction() {
|
|
@@ -1460,17 +1460,17 @@ class Qt extends S {
|
|
|
1460
1460
|
this._direction = t;
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
|
-
class
|
|
1463
|
+
class Xt extends it {
|
|
1464
1464
|
}
|
|
1465
|
-
class
|
|
1465
|
+
class Ut extends f {
|
|
1466
1466
|
constructor(t) {
|
|
1467
1467
|
super(t);
|
|
1468
1468
|
/**
|
|
1469
1469
|
* Relation
|
|
1470
1470
|
*/
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1471
|
+
n(this, "_relation", "");
|
|
1472
|
+
n(this, "_errorField", null);
|
|
1473
|
+
n(this, "_lastStep", !0);
|
|
1474
1474
|
t && (t.relation && (this._relation = t.relation), this.parsedWidgetProps.hasOwnProperty("error_field") && (this._errorField = this.parsedWidgetProps.error_field), this.parsedWidgetProps.hasOwnProperty("last_step") && (this._lastStep = this.parsedWidgetProps.last_step));
|
|
1475
1475
|
}
|
|
1476
1476
|
get relation() {
|
|
@@ -1495,7 +1495,7 @@ class Xt extends f {
|
|
|
1495
1495
|
class at extends $ {
|
|
1496
1496
|
constructor(t) {
|
|
1497
1497
|
super(t);
|
|
1498
|
-
|
|
1498
|
+
n(this, "_lang", null);
|
|
1499
1499
|
t && this.parsedWidgetProps.lang && (this._lang = this.parsedWidgetProps.lang);
|
|
1500
1500
|
}
|
|
1501
1501
|
get lang() {
|
|
@@ -1505,21 +1505,21 @@ class at extends $ {
|
|
|
1505
1505
|
this._lang = t;
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
|
-
class
|
|
1508
|
+
class Zt extends f {
|
|
1509
1509
|
constructor(e) {
|
|
1510
1510
|
super(e);
|
|
1511
1511
|
}
|
|
1512
1512
|
}
|
|
1513
|
-
class
|
|
1513
|
+
class te extends F {
|
|
1514
1514
|
constructor(t) {
|
|
1515
1515
|
super(t);
|
|
1516
1516
|
/**
|
|
1517
1517
|
* Alert type
|
|
1518
1518
|
*/
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1519
|
+
n(this, "_alertType", "info");
|
|
1520
|
+
n(this, "_title", "");
|
|
1521
|
+
n(this, "_text", "");
|
|
1522
|
+
n(this, "_icon", null);
|
|
1523
1523
|
t && (t.alert_type && (this._alertType = t.alert_type), t.title && (this._title = t.title), t.text && (this._text = t.text), t.icon && (this._icon = t.icon));
|
|
1524
1524
|
}
|
|
1525
1525
|
get alertType() {
|
|
@@ -1550,13 +1550,13 @@ class Zt extends F {
|
|
|
1550
1550
|
return this._container.rows.flat().filter((t) => !t.invisible);
|
|
1551
1551
|
}
|
|
1552
1552
|
}
|
|
1553
|
-
class
|
|
1553
|
+
class ee extends f {
|
|
1554
1554
|
constructor(t) {
|
|
1555
1555
|
super(t);
|
|
1556
1556
|
/**
|
|
1557
1557
|
* Height of the comments component
|
|
1558
1558
|
*/
|
|
1559
|
-
|
|
1559
|
+
n(this, "_height");
|
|
1560
1560
|
if (t.height) {
|
|
1561
1561
|
const i = parseInt(t.height);
|
|
1562
1562
|
this._height = isNaN(i) ? void 0 : i;
|
|
@@ -1572,14 +1572,14 @@ class te extends f {
|
|
|
1572
1572
|
class K extends at {
|
|
1573
1573
|
constructor() {
|
|
1574
1574
|
super(...arguments);
|
|
1575
|
-
|
|
1575
|
+
n(this, "_lang", "json");
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
1578
|
-
class
|
|
1578
|
+
class se extends f {
|
|
1579
1579
|
constructor(t) {
|
|
1580
1580
|
super(t);
|
|
1581
|
-
|
|
1582
|
-
|
|
1581
|
+
n(this, "_multi", !1);
|
|
1582
|
+
n(this, "_size");
|
|
1583
1583
|
t && t.size && (this.size = t.size), this.parsedWidgetProps.multi && (this.multi = this.parsedWidgetProps.multi);
|
|
1584
1584
|
}
|
|
1585
1585
|
get multi() {
|
|
@@ -1595,10 +1595,10 @@ class ee extends f {
|
|
|
1595
1595
|
this._size = t;
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
|
-
class
|
|
1598
|
+
class ie extends F {
|
|
1599
1599
|
constructor(t) {
|
|
1600
1600
|
super(t);
|
|
1601
|
-
|
|
1601
|
+
n(this, "_autoPlay", !0);
|
|
1602
1602
|
t && "auto_play" in t && (this._autoPlay = p(t.auto_play));
|
|
1603
1603
|
}
|
|
1604
1604
|
get autoPlay() {
|
|
@@ -1611,7 +1611,7 @@ class se extends F {
|
|
|
1611
1611
|
return this._container.rows.flat().filter((t) => !t.invisible);
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
|
-
class
|
|
1614
|
+
class ne extends R {
|
|
1615
1615
|
get showText() {
|
|
1616
1616
|
return this.parsedWidgetProps.show_text ?? !0;
|
|
1617
1617
|
}
|
|
@@ -1630,15 +1630,15 @@ class re extends f {
|
|
|
1630
1630
|
return console.log(this.parsedWidgetProps), ((e = this.parsedWidgetProps) == null ? void 0 : e.showValue) ?? !1;
|
|
1631
1631
|
}
|
|
1632
1632
|
}
|
|
1633
|
-
class
|
|
1633
|
+
class ae extends N {
|
|
1634
1634
|
constructor(t) {
|
|
1635
1635
|
super(t);
|
|
1636
|
-
|
|
1637
|
-
|
|
1636
|
+
n(this, "_title", null);
|
|
1637
|
+
n(this, "_icon", null);
|
|
1638
1638
|
/**
|
|
1639
1639
|
* Height of the card component
|
|
1640
1640
|
*/
|
|
1641
|
-
|
|
1641
|
+
n(this, "_height");
|
|
1642
1642
|
if (t && (t.title && (this._title = t.title), t.icon && (this._icon = t.icon), t.height)) {
|
|
1643
1643
|
const i = parseInt(t.height);
|
|
1644
1644
|
this._height = isNaN(i) ? void 0 : i;
|
|
@@ -1668,7 +1668,7 @@ class E {
|
|
|
1668
1668
|
/**
|
|
1669
1669
|
* Widget class
|
|
1670
1670
|
*/
|
|
1671
|
-
|
|
1671
|
+
n(this, "_widgetClass");
|
|
1672
1672
|
}
|
|
1673
1673
|
setWidgetClass(e) {
|
|
1674
1674
|
switch (e) {
|
|
@@ -1676,13 +1676,13 @@ class E {
|
|
|
1676
1676
|
this._widgetClass = B;
|
|
1677
1677
|
break;
|
|
1678
1678
|
case "page":
|
|
1679
|
-
this._widgetClass =
|
|
1679
|
+
this._widgetClass = Wt;
|
|
1680
1680
|
break;
|
|
1681
1681
|
case "group":
|
|
1682
|
-
this._widgetClass =
|
|
1682
|
+
this._widgetClass = Tt;
|
|
1683
1683
|
break;
|
|
1684
1684
|
case "card":
|
|
1685
|
-
this._widgetClass =
|
|
1685
|
+
this._widgetClass = ae;
|
|
1686
1686
|
break;
|
|
1687
1687
|
case "label":
|
|
1688
1688
|
this._widgetClass = st;
|
|
@@ -1697,114 +1697,114 @@ class E {
|
|
|
1697
1697
|
this._widgetClass = A;
|
|
1698
1698
|
break;
|
|
1699
1699
|
case "buttonGroup":
|
|
1700
|
-
this._widgetClass =
|
|
1700
|
+
this._widgetClass = zt;
|
|
1701
1701
|
break;
|
|
1702
1702
|
case "action_buttons":
|
|
1703
|
-
this._widgetClass =
|
|
1703
|
+
this._widgetClass = It;
|
|
1704
1704
|
break;
|
|
1705
1705
|
case "selection":
|
|
1706
1706
|
this._widgetClass = S;
|
|
1707
1707
|
break;
|
|
1708
1708
|
case "many2one":
|
|
1709
|
-
this._widgetClass =
|
|
1709
|
+
this._widgetClass = St;
|
|
1710
1710
|
break;
|
|
1711
1711
|
case "boolean":
|
|
1712
1712
|
this._widgetClass = it;
|
|
1713
1713
|
break;
|
|
1714
1714
|
case "integer":
|
|
1715
|
-
this._widgetClass =
|
|
1715
|
+
this._widgetClass = Vt;
|
|
1716
1716
|
break;
|
|
1717
1717
|
case "float":
|
|
1718
1718
|
this._widgetClass = q;
|
|
1719
1719
|
break;
|
|
1720
1720
|
case "float_time":
|
|
1721
|
-
this._widgetClass =
|
|
1721
|
+
this._widgetClass = Yt;
|
|
1722
1722
|
break;
|
|
1723
1723
|
case "date":
|
|
1724
|
-
this._widgetClass =
|
|
1724
|
+
this._widgetClass = Nt;
|
|
1725
1725
|
break;
|
|
1726
1726
|
case "datetime":
|
|
1727
|
-
this._widgetClass =
|
|
1727
|
+
this._widgetClass = At;
|
|
1728
1728
|
break;
|
|
1729
1729
|
case "progressbar":
|
|
1730
|
-
this._widgetClass =
|
|
1730
|
+
this._widgetClass = jt;
|
|
1731
1731
|
break;
|
|
1732
1732
|
case "markdown":
|
|
1733
|
-
this._widgetClass =
|
|
1733
|
+
this._widgetClass = Et;
|
|
1734
1734
|
break;
|
|
1735
1735
|
case "many2many":
|
|
1736
1736
|
case "one2many":
|
|
1737
1737
|
case "one2many_list":
|
|
1738
|
-
this._widgetClass =
|
|
1738
|
+
this._widgetClass = nt;
|
|
1739
1739
|
break;
|
|
1740
1740
|
case "newline":
|
|
1741
1741
|
this._widgetClass = et;
|
|
1742
1742
|
break;
|
|
1743
1743
|
case "separator":
|
|
1744
|
-
this._widgetClass =
|
|
1744
|
+
this._widgetClass = Mt;
|
|
1745
1745
|
break;
|
|
1746
1746
|
case "url":
|
|
1747
1747
|
this._widgetClass = R;
|
|
1748
1748
|
break;
|
|
1749
1749
|
case "email":
|
|
1750
|
-
this._widgetClass =
|
|
1750
|
+
this._widgetClass = se;
|
|
1751
1751
|
break;
|
|
1752
1752
|
case "reference":
|
|
1753
|
-
this._widgetClass =
|
|
1753
|
+
this._widgetClass = Bt;
|
|
1754
1754
|
break;
|
|
1755
1755
|
case "binary":
|
|
1756
|
-
this._widgetClass =
|
|
1756
|
+
this._widgetClass = Rt;
|
|
1757
1757
|
break;
|
|
1758
1758
|
case "image":
|
|
1759
|
-
this._widgetClass =
|
|
1759
|
+
this._widgetClass = Lt;
|
|
1760
1760
|
break;
|
|
1761
1761
|
case "icon":
|
|
1762
|
-
this._widgetClass =
|
|
1762
|
+
this._widgetClass = Gt;
|
|
1763
1763
|
break;
|
|
1764
1764
|
case "fiber_grid":
|
|
1765
|
-
this._widgetClass =
|
|
1765
|
+
this._widgetClass = $t;
|
|
1766
1766
|
break;
|
|
1767
1767
|
case "timeline":
|
|
1768
|
-
this._widgetClass =
|
|
1768
|
+
this._widgetClass = qt;
|
|
1769
1769
|
break;
|
|
1770
1770
|
case "indicator":
|
|
1771
|
-
this._widgetClass =
|
|
1771
|
+
this._widgetClass = Jt;
|
|
1772
1772
|
break;
|
|
1773
1773
|
case "tags":
|
|
1774
|
-
this._widgetClass =
|
|
1774
|
+
this._widgetClass = Ht;
|
|
1775
1775
|
break;
|
|
1776
1776
|
case "tag":
|
|
1777
|
-
this._widgetClass =
|
|
1777
|
+
this._widgetClass = Qt;
|
|
1778
1778
|
break;
|
|
1779
1779
|
case "avatar":
|
|
1780
|
-
this._widgetClass =
|
|
1780
|
+
this._widgetClass = Ot;
|
|
1781
1781
|
break;
|
|
1782
1782
|
case "radio":
|
|
1783
|
-
this._widgetClass =
|
|
1783
|
+
this._widgetClass = Kt;
|
|
1784
1784
|
break;
|
|
1785
1785
|
case "multicheckbox":
|
|
1786
|
-
this._widgetClass =
|
|
1786
|
+
this._widgetClass = rt;
|
|
1787
1787
|
break;
|
|
1788
1788
|
case "switch":
|
|
1789
|
-
this._widgetClass =
|
|
1789
|
+
this._widgetClass = Xt;
|
|
1790
1790
|
break;
|
|
1791
1791
|
case "steps":
|
|
1792
|
-
this._widgetClass =
|
|
1792
|
+
this._widgetClass = Ut;
|
|
1793
1793
|
break;
|
|
1794
1794
|
case "codeeditor":
|
|
1795
1795
|
this._widgetClass = at;
|
|
1796
1796
|
break;
|
|
1797
1797
|
case "time":
|
|
1798
|
-
this._widgetClass =
|
|
1798
|
+
this._widgetClass = Zt;
|
|
1799
1799
|
break;
|
|
1800
1800
|
case "html_preview":
|
|
1801
|
-
this._widgetClass =
|
|
1801
|
+
this._widgetClass = Dt;
|
|
1802
1802
|
break;
|
|
1803
1803
|
case "alert":
|
|
1804
|
-
this._widgetClass =
|
|
1804
|
+
this._widgetClass = te;
|
|
1805
1805
|
break;
|
|
1806
1806
|
case "comments_timeline":
|
|
1807
|
-
this._widgetClass =
|
|
1807
|
+
this._widgetClass = ee;
|
|
1808
1808
|
break;
|
|
1809
1809
|
case "json":
|
|
1810
1810
|
this._widgetClass = K;
|
|
@@ -1816,10 +1816,10 @@ class E {
|
|
|
1816
1816
|
this._widgetClass = N;
|
|
1817
1817
|
break;
|
|
1818
1818
|
case "carousel":
|
|
1819
|
-
this._widgetClass =
|
|
1819
|
+
this._widgetClass = ie;
|
|
1820
1820
|
break;
|
|
1821
1821
|
case "colorPicker":
|
|
1822
|
-
this._widgetClass =
|
|
1822
|
+
this._widgetClass = ne;
|
|
1823
1823
|
break;
|
|
1824
1824
|
case "qrcode":
|
|
1825
1825
|
this._widgetClass = re;
|
|
@@ -1846,7 +1846,7 @@ class E {
|
|
|
1846
1846
|
}
|
|
1847
1847
|
}
|
|
1848
1848
|
}
|
|
1849
|
-
const
|
|
1849
|
+
const le = ({
|
|
1850
1850
|
fieldName: s,
|
|
1851
1851
|
values: e,
|
|
1852
1852
|
fields: t
|
|
@@ -1857,7 +1857,7 @@ const ae = ({
|
|
|
1857
1857
|
const i = (o = t[s]) == null ? void 0 : o.states;
|
|
1858
1858
|
if (!i)
|
|
1859
1859
|
return {};
|
|
1860
|
-
const
|
|
1860
|
+
const r = {}, l = {};
|
|
1861
1861
|
for (const a of Object.keys(i))
|
|
1862
1862
|
if (e.state === a) {
|
|
1863
1863
|
const c = i[a];
|
|
@@ -1868,9 +1868,9 @@ const ae = ({
|
|
|
1868
1868
|
}
|
|
1869
1869
|
for (const a of Object.keys(l)) {
|
|
1870
1870
|
const c = l[a];
|
|
1871
|
-
|
|
1871
|
+
r[a] = c.some((_) => _);
|
|
1872
1872
|
}
|
|
1873
|
-
return
|
|
1873
|
+
return r;
|
|
1874
1874
|
}, lt = ({
|
|
1875
1875
|
states: s,
|
|
1876
1876
|
values: e
|
|
@@ -1880,13 +1880,13 @@ const ae = ({
|
|
|
1880
1880
|
const t = s.split(",");
|
|
1881
1881
|
return t.length === 0 ? {} : t.includes(e.state) ? {} : { invisible: !0 };
|
|
1882
1882
|
};
|
|
1883
|
-
function
|
|
1883
|
+
function oe({
|
|
1884
1884
|
values: s = {},
|
|
1885
1885
|
fieldName: e,
|
|
1886
1886
|
fields: t = {}
|
|
1887
1887
|
}) {
|
|
1888
|
-
var
|
|
1889
|
-
const i = ((
|
|
1888
|
+
var r;
|
|
1889
|
+
const i = ((r = t[e]) == null ? void 0 : r.type) || "passthrough";
|
|
1890
1890
|
return i === "many2one" ? s[e] ? s[e][0] || null : !1 : i === "one2many" || i === "many2many" ? s[e].map((l) => l.id) : s != null && s[e] ? s == null ? void 0 : s[e] : e.includes("'") ? e : parseInt(e);
|
|
1891
1891
|
}
|
|
1892
1892
|
const J = ({
|
|
@@ -1908,7 +1908,7 @@ const J = ({
|
|
|
1908
1908
|
return h.forEach((d) => {
|
|
1909
1909
|
const b = d[1];
|
|
1910
1910
|
if (!d[1].includes("'") && d[1] !== "true" && d[1] !== "false") {
|
|
1911
|
-
const x =
|
|
1911
|
+
const x = oe({
|
|
1912
1912
|
values: e,
|
|
1913
1913
|
fields: t,
|
|
1914
1914
|
fieldName: b === "active_id" ? "id" : b
|
|
@@ -1943,20 +1943,20 @@ function ot(s) {
|
|
|
1943
1943
|
function ct(s) {
|
|
1944
1944
|
return typeof s == "object" && s !== null && typeof s != "string";
|
|
1945
1945
|
}
|
|
1946
|
-
const
|
|
1947
|
-
const e = s.trim().replace(")", "").split("("), t = e[0],
|
|
1946
|
+
const dt = (s) => {
|
|
1947
|
+
const e = s.trim().replace(")", "").split("("), t = e[0], i = e[1], r = i ? i.split(",").map((l) => l.trim()).filter((l) => l.length > 0) : [];
|
|
1948
1948
|
return {
|
|
1949
1949
|
method: t,
|
|
1950
|
-
args:
|
|
1950
|
+
args: r
|
|
1951
1951
|
};
|
|
1952
1952
|
};
|
|
1953
1953
|
function ce(s) {
|
|
1954
1954
|
const e = [];
|
|
1955
1955
|
function t(i) {
|
|
1956
|
-
const
|
|
1956
|
+
const r = [];
|
|
1957
1957
|
for (const l of i)
|
|
1958
|
-
l instanceof F ? t(l._container.rows.flat()) :
|
|
1959
|
-
|
|
1958
|
+
l instanceof F ? t(l._container.rows.flat()) : r.push(l);
|
|
1959
|
+
r.length > 0 && e.push(r);
|
|
1960
1960
|
}
|
|
1961
1961
|
for (const i of s)
|
|
1962
1962
|
t(i);
|
|
@@ -1967,25 +1967,25 @@ class Ee {
|
|
|
1967
1967
|
/**
|
|
1968
1968
|
* Object containing fields specification of the form.
|
|
1969
1969
|
*/
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1970
|
+
n(this, "_fields");
|
|
1971
|
+
n(this, "_container");
|
|
1972
|
+
n(this, "_string", null);
|
|
1973
1973
|
/**
|
|
1974
1974
|
* Widget type
|
|
1975
1975
|
*/
|
|
1976
|
-
|
|
1976
|
+
n(this, "_type", "form");
|
|
1977
1977
|
/**
|
|
1978
1978
|
* Determines if form is read only (default is false)
|
|
1979
1979
|
*/
|
|
1980
|
-
|
|
1980
|
+
n(this, "_readOnly", !1);
|
|
1981
1981
|
/**
|
|
1982
1982
|
* Context
|
|
1983
1983
|
*/
|
|
1984
|
-
|
|
1984
|
+
n(this, "_context", {});
|
|
1985
1985
|
/**
|
|
1986
1986
|
* Collection of onChange actions for fields
|
|
1987
1987
|
*/
|
|
1988
|
-
|
|
1988
|
+
n(this, "_onChangeFields", {});
|
|
1989
1989
|
/*
|
|
1990
1990
|
_widgets = {
|
|
1991
1991
|
*[Symbol.iterator]() {
|
|
@@ -2004,19 +2004,19 @@ class Ee {
|
|
|
2004
2004
|
/**
|
|
2005
2005
|
* Unique key for container
|
|
2006
2006
|
*/
|
|
2007
|
-
|
|
2007
|
+
n(this, "_keyIdx", 0);
|
|
2008
2008
|
/**
|
|
2009
2009
|
* List of invisible fields
|
|
2010
2010
|
*/
|
|
2011
|
-
|
|
2011
|
+
n(this, "_invisibleFields", []);
|
|
2012
2012
|
/**
|
|
2013
2013
|
* List of autorefreshable fields
|
|
2014
2014
|
*/
|
|
2015
|
-
|
|
2015
|
+
n(this, "_autorefreshableFields", []);
|
|
2016
2016
|
/**
|
|
2017
2017
|
* Context for each field in the form
|
|
2018
2018
|
*/
|
|
2019
|
-
|
|
2019
|
+
n(this, "_contextForFields", {});
|
|
2020
2020
|
this._fields = e, this._container = new z(t, 6, !1, "root");
|
|
2021
2021
|
}
|
|
2022
2022
|
get fields() {
|
|
@@ -2072,8 +2072,8 @@ class Ee {
|
|
|
2072
2072
|
}
|
|
2073
2073
|
parse(e, t) {
|
|
2074
2074
|
var a;
|
|
2075
|
-
const { values: i = {}, readOnly:
|
|
2076
|
-
this._string = ((a = l.attributes) == null ? void 0 : a.string) || null, this._string && (this._string = g(this._string)), this._readOnly =
|
|
2075
|
+
const { values: i = {}, readOnly: r = !1 } = t || {}, l = I.parse(e).filter((c) => c.tagName === "form")[0];
|
|
2076
|
+
this._string = ((a = l.attributes) == null ? void 0 : a.string) || null, this._string && (this._string = g(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
2077
2077
|
fields: l.children,
|
|
2078
2078
|
container: this._container,
|
|
2079
2079
|
values: i
|
|
@@ -2089,7 +2089,7 @@ class Ee {
|
|
|
2089
2089
|
container: t,
|
|
2090
2090
|
values: i
|
|
2091
2091
|
}) {
|
|
2092
|
-
const
|
|
2092
|
+
const r = new E();
|
|
2093
2093
|
e.filter((l) => typeof l == "object").forEach((l) => {
|
|
2094
2094
|
var v, C;
|
|
2095
2095
|
const { tagName: o, attributes: a, children: c } = l;
|
|
@@ -2124,7 +2124,7 @@ class Ee {
|
|
|
2124
2124
|
o === "button" && u.states ? m = lt({
|
|
2125
2125
|
states: u.states,
|
|
2126
2126
|
values: i
|
|
2127
|
-
}) : m =
|
|
2127
|
+
}) : m = le({
|
|
2128
2128
|
fieldName: u.name,
|
|
2129
2129
|
values: i,
|
|
2130
2130
|
fields: this._fields
|
|
@@ -2134,7 +2134,7 @@ class Ee {
|
|
|
2134
2134
|
values: i,
|
|
2135
2135
|
fields: this._fields
|
|
2136
2136
|
});
|
|
2137
|
-
u.on_change && (this._onChangeFields[u.name] =
|
|
2137
|
+
u.on_change && (this._onChangeFields[u.name] = dt(
|
|
2138
2138
|
u.on_change
|
|
2139
2139
|
));
|
|
2140
2140
|
let b;
|
|
@@ -2147,7 +2147,7 @@ class Ee {
|
|
|
2147
2147
|
key: `${this._keyIdx}`
|
|
2148
2148
|
};
|
|
2149
2149
|
t.readOnly && (x.readonly = !0);
|
|
2150
|
-
const y =
|
|
2150
|
+
const y = r.createWidget(_, x);
|
|
2151
2151
|
y.invisible && y instanceof f && this._invisibleFields.push(x.name), y instanceof F && this.parseNode({
|
|
2152
2152
|
fields: c,
|
|
2153
2153
|
container: y.container,
|
|
@@ -2171,34 +2171,34 @@ class Ve {
|
|
|
2171
2171
|
/**
|
|
2172
2172
|
* Object containing fields specification of the form.
|
|
2173
2173
|
*/
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2174
|
+
n(this, "_fields");
|
|
2175
|
+
n(this, "_columns", []);
|
|
2176
|
+
n(this, "_string", null);
|
|
2177
2177
|
/**
|
|
2178
2178
|
* Widget type
|
|
2179
2179
|
*/
|
|
2180
|
-
|
|
2180
|
+
n(this, "_type", "tree");
|
|
2181
2181
|
/**
|
|
2182
2182
|
* Color expression value
|
|
2183
2183
|
*/
|
|
2184
|
-
|
|
2185
|
-
|
|
2184
|
+
n(this, "_colors", null);
|
|
2185
|
+
n(this, "_status", null);
|
|
2186
2186
|
/**
|
|
2187
2187
|
* Editable value
|
|
2188
2188
|
*/
|
|
2189
|
-
|
|
2189
|
+
n(this, "_editable", null);
|
|
2190
2190
|
/**
|
|
2191
2191
|
* Context for each field in the form
|
|
2192
2192
|
*/
|
|
2193
|
-
|
|
2193
|
+
n(this, "_contextForFields", {});
|
|
2194
2194
|
/**
|
|
2195
2195
|
* List of autorefreshable fields
|
|
2196
2196
|
*/
|
|
2197
|
-
|
|
2197
|
+
n(this, "_autorefreshableFields", []);
|
|
2198
2198
|
/**
|
|
2199
2199
|
* Is infinite
|
|
2200
2200
|
*/
|
|
2201
|
-
|
|
2201
|
+
n(this, "_infinite", !1);
|
|
2202
2202
|
this._fields = e;
|
|
2203
2203
|
}
|
|
2204
2204
|
get fields() {
|
|
@@ -2238,11 +2238,11 @@ class Ve {
|
|
|
2238
2238
|
this._infinite = e;
|
|
2239
2239
|
}
|
|
2240
2240
|
parse(e) {
|
|
2241
|
-
const t = I.parse(e).filter((
|
|
2241
|
+
const t = I.parse(e).filter((r) => r.tagName === "tree")[0];
|
|
2242
2242
|
this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors)), this._status = t.attributes.status || null, this._status && (this._status = g(this._status)), this._editable = t.attributes.editable || null, this._infinite = t.attributes.infinite || !1;
|
|
2243
2243
|
const i = new E();
|
|
2244
|
-
t.children.forEach((
|
|
2245
|
-
const { tagName: l, attributes: o } =
|
|
2244
|
+
t.children.forEach((r) => {
|
|
2245
|
+
const { tagName: l, attributes: o } = r;
|
|
2246
2246
|
let a = null;
|
|
2247
2247
|
if (l === "field") {
|
|
2248
2248
|
const { name: c, widget: _ } = o;
|
|
@@ -2285,55 +2285,61 @@ class Ye {
|
|
|
2285
2285
|
/**
|
|
2286
2286
|
* Object containing fields specification of the kanban.
|
|
2287
2287
|
*/
|
|
2288
|
-
|
|
2288
|
+
n(this, "_fields");
|
|
2289
2289
|
/**
|
|
2290
2290
|
* Array of field widgets to display in cards
|
|
2291
2291
|
*/
|
|
2292
|
-
|
|
2292
|
+
n(this, "_card_fields", []);
|
|
2293
2293
|
/**
|
|
2294
2294
|
* Array of button widgets to display in cards
|
|
2295
2295
|
*/
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2296
|
+
n(this, "_buttons", []);
|
|
2297
|
+
n(this, "_string", null);
|
|
2298
|
+
n(this, "_status", null);
|
|
2299
2299
|
/**
|
|
2300
2300
|
* Widget type
|
|
2301
2301
|
*/
|
|
2302
|
-
|
|
2302
|
+
n(this, "_type", "kanban");
|
|
2303
2303
|
/**
|
|
2304
2304
|
* Field that defines the columns (e.g., "state")
|
|
2305
2305
|
*/
|
|
2306
|
-
|
|
2306
|
+
n(this, "_column_field", "state");
|
|
2307
2307
|
/**
|
|
2308
2308
|
* Domain for filtering columns (for many2one fields)
|
|
2309
2309
|
* Example: "[('fold', '!=', True)]"
|
|
2310
2310
|
*/
|
|
2311
|
-
|
|
2311
|
+
n(this, "_column_domain", null);
|
|
2312
2312
|
/**
|
|
2313
2313
|
* Enable dragging cards between columns
|
|
2314
2314
|
*/
|
|
2315
|
-
|
|
2315
|
+
n(this, "_drag", !0);
|
|
2316
2316
|
/**
|
|
2317
2317
|
* Field name to use for sorting cards within columns
|
|
2318
2318
|
*/
|
|
2319
|
-
|
|
2319
|
+
n(this, "_sort");
|
|
2320
2320
|
/**
|
|
2321
2321
|
* Enable setting max cards per column (WIP limits)
|
|
2322
2322
|
*/
|
|
2323
|
-
|
|
2323
|
+
n(this, "_set_max_cards", !1);
|
|
2324
2324
|
/**
|
|
2325
2325
|
* Color expression value (e.g., "blue:state=='draft';green:state=='done'")
|
|
2326
2326
|
*/
|
|
2327
|
-
|
|
2327
|
+
n(this, "_colors", null);
|
|
2328
|
+
/**
|
|
2329
|
+
* Custom function to call when a card moves between columns
|
|
2330
|
+
* Example: "handle_state_change" or with args "handle_state_change(field, from, to)"
|
|
2331
|
+
* If not defined, the frontend should use the default on_change_column method
|
|
2332
|
+
*/
|
|
2333
|
+
n(this, "_on_change_column", null);
|
|
2328
2334
|
/**
|
|
2329
2335
|
* Context for each field in the kanban
|
|
2330
2336
|
*/
|
|
2331
|
-
|
|
2337
|
+
n(this, "_contextForFields", {});
|
|
2332
2338
|
/**
|
|
2333
2339
|
* Map of fields that have sum aggregation
|
|
2334
2340
|
* Key: field name, Value: sum label (e.g., "Total hours")
|
|
2335
2341
|
*/
|
|
2336
|
-
|
|
2342
|
+
n(this, "_aggregations", {});
|
|
2337
2343
|
this._fields = e;
|
|
2338
2344
|
}
|
|
2339
2345
|
get fields() {
|
|
@@ -2372,6 +2378,9 @@ class Ye {
|
|
|
2372
2378
|
get colors() {
|
|
2373
2379
|
return this._colors;
|
|
2374
2380
|
}
|
|
2381
|
+
get on_change_column() {
|
|
2382
|
+
return this._on_change_column;
|
|
2383
|
+
}
|
|
2375
2384
|
get contextForFields() {
|
|
2376
2385
|
return this._contextForFields;
|
|
2377
2386
|
}
|
|
@@ -2382,21 +2391,21 @@ class Ye {
|
|
|
2382
2391
|
return this._aggregations;
|
|
2383
2392
|
}
|
|
2384
2393
|
parse(e) {
|
|
2385
|
-
const t = I.parse(e).filter((
|
|
2386
|
-
this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._column_field = t.attributes.column_field || "state", this._column_domain = t.attributes.column_domain || null, this._drag = t.attributes.drag !== void 0 ? p(t.attributes.drag) : !0, this._sort = t.attributes.sort || void 0, this._set_max_cards = t.attributes.set_max_cards !== void 0 ? p(t.attributes.set_max_cards) : !1, this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors)), this._status = t.attributes.status || null, this._status && (this._status = g(this._status));
|
|
2394
|
+
const t = I.parse(e).filter((r) => r.tagName === "kanban")[0];
|
|
2395
|
+
this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._column_field = t.attributes.column_field || "state", this._column_domain = t.attributes.column_domain || null, this._drag = t.attributes.drag !== void 0 ? p(t.attributes.drag) : !0, this._sort = t.attributes.sort || void 0, this._set_max_cards = t.attributes.set_max_cards !== void 0 ? p(t.attributes.set_max_cards) : !1, this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors)), this._status = t.attributes.status || null, this._status && (this._status = g(this._status)), t.attributes.on_change_column && (this._on_change_column = dt(t.attributes.on_change_column));
|
|
2387
2396
|
const i = new E();
|
|
2388
|
-
t.children.forEach((
|
|
2389
|
-
const { tagName: l, attributes: o } =
|
|
2390
|
-
l === "field" ? this._parseField(
|
|
2397
|
+
t.children.forEach((r) => {
|
|
2398
|
+
const { tagName: l, attributes: o } = r;
|
|
2399
|
+
l === "field" ? this._parseField(r, o, i) : l === "button" && this._parseButton(r, o);
|
|
2391
2400
|
});
|
|
2392
2401
|
}
|
|
2393
2402
|
_parseField(e, t, i) {
|
|
2394
|
-
const { name:
|
|
2395
|
-
if (!
|
|
2403
|
+
const { name: r, widget: l, sum: o } = t;
|
|
2404
|
+
if (!r)
|
|
2396
2405
|
return;
|
|
2397
|
-
if (!this._fields[
|
|
2398
|
-
throw new Error(`Field ${
|
|
2399
|
-
const a = this._fields[
|
|
2406
|
+
if (!this._fields[r])
|
|
2407
|
+
throw new Error(`Field ${r} doesn't exist in fields definition`);
|
|
2408
|
+
const a = this._fields[r];
|
|
2400
2409
|
let c = a.type;
|
|
2401
2410
|
(Array.isArray(a == null ? void 0 : a.domain) && (a == null ? void 0 : a.domain.length) === 0 || (a == null ? void 0 : a.domain) === !1) && t.domain && t.domain.length > 0 && delete a.domain;
|
|
2402
2411
|
const _ = J({
|
|
@@ -2409,22 +2418,22 @@ class Ye {
|
|
|
2409
2418
|
fieldsWidgetType: a == null ? void 0 : a.type,
|
|
2410
2419
|
context: _
|
|
2411
2420
|
};
|
|
2412
|
-
if (this._contextForFields[
|
|
2421
|
+
if (this._contextForFields[r] = _, l && (c = l), !u.invisible) {
|
|
2413
2422
|
const h = i.createWidget(
|
|
2414
2423
|
c,
|
|
2415
2424
|
u
|
|
2416
2425
|
);
|
|
2417
|
-
o && (h.sum = g(o), this._aggregations[
|
|
2426
|
+
o && (h.sum = g(o), this._aggregations[r] = g(o)), this._card_fields.push(h);
|
|
2418
2427
|
}
|
|
2419
2428
|
}
|
|
2420
2429
|
_parseButton(e, t) {
|
|
2421
|
-
const { name: i, type:
|
|
2430
|
+
const { name: i, type: r, string: l, states: o } = t;
|
|
2422
2431
|
if (!i)
|
|
2423
2432
|
return;
|
|
2424
2433
|
const a = {
|
|
2425
2434
|
...t,
|
|
2426
2435
|
name: i,
|
|
2427
|
-
buttonType:
|
|
2436
|
+
buttonType: r || "object",
|
|
2428
2437
|
string: l || ""
|
|
2429
2438
|
}, c = new A(a);
|
|
2430
2439
|
o && (c.states = o), this._buttons.push(c);
|
|
@@ -2434,20 +2443,20 @@ class Ye {
|
|
|
2434
2443
|
* @param {string} id id to find
|
|
2435
2444
|
*/
|
|
2436
2445
|
findById(e) {
|
|
2437
|
-
const t = this._card_fields.find((
|
|
2438
|
-
return t || this._buttons.find((
|
|
2446
|
+
const t = this._card_fields.find((r) => r.findById ? r.findById(e) : !1);
|
|
2447
|
+
return t || this._buttons.find((r) => r.findById ? r.findById(e) : !1) || null;
|
|
2439
2448
|
}
|
|
2440
2449
|
}
|
|
2441
2450
|
class De {
|
|
2442
2451
|
constructor(e) {
|
|
2443
|
-
|
|
2452
|
+
n(this, "_kanbanDef");
|
|
2444
2453
|
this._kanbanDef = e;
|
|
2445
2454
|
}
|
|
2446
2455
|
get kanbanDef() {
|
|
2447
2456
|
return this._kanbanDef;
|
|
2448
2457
|
}
|
|
2449
2458
|
parse(e, t) {
|
|
2450
|
-
const i = (t == null ? void 0 : t.readOnly) ?? !1,
|
|
2459
|
+
const i = (t == null ? void 0 : t.readOnly) ?? !1, r = new z(1, 12, i), l = new E();
|
|
2451
2460
|
let o = 0;
|
|
2452
2461
|
return this._kanbanDef.card_fields.forEach((a) => {
|
|
2453
2462
|
o++;
|
|
@@ -2463,7 +2472,7 @@ class De {
|
|
|
2463
2472
|
};
|
|
2464
2473
|
i && (_.readonly = !0);
|
|
2465
2474
|
const u = a.type || "field", h = l.createWidget(u, _);
|
|
2466
|
-
|
|
2475
|
+
r.addWidget(h, { addLabel: !a.nolabel });
|
|
2467
2476
|
}), this._kanbanDef.buttons.forEach((a) => {
|
|
2468
2477
|
o++;
|
|
2469
2478
|
const c = a.states ? lt({
|
|
@@ -2476,8 +2485,8 @@ class De {
|
|
|
2476
2485
|
};
|
|
2477
2486
|
i && (_.readonly = !0);
|
|
2478
2487
|
const u = new A(_);
|
|
2479
|
-
|
|
2480
|
-
}),
|
|
2488
|
+
r.addWidget(u, { addLabel: !1 });
|
|
2489
|
+
}), r;
|
|
2481
2490
|
}
|
|
2482
2491
|
}
|
|
2483
2492
|
const de = {
|
|
@@ -2498,13 +2507,13 @@ class je {
|
|
|
2498
2507
|
/**
|
|
2499
2508
|
* Object containing the specific fields for primary and secondary search fields
|
|
2500
2509
|
*/
|
|
2501
|
-
|
|
2510
|
+
n(this, "_searchFields");
|
|
2502
2511
|
/**
|
|
2503
2512
|
* Object containing all the fields specification of the whole form
|
|
2504
2513
|
*/
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2514
|
+
n(this, "_fields");
|
|
2515
|
+
n(this, "_simpleSearchContainer");
|
|
2516
|
+
n(this, "_advancedSearchContainer");
|
|
2508
2517
|
this._searchFields = e, this._fields = t, this._simpleSearchContainer = new z(i), this._advancedSearchContainer = new z(i);
|
|
2509
2518
|
}
|
|
2510
2519
|
get searchFields() {
|
|
@@ -2524,24 +2533,24 @@ class je {
|
|
|
2524
2533
|
this.parseFields(
|
|
2525
2534
|
this.searchFields.primary,
|
|
2526
2535
|
e
|
|
2527
|
-
).forEach((
|
|
2528
|
-
this.simpleSearchContainer.addWidget(
|
|
2536
|
+
).forEach((r) => {
|
|
2537
|
+
this.simpleSearchContainer.addWidget(r, { addLabel: !1 }), this.advancedSearchContainer.addWidget(r, { addLabel: !1 });
|
|
2529
2538
|
}), this.parseFields(
|
|
2530
2539
|
this.searchFields.secondary,
|
|
2531
2540
|
e
|
|
2532
|
-
).forEach((
|
|
2533
|
-
this.advancedSearchContainer.addWidget(
|
|
2541
|
+
).forEach((r) => {
|
|
2542
|
+
this.advancedSearchContainer.addWidget(r, { addLabel: !1 });
|
|
2534
2543
|
});
|
|
2535
2544
|
}
|
|
2536
2545
|
parseFields(e, t) {
|
|
2537
2546
|
return e.map((i) => {
|
|
2538
|
-
const
|
|
2547
|
+
const r = {
|
|
2539
2548
|
...this.fields[i],
|
|
2540
2549
|
name: i,
|
|
2541
2550
|
colspan: 2
|
|
2542
|
-
}, { type: l, widget: o } =
|
|
2551
|
+
}, { type: l, widget: o } = r;
|
|
2543
2552
|
let a = o ?? l;
|
|
2544
|
-
return de[a] === void 0 && (a = l), t.createWidget(a,
|
|
2553
|
+
return de[a] === void 0 && (a = l), t.createWidget(a, r);
|
|
2545
2554
|
});
|
|
2546
2555
|
}
|
|
2547
2556
|
/**
|
|
@@ -2560,18 +2569,18 @@ const Ne = ({
|
|
|
2560
2569
|
return s.forEach((i) => {
|
|
2561
2570
|
if (!Array.isArray(i))
|
|
2562
2571
|
return;
|
|
2563
|
-
const [
|
|
2572
|
+
const [r, l, o] = i;
|
|
2564
2573
|
let a, c;
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
)) : (a =
|
|
2574
|
+
r.indexOf(".") !== -1 ? (a = r.substr(0, r.indexOf(".")), c = r.substr(
|
|
2575
|
+
r.indexOf(".") + 1,
|
|
2576
|
+
r.length - 1
|
|
2577
|
+
)) : (a = r, c = "id"), a === e && t.push([c, l, o]);
|
|
2569
2578
|
}), t;
|
|
2570
2579
|
}, Ae = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((e) => e.trim()).filter((e) => !e.includes("'"));
|
|
2571
2580
|
class ue {
|
|
2572
2581
|
constructor(e) {
|
|
2573
|
-
|
|
2574
|
-
|
|
2582
|
+
n(this, "_action_id", null);
|
|
2583
|
+
n(this, "_position", null);
|
|
2575
2584
|
e.action_id && (this._action_id = e.action_id), e.position && (this._position = e.position);
|
|
2576
2585
|
}
|
|
2577
2586
|
get action_id() {
|
|
@@ -2583,13 +2592,13 @@ class ue {
|
|
|
2583
2592
|
}
|
|
2584
2593
|
class Me {
|
|
2585
2594
|
constructor(e) {
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
const t = I.parse(e).filter((
|
|
2595
|
+
n(this, "_string", null);
|
|
2596
|
+
n(this, "_items", []);
|
|
2597
|
+
const t = I.parse(e).filter((r) => r.tagName === "dashboard")[0];
|
|
2589
2598
|
this._string = t.attributes.string || null;
|
|
2590
2599
|
const { children: i } = t;
|
|
2591
|
-
i.forEach((
|
|
2592
|
-
|
|
2600
|
+
i.forEach((r) => {
|
|
2601
|
+
r.tagName === "dashboard_item" && this._items.push(new ue(r.attributes));
|
|
2593
2602
|
});
|
|
2594
2603
|
}
|
|
2595
2604
|
get string() {
|
|
@@ -2599,13 +2608,13 @@ class Me {
|
|
|
2599
2608
|
return this._items;
|
|
2600
2609
|
}
|
|
2601
2610
|
}
|
|
2602
|
-
class
|
|
2611
|
+
class ut {
|
|
2603
2612
|
constructor(e) {
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2613
|
+
n(this, "_string", null);
|
|
2614
|
+
n(this, "_type");
|
|
2615
|
+
n(this, "_timerange", null);
|
|
2616
|
+
n(this, "_interval", 1);
|
|
2617
|
+
n(this, "_y_range", "default");
|
|
2609
2618
|
if (this._string = e.attributes.string || null, this._timerange = e.attributes.timerange || null, e.attributes.interval && (this._interval = parseInt(e.attributes.interval)), e.attributes.y_range) {
|
|
2610
2619
|
const t = e.attributes.y_range;
|
|
2611
2620
|
(t === "auto" || t === "full" || t === "default") && (this._y_range = t);
|
|
@@ -2627,15 +2636,15 @@ class dt {
|
|
|
2627
2636
|
return this._y_range;
|
|
2628
2637
|
}
|
|
2629
2638
|
}
|
|
2630
|
-
class
|
|
2639
|
+
class ht extends ut {
|
|
2631
2640
|
constructor(t, i) {
|
|
2632
2641
|
super(i);
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2642
|
+
n(this, "_color", null);
|
|
2643
|
+
n(this, "_icon", null);
|
|
2644
|
+
n(this, "_totalDomain", null);
|
|
2645
|
+
n(this, "_showPercent", !1);
|
|
2646
|
+
n(this, "_progressbar", !1);
|
|
2647
|
+
n(this, "_suffix", null);
|
|
2639
2648
|
this._type = t, this._color = i.attributes.color || null, this._color && (this._color = g(this._color)), this._icon = i.attributes.icon || null, this._icon && (this._icon = g(this._icon)), this._suffix = i.attributes.suffix || null, this._totalDomain = g(i.attributes.totalDomain) || null, this._showPercent = p(i.attributes.showPercent), this._progressbar = p(i.attributes.progressbar);
|
|
2640
2649
|
}
|
|
2641
2650
|
get color() {
|
|
@@ -2657,13 +2666,13 @@ class ut extends dt {
|
|
|
2657
2666
|
return this._suffix;
|
|
2658
2667
|
}
|
|
2659
2668
|
}
|
|
2660
|
-
class he extends
|
|
2669
|
+
class he extends ht {
|
|
2661
2670
|
constructor(t, i) {
|
|
2662
2671
|
super(t, i);
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
const { children:
|
|
2666
|
-
|
|
2672
|
+
n(this, "_field");
|
|
2673
|
+
n(this, "_operator");
|
|
2674
|
+
const { children: r } = i;
|
|
2675
|
+
r.forEach((l) => {
|
|
2667
2676
|
if (l.tagName === "field") {
|
|
2668
2677
|
const o = l.attributes.name, a = l.attributes.operator;
|
|
2669
2678
|
this._field = o || void 0, this._operator = a;
|
|
@@ -2682,14 +2691,14 @@ const _e = (s) => {
|
|
|
2682
2691
|
let t;
|
|
2683
2692
|
if (s.forEach((i) => {
|
|
2684
2693
|
if (i.tagName === "field") {
|
|
2685
|
-
const
|
|
2686
|
-
if (!
|
|
2694
|
+
const r = i.attributes.axis, l = i.attributes.operator, o = i.attributes.name, a = i.attributes.label || void 0, c = i.attributes.stacked || void 0;
|
|
2695
|
+
if (!r)
|
|
2687
2696
|
throw new Error(`Field ${o} doesn't have an axis`);
|
|
2688
2697
|
if (!o)
|
|
2689
2698
|
throw new Error("Missing name attribute for field");
|
|
2690
|
-
|
|
2699
|
+
r === "x" ? t = new me({
|
|
2691
2700
|
name: o
|
|
2692
|
-
}) :
|
|
2701
|
+
}) : r === "y" && e.push(
|
|
2693
2702
|
new ge({
|
|
2694
2703
|
name: o,
|
|
2695
2704
|
operator: l,
|
|
@@ -2707,14 +2716,14 @@ const _e = (s) => {
|
|
|
2707
2716
|
y: e
|
|
2708
2717
|
};
|
|
2709
2718
|
};
|
|
2710
|
-
class M extends
|
|
2719
|
+
class M extends ut {
|
|
2711
2720
|
constructor(t, i) {
|
|
2712
2721
|
super(i);
|
|
2713
|
-
|
|
2714
|
-
|
|
2722
|
+
n(this, "_x");
|
|
2723
|
+
n(this, "_y");
|
|
2715
2724
|
this._type = t;
|
|
2716
|
-
const
|
|
2717
|
-
this._x =
|
|
2725
|
+
const r = _e(i.children);
|
|
2726
|
+
this._x = r.x, this._y = r.y;
|
|
2718
2727
|
}
|
|
2719
2728
|
get x() {
|
|
2720
2729
|
return this._x;
|
|
@@ -2724,13 +2733,13 @@ class M extends dt {
|
|
|
2724
2733
|
}
|
|
2725
2734
|
}
|
|
2726
2735
|
const fe = {
|
|
2727
|
-
indicator:
|
|
2736
|
+
indicator: ht,
|
|
2728
2737
|
indicatorField: he,
|
|
2729
2738
|
line: M,
|
|
2730
2739
|
bar: M,
|
|
2731
2740
|
pie: M
|
|
2732
2741
|
}, Be = (s) => {
|
|
2733
|
-
const e = I.parse(s).filter((
|
|
2742
|
+
const e = I.parse(s).filter((r) => r.tagName === "graph")[0], t = e.attributes.type;
|
|
2734
2743
|
if (!t)
|
|
2735
2744
|
throw new Error(`${t} is not a valid graph`);
|
|
2736
2745
|
const i = fe[t];
|
|
@@ -2738,10 +2747,10 @@ const fe = {
|
|
|
2738
2747
|
throw new Error(`${t} not found as a GraphModel`);
|
|
2739
2748
|
return new i(t, e);
|
|
2740
2749
|
};
|
|
2741
|
-
class
|
|
2750
|
+
class _t {
|
|
2742
2751
|
constructor({ name: e, axis: t }) {
|
|
2743
|
-
|
|
2744
|
-
|
|
2752
|
+
n(this, "_name");
|
|
2753
|
+
n(this, "_axis");
|
|
2745
2754
|
this._name = e, this._axis = t;
|
|
2746
2755
|
}
|
|
2747
2756
|
get name() {
|
|
@@ -2751,18 +2760,18 @@ class ht {
|
|
|
2751
2760
|
return this._axis;
|
|
2752
2761
|
}
|
|
2753
2762
|
}
|
|
2754
|
-
class ge extends
|
|
2763
|
+
class ge extends _t {
|
|
2755
2764
|
constructor({
|
|
2756
2765
|
name: t,
|
|
2757
2766
|
operator: i,
|
|
2758
|
-
label:
|
|
2767
|
+
label: r,
|
|
2759
2768
|
stacked: l
|
|
2760
2769
|
}) {
|
|
2761
2770
|
super({ name: t, axis: "y" });
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
this._operator = i, this._label =
|
|
2771
|
+
n(this, "_operator");
|
|
2772
|
+
n(this, "_label");
|
|
2773
|
+
n(this, "_stacked");
|
|
2774
|
+
this._operator = i, this._label = r, this._stacked = l;
|
|
2766
2775
|
}
|
|
2767
2776
|
get operator() {
|
|
2768
2777
|
return this._operator;
|
|
@@ -2774,7 +2783,7 @@ class ge extends ht {
|
|
|
2774
2783
|
return this._stacked;
|
|
2775
2784
|
}
|
|
2776
2785
|
}
|
|
2777
|
-
class me extends
|
|
2786
|
+
class me extends _t {
|
|
2778
2787
|
constructor({ name: e }) {
|
|
2779
2788
|
super({ name: e, axis: "x" });
|
|
2780
2789
|
}
|
|
@@ -2790,16 +2799,16 @@ function H({
|
|
|
2790
2799
|
values: e,
|
|
2791
2800
|
fieldName: t
|
|
2792
2801
|
}) {
|
|
2793
|
-
const i = s[t],
|
|
2802
|
+
const i = s[t], r = e[t];
|
|
2794
2803
|
if (!i)
|
|
2795
2804
|
throw new Error(`Field ${t} not found`);
|
|
2796
2805
|
if (i.type === "many2one")
|
|
2797
|
-
return
|
|
2806
|
+
return r ? { value: r[0], label: r[1] } : { value: !1, label: void 0 };
|
|
2798
2807
|
if (i.type === "selection") {
|
|
2799
|
-
const o = i.selection.find((a) => a[0] ===
|
|
2800
|
-
return o ? { value:
|
|
2808
|
+
const o = i.selection.find((a) => a[0] === r);
|
|
2809
|
+
return o ? { value: r, label: o[1] } : { value: !1, label: void 0 };
|
|
2801
2810
|
}
|
|
2802
|
-
return { value:
|
|
2811
|
+
return { value: r, label: r };
|
|
2803
2812
|
}
|
|
2804
2813
|
const Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2805
2814
|
__proto__: null,
|
|
@@ -2827,18 +2836,18 @@ function xe({
|
|
|
2827
2836
|
interval: t = 1
|
|
2828
2837
|
}) {
|
|
2829
2838
|
let i = [];
|
|
2830
|
-
const
|
|
2839
|
+
const r = gt({
|
|
2831
2840
|
values: s,
|
|
2832
2841
|
groupBy: "type-stacked"
|
|
2833
2842
|
}), l = `${e}s`;
|
|
2834
|
-
return Object.keys(
|
|
2835
|
-
const c =
|
|
2843
|
+
return Object.keys(r).forEach((a) => {
|
|
2844
|
+
const c = r[a];
|
|
2836
2845
|
for (let _ = 0; _ < c.length; _++) {
|
|
2837
2846
|
const u = c[_];
|
|
2838
2847
|
if (i.push(u), _ === c.length - 1)
|
|
2839
2848
|
return;
|
|
2840
2849
|
const h = u.x, m = c[_ + 1].x;
|
|
2841
|
-
if (!
|
|
2850
|
+
if (!ft([h, m], l)) {
|
|
2842
2851
|
const d = pe({
|
|
2843
2852
|
dates: [h, m],
|
|
2844
2853
|
timerange: e,
|
|
@@ -2861,19 +2870,19 @@ function pe({
|
|
|
2861
2870
|
timerange: e,
|
|
2862
2871
|
interval: t = 1
|
|
2863
2872
|
}) {
|
|
2864
|
-
const i = [],
|
|
2873
|
+
const i = [], r = `${e}s`;
|
|
2865
2874
|
if (s.length === 1)
|
|
2866
2875
|
return s;
|
|
2867
2876
|
const l = s.sort((o, a) => o < a ? -1 : o > a ? 1 : 0);
|
|
2868
2877
|
for (let o = 0; o < l.length - 1; o++) {
|
|
2869
2878
|
const a = l[o], c = l[o + 1];
|
|
2870
|
-
if (!
|
|
2871
|
-
const _ = T(a, D(
|
|
2879
|
+
if (!ft([a, c], r)) {
|
|
2880
|
+
const _ = T(a, D(r)).add(
|
|
2872
2881
|
t,
|
|
2873
|
-
|
|
2874
|
-
), u = T(c, D(
|
|
2882
|
+
r
|
|
2883
|
+
), u = T(c, D(r));
|
|
2875
2884
|
for (; _.isBefore(u); )
|
|
2876
|
-
i.push(_.format(D(
|
|
2885
|
+
i.push(_.format(D(r))), _.add(t, r);
|
|
2877
2886
|
}
|
|
2878
2887
|
}
|
|
2879
2888
|
return i;
|
|
@@ -2885,12 +2894,12 @@ function we({
|
|
|
2885
2894
|
const t = Fe({
|
|
2886
2895
|
values: s,
|
|
2887
2896
|
timerange: e
|
|
2888
|
-
}), i = [],
|
|
2897
|
+
}), i = [], r = gt({
|
|
2889
2898
|
values: t,
|
|
2890
2899
|
groupBy: "all"
|
|
2891
2900
|
});
|
|
2892
|
-
return Object.keys(
|
|
2893
|
-
const o =
|
|
2901
|
+
return Object.keys(r).forEach((l) => {
|
|
2902
|
+
const o = r[l], a = o[0].operator === "count" ? "+" : o[0].operator, c = j({
|
|
2894
2903
|
values: o.map((_) => _.value),
|
|
2895
2904
|
operator: a
|
|
2896
2905
|
});
|
|
@@ -2945,26 +2954,26 @@ function ve({
|
|
|
2945
2954
|
function Ce(s) {
|
|
2946
2955
|
return s.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2947
2956
|
}
|
|
2948
|
-
function
|
|
2957
|
+
function ft(s, e) {
|
|
2949
2958
|
let t = !1;
|
|
2950
2959
|
const i = D(e);
|
|
2951
2960
|
if (s.length === 0)
|
|
2952
2961
|
return !1;
|
|
2953
2962
|
if (s.length === 1)
|
|
2954
2963
|
return !0;
|
|
2955
|
-
for (let
|
|
2956
|
-
const l = T(s[
|
|
2964
|
+
for (let r = 0; r < s.length - 1; r++) {
|
|
2965
|
+
const l = T(s[r], i), a = T(s[r + 1], i).diff(l, e);
|
|
2957
2966
|
Math.abs(a) === 1 ? t = !0 : t = !1;
|
|
2958
2967
|
}
|
|
2959
2968
|
return t;
|
|
2960
2969
|
}
|
|
2961
|
-
function
|
|
2970
|
+
function gt({
|
|
2962
2971
|
values: s,
|
|
2963
2972
|
groupBy: e
|
|
2964
2973
|
}) {
|
|
2965
2974
|
const t = {};
|
|
2966
2975
|
return s.forEach((i) => {
|
|
2967
|
-
const
|
|
2976
|
+
const r = i.x, l = i.type, o = i.stacked, a = e === "all" ? `${r}-${l}-${o}` : `${l}-${o}`;
|
|
2968
2977
|
t[a] || (t[a] = []), t[a].push(i);
|
|
2969
2978
|
}), t;
|
|
2970
2979
|
}
|
|
@@ -2997,14 +3006,14 @@ const ke = {
|
|
|
2997
3006
|
fields: t,
|
|
2998
3007
|
options: i
|
|
2999
3008
|
}) => {
|
|
3000
|
-
const
|
|
3009
|
+
const r = G({
|
|
3001
3010
|
fieldName: s.x.name,
|
|
3002
3011
|
values: e,
|
|
3003
3012
|
fields: t
|
|
3004
3013
|
}), l = [];
|
|
3005
3014
|
s.y.forEach((d) => {
|
|
3006
|
-
Object.keys(
|
|
3007
|
-
const x =
|
|
3015
|
+
Object.keys(r).forEach((b) => {
|
|
3016
|
+
const x = r[b].label, y = r[b].entries;
|
|
3008
3017
|
if (d.label) {
|
|
3009
3018
|
const v = G({
|
|
3010
3019
|
fieldName: d.label,
|
|
@@ -3012,17 +3021,17 @@ const ke = {
|
|
|
3012
3021
|
fields: t
|
|
3013
3022
|
});
|
|
3014
3023
|
Object.keys(v).forEach((C) => {
|
|
3015
|
-
const w = v[C].entries, V = v[C].label,
|
|
3024
|
+
const w = v[C].entries, V = v[C].label, yt = L({
|
|
3016
3025
|
entries: w,
|
|
3017
3026
|
fields: t,
|
|
3018
3027
|
fieldName: d.name
|
|
3019
|
-
}),
|
|
3020
|
-
values:
|
|
3028
|
+
}), xt = j({
|
|
3029
|
+
values: yt,
|
|
3021
3030
|
operator: d.operator
|
|
3022
3031
|
});
|
|
3023
3032
|
l.push({
|
|
3024
3033
|
x: x || !1,
|
|
3025
|
-
value:
|
|
3034
|
+
value: xt,
|
|
3026
3035
|
type: V,
|
|
3027
3036
|
operator: d.operator,
|
|
3028
3037
|
stacked: d.stacked
|
|
@@ -3040,7 +3049,7 @@ const ke = {
|
|
|
3040
3049
|
l.push({
|
|
3041
3050
|
x: x || !1,
|
|
3042
3051
|
value: C,
|
|
3043
|
-
type:
|
|
3052
|
+
type: mt({
|
|
3044
3053
|
yAxis: d,
|
|
3045
3054
|
fields: t
|
|
3046
3055
|
}),
|
|
@@ -3071,7 +3080,7 @@ const ke = {
|
|
|
3071
3080
|
if (s.type === "line" && s.y_range && (m.yAxisOpts = {
|
|
3072
3081
|
mode: s.y_range
|
|
3073
3082
|
}, s.y_range === "auto")) {
|
|
3074
|
-
const { min: d, max: b } =
|
|
3083
|
+
const { min: d, max: b } = bt(h);
|
|
3075
3084
|
m.yAxisOpts.valueOpts = { min: d, max: b };
|
|
3076
3085
|
}
|
|
3077
3086
|
return m;
|
|
@@ -3085,7 +3094,7 @@ function L({
|
|
|
3085
3094
|
fieldName: e,
|
|
3086
3095
|
values: i,
|
|
3087
3096
|
fields: t
|
|
3088
|
-
})).map(({ value: i, label:
|
|
3097
|
+
})).map(({ value: i, label: r }) => r);
|
|
3089
3098
|
}
|
|
3090
3099
|
function j({
|
|
3091
3100
|
operator: s,
|
|
@@ -3113,7 +3122,7 @@ function j({
|
|
|
3113
3122
|
})
|
|
3114
3123
|
);
|
|
3115
3124
|
case "avg": {
|
|
3116
|
-
const i = e.reduce((
|
|
3125
|
+
const i = e.reduce((r, l) => r + l, 0) / e.length || 0;
|
|
3117
3126
|
return Y(i);
|
|
3118
3127
|
}
|
|
3119
3128
|
case "min":
|
|
@@ -3131,13 +3140,13 @@ function G({
|
|
|
3131
3140
|
values: t
|
|
3132
3141
|
}) {
|
|
3133
3142
|
const i = {};
|
|
3134
|
-
return t.forEach((
|
|
3143
|
+
return t.forEach((r) => {
|
|
3135
3144
|
const { value: l, label: o } = H({
|
|
3136
3145
|
fields: e,
|
|
3137
|
-
values:
|
|
3146
|
+
values: r,
|
|
3138
3147
|
fieldName: s
|
|
3139
3148
|
});
|
|
3140
|
-
i[l] || (i[l] = { label: o, entries: [] }), i[l].entries.push(
|
|
3149
|
+
i[l] || (i[l] = { label: o, entries: [] }), i[l].entries.push(r);
|
|
3141
3150
|
}), i;
|
|
3142
3151
|
}
|
|
3143
3152
|
function Oe(s) {
|
|
@@ -3147,98 +3156,98 @@ function Oe(s) {
|
|
|
3147
3156
|
e = e.concat(i.entries);
|
|
3148
3157
|
}), e;
|
|
3149
3158
|
}
|
|
3150
|
-
function
|
|
3159
|
+
function mt({
|
|
3151
3160
|
yAxis: s,
|
|
3152
3161
|
fields: e
|
|
3153
3162
|
}) {
|
|
3154
3163
|
const t = e[s.name];
|
|
3155
3164
|
return t != null && t.string ? t.string : s.name;
|
|
3156
3165
|
}
|
|
3157
|
-
function
|
|
3166
|
+
function bt(s, e = 0.1) {
|
|
3158
3167
|
if (s.length === 0)
|
|
3159
3168
|
throw new Error("The values array cannot be empty.");
|
|
3160
|
-
const t = s.map((o) => o.value), i = Math.min(...t),
|
|
3169
|
+
const t = s.map((o) => o.value), i = Math.min(...t), r = Math.max(...t), l = (r - i) * e;
|
|
3161
3170
|
return {
|
|
3162
3171
|
min: i - l,
|
|
3163
|
-
max:
|
|
3172
|
+
max: r + l
|
|
3164
3173
|
};
|
|
3165
3174
|
}
|
|
3166
3175
|
const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3167
3176
|
__proto__: null,
|
|
3168
3177
|
getAllObjectsInGroupedValues: Oe,
|
|
3169
|
-
getMinMax:
|
|
3178
|
+
getMinMax: bt,
|
|
3170
3179
|
getValueForOperator: j,
|
|
3171
3180
|
getValuesForYField: L,
|
|
3172
3181
|
getValuesGroupedByField: G,
|
|
3173
|
-
getYAxisFieldname:
|
|
3182
|
+
getYAxisFieldname: mt,
|
|
3174
3183
|
labelsForOperator: ke,
|
|
3175
3184
|
processGraphData: Pe
|
|
3176
3185
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3177
3186
|
export {
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3187
|
+
It as ActionButtons,
|
|
3188
|
+
te as Alert,
|
|
3189
|
+
Ot as Avatar,
|
|
3190
|
+
Rt as Binary,
|
|
3182
3191
|
it as Boolean,
|
|
3183
3192
|
A as Button,
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3193
|
+
zt as ButtonGroup,
|
|
3194
|
+
ae as Card,
|
|
3195
|
+
ie as Carousel,
|
|
3187
3196
|
R as Char,
|
|
3188
3197
|
at as CodeEditor,
|
|
3189
|
-
|
|
3190
|
-
|
|
3198
|
+
ne as ColorPicker,
|
|
3199
|
+
ee as Comments,
|
|
3191
3200
|
z as Container,
|
|
3192
3201
|
F as ContainerWidget,
|
|
3193
3202
|
Me as Dashboard,
|
|
3194
3203
|
ue as DashboardItem,
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3204
|
+
Nt as Date,
|
|
3205
|
+
At as DateTime,
|
|
3206
|
+
se as Email,
|
|
3198
3207
|
f as Field,
|
|
3199
3208
|
q as Float,
|
|
3200
|
-
|
|
3209
|
+
Yt as FloatTime,
|
|
3201
3210
|
Ee as Form,
|
|
3202
|
-
|
|
3203
|
-
|
|
3211
|
+
ut as Graph,
|
|
3212
|
+
_t as GraphAxis,
|
|
3204
3213
|
M as GraphChart,
|
|
3205
|
-
|
|
3214
|
+
ht as GraphIndicator,
|
|
3206
3215
|
he as GraphIndicatorField,
|
|
3207
3216
|
me as GraphXAxis,
|
|
3208
3217
|
ge as GraphYAxis,
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3218
|
+
Tt as Group,
|
|
3219
|
+
Dt as HTMLPreview,
|
|
3220
|
+
Gt as Icon,
|
|
3221
|
+
Lt as Image,
|
|
3222
|
+
Jt as Indicator,
|
|
3223
|
+
Vt as Integer,
|
|
3215
3224
|
K as JSONField,
|
|
3216
3225
|
Ye as Kanban,
|
|
3217
3226
|
De as KanbanCard,
|
|
3218
3227
|
st as Label,
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3228
|
+
St as Many2one,
|
|
3229
|
+
Et as Markdown,
|
|
3230
|
+
rt as MultiCheckbox,
|
|
3222
3231
|
et as NewLine,
|
|
3223
3232
|
B as Notebook,
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3233
|
+
nt as One2many,
|
|
3234
|
+
Wt as Page,
|
|
3235
|
+
jt as ProgressBar,
|
|
3227
3236
|
re as QRCode,
|
|
3228
|
-
|
|
3229
|
-
|
|
3237
|
+
Kt as Radio,
|
|
3238
|
+
Bt as Reference,
|
|
3230
3239
|
de as SearchFieldTypes,
|
|
3231
3240
|
je as SearchFilter,
|
|
3232
3241
|
S as Selection,
|
|
3233
|
-
|
|
3242
|
+
Mt as Separator,
|
|
3234
3243
|
N as Spinner,
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3244
|
+
Ut as Steps,
|
|
3245
|
+
Xt as Switch,
|
|
3246
|
+
Qt as Tag,
|
|
3247
|
+
Ht as Tags,
|
|
3239
3248
|
$ as Text,
|
|
3240
|
-
|
|
3241
|
-
|
|
3249
|
+
Zt as Time,
|
|
3250
|
+
qt as Timeline,
|
|
3242
3251
|
Ve as Tree,
|
|
3243
3252
|
k as Widget,
|
|
3244
3253
|
Re as graphFieldUtils,
|