@gisce/ooui 2.23.0-alpha.1 → 2.23.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ooui.es.js CHANGED
@@ -1,11 +1,11 @@
1
- var ge = Object.defineProperty;
2
- var me = (i, t, e) => t in i ? ge(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var n = (i, t, e) => (me(i, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { decode as be } from "html-entities";
5
- import { evaluateCondition as ye } from "@gisce/conscheck";
6
- import * as Y from "txml";
7
- import P from "moment";
8
- const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe = ({
1
+ var me = Object.defineProperty;
2
+ var be = (i, t, e) => t in i ? me(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var n = (i, t, e) => (be(i, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { decode as ye } from "html-entities";
5
+ import { evaluateCondition as pe } from "@gisce/conscheck";
6
+ import * as D from "txml";
7
+ import T from "moment";
8
+ const xe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), we = ({
9
9
  entry: i,
10
10
  values: t,
11
11
  fields: e
@@ -41,7 +41,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
41
41
  default:
42
42
  return !1;
43
43
  }
44
- }, b = (i) => be(i, { level: "xml" }), Q = ({
44
+ }, b = (i) => ye(i, { level: "xml" }), Q = ({
45
45
  fieldName: i,
46
46
  valueInObject: t,
47
47
  expectedValue: e,
@@ -61,19 +61,30 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
61
61
  modifiedExpectedValue: null,
62
62
  directOutcome: !1
63
63
  } : (r.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject = r.modifiedValueInObject === void 0 ? !1 : r.modifiedValueInObject, r.modifiedValueInObject = r.modifiedValueInObject === null ? !1 : r.modifiedValueInObject), s[i].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
64
- }, we = ({
64
+ }, ve = ({
65
65
  attrs: i,
66
66
  values: t,
67
67
  fields: e,
68
68
  widgetType: s
69
69
  }) => {
70
- const d = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(d), h = JSON.parse(_), u = {};
70
+ const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(u), h = JSON.parse(_), d = {};
71
71
  for (const g of Object.keys(h)) {
72
- const p = h[g].map((y) => xe({ entry: y, values: t, fields: e })).every((y) => y);
73
- p ? u[g] = !0 : g === "readonly" && !p && s === "button" && (u[g] = !1);
72
+ const p = h[g].map((y) => we({ entry: y, values: t, fields: e })).every((y) => y);
73
+ p ? d[g] = !0 : g === "readonly" && !p && s === "button" && (d[g] = !1);
74
74
  }
75
- return u;
76
- }, ve = ({
75
+ return d;
76
+ }, X = (i) => {
77
+ if (i === void 0)
78
+ return {};
79
+ if (typeof i == "string")
80
+ try {
81
+ return JSON.parse(i.replace(/'/g, '"'));
82
+ } catch {
83
+ return console.error("Error parsing widget_props"), {};
84
+ }
85
+ else
86
+ return i;
87
+ }, Fe = ({
77
88
  attrs: i,
78
89
  values: t,
79
90
  fields: e,
@@ -84,21 +95,21 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
84
95
  r.replace(/'/g, '"')
85
96
  ), l = {};
86
97
  for (const o of Object.keys(a)) {
87
- const d = ye({
98
+ const u = pe({
88
99
  object: t,
89
100
  condition: a[o],
90
101
  evaluateFieldComparison: ({
91
102
  fieldName: _,
92
103
  valueInObject: h,
93
- expectedValue: u
104
+ expectedValue: d
94
105
  }) => Q({
95
106
  fieldName: _,
96
107
  valueInObject: h,
97
- expectedValue: u,
108
+ expectedValue: d,
98
109
  fields: e
99
110
  })
100
111
  });
101
- d ? l[o] = !0 : o === "readonly" && !d && s === "button" && (l[o] = !1);
112
+ u ? l[o] = !0 : o === "readonly" && !u && s === "button" && (l[o] = !1);
102
113
  }
103
114
  return l;
104
115
  } catch (r) {
@@ -106,7 +117,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
106
117
  "Error parsing new json_attrs. Original string: " + i
107
118
  ) : r;
108
119
  }
109
- }, Fe = ({
120
+ }, Ce = ({
110
121
  tagAttributes: i,
111
122
  values: t,
112
123
  fields: e,
@@ -114,14 +125,14 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
114
125
  fallbackMode: r = !0
115
126
  }) => {
116
127
  let a = {}, l = {};
117
- if (i.attrs && (l = we({
128
+ if (i.attrs && (l = ve({
118
129
  attrs: i.attrs,
119
130
  values: t,
120
131
  fields: e,
121
132
  widgetType: s
122
133
  })), i.json_attrs)
123
134
  try {
124
- a = ve({
135
+ a = Fe({
125
136
  attrs: i.json_attrs,
126
137
  values: t,
127
138
  fields: e,
@@ -141,7 +152,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
141
152
  attrs: void 0,
142
153
  json_attrs: void 0
143
154
  };
144
- }, D = (i) => i === 1 || i === "1" || i === !0 || i === "True" || i === "true", k = class k {
155
+ }, W = (i) => i === 1 || i === "1" || i === !0 || i === "True" || i === "true", k = class k {
145
156
  constructor(t) {
146
157
  /**
147
158
  * Determines if widget is read only (default is undefined)
@@ -177,20 +188,7 @@ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
177
188
  * Base type of the field
178
189
  */
179
190
  n(this, "_fieldType", "");
180
- if (this._colspan = k._defaultColspan, this._invisible = !1, t) {
181
- if (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = D(t.readonly)), t.invisible && (t.invisible === 1 || t.invisible === "1" || t.invisible === !0) && (this._invisible = !0), t.type && (this._type = t.type), t.context && (this._context = t.context), t.domain && (typeof t.domain != "string" ? this._domain = b(JSON.stringify(t.domain)) : this._domain = b(t.domain)), t.type && (this._fieldType = t.fieldsWidgetType), t.widget_props)
182
- if (typeof t.widget_props == "string")
183
- try {
184
- this._parsedWidgetProps = JSON.parse(
185
- t.widget_props.replace(/'/g, '"')
186
- );
187
- } catch {
188
- console.error("Error parsing widget_props");
189
- }
190
- else
191
- this._parsedWidgetProps = t.widget_props;
192
- t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function);
193
- }
191
+ this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = W(t.readonly)), t.invisible && (t.invisible === 1 || t.invisible === "1" || t.invisible === !0) && (this._invisible = !0), t.type && (this._type = t.type), t.context && (this._context = t.context), t.domain && (typeof t.domain != "string" ? this._domain = b(JSON.stringify(t.domain)) : this._domain = b(t.domain)), t.type && (this._fieldType = t.fieldsWidgetType), t.widget_props && (this._parsedWidgetProps = X(t.widget_props)), t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function));
194
192
  }
195
193
  static get defaultColspan() {
196
194
  return k._defaultColspan;
@@ -308,7 +306,7 @@ class f extends C {
308
306
  */
309
307
  n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
310
308
  n(this, "_autoRefresh", !1);
311
- this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(e.help)), e.nolabel && (e.nolabel === "1" || typeof e.nolabel == "boolean" && e.nolabel === !0) && (this._nolabel = !0), e.required && (e.required === "1" || e.required === !0 || e.required === "True") && (this._required = !0), e.sum && (this._sum = b(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = pe(e.help_inline)), e.autorefresh && (this.autoRefresh = D(e.autorefresh)));
309
+ this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(e.help)), e.nolabel && (e.nolabel === "1" || typeof e.nolabel == "boolean" && e.nolabel === !0) && (this._nolabel = !0), e.required && (e.required === "1" || e.required === !0 || e.required === "True") && (this._required = !0), e.sum && (this._sum = b(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = xe(e.help_inline)), e.autorefresh && (this.autoRefresh = W(e.autorefresh)));
312
310
  }
313
311
  get id() {
314
312
  return this._id;
@@ -358,6 +356,12 @@ class f extends C {
358
356
  set sum(e) {
359
357
  this._sum = e;
360
358
  }
359
+ get suffix() {
360
+ return this._parsedWidgetProps.suffix || "";
361
+ }
362
+ get prefix() {
363
+ return this._parsedWidgetProps.prefix || "";
364
+ }
361
365
  get selectionValues() {
362
366
  return this._selectionValues;
363
367
  }
@@ -384,14 +388,14 @@ class f extends C {
384
388
  return this._id === e ? this : null;
385
389
  }
386
390
  }
387
- class Ce extends f {
391
+ class ke extends f {
388
392
  }
389
- class X extends C {
393
+ class U extends C {
390
394
  findById(t) {
391
395
  return null;
392
396
  }
393
397
  }
394
- class U extends f {
398
+ class K extends f {
395
399
  constructor(e) {
396
400
  super({ ...e, nolabel: !0 });
397
401
  /**
@@ -447,7 +451,7 @@ class U extends f {
447
451
  this._fieldForLabel = e;
448
452
  }
449
453
  }
450
- class z {
454
+ class V {
451
455
  constructor(t = 4, e = 6, s = !1, r = void 0) {
452
456
  /**
453
457
  * Number of columns the container is divided
@@ -514,13 +518,13 @@ class z {
514
518
  }
515
519
  addWidget(t, e) {
516
520
  const s = [], r = e ? e.addLabel : !0;
517
- if (t instanceof X) {
521
+ if (t instanceof U) {
518
522
  this._rows.push([]), this._index++;
519
523
  return;
520
524
  }
521
525
  if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof f && !t.nolabel) {
522
526
  t.colspan > 1 && (t.colspan -= 1);
523
- const l = new U({
527
+ const l = new K({
524
528
  name: t.id + "_label",
525
529
  string: t.label,
526
530
  invisible: t.invisible,
@@ -571,7 +575,7 @@ const O = class O extends C {
571
575
  * Container label
572
576
  */
573
577
  n(this, "_label", "");
574
- this._container = new z(
578
+ this._container = new V(
575
579
  e == null ? void 0 : e.col,
576
580
  O._defaultColspan,
577
581
  this.readOnly,
@@ -623,19 +627,19 @@ const O = class O extends C {
623
627
  }
624
628
  };
625
629
  n(O, "_defaultColspan", 6);
626
- let v = O;
627
- const T = class T extends v {
630
+ let w = O;
631
+ const P = class P extends w {
628
632
  constructor(e) {
629
633
  super(e);
630
634
  n(this, "_tabPosition", "top");
631
635
  n(this, "_pages", []);
632
- this.colspan = T._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
636
+ this.colspan = P._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
633
637
  }
634
638
  static get defaultColspan() {
635
- return T._defaultColspan;
639
+ return P._defaultColspan;
636
640
  }
637
641
  static set defaultColspan(e) {
638
- T._defaultColspan = e;
642
+ P._defaultColspan = e;
639
643
  }
640
644
  get tabPosition() {
641
645
  return this._tabPosition;
@@ -647,9 +651,9 @@ const T = class T extends v {
647
651
  return [].concat.apply([], this._container.rows);
648
652
  }
649
653
  };
650
- n(T, "_defaultColspan", 3);
651
- let M = T;
652
- class B extends v {
654
+ n(P, "_defaultColspan", 3);
655
+ let M = P;
656
+ class B extends w {
653
657
  constructor(e) {
654
658
  super(e);
655
659
  n(this, "_loading", !1);
@@ -662,7 +666,7 @@ class B extends v {
662
666
  this._loading = e;
663
667
  }
664
668
  }
665
- class ke extends B {
669
+ class Oe extends B {
666
670
  constructor(e) {
667
671
  super(e);
668
672
  n(this, "_icon", null);
@@ -675,7 +679,7 @@ class ke extends B {
675
679
  this._icon = e;
676
680
  }
677
681
  }
678
- class Oe extends B {
682
+ class Pe extends B {
679
683
  constructor(e) {
680
684
  super(e);
681
685
  n(this, "_icon", null);
@@ -688,7 +692,7 @@ class Oe extends B {
688
692
  this._icon = e;
689
693
  }
690
694
  }
691
- class K extends f {
695
+ class Z extends f {
692
696
  constructor(e) {
693
697
  super({
694
698
  ...e,
@@ -760,7 +764,7 @@ class K extends f {
760
764
  this._danger = e;
761
765
  }
762
766
  }
763
- class Te extends v {
767
+ class Te extends w {
764
768
  constructor(e) {
765
769
  super(e);
766
770
  n(this, "_defaultName", "");
@@ -898,7 +902,7 @@ class L extends f {
898
902
  this._translatable = e;
899
903
  }
900
904
  }
901
- class W extends f {
905
+ class E extends f {
902
906
  constructor(e) {
903
907
  super(e);
904
908
  /**
@@ -914,7 +918,7 @@ class W extends f {
914
918
  this._size = e;
915
919
  }
916
920
  }
917
- class Pe extends f {
921
+ class We extends f {
918
922
  constructor(e) {
919
923
  super(e);
920
924
  /**
@@ -940,14 +944,14 @@ class Pe extends f {
940
944
  this._relation = e;
941
945
  }
942
946
  }
943
- class We extends L {
947
+ class Ee extends L {
944
948
  }
945
- class Z extends f {
949
+ class ee extends f {
946
950
  constructor(t) {
947
951
  super(t);
948
952
  }
949
953
  }
950
- class Ee extends f {
954
+ class Ie extends f {
951
955
  constructor(t) {
952
956
  super(t);
953
957
  }
@@ -985,23 +989,23 @@ class G extends f {
985
989
  this._decimalDigits = e;
986
990
  }
987
991
  }
988
- class Ie extends G {
992
+ class Se extends G {
989
993
  }
990
- class Se extends f {
994
+ class ze extends f {
991
995
  }
992
- class ze extends G {
996
+ class Ve extends G {
993
997
  }
994
- class Ve extends f {
998
+ class Ye extends f {
995
999
  constructor(t) {
996
1000
  super(t);
997
1001
  }
998
1002
  }
999
- class Ye extends f {
1003
+ class De extends f {
1000
1004
  constructor(t) {
1001
1005
  super(t);
1002
1006
  }
1003
1007
  }
1004
- class ee extends f {
1008
+ class te extends f {
1005
1009
  constructor(e) {
1006
1010
  super(e);
1007
1011
  /**
@@ -1095,7 +1099,7 @@ class ee extends f {
1095
1099
  this._infinite = e;
1096
1100
  }
1097
1101
  }
1098
- class De extends C {
1102
+ class je extends C {
1099
1103
  constructor(e) {
1100
1104
  super(e);
1101
1105
  /**
@@ -1121,9 +1125,9 @@ class De extends C {
1121
1125
  return null;
1122
1126
  }
1123
1127
  }
1124
- class je extends W {
1128
+ class Me extends E {
1125
1129
  }
1126
- class Me extends f {
1130
+ class Ne extends f {
1127
1131
  constructor(e) {
1128
1132
  super(e);
1129
1133
  /**
@@ -1139,18 +1143,18 @@ class Me extends f {
1139
1143
  this._filenameField = e;
1140
1144
  }
1141
1145
  }
1142
- class Ne extends f {
1146
+ class Ae extends f {
1143
1147
  get showControls() {
1144
1148
  var t;
1145
1149
  return ((t = this.parsedWidgetProps) == null ? void 0 : t.showControls) ?? !0;
1146
1150
  }
1147
1151
  }
1148
- class Ae extends f {
1152
+ class Be extends f {
1149
1153
  constructor(t) {
1150
1154
  super(t);
1151
1155
  }
1152
1156
  }
1153
- class Be extends ee {
1157
+ class Le extends te {
1154
1158
  constructor(e) {
1155
1159
  super(e);
1156
1160
  /**
@@ -1182,7 +1186,7 @@ class Be extends ee {
1182
1186
  return this.parsedWidgetProps.colorField;
1183
1187
  }
1184
1188
  }
1185
- class Le extends W {
1189
+ class Ge extends E {
1186
1190
  constructor(e) {
1187
1191
  super(e);
1188
1192
  n(this, "_nolabel", !0);
@@ -1232,7 +1236,7 @@ class Le extends W {
1232
1236
  this._height = e;
1233
1237
  }
1234
1238
  }
1235
- class te extends f {
1239
+ class ie extends f {
1236
1240
  constructor(e) {
1237
1241
  super(e);
1238
1242
  /**
@@ -1285,14 +1289,14 @@ class te extends f {
1285
1289
  this._columns = e;
1286
1290
  }
1287
1291
  }
1288
- class Ge extends te {
1292
+ class Re extends ie {
1289
1293
  }
1290
- class Re extends W {
1294
+ class $e extends E {
1291
1295
  get colors() {
1292
1296
  return this._parsedWidgetProps.colors || {};
1293
1297
  }
1294
1298
  }
1295
- class $e extends W {
1299
+ class qe extends E {
1296
1300
  constructor(e) {
1297
1301
  super(e);
1298
1302
  /**
@@ -1308,9 +1312,9 @@ class $e extends W {
1308
1312
  this._direction = e;
1309
1313
  }
1310
1314
  }
1311
- class qe extends Z {
1315
+ class Je extends ee {
1312
1316
  }
1313
- class Je extends f {
1317
+ class He extends f {
1314
1318
  constructor(e) {
1315
1319
  super(e);
1316
1320
  /**
@@ -1340,7 +1344,7 @@ class Je extends f {
1340
1344
  this._lastStep = e;
1341
1345
  }
1342
1346
  }
1343
- class ie extends L {
1347
+ class se extends L {
1344
1348
  constructor(e) {
1345
1349
  super(e);
1346
1350
  n(this, "_lang", null);
@@ -1353,12 +1357,12 @@ class ie extends L {
1353
1357
  this._lang = e;
1354
1358
  }
1355
1359
  }
1356
- class He extends f {
1360
+ class Qe extends f {
1357
1361
  constructor(t) {
1358
1362
  super(t);
1359
1363
  }
1360
1364
  }
1361
- class Qe extends v {
1365
+ class Xe extends w {
1362
1366
  constructor(e) {
1363
1367
  super(e);
1364
1368
  /**
@@ -1398,7 +1402,7 @@ class Qe extends v {
1398
1402
  return this._container.rows.flat().filter((e) => !e.invisible);
1399
1403
  }
1400
1404
  }
1401
- class Xe extends f {
1405
+ class Ue extends f {
1402
1406
  constructor(e) {
1403
1407
  super(e);
1404
1408
  /**
@@ -1417,13 +1421,13 @@ class Xe extends f {
1417
1421
  this._height = e;
1418
1422
  }
1419
1423
  }
1420
- class J extends ie {
1424
+ class J extends se {
1421
1425
  constructor() {
1422
1426
  super(...arguments);
1423
1427
  n(this, "_lang", "json");
1424
1428
  }
1425
1429
  }
1426
- class Ue extends f {
1430
+ class Ke extends f {
1427
1431
  constructor(e) {
1428
1432
  super(e);
1429
1433
  n(this, "_multi", !1);
@@ -1443,6 +1447,22 @@ class Ue extends f {
1443
1447
  this._size = e;
1444
1448
  }
1445
1449
  }
1450
+ class Ze extends w {
1451
+ constructor(e) {
1452
+ super(e);
1453
+ n(this, "_autoPlay", !0);
1454
+ e && "auto_play" in e && (this._autoPlay = W(e.auto_play));
1455
+ }
1456
+ get autoPlay() {
1457
+ return this._autoPlay;
1458
+ }
1459
+ set autoPlay(e) {
1460
+ this._autoPlay = e;
1461
+ }
1462
+ get items() {
1463
+ return this._container.rows.flat().filter((e) => !e.invisible);
1464
+ }
1465
+ }
1446
1466
  class R {
1447
1467
  constructor() {
1448
1468
  /**
@@ -1456,13 +1476,13 @@ class R {
1456
1476
  this._widgetClass = M;
1457
1477
  break;
1458
1478
  case "page":
1459
- this._widgetClass = ke;
1479
+ this._widgetClass = Oe;
1460
1480
  break;
1461
1481
  case "group":
1462
- this._widgetClass = Oe;
1482
+ this._widgetClass = Pe;
1463
1483
  break;
1464
1484
  case "label":
1465
- this._widgetClass = U;
1485
+ this._widgetClass = K;
1466
1486
  break;
1467
1487
  case "char":
1468
1488
  this._widgetClass = q;
@@ -1471,111 +1491,111 @@ class R {
1471
1491
  this._widgetClass = L;
1472
1492
  break;
1473
1493
  case "button":
1474
- this._widgetClass = K;
1494
+ this._widgetClass = Z;
1475
1495
  break;
1476
1496
  case "buttonGroup":
1477
1497
  this._widgetClass = Te;
1478
1498
  break;
1479
1499
  case "selection":
1480
- this._widgetClass = W;
1500
+ this._widgetClass = E;
1481
1501
  break;
1482
1502
  case "many2one":
1483
- this._widgetClass = Pe;
1503
+ this._widgetClass = We;
1484
1504
  break;
1485
1505
  case "boolean":
1486
- this._widgetClass = Z;
1506
+ this._widgetClass = ee;
1487
1507
  break;
1488
1508
  case "integer":
1489
- this._widgetClass = Ee;
1509
+ this._widgetClass = Ie;
1490
1510
  break;
1491
1511
  case "float":
1492
1512
  this._widgetClass = G;
1493
1513
  break;
1494
1514
  case "float_time":
1495
- this._widgetClass = Ie;
1515
+ this._widgetClass = Se;
1496
1516
  break;
1497
1517
  case "date":
1498
- this._widgetClass = Ve;
1518
+ this._widgetClass = Ye;
1499
1519
  break;
1500
1520
  case "datetime":
1501
- this._widgetClass = Ye;
1521
+ this._widgetClass = De;
1502
1522
  break;
1503
1523
  case "progressbar":
1504
- this._widgetClass = ze;
1524
+ this._widgetClass = Ve;
1505
1525
  break;
1506
1526
  case "markdown":
1507
- this._widgetClass = We;
1527
+ this._widgetClass = Ee;
1508
1528
  break;
1509
1529
  case "many2many":
1510
1530
  case "one2many":
1511
1531
  case "one2many_list":
1512
- this._widgetClass = ee;
1532
+ this._widgetClass = te;
1513
1533
  break;
1514
1534
  case "newline":
1515
- this._widgetClass = X;
1535
+ this._widgetClass = U;
1516
1536
  break;
1517
1537
  case "separator":
1518
- this._widgetClass = De;
1538
+ this._widgetClass = je;
1519
1539
  break;
1520
1540
  case "url":
1521
1541
  this._widgetClass = q;
1522
1542
  break;
1523
1543
  case "email":
1524
- this._widgetClass = Ue;
1544
+ this._widgetClass = Ke;
1525
1545
  break;
1526
1546
  case "reference":
1527
- this._widgetClass = je;
1547
+ this._widgetClass = Me;
1528
1548
  break;
1529
1549
  case "binary":
1530
- this._widgetClass = Me;
1550
+ this._widgetClass = Ne;
1531
1551
  break;
1532
1552
  case "image":
1533
- this._widgetClass = Ne;
1553
+ this._widgetClass = Ae;
1534
1554
  break;
1535
1555
  case "fiber_grid":
1536
- this._widgetClass = Ae;
1556
+ this._widgetClass = Be;
1537
1557
  break;
1538
1558
  case "timeline":
1539
- this._widgetClass = Be;
1559
+ this._widgetClass = Le;
1540
1560
  break;
1541
1561
  case "indicator":
1542
- this._widgetClass = Le;
1562
+ this._widgetClass = Ge;
1543
1563
  break;
1544
1564
  case "tags":
1545
- this._widgetClass = Ge;
1565
+ this._widgetClass = Re;
1546
1566
  break;
1547
1567
  case "tag":
1548
- this._widgetClass = Re;
1568
+ this._widgetClass = $e;
1549
1569
  break;
1550
1570
  case "avatar":
1551
- this._widgetClass = Ce;
1571
+ this._widgetClass = ke;
1552
1572
  break;
1553
1573
  case "radio":
1554
- this._widgetClass = $e;
1574
+ this._widgetClass = qe;
1555
1575
  break;
1556
1576
  case "multicheckbox":
1557
- this._widgetClass = te;
1577
+ this._widgetClass = ie;
1558
1578
  break;
1559
1579
  case "switch":
1560
- this._widgetClass = qe;
1580
+ this._widgetClass = Je;
1561
1581
  break;
1562
1582
  case "steps":
1563
- this._widgetClass = Je;
1583
+ this._widgetClass = He;
1564
1584
  break;
1565
1585
  case "codeeditor":
1566
- this._widgetClass = ie;
1586
+ this._widgetClass = se;
1567
1587
  break;
1568
1588
  case "time":
1569
- this._widgetClass = He;
1589
+ this._widgetClass = Qe;
1570
1590
  break;
1571
1591
  case "html_preview":
1572
- this._widgetClass = Se;
1592
+ this._widgetClass = ze;
1573
1593
  break;
1574
1594
  case "alert":
1575
- this._widgetClass = Qe;
1595
+ this._widgetClass = Xe;
1576
1596
  break;
1577
1597
  case "comments_timeline":
1578
- this._widgetClass = Xe;
1598
+ this._widgetClass = Ue;
1579
1599
  break;
1580
1600
  case "json":
1581
1601
  this._widgetClass = J;
@@ -1586,6 +1606,9 @@ class R {
1586
1606
  case "spinner":
1587
1607
  this._widgetClass = B;
1588
1608
  break;
1609
+ case "carousel":
1610
+ this._widgetClass = Ze;
1611
+ break;
1589
1612
  }
1590
1613
  }
1591
1614
  createWidget(t, e) {
@@ -1607,7 +1630,7 @@ class R {
1607
1630
  }
1608
1631
  }
1609
1632
  }
1610
- const Ke = ({
1633
+ const et = ({
1611
1634
  fieldName: i,
1612
1635
  values: t,
1613
1636
  fields: e
@@ -1621,18 +1644,18 @@ const Ke = ({
1621
1644
  const r = {}, a = {};
1622
1645
  for (const o of Object.keys(s))
1623
1646
  if (t.state === o) {
1624
- const d = s[o];
1625
- for (const _ of d) {
1626
- const [h, u] = _;
1627
- a[h] || (a[h] = []), a[h].push(u);
1647
+ const u = s[o];
1648
+ for (const _ of u) {
1649
+ const [h, d] = _;
1650
+ a[h] || (a[h] = []), a[h].push(d);
1628
1651
  }
1629
1652
  }
1630
1653
  for (const o of Object.keys(a)) {
1631
- const d = a[o];
1632
- r[o] = d.some((_) => _);
1654
+ const u = a[o];
1655
+ r[o] = u.some((_) => _);
1633
1656
  }
1634
1657
  return r;
1635
- }, Ze = ({
1658
+ }, tt = ({
1636
1659
  states: i,
1637
1660
  values: t
1638
1661
  }) => {
@@ -1641,7 +1664,7 @@ const Ke = ({
1641
1664
  const e = i.split(",");
1642
1665
  return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
1643
1666
  };
1644
- function et({
1667
+ function it({
1645
1668
  values: i = {},
1646
1669
  fieldName: t,
1647
1670
  fields: e = {}
@@ -1650,7 +1673,7 @@ function et({
1650
1673
  const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
1651
1674
  return s === "many2one" ? i[t] ? i[t][0] || null : !1 : s === "one2many" || s === "many2many" ? i[t].map((a) => a.id) : i != null && i[t] ? i == null ? void 0 : i[t] : t.includes("'") ? t : parseInt(t);
1652
1675
  }
1653
- const se = ({
1676
+ const ne = ({
1654
1677
  context: i,
1655
1678
  values: t,
1656
1679
  fields: e
@@ -1658,18 +1681,18 @@ const se = ({
1658
1681
  try {
1659
1682
  if (!i)
1660
1683
  return;
1661
- if (re(i) || typeof i != "string")
1684
+ if (ae(i) || typeof i != "string")
1662
1685
  return i;
1663
- const s = ne(i);
1686
+ const s = re(i);
1664
1687
  if (s !== null)
1665
1688
  return s;
1666
1689
  if (i.trim().length === 0)
1667
1690
  return;
1668
- const u = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((c) => c.split(":")), g = {};
1669
- return u.forEach((c) => {
1691
+ const d = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((c) => c.split(":")), g = {};
1692
+ return d.forEach((c) => {
1670
1693
  const m = c[1];
1671
1694
  if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
1672
- const p = et({
1695
+ const p = it({
1673
1696
  values: t,
1674
1697
  fields: e,
1675
1698
  fieldName: m === "active_id" ? "id" : m
@@ -1684,46 +1707,46 @@ const se = ({
1684
1707
  } catch {
1685
1708
  return;
1686
1709
  }
1687
- }, kt = (i) => {
1710
+ }, Pt = (i) => {
1688
1711
  const t = [];
1689
1712
  try {
1690
- return !i || re(i) || typeof i != "string" ? t : ne(i) !== null ? [] : (i.trim().length === 0 || i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((u) => u.split(":")).forEach((u) => {
1691
- !u[1].includes("'") && u[1] !== "true" && u[1] !== "false" && t.push(u[1].replace(/'/g, ""));
1713
+ return !i || ae(i) || typeof i != "string" ? t : re(i) !== null ? [] : (i.trim().length === 0 || i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
1714
+ !d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
1692
1715
  }), t);
1693
1716
  } catch {
1694
1717
  }
1695
1718
  return t;
1696
1719
  };
1697
- function ne(i) {
1720
+ function re(i) {
1698
1721
  try {
1699
1722
  return JSON.parse(i.replace(/'/g, '"'));
1700
1723
  } catch {
1701
1724
  return null;
1702
1725
  }
1703
1726
  }
1704
- function re(i) {
1727
+ function ae(i) {
1705
1728
  return typeof i == "object" && i !== null && typeof i != "string";
1706
1729
  }
1707
- const tt = (i) => {
1730
+ const st = (i) => {
1708
1731
  const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
1709
1732
  return {
1710
1733
  method: e,
1711
1734
  args: r
1712
1735
  };
1713
1736
  };
1714
- function it(i) {
1737
+ function nt(i) {
1715
1738
  const t = [];
1716
1739
  function e(s) {
1717
1740
  const r = [];
1718
1741
  for (const a of s)
1719
- a instanceof v ? e(a._container.rows.flat()) : r.push(a);
1742
+ a instanceof w ? e(a._container.rows.flat()) : r.push(a);
1720
1743
  r.length > 0 && t.push(r);
1721
1744
  }
1722
1745
  for (const s of i)
1723
1746
  e(s);
1724
1747
  return t.flat();
1725
1748
  }
1726
- class Ot {
1749
+ class Tt {
1727
1750
  constructor(t, e = 4) {
1728
1751
  /**
1729
1752
  * Object containing fields specification of the form.
@@ -1778,7 +1801,7 @@ class Ot {
1778
1801
  * Context for each field in the form
1779
1802
  */
1780
1803
  n(this, "_contextForFields", {});
1781
- this._fields = t, this._container = new z(e, 6, !1, "root");
1804
+ this._fields = t, this._container = new V(e, 6, !1, "root");
1782
1805
  }
1783
1806
  get fields() {
1784
1807
  return this._fields;
@@ -1833,17 +1856,17 @@ class Ot {
1833
1856
  }
1834
1857
  parse(t, e) {
1835
1858
  var o;
1836
- const { values: s = {}, readOnly: r = !1 } = e || {}, a = Y.parse(t).filter((d) => d.tagName === "form")[0];
1859
+ const { values: s = {}, readOnly: r = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
1837
1860
  this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = s.id ? { active_id: s.id, active_ids: [s.id] } : {}, this._invisibleFields = [], this.parseNode({
1838
1861
  fields: a.children,
1839
1862
  container: this._container,
1840
1863
  values: s
1841
1864
  });
1842
- const l = it(this._container._rows);
1843
- l.forEach((d) => {
1844
- const _ = d;
1845
- _._id && _._context && (this._contextForFields[_._id] = d._context);
1846
- }), this._autorefreshableFields = l.filter((d) => d instanceof f && d.autoRefresh).map((d) => d._id);
1865
+ const l = nt(this._container._rows);
1866
+ l.forEach((u) => {
1867
+ const _ = u;
1868
+ _._id && _._context && (this._contextForFields[_._id] = u._context);
1869
+ }), this._autorefreshableFields = l.filter((u) => u instanceof f && u.autoRefresh).map((u) => u._id);
1847
1870
  }
1848
1871
  parseNode({
1849
1872
  fields: t,
@@ -1852,53 +1875,56 @@ class Ot {
1852
1875
  }) {
1853
1876
  const r = new R();
1854
1877
  t.filter((a) => typeof a == "object").forEach((a) => {
1855
- var x, F;
1856
- const { tagName: l, attributes: o, children: d } = a;
1878
+ var v, F;
1879
+ const { tagName: l, attributes: o, children: u } = a;
1857
1880
  let _ = l, h = o;
1858
1881
  if (l === "field") {
1859
- const { name: w, widget: E } = o;
1860
- if (E)
1861
- _ = E;
1862
- else if (w) {
1863
- if (!this._fields[w])
1882
+ const { name: x, widget: I } = o;
1883
+ if (I)
1884
+ _ = I;
1885
+ else if (x) {
1886
+ if (!this._fields[x])
1864
1887
  throw new Error(
1865
- `Field ${w} doesn't exist in fields defintion`
1888
+ `Field ${x} doesn't exist in fields defintion`
1866
1889
  );
1867
- _ = this._fields[w].type;
1890
+ _ = this._fields[x].type, o.widget_props = {
1891
+ ...X(o.widget_props),
1892
+ ...this._fields[x].widget_props || {}
1893
+ };
1868
1894
  }
1869
1895
  h = {
1870
- ...this._fields[w],
1896
+ ...this._fields[x],
1871
1897
  ...o,
1872
- fieldsWidgetType: this._fields[w].type
1898
+ fieldsWidgetType: this._fields[x].type
1873
1899
  };
1874
1900
  }
1875
- const u = Fe({
1901
+ const d = Ce({
1876
1902
  tagAttributes: h,
1877
1903
  values: s,
1878
1904
  fields: this._fields,
1879
1905
  widgetType: l
1880
1906
  });
1881
1907
  let g;
1882
- l === "button" && h.states ? g = Ze({
1908
+ l === "button" && h.states ? g = tt({
1883
1909
  states: h.states,
1884
1910
  values: s
1885
- }) : g = Ke({
1911
+ }) : g = et({
1886
1912
  fieldName: h.name,
1887
1913
  values: s,
1888
1914
  fields: this._fields
1889
1915
  });
1890
- const c = se({
1891
- context: h.context || ((x = this._fields[h.name]) == null ? void 0 : x.context),
1916
+ const c = ne({
1917
+ context: h.context || ((v = this._fields[h.name]) == null ? void 0 : v.context),
1892
1918
  values: s,
1893
1919
  fields: this._fields
1894
1920
  });
1895
- h.on_change && (this._onChangeFields[h.name] = tt(
1921
+ h.on_change && (this._onChangeFields[h.name] = st(
1896
1922
  h.on_change
1897
1923
  ));
1898
1924
  let m;
1899
1925
  H(h.domain) ? m = h.domain : H((F = this._fields[h.name]) == null ? void 0 : F.domain) && (m = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
1900
1926
  const p = {
1901
- ...u,
1927
+ ...d,
1902
1928
  ...g,
1903
1929
  context: c,
1904
1930
  domain: m,
@@ -1906,11 +1932,11 @@ class Ot {
1906
1932
  };
1907
1933
  e.readOnly && (p.readonly = !0);
1908
1934
  const y = r.createWidget(_, p);
1909
- y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof v && this.parseNode({
1910
- fields: d,
1935
+ y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof w && this.parseNode({
1936
+ fields: u,
1911
1937
  container: y.container,
1912
1938
  values: s
1913
- }), y instanceof K && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
1939
+ }), y instanceof Z && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
1914
1940
  });
1915
1941
  }
1916
1942
  /**
@@ -1924,7 +1950,7 @@ class Ot {
1924
1950
  function H(i) {
1925
1951
  return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
1926
1952
  }
1927
- class Tt {
1953
+ class Wt {
1928
1954
  constructor(t) {
1929
1955
  /**
1930
1956
  * Object containing fields specification of the form.
@@ -1996,37 +2022,37 @@ class Tt {
1996
2022
  this._infinite = t;
1997
2023
  }
1998
2024
  parse(t) {
1999
- const e = Y.parse(t).filter((r) => r.tagName === "tree")[0];
2025
+ const e = D.parse(t).filter((r) => r.tagName === "tree")[0];
2000
2026
  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, this._infinite = e.attributes.infinite || !1;
2001
2027
  const s = new R();
2002
2028
  e.children.forEach((r) => {
2003
2029
  const { tagName: a, attributes: l } = r;
2004
2030
  let o = null;
2005
2031
  if (a === "field") {
2006
- const { name: d, widget: _ } = l;
2032
+ const { name: u, widget: _ } = l;
2007
2033
  let h = l;
2008
- if (d) {
2009
- if (!this._fields[d])
2010
- throw new Error(`Field ${d} doesn't exist in fields defintion`);
2011
- const u = this._fields[d];
2012
- o = u.type, (Array.isArray(u == null ? void 0 : u.domain) && (u == null ? void 0 : u.domain.length) === 0 || (u == null ? void 0 : u.domain) === !1) && l.domain && l.domain.length > 0 && delete u.domain;
2013
- const g = se({
2014
- context: l.context || u.context,
2034
+ if (u) {
2035
+ if (!this._fields[u])
2036
+ throw new Error(`Field ${u} doesn't exist in fields defintion`);
2037
+ const d = this._fields[u];
2038
+ 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;
2039
+ const g = ne({
2040
+ context: l.context || d.context,
2015
2041
  values: {},
2016
2042
  fields: this._fields
2017
2043
  });
2018
2044
  h = {
2019
- ...u,
2045
+ ...d,
2020
2046
  ...l,
2021
- fieldsWidgetType: u == null ? void 0 : u.type,
2047
+ fieldsWidgetType: d == null ? void 0 : d.type,
2022
2048
  context: g
2023
- }, this._contextForFields[d] = g;
2049
+ }, this._contextForFields[u] = g;
2024
2050
  }
2025
2051
  if (_ && (o = _), !h.invisible) {
2026
- const u = s.createWidget(o, h);
2027
- this._columns.push(u);
2052
+ const d = s.createWidget(o, h);
2053
+ this._columns.push(d);
2028
2054
  }
2029
- D(h.autorefresh) && this._autorefreshableFields.push(d);
2055
+ W(h.autorefresh) && this._autorefreshableFields.push(u);
2030
2056
  }
2031
2057
  });
2032
2058
  }
@@ -2038,7 +2064,7 @@ class Tt {
2038
2064
  return this._columns.find((e) => e.findById ? e.findById(t) : !1);
2039
2065
  }
2040
2066
  }
2041
- const st = {
2067
+ const rt = {
2042
2068
  text: "text",
2043
2069
  many2one: "many2one",
2044
2070
  char: "char",
@@ -2051,7 +2077,7 @@ const st = {
2051
2077
  date: "date",
2052
2078
  datetime: "datetime"
2053
2079
  };
2054
- class Pt {
2080
+ class Et {
2055
2081
  constructor(t, e, s = 8) {
2056
2082
  /**
2057
2083
  * Object containing the specific fields for primary and secondary search fields
@@ -2063,7 +2089,7 @@ class Pt {
2063
2089
  n(this, "_fields");
2064
2090
  n(this, "_simpleSearchContainer");
2065
2091
  n(this, "_advancedSearchContainer");
2066
- this._searchFields = t, this._fields = e, this._simpleSearchContainer = new z(s), this._advancedSearchContainer = new z(s);
2092
+ this._searchFields = t, this._fields = e, this._simpleSearchContainer = new V(s), this._advancedSearchContainer = new V(s);
2067
2093
  }
2068
2094
  get searchFields() {
2069
2095
  return this._searchFields;
@@ -2099,7 +2125,7 @@ class Pt {
2099
2125
  colspan: 2
2100
2126
  }, { type: a, widget: l } = r;
2101
2127
  let o = l ?? a;
2102
- return st[o] === void 0 && (o = a), e.createWidget(o, r);
2128
+ return rt[o] === void 0 && (o = a), e.createWidget(o, r);
2103
2129
  });
2104
2130
  }
2105
2131
  /**
@@ -2110,7 +2136,7 @@ class Pt {
2110
2136
  return this.advancedSearchContainer.findById(t);
2111
2137
  }
2112
2138
  }
2113
- const Wt = ({
2139
+ const It = ({
2114
2140
  domain: i,
2115
2141
  widgetFieldName: t
2116
2142
  }) => {
@@ -2119,14 +2145,14 @@ const Wt = ({
2119
2145
  if (!Array.isArray(s))
2120
2146
  return;
2121
2147
  const [r, a, l] = s;
2122
- let o, d;
2123
- r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), d = r.substr(
2148
+ let o, u;
2149
+ r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), u = r.substr(
2124
2150
  r.indexOf(".") + 1,
2125
2151
  r.length - 1
2126
- )) : (o = r, d = "id"), o === t && e.push([d, a, l]);
2152
+ )) : (o = r, u = "id"), o === t && e.push([u, a, l]);
2127
2153
  }), e;
2128
- }, Et = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
2129
- class nt {
2154
+ }, St = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
2155
+ class at {
2130
2156
  constructor(t) {
2131
2157
  n(this, "_action_id", null);
2132
2158
  n(this, "_position", null);
@@ -2139,15 +2165,15 @@ class nt {
2139
2165
  return this._position;
2140
2166
  }
2141
2167
  }
2142
- class It {
2168
+ class zt {
2143
2169
  constructor(t) {
2144
2170
  n(this, "_string", null);
2145
2171
  n(this, "_items", []);
2146
- const e = Y.parse(t).filter((r) => r.tagName === "dashboard")[0];
2172
+ const e = D.parse(t).filter((r) => r.tagName === "dashboard")[0];
2147
2173
  this._string = e.attributes.string || null;
2148
2174
  const { children: s } = e;
2149
2175
  s.forEach((r) => {
2150
- r.tagName === "dashboard_item" && this._items.push(new nt(r.attributes));
2176
+ r.tagName === "dashboard_item" && this._items.push(new at(r.attributes));
2151
2177
  });
2152
2178
  }
2153
2179
  get string() {
@@ -2157,7 +2183,7 @@ class It {
2157
2183
  return this._items;
2158
2184
  }
2159
2185
  }
2160
- class ae {
2186
+ class le {
2161
2187
  constructor(t) {
2162
2188
  n(this, "_string", null);
2163
2189
  n(this, "_type");
@@ -2185,7 +2211,7 @@ class ae {
2185
2211
  return this._y_range;
2186
2212
  }
2187
2213
  }
2188
- class le extends ae {
2214
+ class oe extends le {
2189
2215
  constructor(e, s) {
2190
2216
  super(s);
2191
2217
  n(this, "_color", null);
@@ -2193,7 +2219,7 @@ class le extends ae {
2193
2219
  n(this, "_totalDomain", null);
2194
2220
  n(this, "_showPercent", !1);
2195
2221
  n(this, "_suffix", null);
2196
- this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent = D(s.attributes.showPercent);
2222
+ this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent = W(s.attributes.showPercent);
2197
2223
  }
2198
2224
  get color() {
2199
2225
  return this._color;
@@ -2211,7 +2237,7 @@ class le extends ae {
2211
2237
  return this._suffix;
2212
2238
  }
2213
2239
  }
2214
- class rt extends le {
2240
+ class lt extends oe {
2215
2241
  constructor(e, s) {
2216
2242
  super(e, s);
2217
2243
  n(this, "_field");
@@ -2231,24 +2257,24 @@ class rt extends le {
2231
2257
  return this._operator;
2232
2258
  }
2233
2259
  }
2234
- const at = (i) => {
2260
+ const ot = (i) => {
2235
2261
  const t = [];
2236
2262
  let e;
2237
2263
  if (i.forEach((s) => {
2238
2264
  if (s.tagName === "field") {
2239
- const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, d = s.attributes.stacked || void 0;
2265
+ const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, u = s.attributes.stacked || void 0;
2240
2266
  if (!r)
2241
2267
  throw new Error(`Field ${l} doesn't have an axis`);
2242
2268
  if (!l)
2243
2269
  throw new Error("Missing name attribute for field");
2244
- r === "x" ? e = new ct({
2270
+ r === "x" ? e = new dt({
2245
2271
  name: l
2246
2272
  }) : r === "y" && t.push(
2247
- new ot({
2273
+ new ut({
2248
2274
  name: l,
2249
2275
  operator: a,
2250
2276
  label: o,
2251
- stacked: d
2277
+ stacked: u
2252
2278
  })
2253
2279
  );
2254
2280
  }
@@ -2261,13 +2287,13 @@ const at = (i) => {
2261
2287
  y: t
2262
2288
  };
2263
2289
  };
2264
- class j extends ae {
2290
+ class j extends le {
2265
2291
  constructor(e, s) {
2266
2292
  super(s);
2267
2293
  n(this, "_x");
2268
2294
  n(this, "_y");
2269
2295
  this._type = e;
2270
- const r = at(s.children);
2296
+ const r = ot(s.children);
2271
2297
  this._x = r.x, this._y = r.y;
2272
2298
  }
2273
2299
  get x() {
@@ -2277,22 +2303,22 @@ class j extends ae {
2277
2303
  return this._y;
2278
2304
  }
2279
2305
  }
2280
- const lt = {
2281
- indicator: le,
2282
- indicatorField: rt,
2306
+ const ct = {
2307
+ indicator: oe,
2308
+ indicatorField: lt,
2283
2309
  line: j,
2284
2310
  bar: j,
2285
2311
  pie: j
2286
- }, St = (i) => {
2287
- const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
2312
+ }, Vt = (i) => {
2313
+ const t = D.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
2288
2314
  if (!e)
2289
2315
  throw new Error(`${e} is not a valid graph`);
2290
- const s = lt[e];
2316
+ const s = ct[e];
2291
2317
  if (!s)
2292
2318
  throw new Error(`${e} not found as a GraphModel`);
2293
2319
  return new s(e, t);
2294
2320
  };
2295
- class oe {
2321
+ class ce {
2296
2322
  constructor({ name: t, axis: e }) {
2297
2323
  n(this, "_name");
2298
2324
  n(this, "_axis");
@@ -2305,7 +2331,7 @@ class oe {
2305
2331
  return this._axis;
2306
2332
  }
2307
2333
  }
2308
- class ot extends oe {
2334
+ class ut extends ce {
2309
2335
  constructor({
2310
2336
  name: e,
2311
2337
  operator: s,
@@ -2328,12 +2354,12 @@ class ot extends oe {
2328
2354
  return this._stacked;
2329
2355
  }
2330
2356
  }
2331
- class ct extends oe {
2357
+ class dt extends ce {
2332
2358
  constructor({ name: t }) {
2333
2359
  super({ name: t, axis: "x" });
2334
2360
  }
2335
2361
  }
2336
- const dt = ({ ooui: i }) => {
2362
+ const ht = ({ ooui: i }) => {
2337
2363
  const e = [i.x.name];
2338
2364
  return i.y ? (i.y.forEach((s) => {
2339
2365
  s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
@@ -2355,27 +2381,27 @@ function $({
2355
2381
  }
2356
2382
  return { value: r, label: r };
2357
2383
  }
2358
- const zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2384
+ const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2359
2385
  __proto__: null,
2360
- getFieldsToRetrieve: dt,
2386
+ getFieldsToRetrieve: ht,
2361
2387
  getValueAndLabelForField: $
2362
2388
  }, Symbol.toStringTag, { value: "Module" }));
2363
- function ut({
2389
+ function _t({
2364
2390
  values: i,
2365
2391
  timerange: t,
2366
2392
  interval: e = 1
2367
2393
  }) {
2368
- const s = ft({
2394
+ const s = mt({
2369
2395
  values: i,
2370
2396
  timerange: t
2371
2397
  });
2372
- return ht({
2398
+ return ft({
2373
2399
  values: s,
2374
2400
  timerange: t,
2375
2401
  interval: e
2376
2402
  });
2377
2403
  }
2378
- function ht({
2404
+ function ft({
2379
2405
  values: i,
2380
2406
  timerange: t,
2381
2407
  interval: e = 1
@@ -2386,15 +2412,15 @@ function ht({
2386
2412
  groupBy: "type-stacked"
2387
2413
  }), a = `${t}s`;
2388
2414
  return Object.keys(r).forEach((o) => {
2389
- const d = r[o];
2390
- for (let _ = 0; _ < d.length; _++) {
2391
- const h = d[_];
2392
- if (s.push(h), _ === d.length - 1)
2415
+ const u = r[o];
2416
+ for (let _ = 0; _ < u.length; _++) {
2417
+ const h = u[_];
2418
+ if (s.push(h), _ === u.length - 1)
2393
2419
  return;
2394
- const u = h.x, g = d[_ + 1].x;
2395
- if (!ce([u, g], a)) {
2396
- const c = _t({
2397
- dates: [u, g],
2420
+ const d = h.x, g = u[_ + 1].x;
2421
+ if (!ue([d, g], a)) {
2422
+ const c = gt({
2423
+ dates: [d, g],
2398
2424
  timerange: t,
2399
2425
  interval: e
2400
2426
  });
@@ -2408,9 +2434,9 @@ function ht({
2408
2434
  );
2409
2435
  }
2410
2436
  }
2411
- }), s.sort((o, d) => o.x < d.x ? -1 : o.x > d.x ? 1 : 0);
2437
+ }), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
2412
2438
  }
2413
- function _t({
2439
+ function gt({
2414
2440
  dates: i,
2415
2441
  timerange: t,
2416
2442
  interval: e = 1
@@ -2420,23 +2446,23 @@ function _t({
2420
2446
  return i;
2421
2447
  const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
2422
2448
  for (let l = 0; l < a.length - 1; l++) {
2423
- const o = a[l], d = a[l + 1];
2424
- if (!ce([o, d], r)) {
2425
- const _ = P(o, S(r)).add(
2449
+ const o = a[l], u = a[l + 1];
2450
+ if (!ue([o, u], r)) {
2451
+ const _ = T(o, z(r)).add(
2426
2452
  e,
2427
2453
  r
2428
- ), h = P(d, S(r));
2454
+ ), h = T(u, z(r));
2429
2455
  for (; _.isBefore(h); )
2430
- s.push(_.format(S(r))), _.add(e, r);
2456
+ s.push(_.format(z(r))), _.add(e, r);
2431
2457
  }
2432
2458
  }
2433
2459
  return s;
2434
2460
  }
2435
- function ft({
2461
+ function mt({
2436
2462
  values: i,
2437
2463
  timerange: t
2438
2464
  }) {
2439
- const e = gt({
2465
+ const e = bt({
2440
2466
  values: i,
2441
2467
  timerange: t
2442
2468
  }), s = [], r = de({
@@ -2444,34 +2470,34 @@ function ft({
2444
2470
  groupBy: "all"
2445
2471
  });
2446
2472
  return Object.keys(r).forEach((a) => {
2447
- const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, d = V({
2473
+ const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
2448
2474
  values: l.map((_) => _.value),
2449
2475
  operator: o
2450
2476
  });
2451
2477
  s.push({
2452
2478
  ...l[0],
2453
- value: d
2479
+ value: u
2454
2480
  });
2455
2481
  }), s;
2456
2482
  }
2457
- function gt({
2483
+ function bt({
2458
2484
  values: i,
2459
2485
  timerange: t
2460
2486
  }) {
2461
2487
  return i.map((e) => ({
2462
2488
  ...e,
2463
- x: mt({
2489
+ x: yt({
2464
2490
  date: e.x,
2465
2491
  timerange: t
2466
2492
  })
2467
2493
  }));
2468
2494
  }
2469
- function mt({
2495
+ function yt({
2470
2496
  date: i,
2471
2497
  timerange: t
2472
2498
  }) {
2473
- let e = bt(i);
2474
- const s = P(i, e);
2499
+ let e = pt(i);
2500
+ const s = T(i, e);
2475
2501
  switch (t) {
2476
2502
  case "hour": {
2477
2503
  e = "YYYY-MM-DD HH:00";
@@ -2496,18 +2522,18 @@ function mt({
2496
2522
  }
2497
2523
  return s.format(e);
2498
2524
  }
2499
- function bt(i) {
2525
+ function pt(i) {
2500
2526
  return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
2501
2527
  }
2502
- function ce(i, t) {
2528
+ function ue(i, t) {
2503
2529
  let e = !1;
2504
- const s = S(t);
2530
+ const s = z(t);
2505
2531
  if (i.length === 0)
2506
2532
  return !1;
2507
2533
  if (i.length === 1)
2508
2534
  return !0;
2509
2535
  for (let r = 0; r < i.length - 1; r++) {
2510
- const a = P(i[r], s), o = P(i[r + 1], s).diff(a, t);
2536
+ const a = T(i[r], s), o = T(i[r + 1], s).diff(a, t);
2511
2537
  Math.abs(o) === 1 ? e = !0 : e = !1;
2512
2538
  }
2513
2539
  return e;
@@ -2522,7 +2548,7 @@ function de({
2522
2548
  e[o] || (e[o] = []), e[o].push(s);
2523
2549
  }), e;
2524
2550
  }
2525
- function S(i) {
2551
+ function z(i) {
2526
2552
  switch (i) {
2527
2553
  case "days":
2528
2554
  return "YYYY-MM-DD";
@@ -2537,7 +2563,7 @@ function S(i) {
2537
2563
  return "YYYY-MM-DD HH:mm";
2538
2564
  }
2539
2565
  }
2540
- const yt = {
2566
+ const xt = {
2541
2567
  count: "count",
2542
2568
  "+": "sum",
2543
2569
  "-": "subtract",
@@ -2545,7 +2571,7 @@ const yt = {
2545
2571
  avg: "average",
2546
2572
  min: "min",
2547
2573
  max: "max"
2548
- }, pt = ({
2574
+ }, wt = ({
2549
2575
  ooui: i,
2550
2576
  values: t,
2551
2577
  fields: e,
@@ -2560,41 +2586,41 @@ const yt = {
2560
2586
  Object.keys(r).forEach((m) => {
2561
2587
  const p = r[m].label, y = r[m].entries;
2562
2588
  if (c.label) {
2563
- const x = A({
2589
+ const v = A({
2564
2590
  fieldName: c.label,
2565
2591
  values: y,
2566
2592
  fields: e
2567
2593
  });
2568
- Object.keys(x).forEach((F) => {
2569
- const w = x[F].entries, E = x[F].label, _e = N({
2570
- entries: w,
2594
+ Object.keys(v).forEach((F) => {
2595
+ const x = v[F].entries, I = v[F].label, fe = N({
2596
+ entries: x,
2571
2597
  fields: e,
2572
2598
  fieldName: c.name
2573
- }), fe = V({
2574
- values: _e,
2599
+ }), ge = Y({
2600
+ values: fe,
2575
2601
  operator: c.operator
2576
2602
  });
2577
2603
  a.push({
2578
2604
  x: p || !1,
2579
- value: fe,
2580
- type: E,
2605
+ value: ge,
2606
+ type: I,
2581
2607
  operator: c.operator,
2582
2608
  stacked: c.stacked
2583
2609
  });
2584
2610
  });
2585
2611
  } else {
2586
- const x = N({
2612
+ const v = N({
2587
2613
  entries: y,
2588
2614
  fields: e,
2589
2615
  fieldName: c.name
2590
- }), F = V({
2591
- values: x,
2616
+ }), F = Y({
2617
+ values: v,
2592
2618
  operator: c.operator
2593
2619
  });
2594
2620
  a.push({
2595
2621
  x: p || !1,
2596
2622
  value: F,
2597
- type: ue({
2623
+ type: he({
2598
2624
  yAxis: c,
2599
2625
  fields: e
2600
2626
  }),
@@ -2611,21 +2637,21 @@ const yt = {
2611
2637
  i.type === "pie" && h.some((c) => c.x === !1) ? h = h.map((c) => c.x === !1 ? { ...c, x: (s == null ? void 0 : s.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (h = h.filter(
2612
2638
  (c) => c.x !== !1
2613
2639
  ));
2614
- let u = h;
2615
- i.timerange ? u = ut({
2616
- values: u,
2640
+ let d = h;
2641
+ i.timerange ? d = _t({
2642
+ values: d,
2617
2643
  timerange: i.timerange,
2618
2644
  interval: i.interval
2619
- }) : i.type == "pie" && (u = h.sort((c, m) => m.value - c.value));
2645
+ }) : i.type == "pie" && (d = h.sort((c, m) => m.value - c.value));
2620
2646
  const g = {
2621
- data: u,
2647
+ data: d,
2622
2648
  isGroup: o || l,
2623
2649
  isStack: o
2624
2650
  };
2625
2651
  if (i.type === "line" && i.y_range && (g.yAxisOpts = {
2626
2652
  mode: i.y_range
2627
2653
  }, i.y_range === "auto")) {
2628
- const { min: c, max: m } = he(u);
2654
+ const { min: c, max: m } = _e(d);
2629
2655
  g.yAxisOpts.valueOpts = { min: c, max: m };
2630
2656
  }
2631
2657
  return g;
@@ -2641,7 +2667,7 @@ function N({
2641
2667
  fields: e
2642
2668
  })).map(({ value: s, label: r }) => r);
2643
2669
  }
2644
- function V({
2670
+ function Y({
2645
2671
  operator: i,
2646
2672
  values: t
2647
2673
  }) {
@@ -2649,26 +2675,26 @@ function V({
2649
2675
  case "count":
2650
2676
  return t.length;
2651
2677
  case "+":
2652
- return I(
2678
+ return S(
2653
2679
  t.reduce(function(e, s) {
2654
2680
  return e + s;
2655
2681
  })
2656
2682
  );
2657
2683
  case "-":
2658
- return I(
2684
+ return S(
2659
2685
  t.reduce(function(e, s) {
2660
2686
  return e - s;
2661
2687
  })
2662
2688
  );
2663
2689
  case "*":
2664
- return I(
2690
+ return S(
2665
2691
  t.reduce(function(e, s) {
2666
2692
  return e * s;
2667
2693
  })
2668
2694
  );
2669
2695
  case "avg": {
2670
2696
  const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
2671
- return I(s);
2697
+ return S(s);
2672
2698
  }
2673
2699
  case "min":
2674
2700
  return Math.min(...t);
@@ -2676,7 +2702,7 @@ function V({
2676
2702
  return Math.max(...t);
2677
2703
  }
2678
2704
  }
2679
- function I(i) {
2705
+ function S(i) {
2680
2706
  return Math.round((i + Number.EPSILON) * 100) / 100;
2681
2707
  }
2682
2708
  function A({
@@ -2694,21 +2720,21 @@ function A({
2694
2720
  s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
2695
2721
  }), s;
2696
2722
  }
2697
- function xt(i) {
2723
+ function vt(i) {
2698
2724
  let t = [];
2699
2725
  return Object.keys(i).forEach((e) => {
2700
2726
  const s = i[e];
2701
2727
  t = t.concat(s.entries);
2702
2728
  }), t;
2703
2729
  }
2704
- function ue({
2730
+ function he({
2705
2731
  yAxis: i,
2706
2732
  fields: t
2707
2733
  }) {
2708
2734
  const e = t[i.name];
2709
2735
  return e != null && e.string ? e.string : i.name;
2710
2736
  }
2711
- function he(i, t = 0.1) {
2737
+ function _e(i, t = 0.1) {
2712
2738
  if (i.length === 0)
2713
2739
  throw new Error("The values array cannot be empty.");
2714
2740
  const e = i.map((l) => l.value), s = Math.min(...e), r = Math.max(...e), a = (r - s) * t;
@@ -2717,82 +2743,83 @@ function he(i, t = 0.1) {
2717
2743
  max: r + a
2718
2744
  };
2719
2745
  }
2720
- const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2746
+ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2721
2747
  __proto__: null,
2722
- getAllObjectsInGroupedValues: xt,
2723
- getMinMax: he,
2724
- getValueForOperator: V,
2748
+ getAllObjectsInGroupedValues: vt,
2749
+ getMinMax: _e,
2750
+ getValueForOperator: Y,
2725
2751
  getValuesForYField: N,
2726
2752
  getValuesGroupedByField: A,
2727
- getYAxisFieldname: ue,
2728
- labelsForOperator: yt,
2729
- processGraphData: pt
2753
+ getYAxisFieldname: he,
2754
+ labelsForOperator: xt,
2755
+ processGraphData: wt
2730
2756
  }, Symbol.toStringTag, { value: "Module" }));
2731
2757
  export {
2732
- Qe as Alert,
2733
- Ce as Avatar,
2734
- Me as Binary,
2735
- Z as Boolean,
2736
- K as Button,
2758
+ Xe as Alert,
2759
+ ke as Avatar,
2760
+ Ne as Binary,
2761
+ ee as Boolean,
2762
+ Z as Button,
2737
2763
  Te as ButtonGroup,
2764
+ Ze as Carousel,
2738
2765
  q as Char,
2739
- ie as CodeEditor,
2740
- Xe as Comments,
2741
- z as Container,
2742
- v as ContainerWidget,
2743
- It as Dashboard,
2744
- nt as DashboardItem,
2745
- Ve as Date,
2746
- Ye as DateTime,
2747
- Ue as Email,
2766
+ se as CodeEditor,
2767
+ Ue as Comments,
2768
+ V as Container,
2769
+ w as ContainerWidget,
2770
+ zt as Dashboard,
2771
+ at as DashboardItem,
2772
+ Ye as Date,
2773
+ De as DateTime,
2774
+ Ke as Email,
2748
2775
  f as Field,
2749
2776
  G as Float,
2750
- Ie as FloatTime,
2751
- Ot as Form,
2752
- ae as Graph,
2753
- oe as GraphAxis,
2777
+ Se as FloatTime,
2778
+ Tt as Form,
2779
+ le as Graph,
2780
+ ce as GraphAxis,
2754
2781
  j as GraphChart,
2755
- le as GraphIndicator,
2756
- rt as GraphIndicatorField,
2757
- ct as GraphXAxis,
2758
- ot as GraphYAxis,
2759
- Oe as Group,
2760
- Se as HTMLPreview,
2761
- Ne as Image,
2762
- Le as Indicator,
2763
- Ee as Integer,
2782
+ oe as GraphIndicator,
2783
+ lt as GraphIndicatorField,
2784
+ dt as GraphXAxis,
2785
+ ut as GraphYAxis,
2786
+ Pe as Group,
2787
+ ze as HTMLPreview,
2788
+ Ae as Image,
2789
+ Ge as Indicator,
2790
+ Ie as Integer,
2764
2791
  J as JSONField,
2765
- U as Label,
2766
- Pe as Many2one,
2767
- We as Markdown,
2768
- te as MultiCheckbox,
2769
- X as NewLine,
2792
+ K as Label,
2793
+ We as Many2one,
2794
+ Ee as Markdown,
2795
+ ie as MultiCheckbox,
2796
+ U as NewLine,
2770
2797
  M as Notebook,
2771
- ee as One2many,
2772
- ke as Page,
2773
- ze as ProgressBar,
2774
- $e as Radio,
2775
- je as Reference,
2776
- st as SearchFieldTypes,
2777
- Pt as SearchFilter,
2778
- W as Selection,
2779
- De as Separator,
2798
+ te as One2many,
2799
+ Oe as Page,
2800
+ Ve as ProgressBar,
2801
+ qe as Radio,
2802
+ Me as Reference,
2803
+ rt as SearchFieldTypes,
2804
+ Et as SearchFilter,
2805
+ E as Selection,
2806
+ je as Separator,
2780
2807
  B as Spinner,
2781
- Je as Steps,
2782
- qe as Switch,
2783
- Re as Tag,
2784
- Ge as Tags,
2808
+ He as Steps,
2809
+ Je as Switch,
2810
+ $e as Tag,
2811
+ Re as Tags,
2785
2812
  L as Text,
2786
- He as Time,
2787
- Be as Timeline,
2788
- Tt as Tree,
2813
+ Qe as Time,
2814
+ Le as Timeline,
2815
+ Wt as Tree,
2789
2816
  C as Widget,
2790
- zt as graphFieldUtils,
2791
- Vt as graphProcessor,
2792
- se as parseContext,
2793
- kt as parseContextFields,
2794
- Et as parseDomainFields,
2795
- St as parseGraph,
2796
- Wt as transformDomainForChildWidget
2817
+ Yt as graphFieldUtils,
2818
+ Dt as graphProcessor,
2819
+ ne as parseContext,
2820
+ Pt as parseContextFields,
2821
+ St as parseDomainFields,
2822
+ Vt as parseGraph,
2823
+ It as transformDomainForChildWidget
2797
2824
  };
2798
2825
  //# sourceMappingURL=ooui.es.js.map