@gisce/ooui 2.29.1 → 2.30.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ooui.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var be = Object.defineProperty;
2
2
  var ye = (i, t, e) => t in i ? be(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var n = (i, t, e) => (ye(i, typeof t != "symbol" ? t + "" : t, e), e);
3
+ var r = (i, t, e) => (ye(i, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import { decode as pe } from "html-entities";
5
5
  import { evaluateCondition as xe } from "@gisce/conscheck";
6
6
  import * as D from "txml";
@@ -10,7 +10,7 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
10
10
  values: t,
11
11
  fields: e
12
12
  }) => {
13
- let [s, r, a] = i, l = t[s];
13
+ let [s, n, a] = i, l = t[s];
14
14
  const o = X({
15
15
  fieldName: s,
16
16
  valueInObject: l,
@@ -19,7 +19,7 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
19
19
  });
20
20
  if (o.directOutcome !== void 0)
21
21
  return o.directOutcome;
22
- switch (o.modifiedValueInObject !== null && (l = o.modifiedValueInObject), o.modifiedExpectedValue !== null && (a = o.modifiedExpectedValue), r.toLowerCase()) {
22
+ switch (o.modifiedValueInObject !== null && (l = o.modifiedValueInObject), o.modifiedExpectedValue !== null && (a = o.modifiedExpectedValue), n.toLowerCase()) {
23
23
  case "=":
24
24
  case "==":
25
25
  return l == a;
@@ -41,13 +41,13 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
41
41
  default:
42
42
  return !1;
43
43
  }
44
- }, b = (i) => pe(i, { level: "xml" }), X = ({
44
+ }, m = (i) => pe(i, { level: "xml" }), X = ({
45
45
  fieldName: i,
46
46
  valueInObject: t,
47
47
  expectedValue: e,
48
48
  fields: s = {}
49
49
  }) => {
50
- const r = {
50
+ const n = {
51
51
  modifiedValueInObject: t,
52
52
  modifiedExpectedValue: null,
53
53
  directOutcome: void 0
@@ -60,14 +60,14 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
60
60
  modifiedValueInObject: null,
61
61
  modifiedExpectedValue: null,
62
62
  directOutcome: !1
63
- } : (r.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject === void 0 ? r.modifiedValueInObject = !1 : Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] !== void 0 && (r.modifiedValueInObject = r.modifiedValueInObject[0]), r.modifiedValueInObject === null && (r.modifiedValueInObject = !1)), s[i].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
63
+ } : (n.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? n.modifiedExpectedValue = void 0 : (n.modifiedValueInObject === void 0 ? n.modifiedValueInObject = !1 : Array.isArray(n.modifiedValueInObject) && n.modifiedValueInObject[0] !== void 0 && (n.modifiedValueInObject = n.modifiedValueInObject[0]), n.modifiedValueInObject === null && (n.modifiedValueInObject = !1)), s[i].type === "many2one" && Array.isArray(n.modifiedValueInObject) && n.modifiedValueInObject[0] === void 0 && (n.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (n.modifiedExpectedValue = e !== 0), n);
64
64
  }, J = ({
65
65
  attrs: i,
66
66
  values: t,
67
67
  fields: e,
68
68
  widgetType: s
69
69
  }) => {
70
- const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(u), h = JSON.parse(_), d = {};
70
+ const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = m(u), h = JSON.parse(_), d = {};
71
71
  for (const g of Object.keys(h)) {
72
72
  const p = h[g].map((y) => ve({ entry: y, values: t, fields: e })).every((y) => y);
73
73
  p ? d[g] = !0 : g === "readonly" && !p && s === "button" && (d[g] = !1);
@@ -91,8 +91,8 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
91
91
  widgetType: s
92
92
  }) => {
93
93
  try {
94
- const r = b(i), a = JSON.parse(
95
- r.replace(/'/g, '"')
94
+ const n = m(i), a = JSON.parse(
95
+ n.replace(/'/g, '"')
96
96
  ), l = {};
97
97
  for (const o of Object.keys(a)) {
98
98
  const u = xe({
@@ -112,17 +112,17 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
112
112
  u ? l[o] = !0 : o === "readonly" && !u && s === "button" && (l[o] = !1);
113
113
  }
114
114
  return l;
115
- } catch (r) {
116
- throw console.error(r), r instanceof SyntaxError ? new Error(
115
+ } catch (n) {
116
+ throw console.error(n), n instanceof SyntaxError ? new Error(
117
117
  "Error parsing new json_attrs. Original string: " + i
118
- ) : r;
118
+ ) : n;
119
119
  }
120
120
  }, Ce = ({
121
121
  tagAttributes: i,
122
122
  values: t,
123
123
  fields: e,
124
124
  widgetType: s,
125
- fallbackMode: r = !0
125
+ fallbackMode: n = !0
126
126
  }) => {
127
127
  let a = {};
128
128
  if (i.json_attrs)
@@ -134,7 +134,7 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
134
134
  widgetType: s
135
135
  });
136
136
  } catch (l) {
137
- if (r && i.attrs)
137
+ if (n && i.attrs)
138
138
  a = J({
139
139
  attrs: i.attrs,
140
140
  values: t,
@@ -162,38 +162,38 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
162
162
  /**
163
163
  * Determines if widget is read only (default is undefined)
164
164
  */
165
- n(this, "_readOnly");
165
+ r(this, "_readOnly");
166
166
  /**
167
167
  * Column span (default is 1)
168
168
  */
169
- n(this, "_colspan");
169
+ r(this, "_colspan");
170
170
  /**
171
171
  * Invisible fields (default is false)
172
172
  */
173
- n(this, "_invisible");
173
+ r(this, "_invisible");
174
174
  /**
175
175
  * Widget type
176
176
  */
177
- n(this, "_type", "");
177
+ r(this, "_type", "");
178
178
  /**
179
179
  * Context
180
180
  */
181
- n(this, "_context");
181
+ r(this, "_context");
182
182
  /**
183
183
  * Domain
184
184
  */
185
- n(this, "_domain");
185
+ r(this, "_domain");
186
186
  /**
187
187
  * Unique key for widget
188
188
  */
189
- n(this, "_key");
190
- n(this, "_parsedWidgetProps", {});
191
- n(this, "_isFunction");
189
+ r(this, "_key");
190
+ r(this, "_parsedWidgetProps", {});
191
+ r(this, "_isFunction");
192
192
  /**
193
193
  * Base type of the field
194
194
  */
195
- n(this, "_fieldType", "");
196
- this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = T(t.readonly)), t.invisible && (t.invisible === 1 || t.invisible === "1" || t.invisible === !0) && (this._invisible = !0), t.type && (this._type = t.type), t.context && (this._context = t.context), t.domain && (typeof t.domain != "string" ? this._domain = b(JSON.stringify(t.domain)) : this._domain = b(t.domain)), t.type && (this._fieldType = t.fieldsWidgetType), t.widget_props && (this._parsedWidgetProps = U(t.widget_props)), t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function));
195
+ r(this, "_fieldType", "");
196
+ this._colspan = k._defaultColspan, this._invisible = !1, t && (t.colspan && (this._colspan = +t.colspan), t.readonly !== void 0 && (this._readOnly = T(t.readonly)), t.invisible && (t.invisible === 1 || t.invisible === "1" || t.invisible === !0) && (this._invisible = !0), t.type && (this._type = t.type), t.context && (this._context = t.context), t.domain && (typeof t.domain != "string" ? this._domain = m(JSON.stringify(t.domain)) : this._domain = m(t.domain)), t.type && (this._fieldType = t.fieldsWidgetType), t.widget_props && (this._parsedWidgetProps = U(t.widget_props)), t.key && (this._key = t.key), t.is_function && (this._isFunction = t.is_function));
197
197
  }
198
198
  static get defaultColspan() {
199
199
  return k._defaultColspan;
@@ -262,7 +262,7 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
262
262
  /**
263
263
  * Default colspan
264
264
  */
265
- n(k, "_defaultColspan", 1);
265
+ r(k, "_defaultColspan", 1);
266
266
  let C = k;
267
267
  class f extends C {
268
268
  constructor(e) {
@@ -272,47 +272,47 @@ class f extends C {
272
272
  *
273
273
  * Corresponds to the field's name attribute from xml
274
274
  */
275
- n(this, "_id", "");
275
+ r(this, "_id", "");
276
276
  /**
277
277
  * Label
278
278
  */
279
- n(this, "_label", "");
279
+ r(this, "_label", "");
280
280
  /**
281
281
  * No label
282
282
  *
283
283
  * This field hasn't got to show the label
284
284
  *
285
285
  */
286
- n(this, "_nolabel", !1);
286
+ r(this, "_nolabel", !1);
287
287
  /**
288
288
  *
289
289
  * Required field
290
290
  *
291
291
  */
292
- n(this, "_required", !1);
292
+ r(this, "_required", !1);
293
293
  /**
294
294
  * Tooltip
295
295
  */
296
- n(this, "_tooltip");
296
+ r(this, "_tooltip");
297
297
  /**
298
298
  * Tooltip inline
299
299
  */
300
- n(this, "_tooltipInline", !1);
300
+ r(this, "_tooltipInline", !1);
301
301
  /**
302
302
  * Activated (default is true)
303
303
  */
304
- n(this, "_activated", !0);
304
+ r(this, "_activated", !0);
305
305
  /**
306
306
  * Sum - sum parameter (label), this will mean that we have to sum this field in the tree
307
307
  */
308
- n(this, "_sum");
308
+ r(this, "_sum");
309
309
  /**
310
310
  * Values and keys
311
311
  */
312
- n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
313
- n(this, "_autoRefresh", !1);
314
- n(this, "_raw_props");
315
- this._activated = !0, e && (this._raw_props = e, e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(e.help)), e.nolabel && (e.nolabel === "1" || typeof e.nolabel == "boolean" && e.nolabel === !0) && (this._nolabel = !0), e.required && (e.required === "1" || e.required === !0 || e.required === "True") && (this._required = !0), e.sum && (this._sum = b(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = we(e.help_inline)), e.autorefresh && (this.autoRefresh = T(e.autorefresh)));
312
+ r(this, "_selectionValues", /* @__PURE__ */ new Map([]));
313
+ r(this, "_autoRefresh", !1);
314
+ r(this, "_raw_props");
315
+ this._activated = !0, e && (this._raw_props = e, e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = m(e.string)), e.help && (this._tooltip = m(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 = m(e.sum)), e.selection && (this._selectionValues = new Map(e.selection)), e.help_inline && (this.tooltipInline = we(e.help_inline)), e.autorefresh && (this.autoRefresh = T(e.autorefresh)));
316
316
  }
317
317
  get id() {
318
318
  return this._id;
@@ -410,23 +410,23 @@ class Z extends f {
410
410
  /**
411
411
  * Label text
412
412
  */
413
- n(this, "_text", "");
413
+ r(this, "_text", "");
414
414
  /**
415
415
  * Align text
416
416
  */
417
- n(this, "_align", "left");
417
+ r(this, "_align", "left");
418
418
  /**
419
419
  * Label type
420
420
  */
421
- n(this, "_labelType", "default");
421
+ r(this, "_labelType", "default");
422
422
  /**
423
423
  * Label size
424
424
  */
425
- n(this, "_labelSize");
425
+ r(this, "_labelSize");
426
426
  /**
427
427
  * Id of the field that this label goes with. Null if it's an independent label
428
428
  */
429
- n(this, "_fieldForLabel", null);
429
+ r(this, "_fieldForLabel", null);
430
430
  e != null && e.fieldForLabel && (this._fieldForLabel = e.fieldForLabel), e.widget_props && (this.parsedWidgetProps.label_type && (this.labelType = this.parsedWidgetProps.label_type), this.parsedWidgetProps.label_size && (this.labelSize = this.parsedWidgetProps.label_size));
431
431
  }
432
432
  get text() {
@@ -465,29 +465,29 @@ class Z extends f {
465
465
  }
466
466
  }
467
467
  class V {
468
- constructor(t = 4, e = 6, s = !1, r = void 0) {
468
+ constructor(t = 4, e = 6, s = !1, n = void 0) {
469
469
  /**
470
470
  * Number of columns the container is divided
471
471
  */
472
- n(this, "_columns");
472
+ r(this, "_columns");
473
473
  /**
474
474
  * Number of columns to use
475
475
  */
476
- n(this, "_colspan");
476
+ r(this, "_colspan");
477
477
  /**
478
478
  * Number of rows
479
479
  */
480
- n(this, "_rows");
481
- n(this, "_index");
480
+ r(this, "_rows");
481
+ r(this, "_index");
482
482
  /**
483
483
  * Determines if widget is read only (default is false)
484
484
  */
485
- n(this, "_readOnly");
485
+ r(this, "_readOnly");
486
486
  /**
487
487
  * Unique key for container
488
488
  */
489
- n(this, "_key");
490
- this._columns = t, this._colspan = e, this._rows = [[]], this._index = 0, this._readOnly = s, this._key = r;
489
+ r(this, "_key");
490
+ this._columns = t, this._colspan = e, this._rows = [[]], this._index = 0, this._readOnly = s, this._key = n;
491
491
  }
492
492
  get columns() {
493
493
  return this._columns;
@@ -530,12 +530,12 @@ class V {
530
530
  return this._columns - t;
531
531
  }
532
532
  addWidget(t, e) {
533
- const s = [], r = e ? e.addLabel : !0;
533
+ const s = [], n = e ? e.addLabel : !0;
534
534
  if (t instanceof K) {
535
535
  this._rows.push([]), this._index++;
536
536
  return;
537
537
  }
538
- if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, r && t instanceof f && !t.nolabel) {
538
+ if (t.colspan > this._columns && (t.colspan = this._columns), t.readOnly = t.readOnly || this.readOnly, n && t instanceof f && !t.nolabel) {
539
539
  t.colspan > 1 && (t.colspan -= 1);
540
540
  const l = new Z({
541
541
  name: t.id + "_label",
@@ -560,8 +560,8 @@ class V {
560
560
  findById(t) {
561
561
  var s;
562
562
  let e = null;
563
- return (s = this._rows) != null && s.length && this._rows.forEach((r) => {
564
- e || r != null && r.length && r.forEach((a) => {
563
+ return (s = this._rows) != null && s.length && this._rows.forEach((n) => {
564
+ e || n != null && n.length && n.forEach((a) => {
565
565
  e || a && (e = a.findById(t));
566
566
  });
567
567
  }), e;
@@ -575,25 +575,25 @@ const O = class O extends C {
575
575
  *
576
576
  * Corresponds to the field's name attribute from xml
577
577
  */
578
- n(this, "_id", "");
578
+ r(this, "_id", "");
579
579
  /**
580
580
  * Container
581
581
  */
582
- n(this, "_container");
582
+ r(this, "_container");
583
583
  /**
584
584
  * Must expand widget
585
585
  */
586
- n(this, "_mustExpand", !1);
586
+ r(this, "_mustExpand", !1);
587
587
  /**
588
588
  * Container label
589
589
  */
590
- n(this, "_label", "");
590
+ r(this, "_label", "");
591
591
  this._container = new V(
592
592
  e == null ? void 0 : e.col,
593
593
  O._defaultColspan,
594
594
  this.readOnly,
595
595
  e == null ? void 0 : e.key
596
- ), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label = b(e.string)));
596
+ ), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label = m(e.string)));
597
597
  }
598
598
  get id() {
599
599
  return this._id;
@@ -639,13 +639,13 @@ const O = class O extends C {
639
639
  return e === this.id ? this : this.container.findById(e);
640
640
  }
641
641
  };
642
- n(O, "_defaultColspan", 6);
642
+ r(O, "_defaultColspan", 6);
643
643
  let w = O;
644
644
  const P = class P extends w {
645
645
  constructor(e) {
646
646
  super(e);
647
- n(this, "_tabPosition", "top");
648
- n(this, "_pages", []);
647
+ r(this, "_tabPosition", "top");
648
+ r(this, "_pages", []);
649
649
  this.colspan = P._defaultColspan, e && (e.colspan && (this.colspan = e.colspan), e.tabpos && (this._tabPosition = e.tabpos));
650
650
  }
651
651
  static get defaultColspan() {
@@ -664,12 +664,12 @@ const P = class P extends w {
664
664
  return [].concat.apply([], this._container.rows);
665
665
  }
666
666
  };
667
- n(P, "_defaultColspan", 3);
667
+ r(P, "_defaultColspan", 3);
668
668
  let M = P;
669
669
  class L extends w {
670
670
  constructor(e) {
671
671
  super(e);
672
- n(this, "_loading", !1);
672
+ r(this, "_loading", !1);
673
673
  e && e.loading && (this._loading = e.loading);
674
674
  }
675
675
  get loading() {
@@ -682,7 +682,7 @@ class L extends w {
682
682
  class Oe extends L {
683
683
  constructor(e) {
684
684
  super(e);
685
- n(this, "_icon", null);
685
+ r(this, "_icon", null);
686
686
  e.icon && (this._icon = e.icon);
687
687
  }
688
688
  get icon() {
@@ -695,8 +695,8 @@ class Oe extends L {
695
695
  class Pe extends L {
696
696
  constructor(e) {
697
697
  super(e);
698
- n(this, "_icon", null);
699
- n(this, "_height");
698
+ r(this, "_icon", null);
699
+ r(this, "_height");
700
700
  if (e && (e.icon && (this._icon = e.icon), e.height))
701
701
  try {
702
702
  this._height = parseInt(e.height);
@@ -726,23 +726,23 @@ class ee extends f {
726
726
  /**
727
727
  * Type
728
728
  */
729
- n(this, "_buttonType", "workflow");
729
+ r(this, "_buttonType", "workflow");
730
730
  /**
731
731
  * Button caption
732
732
  */
733
- n(this, "_caption", "");
733
+ r(this, "_caption", "");
734
734
  /**
735
735
  * Button icon
736
736
  */
737
- n(this, "_icon");
737
+ r(this, "_icon");
738
738
  /**
739
739
  * Confirm string for modal in button types workflow
740
740
  */
741
- n(this, "_confirmMessage", "");
742
- n(this, "_primary", !1);
743
- n(this, "_danger", !1);
741
+ r(this, "_confirmMessage", "");
742
+ r(this, "_primary", !1);
743
+ r(this, "_danger", !1);
744
744
  if (e) {
745
- if (e.string && (this._caption = b(e.string)), e.buttonType && (this._buttonType = e.buttonType), e.confirm && (this._confirmMessage = b(e.confirm)), e.special && e.special === "cancel" && (this._buttonType = "cancel"), e.icon && (this._icon = e.icon), e.primary) {
745
+ if (e.string && (this._caption = m(e.string)), e.buttonType && (this._buttonType = e.buttonType), e.confirm && (this._confirmMessage = m(e.confirm)), e.special && e.special === "cancel" && (this._buttonType = "cancel"), e.icon && (this._icon = e.icon), e.primary) {
746
746
  const s = e.primary;
747
747
  (s === "1" || s === 1 || s === !0) && (this._primary = !0);
748
748
  }
@@ -792,7 +792,7 @@ class ee extends f {
792
792
  class Te extends w {
793
793
  constructor(e) {
794
794
  super(e);
795
- n(this, "_defaultName", "");
795
+ r(this, "_defaultName", "");
796
796
  e.default && (this._defaultName = e.default);
797
797
  }
798
798
  get defaultName() {
@@ -811,8 +811,8 @@ class Te extends w {
811
811
  get secondaryButtons() {
812
812
  return this.buttons.filter(
813
813
  (s) => {
814
- var r;
815
- return s.id !== ((r = this.defaultButton) == null ? void 0 : r.id);
814
+ var n;
815
+ return s.id !== ((n = this.defaultButton) == null ? void 0 : n.id);
816
816
  }
817
817
  );
818
818
  }
@@ -826,13 +826,13 @@ class A extends f {
826
826
  /**
827
827
  * Field place holder
828
828
  */
829
- n(this, "_placeholder", "");
829
+ r(this, "_placeholder", "");
830
830
  /**
831
831
  * Field size
832
832
  */
833
- n(this, "_size");
834
- n(this, "_isPassword", !1);
835
- n(this, "_translatable", !1);
833
+ r(this, "_size");
834
+ r(this, "_isPassword", !1);
835
+ r(this, "_translatable", !1);
836
836
  e && (e.size && (this._size = e.size), e.password && (this.isPassword = e.password === "True"), e.translate && (this.translatable = e.translate === "True" || e.translate === !0));
837
837
  }
838
838
  get placeholder() {
@@ -869,22 +869,22 @@ class G extends f {
869
869
  /**
870
870
  * Field place holder
871
871
  */
872
- n(this, "_placeholder", "");
872
+ r(this, "_placeholder", "");
873
873
  /**
874
874
  * Field size
875
875
  */
876
- n(this, "_size");
876
+ r(this, "_size");
877
877
  /**
878
878
  * Must expand widget
879
879
  */
880
- n(this, "_mustExpand", !1);
880
+ r(this, "_mustExpand", !1);
881
881
  /**
882
882
  * Height
883
883
  */
884
- n(this, "_height");
885
- n(this, "_translatable", !1);
884
+ r(this, "_height");
885
+ r(this, "_translatable", !1);
886
886
  if (e) {
887
- if (e.placeholder && (this._placeholder = b(e.placeholder)), e.colspan || (this._mustExpand = !0), e.height)
887
+ if (e.placeholder && (this._placeholder = m(e.placeholder)), e.colspan || (this._mustExpand = !0), e.height)
888
888
  try {
889
889
  this._height = parseInt(e.height);
890
890
  } catch {
@@ -933,7 +933,7 @@ class I extends f {
933
933
  /**
934
934
  * Field size
935
935
  */
936
- n(this, "_size", 150);
936
+ r(this, "_size", 150);
937
937
  e && e.size && (this._size = e.size);
938
938
  }
939
939
  get size() {
@@ -949,11 +949,11 @@ class We extends f {
949
949
  /**
950
950
  * Field size
951
951
  */
952
- n(this, "_size", 150);
952
+ r(this, "_size", 150);
953
953
  /**
954
954
  * Relation
955
955
  */
956
- n(this, "_relation", "");
956
+ r(this, "_relation", "");
957
957
  e && (e.size && (this._size = e.size), e.relation && (this._relation = e.relation));
958
958
  }
959
959
  get size() {
@@ -989,16 +989,16 @@ class R extends f {
989
989
  *
990
990
  * Number of integer digits that will be part of the float
991
991
  */
992
- n(this, "_integerDigits", 16);
992
+ r(this, "_integerDigits", 16);
993
993
  /**
994
994
  * Decimal digits
995
995
  *
996
996
  * Number of decimal digits that will be part of the float
997
997
  */
998
- n(this, "_decimalDigits", 2);
998
+ r(this, "_decimalDigits", 2);
999
999
  if (e != null && e.digits) {
1000
- const [s, r] = e.digits;
1001
- this._integerDigits = s, this._decimalDigits = r;
1000
+ const [s, n] = e.digits;
1001
+ this._integerDigits = s, this._decimalDigits = n;
1002
1002
  }
1003
1003
  }
1004
1004
  get integerDigits() {
@@ -1036,35 +1036,35 @@ class ie extends f {
1036
1036
  /**
1037
1037
  * Field size
1038
1038
  */
1039
- n(this, "_size", 150);
1039
+ r(this, "_size", 150);
1040
1040
  /**
1041
1041
  * Relation
1042
1042
  */
1043
- n(this, "_relation", "");
1043
+ r(this, "_relation", "");
1044
1044
  /**
1045
1045
  * Inv_field
1046
1046
  */
1047
- n(this, "_inv_field");
1047
+ r(this, "_inv_field");
1048
1048
  /**
1049
1049
  * Views
1050
1050
  */
1051
- n(this, "_views", null);
1051
+ r(this, "_views", null);
1052
1052
  /**
1053
1053
  * Mode
1054
1054
  */
1055
- n(this, "_mode", []);
1055
+ r(this, "_mode", []);
1056
1056
  /**
1057
1057
  * Must expand widget
1058
1058
  */
1059
- n(this, "_mustExpand", !1);
1059
+ r(this, "_mustExpand", !1);
1060
1060
  /**
1061
1061
  * Height
1062
1062
  */
1063
- n(this, "_height");
1063
+ r(this, "_height");
1064
1064
  /**
1065
1065
  * Infinite mode
1066
1066
  */
1067
- n(this, "_infinite", !1);
1067
+ r(this, "_infinite", !1);
1068
1068
  if (e) {
1069
1069
  if (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.mode && (this._mode = e.mode.split(",")), e.views && (this._views = e.views), e.colspan ? this.colspan = e.colspan : this._mustExpand = !0, e.inv_field && (this._inv_field = e.inv_field), e.height)
1070
1070
  try {
@@ -1130,9 +1130,9 @@ class je extends C {
1130
1130
  /**
1131
1131
  * Label
1132
1132
  */
1133
- n(this, "_label", "");
1134
- n(this, "_icon", null);
1135
- e && (e.string && (this._label = b(e.string)), e.icon && (this._icon = e.icon));
1133
+ r(this, "_label", "");
1134
+ r(this, "_icon", null);
1135
+ e && (e.string && (this._label = m(e.string)), e.icon && (this._icon = e.icon));
1136
1136
  }
1137
1137
  get label() {
1138
1138
  return this._label;
@@ -1158,7 +1158,7 @@ class Ae extends f {
1158
1158
  /**
1159
1159
  * Filename field name
1160
1160
  */
1161
- n(this, "_filenameField", "");
1161
+ r(this, "_filenameField", "");
1162
1162
  e && e.filename && (this._filenameField = e.filename);
1163
1163
  }
1164
1164
  get filenameField() {
@@ -1185,11 +1185,11 @@ class Le extends ie {
1185
1185
  /**
1186
1186
  * Title field
1187
1187
  */
1188
- n(this, "_titleField");
1188
+ r(this, "_titleField");
1189
1189
  /**
1190
1190
  * Summary field
1191
1191
  */
1192
- n(this, "_summaryField");
1192
+ r(this, "_summaryField");
1193
1193
  this._titleField = "", this._summaryField = "", this._parsedWidgetProps && (this._titleField = this._parsedWidgetProps.titleField, this._summaryField = this.parsedWidgetProps.summaryField);
1194
1194
  }
1195
1195
  get titleField() {
@@ -1214,16 +1214,17 @@ class Le extends ie {
1214
1214
  class Ge extends I {
1215
1215
  constructor(e) {
1216
1216
  super(e);
1217
- n(this, "_nolabel", !0);
1218
- n(this, "_card");
1219
- n(this, "_icon");
1220
- n(this, "_suffix");
1217
+ r(this, "_nolabel", !0);
1218
+ r(this, "_card");
1219
+ r(this, "_icon");
1220
+ r(this, "_suffix");
1221
+ r(this, "_color");
1221
1222
  /**
1222
1223
  * Action id
1223
1224
  */
1224
- n(this, "_actionId");
1225
- n(this, "_height");
1226
- if (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)), e.height))
1225
+ r(this, "_actionId");
1226
+ r(this, "_height");
1227
+ if (this._card = !1, this._icon = "", this._suffix = "", this._parsedWidgetProps && (this._card = this._parsedWidgetProps.card || !1, this._icon = m(this._parsedWidgetProps.icon) || "", this._suffix = this._parsedWidgetProps.suffix || "", this._color = m(this._parsedWidgetProps.color) || ""), e && (e.action_id && (this._actionId = parseInt(e.action_id)), e.height))
1227
1228
  try {
1228
1229
  this._height = parseInt(e.height);
1229
1230
  } catch (s) {
@@ -1248,6 +1249,9 @@ class Ge extends I {
1248
1249
  set suffix(e) {
1249
1250
  this._suffix = e;
1250
1251
  }
1252
+ get color() {
1253
+ return this._color;
1254
+ }
1251
1255
  get actionId() {
1252
1256
  return this._actionId;
1253
1257
  }
@@ -1267,20 +1271,20 @@ class se extends f {
1267
1271
  /**
1268
1272
  * Field size
1269
1273
  */
1270
- n(this, "_size", 150);
1274
+ r(this, "_size", 150);
1271
1275
  /**
1272
1276
  * Relation
1273
1277
  */
1274
- n(this, "_relation", "");
1278
+ r(this, "_relation", "");
1275
1279
  /**
1276
1280
  * Inv_field
1277
1281
  */
1278
- n(this, "_inv_field");
1282
+ r(this, "_inv_field");
1279
1283
  /**
1280
1284
  * field to define the value to show
1281
1285
  */
1282
- n(this, "_field", "name");
1283
- n(this, "_columns", 4);
1286
+ r(this, "_field", "name");
1287
+ r(this, "_columns", 4);
1284
1288
  e && (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.inv_field && (this._inv_field = e.inv_field), this.parsedWidgetProps.hasOwnProperty("field") && (this._field = this.parsedWidgetProps.field), this.parsedWidgetProps.columns && (this._columns = this.parsedWidgetProps.columns));
1285
1289
  }
1286
1290
  get size() {
@@ -1331,7 +1335,7 @@ class qe extends I {
1331
1335
  /**
1332
1336
  * Define the direction
1333
1337
  */
1334
- n(this, "_direction", "horizontal");
1338
+ r(this, "_direction", "horizontal");
1335
1339
  e && this.parsedWidgetProps.hasOwnProperty("direction") && (this._direction = this.parsedWidgetProps.direction);
1336
1340
  }
1337
1341
  get direction() {
@@ -1349,9 +1353,9 @@ class He extends f {
1349
1353
  /**
1350
1354
  * Relation
1351
1355
  */
1352
- n(this, "_relation", "");
1353
- n(this, "_errorField", null);
1354
- n(this, "_lastStep", !0);
1356
+ r(this, "_relation", "");
1357
+ r(this, "_errorField", null);
1358
+ r(this, "_lastStep", !0);
1355
1359
  e && (e.relation && (this._relation = e.relation), this.parsedWidgetProps.hasOwnProperty("error_field") && (this._errorField = this.parsedWidgetProps.error_field), this.parsedWidgetProps.hasOwnProperty("last_step") && (this._lastStep = this.parsedWidgetProps.last_step));
1356
1360
  }
1357
1361
  get relation() {
@@ -1373,10 +1377,10 @@ class He extends f {
1373
1377
  this._lastStep = e;
1374
1378
  }
1375
1379
  }
1376
- class ne extends G {
1380
+ class re extends G {
1377
1381
  constructor(e) {
1378
1382
  super(e);
1379
- n(this, "_lang", null);
1383
+ r(this, "_lang", null);
1380
1384
  e && this.parsedWidgetProps.lang && (this._lang = this.parsedWidgetProps.lang);
1381
1385
  }
1382
1386
  get lang() {
@@ -1397,10 +1401,10 @@ class Xe extends w {
1397
1401
  /**
1398
1402
  * Alert type
1399
1403
  */
1400
- n(this, "_alertType", "info");
1401
- n(this, "_title", "");
1402
- n(this, "_text", "");
1403
- n(this, "_icon", null);
1404
+ r(this, "_alertType", "info");
1405
+ r(this, "_title", "");
1406
+ r(this, "_text", "");
1407
+ r(this, "_icon", null);
1404
1408
  e && (e.alert_type && (this._alertType = e.alert_type), e.title && (this._title = e.title), e.text && (this._text = e.text), e.icon && (this._icon = e.icon));
1405
1409
  }
1406
1410
  get alertType() {
@@ -1437,7 +1441,7 @@ class Ue extends f {
1437
1441
  /**
1438
1442
  * Height of the comments component
1439
1443
  */
1440
- n(this, "_height");
1444
+ r(this, "_height");
1441
1445
  if (e.height) {
1442
1446
  const s = parseInt(e.height);
1443
1447
  this._height = isNaN(s) ? void 0 : s;
@@ -1450,17 +1454,17 @@ class Ue extends f {
1450
1454
  this._height = e;
1451
1455
  }
1452
1456
  }
1453
- class H extends ne {
1457
+ class H extends re {
1454
1458
  constructor() {
1455
1459
  super(...arguments);
1456
- n(this, "_lang", "json");
1460
+ r(this, "_lang", "json");
1457
1461
  }
1458
1462
  }
1459
1463
  class Ke extends f {
1460
1464
  constructor(e) {
1461
1465
  super(e);
1462
- n(this, "_multi", !1);
1463
- n(this, "_size");
1466
+ r(this, "_multi", !1);
1467
+ r(this, "_size");
1464
1468
  e && e.size && (this.size = e.size), this.parsedWidgetProps.multi && (this.multi = this.parsedWidgetProps.multi);
1465
1469
  }
1466
1470
  get multi() {
@@ -1479,7 +1483,7 @@ class Ke extends f {
1479
1483
  class Ze extends w {
1480
1484
  constructor(e) {
1481
1485
  super(e);
1482
- n(this, "_autoPlay", !0);
1486
+ r(this, "_autoPlay", !0);
1483
1487
  e && "auto_play" in e && (this._autoPlay = T(e.auto_play));
1484
1488
  }
1485
1489
  get autoPlay() {
@@ -1502,7 +1506,7 @@ class $ {
1502
1506
  /**
1503
1507
  * Widget class
1504
1508
  */
1505
- n(this, "_widgetClass");
1509
+ r(this, "_widgetClass");
1506
1510
  }
1507
1511
  setWidgetClass(t) {
1508
1512
  switch (t) {
@@ -1617,7 +1621,7 @@ class $ {
1617
1621
  this._widgetClass = He;
1618
1622
  break;
1619
1623
  case "codeeditor":
1620
- this._widgetClass = ne;
1624
+ this._widgetClass = re;
1621
1625
  break;
1622
1626
  case "time":
1623
1627
  this._widgetClass = Qe;
@@ -1678,7 +1682,7 @@ const tt = ({
1678
1682
  const s = (l = e[i]) == null ? void 0 : l.states;
1679
1683
  if (!s)
1680
1684
  return {};
1681
- const r = {}, a = {};
1685
+ const n = {}, a = {};
1682
1686
  for (const o of Object.keys(s))
1683
1687
  if (t.state === o) {
1684
1688
  const u = s[o];
@@ -1689,9 +1693,9 @@ const tt = ({
1689
1693
  }
1690
1694
  for (const o of Object.keys(a)) {
1691
1695
  const u = a[o];
1692
- r[o] = u.some((_) => _);
1696
+ n[o] = u.some((_) => _);
1693
1697
  }
1694
- return r;
1698
+ return n;
1695
1699
  }, it = ({
1696
1700
  states: i,
1697
1701
  values: t
@@ -1706,11 +1710,11 @@ function st({
1706
1710
  fieldName: t,
1707
1711
  fields: e = {}
1708
1712
  }) {
1709
- var r;
1710
- const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
1713
+ var n;
1714
+ const s = ((n = e[t]) == null ? void 0 : n.type) || "passthrough";
1711
1715
  return s === "many2one" ? i[t] ? i[t][0] || null : !1 : s === "one2many" || s === "many2many" ? i[t].map((a) => a.id) : i != null && i[t] ? i == null ? void 0 : i[t] : t.includes("'") ? t : parseInt(t);
1712
1716
  }
1713
- const re = ({
1717
+ const ne = ({
1714
1718
  context: i,
1715
1719
  values: t,
1716
1720
  fields: e
@@ -1727,12 +1731,12 @@ const re = ({
1727
1731
  return;
1728
1732
  const d = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((c) => c.split(":")), g = {};
1729
1733
  return d.forEach((c) => {
1730
- const m = c[1];
1734
+ const b = c[1];
1731
1735
  if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
1732
1736
  const p = st({
1733
1737
  values: t,
1734
1738
  fields: e,
1735
- fieldName: m === "active_id" ? "id" : m
1739
+ fieldName: b === "active_id" ? "id" : b
1736
1740
  });
1737
1741
  g[c[0].replace(/'/g, "")] = p || void 0;
1738
1742
  } else
@@ -1764,20 +1768,20 @@ function ae(i) {
1764
1768
  function le(i) {
1765
1769
  return typeof i == "object" && i !== null && typeof i != "string";
1766
1770
  }
1767
- const nt = (i) => {
1768
- const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
1771
+ const rt = (i) => {
1772
+ const t = i.trim().replace(")", "").split("("), e = t[0], n = t[1].split(",").map((a) => a.trim());
1769
1773
  return {
1770
1774
  method: e,
1771
- args: r
1775
+ args: n
1772
1776
  };
1773
1777
  };
1774
- function rt(i) {
1778
+ function nt(i) {
1775
1779
  const t = [];
1776
1780
  function e(s) {
1777
- const r = [];
1781
+ const n = [];
1778
1782
  for (const a of s)
1779
- a instanceof w ? e(a._container.rows.flat()) : r.push(a);
1780
- r.length > 0 && t.push(r);
1783
+ a instanceof w ? e(a._container.rows.flat()) : n.push(a);
1784
+ n.length > 0 && t.push(n);
1781
1785
  }
1782
1786
  for (const s of i)
1783
1787
  e(s);
@@ -1788,25 +1792,25 @@ class Wt {
1788
1792
  /**
1789
1793
  * Object containing fields specification of the form.
1790
1794
  */
1791
- n(this, "_fields");
1792
- n(this, "_container");
1793
- n(this, "_string", null);
1795
+ r(this, "_fields");
1796
+ r(this, "_container");
1797
+ r(this, "_string", null);
1794
1798
  /**
1795
1799
  * Widget type
1796
1800
  */
1797
- n(this, "_type", "form");
1801
+ r(this, "_type", "form");
1798
1802
  /**
1799
1803
  * Determines if form is read only (default is false)
1800
1804
  */
1801
- n(this, "_readOnly", !1);
1805
+ r(this, "_readOnly", !1);
1802
1806
  /**
1803
1807
  * Context
1804
1808
  */
1805
- n(this, "_context", {});
1809
+ r(this, "_context", {});
1806
1810
  /**
1807
1811
  * Collection of onChange actions for fields
1808
1812
  */
1809
- n(this, "_onChangeFields", {});
1813
+ r(this, "_onChangeFields", {});
1810
1814
  /*
1811
1815
  _widgets = {
1812
1816
  *[Symbol.iterator]() {
@@ -1825,19 +1829,19 @@ class Wt {
1825
1829
  /**
1826
1830
  * Unique key for container
1827
1831
  */
1828
- n(this, "_keyIdx", 0);
1832
+ r(this, "_keyIdx", 0);
1829
1833
  /**
1830
1834
  * List of invisible fields
1831
1835
  */
1832
- n(this, "_invisibleFields", []);
1836
+ r(this, "_invisibleFields", []);
1833
1837
  /**
1834
1838
  * List of autorefreshable fields
1835
1839
  */
1836
- n(this, "_autorefreshableFields", []);
1840
+ r(this, "_autorefreshableFields", []);
1837
1841
  /**
1838
1842
  * Context for each field in the form
1839
1843
  */
1840
- n(this, "_contextForFields", {});
1844
+ r(this, "_contextForFields", {});
1841
1845
  this._fields = t, this._container = new V(e, 6, !1, "root");
1842
1846
  }
1843
1847
  get fields() {
@@ -1893,13 +1897,13 @@ class Wt {
1893
1897
  }
1894
1898
  parse(t, e) {
1895
1899
  var o;
1896
- const { values: s = {}, readOnly: r = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
1897
- 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({
1900
+ const { values: s = {}, readOnly: n = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
1901
+ this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = m(this._string)), this._readOnly = n, this._context = s.id ? { active_id: s.id, active_ids: [s.id] } : {}, this._invisibleFields = [], this.parseNode({
1898
1902
  fields: a.children,
1899
1903
  container: this._container,
1900
1904
  values: s
1901
1905
  });
1902
- const l = rt(this._container._rows);
1906
+ const l = nt(this._container._rows);
1903
1907
  l.forEach((u) => {
1904
1908
  const _ = u;
1905
1909
  _._id && _._context && (this._contextForFields[_._id] = u._context);
@@ -1910,7 +1914,7 @@ class Wt {
1910
1914
  container: e,
1911
1915
  values: s
1912
1916
  }) {
1913
- const r = new $();
1917
+ const n = new $();
1914
1918
  t.filter((a) => typeof a == "object").forEach((a) => {
1915
1919
  var v, F;
1916
1920
  const { tagName: l, attributes: o, children: u } = a;
@@ -1950,25 +1954,25 @@ class Wt {
1950
1954
  values: s,
1951
1955
  fields: this._fields
1952
1956
  });
1953
- const c = re({
1957
+ const c = ne({
1954
1958
  context: h.context || ((v = this._fields[h.name]) == null ? void 0 : v.context),
1955
1959
  values: s,
1956
1960
  fields: this._fields
1957
1961
  });
1958
- h.on_change && (this._onChangeFields[h.name] = nt(
1962
+ h.on_change && (this._onChangeFields[h.name] = rt(
1959
1963
  h.on_change
1960
1964
  ));
1961
- let m;
1962
- Q(h.domain) ? m = h.domain : Q((F = this._fields[h.name]) == null ? void 0 : F.domain) && (m = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
1965
+ let b;
1966
+ Q(h.domain) ? b = h.domain : Q((F = this._fields[h.name]) == null ? void 0 : F.domain) && (b = this._fields[h.name].domain), this._keyIdx = this._keyIdx + 1;
1963
1967
  const p = {
1964
1968
  ...d,
1965
1969
  ...g,
1966
1970
  context: c,
1967
- domain: m,
1971
+ domain: b,
1968
1972
  key: `${this._keyIdx}`
1969
1973
  };
1970
1974
  e.readOnly && (p.readonly = !0);
1971
- const y = r.createWidget(_, p);
1975
+ const y = n.createWidget(_, p);
1972
1976
  y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof w && this.parseNode({
1973
1977
  fields: u,
1974
1978
  container: y.container,
@@ -1992,34 +1996,34 @@ class It {
1992
1996
  /**
1993
1997
  * Object containing fields specification of the form.
1994
1998
  */
1995
- n(this, "_fields");
1996
- n(this, "_columns", []);
1997
- n(this, "_string", null);
1999
+ r(this, "_fields");
2000
+ r(this, "_columns", []);
2001
+ r(this, "_string", null);
1998
2002
  /**
1999
2003
  * Widget type
2000
2004
  */
2001
- n(this, "_type", "tree");
2005
+ r(this, "_type", "tree");
2002
2006
  /**
2003
2007
  * Color expression value
2004
2008
  */
2005
- n(this, "_colors", null);
2006
- n(this, "_status", null);
2009
+ r(this, "_colors", null);
2010
+ r(this, "_status", null);
2007
2011
  /**
2008
2012
  * Editable value
2009
2013
  */
2010
- n(this, "_editable", null);
2014
+ r(this, "_editable", null);
2011
2015
  /**
2012
2016
  * Context for each field in the form
2013
2017
  */
2014
- n(this, "_contextForFields", {});
2018
+ r(this, "_contextForFields", {});
2015
2019
  /**
2016
2020
  * List of autorefreshable fields
2017
2021
  */
2018
- n(this, "_autorefreshableFields", []);
2022
+ r(this, "_autorefreshableFields", []);
2019
2023
  /**
2020
2024
  * Is infinite
2021
2025
  */
2022
- n(this, "_infinite", !1);
2026
+ r(this, "_infinite", !1);
2023
2027
  this._fields = t;
2024
2028
  }
2025
2029
  get fields() {
@@ -2059,11 +2063,11 @@ class It {
2059
2063
  this._infinite = t;
2060
2064
  }
2061
2065
  parse(t) {
2062
- const e = D.parse(t).filter((r) => r.tagName === "tree")[0];
2063
- this._string = e.attributes.string || null, this._string && (this._string = b(this._string)), this._colors = e.attributes.colors || null, this._colors && (this._colors = b(this._colors)), this._status = e.attributes.status || null, this._status && (this._status = b(this._status)), this._editable = e.attributes.editable || null, this._infinite = e.attributes.infinite || !1;
2066
+ const e = D.parse(t).filter((n) => n.tagName === "tree")[0];
2067
+ this._string = e.attributes.string || null, this._string && (this._string = m(this._string)), this._colors = e.attributes.colors || null, this._colors && (this._colors = m(this._colors)), this._status = e.attributes.status || null, this._status && (this._status = m(this._status)), this._editable = e.attributes.editable || null, this._infinite = e.attributes.infinite || !1;
2064
2068
  const s = new $();
2065
- e.children.forEach((r) => {
2066
- const { tagName: a, attributes: l } = r;
2069
+ e.children.forEach((n) => {
2070
+ const { tagName: a, attributes: l } = n;
2067
2071
  let o = null;
2068
2072
  if (a === "field") {
2069
2073
  const { name: u, widget: _ } = l;
@@ -2073,7 +2077,7 @@ class It {
2073
2077
  throw new Error(`Field ${u} doesn't exist in fields defintion`);
2074
2078
  const d = this._fields[u];
2075
2079
  o = d.type, (Array.isArray(d == null ? void 0 : d.domain) && (d == null ? void 0 : d.domain.length) === 0 || (d == null ? void 0 : d.domain) === !1) && l.domain && l.domain.length > 0 && delete d.domain;
2076
- const g = re({
2080
+ const g = ne({
2077
2081
  context: l.context || d.context,
2078
2082
  values: {},
2079
2083
  fields: this._fields
@@ -2119,13 +2123,13 @@ class Et {
2119
2123
  /**
2120
2124
  * Object containing the specific fields for primary and secondary search fields
2121
2125
  */
2122
- n(this, "_searchFields");
2126
+ r(this, "_searchFields");
2123
2127
  /**
2124
2128
  * Object containing all the fields specification of the whole form
2125
2129
  */
2126
- n(this, "_fields");
2127
- n(this, "_simpleSearchContainer");
2128
- n(this, "_advancedSearchContainer");
2130
+ r(this, "_fields");
2131
+ r(this, "_simpleSearchContainer");
2132
+ r(this, "_advancedSearchContainer");
2129
2133
  this._searchFields = t, this._fields = e, this._simpleSearchContainer = new V(s), this._advancedSearchContainer = new V(s);
2130
2134
  }
2131
2135
  get searchFields() {
@@ -2145,24 +2149,24 @@ class Et {
2145
2149
  this.parseFields(
2146
2150
  this.searchFields.primary,
2147
2151
  t
2148
- ).forEach((r) => {
2149
- this.simpleSearchContainer.addWidget(r, { addLabel: !1 }), this.advancedSearchContainer.addWidget(r, { addLabel: !1 });
2152
+ ).forEach((n) => {
2153
+ this.simpleSearchContainer.addWidget(n, { addLabel: !1 }), this.advancedSearchContainer.addWidget(n, { addLabel: !1 });
2150
2154
  }), this.parseFields(
2151
2155
  this.searchFields.secondary,
2152
2156
  t
2153
- ).forEach((r) => {
2154
- this.advancedSearchContainer.addWidget(r, { addLabel: !1 });
2157
+ ).forEach((n) => {
2158
+ this.advancedSearchContainer.addWidget(n, { addLabel: !1 });
2155
2159
  });
2156
2160
  }
2157
2161
  parseFields(t, e) {
2158
2162
  return t.map((s) => {
2159
- const r = {
2163
+ const n = {
2160
2164
  ...this.fields[s],
2161
2165
  name: s,
2162
2166
  colspan: 2
2163
- }, { type: a, widget: l } = r;
2167
+ }, { type: a, widget: l } = n;
2164
2168
  let o = l ?? a;
2165
- return at[o] === void 0 && (o = a), e.createWidget(o, r);
2169
+ return at[o] === void 0 && (o = a), e.createWidget(o, n);
2166
2170
  });
2167
2171
  }
2168
2172
  /**
@@ -2181,18 +2185,18 @@ const St = ({
2181
2185
  return i.forEach((s) => {
2182
2186
  if (!Array.isArray(s))
2183
2187
  return;
2184
- const [r, a, l] = s;
2188
+ const [n, a, l] = s;
2185
2189
  let o, u;
2186
- r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), u = r.substr(
2187
- r.indexOf(".") + 1,
2188
- r.length - 1
2189
- )) : (o = r, u = "id"), o === t && e.push([u, a, l]);
2190
+ n.indexOf(".") !== -1 ? (o = n.substr(0, n.indexOf(".")), u = n.substr(
2191
+ n.indexOf(".") + 1,
2192
+ n.length - 1
2193
+ )) : (o = n, u = "id"), o === t && e.push([u, a, l]);
2190
2194
  }), e;
2191
2195
  }, zt = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
2192
2196
  class lt {
2193
2197
  constructor(t) {
2194
- n(this, "_action_id", null);
2195
- n(this, "_position", null);
2198
+ r(this, "_action_id", null);
2199
+ r(this, "_position", null);
2196
2200
  t.action_id && (this._action_id = t.action_id), t.position && (this._position = t.position);
2197
2201
  }
2198
2202
  get action_id() {
@@ -2204,13 +2208,13 @@ class lt {
2204
2208
  }
2205
2209
  class Vt {
2206
2210
  constructor(t) {
2207
- n(this, "_string", null);
2208
- n(this, "_items", []);
2209
- const e = D.parse(t).filter((r) => r.tagName === "dashboard")[0];
2211
+ r(this, "_string", null);
2212
+ r(this, "_items", []);
2213
+ const e = D.parse(t).filter((n) => n.tagName === "dashboard")[0];
2210
2214
  this._string = e.attributes.string || null;
2211
2215
  const { children: s } = e;
2212
- s.forEach((r) => {
2213
- r.tagName === "dashboard_item" && this._items.push(new lt(r.attributes));
2216
+ s.forEach((n) => {
2217
+ n.tagName === "dashboard_item" && this._items.push(new lt(n.attributes));
2214
2218
  });
2215
2219
  }
2216
2220
  get string() {
@@ -2222,11 +2226,11 @@ class Vt {
2222
2226
  }
2223
2227
  class oe {
2224
2228
  constructor(t) {
2225
- n(this, "_string", null);
2226
- n(this, "_type");
2227
- n(this, "_timerange", null);
2228
- n(this, "_interval", 1);
2229
- n(this, "_y_range", "default");
2229
+ r(this, "_string", null);
2230
+ r(this, "_type");
2231
+ r(this, "_timerange", null);
2232
+ r(this, "_interval", 1);
2233
+ r(this, "_y_range", "default");
2230
2234
  if (this._string = t.attributes.string || null, this._timerange = t.attributes.timerange || null, t.attributes.interval && (this._interval = parseInt(t.attributes.interval)), t.attributes.y_range) {
2231
2235
  const e = t.attributes.y_range;
2232
2236
  (e === "auto" || e === "full" || e === "default") && (this._y_range = e);
@@ -2251,12 +2255,12 @@ class oe {
2251
2255
  class ce extends oe {
2252
2256
  constructor(e, s) {
2253
2257
  super(s);
2254
- n(this, "_color", null);
2255
- n(this, "_icon", null);
2256
- n(this, "_totalDomain", null);
2257
- n(this, "_showPercent", !1);
2258
- n(this, "_suffix", null);
2259
- 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 = T(s.attributes.showPercent);
2258
+ r(this, "_color", null);
2259
+ r(this, "_icon", null);
2260
+ r(this, "_totalDomain", null);
2261
+ r(this, "_showPercent", !1);
2262
+ r(this, "_suffix", null);
2263
+ this._type = e, this._color = s.attributes.color || null, this._color && (this._color = m(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = m(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = m(s.attributes.totalDomain) || null, this._showPercent = T(s.attributes.showPercent);
2260
2264
  }
2261
2265
  get color() {
2262
2266
  return this._color;
@@ -2277,10 +2281,10 @@ class ce extends oe {
2277
2281
  class ot extends ce {
2278
2282
  constructor(e, s) {
2279
2283
  super(e, s);
2280
- n(this, "_field");
2281
- n(this, "_operator");
2282
- const { children: r } = s;
2283
- r.forEach((a) => {
2284
+ r(this, "_field");
2285
+ r(this, "_operator");
2286
+ const { children: n } = s;
2287
+ n.forEach((a) => {
2284
2288
  if (a.tagName === "field") {
2285
2289
  const l = a.attributes.name, o = a.attributes.operator;
2286
2290
  this._field = l || void 0, this._operator = o;
@@ -2299,14 +2303,14 @@ const ct = (i) => {
2299
2303
  let e;
2300
2304
  if (i.forEach((s) => {
2301
2305
  if (s.tagName === "field") {
2302
- const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, u = s.attributes.stacked || void 0;
2303
- if (!r)
2306
+ const n = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, u = s.attributes.stacked || void 0;
2307
+ if (!n)
2304
2308
  throw new Error(`Field ${l} doesn't have an axis`);
2305
2309
  if (!l)
2306
2310
  throw new Error("Missing name attribute for field");
2307
- r === "x" ? e = new ht({
2311
+ n === "x" ? e = new ht({
2308
2312
  name: l
2309
- }) : r === "y" && t.push(
2313
+ }) : n === "y" && t.push(
2310
2314
  new dt({
2311
2315
  name: l,
2312
2316
  operator: a,
@@ -2327,11 +2331,11 @@ const ct = (i) => {
2327
2331
  class j extends oe {
2328
2332
  constructor(e, s) {
2329
2333
  super(s);
2330
- n(this, "_x");
2331
- n(this, "_y");
2334
+ r(this, "_x");
2335
+ r(this, "_y");
2332
2336
  this._type = e;
2333
- const r = ct(s.children);
2334
- this._x = r.x, this._y = r.y;
2337
+ const n = ct(s.children);
2338
+ this._x = n.x, this._y = n.y;
2335
2339
  }
2336
2340
  get x() {
2337
2341
  return this._x;
@@ -2347,7 +2351,7 @@ const ut = {
2347
2351
  bar: j,
2348
2352
  pie: j
2349
2353
  }, Yt = (i) => {
2350
- const t = D.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
2354
+ const t = D.parse(i).filter((n) => n.tagName === "graph")[0], e = t.attributes.type;
2351
2355
  if (!e)
2352
2356
  throw new Error(`${e} is not a valid graph`);
2353
2357
  const s = ut[e];
@@ -2357,8 +2361,8 @@ const ut = {
2357
2361
  };
2358
2362
  class ue {
2359
2363
  constructor({ name: t, axis: e }) {
2360
- n(this, "_name");
2361
- n(this, "_axis");
2364
+ r(this, "_name");
2365
+ r(this, "_axis");
2362
2366
  this._name = t, this._axis = e;
2363
2367
  }
2364
2368
  get name() {
@@ -2372,14 +2376,14 @@ class dt extends ue {
2372
2376
  constructor({
2373
2377
  name: e,
2374
2378
  operator: s,
2375
- label: r,
2379
+ label: n,
2376
2380
  stacked: a
2377
2381
  }) {
2378
2382
  super({ name: e, axis: "y" });
2379
- n(this, "_operator");
2380
- n(this, "_label");
2381
- n(this, "_stacked");
2382
- this._operator = s, this._label = r, this._stacked = a;
2383
+ r(this, "_operator");
2384
+ r(this, "_label");
2385
+ r(this, "_stacked");
2386
+ this._operator = s, this._label = n, this._stacked = a;
2383
2387
  }
2384
2388
  get operator() {
2385
2389
  return this._operator;
@@ -2407,16 +2411,16 @@ function q({
2407
2411
  values: t,
2408
2412
  fieldName: e
2409
2413
  }) {
2410
- const s = i[e], r = t[e];
2414
+ const s = i[e], n = t[e];
2411
2415
  if (!s)
2412
2416
  throw new Error(`Field ${e} not found`);
2413
2417
  if (s.type === "many2one")
2414
- return r ? { value: r[0], label: r[1] } : { value: !1, label: void 0 };
2418
+ return n ? { value: n[0], label: n[1] } : { value: !1, label: void 0 };
2415
2419
  if (s.type === "selection") {
2416
- const l = s.selection.find((o) => o[0] === r);
2417
- return l ? { value: r, label: l[1] } : { value: !1, label: void 0 };
2420
+ const l = s.selection.find((o) => o[0] === n);
2421
+ return l ? { value: n, label: l[1] } : { value: !1, label: void 0 };
2418
2422
  }
2419
- return { value: r, label: r };
2423
+ return { value: n, label: n };
2420
2424
  }
2421
2425
  const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2422
2426
  __proto__: null,
@@ -2444,12 +2448,12 @@ function gt({
2444
2448
  interval: e = 1
2445
2449
  }) {
2446
2450
  let s = [];
2447
- const r = he({
2451
+ const n = he({
2448
2452
  values: i,
2449
2453
  groupBy: "type-stacked"
2450
2454
  }), a = `${t}s`;
2451
- return Object.keys(r).forEach((o) => {
2452
- const u = r[o];
2455
+ return Object.keys(n).forEach((o) => {
2456
+ const u = n[o];
2453
2457
  for (let _ = 0; _ < u.length; _++) {
2454
2458
  const h = u[_];
2455
2459
  if (s.push(h), _ === u.length - 1)
@@ -2462,8 +2466,8 @@ function gt({
2462
2466
  interval: e
2463
2467
  });
2464
2468
  s = s.concat(
2465
- c.map((m) => ({
2466
- x: m,
2469
+ c.map((b) => ({
2470
+ x: b,
2467
2471
  value: 0,
2468
2472
  type: h.type,
2469
2473
  stacked: h.stacked
@@ -2478,19 +2482,19 @@ function mt({
2478
2482
  timerange: t,
2479
2483
  interval: e = 1
2480
2484
  }) {
2481
- const s = [], r = `${t}s`;
2485
+ const s = [], n = `${t}s`;
2482
2486
  if (i.length === 1)
2483
2487
  return i;
2484
2488
  const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
2485
2489
  for (let l = 0; l < a.length - 1; l++) {
2486
2490
  const o = a[l], u = a[l + 1];
2487
- if (!de([o, u], r)) {
2488
- const _ = W(o, z(r)).add(
2491
+ if (!de([o, u], n)) {
2492
+ const _ = W(o, z(n)).add(
2489
2493
  e,
2490
- r
2491
- ), h = W(u, z(r));
2494
+ n
2495
+ ), h = W(u, z(n));
2492
2496
  for (; _.isBefore(h); )
2493
- s.push(_.format(z(r))), _.add(e, r);
2497
+ s.push(_.format(z(n))), _.add(e, n);
2494
2498
  }
2495
2499
  }
2496
2500
  return s;
@@ -2502,12 +2506,12 @@ function bt({
2502
2506
  const e = yt({
2503
2507
  values: i,
2504
2508
  timerange: t
2505
- }), s = [], r = he({
2509
+ }), s = [], n = he({
2506
2510
  values: e,
2507
2511
  groupBy: "all"
2508
2512
  });
2509
- return Object.keys(r).forEach((a) => {
2510
- const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
2513
+ return Object.keys(n).forEach((a) => {
2514
+ const l = n[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
2511
2515
  values: l.map((_) => _.value),
2512
2516
  operator: o
2513
2517
  });
@@ -2569,8 +2573,8 @@ function de(i, t) {
2569
2573
  return !1;
2570
2574
  if (i.length === 1)
2571
2575
  return !0;
2572
- for (let r = 0; r < i.length - 1; r++) {
2573
- const a = W(i[r], s), o = W(i[r + 1], s).diff(a, t);
2576
+ for (let n = 0; n < i.length - 1; n++) {
2577
+ const a = W(i[n], s), o = W(i[n + 1], s).diff(a, t);
2574
2578
  Math.abs(o) === 1 ? e = !0 : e = !1;
2575
2579
  }
2576
2580
  return e;
@@ -2581,7 +2585,7 @@ function he({
2581
2585
  }) {
2582
2586
  const e = {};
2583
2587
  return i.forEach((s) => {
2584
- const r = s.x, a = s.type, l = s.stacked, o = t === "all" ? `${r}-${a}-${l}` : `${a}-${l}`;
2588
+ const n = s.x, a = s.type, l = s.stacked, o = t === "all" ? `${n}-${a}-${l}` : `${a}-${l}`;
2585
2589
  e[o] || (e[o] = []), e[o].push(s);
2586
2590
  }), e;
2587
2591
  }
@@ -2614,14 +2618,14 @@ const wt = {
2614
2618
  fields: e,
2615
2619
  options: s
2616
2620
  }) => {
2617
- const r = B({
2621
+ const n = B({
2618
2622
  fieldName: i.x.name,
2619
2623
  values: t,
2620
2624
  fields: e
2621
2625
  }), a = [];
2622
2626
  i.y.forEach((c) => {
2623
- Object.keys(r).forEach((m) => {
2624
- const p = r[m].label, y = r[m].entries;
2627
+ Object.keys(n).forEach((b) => {
2628
+ const p = n[b].label, y = n[b].entries;
2625
2629
  if (c.label) {
2626
2630
  const v = B({
2627
2631
  fieldName: c.label,
@@ -2668,7 +2672,7 @@ const wt = {
2668
2672
  });
2669
2673
  });
2670
2674
  const l = i.y.some((c) => c.label !== void 0), o = i.y.some((c) => c.stacked !== void 0);
2671
- let _ = [...a.sort((c, m) => c.x < m.x ? -1 : c.x > m.x ? 1 : 0)];
2675
+ let _ = [...a.sort((c, b) => c.x < b.x ? -1 : c.x > b.x ? 1 : 0)];
2672
2676
  o && i.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
2673
2677
  let h = [..._];
2674
2678
  i.type === "pie" && h.some((c) => c.x === !1) ? h = h.map((c) => c.x === !1 ? { ...c, x: (s == null ? void 0 : s.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (h = h.filter(
@@ -2679,7 +2683,7 @@ const wt = {
2679
2683
  values: d,
2680
2684
  timerange: i.timerange,
2681
2685
  interval: i.interval
2682
- }) : i.type == "pie" && (d = h.sort((c, m) => m.value - c.value));
2686
+ }) : i.type == "pie" && (d = h.sort((c, b) => b.value - c.value));
2683
2687
  const g = {
2684
2688
  data: d,
2685
2689
  isGroup: o || l,
@@ -2688,8 +2692,8 @@ const wt = {
2688
2692
  if (i.type === "line" && i.y_range && (g.yAxisOpts = {
2689
2693
  mode: i.y_range
2690
2694
  }, i.y_range === "auto")) {
2691
- const { min: c, max: m } = fe(d);
2692
- g.yAxisOpts.valueOpts = { min: c, max: m };
2695
+ const { min: c, max: b } = fe(d);
2696
+ g.yAxisOpts.valueOpts = { min: c, max: b };
2693
2697
  }
2694
2698
  return g;
2695
2699
  };
@@ -2702,7 +2706,7 @@ function N({
2702
2706
  fieldName: t,
2703
2707
  values: s,
2704
2708
  fields: e
2705
- })).map(({ value: s, label: r }) => r);
2709
+ })).map(({ value: s, label: n }) => n);
2706
2710
  }
2707
2711
  function Y({
2708
2712
  operator: i,
@@ -2730,7 +2734,7 @@ function Y({
2730
2734
  })
2731
2735
  );
2732
2736
  case "avg": {
2733
- const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
2737
+ const s = t.reduce((n, a) => n + a, 0) / t.length || 0;
2734
2738
  return S(s);
2735
2739
  }
2736
2740
  case "min":
@@ -2748,13 +2752,13 @@ function B({
2748
2752
  values: e
2749
2753
  }) {
2750
2754
  const s = {};
2751
- return e.forEach((r) => {
2755
+ return e.forEach((n) => {
2752
2756
  const { value: a, label: l } = q({
2753
2757
  fields: t,
2754
- values: r,
2758
+ values: n,
2755
2759
  fieldName: i
2756
2760
  });
2757
- s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
2761
+ s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(n);
2758
2762
  }), s;
2759
2763
  }
2760
2764
  function Ft(i) {
@@ -2774,10 +2778,10 @@ function _e({
2774
2778
  function fe(i, t = 0.1) {
2775
2779
  if (i.length === 0)
2776
2780
  throw new Error("The values array cannot be empty.");
2777
- const e = i.map((l) => l.value), s = Math.min(...e), r = Math.max(...e), a = (r - s) * t;
2781
+ const e = i.map((l) => l.value), s = Math.min(...e), n = Math.max(...e), a = (n - s) * t;
2778
2782
  return {
2779
2783
  min: s - a,
2780
- max: r + a
2784
+ max: n + a
2781
2785
  };
2782
2786
  }
2783
2787
  const jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -2800,7 +2804,7 @@ export {
2800
2804
  Te as ButtonGroup,
2801
2805
  Ze as Carousel,
2802
2806
  A as Char,
2803
- ne as CodeEditor,
2807
+ re as CodeEditor,
2804
2808
  et as ColorPicker,
2805
2809
  Ue as Comments,
2806
2810
  V as Container,
@@ -2854,7 +2858,7 @@ export {
2854
2858
  C as Widget,
2855
2859
  Dt as graphFieldUtils,
2856
2860
  jt as graphProcessor,
2857
- re as parseContext,
2861
+ ne as parseContext,
2858
2862
  Tt as parseContextFields,
2859
2863
  zt as parseDomainFields,
2860
2864
  Yt as parseGraph,