@gisce/ooui 2.6.2 → 2.6.3-alpha.2

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
@@ -3,7 +3,7 @@ var de = (i, t, e) => t in i ? ce(i, t, { enumerable: !0, configurable: !0, writ
3
3
  var n = (i, t, e) => (de(i, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import { decode as ue } from "html-entities";
5
5
  import { evaluateCondition as he } from "@gisce/conscheck";
6
- import * as Y from "txml";
6
+ import * as D from "txml";
7
7
  import T from "moment";
8
8
  const C = class C {
9
9
  constructor(t) {
@@ -414,7 +414,7 @@ class H extends g {
414
414
  this._fieldForLabel = e;
415
415
  }
416
416
  }
417
- class I {
417
+ class V {
418
418
  constructor(t = 4, e = 6, s = !1, r = void 0) {
419
419
  /**
420
420
  * Number of columns the container is divided
@@ -538,7 +538,7 @@ const k = class k extends F {
538
538
  * Container label
539
539
  */
540
540
  n(this, "_label", "");
541
- this._container = new I(
541
+ this._container = new V(
542
542
  e == null ? void 0 : e.col,
543
543
  k._defaultColspan,
544
544
  this.readOnly,
@@ -738,7 +738,7 @@ class we extends w {
738
738
  return this._container.rows[0].filter((e) => !e.invisible);
739
739
  }
740
740
  }
741
- class D extends g {
741
+ class z extends g {
742
742
  constructor(e) {
743
743
  super(e);
744
744
  /**
@@ -829,7 +829,7 @@ class B extends g {
829
829
  this._translatable = e;
830
830
  }
831
831
  }
832
- class E extends g {
832
+ class P extends g {
833
833
  constructor(e) {
834
834
  super(e);
835
835
  /**
@@ -922,52 +922,16 @@ class Oe extends g {
922
922
  }
923
923
  class Te extends L {
924
924
  }
925
- class Ee extends g {
925
+ class Pe extends g {
926
926
  constructor(t) {
927
927
  super(t);
928
928
  }
929
929
  }
930
- class Pe extends g {
930
+ class Ee extends g {
931
931
  constructor(t) {
932
932
  super(t);
933
933
  }
934
934
  }
935
- class We extends g {
936
- constructor(e) {
937
- super(e);
938
- /**
939
- * Field size
940
- */
941
- n(this, "_size", 150);
942
- /**
943
- * Relation
944
- */
945
- n(this, "_relation", "");
946
- /**
947
- * Must expand widget
948
- */
949
- n(this, "_mustExpand", !1);
950
- e && (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.colspan || (this._mustExpand = !0));
951
- }
952
- get size() {
953
- return this._size;
954
- }
955
- set size(e) {
956
- this._size = e;
957
- }
958
- get relation() {
959
- return this._relation;
960
- }
961
- set relation(e) {
962
- this._relation = e;
963
- }
964
- get mustExpand() {
965
- return this._mustExpand;
966
- }
967
- set mustExpand(e) {
968
- this._mustExpand = e;
969
- }
970
- }
971
935
  class U extends g {
972
936
  constructor(e) {
973
937
  super(e);
@@ -1062,7 +1026,7 @@ class U extends g {
1062
1026
  this._infinite = e;
1063
1027
  }
1064
1028
  }
1065
- class Se extends F {
1029
+ class Ie extends F {
1066
1030
  constructor(e) {
1067
1031
  super(e);
1068
1032
  /**
@@ -1088,9 +1052,9 @@ class Se extends F {
1088
1052
  return null;
1089
1053
  }
1090
1054
  }
1091
- class ze extends E {
1055
+ class We extends P {
1092
1056
  }
1093
- class Ie extends g {
1057
+ class Se extends g {
1094
1058
  constructor(e) {
1095
1059
  super(e);
1096
1060
  /**
@@ -1145,14 +1109,18 @@ class De extends U {
1145
1109
  return this.parsedWidgetProps.colorField;
1146
1110
  }
1147
1111
  }
1148
- class je extends E {
1112
+ class ze extends P {
1149
1113
  constructor(e) {
1150
1114
  super(e);
1151
1115
  n(this, "_nolabel", !0);
1152
1116
  n(this, "_card");
1153
1117
  n(this, "_icon");
1154
1118
  n(this, "_suffix");
1155
- this._card = !1, this._icon = "", this._suffix = "", this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = this._parsedWidgetProps.icon || "", this._suffix = this._parsedWidgetProps.suffix || "");
1119
+ /**
1120
+ * Action id
1121
+ */
1122
+ n(this, "_actionId", NaN);
1123
+ this._card = !1, this._icon = "", this._suffix = "", this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = this._parsedWidgetProps.icon || "", this._suffix = this._parsedWidgetProps.suffix || ""), e && e.action_id && (this._actionId = parseInt(e.action_id));
1156
1124
  }
1157
1125
  get card() {
1158
1126
  return this._card;
@@ -1172,6 +1140,12 @@ class je extends E {
1172
1140
  set suffix(e) {
1173
1141
  this._suffix = e;
1174
1142
  }
1143
+ get actionId() {
1144
+ return this._actionId;
1145
+ }
1146
+ set actionId(e) {
1147
+ this._actionId = e;
1148
+ }
1175
1149
  }
1176
1150
  class K extends g {
1177
1151
  constructor(e) {
@@ -1226,14 +1200,14 @@ class K extends g {
1226
1200
  this._columns = e;
1227
1201
  }
1228
1202
  }
1229
- class Me extends K {
1203
+ class je extends K {
1230
1204
  }
1231
- class Ae extends E {
1205
+ class Me extends P {
1232
1206
  get colors() {
1233
1207
  return this._parsedWidgetProps.colors || {};
1234
1208
  }
1235
1209
  }
1236
- class Ne extends E {
1210
+ class Ne extends P {
1237
1211
  constructor(e) {
1238
1212
  super(e);
1239
1213
  /**
@@ -1249,9 +1223,9 @@ class Ne extends E {
1249
1223
  this._direction = e;
1250
1224
  }
1251
1225
  }
1252
- class Be extends X {
1226
+ class Ae extends X {
1253
1227
  }
1254
- class Le extends g {
1228
+ class Be extends g {
1255
1229
  constructor(e) {
1256
1230
  super(e);
1257
1231
  /**
@@ -1274,7 +1248,7 @@ class Le extends g {
1274
1248
  this._errorField = e;
1275
1249
  }
1276
1250
  }
1277
- class Ge extends B {
1251
+ class Le extends B {
1278
1252
  constructor(e) {
1279
1253
  super(e);
1280
1254
  n(this, "_lang", null);
@@ -1287,12 +1261,12 @@ class Ge extends B {
1287
1261
  this._lang = e;
1288
1262
  }
1289
1263
  }
1290
- class $e extends g {
1264
+ class Ge extends g {
1291
1265
  constructor(t) {
1292
1266
  super(t);
1293
1267
  }
1294
1268
  }
1295
- class Re extends g {
1269
+ class $e extends g {
1296
1270
  constructor(e) {
1297
1271
  super(e);
1298
1272
  /**
@@ -1351,7 +1325,7 @@ class G {
1351
1325
  this._widgetClass = H;
1352
1326
  break;
1353
1327
  case "char":
1354
- this._widgetClass = D;
1328
+ this._widgetClass = z;
1355
1329
  break;
1356
1330
  case "text":
1357
1331
  this._widgetClass = B;
@@ -1363,7 +1337,7 @@ class G {
1363
1337
  this._widgetClass = we;
1364
1338
  break;
1365
1339
  case "selection":
1366
- this._widgetClass = E;
1340
+ this._widgetClass = P;
1367
1341
  break;
1368
1342
  case "many2one":
1369
1343
  this._widgetClass = ve;
@@ -1381,20 +1355,18 @@ class G {
1381
1355
  this._widgetClass = ke;
1382
1356
  break;
1383
1357
  case "date":
1384
- this._widgetClass = Ee;
1358
+ this._widgetClass = Pe;
1385
1359
  break;
1386
1360
  case "datetime":
1387
- this._widgetClass = Pe;
1361
+ this._widgetClass = Ee;
1388
1362
  break;
1389
1363
  case "progressbar":
1390
1364
  this._widgetClass = Te;
1391
1365
  break;
1392
- case "many2many":
1393
- this._widgetClass = We;
1394
- break;
1395
1366
  case "markdown":
1396
1367
  this._widgetClass = Fe;
1397
1368
  break;
1369
+ case "many2many":
1398
1370
  case "one2many":
1399
1371
  case "one2many_list":
1400
1372
  this._widgetClass = U;
@@ -1403,19 +1375,19 @@ class G {
1403
1375
  this._widgetClass = J;
1404
1376
  break;
1405
1377
  case "separator":
1406
- this._widgetClass = Se;
1378
+ this._widgetClass = Ie;
1407
1379
  break;
1408
1380
  case "url":
1409
- this._widgetClass = D;
1381
+ this._widgetClass = z;
1410
1382
  break;
1411
1383
  case "email":
1412
- this._widgetClass = D;
1384
+ this._widgetClass = z;
1413
1385
  break;
1414
1386
  case "reference":
1415
- this._widgetClass = ze;
1387
+ this._widgetClass = We;
1416
1388
  break;
1417
1389
  case "binary":
1418
- this._widgetClass = Ie;
1390
+ this._widgetClass = Se;
1419
1391
  break;
1420
1392
  case "image":
1421
1393
  this._widgetClass = Ve;
@@ -1427,13 +1399,13 @@ class G {
1427
1399
  this._widgetClass = De;
1428
1400
  break;
1429
1401
  case "indicator":
1430
- this._widgetClass = je;
1402
+ this._widgetClass = ze;
1431
1403
  break;
1432
1404
  case "tags":
1433
- this._widgetClass = Me;
1405
+ this._widgetClass = je;
1434
1406
  break;
1435
1407
  case "tag":
1436
- this._widgetClass = Ae;
1408
+ this._widgetClass = Me;
1437
1409
  break;
1438
1410
  case "avatar":
1439
1411
  this._widgetClass = ye;
@@ -1445,22 +1417,22 @@ class G {
1445
1417
  this._widgetClass = K;
1446
1418
  break;
1447
1419
  case "switch":
1448
- this._widgetClass = Be;
1420
+ this._widgetClass = Ae;
1449
1421
  break;
1450
1422
  case "steps":
1451
- this._widgetClass = Le;
1423
+ this._widgetClass = Be;
1452
1424
  break;
1453
1425
  case "codeeditor":
1454
- this._widgetClass = Ge;
1426
+ this._widgetClass = Le;
1455
1427
  break;
1456
1428
  case "time":
1457
- this._widgetClass = $e;
1429
+ this._widgetClass = Ge;
1458
1430
  break;
1459
1431
  case "html_preview":
1460
1432
  this._widgetClass = Oe;
1461
1433
  break;
1462
1434
  case "alert":
1463
- this._widgetClass = Re;
1435
+ this._widgetClass = $e;
1464
1436
  break;
1465
1437
  }
1466
1438
  }
@@ -1482,7 +1454,7 @@ class G {
1482
1454
  }
1483
1455
  }
1484
1456
  }
1485
- const qe = ({
1457
+ const Re = ({
1486
1458
  fieldName: i,
1487
1459
  values: t,
1488
1460
  fields: e
@@ -1507,7 +1479,7 @@ const qe = ({
1507
1479
  r[o] = u.some((_) => _);
1508
1480
  }
1509
1481
  return r;
1510
- }, Je = ({
1482
+ }, qe = ({
1511
1483
  states: i,
1512
1484
  values: t
1513
1485
  }) => {
@@ -1516,7 +1488,7 @@ const qe = ({
1516
1488
  const e = i.split(",");
1517
1489
  return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
1518
1490
  };
1519
- function He({
1491
+ function Je({
1520
1492
  values: i = {},
1521
1493
  fieldName: t,
1522
1494
  fields: e = {}
@@ -1544,7 +1516,7 @@ const Z = ({
1544
1516
  return d.forEach((f) => {
1545
1517
  const y = f[1];
1546
1518
  if (!f[1].includes("'") && f[1] !== "true" && f[1] !== "false") {
1547
- const x = He({
1519
+ const x = Je({
1548
1520
  values: t,
1549
1521
  fields: e,
1550
1522
  fieldName: y === "active_id" ? "id" : y
@@ -1559,7 +1531,7 @@ const Z = ({
1559
1531
  } catch {
1560
1532
  return;
1561
1533
  }
1562
- }, pt = (i) => {
1534
+ }, xt = (i) => {
1563
1535
  const t = [];
1564
1536
  try {
1565
1537
  return !i || te(i) || typeof i != "string" ? t : ee(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) => {
@@ -1579,14 +1551,14 @@ function ee(i) {
1579
1551
  function te(i) {
1580
1552
  return typeof i == "object" && i !== null && typeof i != "string";
1581
1553
  }
1582
- const Qe = (i) => {
1554
+ const He = (i) => {
1583
1555
  const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
1584
1556
  return {
1585
1557
  method: e,
1586
1558
  args: r
1587
1559
  };
1588
1560
  };
1589
- function Xe(i) {
1561
+ function Qe(i) {
1590
1562
  const t = [];
1591
1563
  function e(s) {
1592
1564
  const r = [];
@@ -1598,7 +1570,7 @@ function Xe(i) {
1598
1570
  e(s);
1599
1571
  return t.flat();
1600
1572
  }
1601
- class wt {
1573
+ class pt {
1602
1574
  constructor(t, e = 4) {
1603
1575
  /**
1604
1576
  * Object containing fields specification of the form.
@@ -1649,7 +1621,7 @@ class wt {
1649
1621
  * Context for each field in the form
1650
1622
  */
1651
1623
  n(this, "_contextForFields", {});
1652
- this._fields = t, this._container = new I(e, 6, !1, "root");
1624
+ this._fields = t, this._container = new V(e, 6, !1, "root");
1653
1625
  }
1654
1626
  get fields() {
1655
1627
  return this._fields;
@@ -1701,12 +1673,12 @@ class wt {
1701
1673
  }
1702
1674
  parse(t, e) {
1703
1675
  var o;
1704
- const { values: s = {}, readOnly: r = !1 } = e || {}, a = Y.parse(t).filter((u) => u.tagName === "form")[0];
1676
+ const { values: s = {}, readOnly: r = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
1705
1677
  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({
1706
1678
  fields: a.children,
1707
1679
  container: this._container,
1708
1680
  values: s
1709
- }), Xe(this._container._rows).forEach((u) => {
1681
+ }), Qe(this._container._rows).forEach((u) => {
1710
1682
  const _ = u;
1711
1683
  _._id && _._context && (this._contextForFields[_._id] = u._context);
1712
1684
  });
@@ -1718,13 +1690,13 @@ class wt {
1718
1690
  }) {
1719
1691
  const r = new G();
1720
1692
  t.filter((a) => typeof a == "object").forEach((a) => {
1721
- var v, P;
1693
+ var v, E;
1722
1694
  const { tagName: l, attributes: o, children: u } = a;
1723
1695
  let _ = l, h = o;
1724
1696
  if (l === "field") {
1725
- const { name: p, widget: W } = o;
1726
- if (W)
1727
- _ = W;
1697
+ const { name: p, widget: I } = o;
1698
+ if (I)
1699
+ _ = I;
1728
1700
  else if (p) {
1729
1701
  if (!this._fields[p])
1730
1702
  throw new Error(
@@ -1745,10 +1717,10 @@ class wt {
1745
1717
  widgetType: l
1746
1718
  });
1747
1719
  let c;
1748
- l === "button" && h.states ? c = Je({
1720
+ l === "button" && h.states ? c = qe({
1749
1721
  states: h.states,
1750
1722
  values: s
1751
- }) : c = qe({
1723
+ }) : c = Re({
1752
1724
  fieldName: h.name,
1753
1725
  values: s,
1754
1726
  fields: this._fields
@@ -1758,11 +1730,11 @@ class wt {
1758
1730
  values: s,
1759
1731
  fields: this._fields
1760
1732
  });
1761
- h.on_change && (this._onChangeFields[h.name] = Qe(
1733
+ h.on_change && (this._onChangeFields[h.name] = He(
1762
1734
  h.on_change
1763
1735
  ));
1764
1736
  let y;
1765
- R(h.domain) && (y = h.domain), R((P = this._fields[h.name]) == null ? void 0 : P.domain) && (y = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
1737
+ R(h.domain) && (y = h.domain), R((E = this._fields[h.name]) == null ? void 0 : E.domain) && (y = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
1766
1738
  const x = {
1767
1739
  ...d,
1768
1740
  ...c,
@@ -1790,7 +1762,7 @@ class wt {
1790
1762
  function R(i) {
1791
1763
  return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
1792
1764
  }
1793
- class vt {
1765
+ class wt {
1794
1766
  constructor(t) {
1795
1767
  /**
1796
1768
  * Object containing fields specification of the form.
@@ -1845,7 +1817,7 @@ class vt {
1845
1817
  this._contextForFields = t;
1846
1818
  }
1847
1819
  parse(t) {
1848
- const e = Y.parse(t).filter((r) => r.tagName === "tree")[0];
1820
+ const e = D.parse(t).filter((r) => r.tagName === "tree")[0];
1849
1821
  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;
1850
1822
  const s = new G();
1851
1823
  e.children.forEach((r) => {
@@ -1886,7 +1858,7 @@ class vt {
1886
1858
  return this._columns.find((e) => e.findById ? e.findById(t) : !1);
1887
1859
  }
1888
1860
  }
1889
- const Ue = {
1861
+ const Xe = {
1890
1862
  text: "text",
1891
1863
  many2one: "many2one",
1892
1864
  char: "char",
@@ -1899,7 +1871,7 @@ const Ue = {
1899
1871
  date: "date",
1900
1872
  datetime: "datetime"
1901
1873
  };
1902
- class Ft {
1874
+ class vt {
1903
1875
  constructor(t, e, s = 8) {
1904
1876
  /**
1905
1877
  * Object containing the specific fields for primary and secondary search fields
@@ -1911,7 +1883,7 @@ class Ft {
1911
1883
  n(this, "_fields");
1912
1884
  n(this, "_simpleSearchContainer");
1913
1885
  n(this, "_advancedSearchContainer");
1914
- this._searchFields = t, this._fields = e, this._simpleSearchContainer = new I(s), this._advancedSearchContainer = new I(s);
1886
+ this._searchFields = t, this._fields = e, this._simpleSearchContainer = new V(s), this._advancedSearchContainer = new V(s);
1915
1887
  }
1916
1888
  get searchFields() {
1917
1889
  return this._searchFields;
@@ -1947,7 +1919,7 @@ class Ft {
1947
1919
  colspan: 2
1948
1920
  }, { type: a, widget: l } = r;
1949
1921
  let o = l ?? a;
1950
- return Ue[o] === void 0 && (o = a), e.createWidget(o, r);
1922
+ return Xe[o] === void 0 && (o = a), e.createWidget(o, r);
1951
1923
  });
1952
1924
  }
1953
1925
  /**
@@ -1958,7 +1930,7 @@ class Ft {
1958
1930
  return this.advancedSearchContainer.findById(t);
1959
1931
  }
1960
1932
  }
1961
- const Ct = ({
1933
+ const Ft = ({
1962
1934
  domain: i,
1963
1935
  widgetFieldName: t
1964
1936
  }) => {
@@ -1973,8 +1945,8 @@ const Ct = ({
1973
1945
  r.length - 1
1974
1946
  )) : (o = r, u = "id"), o === t && e.push([u, a, l]);
1975
1947
  }), e;
1976
- }, kt = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
1977
- class Ke {
1948
+ }, Ct = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
1949
+ class Ue {
1978
1950
  constructor(t) {
1979
1951
  n(this, "_action_id", null);
1980
1952
  n(this, "_position", null);
@@ -1987,15 +1959,15 @@ class Ke {
1987
1959
  return this._position;
1988
1960
  }
1989
1961
  }
1990
- class Ot {
1962
+ class kt {
1991
1963
  constructor(t) {
1992
1964
  n(this, "_string", null);
1993
1965
  n(this, "_items", []);
1994
- const e = Y.parse(t).filter((r) => r.tagName === "dashboard")[0];
1966
+ const e = D.parse(t).filter((r) => r.tagName === "dashboard")[0];
1995
1967
  this._string = e.attributes.string || null;
1996
1968
  const { children: s } = e;
1997
1969
  s.forEach((r) => {
1998
- r.tagName === "dashboard_item" && this._items.push(new Ke(r.attributes));
1970
+ r.tagName === "dashboard_item" && this._items.push(new Ue(r.attributes));
1999
1971
  });
2000
1972
  }
2001
1973
  get string() {
@@ -2026,7 +1998,7 @@ class ie {
2026
1998
  return this._interval;
2027
1999
  }
2028
2000
  }
2029
- const Ze = (i) => i === 1 || i === "1" || i === !0 || i === "True";
2001
+ const Ke = (i) => i === 1 || i === "1" || i === !0 || i === "True";
2030
2002
  class se extends ie {
2031
2003
  constructor(e, s) {
2032
2004
  super(s);
@@ -2035,7 +2007,7 @@ class se extends ie {
2035
2007
  n(this, "_totalDomain", null);
2036
2008
  n(this, "_showPercent", !1);
2037
2009
  n(this, "_suffix", null);
2038
- 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 = Ze(s.attributes.showPercent);
2010
+ 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 = Ke(s.attributes.showPercent);
2039
2011
  }
2040
2012
  get color() {
2041
2013
  return this._color;
@@ -2053,7 +2025,7 @@ class se extends ie {
2053
2025
  return this._suffix;
2054
2026
  }
2055
2027
  }
2056
- class et extends se {
2028
+ class Ze extends se {
2057
2029
  constructor(e, s) {
2058
2030
  super(e, s);
2059
2031
  n(this, "_field");
@@ -2073,7 +2045,7 @@ class et extends se {
2073
2045
  return this._operator;
2074
2046
  }
2075
2047
  }
2076
- const tt = (i) => {
2048
+ const et = (i) => {
2077
2049
  const t = [];
2078
2050
  let e;
2079
2051
  if (i.forEach((s) => {
@@ -2083,10 +2055,10 @@ const tt = (i) => {
2083
2055
  throw new Error(`Field ${l} doesn't have an axis`);
2084
2056
  if (!l)
2085
2057
  throw new Error("Missing name attribute for field");
2086
- r === "x" ? e = new nt({
2058
+ r === "x" ? e = new st({
2087
2059
  name: l
2088
2060
  }) : r === "y" && t.push(
2089
- new st({
2061
+ new it({
2090
2062
  name: l,
2091
2063
  operator: a,
2092
2064
  label: o,
@@ -2109,7 +2081,7 @@ class j extends ie {
2109
2081
  n(this, "_x");
2110
2082
  n(this, "_y");
2111
2083
  this._type = e;
2112
- const r = tt(s.children);
2084
+ const r = et(s.children);
2113
2085
  this._x = r.x, this._y = r.y;
2114
2086
  }
2115
2087
  get x() {
@@ -2119,17 +2091,17 @@ class j extends ie {
2119
2091
  return this._y;
2120
2092
  }
2121
2093
  }
2122
- const it = {
2094
+ const tt = {
2123
2095
  indicator: se,
2124
- indicatorField: et,
2096
+ indicatorField: Ze,
2125
2097
  line: j,
2126
2098
  bar: j,
2127
2099
  pie: j
2128
- }, Tt = (i) => {
2129
- const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
2100
+ }, Ot = (i) => {
2101
+ const t = D.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
2130
2102
  if (!e)
2131
2103
  throw new Error(`${e} is not a valid graph`);
2132
- const s = it[e];
2104
+ const s = tt[e];
2133
2105
  if (!s)
2134
2106
  throw new Error(`${e} not found as a GraphModel`);
2135
2107
  return new s(e, t);
@@ -2147,7 +2119,7 @@ class ne {
2147
2119
  return this._axis;
2148
2120
  }
2149
2121
  }
2150
- class st extends ne {
2122
+ class it extends ne {
2151
2123
  constructor({
2152
2124
  name: e,
2153
2125
  operator: s,
@@ -2170,12 +2142,12 @@ class st extends ne {
2170
2142
  return this._stacked;
2171
2143
  }
2172
2144
  }
2173
- class nt extends ne {
2145
+ class st extends ne {
2174
2146
  constructor({ name: t }) {
2175
2147
  super({ name: t, axis: "x" });
2176
2148
  }
2177
2149
  }
2178
- const rt = ({ ooui: i }) => {
2150
+ const nt = ({ ooui: i }) => {
2179
2151
  const e = [i.x.name];
2180
2152
  return i.y ? (i.y.forEach((s) => {
2181
2153
  s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
@@ -2197,27 +2169,27 @@ function $({
2197
2169
  }
2198
2170
  return { value: r, label: r };
2199
2171
  }
2200
- const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2172
+ const Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2201
2173
  __proto__: null,
2202
- getFieldsToRetrieve: rt,
2174
+ getFieldsToRetrieve: nt,
2203
2175
  getValueAndLabelForField: $
2204
2176
  }, Symbol.toStringTag, { value: "Module" }));
2205
- function at({
2177
+ function rt({
2206
2178
  values: i,
2207
2179
  timerange: t,
2208
2180
  interval: e = 1
2209
2181
  }) {
2210
- const s = ct({
2182
+ const s = ot({
2211
2183
  values: i,
2212
2184
  timerange: t
2213
2185
  });
2214
- return lt({
2186
+ return at({
2215
2187
  values: s,
2216
2188
  timerange: t,
2217
2189
  interval: e
2218
2190
  });
2219
2191
  }
2220
- function lt({
2192
+ function at({
2221
2193
  values: i,
2222
2194
  timerange: t,
2223
2195
  interval: e = 1
@@ -2235,7 +2207,7 @@ function lt({
2235
2207
  return;
2236
2208
  const d = h.x, c = u[_ + 1].x;
2237
2209
  if (!re([d, c], a)) {
2238
- const f = ot({
2210
+ const f = lt({
2239
2211
  dates: [d, c],
2240
2212
  timerange: t,
2241
2213
  interval: e
@@ -2252,7 +2224,7 @@ function lt({
2252
2224
  }
2253
2225
  }), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
2254
2226
  }
2255
- function ot({
2227
+ function lt({
2256
2228
  dates: i,
2257
2229
  timerange: t,
2258
2230
  interval: e = 1
@@ -2264,21 +2236,21 @@ function ot({
2264
2236
  for (let l = 0; l < a.length - 1; l++) {
2265
2237
  const o = a[l], u = a[l + 1];
2266
2238
  if (!re([o, u], r)) {
2267
- const _ = T(o, z(r)).add(
2239
+ const _ = T(o, S(r)).add(
2268
2240
  e,
2269
2241
  r
2270
- ), h = T(u, z(r));
2242
+ ), h = T(u, S(r));
2271
2243
  for (; _.isBefore(h); )
2272
- s.push(_.format(z(r))), _.add(e, r);
2244
+ s.push(_.format(S(r))), _.add(e, r);
2273
2245
  }
2274
2246
  }
2275
2247
  return s;
2276
2248
  }
2277
- function ct({
2249
+ function ot({
2278
2250
  values: i,
2279
2251
  timerange: t
2280
2252
  }) {
2281
- const e = dt({
2253
+ const e = ct({
2282
2254
  values: i,
2283
2255
  timerange: t
2284
2256
  }), s = [], r = ae({
@@ -2286,7 +2258,7 @@ function ct({
2286
2258
  groupBy: "all"
2287
2259
  });
2288
2260
  return Object.keys(r).forEach((a) => {
2289
- const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = V({
2261
+ const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
2290
2262
  values: l.map((_) => _.value),
2291
2263
  operator: o
2292
2264
  });
@@ -2296,23 +2268,23 @@ function ct({
2296
2268
  });
2297
2269
  }), s;
2298
2270
  }
2299
- function dt({
2271
+ function ct({
2300
2272
  values: i,
2301
2273
  timerange: t
2302
2274
  }) {
2303
2275
  return i.map((e) => ({
2304
2276
  ...e,
2305
- x: ut({
2277
+ x: dt({
2306
2278
  date: e.x,
2307
2279
  timerange: t
2308
2280
  })
2309
2281
  }));
2310
2282
  }
2311
- function ut({
2283
+ function dt({
2312
2284
  date: i,
2313
2285
  timerange: t
2314
2286
  }) {
2315
- let e = ht(i);
2287
+ let e = ut(i);
2316
2288
  const s = T(i, e);
2317
2289
  switch (t) {
2318
2290
  case "hour": {
@@ -2338,12 +2310,12 @@ function ut({
2338
2310
  }
2339
2311
  return s.format(e);
2340
2312
  }
2341
- function ht(i) {
2313
+ function ut(i) {
2342
2314
  return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
2343
2315
  }
2344
2316
  function re(i, t) {
2345
2317
  let e = !1;
2346
- const s = z(t);
2318
+ const s = S(t);
2347
2319
  if (i.length === 0)
2348
2320
  return !1;
2349
2321
  if (i.length === 1)
@@ -2364,7 +2336,7 @@ function ae({
2364
2336
  e[o] || (e[o] = []), e[o].push(s);
2365
2337
  }), e;
2366
2338
  }
2367
- function z(i) {
2339
+ function S(i) {
2368
2340
  switch (i) {
2369
2341
  case "days":
2370
2342
  return "YYYY-MM-DD";
@@ -2379,7 +2351,7 @@ function z(i) {
2379
2351
  return "YYYY-MM-DD HH:mm";
2380
2352
  }
2381
2353
  }
2382
- const _t = {
2354
+ const ht = {
2383
2355
  count: "count",
2384
2356
  "+": "sum",
2385
2357
  "-": "subtract",
@@ -2387,13 +2359,13 @@ const _t = {
2387
2359
  avg: "average",
2388
2360
  min: "min",
2389
2361
  max: "max"
2390
- }, ft = ({
2362
+ }, _t = ({
2391
2363
  ooui: i,
2392
2364
  values: t,
2393
2365
  fields: e,
2394
2366
  options: s
2395
2367
  }) => {
2396
- const r = N({
2368
+ const r = A({
2397
2369
  fieldName: i.x.name,
2398
2370
  values: t,
2399
2371
  fields: e
@@ -2402,18 +2374,18 @@ const _t = {
2402
2374
  Object.keys(r).forEach((f) => {
2403
2375
  const y = r[f].label, x = r[f].entries;
2404
2376
  if (c.label) {
2405
- const m = N({
2377
+ const m = A({
2406
2378
  fieldName: c.label,
2407
2379
  values: x,
2408
2380
  fields: e
2409
2381
  });
2410
2382
  Object.keys(m).forEach((v) => {
2411
- const P = m[v].entries, p = m[v].label, W = A({
2412
- entries: P,
2383
+ const E = m[v].entries, p = m[v].label, I = N({
2384
+ entries: E,
2413
2385
  fields: e,
2414
2386
  fieldName: c.name
2415
- }), oe = V({
2416
- values: W,
2387
+ }), oe = Y({
2388
+ values: I,
2417
2389
  operator: c.operator
2418
2390
  });
2419
2391
  a.push({
@@ -2425,11 +2397,11 @@ const _t = {
2425
2397
  });
2426
2398
  });
2427
2399
  } else {
2428
- const m = A({
2400
+ const m = N({
2429
2401
  entries: x,
2430
2402
  fields: e,
2431
2403
  fieldName: c.name
2432
- }), v = V({
2404
+ }), v = Y({
2433
2405
  values: m,
2434
2406
  operator: c.operator
2435
2407
  });
@@ -2454,7 +2426,7 @@ const _t = {
2454
2426
  (c) => c.x !== !1
2455
2427
  ));
2456
2428
  let d = h;
2457
- return i.timerange ? d = at({
2429
+ return i.timerange ? d = rt({
2458
2430
  values: d,
2459
2431
  timerange: i.timerange,
2460
2432
  interval: i.interval
@@ -2464,7 +2436,7 @@ const _t = {
2464
2436
  isStack: o
2465
2437
  };
2466
2438
  };
2467
- function A({
2439
+ function N({
2468
2440
  entries: i,
2469
2441
  fieldName: t,
2470
2442
  fields: e
@@ -2475,7 +2447,7 @@ function A({
2475
2447
  fields: e
2476
2448
  })).map(({ value: s, label: r }) => r);
2477
2449
  }
2478
- function V({
2450
+ function Y({
2479
2451
  operator: i,
2480
2452
  values: t
2481
2453
  }) {
@@ -2483,26 +2455,26 @@ function V({
2483
2455
  case "count":
2484
2456
  return t.length;
2485
2457
  case "+":
2486
- return S(
2458
+ return W(
2487
2459
  t.reduce(function(e, s) {
2488
2460
  return e + s;
2489
2461
  })
2490
2462
  );
2491
2463
  case "-":
2492
- return S(
2464
+ return W(
2493
2465
  t.reduce(function(e, s) {
2494
2466
  return e - s;
2495
2467
  })
2496
2468
  );
2497
2469
  case "*":
2498
- return S(
2470
+ return W(
2499
2471
  t.reduce(function(e, s) {
2500
2472
  return e * s;
2501
2473
  })
2502
2474
  );
2503
2475
  case "avg": {
2504
2476
  const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
2505
- return S(s);
2477
+ return W(s);
2506
2478
  }
2507
2479
  case "min":
2508
2480
  return Math.min(...t);
@@ -2510,10 +2482,10 @@ function V({
2510
2482
  return Math.max(...t);
2511
2483
  }
2512
2484
  }
2513
- function S(i) {
2485
+ function W(i) {
2514
2486
  return Math.round((i + Number.EPSILON) * 100) / 100;
2515
2487
  }
2516
- function N({
2488
+ function A({
2517
2489
  fieldName: i,
2518
2490
  fields: t,
2519
2491
  values: e
@@ -2528,7 +2500,7 @@ function N({
2528
2500
  s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
2529
2501
  }), s;
2530
2502
  }
2531
- function gt(i) {
2503
+ function ft(i) {
2532
2504
  let t = [];
2533
2505
  return Object.keys(i).forEach((e) => {
2534
2506
  const s = i[e];
@@ -2544,47 +2516,46 @@ function le({
2544
2516
  }
2545
2517
  const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2546
2518
  __proto__: null,
2547
- getAllObjectsInGroupedValues: gt,
2548
- getValueForOperator: V,
2549
- getValuesForYField: A,
2550
- getValuesGroupedByField: N,
2519
+ getAllObjectsInGroupedValues: ft,
2520
+ getValueForOperator: Y,
2521
+ getValuesForYField: N,
2522
+ getValuesGroupedByField: A,
2551
2523
  getYAxisFieldname: le,
2552
- labelsForOperator: _t,
2553
- processGraphData: ft
2524
+ labelsForOperator: ht,
2525
+ processGraphData: _t
2554
2526
  }, Symbol.toStringTag, { value: "Module" }));
2555
2527
  export {
2556
- Re as Alert,
2528
+ $e as Alert,
2557
2529
  ye as Avatar,
2558
- Ie as Binary,
2530
+ Se as Binary,
2559
2531
  X as Boolean,
2560
2532
  Q as Button,
2561
2533
  we as ButtonGroup,
2562
- D as Char,
2563
- Ge as CodeEditor,
2564
- I as Container,
2534
+ z as Char,
2535
+ Le as CodeEditor,
2536
+ V as Container,
2565
2537
  w as ContainerWidget,
2566
- Ot as Dashboard,
2567
- Ke as DashboardItem,
2568
- Ee as Date,
2569
- Pe as DateTime,
2538
+ kt as Dashboard,
2539
+ Ue as DashboardItem,
2540
+ Pe as Date,
2541
+ Ee as DateTime,
2570
2542
  g as Field,
2571
2543
  L as Float,
2572
2544
  ke as FloatTime,
2573
- wt as Form,
2545
+ pt as Form,
2574
2546
  ie as Graph,
2575
2547
  ne as GraphAxis,
2576
2548
  j as GraphChart,
2577
2549
  se as GraphIndicator,
2578
- et as GraphIndicatorField,
2579
- nt as GraphXAxis,
2580
- st as GraphYAxis,
2550
+ Ze as GraphIndicatorField,
2551
+ st as GraphXAxis,
2552
+ it as GraphYAxis,
2581
2553
  pe as Group,
2582
2554
  Oe as HTMLPreview,
2583
2555
  Ve as Image,
2584
- je as Indicator,
2556
+ ze as Indicator,
2585
2557
  Ce as Integer,
2586
2558
  H as Label,
2587
- We as Many2many,
2588
2559
  ve as Many2one,
2589
2560
  Fe as Markdown,
2590
2561
  K as MultiCheckbox,
@@ -2594,26 +2565,26 @@ export {
2594
2565
  xe as Page,
2595
2566
  Te as ProgressBar,
2596
2567
  Ne as Radio,
2597
- ze as Reference,
2598
- Ue as SearchFieldTypes,
2599
- Ft as SearchFilter,
2600
- E as Selection,
2601
- Se as Separator,
2602
- Le as Steps,
2603
- Be as Switch,
2604
- Ae as Tag,
2605
- Me as Tags,
2568
+ We as Reference,
2569
+ Xe as SearchFieldTypes,
2570
+ vt as SearchFilter,
2571
+ P as Selection,
2572
+ Ie as Separator,
2573
+ Be as Steps,
2574
+ Ae as Switch,
2575
+ Me as Tag,
2576
+ je as Tags,
2606
2577
  B as Text,
2607
- $e as Time,
2578
+ Ge as Time,
2608
2579
  De as Timeline,
2609
- vt as Tree,
2580
+ wt as Tree,
2610
2581
  F as Widget,
2611
- Et as graphFieldUtils,
2582
+ Tt as graphFieldUtils,
2612
2583
  Pt as graphProcessor,
2613
2584
  Z as parseContext,
2614
- pt as parseContextFields,
2615
- kt as parseDomainFields,
2616
- Tt as parseGraph,
2617
- Ct as transformDomainForChildWidget
2585
+ xt as parseContextFields,
2586
+ Ct as parseDomainFields,
2587
+ Ot as parseGraph,
2588
+ Ft as transformDomainForChildWidget
2618
2589
  };
2619
2590
  //# sourceMappingURL=ooui.es.js.map