@gisce/ooui 2.43.0-alpha.1 → 2.43.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"SearchFilter.d.ts","sourceRoot":"","sources":["../src/SearchFilter.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,eAAO,MAAM,gBAAgB,EAAE,GAY9B,CAAC;AAEF,cAAM,YAAY;IAChB;;OAEG;IACH,aAAa,EAAE,GAAG,CAAC;IACnB,IAAI,YAAY,QAEf;IAED;;OAEG;IACH,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,MAAM,QAET;IAED,sBAAsB,EAAE,SAAS,CAAC;IAClC,IAAI,qBAAqB,IAAI,SAAS,CAErC;IAED,wBAAwB,EAAE,SAAS,CAAC;IACpC,IAAI,uBAAuB,IAAI,SAAS,CAEvC;gBAEW,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAU;IAOrE,KAAK;IAqBL,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,aAAa;IAgBhE;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAGpC;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SearchFilter.d.ts","sourceRoot":"","sources":["../src/SearchFilter.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,eAAO,MAAM,gBAAgB,EAAE,GAY9B,CAAC;AAEF,cAAM,YAAY;IAChB;;OAEG;IACH,aAAa,EAAE,GAAG,CAAC;IACnB,IAAI,YAAY,QAEf;IAED;;OAEG;IACH,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,MAAM,QAET;IAED,sBAAsB,EAAE,SAAS,CAAC;IAClC,IAAI,qBAAqB,IAAI,SAAS,CAErC;IAED,wBAAwB,EAAE,SAAS,CAAC;IACpC,IAAI,uBAAuB,IAAI,SAAS,CAEvC;gBAEW,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAU;IAOrE,KAAK;IAqBL,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,aAAa;IAmBhE;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAGpC;AAED,eAAe,YAAY,CAAC"}
package/dist/ooui.es.js CHANGED
@@ -10,34 +10,34 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
10
10
  values: e,
11
11
  fields: t
12
12
  }) => {
13
- let [i, r, l] = s, o = e[i];
14
- const a = U({
13
+ let [i, r, a] = s, o = e[i];
14
+ const l = U({
15
15
  fieldName: i,
16
16
  valueInObject: o,
17
- expectedValue: l,
17
+ expectedValue: a,
18
18
  fields: t
19
19
  });
20
- if (a.directOutcome !== void 0)
21
- return a.directOutcome;
22
- switch (a.modifiedValueInObject !== null && (o = a.modifiedValueInObject), a.modifiedExpectedValue !== null && (l = a.modifiedExpectedValue), r.toLowerCase()) {
20
+ if (l.directOutcome !== void 0)
21
+ return l.directOutcome;
22
+ switch (l.modifiedValueInObject !== null && (o = l.modifiedValueInObject), l.modifiedExpectedValue !== null && (a = l.modifiedExpectedValue), r.toLowerCase()) {
23
23
  case "=":
24
24
  case "==":
25
- return o == l;
25
+ return o == a;
26
26
  case "<>":
27
27
  case "!=":
28
- return o != l;
28
+ return o != a;
29
29
  case ">":
30
- return o > l;
30
+ return o > a;
31
31
  case ">=":
32
- return o >= l;
32
+ return o >= a;
33
33
  case "<":
34
- return o < l;
34
+ return o < a;
35
35
  case "<=":
36
- return o <= l;
36
+ return o <= a;
37
37
  case "in":
38
- return l.includes(o);
38
+ return a.includes(o);
39
39
  case "not in":
40
- return !l.includes(o);
40
+ return !a.includes(o);
41
41
  default:
42
42
  return !1;
43
43
  }
@@ -91,13 +91,13 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
91
91
  widgetType: i
92
92
  }) => {
93
93
  try {
94
- const r = g(s), l = JSON.parse(
94
+ const r = g(s), a = JSON.parse(
95
95
  r.replace(/'/g, '"')
96
96
  ), o = {};
97
- for (const a of Object.keys(l)) {
97
+ for (const l of Object.keys(a)) {
98
98
  const c = vt({
99
99
  object: e,
100
- condition: l[a],
100
+ condition: a[l],
101
101
  evaluateFieldComparison: ({
102
102
  fieldName: _,
103
103
  valueInObject: u,
@@ -109,7 +109,7 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
109
109
  fields: t
110
110
  })
111
111
  });
112
- c ? o[a] = !0 : a === "readonly" && !c && i === "button" && (o[a] = !1);
112
+ c ? o[l] = !0 : l === "readonly" && !c && i === "button" && (o[l] = !1);
113
113
  }
114
114
  return o;
115
115
  } catch (r) {
@@ -124,10 +124,10 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
124
124
  widgetType: i,
125
125
  fallbackMode: r = !0
126
126
  }) => {
127
- let l = {};
127
+ let a = {};
128
128
  if (s.json_attrs)
129
129
  try {
130
- l = Pt({
130
+ a = Pt({
131
131
  attrs: s.json_attrs,
132
132
  values: e,
133
133
  fields: t,
@@ -135,7 +135,7 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
135
135
  });
136
136
  } catch (o) {
137
137
  if (r && s.attrs)
138
- l = Q({
138
+ a = Q({
139
139
  attrs: s.attrs,
140
140
  values: e,
141
141
  fields: t,
@@ -145,7 +145,7 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
145
145
  throw o;
146
146
  }
147
147
  else
148
- s.attrs && (l = Q({
148
+ s.attrs && (a = Q({
149
149
  attrs: s.attrs,
150
150
  values: e,
151
151
  fields: t,
@@ -153,7 +153,7 @@ const Ct = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), kt
153
153
  }));
154
154
  return {
155
155
  ...s,
156
- ...l,
156
+ ...a,
157
157
  attrs: void 0,
158
158
  json_attrs: void 0
159
159
  };
@@ -553,7 +553,7 @@ class z {
553
553
  } else
554
554
  i.push(e);
555
555
  i.reduce(
556
- (o, a) => o + a.colspan,
556
+ (o, l) => o + l.colspan,
557
557
  0
558
558
  ) > this.freePosition() && (this._rows.push([]), this._index++), this._rows[this._index] = this._rows[this._index].concat(i);
559
559
  }
@@ -565,8 +565,8 @@ class z {
565
565
  var i;
566
566
  let t = null;
567
567
  return (i = this._rows) != null && i.length && this._rows.forEach((r) => {
568
- t || r != null && r.length && r.forEach((l) => {
569
- t || l && (t = l.findById(e));
568
+ t || r != null && r.length && r.forEach((a) => {
569
+ t || a && (t = a.findById(e));
570
570
  });
571
571
  }), t;
572
572
  }
@@ -1858,18 +1858,18 @@ const le = ({
1858
1858
  const i = (o = t[s]) == null ? void 0 : o.states;
1859
1859
  if (!i)
1860
1860
  return {};
1861
- const r = {}, l = {};
1862
- for (const a of Object.keys(i))
1863
- if (e.state === a) {
1864
- const c = i[a];
1861
+ const r = {}, a = {};
1862
+ for (const l of Object.keys(i))
1863
+ if (e.state === l) {
1864
+ const c = i[l];
1865
1865
  for (const _ of c) {
1866
1866
  const [u, h] = _;
1867
- l[u] || (l[u] = []), l[u].push(h);
1867
+ a[u] || (a[u] = []), a[u].push(h);
1868
1868
  }
1869
1869
  }
1870
- for (const a of Object.keys(l)) {
1871
- const c = l[a];
1872
- r[a] = c.some((_) => _);
1870
+ for (const l of Object.keys(a)) {
1871
+ const c = a[l];
1872
+ r[l] = c.some((_) => _);
1873
1873
  }
1874
1874
  return r;
1875
1875
  }, lt = ({
@@ -1888,7 +1888,7 @@ function oe({
1888
1888
  }) {
1889
1889
  var r;
1890
1890
  const i = ((r = t[e]) == null ? void 0 : r.type) || "passthrough";
1891
- return i === "many2one" ? s[e] ? s[e][0] || null : !1 : i === "one2many" || i === "many2many" ? s[e].map((l) => l.id) : s != null && s[e] ? s == null ? void 0 : s[e] : e.includes("'") ? e : parseInt(e);
1891
+ return i === "many2one" ? s[e] ? s[e][0] || null : !1 : i === "one2many" || i === "many2many" ? s[e].map((a) => a.id) : s != null && s[e] ? s == null ? void 0 : s[e] : e.includes("'") ? e : parseInt(e);
1892
1892
  }
1893
1893
  const J = ({
1894
1894
  context: s,
@@ -1945,7 +1945,7 @@ function ct(s) {
1945
1945
  return typeof s == "object" && s !== null && typeof s != "string";
1946
1946
  }
1947
1947
  const dt = (s) => {
1948
- const e = s.trim().replace(")", "").split("("), t = e[0], i = e[1], r = i ? i.split(",").map((l) => l.trim()).filter((l) => l.length > 0) : [];
1948
+ const e = s.trim().replace(")", "").split("("), t = e[0], i = e[1], r = i ? i.split(",").map((a) => a.trim()).filter((a) => a.length > 0) : [];
1949
1949
  return {
1950
1950
  method: t,
1951
1951
  args: r
@@ -1955,8 +1955,8 @@ function ce(s) {
1955
1955
  const e = [];
1956
1956
  function t(i) {
1957
1957
  const r = [];
1958
- for (const l of i)
1959
- l instanceof F ? t(l._container.rows.flat()) : r.push(l);
1958
+ for (const a of i)
1959
+ a instanceof F ? t(a._container.rows.flat()) : r.push(a);
1960
1960
  r.length > 0 && e.push(r);
1961
1961
  }
1962
1962
  for (const i of s)
@@ -2072,10 +2072,10 @@ class Ee {
2072
2072
  this._contextForFields = e;
2073
2073
  }
2074
2074
  parse(e, t) {
2075
- var a;
2076
- const { values: i = {}, readOnly: r = !1 } = t || {}, l = I.parse(e).filter((c) => c.tagName === "form")[0];
2077
- this._string = ((a = l.attributes) == null ? void 0 : a.string) || null, this._string && (this._string = g(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
2078
- fields: l.children,
2075
+ var l;
2076
+ const { values: i = {}, readOnly: r = !1 } = t || {}, a = I.parse(e).filter((c) => c.tagName === "form")[0];
2077
+ this._string = ((l = a.attributes) == null ? void 0 : l.string) || null, this._string && (this._string = g(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
2078
+ fields: a.children,
2079
2079
  container: this._container,
2080
2080
  values: i
2081
2081
  });
@@ -2091,12 +2091,12 @@ class Ee {
2091
2091
  values: i
2092
2092
  }) {
2093
2093
  const r = new E();
2094
- e.filter((l) => typeof l == "object").forEach((l) => {
2094
+ e.filter((a) => typeof a == "object").forEach((a) => {
2095
2095
  var v, C;
2096
- const { tagName: o, attributes: a, children: c } = l;
2097
- let _ = o, u = a;
2096
+ const { tagName: o, attributes: l, children: c } = a;
2097
+ let _ = o, u = l;
2098
2098
  if (o === "field") {
2099
- const { name: w, widget: V } = a;
2099
+ const { name: w, widget: V } = l;
2100
2100
  if (V)
2101
2101
  _ = V;
2102
2102
  else if (w) {
@@ -2104,14 +2104,14 @@ class Ee {
2104
2104
  throw new Error(
2105
2105
  `Field ${w} doesn't exist in fields defintion`
2106
2106
  );
2107
- _ = this._fields[w].type, a.widget_props = {
2108
- ...Z(a.widget_props),
2107
+ _ = this._fields[w].type, l.widget_props = {
2108
+ ...Z(l.widget_props),
2109
2109
  ...this._fields[w].widget_props || {}
2110
2110
  };
2111
2111
  }
2112
2112
  u = {
2113
2113
  ...this._fields[w],
2114
- ...a,
2114
+ ...l,
2115
2115
  fieldsWidgetType: this._fields[w].type
2116
2116
  };
2117
2117
  }
@@ -2243,16 +2243,16 @@ class Ve {
2243
2243
  this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors)), this._status = t.attributes.status || null, this._status && (this._status = g(this._status)), this._editable = t.attributes.editable || null, this._infinite = t.attributes.infinite || !1;
2244
2244
  const i = new E();
2245
2245
  t.children.forEach((r) => {
2246
- const { tagName: l, attributes: o } = r;
2247
- let a = null;
2248
- if (l === "field") {
2246
+ const { tagName: a, attributes: o } = r;
2247
+ let l = null;
2248
+ if (a === "field") {
2249
2249
  const { name: c, widget: _ } = o;
2250
2250
  let u = o;
2251
2251
  if (c) {
2252
2252
  if (!this._fields[c])
2253
2253
  throw new Error(`Field ${c} doesn't exist in fields defintion`);
2254
2254
  const h = this._fields[c];
2255
- a = h.type, (Array.isArray(h == null ? void 0 : h.domain) && (h == null ? void 0 : h.domain.length) === 0 || (h == null ? void 0 : h.domain) === !1) && o.domain && o.domain.length > 0 && delete h.domain;
2255
+ l = h.type, (Array.isArray(h == null ? void 0 : h.domain) && (h == null ? void 0 : h.domain.length) === 0 || (h == null ? void 0 : h.domain) === !1) && o.domain && o.domain.length > 0 && delete h.domain;
2256
2256
  const m = J({
2257
2257
  context: o.context || h.context,
2258
2258
  values: {},
@@ -2265,8 +2265,8 @@ class Ve {
2265
2265
  context: m
2266
2266
  }, this._contextForFields[c] = m;
2267
2267
  }
2268
- if (_ && (a = _), !u.invisible) {
2269
- const h = i.createWidget(a, u);
2268
+ if (_ && (l = _), !u.invisible) {
2269
+ const h = i.createWidget(l, u);
2270
2270
  this._columns.push(h);
2271
2271
  }
2272
2272
  p(u.autorefresh) && this._autorefreshableFields.push(c);
@@ -2396,30 +2396,30 @@ class Ye {
2396
2396
  this._string = t.attributes.string || null, this._string && (this._string = g(this._string)), this._column_field = t.attributes.column_field || "state", this._column_domain = t.attributes.column_domain || null, this._drag = t.attributes.drag !== void 0 ? p(t.attributes.drag) : !0, this._sort = t.attributes.sort || void 0, this._set_max_cards = t.attributes.set_max_cards !== void 0 ? p(t.attributes.set_max_cards) : !1, this._colors = t.attributes.colors || null, this._colors && (this._colors = g(this._colors)), this._status = t.attributes.status || null, this._status && (this._status = g(this._status)), t.attributes.on_change_column && (this._on_change_column = dt(t.attributes.on_change_column));
2397
2397
  const i = new E();
2398
2398
  t.children.forEach((r) => {
2399
- const { tagName: l, attributes: o } = r;
2400
- l === "field" ? this._parseField(r, o, i) : l === "button" && this._parseButton(r, o);
2399
+ const { tagName: a, attributes: o } = r;
2400
+ a === "field" ? this._parseField(r, o, i) : a === "button" && this._parseButton(r, o);
2401
2401
  });
2402
2402
  }
2403
2403
  _parseField(e, t, i) {
2404
- const { name: r, widget: l, sum: o } = t;
2404
+ const { name: r, widget: a, sum: o } = t;
2405
2405
  if (!r)
2406
2406
  return;
2407
2407
  if (!this._fields[r])
2408
2408
  throw new Error(`Field ${r} doesn't exist in fields definition`);
2409
- const a = this._fields[r];
2410
- let c = a.type;
2411
- (Array.isArray(a == null ? void 0 : a.domain) && (a == null ? void 0 : a.domain.length) === 0 || (a == null ? void 0 : a.domain) === !1) && t.domain && t.domain.length > 0 && delete a.domain;
2409
+ const l = this._fields[r];
2410
+ let c = l.type;
2411
+ (Array.isArray(l == null ? void 0 : l.domain) && (l == null ? void 0 : l.domain.length) === 0 || (l == null ? void 0 : l.domain) === !1) && t.domain && t.domain.length > 0 && delete l.domain;
2412
2412
  const _ = J({
2413
- context: t.context || a.context,
2413
+ context: t.context || l.context,
2414
2414
  values: {},
2415
2415
  fields: this._fields
2416
2416
  }), u = {
2417
- ...a,
2417
+ ...l,
2418
2418
  ...t,
2419
- fieldsWidgetType: a == null ? void 0 : a.type,
2419
+ fieldsWidgetType: l == null ? void 0 : l.type,
2420
2420
  context: _
2421
2421
  };
2422
- if (this._contextForFields[r] = _, l && (c = l), !u.invisible) {
2422
+ if (this._contextForFields[r] = _, a && (c = a), !u.invisible) {
2423
2423
  const h = i.createWidget(
2424
2424
  c,
2425
2425
  u
@@ -2428,15 +2428,15 @@ class Ye {
2428
2428
  }
2429
2429
  }
2430
2430
  _parseButton(e, t) {
2431
- const { name: i, type: r, string: l, states: o } = t;
2431
+ const { name: i, type: r, string: a, states: o } = t;
2432
2432
  if (!i)
2433
2433
  return;
2434
- const a = {
2434
+ const l = {
2435
2435
  ...t,
2436
2436
  name: i,
2437
2437
  buttonType: r || "object",
2438
- string: l || ""
2439
- }, c = new A(a);
2438
+ string: a || ""
2439
+ }, c = new A(l);
2440
2440
  o && (c.states = o), this._buttons.push(c);
2441
2441
  }
2442
2442
  /**
@@ -2457,30 +2457,30 @@ class De {
2457
2457
  return this._kanbanDef;
2458
2458
  }
2459
2459
  parse(e, t) {
2460
- const i = (t == null ? void 0 : t.readOnly) ?? !1, r = new z(1, 12, i), l = new E();
2460
+ const i = (t == null ? void 0 : t.readOnly) ?? !1, r = new z(1, 12, i), a = new E();
2461
2461
  let o = 0;
2462
- return this._kanbanDef.card_fields.forEach((a) => {
2462
+ return this._kanbanDef.card_fields.forEach((l) => {
2463
2463
  o++;
2464
2464
  const c = tt({
2465
- tagAttributes: a.raw_props || {},
2465
+ tagAttributes: l.raw_props || {},
2466
2466
  values: e,
2467
2467
  fields: this._kanbanDef.fields,
2468
- widgetType: a.type || "field"
2468
+ widgetType: l.type || "field"
2469
2469
  }), _ = {
2470
- ...a.raw_props || {},
2470
+ ...l.raw_props || {},
2471
2471
  ...c,
2472
2472
  key: `field_${o}`
2473
2473
  };
2474
2474
  i && (_.readonly = !0);
2475
- const u = a.type || "field", h = l.createWidget(u, _);
2476
- r.addWidget(h, { addLabel: !a.nolabel });
2477
- }), this._kanbanDef.buttons.forEach((a) => {
2475
+ const u = l.type || "field", h = a.createWidget(u, _);
2476
+ r.addWidget(h, { addLabel: !l.nolabel });
2477
+ }), this._kanbanDef.buttons.forEach((l) => {
2478
2478
  o++;
2479
- const c = a.states ? lt({
2480
- states: a.states,
2479
+ const c = l.states ? lt({
2480
+ states: l.states,
2481
2481
  values: e
2482
2482
  }) : {}, _ = {
2483
- ...a.raw_props || {},
2483
+ ...l.raw_props || {},
2484
2484
  ...c,
2485
2485
  key: `button_${o}`
2486
2486
  };
@@ -2549,9 +2549,11 @@ class je {
2549
2549
  ...this.fields[i],
2550
2550
  name: i,
2551
2551
  colspan: 2
2552
- }, { type: l, widget: o } = r;
2553
- let a = o ?? l;
2554
- return de[a] === void 0 && (a = l), t.createWidget(a, r);
2552
+ }, { type: a, widget: o } = r;
2553
+ let l = o ?? a;
2554
+ return de[l] === void 0 && (console.error(
2555
+ `[SearchFilter] Field "${i}" has unsupported type "${a}"`
2556
+ ), l = a), t.createWidget(l, r);
2555
2557
  });
2556
2558
  }
2557
2559
  /**
@@ -2570,12 +2572,12 @@ const Ne = ({
2570
2572
  return s.forEach((i) => {
2571
2573
  if (!Array.isArray(i))
2572
2574
  return;
2573
- const [r, l, o] = i;
2574
- let a, c;
2575
- r.indexOf(".") !== -1 ? (a = r.substr(0, r.indexOf(".")), c = r.substr(
2575
+ const [r, a, o] = i;
2576
+ let l, c;
2577
+ r.indexOf(".") !== -1 ? (l = r.substr(0, r.indexOf(".")), c = r.substr(
2576
2578
  r.indexOf(".") + 1,
2577
2579
  r.length - 1
2578
- )) : (a = r, c = "id"), a === e && t.push([c, l, o]);
2580
+ )) : (l = r, c = "id"), l === e && t.push([c, a, o]);
2579
2581
  }), t;
2580
2582
  }, Ae = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((e) => e.trim()).filter((e) => !e.includes("'"));
2581
2583
  class ue {
@@ -2677,10 +2679,10 @@ class he extends ht {
2677
2679
  n(this, "_field");
2678
2680
  n(this, "_operator");
2679
2681
  const { children: r } = i;
2680
- r.forEach((l) => {
2681
- if (l.tagName === "field") {
2682
- const o = l.attributes.name, a = l.attributes.operator;
2683
- this._field = o || void 0, this._operator = a;
2682
+ r.forEach((a) => {
2683
+ if (a.tagName === "field") {
2684
+ const o = a.attributes.name, l = a.attributes.operator;
2685
+ this._field = o || void 0, this._operator = l;
2684
2686
  }
2685
2687
  });
2686
2688
  }
@@ -2696,7 +2698,7 @@ const _e = (s) => {
2696
2698
  let t;
2697
2699
  if (s.forEach((i) => {
2698
2700
  if (i.tagName === "field") {
2699
- const r = i.attributes.axis, l = i.attributes.operator, o = i.attributes.name, a = i.attributes.label || void 0, c = i.attributes.stacked || void 0;
2701
+ const r = i.attributes.axis, a = i.attributes.operator, o = i.attributes.name, l = i.attributes.label || void 0, c = i.attributes.stacked || void 0;
2700
2702
  if (!r)
2701
2703
  throw new Error(`Field ${o} doesn't have an axis`);
2702
2704
  if (!o)
@@ -2706,8 +2708,8 @@ const _e = (s) => {
2706
2708
  }) : r === "y" && e.push(
2707
2709
  new ge({
2708
2710
  name: o,
2709
- operator: l,
2710
- label: a,
2711
+ operator: a,
2712
+ label: l,
2711
2713
  stacked: c
2712
2714
  })
2713
2715
  );
@@ -2770,13 +2772,13 @@ class ge extends _t {
2770
2772
  name: t,
2771
2773
  operator: i,
2772
2774
  label: r,
2773
- stacked: l
2775
+ stacked: a
2774
2776
  }) {
2775
2777
  super({ name: t, axis: "y" });
2776
2778
  n(this, "_operator");
2777
2779
  n(this, "_label");
2778
2780
  n(this, "_stacked");
2779
- this._operator = i, this._label = r, this._stacked = l;
2781
+ this._operator = i, this._label = r, this._stacked = a;
2780
2782
  }
2781
2783
  get operator() {
2782
2784
  return this._operator;
@@ -2810,7 +2812,7 @@ function H({
2810
2812
  if (i.type === "many2one")
2811
2813
  return r ? { value: r[0], label: r[1] } : { value: !1, label: void 0 };
2812
2814
  if (i.type === "selection") {
2813
- const o = i.selection.find((a) => a[0] === r);
2815
+ const o = i.selection.find((l) => l[0] === r);
2814
2816
  return o ? { value: r, label: o[1] } : { value: !1, label: void 0 };
2815
2817
  }
2816
2818
  return { value: r, label: r };
@@ -2844,15 +2846,15 @@ function xe({
2844
2846
  const r = gt({
2845
2847
  values: s,
2846
2848
  groupBy: "type-stacked"
2847
- }), l = `${e}s`;
2848
- return Object.keys(r).forEach((a) => {
2849
- const c = r[a];
2849
+ }), a = `${e}s`;
2850
+ return Object.keys(r).forEach((l) => {
2851
+ const c = r[l];
2850
2852
  for (let _ = 0; _ < c.length; _++) {
2851
2853
  const u = c[_];
2852
2854
  if (i.push(u), _ === c.length - 1)
2853
2855
  return;
2854
2856
  const h = u.x, m = c[_ + 1].x;
2855
- if (!ft([h, m], l)) {
2857
+ if (!ft([h, m], a)) {
2856
2858
  const d = pe({
2857
2859
  dates: [h, m],
2858
2860
  timerange: e,
@@ -2868,7 +2870,7 @@ function xe({
2868
2870
  );
2869
2871
  }
2870
2872
  }
2871
- }), i.sort((a, c) => a.x < c.x ? -1 : a.x > c.x ? 1 : 0);
2873
+ }), i.sort((l, c) => l.x < c.x ? -1 : l.x > c.x ? 1 : 0);
2872
2874
  }
2873
2875
  function pe({
2874
2876
  dates: s,
@@ -2878,11 +2880,11 @@ function pe({
2878
2880
  const i = [], r = `${e}s`;
2879
2881
  if (s.length === 1)
2880
2882
  return s;
2881
- const l = s.sort((o, a) => o < a ? -1 : o > a ? 1 : 0);
2882
- for (let o = 0; o < l.length - 1; o++) {
2883
- const a = l[o], c = l[o + 1];
2884
- if (!ft([a, c], r)) {
2885
- const _ = T(a, D(r)).add(
2883
+ const a = s.sort((o, l) => o < l ? -1 : o > l ? 1 : 0);
2884
+ for (let o = 0; o < a.length - 1; o++) {
2885
+ const l = a[o], c = a[o + 1];
2886
+ if (!ft([l, c], r)) {
2887
+ const _ = T(l, D(r)).add(
2886
2888
  t,
2887
2889
  r
2888
2890
  ), u = T(c, D(r));
@@ -2903,10 +2905,10 @@ function we({
2903
2905
  values: t,
2904
2906
  groupBy: "all"
2905
2907
  });
2906
- return Object.keys(r).forEach((l) => {
2907
- const o = r[l], a = o[0].operator === "count" ? "+" : o[0].operator, c = j({
2908
+ return Object.keys(r).forEach((a) => {
2909
+ const o = r[a], l = o[0].operator === "count" ? "+" : o[0].operator, c = j({
2908
2910
  values: o.map((_) => _.value),
2909
- operator: a
2911
+ operator: l
2910
2912
  });
2911
2913
  i.push({
2912
2914
  ...o[0],
@@ -2967,8 +2969,8 @@ function ft(s, e) {
2967
2969
  if (s.length === 1)
2968
2970
  return !0;
2969
2971
  for (let r = 0; r < s.length - 1; r++) {
2970
- const l = T(s[r], i), a = T(s[r + 1], i).diff(l, e);
2971
- Math.abs(a) === 1 ? t = !0 : t = !1;
2972
+ const a = T(s[r], i), l = T(s[r + 1], i).diff(a, e);
2973
+ Math.abs(l) === 1 ? t = !0 : t = !1;
2972
2974
  }
2973
2975
  return t;
2974
2976
  }
@@ -2978,8 +2980,8 @@ function gt({
2978
2980
  }) {
2979
2981
  const t = {};
2980
2982
  return s.forEach((i) => {
2981
- const r = i.x, l = i.type, o = i.stacked, a = e === "all" ? `${r}-${l}-${o}` : `${l}-${o}`;
2982
- t[a] || (t[a] = []), t[a].push(i);
2983
+ const r = i.x, a = i.type, o = i.stacked, l = e === "all" ? `${r}-${a}-${o}` : `${a}-${o}`;
2984
+ t[l] || (t[l] = []), t[l].push(i);
2983
2985
  }), t;
2984
2986
  }
2985
2987
  function D(s) {
@@ -3015,7 +3017,7 @@ const ke = {
3015
3017
  fieldName: s.x.name,
3016
3018
  values: e,
3017
3019
  fields: t
3018
- }), l = [];
3020
+ }), a = [];
3019
3021
  s.y.forEach((d) => {
3020
3022
  Object.keys(r).forEach((b) => {
3021
3023
  const x = r[b].label, y = r[b].entries;
@@ -3034,7 +3036,7 @@ const ke = {
3034
3036
  values: yt,
3035
3037
  operator: d.operator
3036
3038
  });
3037
- l.push({
3039
+ a.push({
3038
3040
  x: x || !1,
3039
3041
  value: xt,
3040
3042
  type: V,
@@ -3051,7 +3053,7 @@ const ke = {
3051
3053
  values: v,
3052
3054
  operator: d.operator
3053
3055
  });
3054
- l.push({
3056
+ a.push({
3055
3057
  x: x || !1,
3056
3058
  value: C,
3057
3059
  type: mt({
@@ -3064,9 +3066,9 @@ const ke = {
3064
3066
  }
3065
3067
  });
3066
3068
  });
3067
- const o = s.y.some((d) => d.label !== void 0), a = s.y.some((d) => d.stacked !== void 0);
3068
- let _ = [...l.sort((d, b) => d.x < b.x ? -1 : d.x > b.x ? 1 : 0)];
3069
- a && s.y.filter((d) => d.stacked !== void 0).length > 1 && (_ = _.map((d) => ({ ...d, type: `${d.type} - ${d.stacked}` })));
3069
+ const o = s.y.some((d) => d.label !== void 0), l = s.y.some((d) => d.stacked !== void 0);
3070
+ let _ = [...a.sort((d, b) => d.x < b.x ? -1 : d.x > b.x ? 1 : 0)];
3071
+ l && s.y.filter((d) => d.stacked !== void 0).length > 1 && (_ = _.map((d) => ({ ...d, type: `${d.type} - ${d.stacked}` })));
3070
3072
  let u = [..._];
3071
3073
  s.type === "pie" && u.some((d) => d.x === !1) ? u = u.map((d) => d.x === !1 ? { ...d, x: (i == null ? void 0 : i.uninformedString) || "Not informed" } : d) : _.some((d) => d.x === !1) && (u = u.filter(
3072
3074
  (d) => d.x !== !1
@@ -3079,8 +3081,8 @@ const ke = {
3079
3081
  }) : s.type == "pie" && (h = u.sort((d, b) => b.value - d.value));
3080
3082
  const m = {
3081
3083
  data: h,
3082
- isGroup: a || o,
3083
- isStack: a
3084
+ isGroup: l || o,
3085
+ isStack: l
3084
3086
  };
3085
3087
  if (s.type === "line" && s.y_range && (m.yAxisOpts = {
3086
3088
  mode: s.y_range
@@ -3127,7 +3129,7 @@ function j({
3127
3129
  })
3128
3130
  );
3129
3131
  case "avg": {
3130
- const i = e.reduce((r, l) => r + l, 0) / e.length || 0;
3132
+ const i = e.reduce((r, a) => r + a, 0) / e.length || 0;
3131
3133
  return Y(i);
3132
3134
  }
3133
3135
  case "min":
@@ -3146,12 +3148,12 @@ function G({
3146
3148
  }) {
3147
3149
  const i = {};
3148
3150
  return t.forEach((r) => {
3149
- const { value: l, label: o } = H({
3151
+ const { value: a, label: o } = H({
3150
3152
  fields: e,
3151
3153
  values: r,
3152
3154
  fieldName: s
3153
3155
  });
3154
- i[l] || (i[l] = { label: o, entries: [] }), i[l].entries.push(r);
3156
+ i[a] || (i[a] = { label: o, entries: [] }), i[a].entries.push(r);
3155
3157
  }), i;
3156
3158
  }
3157
3159
  function Oe(s) {
@@ -3171,10 +3173,10 @@ function mt({
3171
3173
  function bt(s, e = 0.1) {
3172
3174
  if (s.length === 0)
3173
3175
  throw new Error("The values array cannot be empty.");
3174
- const t = s.map((o) => o.value), i = Math.min(...t), r = Math.max(...t), l = (r - i) * e;
3176
+ const t = s.map((o) => o.value), i = Math.min(...t), r = Math.max(...t), a = (r - i) * e;
3175
3177
  return {
3176
- min: i - l,
3177
- max: r + l
3178
+ min: i - a,
3179
+ max: r + a
3178
3180
  };
3179
3181
  }
3180
3182
  const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({