@gisce/ooui 2.40.0-alpha.1 → 2.40.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
@@ -3,8 +3,8 @@ var yt = (i, e, t) => e in i ? bt(i, e, { enumerable: !0, configurable: !0, writ
3
3
  var r = (i, e, t) => (yt(i, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import { decode as xt } from "html-entities";
5
5
  import { evaluateCondition as pt } from "@gisce/conscheck";
6
- import * as I from "txml";
7
- import T from "moment";
6
+ import * as T from "txml";
7
+ import z from "moment";
8
8
  const wt = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), Ft = ({
9
9
  entry: i,
10
10
  values: e,
@@ -669,8 +669,8 @@ const W = class W extends F {
669
669
  }
670
670
  };
671
671
  r(W, "_defaultColspan", 3);
672
- let A = W;
673
- class D extends F {
672
+ let B = W;
673
+ class N extends F {
674
674
  constructor(t) {
675
675
  super(t);
676
676
  r(this, "_loading", !1);
@@ -683,7 +683,7 @@ class D extends F {
683
683
  this._loading = t;
684
684
  }
685
685
  }
686
- class Pt extends D {
686
+ class Pt extends N {
687
687
  constructor(t) {
688
688
  super(t);
689
689
  r(this, "_icon", null);
@@ -696,7 +696,7 @@ class Pt extends D {
696
696
  this._icon = t;
697
697
  }
698
698
  }
699
- class Ot extends D {
699
+ class Ot extends N {
700
700
  constructor(t) {
701
701
  var s;
702
702
  super(t);
@@ -833,9 +833,9 @@ class Wt extends F {
833
833
  return this._container.rows.flat().filter((t) => !t.invisible);
834
834
  }
835
835
  }
836
- class Tt extends f {
836
+ class zt extends f {
837
837
  }
838
- class N extends f {
838
+ class A extends f {
839
839
  constructor(t) {
840
840
  super(t);
841
841
  /**
@@ -942,7 +942,7 @@ class $ extends f {
942
942
  this._translatable = t;
943
943
  }
944
944
  }
945
- class z extends f {
945
+ class I extends f {
946
946
  constructor(t) {
947
947
  super(t);
948
948
  /**
@@ -958,7 +958,7 @@ class z extends f {
958
958
  this._size = t;
959
959
  }
960
960
  }
961
- class It extends f {
961
+ class Tt extends f {
962
962
  constructor(t) {
963
963
  super(t);
964
964
  /**
@@ -993,7 +993,7 @@ class It extends f {
993
993
  return this.parsedWidgetProps.showMenu;
994
994
  }
995
995
  }
996
- class zt extends $ {
996
+ class It extends $ {
997
997
  }
998
998
  class it extends f {
999
999
  constructor(e) {
@@ -1049,7 +1049,7 @@ class jt extends f {
1049
1049
  super(e);
1050
1050
  }
1051
1051
  }
1052
- class Dt extends f {
1052
+ class Nt extends f {
1053
1053
  constructor(t) {
1054
1054
  super(t);
1055
1055
  r(this, "_timezone");
@@ -1156,7 +1156,7 @@ class st extends f {
1156
1156
  this._infinite = t;
1157
1157
  }
1158
1158
  }
1159
- class Mt extends k {
1159
+ class Dt extends k {
1160
1160
  constructor(t) {
1161
1161
  super(t);
1162
1162
  /**
@@ -1182,9 +1182,9 @@ class Mt extends k {
1182
1182
  return null;
1183
1183
  }
1184
1184
  }
1185
- class Bt extends z {
1185
+ class Mt extends I {
1186
1186
  }
1187
- class At extends f {
1187
+ class Bt extends f {
1188
1188
  constructor(t) {
1189
1189
  super(t);
1190
1190
  /**
@@ -1200,18 +1200,81 @@ class At extends f {
1200
1200
  this._filenameField = t;
1201
1201
  }
1202
1202
  }
1203
- class Nt extends f {
1203
+ class At extends f {
1204
+ constructor(t) {
1205
+ super(t);
1206
+ r(this, "_width");
1207
+ r(this, "_height");
1208
+ if (t) {
1209
+ if (t.width) {
1210
+ const s = parseInt(t.width);
1211
+ this._width = isNaN(s) ? void 0 : s;
1212
+ }
1213
+ if (t.height) {
1214
+ const s = parseInt(t.height);
1215
+ this._height = isNaN(s) ? void 0 : s;
1216
+ }
1217
+ }
1218
+ }
1219
+ get width() {
1220
+ return this._width;
1221
+ }
1222
+ set width(t) {
1223
+ this._width = t;
1224
+ }
1225
+ get height() {
1226
+ return this._height;
1227
+ }
1228
+ set height(t) {
1229
+ this._height = t;
1230
+ }
1204
1231
  get showControls() {
1205
- var e;
1206
- return ((e = this.parsedWidgetProps) == null ? void 0 : e.showControls) ?? !0;
1232
+ var t;
1233
+ return ((t = this.parsedWidgetProps) == null ? void 0 : t.showControls) ?? !0;
1207
1234
  }
1208
1235
  }
1209
1236
  class Rt extends f {
1237
+ constructor(t) {
1238
+ super({ ...t, nolabel: !0 });
1239
+ /**
1240
+ * Icon name
1241
+ */
1242
+ r(this, "_name", "");
1243
+ /**
1244
+ * Icon size
1245
+ */
1246
+ r(this, "_size", 16);
1247
+ /**
1248
+ * Icon color
1249
+ */
1250
+ r(this, "_color", "");
1251
+ t && (t.name && (this._name = t.name), t.size && (this._size = t.size), t.color && (this._color = t.color));
1252
+ }
1253
+ get name() {
1254
+ return this._name;
1255
+ }
1256
+ set name(t) {
1257
+ this._name = t;
1258
+ }
1259
+ get size() {
1260
+ return this._size;
1261
+ }
1262
+ set size(t) {
1263
+ this._size = t;
1264
+ }
1265
+ get color() {
1266
+ return this._color;
1267
+ }
1268
+ set color(t) {
1269
+ this._color = t;
1270
+ }
1271
+ }
1272
+ class Lt extends f {
1210
1273
  constructor(e) {
1211
1274
  super(e);
1212
1275
  }
1213
1276
  }
1214
- class Lt extends st {
1277
+ class Gt extends st {
1215
1278
  constructor(t) {
1216
1279
  super(t);
1217
1280
  /**
@@ -1243,7 +1306,7 @@ class Lt extends st {
1243
1306
  return this.parsedWidgetProps.colorField;
1244
1307
  }
1245
1308
  }
1246
- class Gt extends z {
1309
+ class $t extends I {
1247
1310
  constructor(t) {
1248
1311
  super(t);
1249
1312
  r(this, "_nolabel", !0);
@@ -1370,9 +1433,9 @@ class rt extends f {
1370
1433
  this._columns = t;
1371
1434
  }
1372
1435
  }
1373
- class $t extends rt {
1436
+ class qt extends rt {
1374
1437
  }
1375
- class qt extends z {
1438
+ class Jt extends I {
1376
1439
  get colors() {
1377
1440
  return this._parsedWidgetProps.colors || {};
1378
1441
  }
@@ -1381,7 +1444,7 @@ class qt extends z {
1381
1444
  return ((e = this._parsedWidgetProps) == null ? void 0 : e.colorField) || null;
1382
1445
  }
1383
1446
  }
1384
- class Jt extends z {
1447
+ class Ht extends I {
1385
1448
  constructor(t) {
1386
1449
  super(t);
1387
1450
  /**
@@ -1397,9 +1460,9 @@ class Jt extends z {
1397
1460
  this._direction = t;
1398
1461
  }
1399
1462
  }
1400
- class Ht extends it {
1463
+ class Qt extends it {
1401
1464
  }
1402
- class Qt extends f {
1465
+ class Kt extends f {
1403
1466
  constructor(t) {
1404
1467
  super(t);
1405
1468
  /**
@@ -1442,12 +1505,12 @@ class nt extends $ {
1442
1505
  this._lang = t;
1443
1506
  }
1444
1507
  }
1445
- class Kt extends f {
1508
+ class Xt extends f {
1446
1509
  constructor(e) {
1447
1510
  super(e);
1448
1511
  }
1449
1512
  }
1450
- class Xt extends F {
1513
+ class Ut extends F {
1451
1514
  constructor(t) {
1452
1515
  super(t);
1453
1516
  /**
@@ -1487,7 +1550,7 @@ class Xt extends F {
1487
1550
  return this._container.rows.flat().filter((t) => !t.invisible);
1488
1551
  }
1489
1552
  }
1490
- class Ut extends f {
1553
+ class Zt extends f {
1491
1554
  constructor(t) {
1492
1555
  super(t);
1493
1556
  /**
@@ -1512,7 +1575,7 @@ class K extends nt {
1512
1575
  r(this, "_lang", "json");
1513
1576
  }
1514
1577
  }
1515
- class Zt extends f {
1578
+ class te extends f {
1516
1579
  constructor(t) {
1517
1580
  super(t);
1518
1581
  r(this, "_multi", !1);
@@ -1532,7 +1595,7 @@ class Zt extends f {
1532
1595
  this._size = t;
1533
1596
  }
1534
1597
  }
1535
- class te extends F {
1598
+ class ee extends F {
1536
1599
  constructor(t) {
1537
1600
  super(t);
1538
1601
  r(this, "_autoPlay", !0);
@@ -1548,12 +1611,12 @@ class te extends F {
1548
1611
  return this._container.rows.flat().filter((t) => !t.invisible);
1549
1612
  }
1550
1613
  }
1551
- class ee extends N {
1614
+ class ie extends A {
1552
1615
  get showText() {
1553
1616
  return this.parsedWidgetProps.show_text ?? !0;
1554
1617
  }
1555
1618
  }
1556
- class ie extends f {
1619
+ class se extends f {
1557
1620
  get width() {
1558
1621
  var e;
1559
1622
  return (e = this.parsedWidgetProps) == null ? void 0 : e.width;
@@ -1567,7 +1630,7 @@ class ie extends f {
1567
1630
  return console.log(this.parsedWidgetProps), ((e = this.parsedWidgetProps) == null ? void 0 : e.showValue) ?? !1;
1568
1631
  }
1569
1632
  }
1570
- class se extends D {
1633
+ class re extends N {
1571
1634
  constructor(t) {
1572
1635
  super(t);
1573
1636
  r(this, "_title", null);
@@ -1600,7 +1663,7 @@ class se extends D {
1600
1663
  this._height = t;
1601
1664
  }
1602
1665
  }
1603
- class M {
1666
+ class D {
1604
1667
  constructor() {
1605
1668
  /**
1606
1669
  * Widget class
@@ -1610,7 +1673,7 @@ class M {
1610
1673
  setWidgetClass(e) {
1611
1674
  switch (e) {
1612
1675
  case "notebook":
1613
- this._widgetClass = A;
1676
+ this._widgetClass = B;
1614
1677
  break;
1615
1678
  case "page":
1616
1679
  this._widgetClass = Pt;
@@ -1619,13 +1682,13 @@ class M {
1619
1682
  this._widgetClass = Ot;
1620
1683
  break;
1621
1684
  case "card":
1622
- this._widgetClass = se;
1685
+ this._widgetClass = re;
1623
1686
  break;
1624
1687
  case "label":
1625
1688
  this._widgetClass = et;
1626
1689
  break;
1627
1690
  case "char":
1628
- this._widgetClass = N;
1691
+ this._widgetClass = A;
1629
1692
  break;
1630
1693
  case "text":
1631
1694
  this._widgetClass = $;
@@ -1637,13 +1700,13 @@ class M {
1637
1700
  this._widgetClass = Wt;
1638
1701
  break;
1639
1702
  case "action_buttons":
1640
- this._widgetClass = Tt;
1703
+ this._widgetClass = zt;
1641
1704
  break;
1642
1705
  case "selection":
1643
- this._widgetClass = z;
1706
+ this._widgetClass = I;
1644
1707
  break;
1645
1708
  case "many2one":
1646
- this._widgetClass = It;
1709
+ this._widgetClass = Tt;
1647
1710
  break;
1648
1711
  case "boolean":
1649
1712
  this._widgetClass = it;
@@ -1661,13 +1724,13 @@ class M {
1661
1724
  this._widgetClass = jt;
1662
1725
  break;
1663
1726
  case "datetime":
1664
- this._widgetClass = Dt;
1727
+ this._widgetClass = Nt;
1665
1728
  break;
1666
1729
  case "progressbar":
1667
1730
  this._widgetClass = Yt;
1668
1731
  break;
1669
1732
  case "markdown":
1670
- this._widgetClass = zt;
1733
+ this._widgetClass = It;
1671
1734
  break;
1672
1735
  case "many2many":
1673
1736
  case "one2many":
@@ -1678,67 +1741,70 @@ class M {
1678
1741
  this._widgetClass = tt;
1679
1742
  break;
1680
1743
  case "separator":
1681
- this._widgetClass = Mt;
1744
+ this._widgetClass = Dt;
1682
1745
  break;
1683
1746
  case "url":
1684
- this._widgetClass = N;
1747
+ this._widgetClass = A;
1685
1748
  break;
1686
1749
  case "email":
1687
- this._widgetClass = Zt;
1750
+ this._widgetClass = te;
1688
1751
  break;
1689
1752
  case "reference":
1690
- this._widgetClass = Bt;
1753
+ this._widgetClass = Mt;
1691
1754
  break;
1692
1755
  case "binary":
1693
- this._widgetClass = At;
1756
+ this._widgetClass = Bt;
1694
1757
  break;
1695
1758
  case "image":
1696
- this._widgetClass = Nt;
1759
+ this._widgetClass = At;
1697
1760
  break;
1698
- case "fiber_grid":
1761
+ case "icon":
1699
1762
  this._widgetClass = Rt;
1700
1763
  break;
1701
- case "timeline":
1764
+ case "fiber_grid":
1702
1765
  this._widgetClass = Lt;
1703
1766
  break;
1704
- case "indicator":
1767
+ case "timeline":
1705
1768
  this._widgetClass = Gt;
1706
1769
  break;
1707
- case "tags":
1770
+ case "indicator":
1708
1771
  this._widgetClass = $t;
1709
1772
  break;
1710
- case "tag":
1773
+ case "tags":
1711
1774
  this._widgetClass = qt;
1712
1775
  break;
1776
+ case "tag":
1777
+ this._widgetClass = Jt;
1778
+ break;
1713
1779
  case "avatar":
1714
1780
  this._widgetClass = kt;
1715
1781
  break;
1716
1782
  case "radio":
1717
- this._widgetClass = Jt;
1783
+ this._widgetClass = Ht;
1718
1784
  break;
1719
1785
  case "multicheckbox":
1720
1786
  this._widgetClass = rt;
1721
1787
  break;
1722
1788
  case "switch":
1723
- this._widgetClass = Ht;
1789
+ this._widgetClass = Qt;
1724
1790
  break;
1725
1791
  case "steps":
1726
- this._widgetClass = Qt;
1792
+ this._widgetClass = Kt;
1727
1793
  break;
1728
1794
  case "codeeditor":
1729
1795
  this._widgetClass = nt;
1730
1796
  break;
1731
1797
  case "time":
1732
- this._widgetClass = Kt;
1798
+ this._widgetClass = Xt;
1733
1799
  break;
1734
1800
  case "html_preview":
1735
1801
  this._widgetClass = Vt;
1736
1802
  break;
1737
1803
  case "alert":
1738
- this._widgetClass = Xt;
1804
+ this._widgetClass = Ut;
1739
1805
  break;
1740
1806
  case "comments_timeline":
1741
- this._widgetClass = Ut;
1807
+ this._widgetClass = Zt;
1742
1808
  break;
1743
1809
  case "json":
1744
1810
  this._widgetClass = K;
@@ -1747,16 +1813,16 @@ class M {
1747
1813
  this._widgetClass = K;
1748
1814
  break;
1749
1815
  case "spinner":
1750
- this._widgetClass = D;
1816
+ this._widgetClass = N;
1751
1817
  break;
1752
1818
  case "carousel":
1753
- this._widgetClass = te;
1819
+ this._widgetClass = ee;
1754
1820
  break;
1755
1821
  case "colorPicker":
1756
- this._widgetClass = ee;
1822
+ this._widgetClass = ie;
1757
1823
  break;
1758
1824
  case "qrcode":
1759
- this._widgetClass = ie;
1825
+ this._widgetClass = se;
1760
1826
  break;
1761
1827
  }
1762
1828
  }
@@ -1780,7 +1846,7 @@ class M {
1780
1846
  }
1781
1847
  }
1782
1848
  }
1783
- const re = ({
1849
+ const ne = ({
1784
1850
  fieldName: i,
1785
1851
  values: e,
1786
1852
  fields: t
@@ -1805,7 +1871,7 @@ const re = ({
1805
1871
  n[l] = d.some((_) => _);
1806
1872
  }
1807
1873
  return n;
1808
- }, ne = ({
1874
+ }, ae = ({
1809
1875
  states: i,
1810
1876
  values: e
1811
1877
  }) => {
@@ -1814,7 +1880,7 @@ const re = ({
1814
1880
  const t = i.split(",");
1815
1881
  return t.length === 0 ? {} : t.includes(e.state) ? {} : { invisible: !0 };
1816
1882
  };
1817
- function ae({
1883
+ function le({
1818
1884
  values: i = {},
1819
1885
  fieldName: e,
1820
1886
  fields: t = {}
@@ -1842,7 +1908,7 @@ const J = ({
1842
1908
  return u.forEach((c) => {
1843
1909
  const b = c[1];
1844
1910
  if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
1845
- const x = ae({
1911
+ const x = le({
1846
1912
  values: e,
1847
1913
  fields: t,
1848
1914
  fieldName: b === "active_id" ? "id" : b
@@ -1857,7 +1923,7 @@ const J = ({
1857
1923
  } catch {
1858
1924
  return;
1859
1925
  }
1860
- }, ze = (i) => {
1926
+ }, Se = (i) => {
1861
1927
  const e = [];
1862
1928
  try {
1863
1929
  return !i || lt(i) || typeof i != "string" ? e : at(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) => {
@@ -1877,14 +1943,14 @@ function at(i) {
1877
1943
  function lt(i) {
1878
1944
  return typeof i == "object" && i !== null && typeof i != "string";
1879
1945
  }
1880
- const le = (i) => {
1946
+ const oe = (i) => {
1881
1947
  const e = i.trim().replace(")", "").split("("), t = e[0], n = e[1].split(",").map((a) => a.trim());
1882
1948
  return {
1883
1949
  method: t,
1884
1950
  args: n
1885
1951
  };
1886
1952
  };
1887
- function oe(i) {
1953
+ function ce(i) {
1888
1954
  const e = [];
1889
1955
  function t(s) {
1890
1956
  const n = [];
@@ -1896,7 +1962,7 @@ function oe(i) {
1896
1962
  t(s);
1897
1963
  return e.flat();
1898
1964
  }
1899
- class Se {
1965
+ class Ee {
1900
1966
  constructor(e, t = 4) {
1901
1967
  /**
1902
1968
  * Object containing fields specification of the form.
@@ -2006,13 +2072,13 @@ class Se {
2006
2072
  }
2007
2073
  parse(e, t) {
2008
2074
  var l;
2009
- const { values: s = {}, readOnly: n = !1 } = t || {}, a = I.parse(e).filter((d) => d.tagName === "form")[0];
2075
+ const { values: s = {}, readOnly: n = !1 } = t || {}, a = T.parse(e).filter((d) => d.tagName === "form")[0];
2010
2076
  this._string = ((l = a.attributes) == null ? void 0 : l.string) || null, this._string && (this._string = g(this._string)), this._readOnly = n, this._context = s.id ? { active_id: s.id, active_ids: [s.id] } : {}, this._invisibleFields = [], this.parseNode({
2011
2077
  fields: a.children,
2012
2078
  container: this._container,
2013
2079
  values: s
2014
2080
  });
2015
- const o = oe(this._container._rows);
2081
+ const o = ce(this._container._rows);
2016
2082
  o.forEach((d) => {
2017
2083
  const _ = d;
2018
2084
  _._id && _._context && (this._contextForFields[_._id] = d._context);
@@ -2023,7 +2089,7 @@ class Se {
2023
2089
  container: t,
2024
2090
  values: s
2025
2091
  }) {
2026
- const n = new M();
2092
+ const n = new D();
2027
2093
  e.filter((a) => typeof a == "object").forEach((a) => {
2028
2094
  var v, C;
2029
2095
  const { tagName: o, attributes: l, children: d } = a;
@@ -2055,10 +2121,10 @@ class Se {
2055
2121
  widgetType: o
2056
2122
  });
2057
2123
  let m;
2058
- o === "button" && h.states ? m = ne({
2124
+ o === "button" && h.states ? m = ae({
2059
2125
  states: h.states,
2060
2126
  values: s
2061
- }) : m = re({
2127
+ }) : m = ne({
2062
2128
  fieldName: h.name,
2063
2129
  values: s,
2064
2130
  fields: this._fields
@@ -2068,7 +2134,7 @@ class Se {
2068
2134
  values: s,
2069
2135
  fields: this._fields
2070
2136
  });
2071
- h.on_change && (this._onChangeFields[h.name] = le(
2137
+ h.on_change && (this._onChangeFields[h.name] = oe(
2072
2138
  h.on_change
2073
2139
  ));
2074
2140
  let b;
@@ -2100,7 +2166,7 @@ class Se {
2100
2166
  function X(i) {
2101
2167
  return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
2102
2168
  }
2103
- class Ee {
2169
+ class Ve {
2104
2170
  constructor(e) {
2105
2171
  /**
2106
2172
  * Object containing fields specification of the form.
@@ -2172,9 +2238,9 @@ class Ee {
2172
2238
  this._infinite = e;
2173
2239
  }
2174
2240
  parse(e) {
2175
- const t = I.parse(e).filter((n) => n.tagName === "tree")[0];
2241
+ const t = T.parse(e).filter((n) => n.tagName === "tree")[0];
2176
2242
  this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors)), this._status = t.attributes.status || null, this._status && (this._status = g(this._status)), this._editable = t.attributes.editable || null, this._infinite = t.attributes.infinite || !1;
2177
- const s = new M();
2243
+ const s = new D();
2178
2244
  t.children.forEach((n) => {
2179
2245
  const { tagName: a, attributes: o } = n;
2180
2246
  let l = null;
@@ -2214,7 +2280,7 @@ class Ee {
2214
2280
  return this._columns.find((t) => t.findById ? t.findById(e) : !1);
2215
2281
  }
2216
2282
  }
2217
- class Ve {
2283
+ class Ye {
2218
2284
  constructor(e) {
2219
2285
  /**
2220
2286
  * Object containing fields specification of the kanban.
@@ -2304,11 +2370,11 @@ class Ve {
2304
2370
  return this._aggregations;
2305
2371
  }
2306
2372
  parse(e) {
2307
- const t = I.parse(e).filter((n) => n.tagName === "kanban")[0];
2373
+ const t = T.parse(e).filter((n) => n.tagName === "kanban")[0];
2308
2374
  if (this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._column_field = t.attributes.column_field || null, !this._column_field)
2309
2375
  throw new Error("Kanban view must have a column_field attribute");
2310
2376
  this._drag = t.attributes.drag !== void 0 ? p(t.attributes.drag) : !0, this._sort = t.attributes.sort !== void 0 ? p(t.attributes.sort) : !0, this._set_max_cards = t.attributes.set_max_cards !== void 0 ? p(t.attributes.set_max_cards) : !1, this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors));
2311
- const s = new M();
2377
+ const s = new D();
2312
2378
  t.children.forEach((n) => {
2313
2379
  const { tagName: a, attributes: o } = n;
2314
2380
  a === "field" ? this._parseField(n, o, s) : a === "button" && this._parseButton(n, o);
@@ -2362,7 +2428,7 @@ class Ve {
2362
2428
  return t || this._buttons.find((n) => n.findById ? n.findById(e) : !1) || null;
2363
2429
  }
2364
2430
  }
2365
- const ce = {
2431
+ const de = {
2366
2432
  text: "text",
2367
2433
  many2one: "many2one",
2368
2434
  char: "char",
@@ -2375,7 +2441,7 @@ const ce = {
2375
2441
  date: "date",
2376
2442
  datetime: "datetime"
2377
2443
  };
2378
- class Ye {
2444
+ class je {
2379
2445
  constructor(e, t, s = 8) {
2380
2446
  /**
2381
2447
  * Object containing the specific fields for primary and secondary search fields
@@ -2402,7 +2468,7 @@ class Ye {
2402
2468
  return this._advancedSearchContainer;
2403
2469
  }
2404
2470
  parse() {
2405
- const e = new M();
2471
+ const e = new D();
2406
2472
  this.parseFields(
2407
2473
  this.searchFields.primary,
2408
2474
  e
@@ -2423,7 +2489,7 @@ class Ye {
2423
2489
  colspan: 2
2424
2490
  }, { type: a, widget: o } = n;
2425
2491
  let l = o ?? a;
2426
- return ce[l] === void 0 && (l = a), t.createWidget(l, n);
2492
+ return de[l] === void 0 && (l = a), t.createWidget(l, n);
2427
2493
  });
2428
2494
  }
2429
2495
  /**
@@ -2434,7 +2500,7 @@ class Ye {
2434
2500
  return this.advancedSearchContainer.findById(e);
2435
2501
  }
2436
2502
  }
2437
- const je = ({
2503
+ const Ne = ({
2438
2504
  domain: i,
2439
2505
  widgetFieldName: e
2440
2506
  }) => {
@@ -2450,7 +2516,7 @@ const je = ({
2450
2516
  )) : (l = n, d = "id"), l === e && t.push([d, a, o]);
2451
2517
  }), t;
2452
2518
  }, De = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((e) => e.trim()).filter((e) => !e.includes("'"));
2453
- class de {
2519
+ class ue {
2454
2520
  constructor(e) {
2455
2521
  r(this, "_action_id", null);
2456
2522
  r(this, "_position", null);
@@ -2467,11 +2533,11 @@ class Me {
2467
2533
  constructor(e) {
2468
2534
  r(this, "_string", null);
2469
2535
  r(this, "_items", []);
2470
- const t = I.parse(e).filter((n) => n.tagName === "dashboard")[0];
2536
+ const t = T.parse(e).filter((n) => n.tagName === "dashboard")[0];
2471
2537
  this._string = t.attributes.string || null;
2472
2538
  const { children: s } = t;
2473
2539
  s.forEach((n) => {
2474
- n.tagName === "dashboard_item" && this._items.push(new de(n.attributes));
2540
+ n.tagName === "dashboard_item" && this._items.push(new ue(n.attributes));
2475
2541
  });
2476
2542
  }
2477
2543
  get string() {
@@ -2535,7 +2601,7 @@ class ct extends ot {
2535
2601
  return this._suffix;
2536
2602
  }
2537
2603
  }
2538
- class ue extends ct {
2604
+ class he extends ct {
2539
2605
  constructor(t, s) {
2540
2606
  super(t, s);
2541
2607
  r(this, "_field");
@@ -2555,7 +2621,7 @@ class ue extends ct {
2555
2621
  return this._operator;
2556
2622
  }
2557
2623
  }
2558
- const he = (i) => {
2624
+ const _e = (i) => {
2559
2625
  const e = [];
2560
2626
  let t;
2561
2627
  if (i.forEach((s) => {
@@ -2565,10 +2631,10 @@ const he = (i) => {
2565
2631
  throw new Error(`Field ${o} doesn't have an axis`);
2566
2632
  if (!o)
2567
2633
  throw new Error("Missing name attribute for field");
2568
- n === "x" ? t = new ge({
2634
+ n === "x" ? t = new me({
2569
2635
  name: o
2570
2636
  }) : n === "y" && e.push(
2571
- new fe({
2637
+ new ge({
2572
2638
  name: o,
2573
2639
  operator: a,
2574
2640
  label: l,
@@ -2585,13 +2651,13 @@ const he = (i) => {
2585
2651
  y: e
2586
2652
  };
2587
2653
  };
2588
- class B extends ot {
2654
+ class M extends ot {
2589
2655
  constructor(t, s) {
2590
2656
  super(s);
2591
2657
  r(this, "_x");
2592
2658
  r(this, "_y");
2593
2659
  this._type = t;
2594
- const n = he(s.children);
2660
+ const n = _e(s.children);
2595
2661
  this._x = n.x, this._y = n.y;
2596
2662
  }
2597
2663
  get x() {
@@ -2601,17 +2667,17 @@ class B extends ot {
2601
2667
  return this._y;
2602
2668
  }
2603
2669
  }
2604
- const _e = {
2670
+ const fe = {
2605
2671
  indicator: ct,
2606
- indicatorField: ue,
2607
- line: B,
2608
- bar: B,
2609
- pie: B
2672
+ indicatorField: he,
2673
+ line: M,
2674
+ bar: M,
2675
+ pie: M
2610
2676
  }, Be = (i) => {
2611
- const e = I.parse(i).filter((n) => n.tagName === "graph")[0], t = e.attributes.type;
2677
+ const e = T.parse(i).filter((n) => n.tagName === "graph")[0], t = e.attributes.type;
2612
2678
  if (!t)
2613
2679
  throw new Error(`${t} is not a valid graph`);
2614
- const s = _e[t];
2680
+ const s = fe[t];
2615
2681
  if (!s)
2616
2682
  throw new Error(`${t} not found as a GraphModel`);
2617
2683
  return new s(t, e);
@@ -2629,7 +2695,7 @@ class dt {
2629
2695
  return this._axis;
2630
2696
  }
2631
2697
  }
2632
- class fe extends dt {
2698
+ class ge extends dt {
2633
2699
  constructor({
2634
2700
  name: t,
2635
2701
  operator: s,
@@ -2652,12 +2718,12 @@ class fe extends dt {
2652
2718
  return this._stacked;
2653
2719
  }
2654
2720
  }
2655
- class ge extends dt {
2721
+ class me extends dt {
2656
2722
  constructor({ name: e }) {
2657
2723
  super({ name: e, axis: "x" });
2658
2724
  }
2659
2725
  }
2660
- const me = ({ ooui: i }) => {
2726
+ const be = ({ ooui: i }) => {
2661
2727
  const t = [i.x.name];
2662
2728
  return i.y ? (i.y.forEach((s) => {
2663
2729
  s.operator !== "count" && !t.includes(s.name) && t.push(s.name), s.label && !t.includes(s.label) && t.push(s.label);
@@ -2681,25 +2747,25 @@ function H({
2681
2747
  }
2682
2748
  const Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2683
2749
  __proto__: null,
2684
- getFieldsToRetrieve: me,
2750
+ getFieldsToRetrieve: be,
2685
2751
  getValueAndLabelForField: H
2686
2752
  }, Symbol.toStringTag, { value: "Module" }));
2687
- function be({
2753
+ function ye({
2688
2754
  values: i,
2689
2755
  timerange: e,
2690
2756
  interval: t = 1
2691
2757
  }) {
2692
- const s = pe({
2758
+ const s = we({
2693
2759
  values: i,
2694
2760
  timerange: e
2695
2761
  });
2696
- return ye({
2762
+ return xe({
2697
2763
  values: s,
2698
2764
  timerange: e,
2699
2765
  interval: t
2700
2766
  });
2701
2767
  }
2702
- function ye({
2768
+ function xe({
2703
2769
  values: i,
2704
2770
  timerange: e,
2705
2771
  interval: t = 1
@@ -2717,7 +2783,7 @@ function ye({
2717
2783
  return;
2718
2784
  const u = h.x, m = d[_ + 1].x;
2719
2785
  if (!ut([u, m], a)) {
2720
- const c = xe({
2786
+ const c = pe({
2721
2787
  dates: [u, m],
2722
2788
  timerange: e,
2723
2789
  interval: t
@@ -2734,7 +2800,7 @@ function ye({
2734
2800
  }
2735
2801
  }), s.sort((l, d) => l.x < d.x ? -1 : l.x > d.x ? 1 : 0);
2736
2802
  }
2737
- function xe({
2803
+ function pe({
2738
2804
  dates: i,
2739
2805
  timerange: e,
2740
2806
  interval: t = 1
@@ -2746,21 +2812,21 @@ function xe({
2746
2812
  for (let o = 0; o < a.length - 1; o++) {
2747
2813
  const l = a[o], d = a[o + 1];
2748
2814
  if (!ut([l, d], n)) {
2749
- const _ = T(l, V(n)).add(
2815
+ const _ = z(l, V(n)).add(
2750
2816
  t,
2751
2817
  n
2752
- ), h = T(d, V(n));
2818
+ ), h = z(d, V(n));
2753
2819
  for (; _.isBefore(h); )
2754
2820
  s.push(_.format(V(n))), _.add(t, n);
2755
2821
  }
2756
2822
  }
2757
2823
  return s;
2758
2824
  }
2759
- function pe({
2825
+ function we({
2760
2826
  values: i,
2761
2827
  timerange: e
2762
2828
  }) {
2763
- const t = we({
2829
+ const t = Fe({
2764
2830
  values: i,
2765
2831
  timerange: e
2766
2832
  }), s = [], n = ht({
@@ -2778,24 +2844,24 @@ function pe({
2778
2844
  });
2779
2845
  }), s;
2780
2846
  }
2781
- function we({
2847
+ function Fe({
2782
2848
  values: i,
2783
2849
  timerange: e
2784
2850
  }) {
2785
2851
  return i.map((t) => ({
2786
2852
  ...t,
2787
- x: Fe({
2853
+ x: ve({
2788
2854
  date: t.x,
2789
2855
  timerange: e
2790
2856
  })
2791
2857
  }));
2792
2858
  }
2793
- function Fe({
2859
+ function ve({
2794
2860
  date: i,
2795
2861
  timerange: e
2796
2862
  }) {
2797
- let t = ve(i);
2798
- const s = T(i, t);
2863
+ let t = Ce(i);
2864
+ const s = z(i, t);
2799
2865
  switch (e) {
2800
2866
  case "hour": {
2801
2867
  t = "YYYY-MM-DD HH:00";
@@ -2820,7 +2886,7 @@ function Fe({
2820
2886
  }
2821
2887
  return s.format(t);
2822
2888
  }
2823
- function ve(i) {
2889
+ function Ce(i) {
2824
2890
  return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
2825
2891
  }
2826
2892
  function ut(i, e) {
@@ -2831,7 +2897,7 @@ function ut(i, e) {
2831
2897
  if (i.length === 1)
2832
2898
  return !0;
2833
2899
  for (let n = 0; n < i.length - 1; n++) {
2834
- const a = T(i[n], s), l = T(i[n + 1], s).diff(a, e);
2900
+ const a = z(i[n], s), l = z(i[n + 1], s).diff(a, e);
2835
2901
  Math.abs(l) === 1 ? t = !0 : t = !1;
2836
2902
  }
2837
2903
  return t;
@@ -2861,7 +2927,7 @@ function V(i) {
2861
2927
  return "YYYY-MM-DD HH:mm";
2862
2928
  }
2863
2929
  }
2864
- const Ce = {
2930
+ const ke = {
2865
2931
  count: "count",
2866
2932
  "+": "sum",
2867
2933
  "-": "subtract",
@@ -2869,7 +2935,7 @@ const Ce = {
2869
2935
  avg: "average",
2870
2936
  min: "min",
2871
2937
  max: "max"
2872
- }, ke = ({
2938
+ }, Pe = ({
2873
2939
  ooui: i,
2874
2940
  values: e,
2875
2941
  fields: t,
@@ -2936,7 +3002,7 @@ const Ce = {
2936
3002
  (c) => c.x !== !1
2937
3003
  ));
2938
3004
  let u = h;
2939
- i.timerange ? u = be({
3005
+ i.timerange ? u = ye({
2940
3006
  values: u,
2941
3007
  timerange: i.timerange,
2942
3008
  interval: i.interval
@@ -3018,7 +3084,7 @@ function L({
3018
3084
  s[a] || (s[a] = { label: o, entries: [] }), s[a].entries.push(n);
3019
3085
  }), s;
3020
3086
  }
3021
- function Pe(i) {
3087
+ function Oe(i) {
3022
3088
  let e = [];
3023
3089
  return Object.keys(i).forEach((t) => {
3024
3090
  const s = i[t];
@@ -3041,88 +3107,89 @@ function ft(i, e = 0.1) {
3041
3107
  max: n + a
3042
3108
  };
3043
3109
  }
3044
- const Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3110
+ const Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3045
3111
  __proto__: null,
3046
- getAllObjectsInGroupedValues: Pe,
3112
+ getAllObjectsInGroupedValues: Oe,
3047
3113
  getMinMax: ft,
3048
3114
  getValueForOperator: j,
3049
3115
  getValuesForYField: R,
3050
3116
  getValuesGroupedByField: L,
3051
3117
  getYAxisFieldname: _t,
3052
- labelsForOperator: Ce,
3053
- processGraphData: ke
3118
+ labelsForOperator: ke,
3119
+ processGraphData: Pe
3054
3120
  }, Symbol.toStringTag, { value: "Module" }));
3055
3121
  export {
3056
- Tt as ActionButtons,
3057
- Xt as Alert,
3122
+ zt as ActionButtons,
3123
+ Ut as Alert,
3058
3124
  kt as Avatar,
3059
- At as Binary,
3125
+ Bt as Binary,
3060
3126
  it as Boolean,
3061
3127
  G as Button,
3062
3128
  Wt as ButtonGroup,
3063
- se as Card,
3064
- te as Carousel,
3065
- N as Char,
3129
+ re as Card,
3130
+ ee as Carousel,
3131
+ A as Char,
3066
3132
  nt as CodeEditor,
3067
- ee as ColorPicker,
3068
- Ut as Comments,
3133
+ ie as ColorPicker,
3134
+ Zt as Comments,
3069
3135
  Y as Container,
3070
3136
  F as ContainerWidget,
3071
3137
  Me as Dashboard,
3072
- de as DashboardItem,
3138
+ ue as DashboardItem,
3073
3139
  jt as Date,
3074
- Dt as DateTime,
3075
- Zt as Email,
3140
+ Nt as DateTime,
3141
+ te as Email,
3076
3142
  f as Field,
3077
3143
  q as Float,
3078
3144
  Et as FloatTime,
3079
- Se as Form,
3145
+ Ee as Form,
3080
3146
  ot as Graph,
3081
3147
  dt as GraphAxis,
3082
- B as GraphChart,
3148
+ M as GraphChart,
3083
3149
  ct as GraphIndicator,
3084
- ue as GraphIndicatorField,
3085
- ge as GraphXAxis,
3086
- fe as GraphYAxis,
3150
+ he as GraphIndicatorField,
3151
+ me as GraphXAxis,
3152
+ ge as GraphYAxis,
3087
3153
  Ot as Group,
3088
3154
  Vt as HTMLPreview,
3089
- Nt as Image,
3090
- Gt as Indicator,
3155
+ Rt as Icon,
3156
+ At as Image,
3157
+ $t as Indicator,
3091
3158
  St as Integer,
3092
3159
  K as JSONField,
3093
- Ve as Kanban,
3160
+ Ye as Kanban,
3094
3161
  et as Label,
3095
- It as Many2one,
3096
- zt as Markdown,
3162
+ Tt as Many2one,
3163
+ It as Markdown,
3097
3164
  rt as MultiCheckbox,
3098
3165
  tt as NewLine,
3099
- A as Notebook,
3166
+ B as Notebook,
3100
3167
  st as One2many,
3101
3168
  Pt as Page,
3102
3169
  Yt as ProgressBar,
3103
- ie as QRCode,
3104
- Jt as Radio,
3105
- Bt as Reference,
3106
- ce as SearchFieldTypes,
3107
- Ye as SearchFilter,
3108
- z as Selection,
3109
- Mt as Separator,
3110
- D as Spinner,
3111
- Qt as Steps,
3112
- Ht as Switch,
3113
- qt as Tag,
3114
- $t as Tags,
3170
+ se as QRCode,
3171
+ Ht as Radio,
3172
+ Mt as Reference,
3173
+ de as SearchFieldTypes,
3174
+ je as SearchFilter,
3175
+ I as Selection,
3176
+ Dt as Separator,
3177
+ N as Spinner,
3178
+ Kt as Steps,
3179
+ Qt as Switch,
3180
+ Jt as Tag,
3181
+ qt as Tags,
3115
3182
  $ as Text,
3116
- Kt as Time,
3117
- Lt as Timeline,
3118
- Ee as Tree,
3183
+ Xt as Time,
3184
+ Gt as Timeline,
3185
+ Ve as Tree,
3119
3186
  k as Widget,
3120
3187
  Ae as graphFieldUtils,
3121
- Ne as graphProcessor,
3188
+ Re as graphProcessor,
3122
3189
  J as parseContext,
3123
- ze as parseContextFields,
3190
+ Se as parseContextFields,
3124
3191
  De as parseDomainFields,
3125
3192
  Be as parseGraph,
3126
- je as transformDomainForChildWidget
3193
+ Ne as transformDomainForChildWidget
3127
3194
  };
3128
3195
  //# sourceMappingURL=ooui.es.js.map