@gisce/ooui 2.23.0-rc.1 → 2.23.0

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 fe = Object.defineProperty;
2
- var ge = (i, t, e) => t in i ? fe(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var n = (i, t, e) => (ge(i, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { decode as me } from "html-entities";
5
- import { evaluateCondition as be } from "@gisce/conscheck";
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
6
  import * as Y from "txml";
7
- import P from "moment";
8
- const ye = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe = ({
7
+ import T from "moment";
8
+ const pe = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe = ({
9
9
  entry: i,
10
10
  values: t,
11
11
  fields: e
@@ -41,7 +41,7 @@ const ye = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
41
41
  default:
42
42
  return !1;
43
43
  }
44
- }, b = (i) => me(i, { level: "xml" }), H = ({
44
+ }, b = (i) => be(i, { level: "xml" }), H = ({
45
45
  fieldName: i,
46
46
  valueInObject: t,
47
47
  expectedValue: e,
@@ -61,7 +61,7 @@ const ye = (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
- }, pe = ({
64
+ }, we = ({
65
65
  attrs: i,
66
66
  values: t,
67
67
  fields: e,
@@ -69,11 +69,22 @@ const ye = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), xe
69
69
  }) => {
70
70
  const h = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(h), u = JSON.parse(_), d = {};
71
71
  for (const f of Object.keys(u)) {
72
- const x = u[f].map((y) => xe({ entry: y, values: t, fields: e })).every((y) => y);
73
- x ? d[f] = !0 : f === "readonly" && !x && s === "button" && (d[f] = !1);
72
+ const p = u[f].map((y) => xe({ entry: y, values: t, fields: e })).every((y) => y);
73
+ p ? d[f] = !0 : f === "readonly" && !p && s === "button" && (d[f] = !1);
74
74
  }
75
75
  return d;
76
- }, we = ({
76
+ }, Q = (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
+ }, ve = ({
77
88
  attrs: i,
78
89
  values: t,
79
90
  fields: e,
@@ -84,7 +95,7 @@ const ye = (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 h = be({
98
+ const h = ye({
88
99
  object: t,
89
100
  condition: a[o],
90
101
  evaluateFieldComparison: ({
@@ -106,7 +117,7 @@ const ye = (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
- }, ve = ({
120
+ }, Fe = ({
110
121
  tagAttributes: i,
111
122
  values: t,
112
123
  fields: e,
@@ -114,14 +125,14 @@ const ye = (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 = pe({
128
+ if (i.attrs && (l = we({
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 = we({
135
+ a = ve({
125
136
  attrs: i.json_attrs,
126
137
  values: t,
127
138
  fields: e,
@@ -177,20 +188,7 @@ const ye = (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 && (t.readonly === "1" || t.readonly === 1 || t.readonly === !0 ? this._readOnly = !0 : (t.readonly === "0" || t.readonly === 0 || t.readonly === !1) && (this._readOnly = !1)), t.invisible && (t.invisible === 1 || t.invisible === "1" || t.invisible === !0) && (this._invisible = !0), t.type && (this._type = t.type), t.context && (this._context = t.context), t.domain && (typeof t.domain != "string" ? this._domain = 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 && (t.readonly === "1" || t.readonly === 1 || t.readonly === !0 ? this._readOnly = !0 : (t.readonly === "0" || t.readonly === 0 || t.readonly === !1) && (this._readOnly = !1)), t.invisible && (t.invisible === 1 || t.invisible === "1" || t.invisible === !0) && (this._invisible = !0), t.type && (this._type = t.type), t.context && (this._context = t.context), t.domain && (typeof t.domain != "string" ? this._domain = b(JSON.stringify(t.domain)) : this._domain = b(t.domain)), t.type && (this._fieldType = t.fieldsWidgetType), t.widget_props && (this._parsedWidgetProps = Q(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;
@@ -307,7 +305,7 @@ class g extends C {
307
305
  * Values and keys
308
306
  */
309
307
  n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
310
- 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 = ye(e.help_inline)));
308
+ 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)));
311
309
  }
312
310
  get id() {
313
311
  return this._id;
@@ -357,6 +355,12 @@ class g extends C {
357
355
  set sum(e) {
358
356
  this._sum = e;
359
357
  }
358
+ get suffix() {
359
+ return this._parsedWidgetProps.suffix || "";
360
+ }
361
+ get prefix() {
362
+ return this._parsedWidgetProps.prefix || "";
363
+ }
360
364
  get selectionValues() {
361
365
  return this._selectionValues;
362
366
  }
@@ -371,14 +375,14 @@ class g extends C {
371
375
  return this._id === e ? this : null;
372
376
  }
373
377
  }
374
- class Fe extends g {
378
+ class Ce extends g {
375
379
  }
376
- class Q extends C {
380
+ class X extends C {
377
381
  findById(t) {
378
382
  return null;
379
383
  }
380
384
  }
381
- class X extends g {
385
+ class U extends g {
382
386
  constructor(e) {
383
387
  super({ ...e, nolabel: !0 });
384
388
  /**
@@ -501,13 +505,13 @@ class z {
501
505
  }
502
506
  addWidget(t, e) {
503
507
  const s = [], r = e ? e.addLabel : !0;
504
- if (t instanceof Q) {
508
+ if (t instanceof X) {
505
509
  this._rows.push([]), this._index++;
506
510
  return;
507
511
  }
508
512
  if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof g && !t.nolabel) {
509
513
  t.colspan > 1 && (t.colspan -= 1);
510
- const l = new X({
514
+ const l = new U({
511
515
  name: t.id + "_label",
512
516
  string: t.label,
513
517
  invisible: t.invisible,
@@ -611,18 +615,18 @@ const O = class O extends C {
611
615
  };
612
616
  n(O, "_defaultColspan", 6);
613
617
  let v = O;
614
- const T = class T extends v {
618
+ const P = class P extends v {
615
619
  constructor(e) {
616
620
  super(e);
617
621
  n(this, "_tabPosition", "top");
618
622
  n(this, "_pages", []);
619
- this.colspan = T._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
623
+ this.colspan = P._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
620
624
  }
621
625
  static get defaultColspan() {
622
- return T._defaultColspan;
626
+ return P._defaultColspan;
623
627
  }
624
628
  static set defaultColspan(e) {
625
- T._defaultColspan = e;
629
+ P._defaultColspan = e;
626
630
  }
627
631
  get tabPosition() {
628
632
  return this._tabPosition;
@@ -634,8 +638,8 @@ const T = class T extends v {
634
638
  return [].concat.apply([], this._container.rows);
635
639
  }
636
640
  };
637
- n(T, "_defaultColspan", 3);
638
- let j = T;
641
+ n(P, "_defaultColspan", 3);
642
+ let j = P;
639
643
  class A extends v {
640
644
  constructor(e) {
641
645
  super(e);
@@ -649,7 +653,7 @@ class A extends v {
649
653
  this._loading = e;
650
654
  }
651
655
  }
652
- class Ce extends A {
656
+ class ke extends A {
653
657
  constructor(e) {
654
658
  super(e);
655
659
  n(this, "_icon", null);
@@ -662,7 +666,7 @@ class Ce extends A {
662
666
  this._icon = e;
663
667
  }
664
668
  }
665
- class ke extends A {
669
+ class Oe extends A {
666
670
  constructor(e) {
667
671
  super(e);
668
672
  n(this, "_icon", null);
@@ -675,7 +679,7 @@ class ke extends A {
675
679
  this._icon = e;
676
680
  }
677
681
  }
678
- class U extends g {
682
+ class K extends g {
679
683
  constructor(e) {
680
684
  super({
681
685
  ...e,
@@ -747,7 +751,7 @@ class U extends g {
747
751
  this._danger = e;
748
752
  }
749
753
  }
750
- class Oe extends v {
754
+ class Pe extends v {
751
755
  constructor(e) {
752
756
  super(e);
753
757
  n(this, "_defaultName", "");
@@ -927,14 +931,14 @@ class Te extends g {
927
931
  this._relation = e;
928
932
  }
929
933
  }
930
- class Pe extends B {
934
+ class We extends B {
931
935
  }
932
- class K extends g {
936
+ class Z extends g {
933
937
  constructor(t) {
934
938
  super(t);
935
939
  }
936
940
  }
937
- class We extends g {
941
+ class Ee extends g {
938
942
  constructor(t) {
939
943
  super(t);
940
944
  }
@@ -972,23 +976,23 @@ class L extends g {
972
976
  this._decimalDigits = e;
973
977
  }
974
978
  }
975
- class Ee extends L {
979
+ class Ie extends L {
976
980
  }
977
- class Ie extends g {
981
+ class Se extends g {
978
982
  }
979
- class Se extends L {
983
+ class ze extends L {
980
984
  }
981
- class ze extends g {
985
+ class Ve extends g {
982
986
  constructor(t) {
983
987
  super(t);
984
988
  }
985
989
  }
986
- class Ve extends g {
990
+ class Ye extends g {
987
991
  constructor(t) {
988
992
  super(t);
989
993
  }
990
994
  }
991
- class Z extends g {
995
+ class ee extends g {
992
996
  constructor(e) {
993
997
  super(e);
994
998
  /**
@@ -1082,7 +1086,7 @@ class Z extends g {
1082
1086
  this._infinite = e;
1083
1087
  }
1084
1088
  }
1085
- class Ye extends C {
1089
+ class De extends C {
1086
1090
  constructor(e) {
1087
1091
  super(e);
1088
1092
  /**
@@ -1108,9 +1112,9 @@ class Ye extends C {
1108
1112
  return null;
1109
1113
  }
1110
1114
  }
1111
- class De extends W {
1115
+ class je extends W {
1112
1116
  }
1113
- class je extends g {
1117
+ class Me extends g {
1114
1118
  constructor(e) {
1115
1119
  super(e);
1116
1120
  /**
@@ -1126,18 +1130,18 @@ class je extends g {
1126
1130
  this._filenameField = e;
1127
1131
  }
1128
1132
  }
1129
- class Me extends g {
1133
+ class Ne extends g {
1130
1134
  get showControls() {
1131
1135
  var t;
1132
1136
  return ((t = this.parsedWidgetProps) == null ? void 0 : t.showControls) ?? !0;
1133
1137
  }
1134
1138
  }
1135
- class Ne extends g {
1139
+ class Ae extends g {
1136
1140
  constructor(t) {
1137
1141
  super(t);
1138
1142
  }
1139
1143
  }
1140
- class Ae extends Z {
1144
+ class Be extends ee {
1141
1145
  constructor(e) {
1142
1146
  super(e);
1143
1147
  /**
@@ -1169,7 +1173,7 @@ class Ae extends Z {
1169
1173
  return this.parsedWidgetProps.colorField;
1170
1174
  }
1171
1175
  }
1172
- class Be extends W {
1176
+ class Le extends W {
1173
1177
  constructor(e) {
1174
1178
  super(e);
1175
1179
  n(this, "_nolabel", !0);
@@ -1219,7 +1223,7 @@ class Be extends W {
1219
1223
  this._height = e;
1220
1224
  }
1221
1225
  }
1222
- class ee extends g {
1226
+ class te extends g {
1223
1227
  constructor(e) {
1224
1228
  super(e);
1225
1229
  /**
@@ -1272,14 +1276,14 @@ class ee extends g {
1272
1276
  this._columns = e;
1273
1277
  }
1274
1278
  }
1275
- class Le extends ee {
1279
+ class Ge extends te {
1276
1280
  }
1277
- class Ge extends W {
1281
+ class $e extends W {
1278
1282
  get colors() {
1279
1283
  return this._parsedWidgetProps.colors || {};
1280
1284
  }
1281
1285
  }
1282
- class $e extends W {
1286
+ class Re extends W {
1283
1287
  constructor(e) {
1284
1288
  super(e);
1285
1289
  /**
@@ -1295,9 +1299,9 @@ class $e extends W {
1295
1299
  this._direction = e;
1296
1300
  }
1297
1301
  }
1298
- class Re extends K {
1302
+ class qe extends Z {
1299
1303
  }
1300
- class qe extends g {
1304
+ class Je extends g {
1301
1305
  constructor(e) {
1302
1306
  super(e);
1303
1307
  /**
@@ -1327,7 +1331,7 @@ class qe extends g {
1327
1331
  this._lastStep = e;
1328
1332
  }
1329
1333
  }
1330
- class te extends B {
1334
+ class ie extends B {
1331
1335
  constructor(e) {
1332
1336
  super(e);
1333
1337
  n(this, "_lang", null);
@@ -1340,12 +1344,12 @@ class te extends B {
1340
1344
  this._lang = e;
1341
1345
  }
1342
1346
  }
1343
- class Je extends g {
1347
+ class He extends g {
1344
1348
  constructor(t) {
1345
1349
  super(t);
1346
1350
  }
1347
1351
  }
1348
- class He extends v {
1352
+ class Qe extends v {
1349
1353
  constructor(e) {
1350
1354
  super(e);
1351
1355
  /**
@@ -1385,7 +1389,7 @@ class He extends v {
1385
1389
  return this._container.rows.flat().filter((e) => !e.invisible);
1386
1390
  }
1387
1391
  }
1388
- class Qe extends g {
1392
+ class Xe extends g {
1389
1393
  constructor(e) {
1390
1394
  super(e);
1391
1395
  /**
@@ -1404,13 +1408,13 @@ class Qe extends g {
1404
1408
  this._height = e;
1405
1409
  }
1406
1410
  }
1407
- class q extends te {
1411
+ class q extends ie {
1408
1412
  constructor() {
1409
1413
  super(...arguments);
1410
1414
  n(this, "_lang", "json");
1411
1415
  }
1412
1416
  }
1413
- class Xe extends g {
1417
+ class Ue extends g {
1414
1418
  constructor(e) {
1415
1419
  super(e);
1416
1420
  n(this, "_multi", !1);
@@ -1443,13 +1447,13 @@ class G {
1443
1447
  this._widgetClass = j;
1444
1448
  break;
1445
1449
  case "page":
1446
- this._widgetClass = Ce;
1450
+ this._widgetClass = ke;
1447
1451
  break;
1448
1452
  case "group":
1449
- this._widgetClass = ke;
1453
+ this._widgetClass = Oe;
1450
1454
  break;
1451
1455
  case "label":
1452
- this._widgetClass = X;
1456
+ this._widgetClass = U;
1453
1457
  break;
1454
1458
  case "char":
1455
1459
  this._widgetClass = R;
@@ -1458,10 +1462,10 @@ class G {
1458
1462
  this._widgetClass = B;
1459
1463
  break;
1460
1464
  case "button":
1461
- this._widgetClass = U;
1465
+ this._widgetClass = K;
1462
1466
  break;
1463
1467
  case "buttonGroup":
1464
- this._widgetClass = Oe;
1468
+ this._widgetClass = Pe;
1465
1469
  break;
1466
1470
  case "selection":
1467
1471
  this._widgetClass = W;
@@ -1470,99 +1474,99 @@ class G {
1470
1474
  this._widgetClass = Te;
1471
1475
  break;
1472
1476
  case "boolean":
1473
- this._widgetClass = K;
1477
+ this._widgetClass = Z;
1474
1478
  break;
1475
1479
  case "integer":
1476
- this._widgetClass = We;
1480
+ this._widgetClass = Ee;
1477
1481
  break;
1478
1482
  case "float":
1479
1483
  this._widgetClass = L;
1480
1484
  break;
1481
1485
  case "float_time":
1482
- this._widgetClass = Ee;
1486
+ this._widgetClass = Ie;
1483
1487
  break;
1484
1488
  case "date":
1485
- this._widgetClass = ze;
1489
+ this._widgetClass = Ve;
1486
1490
  break;
1487
1491
  case "datetime":
1488
- this._widgetClass = Ve;
1492
+ this._widgetClass = Ye;
1489
1493
  break;
1490
1494
  case "progressbar":
1491
- this._widgetClass = Se;
1495
+ this._widgetClass = ze;
1492
1496
  break;
1493
1497
  case "markdown":
1494
- this._widgetClass = Pe;
1498
+ this._widgetClass = We;
1495
1499
  break;
1496
1500
  case "many2many":
1497
1501
  case "one2many":
1498
1502
  case "one2many_list":
1499
- this._widgetClass = Z;
1503
+ this._widgetClass = ee;
1500
1504
  break;
1501
1505
  case "newline":
1502
- this._widgetClass = Q;
1506
+ this._widgetClass = X;
1503
1507
  break;
1504
1508
  case "separator":
1505
- this._widgetClass = Ye;
1509
+ this._widgetClass = De;
1506
1510
  break;
1507
1511
  case "url":
1508
1512
  this._widgetClass = R;
1509
1513
  break;
1510
1514
  case "email":
1511
- this._widgetClass = Xe;
1515
+ this._widgetClass = Ue;
1512
1516
  break;
1513
1517
  case "reference":
1514
- this._widgetClass = De;
1518
+ this._widgetClass = je;
1515
1519
  break;
1516
1520
  case "binary":
1517
- this._widgetClass = je;
1521
+ this._widgetClass = Me;
1518
1522
  break;
1519
1523
  case "image":
1520
- this._widgetClass = Me;
1524
+ this._widgetClass = Ne;
1521
1525
  break;
1522
1526
  case "fiber_grid":
1523
- this._widgetClass = Ne;
1527
+ this._widgetClass = Ae;
1524
1528
  break;
1525
1529
  case "timeline":
1526
- this._widgetClass = Ae;
1530
+ this._widgetClass = Be;
1527
1531
  break;
1528
1532
  case "indicator":
1529
- this._widgetClass = Be;
1533
+ this._widgetClass = Le;
1530
1534
  break;
1531
1535
  case "tags":
1532
- this._widgetClass = Le;
1536
+ this._widgetClass = Ge;
1533
1537
  break;
1534
1538
  case "tag":
1535
- this._widgetClass = Ge;
1539
+ this._widgetClass = $e;
1536
1540
  break;
1537
1541
  case "avatar":
1538
- this._widgetClass = Fe;
1542
+ this._widgetClass = Ce;
1539
1543
  break;
1540
1544
  case "radio":
1541
- this._widgetClass = $e;
1545
+ this._widgetClass = Re;
1542
1546
  break;
1543
1547
  case "multicheckbox":
1544
- this._widgetClass = ee;
1548
+ this._widgetClass = te;
1545
1549
  break;
1546
1550
  case "switch":
1547
- this._widgetClass = Re;
1551
+ this._widgetClass = qe;
1548
1552
  break;
1549
1553
  case "steps":
1550
- this._widgetClass = qe;
1554
+ this._widgetClass = Je;
1551
1555
  break;
1552
1556
  case "codeeditor":
1553
- this._widgetClass = te;
1557
+ this._widgetClass = ie;
1554
1558
  break;
1555
1559
  case "time":
1556
- this._widgetClass = Je;
1560
+ this._widgetClass = He;
1557
1561
  break;
1558
1562
  case "html_preview":
1559
- this._widgetClass = Ie;
1563
+ this._widgetClass = Se;
1560
1564
  break;
1561
1565
  case "alert":
1562
- this._widgetClass = He;
1566
+ this._widgetClass = Qe;
1563
1567
  break;
1564
1568
  case "comments_timeline":
1565
- this._widgetClass = Qe;
1569
+ this._widgetClass = Xe;
1566
1570
  break;
1567
1571
  case "json":
1568
1572
  this._widgetClass = q;
@@ -1594,7 +1598,7 @@ class G {
1594
1598
  }
1595
1599
  }
1596
1600
  }
1597
- const Ue = ({
1601
+ const Ke = ({
1598
1602
  fieldName: i,
1599
1603
  values: t,
1600
1604
  fields: e
@@ -1619,7 +1623,7 @@ const Ue = ({
1619
1623
  r[o] = h.some((_) => _);
1620
1624
  }
1621
1625
  return r;
1622
- }, Ke = ({
1626
+ }, Ze = ({
1623
1627
  states: i,
1624
1628
  values: t
1625
1629
  }) => {
@@ -1628,7 +1632,7 @@ const Ue = ({
1628
1632
  const e = i.split(",");
1629
1633
  return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
1630
1634
  };
1631
- function Ze({
1635
+ function et({
1632
1636
  values: i = {},
1633
1637
  fieldName: t,
1634
1638
  fields: e = {}
@@ -1637,7 +1641,7 @@ function Ze({
1637
1641
  const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
1638
1642
  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);
1639
1643
  }
1640
- const ie = ({
1644
+ const se = ({
1641
1645
  context: i,
1642
1646
  values: t,
1643
1647
  fields: e
@@ -1645,9 +1649,9 @@ const ie = ({
1645
1649
  try {
1646
1650
  if (!i)
1647
1651
  return;
1648
- if (ne(i) || typeof i != "string")
1652
+ if (re(i) || typeof i != "string")
1649
1653
  return i;
1650
- const s = se(i);
1654
+ const s = ne(i);
1651
1655
  if (s !== null)
1652
1656
  return s;
1653
1657
  if (i.trim().length === 0)
@@ -1656,12 +1660,12 @@ const ie = ({
1656
1660
  return d.forEach((c) => {
1657
1661
  const m = c[1];
1658
1662
  if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
1659
- const x = Ze({
1663
+ const p = et({
1660
1664
  values: t,
1661
1665
  fields: e,
1662
1666
  fieldName: m === "active_id" ? "id" : m
1663
1667
  });
1664
- f[c[0].replace(/'/g, "")] = x || void 0;
1668
+ f[c[0].replace(/'/g, "")] = p || void 0;
1665
1669
  } else
1666
1670
  c[1] === "true" ? f[c[0].replace(/'/g, "")] = !0 : c[1] === "false" ? f[c[0].replace(/'/g, "")] = !1 : f[c[0].replace(/'/g, "")] = c[1].replace(
1667
1671
  /'/g,
@@ -1671,34 +1675,34 @@ const ie = ({
1671
1675
  } catch {
1672
1676
  return;
1673
1677
  }
1674
- }, kt = (i) => {
1678
+ }, Ot = (i) => {
1675
1679
  const t = [];
1676
1680
  try {
1677
- return !i || ne(i) || typeof i != "string" ? t : se(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) => {
1681
+ 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((d) => d.split(":")).forEach((d) => {
1678
1682
  !d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
1679
1683
  }), t);
1680
1684
  } catch {
1681
1685
  }
1682
1686
  return t;
1683
1687
  };
1684
- function se(i) {
1688
+ function ne(i) {
1685
1689
  try {
1686
1690
  return JSON.parse(i.replace(/'/g, '"'));
1687
1691
  } catch {
1688
1692
  return null;
1689
1693
  }
1690
1694
  }
1691
- function ne(i) {
1695
+ function re(i) {
1692
1696
  return typeof i == "object" && i !== null && typeof i != "string";
1693
1697
  }
1694
- const et = (i) => {
1698
+ const tt = (i) => {
1695
1699
  const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
1696
1700
  return {
1697
1701
  method: e,
1698
1702
  args: r
1699
1703
  };
1700
1704
  };
1701
- function tt(i) {
1705
+ function it(i) {
1702
1706
  const t = [];
1703
1707
  function e(s) {
1704
1708
  const r = [];
@@ -1710,7 +1714,7 @@ function tt(i) {
1710
1714
  e(s);
1711
1715
  return t.flat();
1712
1716
  }
1713
- class Ot {
1717
+ class Pt {
1714
1718
  constructor(t, e = 4) {
1715
1719
  /**
1716
1720
  * Object containing fields specification of the form.
@@ -1818,7 +1822,7 @@ class Ot {
1818
1822
  fields: a.children,
1819
1823
  container: this._container,
1820
1824
  values: s
1821
- }), tt(this._container._rows).forEach((h) => {
1825
+ }), it(this._container._rows).forEach((h) => {
1822
1826
  const _ = h;
1823
1827
  _._id && _._context && (this._contextForFields[_._id] = h._context);
1824
1828
  });
@@ -1830,65 +1834,68 @@ class Ot {
1830
1834
  }) {
1831
1835
  const r = new G();
1832
1836
  t.filter((a) => typeof a == "object").forEach((a) => {
1833
- var p, F;
1837
+ var w, F;
1834
1838
  const { tagName: l, attributes: o, children: h } = a;
1835
1839
  let _ = l, u = o;
1836
1840
  if (l === "field") {
1837
- const { name: w, widget: E } = o;
1841
+ const { name: x, widget: E } = o;
1838
1842
  if (E)
1839
1843
  _ = E;
1840
- else if (w) {
1841
- if (!this._fields[w])
1844
+ else if (x) {
1845
+ if (!this._fields[x])
1842
1846
  throw new Error(
1843
- `Field ${w} doesn't exist in fields defintion`
1847
+ `Field ${x} doesn't exist in fields defintion`
1844
1848
  );
1845
- _ = this._fields[w].type;
1849
+ _ = this._fields[x].type, o.widget_props = {
1850
+ ...Q(o.widget_props),
1851
+ ...this._fields[x].widget_props || {}
1852
+ };
1846
1853
  }
1847
1854
  u = {
1848
- ...this._fields[w],
1855
+ ...this._fields[x],
1849
1856
  ...o,
1850
- fieldsWidgetType: this._fields[w].type
1857
+ fieldsWidgetType: this._fields[x].type
1851
1858
  };
1852
1859
  }
1853
- const d = ve({
1860
+ const d = Fe({
1854
1861
  tagAttributes: u,
1855
1862
  values: s,
1856
1863
  fields: this._fields,
1857
1864
  widgetType: l
1858
1865
  });
1859
1866
  let f;
1860
- l === "button" && u.states ? f = Ke({
1867
+ l === "button" && u.states ? f = Ze({
1861
1868
  states: u.states,
1862
1869
  values: s
1863
- }) : f = Ue({
1870
+ }) : f = Ke({
1864
1871
  fieldName: u.name,
1865
1872
  values: s,
1866
1873
  fields: this._fields
1867
1874
  });
1868
- const c = ie({
1869
- context: u.context || ((p = this._fields[u.name]) == null ? void 0 : p.context),
1875
+ const c = se({
1876
+ context: u.context || ((w = this._fields[u.name]) == null ? void 0 : w.context),
1870
1877
  values: s,
1871
1878
  fields: this._fields
1872
1879
  });
1873
- u.on_change && (this._onChangeFields[u.name] = et(
1880
+ u.on_change && (this._onChangeFields[u.name] = tt(
1874
1881
  u.on_change
1875
1882
  ));
1876
1883
  let m;
1877
1884
  J(u.domain) ? m = u.domain : J((F = this._fields[u.name]) == null ? void 0 : F.domain) && (m = this._fields[u.name].domain), this._keyIdx = this._keyIdx + 1;
1878
- const x = {
1885
+ const p = {
1879
1886
  ...d,
1880
1887
  ...f,
1881
1888
  context: c,
1882
1889
  domain: m,
1883
1890
  key: `${this._keyIdx}`
1884
1891
  };
1885
- e.readOnly && (x.readonly = !0);
1886
- const y = r.createWidget(_, x);
1887
- y.invisible && y instanceof g && this._invisibleFields.push(x.name), y instanceof v && this.parseNode({
1892
+ e.readOnly && (p.readonly = !0);
1893
+ const y = r.createWidget(_, p);
1894
+ y.invisible && y instanceof g && this._invisibleFields.push(p.name), y instanceof v && this.parseNode({
1888
1895
  fields: h,
1889
1896
  container: y.container,
1890
1897
  values: s
1891
- }), y instanceof U && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
1898
+ }), y instanceof K && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
1892
1899
  });
1893
1900
  }
1894
1901
  /**
@@ -1981,7 +1988,7 @@ class Tt {
1981
1988
  throw new Error(`Field ${h} doesn't exist in fields defintion`);
1982
1989
  const d = this._fields[h];
1983
1990
  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;
1984
- const f = ie({
1991
+ const f = se({
1985
1992
  context: l.context || d.context,
1986
1993
  values: {},
1987
1994
  fields: this._fields
@@ -2008,7 +2015,7 @@ class Tt {
2008
2015
  return this._columns.find((e) => e.findById ? e.findById(t) : !1);
2009
2016
  }
2010
2017
  }
2011
- const it = {
2018
+ const st = {
2012
2019
  text: "text",
2013
2020
  many2one: "many2one",
2014
2021
  char: "char",
@@ -2021,7 +2028,7 @@ const it = {
2021
2028
  date: "date",
2022
2029
  datetime: "datetime"
2023
2030
  };
2024
- class Pt {
2031
+ class Wt {
2025
2032
  constructor(t, e, s = 8) {
2026
2033
  /**
2027
2034
  * Object containing the specific fields for primary and secondary search fields
@@ -2069,7 +2076,7 @@ class Pt {
2069
2076
  colspan: 2
2070
2077
  }, { type: a, widget: l } = r;
2071
2078
  let o = l ?? a;
2072
- return it[o] === void 0 && (o = a), e.createWidget(o, r);
2079
+ return st[o] === void 0 && (o = a), e.createWidget(o, r);
2073
2080
  });
2074
2081
  }
2075
2082
  /**
@@ -2080,7 +2087,7 @@ class Pt {
2080
2087
  return this.advancedSearchContainer.findById(t);
2081
2088
  }
2082
2089
  }
2083
- const Wt = ({
2090
+ const Et = ({
2084
2091
  domain: i,
2085
2092
  widgetFieldName: t
2086
2093
  }) => {
@@ -2095,8 +2102,8 @@ const Wt = ({
2095
2102
  r.length - 1
2096
2103
  )) : (o = r, h = "id"), o === t && e.push([h, a, l]);
2097
2104
  }), e;
2098
- }, Et = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
2099
- class st {
2105
+ }, It = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
2106
+ class nt {
2100
2107
  constructor(t) {
2101
2108
  n(this, "_action_id", null);
2102
2109
  n(this, "_position", null);
@@ -2109,7 +2116,7 @@ class st {
2109
2116
  return this._position;
2110
2117
  }
2111
2118
  }
2112
- class It {
2119
+ class St {
2113
2120
  constructor(t) {
2114
2121
  n(this, "_string", null);
2115
2122
  n(this, "_items", []);
@@ -2117,7 +2124,7 @@ class It {
2117
2124
  this._string = e.attributes.string || null;
2118
2125
  const { children: s } = e;
2119
2126
  s.forEach((r) => {
2120
- r.tagName === "dashboard_item" && this._items.push(new st(r.attributes));
2127
+ r.tagName === "dashboard_item" && this._items.push(new nt(r.attributes));
2121
2128
  });
2122
2129
  }
2123
2130
  get string() {
@@ -2127,7 +2134,7 @@ class It {
2127
2134
  return this._items;
2128
2135
  }
2129
2136
  }
2130
- class re {
2137
+ class ae {
2131
2138
  constructor(t) {
2132
2139
  n(this, "_string", null);
2133
2140
  n(this, "_type");
@@ -2155,8 +2162,8 @@ class re {
2155
2162
  return this._y_range;
2156
2163
  }
2157
2164
  }
2158
- const nt = (i) => i === 1 || i === "1" || i === !0 || i === "True";
2159
- class ae extends re {
2165
+ const rt = (i) => i === 1 || i === "1" || i === !0 || i === "True";
2166
+ class le extends ae {
2160
2167
  constructor(e, s) {
2161
2168
  super(s);
2162
2169
  n(this, "_color", null);
@@ -2164,7 +2171,7 @@ class ae extends re {
2164
2171
  n(this, "_totalDomain", null);
2165
2172
  n(this, "_showPercent", !1);
2166
2173
  n(this, "_suffix", null);
2167
- 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 = nt(s.attributes.showPercent);
2174
+ 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 = rt(s.attributes.showPercent);
2168
2175
  }
2169
2176
  get color() {
2170
2177
  return this._color;
@@ -2182,7 +2189,7 @@ class ae extends re {
2182
2189
  return this._suffix;
2183
2190
  }
2184
2191
  }
2185
- class rt extends ae {
2192
+ class at extends le {
2186
2193
  constructor(e, s) {
2187
2194
  super(e, s);
2188
2195
  n(this, "_field");
@@ -2202,7 +2209,7 @@ class rt extends ae {
2202
2209
  return this._operator;
2203
2210
  }
2204
2211
  }
2205
- const at = (i) => {
2212
+ const lt = (i) => {
2206
2213
  const t = [];
2207
2214
  let e;
2208
2215
  if (i.forEach((s) => {
@@ -2212,10 +2219,10 @@ const at = (i) => {
2212
2219
  throw new Error(`Field ${l} doesn't have an axis`);
2213
2220
  if (!l)
2214
2221
  throw new Error("Missing name attribute for field");
2215
- r === "x" ? e = new ct({
2222
+ r === "x" ? e = new dt({
2216
2223
  name: l
2217
2224
  }) : r === "y" && t.push(
2218
- new ot({
2225
+ new ct({
2219
2226
  name: l,
2220
2227
  operator: a,
2221
2228
  label: o,
@@ -2232,13 +2239,13 @@ const at = (i) => {
2232
2239
  y: t
2233
2240
  };
2234
2241
  };
2235
- class D extends re {
2242
+ class D extends ae {
2236
2243
  constructor(e, s) {
2237
2244
  super(s);
2238
2245
  n(this, "_x");
2239
2246
  n(this, "_y");
2240
2247
  this._type = e;
2241
- const r = at(s.children);
2248
+ const r = lt(s.children);
2242
2249
  this._x = r.x, this._y = r.y;
2243
2250
  }
2244
2251
  get x() {
@@ -2248,22 +2255,22 @@ class D extends re {
2248
2255
  return this._y;
2249
2256
  }
2250
2257
  }
2251
- const lt = {
2252
- indicator: ae,
2253
- indicatorField: rt,
2258
+ const ot = {
2259
+ indicator: le,
2260
+ indicatorField: at,
2254
2261
  line: D,
2255
2262
  bar: D,
2256
2263
  pie: D
2257
- }, St = (i) => {
2264
+ }, zt = (i) => {
2258
2265
  const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
2259
2266
  if (!e)
2260
2267
  throw new Error(`${e} is not a valid graph`);
2261
- const s = lt[e];
2268
+ const s = ot[e];
2262
2269
  if (!s)
2263
2270
  throw new Error(`${e} not found as a GraphModel`);
2264
2271
  return new s(e, t);
2265
2272
  };
2266
- class le {
2273
+ class oe {
2267
2274
  constructor({ name: t, axis: e }) {
2268
2275
  n(this, "_name");
2269
2276
  n(this, "_axis");
@@ -2276,7 +2283,7 @@ class le {
2276
2283
  return this._axis;
2277
2284
  }
2278
2285
  }
2279
- class ot extends le {
2286
+ class ct extends oe {
2280
2287
  constructor({
2281
2288
  name: e,
2282
2289
  operator: s,
@@ -2299,12 +2306,12 @@ class ot extends le {
2299
2306
  return this._stacked;
2300
2307
  }
2301
2308
  }
2302
- class ct extends le {
2309
+ class dt extends oe {
2303
2310
  constructor({ name: t }) {
2304
2311
  super({ name: t, axis: "x" });
2305
2312
  }
2306
2313
  }
2307
- const dt = ({ ooui: i }) => {
2314
+ const ut = ({ ooui: i }) => {
2308
2315
  const e = [i.x.name];
2309
2316
  return i.y ? (i.y.forEach((s) => {
2310
2317
  s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
@@ -2326,33 +2333,33 @@ function $({
2326
2333
  }
2327
2334
  return { value: r, label: r };
2328
2335
  }
2329
- const zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2336
+ const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2330
2337
  __proto__: null,
2331
- getFieldsToRetrieve: dt,
2338
+ getFieldsToRetrieve: ut,
2332
2339
  getValueAndLabelForField: $
2333
2340
  }, Symbol.toStringTag, { value: "Module" }));
2334
- function ut({
2341
+ function ht({
2335
2342
  values: i,
2336
2343
  timerange: t,
2337
2344
  interval: e = 1
2338
2345
  }) {
2339
- const s = ft({
2346
+ const s = gt({
2340
2347
  values: i,
2341
2348
  timerange: t
2342
2349
  });
2343
- return ht({
2350
+ return _t({
2344
2351
  values: s,
2345
2352
  timerange: t,
2346
2353
  interval: e
2347
2354
  });
2348
2355
  }
2349
- function ht({
2356
+ function _t({
2350
2357
  values: i,
2351
2358
  timerange: t,
2352
2359
  interval: e = 1
2353
2360
  }) {
2354
2361
  let s = [];
2355
- const r = ce({
2362
+ const r = de({
2356
2363
  values: i,
2357
2364
  groupBy: "type-stacked"
2358
2365
  }), a = `${t}s`;
@@ -2363,8 +2370,8 @@ function ht({
2363
2370
  if (s.push(u), _ === h.length - 1)
2364
2371
  return;
2365
2372
  const d = u.x, f = h[_ + 1].x;
2366
- if (!oe([d, f], a)) {
2367
- const c = _t({
2373
+ if (!ce([d, f], a)) {
2374
+ const c = ft({
2368
2375
  dates: [d, f],
2369
2376
  timerange: t,
2370
2377
  interval: e
@@ -2381,7 +2388,7 @@ function ht({
2381
2388
  }
2382
2389
  }), s.sort((o, h) => o.x < h.x ? -1 : o.x > h.x ? 1 : 0);
2383
2390
  }
2384
- function _t({
2391
+ function ft({
2385
2392
  dates: i,
2386
2393
  timerange: t,
2387
2394
  interval: e = 1
@@ -2392,25 +2399,25 @@ function _t({
2392
2399
  const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
2393
2400
  for (let l = 0; l < a.length - 1; l++) {
2394
2401
  const o = a[l], h = a[l + 1];
2395
- if (!oe([o, h], r)) {
2396
- const _ = P(o, S(r)).add(
2402
+ if (!ce([o, h], r)) {
2403
+ const _ = T(o, S(r)).add(
2397
2404
  e,
2398
2405
  r
2399
- ), u = P(h, S(r));
2406
+ ), u = T(h, S(r));
2400
2407
  for (; _.isBefore(u); )
2401
2408
  s.push(_.format(S(r))), _.add(e, r);
2402
2409
  }
2403
2410
  }
2404
2411
  return s;
2405
2412
  }
2406
- function ft({
2413
+ function gt({
2407
2414
  values: i,
2408
2415
  timerange: t
2409
2416
  }) {
2410
- const e = gt({
2417
+ const e = mt({
2411
2418
  values: i,
2412
2419
  timerange: t
2413
- }), s = [], r = ce({
2420
+ }), s = [], r = de({
2414
2421
  values: e,
2415
2422
  groupBy: "all"
2416
2423
  });
@@ -2425,24 +2432,24 @@ function ft({
2425
2432
  });
2426
2433
  }), s;
2427
2434
  }
2428
- function gt({
2435
+ function mt({
2429
2436
  values: i,
2430
2437
  timerange: t
2431
2438
  }) {
2432
2439
  return i.map((e) => ({
2433
2440
  ...e,
2434
- x: mt({
2441
+ x: bt({
2435
2442
  date: e.x,
2436
2443
  timerange: t
2437
2444
  })
2438
2445
  }));
2439
2446
  }
2440
- function mt({
2447
+ function bt({
2441
2448
  date: i,
2442
2449
  timerange: t
2443
2450
  }) {
2444
- let e = bt(i);
2445
- const s = P(i, e);
2451
+ let e = yt(i);
2452
+ const s = T(i, e);
2446
2453
  switch (t) {
2447
2454
  case "hour": {
2448
2455
  e = "YYYY-MM-DD HH:00";
@@ -2467,10 +2474,10 @@ function mt({
2467
2474
  }
2468
2475
  return s.format(e);
2469
2476
  }
2470
- function bt(i) {
2477
+ function yt(i) {
2471
2478
  return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
2472
2479
  }
2473
- function oe(i, t) {
2480
+ function ce(i, t) {
2474
2481
  let e = !1;
2475
2482
  const s = S(t);
2476
2483
  if (i.length === 0)
@@ -2478,12 +2485,12 @@ function oe(i, t) {
2478
2485
  if (i.length === 1)
2479
2486
  return !0;
2480
2487
  for (let r = 0; r < i.length - 1; r++) {
2481
- const a = P(i[r], s), o = P(i[r + 1], s).diff(a, t);
2488
+ const a = T(i[r], s), o = T(i[r + 1], s).diff(a, t);
2482
2489
  Math.abs(o) === 1 ? e = !0 : e = !1;
2483
2490
  }
2484
2491
  return e;
2485
2492
  }
2486
- function ce({
2493
+ function de({
2487
2494
  values: i,
2488
2495
  groupBy: t
2489
2496
  }) {
@@ -2508,7 +2515,7 @@ function S(i) {
2508
2515
  return "YYYY-MM-DD HH:mm";
2509
2516
  }
2510
2517
  }
2511
- const yt = {
2518
+ const pt = {
2512
2519
  count: "count",
2513
2520
  "+": "sum",
2514
2521
  "-": "subtract",
@@ -2529,43 +2536,43 @@ const yt = {
2529
2536
  }), a = [];
2530
2537
  i.y.forEach((c) => {
2531
2538
  Object.keys(r).forEach((m) => {
2532
- const x = r[m].label, y = r[m].entries;
2539
+ const p = r[m].label, y = r[m].entries;
2533
2540
  if (c.label) {
2534
- const p = N({
2541
+ const w = N({
2535
2542
  fieldName: c.label,
2536
2543
  values: y,
2537
2544
  fields: e
2538
2545
  });
2539
- Object.keys(p).forEach((F) => {
2540
- const w = p[F].entries, E = p[F].label, he = M({
2541
- entries: w,
2546
+ Object.keys(w).forEach((F) => {
2547
+ const x = w[F].entries, E = w[F].label, _e = M({
2548
+ entries: x,
2542
2549
  fields: e,
2543
2550
  fieldName: c.name
2544
- }), _e = V({
2545
- values: he,
2551
+ }), fe = V({
2552
+ values: _e,
2546
2553
  operator: c.operator
2547
2554
  });
2548
2555
  a.push({
2549
- x: x || !1,
2550
- value: _e,
2556
+ x: p || !1,
2557
+ value: fe,
2551
2558
  type: E,
2552
2559
  operator: c.operator,
2553
2560
  stacked: c.stacked
2554
2561
  });
2555
2562
  });
2556
2563
  } else {
2557
- const p = M({
2564
+ const w = M({
2558
2565
  entries: y,
2559
2566
  fields: e,
2560
2567
  fieldName: c.name
2561
2568
  }), F = V({
2562
- values: p,
2569
+ values: w,
2563
2570
  operator: c.operator
2564
2571
  });
2565
2572
  a.push({
2566
- x: x || !1,
2573
+ x: p || !1,
2567
2574
  value: F,
2568
- type: de({
2575
+ type: ue({
2569
2576
  yAxis: c,
2570
2577
  fields: e
2571
2578
  }),
@@ -2583,7 +2590,7 @@ const yt = {
2583
2590
  (c) => c.x !== !1
2584
2591
  ));
2585
2592
  let d = u;
2586
- i.timerange ? d = ut({
2593
+ i.timerange ? d = ht({
2587
2594
  values: d,
2588
2595
  timerange: i.timerange,
2589
2596
  interval: i.interval
@@ -2596,7 +2603,7 @@ const yt = {
2596
2603
  if (i.type === "line" && i.y_range && (f.yAxisOpts = {
2597
2604
  mode: i.y_range
2598
2605
  }, i.y_range === "auto")) {
2599
- const { min: c, max: m } = ue(d);
2606
+ const { min: c, max: m } = he(d);
2600
2607
  f.yAxisOpts.valueOpts = { min: c, max: m };
2601
2608
  }
2602
2609
  return f;
@@ -2665,21 +2672,21 @@ function N({
2665
2672
  s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
2666
2673
  }), s;
2667
2674
  }
2668
- function pt(i) {
2675
+ function wt(i) {
2669
2676
  let t = [];
2670
2677
  return Object.keys(i).forEach((e) => {
2671
2678
  const s = i[e];
2672
2679
  t = t.concat(s.entries);
2673
2680
  }), t;
2674
2681
  }
2675
- function de({
2682
+ function ue({
2676
2683
  yAxis: i,
2677
2684
  fields: t
2678
2685
  }) {
2679
2686
  const e = t[i.name];
2680
2687
  return e != null && e.string ? e.string : i.name;
2681
2688
  }
2682
- function ue(i, t = 0.1) {
2689
+ function he(i, t = 0.1) {
2683
2690
  if (i.length === 0)
2684
2691
  throw new Error("The values array cannot be empty.");
2685
2692
  const e = i.map((l) => l.value), s = Math.min(...e), r = Math.max(...e), a = (r - s) * t;
@@ -2688,82 +2695,82 @@ function ue(i, t = 0.1) {
2688
2695
  max: r + a
2689
2696
  };
2690
2697
  }
2691
- const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2698
+ const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2692
2699
  __proto__: null,
2693
- getAllObjectsInGroupedValues: pt,
2694
- getMinMax: ue,
2700
+ getAllObjectsInGroupedValues: wt,
2701
+ getMinMax: he,
2695
2702
  getValueForOperator: V,
2696
2703
  getValuesForYField: M,
2697
2704
  getValuesGroupedByField: N,
2698
- getYAxisFieldname: de,
2699
- labelsForOperator: yt,
2705
+ getYAxisFieldname: ue,
2706
+ labelsForOperator: pt,
2700
2707
  processGraphData: xt
2701
2708
  }, Symbol.toStringTag, { value: "Module" }));
2702
2709
  export {
2703
- He as Alert,
2704
- Fe as Avatar,
2705
- je as Binary,
2706
- K as Boolean,
2707
- U as Button,
2708
- Oe as ButtonGroup,
2710
+ Qe as Alert,
2711
+ Ce as Avatar,
2712
+ Me as Binary,
2713
+ Z as Boolean,
2714
+ K as Button,
2715
+ Pe as ButtonGroup,
2709
2716
  R as Char,
2710
- te as CodeEditor,
2711
- Qe as Comments,
2717
+ ie as CodeEditor,
2718
+ Xe as Comments,
2712
2719
  z as Container,
2713
2720
  v as ContainerWidget,
2714
- It as Dashboard,
2715
- st as DashboardItem,
2716
- ze as Date,
2717
- Ve as DateTime,
2718
- Xe as Email,
2721
+ St as Dashboard,
2722
+ nt as DashboardItem,
2723
+ Ve as Date,
2724
+ Ye as DateTime,
2725
+ Ue as Email,
2719
2726
  g as Field,
2720
2727
  L as Float,
2721
- Ee as FloatTime,
2722
- Ot as Form,
2723
- re as Graph,
2724
- le as GraphAxis,
2728
+ Ie as FloatTime,
2729
+ Pt as Form,
2730
+ ae as Graph,
2731
+ oe as GraphAxis,
2725
2732
  D as GraphChart,
2726
- ae as GraphIndicator,
2727
- rt as GraphIndicatorField,
2728
- ct as GraphXAxis,
2729
- ot as GraphYAxis,
2730
- ke as Group,
2731
- Ie as HTMLPreview,
2732
- Me as Image,
2733
- Be as Indicator,
2734
- We as Integer,
2733
+ le as GraphIndicator,
2734
+ at as GraphIndicatorField,
2735
+ dt as GraphXAxis,
2736
+ ct as GraphYAxis,
2737
+ Oe as Group,
2738
+ Se as HTMLPreview,
2739
+ Ne as Image,
2740
+ Le as Indicator,
2741
+ Ee as Integer,
2735
2742
  q as JSONField,
2736
- X as Label,
2743
+ U as Label,
2737
2744
  Te as Many2one,
2738
- Pe as Markdown,
2739
- ee as MultiCheckbox,
2740
- Q as NewLine,
2745
+ We as Markdown,
2746
+ te as MultiCheckbox,
2747
+ X as NewLine,
2741
2748
  j as Notebook,
2742
- Z as One2many,
2743
- Ce as Page,
2744
- Se as ProgressBar,
2745
- $e as Radio,
2746
- De as Reference,
2747
- it as SearchFieldTypes,
2748
- Pt as SearchFilter,
2749
+ ee as One2many,
2750
+ ke as Page,
2751
+ ze as ProgressBar,
2752
+ Re as Radio,
2753
+ je as Reference,
2754
+ st as SearchFieldTypes,
2755
+ Wt as SearchFilter,
2749
2756
  W as Selection,
2750
- Ye as Separator,
2757
+ De as Separator,
2751
2758
  A as Spinner,
2752
- qe as Steps,
2753
- Re as Switch,
2754
- Ge as Tag,
2755
- Le as Tags,
2759
+ Je as Steps,
2760
+ qe as Switch,
2761
+ $e as Tag,
2762
+ Ge as Tags,
2756
2763
  B as Text,
2757
- Je as Time,
2758
- Ae as Timeline,
2764
+ He as Time,
2765
+ Be as Timeline,
2759
2766
  Tt as Tree,
2760
2767
  C as Widget,
2761
- zt as graphFieldUtils,
2762
- Vt as graphProcessor,
2763
- ie as parseContext,
2764
- kt as parseContextFields,
2765
- Et as parseDomainFields,
2766
- St as parseGraph,
2767
- Wt as transformDomainForChildWidget
2768
+ Vt as graphFieldUtils,
2769
+ Yt as graphProcessor,
2770
+ se as parseContext,
2771
+ Ot as parseContextFields,
2772
+ It as parseDomainFields,
2773
+ zt as parseGraph,
2774
+ Et as transformDomainForChildWidget
2768
2775
  };
2769
2776
  //# sourceMappingURL=ooui.es.js.map