@gisce/ooui 1.0.0-alpha.4 → 1.0.0-alpha.6

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
@@ -2,12 +2,12 @@ var le = Object.defineProperty;
2
2
  var oe = (s, t, e) => t in s ? le(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
3
  var n = (s, t, e) => (oe(s, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import { decode as ce } from "html-entities";
5
- import * as N from "txml";
6
- import P from "moment";
5
+ import * as I from "txml";
6
+ import O from "moment";
7
7
  const F = class F {
8
8
  constructor(t) {
9
9
  /**
10
- * Determines if widget is read only (default is false)
10
+ * Determines if widget is read only (default is undefined)
11
11
  */
12
12
  n(this, "_readOnly");
13
13
  /**
@@ -35,8 +35,8 @@ const F = class F {
35
35
  */
36
36
  n(this, "_key");
37
37
  n(this, "_parsedWidgetProps", {});
38
- if (this._colspan = F._defaultColspan, this._readOnly = !1, this._invisible = !1, t) {
39
- if (t.colspan && (this._colspan = +t.colspan), t.readonly && (t.readonly === "1" || t.readonly === 1 || t.readonly === !0) && (this._readOnly = !0), 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 = JSON.stringify(t.domain) : this._domain = t.domain), t.widget_props)
38
+ if (this._colspan = F._defaultColspan, this._invisible = !1, t) {
39
+ 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 = JSON.stringify(t.domain) : this._domain = t.domain), t.widget_props)
40
40
  try {
41
41
  this._parsedWidgetProps = JSON.parse(
42
42
  t.widget_props.replace(/'/g, '"')
@@ -107,7 +107,7 @@ const F = class F {
107
107
  */
108
108
  n(F, "_defaultColspan", 1);
109
109
  let v = F;
110
- const de = ({
110
+ const de = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), ue = ({
111
111
  entry: s,
112
112
  values: t,
113
113
  fields: e
@@ -138,7 +138,7 @@ const de = ({
138
138
  default:
139
139
  return !1;
140
140
  }
141
- }, b = (s) => ce(s, { level: "xml" }), ue = ({
141
+ }, b = (s) => ce(s, { level: "xml" }), he = ({
142
142
  attrs: s,
143
143
  values: t,
144
144
  fields: e,
@@ -146,17 +146,17 @@ const de = ({
146
146
  }) => {
147
147
  const h = s.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(h), u = JSON.parse(_), d = {};
148
148
  for (const c of Object.keys(u)) {
149
- const p = u[c].map((m) => de({ entry: m, values: t, fields: e })).every((m) => m);
149
+ const p = u[c].map((m) => ue({ entry: m, values: t, fields: e })).every((m) => m);
150
150
  p ? d[c] = !0 : c === "readonly" && !p && i === "button" && (d[c] = !1);
151
151
  }
152
152
  return d;
153
- }, he = ({
153
+ }, _e = ({
154
154
  tagAttributes: s,
155
155
  values: t,
156
156
  fields: e,
157
157
  widgetType: i
158
158
  }) => {
159
- const r = s.attrs ? ue({
159
+ const r = s.attrs ? he({
160
160
  attrs: s.attrs,
161
161
  values: t,
162
162
  fields: e,
@@ -194,6 +194,10 @@ class g extends v {
194
194
  * Tooltip
195
195
  */
196
196
  n(this, "_tooltip");
197
+ /**
198
+ * Tooltip inline
199
+ */
200
+ n(this, "_tooltipInline", !1);
197
201
  /**
198
202
  * Activated (default is true)
199
203
  */
@@ -206,7 +210,7 @@ class g extends v {
206
210
  * Values and keys
207
211
  */
208
212
  n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
209
- 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 = e.sum), e.selection && (this._selectionValues = new Map(e.selection)));
213
+ 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 = e.sum), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = de(e.help_inline)));
210
214
  }
211
215
  get id() {
212
216
  return this._id;
@@ -238,6 +242,12 @@ class g extends v {
238
242
  set tooltip(e) {
239
243
  this._tooltip = e;
240
244
  }
245
+ get tooltipInline() {
246
+ return this._tooltipInline;
247
+ }
248
+ set tooltipInline(e) {
249
+ this._tooltipInline = e;
250
+ }
241
251
  get activated() {
242
252
  return this._activated;
243
253
  }
@@ -264,7 +274,7 @@ class g extends v {
264
274
  return this._id === e ? this : null;
265
275
  }
266
276
  }
267
- class _e extends g {
277
+ class fe extends g {
268
278
  }
269
279
  class R extends v {
270
280
  findById(t) {
@@ -529,7 +539,7 @@ const T = class T extends C {
529
539
  };
530
540
  n(T, "_defaultColspan", 3);
531
541
  let V = T;
532
- class fe extends C {
542
+ class ge extends C {
533
543
  constructor(e) {
534
544
  super(e);
535
545
  n(this, "_icon", null);
@@ -542,7 +552,7 @@ class fe extends C {
542
552
  this._icon = e;
543
553
  }
544
554
  }
545
- class ge extends C {
555
+ class me extends C {
546
556
  constructor(e) {
547
557
  super(e);
548
558
  n(this, "_icon", null);
@@ -627,7 +637,7 @@ class H extends g {
627
637
  this._danger = e;
628
638
  }
629
639
  }
630
- class me extends C {
640
+ class be extends C {
631
641
  constructor(e) {
632
642
  super(e);
633
643
  n(this, "_defaultName", "");
@@ -651,7 +661,7 @@ class me extends C {
651
661
  return this._container.rows[0].filter((e) => !e.invisible);
652
662
  }
653
663
  }
654
- class I extends g {
664
+ class N extends g {
655
665
  constructor(e) {
656
666
  super(e);
657
667
  /**
@@ -742,7 +752,7 @@ class G extends g {
742
752
  this._translatable = e;
743
753
  }
744
754
  }
745
- class O extends g {
755
+ class P extends g {
746
756
  constructor(e) {
747
757
  super(e);
748
758
  /**
@@ -758,7 +768,7 @@ class O extends g {
758
768
  this._size = e;
759
769
  }
760
770
  }
761
- class be extends g {
771
+ class ye extends g {
762
772
  constructor(e) {
763
773
  super(e);
764
774
  /**
@@ -784,14 +794,14 @@ class be extends g {
784
794
  this._relation = e;
785
795
  }
786
796
  }
787
- class ye extends G {
797
+ class pe extends G {
788
798
  }
789
799
  class Q extends g {
790
800
  constructor(t) {
791
801
  super(t);
792
802
  }
793
803
  }
794
- class pe extends g {
804
+ class xe extends g {
795
805
  constructor(t) {
796
806
  super(t);
797
807
  }
@@ -829,21 +839,21 @@ class L extends g {
829
839
  this._decimalDigits = e;
830
840
  }
831
841
  }
832
- class xe extends L {
833
- }
834
842
  class we extends L {
835
843
  }
836
- class ve extends g {
844
+ class ve extends L {
845
+ }
846
+ class Ce extends g {
837
847
  constructor(t) {
838
848
  super(t);
839
849
  }
840
850
  }
841
- class Ce extends g {
851
+ class Fe extends g {
842
852
  constructor(t) {
843
853
  super(t);
844
854
  }
845
855
  }
846
- class Fe extends g {
856
+ class ke extends g {
847
857
  constructor(e) {
848
858
  super(e);
849
859
  /**
@@ -945,7 +955,7 @@ class X extends g {
945
955
  this._mustExpand = e;
946
956
  }
947
957
  }
948
- class ke extends v {
958
+ class Te extends v {
949
959
  constructor(e) {
950
960
  super(e);
951
961
  /**
@@ -971,7 +981,7 @@ class ke extends v {
971
981
  return null;
972
982
  }
973
983
  }
974
- class Te extends O {
984
+ class Oe extends P {
975
985
  }
976
986
  class Pe extends g {
977
987
  constructor(e) {
@@ -989,14 +999,14 @@ class Pe extends g {
989
999
  this._filenameField = e;
990
1000
  }
991
1001
  }
992
- class Oe extends g {
993
- }
994
1002
  class Ee extends g {
1003
+ }
1004
+ class ze extends g {
995
1005
  constructor(t) {
996
1006
  super(t);
997
1007
  }
998
1008
  }
999
- class ze extends X {
1009
+ class Se extends X {
1000
1010
  constructor(e) {
1001
1011
  super(e);
1002
1012
  /**
@@ -1028,7 +1038,7 @@ class ze extends X {
1028
1038
  return this.parsedWidgetProps.colorField;
1029
1039
  }
1030
1040
  }
1031
- class We extends O {
1041
+ class We extends P {
1032
1042
  constructor(e) {
1033
1043
  super(e);
1034
1044
  n(this, "_nolabel", !0);
@@ -1109,14 +1119,14 @@ class U extends g {
1109
1119
  this._columns = e;
1110
1120
  }
1111
1121
  }
1112
- class Se extends U {
1122
+ class Ye extends U {
1113
1123
  }
1114
- class Ye extends O {
1124
+ class De extends P {
1115
1125
  get colors() {
1116
1126
  return this._parsedWidgetProps.colors || {};
1117
1127
  }
1118
1128
  }
1119
- class De extends O {
1129
+ class Ie extends P {
1120
1130
  constructor(e) {
1121
1131
  super(e);
1122
1132
  /**
@@ -1134,7 +1144,7 @@ class De extends O {
1134
1144
  }
1135
1145
  class Ne extends Q {
1136
1146
  }
1137
- class Ie extends g {
1147
+ class Me extends g {
1138
1148
  constructor(e) {
1139
1149
  super(e);
1140
1150
  /**
@@ -1157,7 +1167,7 @@ class Ie extends g {
1157
1167
  this._errorField = e;
1158
1168
  }
1159
1169
  }
1160
- class Me extends G {
1170
+ class Ve extends G {
1161
1171
  constructor(e) {
1162
1172
  super(e);
1163
1173
  n(this, "_lang", null);
@@ -1170,7 +1180,7 @@ class Me extends G {
1170
1180
  this._lang = e;
1171
1181
  }
1172
1182
  }
1173
- class Ve extends g {
1183
+ class Ae extends g {
1174
1184
  constructor(t) {
1175
1185
  super(t);
1176
1186
  }
@@ -1188,16 +1198,16 @@ class j {
1188
1198
  this._widgetClass = V;
1189
1199
  break;
1190
1200
  case "page":
1191
- this._widgetClass = fe;
1201
+ this._widgetClass = ge;
1192
1202
  break;
1193
1203
  case "group":
1194
- this._widgetClass = ge;
1204
+ this._widgetClass = me;
1195
1205
  break;
1196
1206
  case "label":
1197
1207
  this._widgetClass = J;
1198
1208
  break;
1199
1209
  case "char":
1200
- this._widgetClass = I;
1210
+ this._widgetClass = N;
1201
1211
  break;
1202
1212
  case "text":
1203
1213
  this._widgetClass = G;
@@ -1206,40 +1216,40 @@ class j {
1206
1216
  this._widgetClass = H;
1207
1217
  break;
1208
1218
  case "buttonGroup":
1209
- this._widgetClass = me;
1219
+ this._widgetClass = be;
1210
1220
  break;
1211
1221
  case "selection":
1212
- this._widgetClass = O;
1222
+ this._widgetClass = P;
1213
1223
  break;
1214
1224
  case "many2one":
1215
- this._widgetClass = be;
1225
+ this._widgetClass = ye;
1216
1226
  break;
1217
1227
  case "boolean":
1218
1228
  this._widgetClass = Q;
1219
1229
  break;
1220
1230
  case "integer":
1221
- this._widgetClass = pe;
1231
+ this._widgetClass = xe;
1222
1232
  break;
1223
1233
  case "float":
1224
1234
  this._widgetClass = L;
1225
1235
  break;
1226
1236
  case "float_time":
1227
- this._widgetClass = xe;
1237
+ this._widgetClass = we;
1228
1238
  break;
1229
1239
  case "date":
1230
- this._widgetClass = ve;
1240
+ this._widgetClass = Ce;
1231
1241
  break;
1232
1242
  case "datetime":
1233
- this._widgetClass = Ce;
1243
+ this._widgetClass = Fe;
1234
1244
  break;
1235
1245
  case "progressbar":
1236
- this._widgetClass = we;
1246
+ this._widgetClass = ve;
1237
1247
  break;
1238
1248
  case "many2many":
1239
- this._widgetClass = Fe;
1249
+ this._widgetClass = ke;
1240
1250
  break;
1241
1251
  case "markdown":
1242
- this._widgetClass = ye;
1252
+ this._widgetClass = pe;
1243
1253
  break;
1244
1254
  case "one2many":
1245
1255
  case "one2many_list":
@@ -1249,43 +1259,43 @@ class j {
1249
1259
  this._widgetClass = R;
1250
1260
  break;
1251
1261
  case "separator":
1252
- this._widgetClass = ke;
1262
+ this._widgetClass = Te;
1253
1263
  break;
1254
1264
  case "url":
1255
- this._widgetClass = I;
1265
+ this._widgetClass = N;
1256
1266
  break;
1257
1267
  case "email":
1258
- this._widgetClass = I;
1268
+ this._widgetClass = N;
1259
1269
  break;
1260
1270
  case "reference":
1261
- this._widgetClass = Te;
1271
+ this._widgetClass = Oe;
1262
1272
  break;
1263
1273
  case "binary":
1264
1274
  this._widgetClass = Pe;
1265
1275
  break;
1266
1276
  case "image":
1267
- this._widgetClass = Oe;
1277
+ this._widgetClass = Ee;
1268
1278
  break;
1269
1279
  case "fiber_grid":
1270
- this._widgetClass = Ee;
1280
+ this._widgetClass = ze;
1271
1281
  break;
1272
1282
  case "timeline":
1273
- this._widgetClass = ze;
1283
+ this._widgetClass = Se;
1274
1284
  break;
1275
1285
  case "indicator":
1276
1286
  this._widgetClass = We;
1277
1287
  break;
1278
1288
  case "tags":
1279
- this._widgetClass = Se;
1289
+ this._widgetClass = Ye;
1280
1290
  break;
1281
1291
  case "tag":
1282
- this._widgetClass = Ye;
1292
+ this._widgetClass = De;
1283
1293
  break;
1284
1294
  case "avatar":
1285
- this._widgetClass = _e;
1295
+ this._widgetClass = fe;
1286
1296
  break;
1287
1297
  case "radio":
1288
- this._widgetClass = De;
1298
+ this._widgetClass = Ie;
1289
1299
  break;
1290
1300
  case "multicheckbox":
1291
1301
  this._widgetClass = U;
@@ -1294,13 +1304,13 @@ class j {
1294
1304
  this._widgetClass = Ne;
1295
1305
  break;
1296
1306
  case "steps":
1297
- this._widgetClass = Ie;
1307
+ this._widgetClass = Me;
1298
1308
  break;
1299
1309
  case "codeeditor":
1300
- this._widgetClass = Me;
1310
+ this._widgetClass = Ve;
1301
1311
  break;
1302
1312
  case "time":
1303
- this._widgetClass = Ve;
1313
+ this._widgetClass = Ae;
1304
1314
  break;
1305
1315
  }
1306
1316
  }
@@ -1322,7 +1332,7 @@ class j {
1322
1332
  }
1323
1333
  }
1324
1334
  }
1325
- const Ae = ({
1335
+ const Be = ({
1326
1336
  fieldName: s,
1327
1337
  values: t,
1328
1338
  fields: e
@@ -1347,7 +1357,7 @@ const Ae = ({
1347
1357
  r[a] = h.some((_) => _);
1348
1358
  }
1349
1359
  return r;
1350
- }, Be = ({
1360
+ }, Ge = ({
1351
1361
  states: s,
1352
1362
  values: t
1353
1363
  }) => {
@@ -1356,7 +1366,7 @@ const Ae = ({
1356
1366
  const e = s.split(",");
1357
1367
  return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
1358
1368
  };
1359
- function Ge({
1369
+ function Le({
1360
1370
  values: s = {},
1361
1371
  fieldName: t,
1362
1372
  fields: e = {}
@@ -1365,7 +1375,7 @@ function Ge({
1365
1375
  const i = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
1366
1376
  return i === "many2one" ? s[t] ? s[t][0] || null : !1 : i === "one2many" || i === "many2many" ? s[t].map((o) => o.id) : s != null && s[t] ? s == null ? void 0 : s[t] : t.includes("'") ? t : parseInt(t);
1367
1377
  }
1368
- const Le = ({
1378
+ const je = ({
1369
1379
  context: s,
1370
1380
  values: t,
1371
1381
  fields: e
@@ -1384,7 +1394,7 @@ const Le = ({
1384
1394
  return d.forEach((f) => {
1385
1395
  const y = f[1];
1386
1396
  if (!f[1].includes("'") && f[1] !== "true" && f[1] !== "false") {
1387
- const p = Ge({
1397
+ const p = Le({
1388
1398
  values: t,
1389
1399
  fields: e,
1390
1400
  fieldName: y === "active_id" ? "id" : y
@@ -1399,7 +1409,7 @@ const Le = ({
1399
1409
  } catch {
1400
1410
  return;
1401
1411
  }
1402
- }, ht = (s) => {
1412
+ }, _t = (s) => {
1403
1413
  const t = [];
1404
1414
  try {
1405
1415
  return !s || Z(s) || typeof s != "string" ? t : K(s) !== null ? [] : (s.trim().length === 0 || s.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
@@ -1419,14 +1429,14 @@ function K(s) {
1419
1429
  function Z(s) {
1420
1430
  return typeof s == "object" && s !== null && typeof s != "string";
1421
1431
  }
1422
- const je = (s) => {
1432
+ const $e = (s) => {
1423
1433
  const t = s.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((o) => o.trim());
1424
1434
  return {
1425
1435
  method: e,
1426
1436
  args: r
1427
1437
  };
1428
1438
  };
1429
- class _t {
1439
+ class ft {
1430
1440
  constructor(t, e = 4) {
1431
1441
  /**
1432
1442
  * Object containing fields specification of the form.
@@ -1519,7 +1529,7 @@ class _t {
1519
1529
  }
1520
1530
  parse(t, e) {
1521
1531
  var l;
1522
- const { values: i = {}, readOnly: r = !1 } = e || {}, o = N.parse(t).filter((a) => a.tagName === "form")[0];
1532
+ const { values: i = {}, readOnly: r = !1 } = e || {}, o = I.parse(t).filter((a) => a.tagName === "form")[0];
1523
1533
  this._string = ((l = o.attributes) == null ? void 0 : l.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
1524
1534
  fields: o.children,
1525
1535
  container: this._container,
@@ -1553,27 +1563,27 @@ class _t {
1553
1563
  fieldsWidgetType: this._fields[x].type
1554
1564
  };
1555
1565
  }
1556
- const d = he({
1566
+ const d = _e({
1557
1567
  tagAttributes: u,
1558
1568
  values: i,
1559
1569
  fields: this._fields,
1560
1570
  widgetType: l
1561
1571
  });
1562
1572
  let c;
1563
- l === "button" && u.states ? c = Be({
1573
+ l === "button" && u.states ? c = Ge({
1564
1574
  states: u.states,
1565
1575
  values: i
1566
- }) : c = Ae({
1576
+ }) : c = Be({
1567
1577
  fieldName: u.name,
1568
1578
  values: i,
1569
1579
  fields: this._fields
1570
1580
  });
1571
- const f = Le({
1581
+ const f = je({
1572
1582
  context: u.context || ((w = this._fields[u.name]) == null ? void 0 : w.context),
1573
1583
  values: i,
1574
1584
  fields: this._fields
1575
1585
  });
1576
- u.on_change && (this._onChangeFields[u.name] = je(
1586
+ u.on_change && (this._onChangeFields[u.name] = $e(
1577
1587
  u.on_change
1578
1588
  ));
1579
1589
  let y;
@@ -1603,7 +1613,7 @@ class _t {
1603
1613
  function q(s) {
1604
1614
  return s ? Array.isArray(s) && s.length > 0 ? !0 : typeof s == "string" && s !== "" && s !== "[]" : !1;
1605
1615
  }
1606
- class ft {
1616
+ class gt {
1607
1617
  constructor(t) {
1608
1618
  /**
1609
1619
  * Object containing fields specification of the form.
@@ -1648,7 +1658,7 @@ class ft {
1648
1658
  return this._editable;
1649
1659
  }
1650
1660
  parse(t) {
1651
- const e = N.parse(t).filter((r) => r.tagName === "tree")[0];
1661
+ const e = I.parse(t).filter((r) => r.tagName === "tree")[0];
1652
1662
  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;
1653
1663
  const i = new j();
1654
1664
  e.children.forEach((r) => {
@@ -1682,7 +1692,7 @@ class ft {
1682
1692
  return this._columns.find((e) => e.findById ? e.findById(t) : !1);
1683
1693
  }
1684
1694
  }
1685
- const $e = {
1695
+ const qe = {
1686
1696
  text: "text",
1687
1697
  many2one: "many2one",
1688
1698
  char: "char",
@@ -1695,7 +1705,7 @@ const $e = {
1695
1705
  date: "date",
1696
1706
  datetime: "datetime"
1697
1707
  };
1698
- class gt {
1708
+ class mt {
1699
1709
  constructor(t, e, i = 8) {
1700
1710
  /**
1701
1711
  * Object containing the specific fields for primary and secondary search fields
@@ -1743,7 +1753,7 @@ class gt {
1743
1753
  colspan: 2
1744
1754
  }, { type: o, widget: l } = r;
1745
1755
  let a = l ?? o;
1746
- return $e[a] === void 0 && (a = o), e.createWidget(a, r);
1756
+ return qe[a] === void 0 && (a = o), e.createWidget(a, r);
1747
1757
  });
1748
1758
  }
1749
1759
  /**
@@ -1754,7 +1764,7 @@ class gt {
1754
1764
  return this.advancedSearchContainer.findById(t);
1755
1765
  }
1756
1766
  }
1757
- const mt = ({
1767
+ const bt = ({
1758
1768
  domain: s,
1759
1769
  widgetFieldName: t
1760
1770
  }) => {
@@ -1769,8 +1779,8 @@ const mt = ({
1769
1779
  r.length - 1
1770
1780
  )) : (a = r, h = "id"), a === t && e.push([h, o, l]);
1771
1781
  }), e;
1772
- }, bt = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
1773
- class qe {
1782
+ }, yt = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
1783
+ class Re {
1774
1784
  constructor(t) {
1775
1785
  n(this, "_action_id", null);
1776
1786
  n(this, "_position", null);
@@ -1783,15 +1793,15 @@ class qe {
1783
1793
  return this._position;
1784
1794
  }
1785
1795
  }
1786
- class yt {
1796
+ class pt {
1787
1797
  constructor(t) {
1788
1798
  n(this, "_string", null);
1789
1799
  n(this, "_items", []);
1790
- const e = N.parse(t).filter((r) => r.tagName === "dashboard")[0];
1800
+ const e = I.parse(t).filter((r) => r.tagName === "dashboard")[0];
1791
1801
  this._string = e.attributes.string || null;
1792
1802
  const { children: i } = e;
1793
1803
  i.forEach((r) => {
1794
- r.tagName === "dashboard_item" && this._items.push(new qe(r.attributes));
1804
+ r.tagName === "dashboard_item" && this._items.push(new Re(r.attributes));
1795
1805
  });
1796
1806
  }
1797
1807
  get string() {
@@ -1818,7 +1828,7 @@ class ee {
1818
1828
  return this._timerange;
1819
1829
  }
1820
1830
  }
1821
- const Re = (s) => s === 1 || s === "1" || s === !0 || s === "True";
1831
+ const Je = (s) => s === 1 || s === "1" || s === !0 || s === "True";
1822
1832
  class te extends ee {
1823
1833
  constructor(e, i) {
1824
1834
  super(i);
@@ -1827,7 +1837,7 @@ class te extends ee {
1827
1837
  n(this, "_totalDomain", null);
1828
1838
  n(this, "_showPercent", !1);
1829
1839
  n(this, "_suffix", null);
1830
- this._type = e, this._color = i.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = i.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = i.attributes.suffix || null, this._totalDomain = b(i.attributes.totalDomain) || null, this._showPercent = Re(i.attributes.showPercent);
1840
+ this._type = e, this._color = i.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = i.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = i.attributes.suffix || null, this._totalDomain = b(i.attributes.totalDomain) || null, this._showPercent = Je(i.attributes.showPercent);
1831
1841
  }
1832
1842
  get color() {
1833
1843
  return this._color;
@@ -1845,7 +1855,7 @@ class te extends ee {
1845
1855
  return this._suffix;
1846
1856
  }
1847
1857
  }
1848
- class Je extends te {
1858
+ class He extends te {
1849
1859
  constructor(e, i) {
1850
1860
  super(e, i);
1851
1861
  n(this, "_field");
@@ -1865,7 +1875,7 @@ class Je extends te {
1865
1875
  return this._operator;
1866
1876
  }
1867
1877
  }
1868
- const He = (s) => {
1878
+ const Qe = (s) => {
1869
1879
  const t = [];
1870
1880
  let e;
1871
1881
  if (s.forEach((i) => {
@@ -1875,10 +1885,10 @@ const He = (s) => {
1875
1885
  throw new Error(`Field ${l} doesn't have an axis`);
1876
1886
  if (!l)
1877
1887
  throw new Error("Missing name attribute for field");
1878
- r === "x" ? e = new Ue({
1888
+ r === "x" ? e = new Ke({
1879
1889
  name: l
1880
1890
  }) : r === "y" && t.push(
1881
- new Xe({
1891
+ new Ue({
1882
1892
  name: l,
1883
1893
  operator: o,
1884
1894
  label: a,
@@ -1901,7 +1911,7 @@ class M extends ee {
1901
1911
  n(this, "_x");
1902
1912
  n(this, "_y");
1903
1913
  this._type = e;
1904
- const r = He(i.children);
1914
+ const r = Qe(i.children);
1905
1915
  this._x = r.x, this._y = r.y;
1906
1916
  }
1907
1917
  get x() {
@@ -1911,17 +1921,17 @@ class M extends ee {
1911
1921
  return this._y;
1912
1922
  }
1913
1923
  }
1914
- const Qe = {
1924
+ const Xe = {
1915
1925
  indicator: te,
1916
- indicatorField: Je,
1926
+ indicatorField: He,
1917
1927
  line: M,
1918
1928
  bar: M,
1919
1929
  pie: M
1920
- }, pt = (s) => {
1921
- const t = N.parse(s).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
1930
+ }, xt = (s) => {
1931
+ const t = I.parse(s).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
1922
1932
  if (!e)
1923
1933
  throw new Error(`${e} is not a valid graph`);
1924
- const i = Qe[e];
1934
+ const i = Xe[e];
1925
1935
  if (!i)
1926
1936
  throw new Error(`${e} not found as a GraphModel`);
1927
1937
  return new i(e, t);
@@ -1939,7 +1949,7 @@ class se {
1939
1949
  return this._axis;
1940
1950
  }
1941
1951
  }
1942
- class Xe extends se {
1952
+ class Ue extends se {
1943
1953
  constructor({
1944
1954
  name: e,
1945
1955
  operator: i,
@@ -1962,12 +1972,12 @@ class Xe extends se {
1962
1972
  return this._stacked;
1963
1973
  }
1964
1974
  }
1965
- class Ue extends se {
1975
+ class Ke extends se {
1966
1976
  constructor({ name: t }) {
1967
1977
  super({ name: t, axis: "x" });
1968
1978
  }
1969
1979
  }
1970
- const Ke = ({ ooui: s }) => {
1980
+ const Ze = ({ ooui: s }) => {
1971
1981
  const e = [s.x.name];
1972
1982
  return s.y ? (s.y.forEach((i) => {
1973
1983
  i.operator !== "count" && !e.includes(i.name) && e.push(i.name), i.label && !e.includes(i.label) && e.push(i.label);
@@ -1989,25 +1999,25 @@ function $({
1989
1999
  }
1990
2000
  return { value: r, label: r };
1991
2001
  }
1992
- const xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2002
+ const wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1993
2003
  __proto__: null,
1994
- getFieldsToRetrieve: Ke,
2004
+ getFieldsToRetrieve: Ze,
1995
2005
  getValueAndLabelForField: $
1996
2006
  }, Symbol.toStringTag, { value: "Module" }));
1997
- function Ze({
2007
+ function et({
1998
2008
  values: s,
1999
2009
  timerange: t
2000
2010
  }) {
2001
- const e = st({
2011
+ const e = it({
2002
2012
  values: s,
2003
2013
  timerange: t
2004
2014
  });
2005
- return et({
2015
+ return tt({
2006
2016
  values: e,
2007
2017
  timerange: t
2008
2018
  });
2009
2019
  }
2010
- function et({
2020
+ function tt({
2011
2021
  values: s,
2012
2022
  timerange: t
2013
2023
  }) {
@@ -2024,7 +2034,7 @@ function et({
2024
2034
  return;
2025
2035
  const u = _.x, d = a[h + 1].x;
2026
2036
  if (!ie([u, d], r)) {
2027
- const c = tt({
2037
+ const c = st({
2028
2038
  dates: [u, d],
2029
2039
  timerange: t
2030
2040
  });
@@ -2040,7 +2050,7 @@ function et({
2040
2050
  }
2041
2051
  }), e.sort((l, a) => l.x < a.x ? -1 : l.x > a.x ? 1 : 0);
2042
2052
  }
2043
- function tt({
2053
+ function st({
2044
2054
  dates: s,
2045
2055
  timerange: t
2046
2056
  }) {
@@ -2051,18 +2061,18 @@ function tt({
2051
2061
  for (let o = 0; o < r.length - 1; o++) {
2052
2062
  const l = r[o], a = r[o + 1];
2053
2063
  if (!ie([l, a], i)) {
2054
- const h = P(l, S(i)).add(1, i), _ = P(a, S(i));
2064
+ const h = O(l, W(i)).add(1, i), _ = O(a, W(i));
2055
2065
  for (; h.isBefore(_); )
2056
- e.push(h.format(S(i))), h.add(1, i);
2066
+ e.push(h.format(W(i))), h.add(1, i);
2057
2067
  }
2058
2068
  }
2059
2069
  return e;
2060
2070
  }
2061
- function st({
2071
+ function it({
2062
2072
  values: s,
2063
2073
  timerange: t
2064
2074
  }) {
2065
- const e = it({
2075
+ const e = nt({
2066
2076
  values: s,
2067
2077
  timerange: t
2068
2078
  }), i = [], r = ne({
@@ -2080,24 +2090,24 @@ function st({
2080
2090
  });
2081
2091
  }), i;
2082
2092
  }
2083
- function it({
2093
+ function nt({
2084
2094
  values: s,
2085
2095
  timerange: t
2086
2096
  }) {
2087
2097
  return s.map((e) => ({
2088
2098
  ...e,
2089
- x: nt({
2099
+ x: rt({
2090
2100
  date: e.x,
2091
2101
  timerange: t
2092
2102
  })
2093
2103
  }));
2094
2104
  }
2095
- function nt({
2105
+ function rt({
2096
2106
  date: s,
2097
2107
  timerange: t
2098
2108
  }) {
2099
- let e = rt(s);
2100
- const i = P(s, e);
2109
+ let e = at(s);
2110
+ const i = O(s, e);
2101
2111
  switch (t) {
2102
2112
  case "hour": {
2103
2113
  e = "YYYY-MM-DD HH:00";
@@ -2122,18 +2132,18 @@ function nt({
2122
2132
  }
2123
2133
  return i.format(e);
2124
2134
  }
2125
- function rt(s) {
2135
+ function at(s) {
2126
2136
  return s.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
2127
2137
  }
2128
2138
  function ie(s, t) {
2129
2139
  let e = !1;
2130
- const i = S(t);
2140
+ const i = W(t);
2131
2141
  if (s.length === 0)
2132
2142
  return !1;
2133
2143
  if (s.length === 1)
2134
2144
  return !0;
2135
2145
  for (let r = 0; r < s.length - 1; r++) {
2136
- const o = P(s[r], i), a = P(s[r + 1], i).diff(o, t);
2146
+ const o = O(s[r], i), a = O(s[r + 1], i).diff(o, t);
2137
2147
  Math.abs(a) === 1 ? e = !0 : e = !1;
2138
2148
  }
2139
2149
  return e;
@@ -2148,7 +2158,7 @@ function ne({
2148
2158
  e[a] || (e[a] = []), e[a].push(i);
2149
2159
  }), e;
2150
2160
  }
2151
- function S(s) {
2161
+ function W(s) {
2152
2162
  switch (s) {
2153
2163
  case "days":
2154
2164
  return "YYYY-MM-DD";
@@ -2163,7 +2173,7 @@ function S(s) {
2163
2173
  return "YYYY-MM-DD HH:mm";
2164
2174
  }
2165
2175
  }
2166
- const at = {
2176
+ const lt = {
2167
2177
  count: "count",
2168
2178
  "+": "sum",
2169
2179
  "-": "subtract",
@@ -2171,7 +2181,7 @@ const at = {
2171
2181
  avg: "average",
2172
2182
  min: "min",
2173
2183
  max: "max"
2174
- }, lt = ({
2184
+ }, ot = ({
2175
2185
  ooui: s,
2176
2186
  values: t,
2177
2187
  fields: e,
@@ -2238,7 +2248,7 @@ const at = {
2238
2248
  (c) => c.x !== !1
2239
2249
  ));
2240
2250
  let d = u;
2241
- return s.timerange ? d = Ze({
2251
+ return s.timerange ? d = et({
2242
2252
  values: d,
2243
2253
  timerange: s.timerange
2244
2254
  }) : s.type == "pie" && (d = u.sort((c, f) => f.value - c.value)), {
@@ -2266,26 +2276,26 @@ function D({
2266
2276
  case "count":
2267
2277
  return t.length;
2268
2278
  case "+":
2269
- return W(
2279
+ return S(
2270
2280
  t.reduce(function(e, i) {
2271
2281
  return e + i;
2272
2282
  })
2273
2283
  );
2274
2284
  case "-":
2275
- return W(
2285
+ return S(
2276
2286
  t.reduce(function(e, i) {
2277
2287
  return e - i;
2278
2288
  })
2279
2289
  );
2280
2290
  case "*":
2281
- return W(
2291
+ return S(
2282
2292
  t.reduce(function(e, i) {
2283
2293
  return e * i;
2284
2294
  })
2285
2295
  );
2286
2296
  case "avg": {
2287
2297
  const i = t.reduce((r, o) => r + o, 0) / t.length || 0;
2288
- return W(i);
2298
+ return S(i);
2289
2299
  }
2290
2300
  case "min":
2291
2301
  return Math.min(...t);
@@ -2293,7 +2303,7 @@ function D({
2293
2303
  return Math.max(...t);
2294
2304
  }
2295
2305
  }
2296
- function W(s) {
2306
+ function S(s) {
2297
2307
  return Math.round((s + Number.EPSILON) * 100) / 100;
2298
2308
  }
2299
2309
  function B({
@@ -2311,7 +2321,7 @@ function B({
2311
2321
  i[o] || (i[o] = { label: l, entries: [] }), i[o].entries.push(r);
2312
2322
  }), i;
2313
2323
  }
2314
- function ot(s) {
2324
+ function ct(s) {
2315
2325
  let t = [];
2316
2326
  return Object.keys(s).forEach((e) => {
2317
2327
  const i = s[e];
@@ -2325,76 +2335,76 @@ function re({
2325
2335
  const e = t[s.name];
2326
2336
  return e != null && e.string ? e.string : s.name;
2327
2337
  }
2328
- const wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2338
+ const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2329
2339
  __proto__: null,
2330
- getAllObjectsInGroupedValues: ot,
2340
+ getAllObjectsInGroupedValues: ct,
2331
2341
  getValueForOperator: D,
2332
2342
  getValuesForYField: A,
2333
2343
  getValuesGroupedByField: B,
2334
2344
  getYAxisFieldname: re,
2335
- labelsForOperator: at,
2336
- processGraphData: lt
2345
+ labelsForOperator: lt,
2346
+ processGraphData: ot
2337
2347
  }, Symbol.toStringTag, { value: "Module" }));
2338
2348
  export {
2339
- _e as Avatar,
2349
+ fe as Avatar,
2340
2350
  Pe as Binary,
2341
2351
  Q as Boolean,
2342
2352
  H as Button,
2343
- me as ButtonGroup,
2344
- I as Char,
2345
- Me as CodeEditor,
2353
+ be as ButtonGroup,
2354
+ N as Char,
2355
+ Ve as CodeEditor,
2346
2356
  Y as Container,
2347
2357
  C as ContainerWidget,
2348
- yt as Dashboard,
2349
- qe as DashboardItem,
2350
- ve as Date,
2351
- Ce as DateTime,
2358
+ pt as Dashboard,
2359
+ Re as DashboardItem,
2360
+ Ce as Date,
2361
+ Fe as DateTime,
2352
2362
  g as Field,
2353
2363
  L as Float,
2354
- xe as FloatTime,
2355
- _t as Form,
2364
+ we as FloatTime,
2365
+ ft as Form,
2356
2366
  ee as Graph,
2357
2367
  se as GraphAxis,
2358
2368
  M as GraphChart,
2359
2369
  te as GraphIndicator,
2360
- Je as GraphIndicatorField,
2361
- Ue as GraphXAxis,
2362
- Xe as GraphYAxis,
2363
- ge as Group,
2364
- Oe as Image,
2370
+ He as GraphIndicatorField,
2371
+ Ke as GraphXAxis,
2372
+ Ue as GraphYAxis,
2373
+ me as Group,
2374
+ Ee as Image,
2365
2375
  We as Indicator,
2366
- pe as Integer,
2376
+ xe as Integer,
2367
2377
  J as Label,
2368
- Fe as Many2many,
2369
- be as Many2one,
2370
- ye as Markdown,
2378
+ ke as Many2many,
2379
+ ye as Many2one,
2380
+ pe as Markdown,
2371
2381
  U as MultiCheckbox,
2372
2382
  R as NewLine,
2373
2383
  V as Notebook,
2374
2384
  X as One2many,
2375
- fe as Page,
2376
- we as ProgressBar,
2377
- De as Radio,
2378
- Te as Reference,
2379
- $e as SearchFieldTypes,
2380
- gt as SearchFilter,
2381
- O as Selection,
2382
- ke as Separator,
2383
- Ie as Steps,
2385
+ ge as Page,
2386
+ ve as ProgressBar,
2387
+ Ie as Radio,
2388
+ Oe as Reference,
2389
+ qe as SearchFieldTypes,
2390
+ mt as SearchFilter,
2391
+ P as Selection,
2392
+ Te as Separator,
2393
+ Me as Steps,
2384
2394
  Ne as Switch,
2385
- Ye as Tag,
2386
- Se as Tags,
2395
+ De as Tag,
2396
+ Ye as Tags,
2387
2397
  G as Text,
2388
- Ve as Time,
2389
- ze as Timeline,
2390
- ft as Tree,
2398
+ Ae as Time,
2399
+ Se as Timeline,
2400
+ gt as Tree,
2391
2401
  v as Widget,
2392
- xt as graphFieldUtils,
2393
- wt as graphProcessor,
2394
- Le as parseContext,
2395
- ht as parseContextFields,
2396
- bt as parseDomainFields,
2397
- pt as parseGraph,
2398
- mt as transformDomainForChildWidget
2402
+ wt as graphFieldUtils,
2403
+ vt as graphProcessor,
2404
+ je as parseContext,
2405
+ _t as parseContextFields,
2406
+ yt as parseDomainFields,
2407
+ xt as parseGraph,
2408
+ bt as transformDomainForChildWidget
2399
2409
  };
2400
2410
  //# sourceMappingURL=ooui.es.js.map