@gisce/ooui 2.32.0 → 2.32.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.
@@ -15,9 +15,9 @@ declare class Many2one extends Field {
15
15
  _relation: string;
16
16
  get relation(): string;
17
17
  set relation(value: string);
18
- get showFolder(): boolean;
19
- get showSearch(): boolean;
20
- get showMenu(): boolean;
18
+ get showFolder(): boolean | undefined;
19
+ get showSearch(): boolean | undefined;
20
+ get showMenu(): boolean | undefined;
21
21
  constructor(props: any);
22
22
  }
23
23
  export default Many2one;
@@ -1 +1 @@
1
- {"version":3,"file":"Many2one.d.ts","sourceRoot":"","sources":["../src/Many2one.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,QAAS,SAAQ,KAAK;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAO;IACpB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,SAAS,EAAE,MAAM,CAAM;IACvB,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;gBAEW,KAAK,EAAE,GAAG;CAavB;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Many2one.d.ts","sourceRoot":"","sources":["../src/Many2one.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,QAAS,SAAQ,KAAK;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAO;IACpB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,SAAS,EAAE,MAAM,CAAM;IACvB,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED,IAAI,UAAU,IAAI,OAAO,GAAG,SAAS,CAEpC;IAED,IAAI,UAAU,IAAI,OAAO,GAAG,SAAS,CAEpC;IAED,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAElC;gBAEW,KAAK,EAAE,GAAG;CAavB;AAED,eAAe,QAAQ,CAAC"}
package/dist/ooui.es.js CHANGED
@@ -67,12 +67,12 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
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"), _ = m(u), h = JSON.parse(_), d = {};
70
+ const d = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = m(d), h = JSON.parse(_), u = {};
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
- p ? d[g] = !0 : g === "readonly" && !p && s === "button" && (d[g] = !1);
73
+ p ? u[g] = !0 : g === "readonly" && !p && s === "button" && (u[g] = !1);
74
74
  }
75
- return d;
75
+ return u;
76
76
  }, U = (i) => {
77
77
  if (i === void 0)
78
78
  return {};
@@ -95,21 +95,21 @@ const we = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ve
95
95
  n.replace(/'/g, '"')
96
96
  ), l = {};
97
97
  for (const o of Object.keys(a)) {
98
- const u = xe({
98
+ const d = xe({
99
99
  object: t,
100
100
  condition: a[o],
101
101
  evaluateFieldComparison: ({
102
102
  fieldName: _,
103
103
  valueInObject: h,
104
- expectedValue: d
104
+ expectedValue: u
105
105
  }) => X({
106
106
  fieldName: _,
107
107
  valueInObject: h,
108
- expectedValue: d,
108
+ expectedValue: u,
109
109
  fields: e
110
110
  })
111
111
  });
112
- u ? l[o] = !0 : o === "readonly" && !u && s === "button" && (l[o] = !1);
112
+ d ? l[o] = !0 : o === "readonly" && !d && s === "button" && (l[o] = !1);
113
113
  }
114
114
  return l;
115
115
  } catch (n) {
@@ -978,13 +978,13 @@ class Te extends f {
978
978
  this._relation = e;
979
979
  }
980
980
  get showFolder() {
981
- return this.parsedWidgetProps.showFolder ?? !0;
981
+ return this.parsedWidgetProps.showFolder;
982
982
  }
983
983
  get showSearch() {
984
- return this.parsedWidgetProps.showSearch ?? !0;
984
+ return this.parsedWidgetProps.showSearch;
985
985
  }
986
986
  get showMenu() {
987
- return this.parsedWidgetProps.showMenu ?? !0;
987
+ return this.parsedWidgetProps.showMenu;
988
988
  }
989
989
  }
990
990
  class ze extends G {
@@ -1711,15 +1711,15 @@ const tt = ({
1711
1711
  const n = {}, a = {};
1712
1712
  for (const o of Object.keys(s))
1713
1713
  if (t.state === o) {
1714
- const u = s[o];
1715
- for (const _ of u) {
1716
- const [h, d] = _;
1717
- a[h] || (a[h] = []), a[h].push(d);
1714
+ const d = s[o];
1715
+ for (const _ of d) {
1716
+ const [h, u] = _;
1717
+ a[h] || (a[h] = []), a[h].push(u);
1718
1718
  }
1719
1719
  }
1720
1720
  for (const o of Object.keys(a)) {
1721
- const u = a[o];
1722
- n[o] = u.some((_) => _);
1721
+ const d = a[o];
1722
+ n[o] = d.some((_) => _);
1723
1723
  }
1724
1724
  return n;
1725
1725
  }, it = ({
@@ -1755,8 +1755,8 @@ const ne = ({
1755
1755
  return s;
1756
1756
  if (i.trim().length === 0)
1757
1757
  return;
1758
- 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 = {};
1759
- return d.forEach((c) => {
1758
+ const u = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((c) => c.split(":")), g = {};
1759
+ return u.forEach((c) => {
1760
1760
  const b = c[1];
1761
1761
  if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
1762
1762
  const p = st({
@@ -1777,8 +1777,8 @@ const ne = ({
1777
1777
  }, Wt = (i) => {
1778
1778
  const t = [];
1779
1779
  try {
1780
- return !i || le(i) || typeof i != "string" ? t : ae(i) !== null ? [] : (i.trim().length === 0 || i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
1781
- !d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
1780
+ return !i || le(i) || typeof i != "string" ? t : ae(i) !== null ? [] : (i.trim().length === 0 || i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((u) => u.split(":")).forEach((u) => {
1781
+ !u[1].includes("'") && u[1] !== "true" && u[1] !== "false" && t.push(u[1].replace(/'/g, ""));
1782
1782
  }), t);
1783
1783
  } catch {
1784
1784
  }
@@ -1923,17 +1923,17 @@ class Tt {
1923
1923
  }
1924
1924
  parse(t, e) {
1925
1925
  var o;
1926
- const { values: s = {}, readOnly: n = !1 } = e || {}, a = D.parse(t).filter((u) => u.tagName === "form")[0];
1926
+ const { values: s = {}, readOnly: n = !1 } = e || {}, a = D.parse(t).filter((d) => d.tagName === "form")[0];
1927
1927
  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({
1928
1928
  fields: a.children,
1929
1929
  container: this._container,
1930
1930
  values: s
1931
1931
  });
1932
1932
  const l = nt(this._container._rows);
1933
- l.forEach((u) => {
1934
- const _ = u;
1935
- _._id && _._context && (this._contextForFields[_._id] = u._context);
1936
- }), this._autorefreshableFields = l.filter((u) => u instanceof f && u.autoRefresh).map((u) => u._id);
1933
+ l.forEach((d) => {
1934
+ const _ = d;
1935
+ _._id && _._context && (this._contextForFields[_._id] = d._context);
1936
+ }), this._autorefreshableFields = l.filter((d) => d instanceof f && d.autoRefresh).map((d) => d._id);
1937
1937
  }
1938
1938
  parseNode({
1939
1939
  fields: t,
@@ -1943,7 +1943,7 @@ class Tt {
1943
1943
  const n = new $();
1944
1944
  t.filter((a) => typeof a == "object").forEach((a) => {
1945
1945
  var v, F;
1946
- const { tagName: l, attributes: o, children: u } = a;
1946
+ const { tagName: l, attributes: o, children: d } = a;
1947
1947
  let _ = l, h = o;
1948
1948
  if (l === "field") {
1949
1949
  const { name: x, widget: I } = o;
@@ -1965,7 +1965,7 @@ class Tt {
1965
1965
  fieldsWidgetType: this._fields[x].type
1966
1966
  };
1967
1967
  }
1968
- const d = Ce({
1968
+ const u = Ce({
1969
1969
  tagAttributes: h,
1970
1970
  values: s,
1971
1971
  fields: this._fields,
@@ -1991,7 +1991,7 @@ class Tt {
1991
1991
  let b;
1992
1992
  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;
1993
1993
  const p = {
1994
- ...d,
1994
+ ...u,
1995
1995
  ...g,
1996
1996
  context: c,
1997
1997
  domain: b,
@@ -2000,7 +2000,7 @@ class Tt {
2000
2000
  e.readOnly && (p.readonly = !0);
2001
2001
  const y = n.createWidget(_, p);
2002
2002
  y.invisible && y instanceof f && this._invisibleFields.push(p.name), y instanceof w && this.parseNode({
2003
- fields: u,
2003
+ fields: d,
2004
2004
  container: y.container,
2005
2005
  values: s
2006
2006
  }), y instanceof ee && y.readOnly !== void 0 || (y.readOnly = y.readOnly || this.readOnly), e.addWidget(y);
@@ -2096,30 +2096,30 @@ class zt {
2096
2096
  const { tagName: a, attributes: l } = n;
2097
2097
  let o = null;
2098
2098
  if (a === "field") {
2099
- const { name: u, widget: _ } = l;
2099
+ const { name: d, widget: _ } = l;
2100
2100
  let h = l;
2101
- if (u) {
2102
- if (!this._fields[u])
2103
- throw new Error(`Field ${u} doesn't exist in fields defintion`);
2104
- const d = this._fields[u];
2105
- 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;
2101
+ if (d) {
2102
+ if (!this._fields[d])
2103
+ throw new Error(`Field ${d} doesn't exist in fields defintion`);
2104
+ const u = this._fields[d];
2105
+ o = u.type, (Array.isArray(u == null ? void 0 : u.domain) && (u == null ? void 0 : u.domain.length) === 0 || (u == null ? void 0 : u.domain) === !1) && l.domain && l.domain.length > 0 && delete u.domain;
2106
2106
  const g = ne({
2107
- context: l.context || d.context,
2107
+ context: l.context || u.context,
2108
2108
  values: {},
2109
2109
  fields: this._fields
2110
2110
  });
2111
2111
  h = {
2112
- ...d,
2112
+ ...u,
2113
2113
  ...l,
2114
- fieldsWidgetType: d == null ? void 0 : d.type,
2114
+ fieldsWidgetType: u == null ? void 0 : u.type,
2115
2115
  context: g
2116
- }, this._contextForFields[u] = g;
2116
+ }, this._contextForFields[d] = g;
2117
2117
  }
2118
2118
  if (_ && (o = _), !h.invisible) {
2119
- const d = s.createWidget(o, h);
2120
- this._columns.push(d);
2119
+ const u = s.createWidget(o, h);
2120
+ this._columns.push(u);
2121
2121
  }
2122
- W(h.autorefresh) && this._autorefreshableFields.push(u);
2122
+ W(h.autorefresh) && this._autorefreshableFields.push(d);
2123
2123
  }
2124
2124
  });
2125
2125
  }
@@ -2212,11 +2212,11 @@ const Et = ({
2212
2212
  if (!Array.isArray(s))
2213
2213
  return;
2214
2214
  const [n, a, l] = s;
2215
- let o, u;
2216
- n.indexOf(".") !== -1 ? (o = n.substr(0, n.indexOf(".")), u = n.substr(
2215
+ let o, d;
2216
+ n.indexOf(".") !== -1 ? (o = n.substr(0, n.indexOf(".")), d = n.substr(
2217
2217
  n.indexOf(".") + 1,
2218
2218
  n.length - 1
2219
- )) : (o = n, u = "id"), o === t && e.push([u, a, l]);
2219
+ )) : (o = n, d = "id"), o === t && e.push([d, a, l]);
2220
2220
  }), e;
2221
2221
  }, St = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
2222
2222
  class lt {
@@ -2329,7 +2329,7 @@ const ct = (i) => {
2329
2329
  let e;
2330
2330
  if (i.forEach((s) => {
2331
2331
  if (s.tagName === "field") {
2332
- 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;
2332
+ const n = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, d = s.attributes.stacked || void 0;
2333
2333
  if (!n)
2334
2334
  throw new Error(`Field ${l} doesn't have an axis`);
2335
2335
  if (!l)
@@ -2337,11 +2337,11 @@ const ct = (i) => {
2337
2337
  n === "x" ? e = new ht({
2338
2338
  name: l
2339
2339
  }) : n === "y" && t.push(
2340
- new dt({
2340
+ new ut({
2341
2341
  name: l,
2342
2342
  operator: a,
2343
2343
  label: o,
2344
- stacked: u
2344
+ stacked: d
2345
2345
  })
2346
2346
  );
2347
2347
  }
@@ -2370,7 +2370,7 @@ class j extends oe {
2370
2370
  return this._y;
2371
2371
  }
2372
2372
  }
2373
- const ut = {
2373
+ const dt = {
2374
2374
  indicator: ce,
2375
2375
  indicatorField: ot,
2376
2376
  line: j,
@@ -2380,12 +2380,12 @@ const ut = {
2380
2380
  const t = D.parse(i).filter((n) => n.tagName === "graph")[0], e = t.attributes.type;
2381
2381
  if (!e)
2382
2382
  throw new Error(`${e} is not a valid graph`);
2383
- const s = ut[e];
2383
+ const s = dt[e];
2384
2384
  if (!s)
2385
2385
  throw new Error(`${e} not found as a GraphModel`);
2386
2386
  return new s(e, t);
2387
2387
  };
2388
- class ue {
2388
+ class de {
2389
2389
  constructor({ name: t, axis: e }) {
2390
2390
  r(this, "_name");
2391
2391
  r(this, "_axis");
@@ -2398,7 +2398,7 @@ class ue {
2398
2398
  return this._axis;
2399
2399
  }
2400
2400
  }
2401
- class dt extends ue {
2401
+ class ut extends de {
2402
2402
  constructor({
2403
2403
  name: e,
2404
2404
  operator: s,
@@ -2421,7 +2421,7 @@ class dt extends ue {
2421
2421
  return this._stacked;
2422
2422
  }
2423
2423
  }
2424
- class ht extends ue {
2424
+ class ht extends de {
2425
2425
  constructor({ name: t }) {
2426
2426
  super({ name: t, axis: "x" });
2427
2427
  }
@@ -2479,15 +2479,15 @@ function gt({
2479
2479
  groupBy: "type-stacked"
2480
2480
  }), a = `${t}s`;
2481
2481
  return Object.keys(n).forEach((o) => {
2482
- const u = n[o];
2483
- for (let _ = 0; _ < u.length; _++) {
2484
- const h = u[_];
2485
- if (s.push(h), _ === u.length - 1)
2482
+ const d = n[o];
2483
+ for (let _ = 0; _ < d.length; _++) {
2484
+ const h = d[_];
2485
+ if (s.push(h), _ === d.length - 1)
2486
2486
  return;
2487
- const d = h.x, g = u[_ + 1].x;
2488
- if (!de([d, g], a)) {
2487
+ const u = h.x, g = d[_ + 1].x;
2488
+ if (!ue([u, g], a)) {
2489
2489
  const c = mt({
2490
- dates: [d, g],
2490
+ dates: [u, g],
2491
2491
  timerange: t,
2492
2492
  interval: e
2493
2493
  });
@@ -2501,7 +2501,7 @@ function gt({
2501
2501
  );
2502
2502
  }
2503
2503
  }
2504
- }), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
2504
+ }), s.sort((o, d) => o.x < d.x ? -1 : o.x > d.x ? 1 : 0);
2505
2505
  }
2506
2506
  function mt({
2507
2507
  dates: i,
@@ -2513,12 +2513,12 @@ function mt({
2513
2513
  return i;
2514
2514
  const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
2515
2515
  for (let l = 0; l < a.length - 1; l++) {
2516
- const o = a[l], u = a[l + 1];
2517
- if (!de([o, u], n)) {
2516
+ const o = a[l], d = a[l + 1];
2517
+ if (!ue([o, d], n)) {
2518
2518
  const _ = T(o, S(n)).add(
2519
2519
  e,
2520
2520
  n
2521
- ), h = T(u, S(n));
2521
+ ), h = T(d, S(n));
2522
2522
  for (; _.isBefore(h); )
2523
2523
  s.push(_.format(S(n))), _.add(e, n);
2524
2524
  }
@@ -2537,13 +2537,13 @@ function bt({
2537
2537
  groupBy: "all"
2538
2538
  });
2539
2539
  return Object.keys(n).forEach((a) => {
2540
- const l = n[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = Y({
2540
+ const l = n[a], o = l[0].operator === "count" ? "+" : l[0].operator, d = Y({
2541
2541
  values: l.map((_) => _.value),
2542
2542
  operator: o
2543
2543
  });
2544
2544
  s.push({
2545
2545
  ...l[0],
2546
- value: u
2546
+ value: d
2547
2547
  });
2548
2548
  }), s;
2549
2549
  }
@@ -2592,7 +2592,7 @@ function pt({
2592
2592
  function xt(i) {
2593
2593
  return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
2594
2594
  }
2595
- function de(i, t) {
2595
+ function ue(i, t) {
2596
2596
  let e = !1;
2597
2597
  const s = S(t);
2598
2598
  if (i.length === 0)
@@ -2704,21 +2704,21 @@ const wt = {
2704
2704
  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(
2705
2705
  (c) => c.x !== !1
2706
2706
  ));
2707
- let d = h;
2708
- i.timerange ? d = ft({
2709
- values: d,
2707
+ let u = h;
2708
+ i.timerange ? u = ft({
2709
+ values: u,
2710
2710
  timerange: i.timerange,
2711
2711
  interval: i.interval
2712
- }) : i.type == "pie" && (d = h.sort((c, b) => b.value - c.value));
2712
+ }) : i.type == "pie" && (u = h.sort((c, b) => b.value - c.value));
2713
2713
  const g = {
2714
- data: d,
2714
+ data: u,
2715
2715
  isGroup: o || l,
2716
2716
  isStack: o
2717
2717
  };
2718
2718
  if (i.type === "line" && i.y_range && (g.yAxisOpts = {
2719
2719
  mode: i.y_range
2720
2720
  }, i.y_range === "auto")) {
2721
- const { min: c, max: b } = fe(d);
2721
+ const { min: c, max: b } = fe(u);
2722
2722
  g.yAxisOpts.valueOpts = { min: c, max: b };
2723
2723
  }
2724
2724
  return g;
@@ -2845,12 +2845,12 @@ export {
2845
2845
  Ee as FloatTime,
2846
2846
  Tt as Form,
2847
2847
  oe as Graph,
2848
- ue as GraphAxis,
2848
+ de as GraphAxis,
2849
2849
  j as GraphChart,
2850
2850
  ce as GraphIndicator,
2851
2851
  ot as GraphIndicatorField,
2852
2852
  ht as GraphXAxis,
2853
- dt as GraphYAxis,
2853
+ ut as GraphYAxis,
2854
2854
  Oe as Group,
2855
2855
  Se as HTMLPreview,
2856
2856
  Ne as Image,